Skip to content

Commit

Permalink
do not include CMS code with LIBRESSL, as it has no CMS code
Browse files Browse the repository at this point in the history
  • Loading branch information
mcr committed Dec 27, 2018
1 parent b7f68eb commit 156f8df
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions ext/openssl/extconf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ def find_openssl_library
have_func("X509_get0_notBefore")
have_func("SSL_SESSION_get_protocol_version")
have_func("EVP_PBE_scrypt")
have_func("CMS_sign")

Logging::message "=== Checking done. ===\n"

Expand Down
2 changes: 2 additions & 0 deletions ext/openssl/ossl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1202,7 +1202,9 @@ Init_openssl(void)
Init_ossl_ns_spki();
Init_ossl_pkcs12();
Init_ossl_pkcs7();
#if defined(HAVE_CMS_SIGN)
Init_ossl_cms();
#endif
Init_ossl_pkey();
Init_ossl_rand();
Init_ossl_ssl();
Expand Down
2 changes: 2 additions & 0 deletions ext/openssl/ossl.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@
#include <openssl/ssl.h>
#include <openssl/pkcs12.h>
#include <openssl/pkcs7.h>
#if defined(HAVE_CMS_SIGN)
#include <openssl/cms.h>
#endif
#include <openssl/hmac.h>
#include <openssl/rand.h>
#include <openssl/conf.h>
Expand Down
3 changes: 3 additions & 0 deletions ext/openssl/ossl_cms.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
*/
#include "ossl.h"

#if defined(HAVE_CMS_SIGN)
/*
* The CMS_ContentInfo is the primary data structure which this module creates and maintains
* Is is called OpenSSL::CMS::ContentInfo in ruby.
Expand Down Expand Up @@ -496,3 +497,5 @@ Init_ossl_cms(void)
DefCMSConst(STREAM);
DefCMSConst(PARTIAL);
}

#endif /* HAVE_CMS_SIGN */

0 comments on commit 156f8df

Please sign in to comment.