diff options
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 4acee3eb84..2ec84309b9 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 a932028911..8458e811c9 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 1b6f8ebe40..02efa83583 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 11176f0e16..1b29f1c7f1 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 54a3d7b4bd..b7dfb65a31 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 e1f702acd8..94233cb8e9 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 36a130d6aa..baa34f0c9b 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 |