[ruby/openssl] ts: fix exception class raised when getting an OID name
get_asn1obj() is used by several methods in OpenSSL::Timestamp to get the string representation of an OID. On an error, such as memory allocation failure, it can raise OpenSSL::X509::AttributeError. It should be OpenSSL::Timestamp::TimestampError instead. https://github.com/ruby/openssl/commit/a424aad1df
This commit is contained in:
parent
f8e9302e66
commit
cbe7bfd9a8
@ -161,8 +161,11 @@ get_asn1obj(ASN1_OBJECT *obj)
|
||||
ret = rb_str_new2(OBJ_nid2sn(nid));
|
||||
else{
|
||||
if (!(out = BIO_new(BIO_s_mem())))
|
||||
ossl_raise(eX509AttrError, NULL);
|
||||
i2a_ASN1_OBJECT(out, obj);
|
||||
ossl_raise(eTimestampError, "BIO_new(BIO_s_mem())");
|
||||
if (i2a_ASN1_OBJECT(out, obj) <= 0) {
|
||||
BIO_free(out);
|
||||
ossl_raise(eTimestampError, "i2a_ASN1_OBJECT");
|
||||
}
|
||||
ret = ossl_membio2str(out);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user