diff options
author | jsing <> | 2014-04-23 12:42:16 +0000 |
---|---|---|
committer | jsing <> | 2014-04-23 12:42:16 +0000 |
commit | bef35d38b7cc486e4c4a429c36326b26d4fbf2aa (patch) | |
tree | 7240e5bc40500698b833e57621dd57447acf9307 /src | |
parent | 7590e2c6d967f068851564b3c86e9e2a5086ecf8 (diff) | |
download | openbsd-bef35d38b7cc486e4c4a429c36326b26d4fbf2aa.tar.gz openbsd-bef35d38b7cc486e4c4a429c36326b26d4fbf2aa.tar.bz2 openbsd-bef35d38b7cc486e4c4a429c36326b26d4fbf2aa.zip |
Casting from a const unsigned char ** to a const unsigned char ** seems...
unnecessary. Remove the temporary ugly casts - the comments even call them
that!
ok guenther@
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/libcrypto/asn1/d2i_pu.c | 12 | ||||
-rw-r--r-- | src/lib/libssl/src/crypto/asn1/d2i_pu.c | 12 |
2 files changed, 8 insertions, 16 deletions
diff --git a/src/lib/libcrypto/asn1/d2i_pu.c b/src/lib/libcrypto/asn1/d2i_pu.c index 564f0945b5..d0c2cecd7d 100644 --- a/src/lib/libcrypto/asn1/d2i_pu.c +++ b/src/lib/libcrypto/asn1/d2i_pu.c | |||
@@ -93,9 +93,8 @@ d2i_PublicKey(int type, EVP_PKEY **a, const unsigned char **pp, long length) | |||
93 | switch (EVP_PKEY_id(ret)) { | 93 | switch (EVP_PKEY_id(ret)) { |
94 | #ifndef OPENSSL_NO_RSA | 94 | #ifndef OPENSSL_NO_RSA |
95 | case EVP_PKEY_RSA: | 95 | case EVP_PKEY_RSA: |
96 | if ((ret->pkey.rsa = d2i_RSAPublicKey(NULL, | 96 | if ((ret->pkey.rsa = d2i_RSAPublicKey(NULL, pp, length)) == |
97 | (const unsigned char **)pp,length)) == NULL) /* TMP UGLY CAST */ | 97 | NULL) { |
98 | { | ||
99 | ASN1err(ASN1_F_D2I_PUBLICKEY, ERR_R_ASN1_LIB); | 98 | ASN1err(ASN1_F_D2I_PUBLICKEY, ERR_R_ASN1_LIB); |
100 | goto err; | 99 | goto err; |
101 | } | 100 | } |
@@ -103,9 +102,7 @@ d2i_PublicKey(int type, EVP_PKEY **a, const unsigned char **pp, long length) | |||
103 | #endif | 102 | #endif |
104 | #ifndef OPENSSL_NO_DSA | 103 | #ifndef OPENSSL_NO_DSA |
105 | case EVP_PKEY_DSA: | 104 | case EVP_PKEY_DSA: |
106 | if (!d2i_DSAPublicKey(&(ret->pkey.dsa), | 105 | if (!d2i_DSAPublicKey(&(ret->pkey.dsa), pp, length)) { |
107 | (const unsigned char **)pp,length)) /* TMP UGLY CAST */ | ||
108 | { | ||
109 | ASN1err(ASN1_F_D2I_PUBLICKEY, ERR_R_ASN1_LIB); | 106 | ASN1err(ASN1_F_D2I_PUBLICKEY, ERR_R_ASN1_LIB); |
110 | goto err; | 107 | goto err; |
111 | } | 108 | } |
@@ -113,8 +110,7 @@ d2i_PublicKey(int type, EVP_PKEY **a, const unsigned char **pp, long length) | |||
113 | #endif | 110 | #endif |
114 | #ifndef OPENSSL_NO_EC | 111 | #ifndef OPENSSL_NO_EC |
115 | case EVP_PKEY_EC: | 112 | case EVP_PKEY_EC: |
116 | if (!o2i_ECPublicKey(&(ret->pkey.ec), | 113 | if (!o2i_ECPublicKey(&(ret->pkey.ec), pp, length)) { |
117 | (const unsigned char **)pp, length)) { | ||
118 | ASN1err(ASN1_F_D2I_PUBLICKEY, ERR_R_ASN1_LIB); | 114 | ASN1err(ASN1_F_D2I_PUBLICKEY, ERR_R_ASN1_LIB); |
119 | goto err; | 115 | goto err; |
120 | } | 116 | } |
diff --git a/src/lib/libssl/src/crypto/asn1/d2i_pu.c b/src/lib/libssl/src/crypto/asn1/d2i_pu.c index 564f0945b5..d0c2cecd7d 100644 --- a/src/lib/libssl/src/crypto/asn1/d2i_pu.c +++ b/src/lib/libssl/src/crypto/asn1/d2i_pu.c | |||
@@ -93,9 +93,8 @@ d2i_PublicKey(int type, EVP_PKEY **a, const unsigned char **pp, long length) | |||
93 | switch (EVP_PKEY_id(ret)) { | 93 | switch (EVP_PKEY_id(ret)) { |
94 | #ifndef OPENSSL_NO_RSA | 94 | #ifndef OPENSSL_NO_RSA |
95 | case EVP_PKEY_RSA: | 95 | case EVP_PKEY_RSA: |
96 | if ((ret->pkey.rsa = d2i_RSAPublicKey(NULL, | 96 | if ((ret->pkey.rsa = d2i_RSAPublicKey(NULL, pp, length)) == |
97 | (const unsigned char **)pp,length)) == NULL) /* TMP UGLY CAST */ | 97 | NULL) { |
98 | { | ||
99 | ASN1err(ASN1_F_D2I_PUBLICKEY, ERR_R_ASN1_LIB); | 98 | ASN1err(ASN1_F_D2I_PUBLICKEY, ERR_R_ASN1_LIB); |
100 | goto err; | 99 | goto err; |
101 | } | 100 | } |
@@ -103,9 +102,7 @@ d2i_PublicKey(int type, EVP_PKEY **a, const unsigned char **pp, long length) | |||
103 | #endif | 102 | #endif |
104 | #ifndef OPENSSL_NO_DSA | 103 | #ifndef OPENSSL_NO_DSA |
105 | case EVP_PKEY_DSA: | 104 | case EVP_PKEY_DSA: |
106 | if (!d2i_DSAPublicKey(&(ret->pkey.dsa), | 105 | if (!d2i_DSAPublicKey(&(ret->pkey.dsa), pp, length)) { |
107 | (const unsigned char **)pp,length)) /* TMP UGLY CAST */ | ||
108 | { | ||
109 | ASN1err(ASN1_F_D2I_PUBLICKEY, ERR_R_ASN1_LIB); | 106 | ASN1err(ASN1_F_D2I_PUBLICKEY, ERR_R_ASN1_LIB); |
110 | goto err; | 107 | goto err; |
111 | } | 108 | } |
@@ -113,8 +110,7 @@ d2i_PublicKey(int type, EVP_PKEY **a, const unsigned char **pp, long length) | |||
113 | #endif | 110 | #endif |
114 | #ifndef OPENSSL_NO_EC | 111 | #ifndef OPENSSL_NO_EC |
115 | case EVP_PKEY_EC: | 112 | case EVP_PKEY_EC: |
116 | if (!o2i_ECPublicKey(&(ret->pkey.ec), | 113 | if (!o2i_ECPublicKey(&(ret->pkey.ec), pp, length)) { |
117 | (const unsigned char **)pp, length)) { | ||
118 | ASN1err(ASN1_F_D2I_PUBLICKEY, ERR_R_ASN1_LIB); | 114 | ASN1err(ASN1_F_D2I_PUBLICKEY, ERR_R_ASN1_LIB); |
119 | goto err; | 115 | goto err; |
120 | } | 116 | } |