From: tb Date: Thu, 21 Oct 2021 13:02:00 +0000 (+0000) Subject: Prepare to provide X509_get_X509_PUBKEY() as a function. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=1675412615b1f35e3cc0367dde53aaf5794b8078;p=openbsd Prepare to provide X509_get_X509_PUBKEY() as a function. ok jsing --- diff --git a/lib/libcrypto/x509/x509.h b/lib/libcrypto/x509/x509.h index 5b25c6e4b1a..a3d17a426b2 100644 --- a/lib/libcrypto/x509/x509.h +++ b/lib/libcrypto/x509/x509.h @@ -1,4 +1,4 @@ -/* $OpenBSD: x509.h,v 1.76 2021/09/02 12:41:44 job Exp $ */ +/* $OpenBSD: x509.h,v 1.77 2021/10/21 13:02:00 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -621,9 +621,11 @@ void X509_CRL_METHOD_free(X509_CRL_METHOD *m); void X509_CRL_set_meth_data(X509_CRL *crl, void *dat); void *X509_CRL_get_meth_data(X509_CRL *crl); -/* This one is only used so that a binary form can output, as in - * i2d_X509_NAME(X509_get_X509_PUBKEY(x),&buf) */ -#define X509_get_X509_PUBKEY(x) ((x)->cert_info->key) +#if defined(LIBRESSL_NEW_API) +X509_PUBKEY *X509_get_X509_PUBKEY(const X509 *x); +#else +#define X509_get_X509_PUBKEY(x) (x)->cert_info->key +#endif const char *X509_verify_cert_error_string(long n); diff --git a/lib/libcrypto/x509/x509_set.c b/lib/libcrypto/x509/x509_set.c index 1a4b583ab72..e086c021cd0 100644 --- a/lib/libcrypto/x509/x509_set.c +++ b/lib/libcrypto/x509/x509_set.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x509_set.c,v 1.17 2018/08/24 19:55:58 tb Exp $ */ +/* $OpenBSD: x509_set.c,v 1.18 2021/10/21 13:02:01 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -216,3 +216,11 @@ X509_get_signature_type(const X509 *x) { return EVP_PKEY_type(OBJ_obj2nid(x->sig_alg->algorithm)); } + +#if defined(LIBRESSL_NEW_API) +X509_PUBKEY * +X509_get_X509_PUBKEY(const X509 *x) +{ + return x->cert_info->key; +} +#endif