Skip to content

Commit 1fc4386

Browse files
committed
review comments on PR: always define Init_ossl_cms()
1 parent 51b28bc commit 1fc4386

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

ext/openssl/ossl.c

Lines changed: 1 addition & 3 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();
@@ -1044,9 +1045,6 @@ Init_openssl(void)
10441045
Init_ossl_ocsp();
10451046
Init_ossl_pkcs12();
10461047
Init_ossl_pkcs7();
1047-
#if defined(HAVE_CMS_SIGN)
1048-
Init_ossl_cms();
1049-
#endif
10501048
Init_ossl_pkey();
10511049
Init_ossl_provider();
10521050
Init_ossl_rand();

ext/openssl/ossl_cms.c

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
*/
1212
#include "ossl.h"
1313

14-
#if defined(HAVE_CMS_SIGN)
14+
#if !defined(OPENSSL_NO_CMS)
1515
/*
1616
* The CMS_ContentInfo is the primary data structure which this module creates and maintains
1717
* Is is called OpenSSL::CMS::ContentInfo in ruby.
@@ -435,7 +435,7 @@ ossl_cms_s_sign(int argc, VALUE *argv, VALUE klass)
435435
}
436436

437437
/*
438-
* INIT
438+
* INIT CMS interface
439439
*/
440440
void
441441
Init_ossl_cms(void)
@@ -511,4 +511,11 @@ Init_ossl_cms(void)
511511
DefCMSConst(PARTIAL);
512512
}
513513

514-
#endif /* HAVE_CMS_SIGN */
514+
#else
515+
/* empty init function for when OPENSSL_NO_CMS */
516+
void Init_ossl_cms(void)
517+
{
518+
/* nothing */
519+
}
520+
521+
#endif /* OPENSSL_NO_CMS */

0 commit comments

Comments
 (0)