X-Git-Url: https://git.openssl.org/?p=openssl.git;a=blobdiff_plain;f=crypto%2Fx509%2Fx_pubkey.c;h=55d5594b036047561b45c3cdf5de0e8ac5a9e8d6;hp=158d1d26aff3c01f5989ffb88713b08778862827;hb=29fa0a1af45a1037850b29f5851f4a054124781b;hpb=91829e456c998eb9c2e565307b8f1022481049ce;ds=sidebyside diff --git a/crypto/x509/x_pubkey.c b/crypto/x509/x_pubkey.c index 158d1d26af..55d5594b03 100644 --- a/crypto/x509/x_pubkey.c +++ b/crypto/x509/x_pubkey.c @@ -61,9 +61,17 @@ #include #include "internal/asn1_int.h" #include "internal/evp_int.h" +#include "internal/x509_int.h" #include #include +struct X509_pubkey_st { + X509_ALGOR *algor; + ASN1_BIT_STRING *public_key; + EVP_PKEY *pkey; + CRYPTO_RWLOCK *lock; +}; + /* Minor tweak to operation: free up EVP_PKEY */ static int pubkey_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it, void *exarg) @@ -375,3 +383,10 @@ int X509_PUBKEY_get0_param(ASN1_OBJECT **ppkalg, *pa = pub->algor; return 1; } + +ASN1_BIT_STRING *X509_get0_pubkey_bitstr(const X509 *x) +{ + if (x == NULL) + return NULL; + return x->cert_info.key->public_key; +}