Skip to content

Commit ac3ff8b

Browse files
committed
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.
1 parent 18869e2 commit ac3ff8b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/backend/libpq/be-secure-openssl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1265,7 +1265,7 @@ be_tls_get_certificate_hash(Port *port, size_t *len)
12651265
* Get the signature algorithm of the certificate to determine the
12661266
* hash algorithm to use for the result.
12671267
*/
1268-
if (!OBJ_find_sigid_algs(X509_get_signature_nid(server_cert),
1268+
if (!OBJ_find_sigid_algs(OBJ_obj2nid(server_cert->sig_alg->algorithm),
12691269
&algo_nid, NULL))
12701270
elog(ERROR, "could not determine server certificate signature algorithm");
12711271

src/interfaces/libpq/fe-secure-openssl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ pgtls_get_peer_certificate_hash(PGconn *conn, size_t *len)
447447
* Get the signature algorithm of the certificate to determine the hash
448448
* algorithm to use for the result.
449449
*/
450-
if (!OBJ_find_sigid_algs(X509_get_signature_nid(peer_cert),
450+
if (!OBJ_find_sigid_algs(OBJ_obj2nid(peer_cert->sig_alg->algorithm),
451451
&algo_nid, NULL))
452452
{
453453
printfPQExpBuffer(&conn->errorMessage,

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy