opencryptoki/SOURCES/opencryptoki-CVE-2024-0914-part4.patch

1014 lines
57 KiB
Diff
Raw Normal View History

commit 7d064610937cdfb3cf8976adbb7eec6be3ea9d9f
Author: Ingo Franzki <ifranzki@linux.ibm.com>
Date: Tue Jan 16 10:01:20 2024 +0100
testcases: Add RSA implicit rejection test cases
Signed-off-by: Ingo Franzki <ifranzki@linux.ibm.com>
diff --git a/testcases/crypto/rsa.h b/testcases/crypto/rsa.h
index 7ed70262..6281d982 100644
--- a/testcases/crypto/rsa.h
+++ b/testcases/crypto/rsa.h
@@ -8977,3 +8977,817 @@ struct PUBLISHED_TEST_SUITE_INFO rsa_encdec_import_test_suites[] = {
.mech = {CKM_RSA_X_509, 0, 0},
},
};
+
+struct RSA_PUBLISHED_TEST_VECTOR rsa_imp_rejection_tv[] = {
+ { // 0 - good case
+ .mod = {0xc8, 0xcc, 0x83, 0x97, 0x14, 0x09, 0x8d, 0xa5,
+ 0x6c, 0xaa, 0x23, 0x64, 0x0f, 0x93, 0xdc, 0x89,
+ 0x97, 0xc1, 0x63, 0x72, 0x96, 0x8f, 0xc1, 0xb0,
+ 0xc6, 0xdf, 0x51, 0x13, 0xc1, 0xc9, 0x4e, 0x8b,
+ 0x21, 0xe4, 0x8a, 0xd2, 0x29, 0x7e, 0x65, 0x41,
+ 0x90, 0x11, 0xb4, 0xe6, 0xd8, 0xf5, 0xe7, 0x3b,
+ 0x1b, 0x78, 0xb2, 0x57, 0x40, 0x03, 0x21, 0xd1,
+ 0xef, 0x6b, 0x60, 0x2d, 0x4e, 0xc8, 0xce, 0x8d,
+ 0x14, 0x1c, 0x94, 0x90, 0x5e, 0xb4, 0xad, 0x30,
+ 0x66, 0x39, 0xa4, 0x92, 0x06, 0x53, 0x4b, 0x6e,
+ 0x7f, 0x26, 0x07, 0x42, 0x3e, 0x97, 0xdf, 0xfd,
+ 0x13, 0x3c, 0x88, 0xd7, 0x21, 0x39, 0x9d, 0xef,
+ 0xbc, 0x7e, 0x96, 0xcc, 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d, 0x60, 0x37, 0x46, 0xbe,
+ 0x13, 0xc1, 0x0d, 0x4e, 0x3e, 0x60, 0x22, 0xeb,
+ 0xc9, 0x05, 0xd2, 0x0c, 0x2a, 0x7f, 0x32, 0xb2,
+ 0x15, 0xa4, 0xcd, 0x53, 0xb3, 0xf4, 0x4c, 0xa1,
+ 0xc3, 0x27, 0xd2, 0xc2, 0xb6, 0x51, 0x14, 0x58,
+ 0x21, 0xc0, 0x83, 0x96, 0xc8, 0x90, 0x71, 0xf6,
+ 0x65, 0x34, 0x9c, 0x25, 0xe4, 0x4d, 0x27, 0x33,
+ 0xcd, 0x93, 0x05, 0x98, 0x5c, 0xee, 0xf6, 0x43,
+ 0x0c, 0x3c, 0xf5, 0x7a, 0xf5, 0xfa, 0x22, 0x40,
+ 0x89, 0x22, 0x12, 0x18, 0xfa, 0x34, 0x73, 0x7c,
+ 0x79, 0xc4, 0x46, 0xd2, 0x8a, 0x94, 0xc4, 0x1c,
+ 0x96, 0xe4, 0xe9, 0x2a, 0xc5, 0x3f, 0xbc, 0xf3,
+ 0x84, 0xde, 0xa8, 0x41, 0x9e, 0xa0, 0x89, 0xf8,
+ 0x78, 0x44, 0x45, 0xa4, 0x92, 0xc8, 0x12, 0xeb,
+ 0x0d, 0x40, 0x94, 0x67, 0xf7, 0x5a, 0xfd, 0x7d,
+ 0x4d, 0x10, 0x78, 0x88, 0x62, 0x05, 0xa0, 0x66},
+ .msg_len = 256,
+ // sig is decrypted message
+ .sig = { 0x6c, 0x6f, 0x72, 0x65, 0x6d, 0x20, 0x69, 0x70,
+ 0x73, 0x75, 0x6d, 0x20, 0x64, 0x6f, 0x6c, 0x6f,
+ 0x72, 0x20, 0x73, 0x69, 0x74, 0x20, 0x61, 0x6d,
+ 0x65, 0x74},
+ .sig_len = 26,
+ },
+ { // 1 - bad, empty input
+ .mod = {0xc8, 0xcc, 0x83, 0x97, 0x14, 0x09, 0x8d, 0xa5,
+ 0x6c, 0xaa, 0x23, 0x64, 0x0f,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0x2e, 0x72, 0xf3,
+ 0xa6, 0x7c, 0xd2, 0x89, 0x71, 0x15, 0x03, 0xc8,
+ 0x55, 0x16, 0xa9, 0xed, 0x22, 0x54, 0x22, 0xf9,
+ 0x8b, 0x11, 0x6f, 0x1a, 0xb0, 0x80, 0xa8, 0x0a,
+ 0xbd, 0x6f, 0x02, 0x16, 0xdf, 0x88, 0xd8, 0xcf,
+ 0xd6, 0x7c, 0x13, 0x92, 0x43, 0xbe, 0x8d, 0xd7,
+ 0x85, 0x02, 0xa7, 0xaa, 0xf6, 0xbc, 0x99, 0xd7,
+ 0xda, 0x71, 0xbc, 0xdf, 0x62, 0x7e, 0x73, 0x54},
+ .msg_len = 256,
+ // sig is decrypted message
+ .sig = { 0x0f, 0x9b},
+ .sig_len = 2,
+ },
+};
+
+#define NUM_OF_IMPLICIT_REJECTION_TESTSUITES 1
+struct PUBLISHED_TEST_SUITE_INFO rsa_implicit_rejection_test_suites[] = {
+ {
+ .name = "RSA PKCS v1.5",
+ .tvcount = 4,
+ .tv = rsa_imp_rejection_tv,
+ .mech = {CKM_RSA_PKCS, 0, 0},
+ },
+};
diff --git a/testcases/crypto/rsa_func.c b/testcases/crypto/rsa_func.c
index 2c9984d0..c092110e 100644
--- a/testcases/crypto/rsa_func.c
+++ b/testcases/crypto/rsa_func.c
@@ -1963,6 +1963,164 @@ testcase_cleanup:
return rc;
}
+CK_RV do_RSAImplicitRejection(struct PUBLISHED_TEST_SUITE_INFO *tsuite)
+{
+ unsigned int i;
+ CK_BYTE decrypt[BIG_REQUEST];
+ CK_ULONG decrypt_len;
+ CK_MECHANISM mech;
+ CK_OBJECT_HANDLE priv_key = CK_INVALID_HANDLE;
+ CK_SLOT_ID slot_id = SLOT_ID;
+ CK_SESSION_HANDLE session;
+ CK_FLAGS flags;
+ CK_BYTE user_pin[PKCS11_MAX_PIN_LEN];
+ CK_ULONG user_pin_len;
+ CK_RV rc, loc_rc;
+
+ char *s;
+
+ // begin testsuite
+ testsuite_begin("%s Implicit Rejection.", tsuite->name);
+ testcase_rw_session();
+ testcase_user_login();
+
+ if (!is_ica_token(slot_id) && !is_soft_token(slot_id)) {
+ testsuite_skip(tsuite->tvcount,
+ "Slot %u doesn't support Implicit Rejection",
+ (unsigned int) slot_id);
+ goto testcase_cleanup;
+ }
+ // skip tests if the slot doesn't support this mechanism
+ if (!mech_supported(slot_id, tsuite->mech.mechanism)) {
+ testsuite_skip(tsuite->tvcount,
+ "Slot %u doesn't support %s (0x%x)",
+ (unsigned int) slot_id,
+ mech_to_str(tsuite->mech.mechanism),
+ (unsigned int) tsuite->mech.mechanism);
+ goto testcase_cleanup;
+ }
+
+ // iterate over test vectors
+ for (i = 0; i < tsuite->tvcount; i++) {
+
+ // get public exponent from test vector
+ if (p11_ahex_dump(&s, tsuite->tv[i].pub_exp,
+ tsuite->tv[i].pubexp_len) == NULL) {
+ testcase_error("p11_ahex_dump() failed");
+ rc = -1;
+ goto testcase_cleanup;
+ }
+ // begin testcase
+ testcase_begin("%s Implicit Rejection with test vector %u."
+ "\npubl_exp='%s', modbits=%lu, publ_exp_len=%lu.",
+ tsuite->name, i, s,
+ tsuite->tv[i].mod_len * 8,
+ tsuite->tv[i].pubexp_len);
+
+ rc = CKR_OK;
+
+ if (!keysize_supported(slot_id, tsuite->mech.mechanism,
+ tsuite->tv[i].mod_len * 8)) {
+ testcase_skip("Token in slot %lu cannot be used with modbits='%lu'",
+ SLOT_ID, tsuite->tv[i].mod_len * 8);
+ free(s);
+ continue;
+ }
+
+ free(s);
+
+ // clear buffers
+ memset(decrypt, 0, BIG_REQUEST);
+
+ // create (private) key handle
+ rc = create_RSAPrivateKey(session,
+ tsuite->tv[i].mod,
+ tsuite->tv[i].pub_exp,
+ tsuite->tv[i].priv_exp,
+ tsuite->tv[i].prime1,
+ tsuite->tv[i].prime2,
+ tsuite->tv[i].exp1,
+ tsuite->tv[i].exp2,
+ tsuite->tv[i].coef,
+ tsuite->tv[i].mod_len,
+ tsuite->tv[i].pubexp_len,
+ tsuite->tv[i].privexp_len,
+ tsuite->tv[i].prime1_len,
+ tsuite->tv[i].prime2_len,
+ tsuite->tv[i].exp1_len,
+ tsuite->tv[i].exp2_len,
+ tsuite->tv[i].coef_len, &priv_key);
+ if (rc != CKR_OK) {
+ if (rc == CKR_POLICY_VIOLATION) {
+ testcase_skip("RSA key import is not allowed by policy");
+ continue;
+ }
+
+ testcase_error("create_RSAPrivateKey(), rc=%s", p11_get_ckr(rc));
+ goto error;
+ }
+
+ // set cipher buffer length
+ decrypt_len = BIG_REQUEST;
+
+ // get mech
+ mech = tsuite->mech;
+
+ // initialize (private key) decryption
+ rc = funcs->C_DecryptInit(session, &mech, priv_key);
+ if (rc != CKR_OK) {
+ testcase_error("C_DecryptInit, rc=%s", p11_get_ckr(rc));
+ goto tv_cleanup;
+ }
+ // do (private key) decryption
+ rc = funcs->C_Decrypt(session, tsuite->tv[i].msg, tsuite->tv[i].msg_len,
+ decrypt, &decrypt_len);
+ if (rc != CKR_OK) {
+ testcase_error("C_Decrypt, rc=%s", p11_get_ckr(rc));
+ goto tv_cleanup;
+ }
+
+ // check results
+ testcase_new_assertion();
+
+ if (decrypt_len != tsuite->tv[i].sig_len) {
+ testcase_fail("decrypted length does not match"
+ "expected data length.\n expected length = %lu, "
+ "but found length=%lu.\n",
+ tsuite->tv[i].sig_len, decrypt_len);
+ } else if (memcmp(decrypt, tsuite->tv[i].sig, tsuite->tv[i].sig_len)) {
+ testcase_fail("decrypted data does not match expected data.");
+ } else {
+ testcase_pass("Implicit Rejection.");
+ }
+
+ // clean up
+tv_cleanup:
+
+ rc = funcs->C_DestroyObject(session, priv_key);
+ if (rc != CKR_OK) {
+ testcase_error("C_DestroyObject(), rc=%s.", p11_get_ckr(rc));
+ goto error;
+ }
+ }
+
+ goto testcase_cleanup;
+error:
+ loc_rc = funcs->C_DestroyObject(session, priv_key);
+ if (loc_rc != CKR_OK) {
+ testcase_error("C_DestroyObject(), rc=%s.", p11_get_ckr(loc_rc));
+ }
+
+testcase_cleanup:
+ testcase_user_logout();
+ loc_rc = funcs->C_CloseAllSessions(slot_id);
+ if (loc_rc != CKR_OK) {
+ testcase_error("C_CloseAllSessions, rc=%s", p11_get_ckr(loc_rc));
+ }
+
+ return rc;
+}
+
CK_RV rsa_funcs(void)
{
unsigned int i;
@@ -2032,6 +2190,13 @@ CK_RV rsa_funcs(void)
break;
}
+ // Implicit rejection tests
+ for (i = 0; i < NUM_OF_IMPLICIT_REJECTION_TESTSUITES; i++) {
+ rv = do_RSAImplicitRejection(&rsa_implicit_rejection_test_suites[i]);
+ if (rv != CKR_OK && (!no_stop))
+ break;
+ }
+
return rv;
}