Port fix from ykpiv-minidriver:

commit 79ae87153c2be06e8193a491e26b799e3b5ba028
Author: Oscar K So JR <oscar@yubico.com>
Date:   Mon Jan 30 22:08:29 2017 +0000

    Fixed Issue #78 - P2 Bug: MXCT352 - Importing PKCS#12 with key size 4096 bits crashed CertUtil.exe
This commit is contained in:
Trevor Bentley
2017-07-03 11:15:27 +02:00
parent 0d2b85fcef
commit 86a0e72dbe
+4
View File
@@ -941,6 +941,10 @@ ykpiv_rc ykpiv_import_private_key(ykpiv_state *state, const unsigned char key, u
if (state == NULL)
return YKPIV_GENERIC_ERROR;
if (p_len + q_len + dp_len + dq_len + qinv_len + ec_data_len >= sizeof(key_data)) {
return YKPIV_SIZE_ERROR;
}
if (key == YKPIV_KEY_CARDMGM ||
key < YKPIV_KEY_RETIRED1 ||
(key > YKPIV_KEY_RETIRED20 && key < YKPIV_KEY_AUTHENTICATION) ||