<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/test/openssl/test_cipher.rb, branch v4.0.4</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] cipher: use EVP_CIPHER_fetch() if available</title>
<updated>2025-11-06T13:25:09+00:00</updated>
<author>
<name>Kazuki Yamaguchi</name>
<email>k@rhe.jp</email>
</author>
<published>2025-08-09T09:36:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=57aaf86bdbdaacb66ebbd29d1e2551d87167cbfe'/>
<id>57aaf86bdbdaacb66ebbd29d1e2551d87167cbfe</id>
<content type='text'>
Likewise, use EVP_MD_fetch() if it is available.

This adds support for AES-GCM-SIV with OpenSSL 3.2 or later.

https://github.com/ruby/openssl/commit/0e565a215e
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Likewise, use EVP_MD_fetch() if it is available.

This adds support for AES-GCM-SIV with OpenSSL 3.2 or later.

https://github.com/ruby/openssl/commit/0e565a215e
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/openssl] cipher: raise CipherError for unsupported algorithm name</title>
<updated>2025-11-06T13:25:09+00:00</updated>
<author>
<name>Kazuki Yamaguchi</name>
<email>k@rhe.jp</email>
</author>
<published>2025-11-03T09:26:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=26751e40857be6faf91d0c87362ebae769f51faa'/>
<id>26751e40857be6faf91d0c87362ebae769f51faa</id>
<content type='text'>
Raise OpenSSL::Cipher::CipherError instead of ArgumentError or
RuntimeError for consistency.

https://github.com/ruby/openssl/commit/78601c9c34
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Raise OpenSSL::Cipher::CipherError instead of ArgumentError or
RuntimeError for consistency.

https://github.com/ruby/openssl/commit/78601c9c34
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/openssl] Add AuthTagError exception for AEAD authentication</title>
<updated>2025-09-17T12:32:50+00:00</updated>
<author>
<name>Samuel Williams</name>
<email>samuel.williams@shopify.com</email>
</author>
<published>2025-09-17T12:32:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=a1f39b4b807a5412181ca3f1bf87e7c7d2d9f542'/>
<id>a1f39b4b807a5412181ca3f1bf87e7c7d2d9f542</id>
<content type='text'>
failures
(https://github.com/ruby/openssl/pull/939)

* Add AuthTagError exception for AEAD authentication failures

- Add OpenSSL::Cipher::AuthTagError as a subclass of CipherError
- Raise AuthTagError specifically for AEAD cipher authentication tag verification failures
- Enhanced error messages: 'AEAD authentication tag verification failed' for auth failures
- Precise detection: Only EVP_CipherFinal_ex failures in AEAD ciphers raise AuthTagError
- All other errors (key setup, IV setup, update failures, etc.) still raise CipherError
- Comprehensive test coverage for GCM/CCM modes and error inheritance
- Fully backwards compatible: AuthTagError &lt; CipherError

https://github.com/ruby/openssl/commit/9663b09040
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
failures
(https://github.com/ruby/openssl/pull/939)

* Add AuthTagError exception for AEAD authentication failures

- Add OpenSSL::Cipher::AuthTagError as a subclass of CipherError
- Raise AuthTagError specifically for AEAD cipher authentication tag verification failures
- Enhanced error messages: 'AEAD authentication tag verification failed' for auth failures
- Precise detection: Only EVP_CipherFinal_ex failures in AEAD ciphers raise AuthTagError
- All other errors (key setup, IV setup, update failures, etc.) still raise CipherError
- Comprehensive test coverage for GCM/CCM modes and error inheritance
- Fully backwards compatible: AuthTagError &lt; CipherError

https://github.com/ruby/openssl/commit/9663b09040
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/openssl] cipher: make output buffer String independent</title>
<updated>2024-12-21T18:33:03+00:00</updated>
<author>
<name>Kazuki Yamaguchi</name>
<email>k@rhe.jp</email>
</author>
<published>2024-12-10T14:06:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=637f019f1f7611ba41f761a1b17e4228661d0a5b'/>
<id>637f019f1f7611ba41f761a1b17e4228661d0a5b</id>
<content type='text'>
OpenSSL::Cipher#update accepts a String as the second argument to be
used as the output buffer. The buffer must be directly writable, in
other words, it must not be frozen and not a shared string.

rb_str_resize() does not make the String independent if the String
already has the intended length. Use the rb_str_modify() family instead
to check it.

Fixes: https://bugs.ruby-lang.org/issues/20937

https://github.com/ruby/openssl/commit/1de3b80a46
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
OpenSSL::Cipher#update accepts a String as the second argument to be
used as the output buffer. The buffer must be directly writable, in
other words, it must not be frozen and not a shared string.

rb_str_resize() does not make the String independent if the String
already has the intended length. Use the rb_str_modify() family instead
to check it.

Fixes: https://bugs.ruby-lang.org/issues/20937

https://github.com/ruby/openssl/commit/1de3b80a46
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/openssl] cipher: fix buffer overflow in Cipher#update</title>
<updated>2024-05-02T07:26:11+00:00</updated>
<author>
<name>Kazuki Yamaguchi</name>
<email>k@rhe.jp</email>
</author>
<published>2024-02-05T12:54:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=eb6f0000a4b752803ff7431d24d1a0a535a4387e'/>
<id>eb6f0000a4b752803ff7431d24d1a0a535a4387e</id>
<content type='text'>
OpenSSL::Cipher#update currently allocates the output buffer with size
(input data length)+(the block size of the cipher). This is insufficient
for the id-aes{128,192,256}-wrap-pad (AES keywrap with padding) ciphers.
They have a block size of 8 bytes, but the output may be up to 15 bytes
larger than the input.

