summaryrefslogtreecommitdiffstats
path: root/crypto/ec
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2016-08-16 14:06:48 +0100
committerDr. Stephen Henson <steve@openssl.org>2016-08-16 16:05:35 +0100
commit17ebf85abda18c3875b1ba6670fe7b393bc1f297 (patch)
tree224f98559daf13f77b4526df0a24a3ab1675f685 /crypto/ec
parent1940aa6e6b51147df10a5bffcaaa2b9904209184 (diff)
Add ASN1_STRING_get0_data(), deprecate ASN1_STRING_data().
Deprecate the function ASN1_STRING_data() and replace with a new function ASN1_STRING_get0_data() which returns a constant pointer. Update library to use new function. Reviewed-by: Rich Salz <rsalz@openssl.org>
Diffstat (limited to 'crypto/ec')
-rw-r--r--crypto/ec/ec_ameth.c2
-rw-r--r--crypto/ec/ec_asn1.c4
-rw-r--r--crypto/ec/ecx_meth.c2
3 files changed, 4 insertions, 4 deletions
diff --git a/crypto/ec/ec_ameth.c b/crypto/ec/ec_ameth.c
index f6a3f5c15f..44dfbb4ae6 100644
--- a/crypto/ec/ec_ameth.c
+++ b/crypto/ec/ec_ameth.c
@@ -593,7 +593,7 @@ static int ecdh_cms_set_peerkey(EVP_PKEY_CTX *pctx,
}
/* We have parameters now set public key */
plen = ASN1_STRING_length(pubkey);
- p = ASN1_STRING_data(pubkey);
+ p = ASN1_STRING_get0_data(pubkey);
if (!p || !plen)
goto err;
if (!o2i_ECPublicKey(&ecpeer, &p, plen))
diff --git a/crypto/ec/ec_asn1.c b/crypto/ec/ec_asn1.c
index 8714a4b1d8..e10deff165 100644
--- a/crypto/ec/ec_asn1.c
+++ b/crypto/ec/ec_asn1.c
@@ -948,7 +948,7 @@ EC_KEY *d2i_ECPrivateKey(EC_KEY **a, const unsigned char **in, long len)
if (priv_key->privateKey) {
ASN1_OCTET_STRING *pkey = priv_key->privateKey;
- if (EC_KEY_oct2priv(ret, ASN1_STRING_data(pkey),
+ if (EC_KEY_oct2priv(ret, ASN1_STRING_get0_data(pkey),
ASN1_STRING_length(pkey)) == 0)
goto err;
} else {
@@ -967,7 +967,7 @@ EC_KEY *d2i_ECPrivateKey(EC_KEY **a, const unsigned char **in, long len)
const unsigned char *pub_oct;
int pub_oct_len;
- pub_oct = ASN1_STRING_data(priv_key->publicKey);
+ pub_oct = ASN1_STRING_get0_data(priv_key->publicKey);
pub_oct_len = ASN1_STRING_length(priv_key->publicKey);
if (!EC_KEY_oct2key(ret, pub_oct, pub_oct_len, NULL)) {
ECerr(EC_F_D2I_ECPRIVATEKEY, ERR_R_EC_LIB);
diff --git a/crypto/ec/ecx_meth.c b/crypto/ec/ecx_meth.c
index 354d387946..f7179511dd 100644
--- a/crypto/ec/ecx_meth.c
+++ b/crypto/ec/ecx_meth.c
@@ -151,7 +151,7 @@ static int ecx_priv_decode(EVP_PKEY *pkey, PKCS8_PRIV_KEY_INFO *p8)
p = NULL;
plen = 0;
} else {
- p = ASN1_STRING_data(oct);
+ p = ASN1_STRING_get0_data(oct);
plen = ASN1_STRING_length(oct);
}