diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2016-01-19 00:21:12 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2016-01-20 03:24:59 +0000 |
commit | 3aeb93486588e7dd01379c50b8fd496d55cf8858 (patch) | |
tree | e5d5793ef4786dbfac5c724e8235a3aa1ce323b2 /crypto/asn1 | |
parent | a8eda4312db1f98cffda38670e2d40d36566785a (diff) | |
download | openssl-3aeb93486588e7dd01379c50b8fd496d55cf8858.zip openssl-3aeb93486588e7dd01379c50b8fd496d55cf8858.tar.gz openssl-3aeb93486588e7dd01379c50b8fd496d55cf8858.tar.bz2 |
make EVP_PKEY opaque
Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'crypto/asn1')
-rw-r--r-- | crypto/asn1/a_verify.c | 1 | ||||
-rw-r--r-- | crypto/asn1/ameth_lib.c | 1 | ||||
-rw-r--r-- | crypto/asn1/d2i_pr.c | 1 | ||||
-rw-r--r-- | crypto/asn1/d2i_pu.c | 13 | ||||
-rw-r--r-- | crypto/asn1/i2d_pr.c | 1 | ||||
-rw-r--r-- | crypto/asn1/i2d_pu.c | 10 | ||||
-rw-r--r-- | crypto/asn1/x_pubkey.c | 1 |
7 files changed, 15 insertions, 13 deletions
diff --git a/crypto/asn1/a_verify.c b/crypto/asn1/a_verify.c index 4acee3e..2ec8430 100644 --- a/crypto/asn1/a_verify.c +++ b/crypto/asn1/a_verify.c @@ -71,6 +71,7 @@ #include <openssl/buffer.h> #include <openssl/evp.h> #include "internal/asn1_int.h" +#include "internal/evp_int.h" #ifndef NO_ASN1_OLD diff --git a/crypto/asn1/ameth_lib.c b/crypto/asn1/ameth_lib.c index a932028..8458e81 100644 --- a/crypto/asn1/ameth_lib.c +++ b/crypto/asn1/ameth_lib.c @@ -64,6 +64,7 @@ # include <openssl/engine.h> #endif #include "internal/asn1_int.h" +#include "internal/evp_int.h" /* Keep this sorted in type order !! */ static const EVP_PKEY_ASN1_METHOD *standard_methods[] = { diff --git a/crypto/asn1/d2i_pr.c b/crypto/asn1/d2i_pr.c index 1b6f8eb..02efa83 100644 --- a/crypto/asn1/d2i_pr.c +++ b/crypto/asn1/d2i_pr.c @@ -67,6 +67,7 @@ #include <openssl/x509.h> #include <openssl/asn1.h> #include "internal/asn1_int.h" +#include "internal/evp_int.h" EVP_PKEY *d2i_PrivateKey(int type, EVP_PKEY **a, const unsigned char **pp, long length) diff --git a/crypto/asn1/d2i_pu.c b/crypto/asn1/d2i_pu.c index 11176f0..1b29f1c 100644 --- a/crypto/asn1/d2i_pu.c +++ b/crypto/asn1/d2i_pu.c @@ -72,6 +72,8 @@ # include <openssl/ec.h> #endif +#include "internal/evp_int.h" + EVP_PKEY *d2i_PublicKey(int type, EVP_PKEY **a, const unsigned char **pp, long length) { @@ -93,10 +95,7 @@ EVP_PKEY *d2i_PublicKey(int type, EVP_PKEY **a, const unsigned char **pp, switch (EVP_PKEY_id(ret)) { #ifndef OPENSSL_NO_RSA case EVP_PKEY_RSA: - /* TMP UGLY CAST */ - if ((ret->pkey.rsa = d2i_RSAPublicKey(NULL, - (const unsigned char **)pp, - length)) == NULL) { + if ((ret->pkey.rsa = d2i_RSAPublicKey(NULL, pp, length)) == NULL) { ASN1err(ASN1_F_D2I_PUBLICKEY, ERR_R_ASN1_LIB); goto err; } @@ -105,8 +104,7 @@ EVP_PKEY *d2i_PublicKey(int type, EVP_PKEY **a, const unsigned char **pp, #ifndef OPENSSL_NO_DSA case EVP_PKEY_DSA: /* TMP UGLY CAST */ - if (!d2i_DSAPublicKey(&(ret->pkey.dsa), - (const unsigned char **)pp, length)) { + if (!d2i_DSAPublicKey(&ret->pkey.dsa, pp, length)) { ASN1err(ASN1_F_D2I_PUBLICKEY, ERR_R_ASN1_LIB); goto err; } @@ -114,8 +112,7 @@ EVP_PKEY *d2i_PublicKey(int type, EVP_PKEY **a, const unsigned char **pp, #endif #ifndef OPENSSL_NO_EC case EVP_PKEY_EC: - if (!o2i_ECPublicKey(&(ret->pkey.ec), - (const unsigned char **)pp, length)) { + if (!o2i_ECPublicKey(&ret->pkey.ec, pp, length)) { ASN1err(ASN1_F_D2I_PUBLICKEY, ERR_R_ASN1_LIB); goto err; } diff --git a/crypto/asn1/i2d_pr.c b/crypto/asn1/i2d_pr.c index 54a3d7b..b7dfb65 100644 --- a/crypto/asn1/i2d_pr.c +++ b/crypto/asn1/i2d_pr.c @@ -61,6 +61,7 @@ #include <openssl/evp.h> #include <openssl/x509.h> #include "internal/asn1_int.h" +#include "internal/evp_int.h" int i2d_PrivateKey(EVP_PKEY *a, unsigned char **pp) { diff --git a/crypto/asn1/i2d_pu.c b/crypto/asn1/i2d_pu.c index e1f702a..94233cb 100644 --- a/crypto/asn1/i2d_pu.c +++ b/crypto/asn1/i2d_pu.c @@ -73,21 +73,21 @@ int i2d_PublicKey(EVP_PKEY *a, unsigned char **pp) { - switch (a->type) { + switch (EVP_PKEY_id(a)) { #ifndef OPENSSL_NO_RSA case EVP_PKEY_RSA: - return (i2d_RSAPublicKey(a->pkey.rsa, pp)); + return i2d_RSAPublicKey(EVP_PKEY_get0_RSA(a), pp); #endif #ifndef OPENSSL_NO_DSA case EVP_PKEY_DSA: - return (i2d_DSAPublicKey(a->pkey.dsa, pp)); + return i2d_DSAPublicKey(EVP_PKEY_get0_DSA(a), pp); #endif #ifndef OPENSSL_NO_EC case EVP_PKEY_EC: - return (i2o_ECPublicKey(a->pkey.ec, pp)); + return i2o_ECPublicKey(EVP_PKEY_get0_EC_KEY(a), pp); #endif default: ASN1err(ASN1_F_I2D_PUBLICKEY, ASN1_R_UNSUPPORTED_PUBLIC_KEY_TYPE); - return (-1); + return -1; } } diff --git a/crypto/asn1/x_pubkey.c b/crypto/asn1/x_pubkey.c index 36a130d..baa34f0 100644 --- a/crypto/asn1/x_pubkey.c +++ b/crypto/asn1/x_pubkey.c @@ -61,6 +61,7 @@ #include <openssl/asn1t.h> #include <openssl/x509.h> #include "internal/asn1_int.h" +#include "internal/evp_int.h" #ifndef OPENSSL_NO_RSA # include <openssl/rsa.h> #endif |