Use (input data length)+EVP_MAX_BLOCK_LENGTH (== 32) as the output
buffer size, instead. OpenSSL doesn't provide a generic way to tell the
maximum required buffer size for ciphers, but this is large enough for
all algorithms implemented in current versions of OpenSSL.

Fixes: https://bugs.ruby-lang.org/issues/20236

https://github.com/ruby/openssl/commit/3035559f54
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
OpenSSL::Cipher#update currently allocates the output buffer with size
(input data length)+(the block size of the cipher). This is insufficient
for the id-aes{128,192,256}-wrap-pad (AES keywrap with padding) ciphers.
They have a block size of 8 bytes, but the output may be up to 15 bytes
larger than the input.

Use (input data length)+EVP_MAX_BLOCK_LENGTH (== 32) as the output
buffer size, instead. OpenSSL doesn't provide a generic way to tell the
maximum required buffer size for ciphers, but this is large enough for
all algorithms implemented in current versions of OpenSSL.

Fixes: https://bugs.ruby-lang.org/issues/20236

https://github.com/ruby/openssl/commit/3035559f54
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/openssl] Use openssl? instead of OpenSSL::OPENSSL_VERSION_NUMBER.</title>
<updated>2023-08-16T05:48:42+00:00</updated>
<author>
<name>Jun Aruga</name>
<email>jaruga@redhat.com</email>
</author>
<published>2023-08-14T15:13:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=8ca0d53fd09b2032d990b0ab92ec63f408861dbc'/>
<id>8ca0d53fd09b2032d990b0ab92ec63f408861dbc</id>
<content type='text'>
Update the `openssl?` method by adding status argument.

Note the format is below.

* OpenSSL 3: 0xMNN00PP0 (major minor 00 patch 0)
* OpenSSL 1: 0xMNNFFPPS (major minor fix patch status)

See &lt;https://www.openssl.org/docs/man1.1.1/man3/OPENSSL_VERSION_NUMBER.html&gt;
for details.

https://github.com/ruby/openssl/commit/db8deaacd3
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Update the `openssl?` method by adding status argument.

Note the format is below.

* OpenSSL 3: 0xMNN00PP0 (major minor 00 patch 0)
* OpenSSL 1: 0xMNNFFPPS (major minor fix patch status)

