summaryrefslogtreecommitdiffstats
path: root/crypto/asn1/evp_asn1.c
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2016-08-16 15:06:48 +0200
committerDr. Stephen Henson <steve@openssl.org>2016-08-16 17:05:35 +0200
commit17ebf85abda18c3875b1ba6670fe7b393bc1f297 (patch)
tree224f98559daf13f77b4526df0a24a3ab1675f685 /crypto/asn1/evp_asn1.c
parentRemove duplicate ordinals (diff)
downloadopenssl-17ebf85abda18c3875b1ba6670fe7b393bc1f297.tar.xz
openssl-17ebf85abda18c3875b1ba6670fe7b393bc1f297.zip
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/asn1/evp_asn1.c')
-rw-r--r--crypto/asn1/evp_asn1.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/crypto/asn1/evp_asn1.c b/crypto/asn1/evp_asn1.c
index ad3a5bc7a0..a458367ebd 100644
--- a/crypto/asn1/evp_asn1.c
+++ b/crypto/asn1/evp_asn1.c
@@ -30,13 +30,13 @@ int ASN1_TYPE_set_octetstring(ASN1_TYPE *a, unsigned char *data, int len)
int ASN1_TYPE_get_octetstring(const ASN1_TYPE *a, unsigned char *data, int max_len)
{
int ret, num;
- unsigned char *p;
+ const unsigned char *p;
if ((a->type != V_ASN1_OCTET_STRING) || (a->value.octet_string == NULL)) {
ASN1err(ASN1_F_ASN1_TYPE_GET_OCTETSTRING, ASN1_R_DATA_IS_WRONG);
return (-1);
}
- p = ASN1_STRING_data(a->value.octet_string);
+ p = ASN1_STRING_get0_data(a->value.octet_string);
ret = ASN1_STRING_length(a->value.octet_string);
if (ret < max_len)
num = ret;
@@ -105,7 +105,7 @@ int ASN1_TYPE_get_int_octetstring(const ASN1_TYPE *a, long *num,
n = max_len;
if (data != NULL)
- memcpy(data, ASN1_STRING_data(atmp->oct), n);
+ memcpy(data, ASN1_STRING_get0_data(atmp->oct), n);
if (ret == -1) {
err:
ASN1err(ASN1_F_ASN1_TYPE_GET_INT_OCTETSTRING, ASN1_R_DATA_IS_WRONG);