summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/x509/x509.h
diff options
context:
space:
mode:
authortb <>2018-05-30 15:59:33 +0000
committertb <>2018-05-30 15:59:33 +0000
commit60382f7d19bb7b7087eb92001a800a712bcc4f4a (patch)
tree1da781cec26d49a1339bb21bf801177950d2a9e3 /src/lib/libcrypto/x509/x509.h
parentab8347d6b3d1d095f308d5d9bde3c6bc7e2a6db6 (diff)
downloadopenbsd-60382f7d19bb7b7087eb92001a800a712bcc4f4a.tar.gz
openbsd-60382f7d19bb7b7087eb92001a800a712bcc4f4a.tar.bz2
openbsd-60382f7d19bb7b7087eb92001a800a712bcc4f4a.zip
Add const to both arguments of X509_certificate_type() and clean up
a little: Use X509_get0_pubkey() in place of X509_get_pubkey() and EVP_PKEY_free(). Check return value of the former in the appropriate place and simplify the logic for dealing with the potentially NULL pkey argument (includes a neat tweak from jsing). Finally, kill an ugly comment that has been rotting for twenty years and merge the lines around it. tested in a bulk build by sthen ok jsing
Diffstat (limited to 'src/lib/libcrypto/x509/x509.h')
-rw-r--r--src/lib/libcrypto/x509/x509.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/libcrypto/x509/x509.h b/src/lib/libcrypto/x509/x509.h
index 29e00d7a5b..ed6225997a 100644
--- a/src/lib/libcrypto/x509/x509.h
+++ b/src/lib/libcrypto/x509/x509.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509.h,v 1.68 2018/05/30 15:35:45 tb Exp $ */ 1/* $OpenBSD: x509.h,v 1.69 2018/05/30 15:59:33 tb Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -1002,7 +1002,7 @@ int X509_set_pubkey(X509 *x, EVP_PKEY *pkey);
1002EVP_PKEY * X509_get_pubkey(X509 *x); 1002EVP_PKEY * X509_get_pubkey(X509 *x);
1003EVP_PKEY * X509_get0_pubkey(const X509 *x); 1003EVP_PKEY * X509_get0_pubkey(const X509 *x);
1004ASN1_BIT_STRING *X509_get0_pubkey_bitstr(const X509 *x); 1004ASN1_BIT_STRING *X509_get0_pubkey_bitstr(const X509 *x);
1005int X509_certificate_type(X509 *x,EVP_PKEY *pubkey /* optional */); 1005int X509_certificate_type(const X509 *x, const EVP_PKEY *pubkey);
1006 1006
1007int X509_REQ_set_version(X509_REQ *x,long version); 1007int X509_REQ_set_version(X509_REQ *x,long version);
1008int X509_REQ_set_subject_name(X509_REQ *req,X509_NAME *name); 1008int X509_REQ_set_subject_name(X509_REQ *req,X509_NAME *name);