See &lt;https://www.openssl.org/docs/man1.1.1/man3/OPENSSL_VERSION_NUMBER.html&gt;
for details.

https://github.com/ruby/openssl/commit/db8deaacd3
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/openssl] Allow empty string to OpenSSL::Cipher#update</title>
<updated>2022-12-13T09:07:41+00:00</updated>
<author>
<name>Yusuke Nakamura</name>
<email>yusuke1994525@gmail.com</email>
</author>
<published>2022-11-23T12:05:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=d4dce27d894f4889f29d779c94ba2d30c231f9f8'/>
<id>d4dce27d894f4889f29d779c94ba2d30c231f9f8</id>
<content type='text'>
For some reasons, plaintext may be empty string.

ref https://www.rfc-editor.org/rfc/rfc9001.html#section-5.8

https://github.com/ruby/openssl/commit/953592a29e
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
For some reasons, plaintext may be empty string.

ref https://www.rfc-editor.org/rfc/rfc9001.html#section-5.8

https://github.com/ruby/openssl/commit/953592a29e
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/openssl] cipher: update test_ciphers</title>
<updated>2021-12-20T14:42:02+00:00</updated>
<author>
<name>Kazuki Yamaguchi</name>
<email>k@rhe.jp</email>
</author>
<published>2021-10-24T08:50:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=cfcdd2b4bd6c2420ecc93a8f77e553b53595b7ef'/>
<id>cfcdd2b4bd6c2420ecc93a8f77e553b53595b7ef</id>
<content type='text'>
Do not attempt to actually use all algorithms. Not all algorithms listed
in OpenSSL::Cipher.ciphers are always available.

https://github.com/ruby/openssl/commit/91d04f991f
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Do not attempt to actually use all algorithms. Not all algorithms listed
in OpenSSL::Cipher.ciphers are always available.

https://github.com/ruby/openssl/commit/91d04f991f
</pre>
</div>
</content>
</entry>
<entry>
<title>test/openssl/test_cipher: skip AES-CCM tests on OpenSSL &lt;= 1.1.1b</title>
<updated>2021-03-16T13:30:18+00:00</updated>
<author>
<name>Kazuki Yamaguchi</name>
<email>k@rhe.jp</email>
</author>
<published>2021-03-16T13:05:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=44d67128a827c65d1a3867c5d8fd190d10aa1dd2'/>
<id>44d67128a827c65d1a3867c5d8fd190d10aa1dd2</id>
<content type='text'>
AES CCM mode in OpenSSL &lt;= 1.1.1b was overly strict in the parameters
assignment order. This has been relaxed by OpenSSL 1.1.1c.

https://github.com/openssl/openssl/commit/b48e3be947ddc5da6b5a86db8341081c72b9a4ee

The test case is failing on Ubuntu 18.04 because it still uses the
initial 1.1.1 release and has the issue:

http://rubyci.s3.amazonaws.com/graviton2/ruby-master/log/20210316T120003Z.fail.html.gz
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
AES CCM mode in OpenSSL &lt;= 1.1.1b was overly strict in the parameters
assignment order. This has been relaxed by OpenSSL 1.1.1c.

https://github.com/openssl/openssl/commit/b48e3be947ddc5da6b5a86db8341081c72b9a4ee

The test case is failing on Ubuntu 18.04 because it still uses the
initial 1.1.1 release and has the issue:

http://rubyci.s3.amazonaws.com/graviton2/ruby-master/log/20210316T120003Z.fail.html.gz
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/openssl] User lower case cipher names for maximum compatibility</title>
<updated>2021-03-16T10:16:11+00:00</updated>
<author>
<name>Bart de Water</name>
<email>bartdewater@gmail.com</email>
</author>
<published>2020-07-07T16:59:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=da6341b70942cf448888471f66dfde2cf614f052'/>
<id>da6341b70942cf448888471f66dfde2cf614f052</id>
<content type='text'>
We ran into some Linux-based systems not accepting the upper case variant

https://github.com/ruby/openssl/commit/7bc49121d5
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We ran into some Linux-based systems not accepting the upper case variant

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