Commit ac3ff8b1 authored by Peter Eisentraut's avatar Peter Eisentraut

Fix build with older OpenSSL versions

Apparently, X509_get_signature_nid() is only in fairly new OpenSSL
versions, so use the lower-level interface it is built on instead.
parent 18869e20
...@@ -1265,7 +1265,7 @@ be_tls_get_certificate_hash(Port *port, size_t *len) ...@@ -1265,7 +1265,7 @@ be_tls_get_certificate_hash(Port *port, size_t *len)
* Get the signature algorithm of the certificate to determine the * Get the signature algorithm of the certificate to determine the
* hash algorithm to use for the result. * hash algorithm to use for the result.
*/ */
if (!OBJ_find_sigid_algs(X509_get_signature_nid(server_cert), if (!OBJ_find_sigid_algs(OBJ_obj2nid(server_cert->sig_alg->algorithm),
&algo_nid, NULL)) &algo_nid, NULL))
elog(ERROR, "could not determine server certificate signature algorithm"); elog(ERROR, "could not determine server certificate signature algorithm");
......
...@@ -447,7 +447,7 @@ pgtls_get_peer_certificate_hash(PGconn *conn, size_t *len) ...@@ -447,7 +447,7 @@ pgtls_get_peer_certificate_hash(PGconn *conn, size_t *len)
* Get the signature algorithm of the certificate to determine the hash * Get the signature algorithm of the certificate to determine the hash
* algorithm to use for the result. * algorithm to use for the result.
*/ */
if (!OBJ_find_sigid_algs(X509_get_signature_nid(peer_cert), if (!OBJ_find_sigid_algs(OBJ_obj2nid(peer_cert->sig_alg->algorithm),
&algo_nid, NULL)) &algo_nid, NULL))
{ {
printfPQExpBuffer(&conn->errorMessage, printfPQExpBuffer(&conn->errorMessage,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment