<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/test/openssl/test_pkey_ec.rb, branch v3_3_11</title>
<subtitle>The Ruby Programming Language</subtitle>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/'/>
<entry>
<title>[ruby/openssl] Fix test_pkey_ec.rb on FIPS.</title>
<updated>2023-09-21T18:04:56+00:00</updated>
<author>
<name>Jun Aruga</name>
<email>jaruga@redhat.com</email>
</author>
<published>2023-09-19T17:19:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=7f407e0240ebd41d9fb1ea1bbd15442ed8744b34'/>
<id>7f407e0240ebd41d9fb1ea1bbd15442ed8744b34</id>
<content type='text'>
https://github.com/ruby/openssl/commit/d07183f639
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/openssl/commit/d07183f639
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/openssl] test/openssl/test_pkey_ec.rb: refactor tests for EC.builtin_curves</title>
<updated>2023-09-06T10:31:11+00:00</updated>
<author>
<name>Kazuki Yamaguchi</name>
<email>k@rhe.jp</email>
</author>
<published>2023-08-29T15:02:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=3fd90c0158f8170ad11c8a99354bb3347c7cc121'/>
<id>3fd90c0158f8170ad11c8a99354bb3347c7cc121</id>
<content type='text'>
Check that OpenSSL::PKey::EC.builtin_curves returns an array in the
expected format.

Similarly to OpenSSL::Cipher.ciphers, OpenSSL::PKey::EC.builtin_curves
returns a list of known named curves rather than actually usable ones.

https://github.com/ruby/openssl/issues/671 found that the list may
include unapproved (and thus unusable) curves when the FIPS module is
loaded.

https://github.com/ruby/openssl/commit/c53cbabe00
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Check that OpenSSL::PKey::EC.builtin_curves returns an array in the
expected format.

Similarly to OpenSSL::Cipher.ciphers, OpenSSL::PKey::EC.builtin_curves
returns a list of known named curves rather than actually usable ones.

https://github.com/ruby/openssl/issues/671 found that the list may
include unapproved (and thus unusable) curves when the FIPS module is
loaded.

https://github.com/ruby/openssl/commit/c53cbabe00
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/openssl] Prefer String#unpack1</title>
<updated>2023-09-06T10:24:53+00:00</updated>
<author>
<name>Mau Magnaguagno</name>
<email>maumagnaguagno@gmail.com</email>
</author>
<published>2023-08-31T06:38:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=60a6de81a823cdb932d21fa5869c93853d3f2795'/>
<id>60a6de81a823cdb932d21fa5869c93853d3f2795</id>
<content type='text'>
(https://github.com/ruby/openssl/pull/586)

String#unpack1 avoids the intermediate array created by String#unpack
for single elements, while also making a call to Array#first/[0]
unnecessary.

https://github.com/ruby/openssl/commit/8eb0715a42
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
(https://github.com/ruby/openssl/pull/586)

String#unpack1 avoids the intermediate array created by String#unpack
for single elements, while also making a call to Array#first/[0]
unnecessary.

https://github.com/ruby/openssl/commit/8eb0715a42
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/openssl] pkey/ec: check private key validity with OpenSSL 3</title>
<updated>2022-12-23T00:39:15+00:00</updated>
<author>
<name>Joe Truba</name>
<email>joe@bannable.net</email>
</author>
<published>2022-11-20T00:54:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=0e11d2c3f8a74d2310efa67179b50c12acb3fa42'/>
<id>0e11d2c3f8a74d2310efa67179b50c12acb3fa42</id>
<content type='text'>
The behavior of EVP_PKEY_public_check changed between OpenSSL 1.1.1
and 3.0 so that it no longer validates the private key. Instead, private
keys can be validated through EVP_PKEY_private_check and
EVP_PKEY_pairwise_check.

[ky: simplified condition to use either EVP_PKEY_check() or
EVP_PKEY_public_check().]

https://github.com/ruby/openssl/commit/e38a63ab3d
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The behavior of EVP_PKEY_public_check changed between OpenSSL 1.1.1
and 3.0 so that it no longer validates the private key. Instead, private
keys can be validated through EVP_PKEY_private_check and
EVP_PKEY_pairwise_check.

[ky: simplified condition to use either EVP_PKEY_check() or
EVP_PKEY_public_check().]

https://github.com/ruby/openssl/commit/e38a63ab3d
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/openssl] Use SHA256 instead of SHA1 where needed in tests.</title>
<updated>2022-12-13T09:07:41+00:00</updated>
<author>
<name>Jarek Prokop</name>
<email>jprokop@redhat.com</email>
</author>
<published>2022-10-18T07:52:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=ce025a5cb4a7aea62629fcf8685e931671a0672d'/>
<id>ce025a5cb4a7aea62629fcf8685e931671a0672d</id>
<content type='text'>
Systems such as RHEL 9 are moving away from SHA1
disabling it completely in default configuration.

https://github.com/ruby/openssl/commit/32648da2f6
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Systems such as RHEL 9 are moving away from SHA1
disabling it completely in default configuration.

https://github.com/ruby/openssl/commit/32648da2f6
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/openssl] pkey/ec: check existence of public key component before exporting</title>
<updated>2022-10-17T07:35:35+00:00</updated>
<author>
<name>Kazuki Yamaguchi</name>
<email>k@rhe.jp</email>
</author>
<published>2022-09-02T14:05:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=b69d41e1c433f9109b7c9237cde6ed8b4884cc06'/>
<id>b69d41e1c433f9109b7c9237cde6ed8b4884cc06</id>
<content type='text'>
i2d_PUBKEY_bio() against an EC_KEY without the public key component
trggers a null dereference.

This is a regression introduced by commit https://github.com/ruby/openssl/commit/56f0d34d63fb ("pkey:
refactor #export/#to_pem and #to_der", 2017-06-14).

Fixes https://github.com/ruby/openssl/pull/527#issuecomment-1220504524
Fixes https://github.com/ruby/openssl/issues/369#issuecomment-1221554057

https://github.com/ruby/openssl/commit/f6ee0fa4de
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
i2d_PUBKEY_bio() against an EC_KEY without the public key component
trggers a null dereference.

This is a regression introduced by commit https://github.com/ruby/openssl/commit/56f0d34d63fb ("pkey:
refactor #export/#to_pem and #to_der", 2017-06-14).

Fixes https://github.com/ruby/openssl/pull/527#issuecomment-1220504524
Fixes https://github.com/ruby/openssl/issues/369#issuecomment-1221554057

https://github.com/ruby/openssl/commit/f6ee0fa4de
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/openssl] pkey: restore support for decoding "openssl ecparam -genkey" output</title>
<updated>2022-10-17T07:35:35+00:00</updated>
<author>
<name>Kazuki Yamaguchi</name>
<email>k@rhe.jp</email>
</author>
<published>2022-09-02T13:40:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=0677b2fb87fa4bdff64e650e5df0fd7bf684bd2e'/>
<id>0677b2fb87fa4bdff64e650e5df0fd7bf684bd2e</id>
<content type='text'>
Scan through the input for a private key, then fallback to generic
decoder.

OpenSSL 3.0's OSSL_DECODER supports encoded key parameters. The PEM
header "-----BEGIN EC PARAMETERS-----" is used by one of such encoding
formats. While this is useful for OpenSSL::PKey::PKey, an edge case has
been discovered.

The openssl CLI command line "openssl ecparam -genkey" prints two PEM
blocks in a row, one for EC parameters and another for the private key.
Feeding the whole output into OSSL_DECODER results in only the first PEM
block, the key parameters, being decoded. Previously, ruby/openssl did
not support decoding key parameters and it would decode the private key
PEM block instead.

While the new behavior is technically correct, "openssl ecparam -genkey"
is so widely used that ruby/openssl does not want to break existing
applications.

Fixes https://github.com/ruby/openssl/pull/535

https://github.com/ruby/openssl/commit/d486c82833
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Scan through the input for a private key, then fallback to generic
decoder.

OpenSSL 3.0's OSSL_DECODER supports encoded key parameters. The PEM
header "-----BEGIN EC PARAMETERS-----" is used by one of such encoding
formats. While this is useful for OpenSSL::PKey::PKey, an edge case has
been discovered.

The openssl CLI command line "openssl ecparam -genkey" prints two PEM
blocks in a row, one for EC parameters and another for the private key.
Feeding the whole output into OSSL_DECODER results in only the first PEM
block, the key parameters, being decoded. Previously, ruby/openssl did
not support decoding key parameters and it would decode the private key
PEM block instead.

While the new behavior is technically correct, "openssl ecparam -genkey"
is so widely used that ruby/openssl does not want to break existing
applications.

Fixes https://github.com/ruby/openssl/pull/535

https://github.com/ruby/openssl/commit/d486c82833
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/openssl] pkey: deprecate PKey#set_* methods</title>
<updated>2021-12-20T14:42:02+00:00</updated>
<author>
<name>Kazuki Yamaguchi</name>
<email>k@rhe.jp</email>
</author>
<published>2021-09-21T09:29:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=8ebf5978852e22358cbcdf74c0eb506f22e2c73f'/>
<id>8ebf5978852e22358cbcdf74c0eb506f22e2c73f</id>
<content type='text'>
OpenSSL 3.0 made EVP_PKEY immutable. This means we can only have a const
pointer of the low level struct and the following methods can no longer
be provided when linked against OpenSSL 3.0:

 - OpenSSL::PKey::RSA#set_key
 - OpenSSL::PKey::RSA#set_factors
 - OpenSSL::PKey::RSA#set_crt_params
 - OpenSSL::PKey::DSA#set_pqg
 - OpenSSL::PKey::DSA#set_key
 - OpenSSL::PKey::DH#set_pqg
 - OpenSSL::PKey::DH#set_key
 - OpenSSL::PKey::EC#group=
 - OpenSSL::PKey::EC#private_key=
 - OpenSSL::PKey::EC#public_key=

There is no direct replacement for this functionality at the moment.
I plan to introduce a wrapper around EVP_PKEY_fromdata(), which takes
all key components at once to construct an EVP_PKEY.

https://github.com/ruby/openssl/commit/6848d2d969
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
OpenSSL 3.0 made EVP_PKEY immutable. This means we can only have a const
pointer of the low level struct and the following methods can no longer
be provided when linked against OpenSSL 3.0:

 - OpenSSL::PKey::RSA#set_key
 - OpenSSL::PKey::RSA#set_factors
 - OpenSSL::PKey::RSA#set_crt_params
 - OpenSSL::PKey::DSA#set_pqg
 - OpenSSL::PKey::DSA#set_key
 - OpenSSL::PKey::DH#set_pqg
 - OpenSSL::PKey::DH#set_key
 - OpenSSL::PKey::EC#group=
 - OpenSSL::PKey::EC#private_key=
 - OpenSSL::PKey::EC#public_key=

There is no direct replacement for this functionality at the moment.
I plan to introduce a wrapper around EVP_PKEY_fromdata(), which takes
all key components at once to construct an EVP_PKEY.

https://github.com/ruby/openssl/commit/6848d2d969
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/openssl] pkey/ec: deprecate OpenSSL::PKey::EC#generate_key!</title>
<updated>2021-12-20T14:42:02+00:00</updated>
<author>
<name>Kazuki Yamaguchi</name>
<email>k@rhe.jp</email>
</author>
<published>2021-12-16T17:21:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=b93ae54258684d0c3d1501400af949c013f44fba'/>
<id>b93ae54258684d0c3d1501400af949c013f44fba</id>
<content type='text'>
OpenSSL::PKey::EC#generate_key! will not work on OpenSSL 3.0 because
keys are made immutable. Users should use OpenSSL::PKey.generate_key
instead.

https://github.com/ruby/openssl/commit/5e2e66cce8
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
OpenSSL::PKey::EC#generate_key! will not work on OpenSSL 3.0 because
keys are made immutable. Users should use OpenSSL::PKey.generate_key
instead.

https://github.com/ruby/openssl/commit/5e2e66cce8
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/openssl] test/openssl/test_ssl: assume ECC support</title>
<updated>2021-10-23T04:38:37+00:00</updated>
<author>
<name>Kazuki Yamaguchi</name>
<email>k@rhe.jp</email>
</author>
<published>2021-09-27T06:34:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=5a8e1c520ac71c76f6424f9ef5aef64a79527f78'/>
<id>5a8e1c520ac71c76f6424f9ef5aef64a79527f78</id>
<content type='text'>
Disabling ECC support of OpenSSL is impractical nowadays.

We still try to have the C extension compile on no-ec builds (as well
as no-dh or no-engine, etc.) as long as we can, but keeping test cases
for such an extreme scenario is not worth the effort.

https://github.com/ruby/openssl/commit/2cd01d4676
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Disabling ECC support of OpenSSL is impractical nowadays.

We still try to have the C extension compile on no-ec builds (as well
as no-dh or no-engine, etc.) as long as we can, but keeping test cases
for such an extreme scenario is not worth the effort.

https://github.com/ruby/openssl/commit/2cd01d4676
</pre>
</div>
</content>
</entry>
</feed>
