Various small fixes in C extension code #814
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a collection of various otherwise unrelated tree-wide fixes.
pkey/ec: fix exception class in OpenSSL::PKey::EC.new
Fix a copy-and-paste error introduced in commit 74f6c61 (pkey:
allocate EVP_PKEY on #initialize, 2021-04-12).
It should raise OpenSSL::PKey::ECError instead of
OpenSSL::PKey::DSAError.
ns_spki: fix exception class in OpenSSL::Netscape::SPKI#to_der
It should raise OpenSSL::Netscape::SPKIError instead of
OpenSSL::X509::CertificateError.
No test cases covered this because it only occurs in exceptional
cases, such as memory allocation failure.
x509store: fix exception class in OpenSSL::X509::StoreContext#verify
Follow-up commit 0789643 (openssl: clear OpenSSL error
queue before return to Ruby, 2016-05-18). It should raise
OpenSSL::X509::StoreError instead of OpenSSL::X509::CertificateError.
ts: avoid using OpenSSL::PKCS7's internals
Internals of OpenSSL::PKCS7 should be kept within ossl_pkcs7.c.
Add a new ossl_pkcs7_new() function for duplicating and wrapping an
OpenSSL PKCS7 object in OpenSSL::PKCS7. This follows the convention
used by other ossl_*_new() functions.
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.
Mark variables and functions as static whenever possible
Call Init_ossl_*() functions in alphabetical order
It was originally sorted in alphabetical order, but it has been broken
over time. Let's fix it.