@@ -55,7 +55,7 @@ int rand_serial(BIGNUM *b, ASN1_INTEGER *ai)
55
55
if (btmp == NULL )
56
56
return 0 ;
57
57
58
- #if OPENSSL_API_COMPAT < 10100
58
+ #if OPENSSL_API_COMPAT <= 10100
59
59
if (!BN_rand (btmp , SERIAL_RAND_BITS , 0 , 0 ))
60
60
#else
61
61
if (!BN_rand (btmp , SERIAL_RAND_BITS , BN_RAND_TOP_ANY , BN_RAND_BOTTOM_ANY ))
@@ -78,22 +78,22 @@ int set_cert_times(X509 *x, const char *startdate, const char *enddate,
78
78
int days )
79
79
{
80
80
if (startdate == NULL || strcmp (startdate , "today" ) == 0 ) {
81
- #if OPENSSL_API_COMPAT < 10100
81
+ #if OPENSSL_API_COMPAT <= 10100
82
82
if (X509_gmtime_adj (X509_get_notBefore (x ), 0 ) == NULL )
83
83
#else
84
84
if (X509_gmtime_adj (X509_getm_notBefore (x ), 0 ) == NULL )
85
85
#endif
86
86
return 0 ;
87
87
} else {
88
- #if OPENSSL_API_COMPAT < 10101
88
+ #if OPENSSL_API_COMPAT <= 10101
89
89
if (!ASN1_TIME_set_string (X509_get_notBefore (x ), startdate ))
90
90
#else
91
91
if (!ASN1_TIME_set_string_X509 (X509_getm_notBefore (x ), startdate ))
92
92
#endif
93
93
return 0 ;
94
94
}
95
95
if (enddate == NULL ) {
96
- #if OPENSSL_API_COMPAT < 10100
96
+ #if OPENSSL_API_COMPAT <= 10100
97
97
if (X509_time_adj_ex (X509_get_notAfter (x ), days , 0 , NULL )
98
98
#else
99
99
if (X509_time_adj_ex (X509_getm_notAfter (x ), days , 0 , NULL )
@@ -631,7 +631,7 @@ SV * sign(self, request_SV, sigopts)
631
631
// Verify the CSR is properly signed
632
632
EVP_PKEY * pkey ;
633
633
if (csr != NULL ) {
634
- #if OPENSSL_API_COMPAT < 10100
634
+ #if OPENSSL_API_COMPAT <= 10100
635
635
pkey = X509_REQ_get_pubkey (csr );
636
636
#else
637
637
pkey = X509_REQ_get0_pubkey (csr );
@@ -667,7 +667,7 @@ SV * sign(self, request_SV, sigopts)
667
667
croak ("X509_set_subject_name cannot set subject name\n" );
668
668
669
669
// Update the certificate with the CSR's public key
670
- #if OPENSSL_API_COMPAT < 10100
670
+ #if OPENSSL_API_COMPAT <= 10100
671
671
if (!X509_set_pubkey (x , X509_REQ_get_pubkey (csr )))
672
672
#else
673
673
if (!X509_set_pubkey (x , X509_REQ_get0_pubkey (csr )))
@@ -744,10 +744,10 @@ SV * sign(self, request_SV, sigopts)
744
744
}
745
745
//printf ("DIGEST NAME = %s\n", digestname);
746
746
// Allocate and a new digest context for certificate signing
747
- #if OPENSSL_API_COMPAT >= 10100
748
- mctx = EVP_MD_CTX_new ();
749
- #else
747
+ #if OPENSSL_API_COMPAT <= 10100
750
748
mctx = EVP_MD_CTX_create ();
749
+ #else
750
+ mctx = EVP_MD_CTX_new ();
751
751
#endif
752
752
753
753
// Sign the new certificate
0 commit comments