diff options
author | 2018-03-17 14:57:23 +0000 | |
---|---|---|
committer | 2018-03-17 14:57:23 +0000 | |
commit | 6bd828a609c20de7ebcf0cf4c52d66518e8004cc (patch) | |
tree | c314d4c5a7d1711c7ecf5de140081228a2c8bac7 /lib | |
parent | Provide X509_PUBKEY_get0() by splitting X509_PUBKEY_get() and turning it (diff) | |
download | wireguard-openbsd-6bd828a609c20de7ebcf0cf4c52d66518e8004cc.tar.xz wireguard-openbsd-6bd828a609c20de7ebcf0cf4c52d66518e8004cc.zip |
Fix X509_get0_pubkey() - X509_get_pubkey() is a misnamed "get1" function,
so call X509_PUBKEY_get0() instead.
Spotted by schwarze@ while documenting.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libcrypto/x509/x509_cmp.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/libcrypto/x509/x509_cmp.c b/lib/libcrypto/x509/x509_cmp.c index 001f98e61a4..ab0dbcba39d 100644 --- a/lib/libcrypto/x509/x509_cmp.c +++ b/lib/libcrypto/x509/x509_cmp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x509_cmp.c,v 1.29 2018/02/22 17:22:02 jsing Exp $ */ +/* $OpenBSD: x509_cmp.c,v 1.30 2018/03/17 14:57:23 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -329,7 +329,9 @@ X509_get_pubkey(X509 *x) EVP_PKEY * X509_get0_pubkey(X509 *x) { - return X509_get_pubkey(x); + if (x == NULL || x->cert_info == NULL) + return (NULL); + return (X509_PUBKEY_get0(x->cert_info->key)); } ASN1_BIT_STRING * |