Skip to content

Commit 4b10acc

Browse files
committed
Include all of 1.1 Openssl releases in older functions
1 parent b9d2ae4 commit 4b10acc

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

SignCSR.xs

+9-9
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ int rand_serial(BIGNUM *b, ASN1_INTEGER *ai)
5555
if (btmp == NULL)
5656
return 0;
5757

58-
#if OPENSSL_API_COMPAT < 10100
58+
#if OPENSSL_API_COMPAT <= 10100
5959
if (!BN_rand(btmp, SERIAL_RAND_BITS, 0, 0))
6060
#else
6161
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,
7878
int days)
7979
{
8080
if (startdate == NULL || strcmp(startdate, "today") == 0) {
81-
#if OPENSSL_API_COMPAT < 10100
81+
#if OPENSSL_API_COMPAT <= 10100
8282
if (X509_gmtime_adj(X509_get_notBefore(x), 0) == NULL)
8383
#else
8484
if (X509_gmtime_adj(X509_getm_notBefore(x), 0) == NULL)
8585
#endif
8686
return 0;
8787
} else {
88-
#if OPENSSL_API_COMPAT < 10101
88+
#if OPENSSL_API_COMPAT <= 10101
8989
if (!ASN1_TIME_set_string(X509_get_notBefore(x), startdate))
9090
#else
9191
if (!ASN1_TIME_set_string_X509(X509_getm_notBefore(x), startdate))
9292
#endif
9393
return 0;
9494
}
9595
if (enddate == NULL) {
96-
#if OPENSSL_API_COMPAT < 10100
96+
#if OPENSSL_API_COMPAT <= 10100
9797
if (X509_time_adj_ex(X509_get_notAfter(x), days, 0, NULL)
9898
#else
9999
if (X509_time_adj_ex(X509_getm_notAfter(x), days, 0, NULL)
@@ -631,7 +631,7 @@ SV * sign(self, request_SV, sigopts)
631631
// Verify the CSR is properly signed
632632
EVP_PKEY *pkey;
633633
if (csr != NULL) {
634-
#if OPENSSL_API_COMPAT < 10100
634+
#if OPENSSL_API_COMPAT <= 10100
635635
pkey = X509_REQ_get_pubkey(csr);
636636
#else
637637
pkey = X509_REQ_get0_pubkey(csr);
@@ -667,7 +667,7 @@ SV * sign(self, request_SV, sigopts)
667667
croak("X509_set_subject_name cannot set subject name\n");
668668

669669
// Update the certificate with the CSR's public key
670-
#if OPENSSL_API_COMPAT < 10100
670+
#if OPENSSL_API_COMPAT <= 10100
671671
if (!X509_set_pubkey(x, X509_REQ_get_pubkey(csr)))
672672
#else
673673
if (!X509_set_pubkey(x, X509_REQ_get0_pubkey(csr)))
@@ -744,10 +744,10 @@ SV * sign(self, request_SV, sigopts)
744744
}
745745
//printf ("DIGEST NAME = %s\n", digestname);
746746
// 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
750748
mctx = EVP_MD_CTX_create();
749+
#else
750+
mctx = EVP_MD_CTX_new();
751751
#endif
752752

753753
// Sign the new certificate

0 commit comments

Comments
 (0)