[ruby/openssl] Convert ossl_ts.c to opaque ASN1_STRING

https://github.com/ruby/openssl/commit/8945f379b3
This commit is contained in:
Theo Buehler 2025-12-05 13:54:49 +01:00 committed by git
parent a07997bf81
commit 38ad0806d7

View File

@ -259,7 +259,7 @@ ossl_ts_req_get_msg_imprint(VALUE self)
mi = TS_REQ_get_msg_imprint(req);
hashed_msg = TS_MSG_IMPRINT_get_msg(mi);
ret = rb_str_new((const char *)hashed_msg->data, hashed_msg->length);
ret = asn1str_to_str(hashed_msg);
return ret;
}
@ -470,7 +470,7 @@ ossl_ts_req_to_der(VALUE self)
ossl_raise(eTimestampError, "Message imprint missing algorithm");
hashed_msg = TS_MSG_IMPRINT_get_msg(mi);
if (!hashed_msg->length)
if (!ASN1_STRING_length(hashed_msg))
ossl_raise(eTimestampError, "Message imprint missing hashed message");
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)
GetTSTokenInfo(self, info);
mi = TS_TST_INFO_get_msg_imprint(info);
hashed_msg = TS_MSG_IMPRINT_get_msg(mi);
ret = rb_str_new((const char *)hashed_msg->data, hashed_msg->length);
ret = asn1str_to_str(hashed_msg);
return ret;
}