Skip to content

Commit c341909

Browse files
committed
This adds CMS support to the Ruby layer.
The CMS_ContentInfo object can be used. Access to the CMS_SignedInfo structure exists, but it can not be created or freed, as it is just a pointer into CMS_ContentInfo stack. feat: added NOINTERN and NO_SIGNER_CERT_VERIFY flags feat: look for CMS_sign, and set HAVE_CMS_SIGN if present, enabling CMS support
1 parent 58cf287 commit c341909

File tree

6 files changed

+647
-0
lines changed

6 files changed

+647
-0
lines changed

ext/openssl/extconf.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,9 @@ def find_openssl_library
143143
# added in 1.1.0, currently not in LibreSSL
144144
have_func("EVP_PBE_scrypt(\"\", 0, (unsigned char *)\"\", 0, 0, 0, 0, 0, NULL, 0)", evp_h)
145145

146+
# look for CMS code, normally included, but some variations compile it out
147+
have_func("CMS_sign", ssl_h)
148+
146149
# added in OpenSSL 1.1.1 and LibreSSL 3.5.0, then removed in LibreSSL 4.0.0
147150
have_func("EVP_PKEY_check(NULL)", evp_h)
148151

ext/openssl/ossl.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1035,6 +1035,7 @@ Init_openssl(void)
10351035
Init_ossl_asn1();
10361036
Init_ossl_bn();
10371037
Init_ossl_cipher();
1038+
Init_ossl_cms();
10381039
Init_ossl_config();
10391040
Init_ossl_digest();
10401041
Init_ossl_engine();

ext/openssl/ossl.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@
2525

2626
#include <openssl/opensslv.h>
2727

28+
#if !defined(OPENSSL_NO_CMS)
29+
#include <openssl/cms.h>
30+
31+
#endif
2832
#include <openssl/err.h>
2933
#include <openssl/asn1.h>
3034
#include <openssl/x509v3.h>
@@ -185,6 +189,7 @@ extern VALUE dOSSL;
185189
#include "ossl_bn.h"
186190
#include "ossl_cipher.h"
187191
#include "ossl_config.h"
192+
#include "ossl_cms.h"
188193
#include "ossl_digest.h"
189194
#include "ossl_engine.h"
190195
#include "ossl_hmac.h"

0 commit comments

Comments
 (0)