summaryrefslogtreecommitdiffstats
path: root/crypto/ts
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/ts
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/ts')
-rw-r--r--crypto/ts/ts_lib.c2
-rw-r--r--crypto/ts/ts_rsp_verify.c4
-rw-r--r--crypto/ts/ts_verify_ctx.c2
3 files changed, 4 insertions, 4 deletions
diff --git a/crypto/ts/ts_lib.c b/crypto/ts/ts_lib.c
index e18f1f3f7e..99c0580f2a 100644
--- a/crypto/ts/ts_lib.c
+++ b/crypto/ts/ts_lib.c
@@ -85,7 +85,7 @@ int TS_MSG_IMPRINT_print_bio(BIO *bio, TS_MSG_IMPRINT *a)
BIO_printf(bio, "Message data:\n");
msg = a->hashed_msg;
- BIO_dump_indent(bio, (const char *)ASN1_STRING_data(msg),
+ BIO_dump_indent(bio, (const char *)ASN1_STRING_get0_data(msg),
ASN1_STRING_length(msg), 4);
return 1;
diff --git a/crypto/ts/ts_rsp_verify.c b/crypto/ts/ts_rsp_verify.c
index 99f664b431..2755dd0ef3 100644
--- a/crypto/ts/ts_rsp_verify.c
+++ b/crypto/ts/ts_rsp_verify.c
@@ -472,7 +472,7 @@ static char *ts_get_status_text(STACK_OF(ASN1_UTF8STRING) *text)
length = ASN1_STRING_length(current);
if (i > 0)
*p++ = '/';
- strncpy(p, (const char *)ASN1_STRING_data(current), length);
+ strncpy(p, (const char *)ASN1_STRING_get0_data(current), length);
p += length;
}
*p = '\0';
@@ -568,7 +568,7 @@ static int ts_check_imprints(X509_ALGOR *algor_a,
}
ret = len_a == (unsigned)ASN1_STRING_length(b->hashed_msg) &&
- memcmp(imprint_a, ASN1_STRING_data(b->hashed_msg), len_a) == 0;
+ memcmp(imprint_a, ASN1_STRING_get0_data(b->hashed_msg), len_a) == 0;
err:
if (!ret)
TSerr(TS_F_TS_CHECK_IMPRINTS, TS_R_MESSAGE_IMPRINT_MISMATCH);
diff --git a/crypto/ts/ts_verify_ctx.c b/crypto/ts/ts_verify_ctx.c
index 141385d79f..d4792ee04f 100644
--- a/crypto/ts/ts_verify_ctx.c
+++ b/crypto/ts/ts_verify_ctx.c
@@ -128,7 +128,7 @@ TS_VERIFY_CTX *TS_REQ_to_TS_VERIFY_CTX(TS_REQ *req, TS_VERIFY_CTX *ctx)
ret->imprint_len = ASN1_STRING_length(msg);
if ((ret->imprint = OPENSSL_malloc(ret->imprint_len)) == NULL)
goto err;
- memcpy(ret->imprint, ASN1_STRING_data(msg), ret->imprint_len);
+ memcpy(ret->imprint, ASN1_STRING_get0_data(msg), ret->imprint_len);
if ((nonce = req->nonce) != NULL) {
if ((ret->nonce = ASN1_INTEGER_dup(nonce)) == NULL)