summaryrefslogtreecommitdiff
path: root/lib/libcrypto
diff options
context:
space:
mode:
authorJoel Sing <jsing@cvs.openbsd.org>2018-03-17 14:57:24 +0000
committerJoel Sing <jsing@cvs.openbsd.org>2018-03-17 14:57:24 +0000
commitfac29d99784fea682fff2e8afc4c3145c9117f39 (patch)
tree87f4f76b094d7fb9459471a92e1bf5c67c5dd1ef /lib/libcrypto
parent7292e5c64a059d98bc6cf4ed1f4bf27c124f2a17 (diff)
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/libcrypto')
-rw-r--r--lib/libcrypto/x509/x509_cmp.c6
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 *