ruby/ext
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
..
-test- Fix ext/-test-/namespace/yay{1,2} for mswin 2025-07-29 13:25:09 +09:00
cgi/escape Update dependencies for addition of set.h to public headers 2025-07-11 15:24:23 +09:00
continuation Update dependencies for addition of set.h to public headers 2025-07-11 15:24:23 +09:00
coverage Update dependencies for addition of set.h to public headers 2025-07-11 15:24:23 +09:00
date Update dependencies for addition of set.h to public headers 2025-07-11 15:24:23 +09:00
digest Update dependencies for addition of set.h to public headers 2025-07-11 15:24:23 +09:00
erb/escape [ruby/erb] Declare escape functions as Ractor-safe 2025-07-15 16:30:55 +00:00
etc [ruby/etc] Bump up v1.4.6 2025-07-15 07:24:28 +00:00
fcntl Update dependencies for addition of set.h to public headers 2025-07-11 15:24:23 +09:00
io [ruby/io-wait] Bump up 0.3.2 2025-07-17 11:16:30 +09:00
json [ruby/json] Release 2.13.2 2025-07-29 10:41:09 +09:00
monitor Update dependencies for addition of set.h to public headers 2025-07-11 15:24:23 +09:00
objspace Get rid of RSHAPE_PARENT in favor of RSHAPE_DIRECT_CHILD_P 2025-07-31 21:55:51 +02:00
openssl [ruby/openssl] pkcs7: make PKCS7#add_recipient actually useful 2025-08-01 12:04:06 +00:00
psych Update dependencies for addition of set.h to public headers 2025-07-11 15:24:23 +09:00
pty Update dependencies for addition of set.h to public headers 2025-07-11 15:24:23 +09:00
rbconfig/sizeof Update dependencies for addition of set.h to public headers 2025-07-11 15:24:23 +09:00
ripper Update dependencies for addition of set.h to public headers 2025-07-11 15:24:23 +09:00
rubyvm Added depend files 2019-07-14 01:31:29 +09:00
socket Prevent a warning: old-style function definition 2025-07-23 16:46:01 +09:00
stringio Update dependencies for addition of set.h to public headers 2025-07-11 15:24:23 +09:00
strscan Update dependencies for addition of set.h to public headers 2025-07-11 15:24:23 +09:00
win32 [ruby/win32-registry] Minor readme improvements and typo fixes 2025-06-17 05:52:04 +00:00
zlib Update dependencies for addition of set.h to public headers 2025-07-11 15:24:23 +09:00
.document [DOC] Include pathname_builtin.rb documents 2025-07-15 20:51:16 +09:00
extmk.rb [Bug #21092] Fallback variables after execonf has done 2025-01-30 14:52:01 +09:00
Setup Clean up removed directories in ext/Setup* [ci skip] 2023-01-18 12:02:27 +09:00
Setup.atheos racc/cparse is extracted from ruby/ruby repository 2023-06-08 18:05:07 +09:00
Setup.nt racc/cparse is extracted from ruby/ruby repository 2023-06-08 18:05:07 +09:00