Skip to content

This adds CMS support to the Ruby layer. #917

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

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions ext/openssl/extconf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,9 @@ def find_openssl_library
# added in 1.1.0, currently not in LibreSSL
have_func("EVP_PBE_scrypt(\"\", 0, (unsigned char *)\"\", 0, 0, 0, 0, 0, NULL, 0)", evp_h)

# look for CMS code, normally included, but some variations compile it out
have_func("CMS_sign", ssl_h)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ruby/openssl currently aims to support OpenSSL 1.1.1 or later, LibreSSL versions that are supported by upstream, and the latest version of AWS-LC.

I think we can use !defined(OPENSSL_NO_CMS) without this mkmf check.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I put this in during 1.1.1, because I found that some targets (maybe it was openwrt) did not include CMS for space reasons.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAIK OPENSSL_NO_XXX macros are provided for this purpose. Their headers should have the macro if it is compiled with ./Configure no-cms.


# added in OpenSSL 1.1.1 and LibreSSL 3.5.0, then removed in LibreSSL 4.0.0
have_func("EVP_PKEY_check(NULL)", evp_h)

Expand Down
1 change: 1 addition & 0 deletions ext/openssl/ossl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1035,6 +1035,7 @@ Init_openssl(void)
Init_ossl_asn1();
Init_ossl_bn();
Init_ossl_cipher();
Init_ossl_cms();
Init_ossl_config();
Init_ossl_digest();
Init_ossl_engine();
Expand Down
2 changes: 2 additions & 0 deletions ext/openssl/ossl.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

#include <openssl/opensslv.h>

#include <openssl/cms.h>
#include <openssl/err.h>
#include <openssl/asn1.h>
#include <openssl/x509v3.h>
Expand Down Expand Up @@ -185,6 +186,7 @@ extern VALUE dOSSL;
#include "ossl_bn.h"
#include "ossl_cipher.h"
#include "ossl_config.h"
#include "ossl_cms.h"
#include "ossl_digest.h"
#include "ossl_engine.h"
#include "ossl_hmac.h"
Expand Down
Loading
Loading