@@ -322,7 +322,16 @@ static int key_destroy(pTHX_ SV* var, MAGIC* magic) {
322
322
static const MGVTBL key_magic = { NULL , NULL , NULL , NULL , key_destroy };
323
323
324
324
325
- MODULE = Crypt ::OpenSSL ::SignCSR PACKAGE = Crypt ::OpenSSL ::SignCSR
325
+ MODULE = Crypt ::OpenSSL ::SignCSR PACKAGE = Crypt ::OpenSSL ::SignCSR PREFIX = signcsr_
326
+
327
+ BOOT :
328
+ ERR_load_crypto_strings ();
329
+ #if OPENSSL_API_COMPAT <= 10100
330
+ ERR_load_ERR_strings ();
331
+ OpenSSL_add_all_algorithms ();
332
+ OpenSSL_add_all_ciphers ();
333
+ OpenSSL_add_all_digests ();
334
+ #endif
326
335
327
336
PROTOTYPES : DISABLE
328
337
@@ -471,8 +480,8 @@ IV set_digest(self, SV* digest)
471
480
else
472
481
RETVAL = 1 ;
473
482
} else {
474
- //printf("Can't change digets to %s\n", digestname);
475
- }
483
+ //printf("Can't change digets to %s\n", digestname);
484
+ }
476
485
477
486
OUTPUT :
478
487
@@ -641,7 +650,7 @@ SV * sign(self, request_SV)
641
650
int ret = do_X509_REQ_verify (csr , pkey , NULL );
642
651
if (ret == 0 )
643
652
croak ("Verification of CSR failed\n" );
644
- if ( ret < 0 )
653
+ if ( ret < 0 )
645
654
croak ("Warning: error while verifying CSR self-signature\n" );
646
655
}
647
656
else
@@ -738,9 +747,9 @@ SV * sign(self, request_SV)
738
747
if (md != NULL )
739
748
digestname = (const char * ) digestname ;
740
749
else {
741
- digestname = NULL ;
742
- printf ("Failed to set the digest md = Null\n" );
743
- }
750
+ digestname = NULL ;
751
+ printf ("Failed to set the digest md = Null\n" );
752
+ }
744
753
//printf ("DIGEST NAME = %s\n", digestname);
745
754
// Allocate and a new digest context for certificate signing
746
755
#if OPENSSL_API_COMPAT <= 10100
@@ -780,3 +789,21 @@ SV * sign(self, request_SV)
780
789
781
790
RETVAL
782
791
792
+ #if OPENSSL_API_COMPAT > 10200
793
+ void signcsr_DESTROY (void )
794
+
795
+ CODE :
796
+ /* deinitialisation is done automatically */
797
+
798
+ #else
799
+ void signcsr_DESTROY (void )
800
+
801
+ CODE :
802
+
803
+ CRYPTO_cleanup_all_ex_data ();
804
+ ERR_free_strings ();
805
+ ERR_remove_state (0 );
806
+ EVP_cleanup ();
807
+
808
+ #endif
809
+
0 commit comments