ext/openssl/History.md
OpenSSL::SSL
OpenSSL::SSL::SSLSocket. #syswrite no
longer creates a temporary String object.
[GitHub #831]OpenSSL::SSL::SSLContext#min_version= and #max_version= wrap the
corresponding OpenSSL APIs directly, and remove the fallback to SSL options.
[GitHub #849]OpenSSL::SSL::SSLContext#sigalgs= and #client_sigalgs= for
specifying signature algorithms to use for connections.
[GitHub #895]OpenSSL::SSL::SSLContext#ecdh_curves= to #groups= following
the underlying OpenSSL API rename. This method is no longer specific to
ECDHE. The old method remains as an alias.
[GitHub #900]OpenSSL::SSL::SSLSocket#sigalg, #peer_sigalg, and #group for
getting the signature algorithm and the key agreement group used in the
current connection.
[GitHub #908]SSL_CTX_set_dh_auto() for servers by default.
[GitHub #924]OpenSSL::SSL::SSLContext::DEFAULT_PARAMS is now frozen.
[GitHub #925]OpenSSL::PKey
OpenSSL::PKey::EC::Point#mul support with array arguments. The
underlying OpenSSL API has been removed, and the method has been deprecated
since ruby/openssl v3.0.0.
[GitHub #843]OpenSSL::PKey::{RSA,DSA,DH}#params uses nil to indicate missing fields
instead of the number 0.
[GitHub #774]OpenSSL::PKey::PKeyError classes. The former subclasses
OpenSSL::PKey::DHError, OpenSSL::PKey::DSAError,
OpenSSL::PKey::ECError, and OpenSSL::PKey::RSAError have been merged
into a single class.
[GitHub #929]OpenSSL::Cipher
OpenSSL::Cipher#encrypt and #decrypt no longer accept arguments.
Passing passwords has been deprecated since Ruby 1.8.2 (released in 2004).
[GitHub #887]OpenSSL::Cipher#final raises OpenSSL::Cipher::AuthTagError when the
integrity check fails for AEAD ciphers. OpenSSL::Cipher::AuthTagError is a
new subclass of OpenSSL::Cipher::CipherError, which was previously raised.
[GitHub #939]OpenSSL::Cipher.new now raises OpenSSL::Cipher::CipherError instead of
RuntimeError when OpenSSL does not recognize the algorithm.
[GitHub #958]OpenSSL::Digest
OpenSSL::Digest.new now raises OpenSSL::Digest::DigestError instead of
RuntimeError when OpenSSL does not recognize the algorithm.
[GitHub #958]OpenSSL::ASN1.decode now assumes a 1950-2049 year range for UTCTime
according to RFC 5280. It previously used a 1969-2068 range. The encoder
has always used the 1950-2049 range.
[GitHub #909]OpenSSL::OpenSSLError, the base class for all ruby/openssl errors, carry
an additional attribute #errors to keep the content of OpenSSL's error
queue. Also, add #detailed_message for Ruby 3.2 or later.
[GitHub #976]OpenSSL::PKCS7.new raises OpenSSL::PKCS7::PKCS7Error instead of
ArgumentError on error to be consistent with other constructors.
[GitHub #983]Merged changes in 3.1.3 and 3.2.3.
Merged changes in 3.1.2 and 3.2.2.
OpenSSL::SSL
OpenSSL::SSL::SSLSocket#set_params no longer sets #min_version= to TLS
1.0 except when OpenSSL 1.0.2 is used. This has been done to disable
SSL 3.0, which is not supported by default in OpenSSL 1.1.0 or later, or in
LibreSSL. This lets it respect the system default if the system-wide
configuration file specifies a higher minimum protocol version.
[GitHub #710]OpenSSL::SSL::SSLSocket.new no longer enables the OpenSSL::SSL::OP_ALL
SSL options by default and follows the system default.
[GitHub #767]OpenSSL::SSL::SSLSocket, which will pass
along to the underlying socket: #local_address, #remote_address,
#close_on_exec=, #close_on_exec?, #wait, #wait_readable, and
#wait_writable.
[GitHub #708]OpenSSL::SSL::SSLSocket#gets to take the chomp keyword argument.
[GitHub #708]OpenSSL::SSL::SSLSocket respect the IO#timeout value of the
underlying socket on Ruby 3.2 or later. #timeout and #timeout= methods
are also added.
[GitHub #714]OpenSSL::SSL::SSLSocket#close_read and #close_write.
[GitHub #743]OpenSSL::Digest.digests to get a list of all available digest
algorithms.
[GitHub #726]OpenSSL::SSL::SSLSocket#read_nonblock clearing the passed String
buffer when nothing can be read from the connection.
[GitHub #739]#to_text methods to OpenSSL::Timestamp::Response,
OpenSSL::Timestamp::Request, OpenSSL::Timestamp::TokenInfo, and
OpenSSL::PKCS7 to get a human-readable representation of the object.
[GitHub #756]OpenSSL::X509::Certificate#tbs_bytes to get the DER encoding of the
TBSCertificate.
[GitHub #753]nil as the digest algorithm to #sign methods on
OpenSSL::X509::Certificate, OpenSSL::X509::Request, and
OpenSSL::X509::CRL. This adds supports for signing with EdDSA keys.
[GitHub #761]
[GitHub #804]OpenSSL::SSL::SSLSocket#readbyte.
[GitHub #771]OpenSSL::X509::Store#time= to set the time to the X509_VERIFY_PARAM
in the X509_STORE. This allows OpenSSL::Timestamp::Response#verify to
verify a signature with the specified timestamp.
[GitHub #770]OpenSSL::PKCS7.encrypt's third parameter cipher mandatory. It had
an undocumented default value "RC2-40-CBC", which is not only insecure, but
also not supported in OpenSSL 3.0 or later.
[GitHub #796]OpenSSL::BN shareable between ractors when frozen.
[GitHub #808]OpenSSL::Config instances frozen by default, and make it shareable
between ractors. OpenSSL::Config::DEFAULT_CONFIG_FILE is also frozen.
[GitHub #809]OpenSSL::PKCS12#set_mac to configure the MAC parameters and recalculate
a MAC for the content.
[GitHub #788]And various non-user-visible changes and bug fixes. Please see the commit history for more details.
Merged changes in 3.1.3.
Merged changes in 3.1.2.
Merged changes in 3.0.3.
jruby-openssl gem.
[GitHub #598]OpenSSL::PKey routines for loading DER or PEM encoded keys for better
compatibility with OpenSSL 3.0/3.1 with the FIPS module.
[GitHub #615]
[GitHub #669]OpenSSL::Provider module for loading and unloading OpenSSL 3 providers.
[GitHub #635]OpenSSL::PKey.new_raw_private_key, .new_raw_public_key,
OpenSSL::PKey::PKey#raw_private_key, and #raw_public_key for public key
algorithms that use "raw private/public key", such as X25519 and Ed25519.
[GitHub #646]OpenSSL::SSL::SSLContext#ca_file= and #ca_path= to raise
OpenSSL::SSL::SSLError instead of printing a warning message.
[GitHub #659]OpenSSL::X509::ExtensionFactory#create_extension to take OIDs in the
dotted-decimal notation.
[GitHub #141]EVP_PKEY_get0() functions with OpenSSL 3.x.
[GitHub #957]OpenSSL::PKey::DSA key.
[GitHub #845]
[GitHub #847]OpenSSL::X509::V_FLAG_CRL_CHECK_ALL flag from the default store
used by OpenSSL::SSL::SSLContext#set_params. It causes certificate
verification to fail with OpenSSL 3.6.0. It has no effect with any other
OpenSSL versions.
[GitHub #949]
[GitHub #950]Merged changes in 3.0.3.
Ruby/OpenSSL 3.1 will be maintained for the lifetime of Ruby 3.2.
Merged bug fixes in 2.2.3 and 3.0.2. Among the new features and changes are:
OpenSSL::SSL::SSLContext#ciphersuites= to allow setting TLS 1.3 cipher
suites.
[GitHub #493]OpenSSL::SSL::SSLSocket#export_keying_material for exporting keying
material of the session, as defined in RFC 5705.
[GitHub #530]OpenSSL::SSL::SSLContext#keylog_cb= for setting the TLS key logging
callback, which is useful for supporting NSS's SSLKEYLOGFILE debugging output.
[GitHub #536]OpenSSL::OCSP::BasicResponse#sign
and OpenSSL::OCSP::Request#sign. Omitting the 5th parameter of these
methods used to be equivalent of specifying SHA-1. This default value is now
removed and we will let the underlying OpenSSL library decide instead.
[GitHub #507]OpenSSL::BN#mod_sqrt.
[GitHub #553]OpenSSL::Cipher#update with an empty string. This was
prohibited to workaround an ancient bug in OpenSSL.
[GitHub #568]OpenSSL::SSL
will not be defined if OpenSSL is compiled with OPENSSL_NO_SOCK.
[GitHub #558]SSLSocket.
[GitHub #706]OpenSSL::PKCS7 to handle PKCS#7 structures without content.
[GitHub #690]
[GitHub #752]OpenSSL::ASN1::ObjectId#== with OIDs without a known name.
[GitHub #791]
[GitHub #792]OpenSSL::X509::Certificate#crl_uris to handle CDP with multiple CRL
URIs.
[GitHub #775]
[GitHub #776]OpenSSL::Cipher#update to always make the output buffer String
independent.
[Bug #20937]
[GitHub #824]Merged changes in 2.2.3. Additionally, the following issues are fixed by this release.
Merged changes in 2.1.4 and 2.2.2. Additionally, the following issues are fixed by this release.
OpenSSL 1.0.1 and Ruby 2.3-2.5 are no longer supported. [GitHub #396] [GitHub #466]
OpenSSL 3.0 support is added. It is the first major version bump from OpenSSL 1.1 and contains incompatible changes that affect Ruby/OpenSSL. Note that OpenSSL 3.0 support is preliminary and not all features are currently available: [GitHub #369]
Deprecate the ability to modify OpenSSL::PKey::PKey instances. OpenSSL 3.0
made EVP_PKEY structure immutable, and hence the following methods are not
available when Ruby/OpenSSL is linked against OpenSSL 3.0.
[GitHub #480]
OpenSSL::PKey::RSA#set_key, #set_factors, #set_crt_paramsOpenSSL::PKey::DSA#set_pqg, #set_keyOpenSSL::PKey::DH#set_pqg, #set_key, #generate_key!OpenSSL::PKey::EC#private_key=, #public_key=, #group=, #generate_key!Deprecate OpenSSL::Engine. The ENGINE API has been deprecated in OpenSSL 3.0
in favor of the new "provider" concept and will be removed in a future
version.
[GitHub #481]
OpenSSL::SSL::SSLContext#tmp_ecdh_callback has been removed. It has been
deprecated since v2.0.0 because it is incompatible with modern OpenSSL
versions.
[GitHub #394]
OpenSSL::SSL::SSLSocket#read and #write now raise OpenSSL::SSL::SSLError
if called before a TLS connection is established. Historically, they
read/wrote unencrypted data to the underlying socket directly in that case.
[GitHub #9]
[GitHub #469]
Enhance OpenSSL::PKey's common interface. [GitHub #370]
OpenSSL::PKey.read to handle PEM encoding of
DH parameters, which used to be only deserialized by OpenSSL::PKey::DH.new.
[GitHub #328]OpenSSL::PKey.generate_parameters and
OpenSSL::PKey.generate_key.
[GitHub #329]OpenSSL::PKey::PKey#sign and #verify to use
the new EVP_DigestSign() family to enable PureEdDSA support on OpenSSL 1.1.1
or later. They also now take optional algorithm-specific parameters for more
control.
[GitHub #329]OpenSSL::PKey::PKey#sign_raw, #verify_raw, and #verify_recover.
[GitHub #382]OpenSSL::PKey::PKey#encrypt and #decrypt.
[GitHub #382]OpenSSL::PKey::PKey#derive.
[GitHub #329]OpenSSL::PKey::PKey#compare? to conveniently check
that two keys have common parameters and a public key.
[GitHub #383]Add OpenSSL::BN#set_flags and #get_flags. This can be used in combination
with OpenSSL::BN::CONSTTIME to force constant-time computation.
[GitHub #417]
Add OpenSSL::BN#abs to get the absolute value of the BIGNUM.
[GitHub #430]
Add OpenSSL::SSL::SSLSocket#getbyte.
[GitHub #438]
Add OpenSSL::SSL::SSLContext#tmp_dh=.
[GitHub #459]
Add OpenSSL::X509::Certificate.load to load a PEM-encoded and concatenated
list of X.509 certificates at once.
[GitHub #441]
Change OpenSSL::X509::Certificate.new to attempt to deserialize the given
string first as DER encoding first and then as PEM encoding to ensure the
round-trip consistency.
[GitHub #442]
Update various part of the code base to use the modern API. No breaking changes are intended with this. This includes:
OpenSSL::HMAC uses the EVP API.
[GitHub #371]OpenSSL::Config uses native OpenSSL API to parse config files.
[GitHub #342]Merged changes in 2.1.4.
Merged changes in 2.1.3. Additionally, the following issues are fixed by this release.
OpenSSL::Timestamp::{Request,Response,TokenInfo}.new when
invalid arguments are given.
[GitHub #407]OpenSSL::Timestamp::Factory#create_timestamp with LibreSSL on platforms
where time_t has a different size from long.
[GitHub #454]OpenSSL::PKCS7::SignerInfo#name alias for #issuer.
[GitHub #266]OpenSSL::Config#add_value and #[]= for future removal.
[GitHub #322]OpenSSL::SSL::SSLServer#listen backlog argument from
5 to Socket::SOMAXCONN.
[GitHub #286]OpenSSL::HMAC#== use a timing safe string comparison.
[GitHub #284]OpenSSL::SSL::SSLSocket.open for opening a TCPSocket and
returning an OpenSSL::SSL::SSLSocket for it.
[GitHub #225]OpenSSL::X509 and OpenSSL::PKey objects.
[GitHub #281]
[GitHub #363]OpenSSL.secure_compare for timing safe string comparison for
strings of possibly unequal length.
[GitHub #280]OpenSSL.fixed_length_secure_compare for timing safe string
comparison for strings of equal length.
[GitHub #269]OpenSSL::SSL::SSLSocket#{finished_message,peer_finished_message}
for last finished message sent and received.
[GitHub #250]OpenSSL::Timestamp module for handing timestamp requests and
responses.
[GitHub #204]OpenSSL::X509::Certificate:
find_extension, subject_key_identifier,
authority_key_identifier, crl_uris, ca_issuer_uris and
ocsp_uris, and for OpenSSL::X509::CRL:
find_extension and subject_key_identifier.
[GitHub #260]
[GitHub #275]
[GitHub #293]OpenSSL::ECPoint#add for performing elliptic curve point addition.
[GitHub #261]OpenSSL::PKey::RSA#{export,to_der} check key, factors, and
crt_params to do proper private key serialization.
[GitHub #258]OpenSSL::SSL::{SSLSocket,SSLServer}#fileno, returning the
underlying socket file descriptor number.
[GitHub #247]OpenSSL::ASN1::ObjectId#== for equality testing.OpenSSL::X509::Extension#value_der for the raw value of
the extension.
[GitHub #234]OpenSSL::Buffering#do_write.
[GitHub #212]OpenSSL::PKey classes: private_to_der, private_to_pem,
public_to_der and public_to_pem.
[GitHub #297]OpenSSL::Config.
[GitHub #216]OpenSSL::SSL::SSLContext#verify_hostname=
sets a proper error code.
[GitHub #350]OpenSSL::BN.new(nil, 2).
[Bug #15760]OpenSSL::SSL::SSLSocket#sys{read,write} prevent internal string buffers from
being modified by another thread.
[GitHub #453]OpenSSL::Buffering where it was
for output.OpenSSL::PKey::EC#dsa_verify_asn1.
[GitHub #460]extconf.rb explicitly checks that OpenSSL's version number is 1.0.1 or
newer but also less than 3.0. Ruby/OpenSSL v2.1.x and v2.2.x will not support
OpenSSL 3.0 API.
[GitHub #458]digest gem correctly. digest library could go into an
inconsistent state if there are multiple versions of digest is installed
and openssl is required before digest.
[GitHub #463]Merged changes in 2.0.9.
Merged changes in 2.0.8.
This is the first release of openssl gem, formerly a standard library of Ruby, ext/openssl. This is the successor of the version included in Ruby 2.3.
Add support for OpenSSL 1.1.0. [Feature #12324]
Add support for LibreSSL
OpenSSL::Cipher
OpenSSL::Cipher#key= and #iv= reject too long inputs. They used to truncate silently. [Bug #12561]
OpenSSL::Cipher#iv_len= is added. It allows changing IV (nonce) length if using AEAD ciphers. [Bug #8667], [Bug #10420], [GH ruby/ruby#569], [GH ruby/openssl#58]
OpenSSL::Cipher#auth_tag_len= is added. This sets the authentication tag length to be generated by an AEAD cipher.
OpenSSL::OCSP
Accessor methods are added to OpenSSL::OCSP::CertificateId. [Feature #7181]
OpenSSL::OCSP::Request and BasicResponse can be signed with non-SHA-1 hash algorithm. [Feature #11552]
OpenSSL::OCSP::CertificateId and BasicResponse can be encoded into DER.
A new class OpenSSL::OCSP::SingleResponse is added for convenience.
OpenSSL::OCSP::BasicResponse#add_status accepts absolute times. They used to accept only relative seconds from the current time.
OpenSSL::PKey
OpenSSL::PKey::EC follows the general PKey interface. [Bug #6567]
OpenSSL::PKey.read raises OpenSSL::PKey::PKeyError instead of ArgumentError for consistency with OpenSSL::PKey::{DH,DSA,RSA,EC}#new. [Bug #11774], [GH ruby/openssl#55]
OpenSSL::PKey::EC::Group retrieved by OpenSSL::PKey::EC#group is no longer linked with the EC key. Modifications to the EC::Group have no effect on the key. [GH ruby/openssl#71]
OpenSSL::PKey::EC::Point#to_bn allows specifying the point conversion form by the optional argument.
OpenSSL::SSL
OpenSSL::SSL::SSLSocket#tmp_key is added. A client can call it after the connection is established to retrieve the ephemeral key. [GH ruby/ruby#1318]
The automatic ephemeral ECDH curve selection is enabled by default when built with OpenSSL >= 1.0.2 or LibreSSL.
OpenSSL::SSL::SSLContext#security_level= is added. You can set the "security level" of the SSL context. This is effective only when built with OpenSSL 1.1.0.
A new option 'verify_hostname' is added to OpenSSL::SSL::SSLContext. When it is enabled, and the SNI hostname is also set, the hostname verification on the server certificate is automatically performed. It is now enabled by OpenSSL::SSL::SSLContext#set_params. [GH ruby/openssl#60]
OpenSSL::Engine
OpenSSL::SSL
OpenSSL::PKey::DH::DEFAULT_512 is removed. Hence servers no longer use 512-bit DH group by default. It is considered too weak nowadays. [Bug #11968], [GH ruby/ruby#1196]
RC4 cipher suites are removed from OpenSSL::SSL::SSLContext::DEFAULT_PARAMS. RC4 is now considered to be weak. [GH ruby/openssl#50]
OpenSSL::PKey
OpenSSL::Random
OpenSSL::SSL