@@ -85,7 +85,7 @@ int set_cert_times(X509 *x, const char *startdate, const char *enddate,
85
85
#endif
86
86
return 0 ;
87
87
} else {
88
- #if OPENSSL_API_COMPAT <= 10101
88
+ #if OPENSSL_API_COMPAT <= 11000
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 ))
@@ -100,7 +100,7 @@ int set_cert_times(X509 *x, const char *startdate, const char *enddate,
100
100
#endif
101
101
== NULL )
102
102
return 0 ;
103
- #if OPENSSL_API_COMPAT < 10101
103
+ #if OPENSSL_API_COMPAT <= 11000
104
104
} else if (!ASN1_TIME_set_string (X509_get_notAfter (x ), enddate )) {
105
105
#else
106
106
} else if (!ASN1_TIME_set_string_X509 (X509_getm_notAfter (x ), enddate )) {
@@ -437,18 +437,15 @@ char * get_digest(self)
437
437
CODE :
438
438
SV * * svp ;
439
439
440
+ RETVAL = SvPV_nolen (newSVpv ("" ,0 ));
441
+
440
442
// Get the output format - default is pem format
441
443
if (hv_exists (self , "digest" , strlen ("digest" ))) {
442
444
svp = hv_fetch (self , "digest" , strlen ("digest" ), 0 );
443
445
if (SvROK (* svp )) {
444
446
RETVAL = SvPV_nolen (SvRV (* svp ));
445
447
}
446
448
}
447
- else {
448
- //FIXME this should probably get the default for openssl
449
- //but since nothing was set this is likely most accurate
450
- RETVAL = SvPV_nolen (newSVpv ("" ,0 ));
451
- }
452
449
453
450
OUTPUT :
454
451
@@ -493,16 +490,15 @@ char * get_format(self)
493
490
CODE :
494
491
SV * * svp ;
495
492
493
+ RETVAL = SvPV_nolen (newSVpv ("" ,0 ));
494
+
496
495
// Get the output format - default is pem format
497
496
if (hv_exists (self , "format" , strlen ("format" ))) {
498
497
svp = hv_fetch (self , "format" , strlen ("format" ), 0 );
499
498
if (SvROK (* svp )) {
500
499
RETVAL = SvPV_nolen (SvRV (* svp ));
501
500
}
502
501
}
503
- else {
504
- RETVAL = SvPV_nolen (newSVpv ("" ,0 ));
505
- }
506
502
507
503
OUTPUT :
508
504
@@ -512,7 +508,7 @@ IV set_format(self, SV* format)
512
508
HV * self ;
513
509
514
510
CODE :
515
- IV ret = 0 ;
511
+ RETVAL = 0 ;
516
512
517
513
if (sv_cmp (format , newSVpv ("pem" , 0 )) == 0 ||
518
514
sv_cmp (format , newSVpv ("text" , 0 )) == 0 )
@@ -522,7 +518,7 @@ IV set_format(self, SV* format)
522
518
else
523
519
RETVAL = 1 ;
524
520
} else {
525
- RETVAL = ret ;
521
+ RETVAL = 0 ;
526
522
}
527
523
528
524
OUTPUT :
@@ -535,6 +531,7 @@ IV get_days(self)
535
531
CODE :
536
532
SV * * svp ;
537
533
534
+ RETVAL = -1 ;
538
535
// Get the number of days for specified - default 365
539
536
if (hv_exists (self , "days" , strlen ("days" ))) {
540
537
svp = hv_fetch (self , "days" , strlen ("days" ), 0 );
@@ -551,6 +548,7 @@ IV set_days(self, IV days)
551
548
HV * self ;
552
549
553
550
CODE :
551
+ RETVAL = 0 ;
554
552
555
553
if ((hv_store (self , "days" , 4 , newSViv (days ), 0 )) == NULL )
556
554
RETVAL = 0 ;
@@ -582,7 +580,7 @@ SV * sign(self, request_SV)
582
580
STRLEN digestname_length ;
583
581
IV days ;
584
582
SV * digest = NULL ;
585
- SV * format ;
583
+ SV * format = NULL ;
586
584
587
585
if (!hv_exists (self , "privkey" , strlen ("privkey" )))
588
586
croak ("privkey not found in self!\n" );
@@ -802,7 +800,9 @@ void signcsr_DESTROY(void)
802
800
803
801
CRYPTO_cleanup_all_ex_data ();
804
802
ERR_free_strings ();
803
+ #if OPENSSL_API_COMPAT < 10000
805
804
ERR_remove_state (0 );
805
+ #endif
806
806
EVP_cleanup ();
807
807
808
808
#endif
0 commit comments