mirror of
https://github.com/postgres/postgres.git
synced 2025-10-25 13:17:41 +03:00
Implement channel binding tls-server-end-point for SCRAM
This adds a second standard channel binding type for SCRAM. It is mainly intended for third-party clients that cannot implement tls-unique, for example JDBC. Author: Michael Paquier <michael.paquier@gmail.com>
This commit is contained in:
@@ -444,6 +444,21 @@ build_client_final_message(fe_scram_state *state)
|
||||
cbind_data = pgtls_get_finished(state->conn, &cbind_data_len);
|
||||
if (cbind_data == NULL)
|
||||
goto oom_error;
|
||||
#endif
|
||||
}
|
||||
else if (strcmp(conn->scram_channel_binding,
|
||||
SCRAM_CHANNEL_BINDING_TLS_END_POINT) == 0)
|
||||
{
|
||||
/* Fetch hash data of server's SSL certificate */
|
||||
#ifdef USE_SSL
|
||||
cbind_data =
|
||||
pgtls_get_peer_certificate_hash(state->conn,
|
||||
&cbind_data_len);
|
||||
if (cbind_data == NULL)
|
||||
{
|
||||
/* error message is already set on error */
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user