-
Notifications
You must be signed in to change notification settings - Fork 167
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle empty signed data in PKCS7 #690
Conversation
…along with some unit tests (ruby#493) Add OpenSSL::SSL::SSLContext#ciphersuites= method along with unit tests.
I use ruby.git's tool/sync_default_gems.rb and simple git cherry-pick instead nowadays. These tasks actually don't correctly work because they use outdated path references and expect ruby.git to be using git-svn, which is not the case anymore. Reported-by: rkoster <[email protected]> Fixes: ruby#495
Install openssl with vcpkg on mswin
LibreSSL 3.5 switched the cipher naming to match OpenSSL.
The + tag can only be used for single words. For multiple words the <tt> tag has to be used.
Fix formatting in docs
Update actions at 2022/3
Use SHA256 for OCSP BasicResponse and Request
[CI] add Ubuntu-22.04 and update mswin, all are OpenSSL 3
ignore pkgconfig when openssl-dir option is specified
While building with a custom build of OpenSSL, I noticed in mkmf.log that all the feature detection checks are done using a program lacking an OpenSSL header include. `mkmf` retries using a fallback program when this fails, but that means all the `have_func` calls compile twice when compiling once should suffice. Example log without this commit: have_func: checking for X509_STORE_CTX_get0_cert()... -------------------- yes DYLD_FALLBACK_LIBRARY_PATH=.:../.. "clang -o conftest ... conftest.c:14:57: error: use of undeclared identifier 'X509_STORE_CTX_get0_cert' int t(void) { void ((*volatile p)()); p = (void ((*)()))X509_STORE_CTX_get0_cert; return !p; } ^ 1 error generated. checked program was: /* begin */ 1: #include "ruby.h" 2: 3: /*top*/ 4: extern int t(void); 5: int main(int argc, char **argv) 6: { 7: if (argc > 1000000) { 8: int (* volatile tp)(void)=(int (*)(void))&t; 9: printf("%d", (*tp)()); 10: } 11: 12: return !!argv[argc]; 13: } 14: int t(void) { void ((*volatile p)()); p = (void ((*)()))X509_STORE_CTX_get0_cert; return !p; } /* end */ DYLD_FALLBACK_LIBRARY_PATH=.:../.. "clang -o conftest ... checked program was: /* begin */ 1: #include "ruby.h" 2: 3: /*top*/ 4: extern int t(void); 5: int main(int argc, char **argv) 6: { 7: if (argc > 1000000) { 8: int (* volatile tp)(void)=(int (*)(void))&t; 9: printf("%d", (*tp)()); 10: } 11: 12: return !!argv[argc]; 13: } 14: extern void X509_STORE_CTX_get0_cert(); 15: int t(void) { X509_STORE_CTX_get0_cert(); return 0; } /* end */ The second compilation succeeds. Specify the header for each checked function.
It does not raise an error when setting an invalid value to SSLContext ciphers on Ubuntu 18.04.
Skip a new test when old OpenSSL
X509_STORE_get_ex_new_index() is a macro, so passing just its name to have_func() doesn't detect it. Pass an example call instead. Co-authored-by: Nobuyoshi Nakada <[email protected]>
Check for OpenSSL functions in headers
[CI] test.yml - test-openssls - use 1.1.1q, 3.0.5
[CI] TestHMAC#test_dup - remove 'pend' for OpenSSL 3
Add OpenSSL::SSL::SSLSocket#export_keying_material to support RFC 5705
Run the test with `assert_separately` for the `false` value of the `OpenSSL.fips_mode` not to affect other tests.
* Split the test in the FIPS case as another test. * test/openssl/utils.rb: Add omit_on_fips and omit_on_non_fips methods.
Fix test_pkey_ec.rb on FIPS.
…ns/checkout-4 Bump actions/checkout from 3 to 4
* Reword the description in README for more clarity. * Add a compatibility matrix of our stable branches and explain the maintenance policy. * Remove the obsolete paragraph for how to use the gem in Ruby 2.3, which is no longer supported.
Exact checks with `assert_include`
Where `assert_match` converts string matcher argument to regexp first with escaping, `assert_include` does the same thing simpler.
Exact checks with `assert_include`
CI: Upgrade OpenSSL and LibreSSL versions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍🏼
I think we should reject such input in
Apparently, this is technically a valid PKCS#7 structure (https://datatracker.ietf.org/doc/html/rfc2315#section-7):
but the FWIW, IETF's successor of PKCS#7, CMS (https://datatracker.ietf.org/doc/html/rfc2630#section-3) defines a separate structure EncapsulatedContentInfo for this use case and disallows ContentInfo to omit |
This is not a new bug. I changed the base branch to the oldest supported one (gem 3.0/Ruby 3.1). |
…d data Fixes [Bug #19974]
d84a5f2
to
5325c06
Compare
I updated the PR to raise an error in #initialize if there should be signed data but there is not. |
Sorry for the slow followup. In addition to It seems the enveloped-data content type has the same issue:
I didn't check other content types, but since there doesn't seem a valid use case for such encoding anyway (considering that CMS disallows it while claiming compatibility with PKCS#7), I think we can safely reject all |
@rhenium I updated PKCS7.read_smime to raise the same error. |
@rhenium Now, we see 227 commits on this PR to the I just wanted to share how I was backporting something as a reference. I was working for the |
To completely fix the null-def issue the following change should be made on this PR:
|
This will have certificates and crls return nil instead of segfaulting.
Fixes [Bug #19974]