Skip to content

Commit 8945f37

Browse files
committed
Convert ossl_ts.c to opaque ASN1_STRING
1 parent 0941ebb commit 8945f37

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ext/openssl/ossl_ts.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ ossl_ts_req_get_msg_imprint(VALUE self)
259259
mi = TS_REQ_get_msg_imprint(req);
260260
hashed_msg = TS_MSG_IMPRINT_get_msg(mi);
261261

262-
ret = rb_str_new((const char *)hashed_msg->data, hashed_msg->length);
262+
ret = asn1str_to_str(hashed_msg);
263263

264264
return ret;
265265
}
@@ -470,7 +470,7 @@ ossl_ts_req_to_der(VALUE self)
470470
ossl_raise(eTimestampError, "Message imprint missing algorithm");
471471

472472
hashed_msg = TS_MSG_IMPRINT_get_msg(mi);
473-
if (!hashed_msg->length)
473+
if (!ASN1_STRING_length(hashed_msg))
474474
ossl_raise(eTimestampError, "Message imprint missing hashed message");
475475

476476
return asn1_to_der((void *)req, (int (*)(void *, unsigned char **))i2d_TS_REQ);
@@ -981,7 +981,7 @@ ossl_ts_token_info_get_msg_imprint(VALUE self)
981981
GetTSTokenInfo(self, info);
982982
mi = TS_TST_INFO_get_msg_imprint(info);
983983
hashed_msg = TS_MSG_IMPRINT_get_msg(mi);
984-
ret = rb_str_new((const char *)hashed_msg->data, hashed_msg->length);
984+
ret = asn1str_to_str(hashed_msg);
985985

986986
return ret;
987987
}

0 commit comments

Comments
 (0)