ruby/test/openssl
Kazuki Yamaguchi 497782856a [ruby/openssl] pkcs7: make PKCS7#add_recipient actually useful
Add a simple test case that creates an enveloped-data structure without
using the shorthand method, and fix two issues preventing this from
working correctly.

First, OpenSSL::PKey::PKCS7#add_recipient currently inserts an
incomplete PKCS7_RECIP_INFO object into the PKCS7 object. When
duplicating an unfinalized PKCS7_RECIP_INFO, the internal X509 reference
must also be copied, as it is later used by #add_data to fill the rest.

A similar issue with #add_signer was fixed in commit 20ca7a27a8
(pkcs7: keep private key when duplicating PKCS7_SIGNER_INFO,
2021-03-24).

Second, #add_data calls PKCS7_dataFinal(), which for enveloped-data
appears to require the BIO to be flushed explicitly with BIO_flush().
Without this, the last block of the encrypted data would be missing.

9595ecf643
2025-08-01 12:04:06 +00:00
..
fixtures/pkey [ruby/openssl] ssl: add post-quantum cryptography (PQC) tests 2025-07-27 12:15:02 +00:00
test_asn1.rb [ruby/openssl] asn1: align UTCTime year range with RFC 5280 2025-07-12 13:25:24 +00:00
test_bn.rb Sync ruby/openssl 2025-06-06 11:11:38 +09:00
test_buffering.rb [ruby/openssl] Refactor buffer usage to only use append_as_bytes 2025-01-14 11:54:47 +00:00
test_cipher.rb [ruby/openssl] cipher: make output buffer String independent 2024-12-22 03:33:03 +09:00
test_config.rb [ruby/openssl] test_config.rb: skip AWS-LC's unsupported features 2025-02-22 15:11:37 +00:00
test_digest.rb [ruby/openssl] digest: correct assert_equal usage in test_sha3 2025-02-27 17:04:32 +00:00
test_engine.rb
test_fips.rb [ruby/openssl] Use ENV["TEST_RUBY_OPENSSL_FIPS_ENABLED"] instead of OpenSSL::OPENSSL_FIPS. 2025-02-27 17:01:57 +00:00
test_hmac.rb
test_kdf.rb [ruby/openssl] Require OpenSSL 1.1.0 or later 2025-01-20 17:12:57 +00:00
test_ns_spki.rb
test_ocsp.rb [ruby/openssl] test/openssl/test_ocsp.rb: fix flaky test 2024-01-17 17:13:16 +00:00
test_ossl.rb [ruby/openssl] test/openssl/test_ossl.rb: fix style issues 2025-07-21 14:31:24 +00:00
test_pair.rb [ruby/openssl] Add SSLSocket#readbyte 2024-07-03 08:54:18 +00:00
test_pkcs7.rb [ruby/openssl] pkcs7: make PKCS7#add_recipient actually useful 2025-08-01 12:04:06 +00:00
test_pkcs12.rb [ruby/openssl] test_pkcs12.rb: don't use KEY_EX/SIG with AWS-LC 2025-02-22 15:11:37 +00:00
test_pkey.rb [ruby/openssl] pkey: use EVP_PKEY_new_raw_{private,public}_key_ex() if available 2025-06-25 17:13:11 +00:00
test_pkey_dh.rb [ruby/openssl] Move slow tests to OSSL_TEST_ALL=1 only 2025-07-21 14:31:24 +00:00
test_pkey_dsa.rb [ruby/openssl] Move slow tests to OSSL_TEST_ALL=1 only 2025-07-21 14:31:24 +00:00
test_pkey_ec.rb [ruby/openssl] pkey/ec: AWS-LC disallows serialization of explicit curves 2025-02-22 15:11:40 +00:00
test_pkey_rsa.rb [ruby/openssl] Fix the tests using SHA-1 Probabilistic Signature Scheme (PSS) parameters. 2025-04-08 17:46:42 +00:00
test_provider.rb [ruby/openssl] Fix test_provider.rb in FIPS. 2024-09-06 16:58:18 +00:00
test_random.rb
test_ssl.rb [ruby/openssl] ssl: add post-quantum cryptography (PQC) tests 2025-07-27 12:15:02 +00:00
test_ssl_session.rb [ruby/openssl] Move slow tests to OSSL_TEST_ALL=1 only 2025-07-21 14:31:24 +00:00
test_ts.rb [ruby/openssl] test/openssl/test_ts.rb: make assert_raise blocks smaller 2025-07-21 14:31:24 +00:00
test_x509attr.rb [ruby/openssl] x509attr: avoid using OpenSSL::ASN1 internals in #value= 2024-07-24 16:50:01 +00:00
test_x509cert.rb [ruby/openssl] Require OpenSSL 1.1.1 or later 2025-01-21 18:14:14 +00:00
test_x509crl.rb [ruby/openssl] Require OpenSSL 1.1.1 or later 2025-01-21 18:14:14 +00:00
test_x509ext.rb
test_x509name.rb
test_x509req.rb [ruby/openssl] Require OpenSSL 1.1.1 or later 2025-01-21 18:14:14 +00:00
test_x509store.rb [ruby/openssl] x509store: fix StoreContext#current_cert 2025-07-31 09:45:35 +00:00
ut_eof.rb [ruby/openssl] Add SSLSocket#readbyte 2024-07-03 08:54:18 +00:00
utils.rb [ruby/openssl] ssl: add post-quantum cryptography (PQC) tests 2025-07-27 12:15:02 +00:00