diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2016-03-22 13:16:42 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2016-03-22 15:28:11 +0000 |
commit | 29fa0a1af45a1037850b29f5851f4a054124781b (patch) | |
tree | 15f8e47117a0b14782700d6d9feab7fa2a71af1b /crypto/x509 | |
parent | 91829e456c998eb9c2e565307b8f1022481049ce (diff) | |
download | openssl-29fa0a1af45a1037850b29f5851f4a054124781b.tar.gz |
Make X509_PUBKEY opaque
Reviewed-by: Matt Caswell <matt@openssl.org>
Diffstat (limited to 'crypto/x509')
-rw-r--r-- | crypto/x509/x509_cmp.c | 7 | ||||
-rw-r--r-- | crypto/x509/x_pubkey.c | 15 |
2 files changed, 15 insertions, 7 deletions
diff --git a/crypto/x509/x509_cmp.c b/crypto/x509/x509_cmp.c index 69a3fb39a2..d3b2c199b9 100644 --- a/crypto/x509/x509_cmp.c +++ b/crypto/x509/x509_cmp.c @@ -318,13 +318,6 @@ EVP_PKEY *X509_get_pubkey(X509 *x) return X509_PUBKEY_get(x->cert_info.key); } -ASN1_BIT_STRING *X509_get0_pubkey_bitstr(const X509 *x) -{ - if (!x) - return NULL; - return x->cert_info.key->public_key; -} - int X509_check_private_key(X509 *x, EVP_PKEY *k) { EVP_PKEY *xk; 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 <openssl/x509.h> #include "internal/asn1_int.h" #include "internal/evp_int.h" +#include "internal/x509_int.h" #include <openssl/rsa.h> #include <openssl/dsa.h> +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; +} |