mirror of
https://github.com/ruby/ruby.git
synced 2026-01-26 12:14:51 +00:00
[ruby/openssl] Convert ossl_ts.c to opaque ASN1_STRING
https://github.com/ruby/openssl/commit/8945f379b3
This commit is contained in:
parent
a07997bf81
commit
38ad0806d7
@ -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;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user