Disable runtime detection of md5 and sha1 support for Utimaco HSM.

Utimaco HSM requires user to be logged in before executing DigestUpdate, thus
breaking dst_lib_init2 that ran isc_md5_check and isc_sha1_check before sending
PIN to the HSM.  Therefore isc_*_check needs to be disabled when Utimaco HSM is
being used as PKCS#11 library.
This commit is contained in:
Ondřej Surý
2018-11-09 00:07:55 +07:00
parent 2079e44fb9
commit 52784fc3cc
+4 -1
View File
@@ -355,12 +355,13 @@ dst__hmacmd5_init(dst_func_t **funcp) {
}
#endif
#if PK11_FLAVOR != PK11_UTIMACO_FLAVOR
/*
* Prevent use of incorrect crypto
*/
RUNTIME_CHECK(isc_md5_check(false));
RUNTIME_CHECK(isc_hmacmd5_check(0));
#endif
REQUIRE(funcp != NULL);
if (*funcp == NULL)
@@ -648,11 +649,13 @@ static dst_func_t hmacsha1_functions = {
isc_result_t
dst__hmacsha1_init(dst_func_t **funcp) {
#if PK11_FLAVOR != PK11_UTIMACO_FLAVOR
/*
* Prevent use of incorrect crypto
*/
RUNTIME_CHECK(isc_sha1_check(false));
RUNTIME_CHECK(isc_hmacsha1_check(0));
#endif
REQUIRE(funcp != NULL);
if (*funcp == NULL)