@@ -658,7 +658,7 @@ static CK_RV pkcs11_derive_with_mechanism(PKCS11_OBJECT_private *key,
658658 if (newkey != CK_INVALID_HANDLE )
659659 CRYPTOKI_call (ctx , C_DestroyObject (session , newkey ));
660660
661- OPENSSL_clear_free (value , value_len_alloc );
661+ pkcs11_clear_free (value , value_len_alloc );
662662 pkcs11_session_pool_release (slot , session );
663663 return rv ;
664664}
@@ -784,7 +784,7 @@ static CK_RV pkcs11_decapsulate_with_mechanism(
784784 if (newkey != CK_INVALID_HANDLE )
785785 CRYPTOKI_call (ctx , C_DestroyObject (session , newkey ));
786786
787- OPENSSL_clear_free (value , value_len_alloc );
787+ pkcs11_clear_free (value , value_len_alloc );
788788 pkcs11_session_pool_release (slot , session );
789789 return rv ;
790790}
@@ -863,7 +863,12 @@ static int pkcs11_build_digestinfo(const char *mdname,
863863 if (x509_sig == NULL )
864864 return 0 ;
865865
866+ #if OPENSSL_VERSION_NUMBER < 0x10100000L
867+ alg = x509_sig -> algor ;
868+ digest = x509_sig -> digest ;
869+ #else
866870 X509_SIG_getm (x509_sig , & alg , & digest );
871+ #endif
867872
868873 if (!X509_ALGOR_set0 (alg , OBJ_nid2obj (EVP_MD_type (md )), V_ASN1_NULL , NULL ))
869874 goto err ;
@@ -1341,7 +1346,7 @@ extern int pkcs11_evp_pkey_ecdh_derive(PKCS11_OBJECT_private *key,
13411346
13421347 rv = pkcs11_derive_with_mechanism (key , & mechanism , secret , secretlen );
13431348
1344- OPENSSL_clear_free (der_pub , der_pub_len );
1349+ pkcs11_clear_free (der_pub , der_pub_len );
13451350
13461351 if (rv != CKR_OK )
13471352 return -1 ;
0 commit comments