From 113a842bfeba67ca19a11b6cb265c5f4e644c986 Mon Sep 17 00:00:00 2001 From: Florent Plard <175201264+fpl-switstack@users.noreply.github.com> Date: Thu, 11 Jun 2026 12:26:57 +0200 Subject: [PATCH] Add support for wrapping/unwrapping using CKM_AES_GCM mechanism --- src/lib/SoftHSM.cpp | 293 ++++++++--- src/lib/test/SymmetricAlgorithmTests.cpp | 620 ++++++++++++++--------- src/lib/test/SymmetricAlgorithmTests.h | 30 +- 3 files changed, 620 insertions(+), 323 deletions(-) diff --git a/src/lib/SoftHSM.cpp b/src/lib/SoftHSM.cpp index bef298746..1ad70e373 100644 --- a/src/lib/SoftHSM.cpp +++ b/src/lib/SoftHSM.cpp @@ -1220,7 +1220,7 @@ CK_RV SoftHSM::C_GetMechanismInfo(CK_SLOT_ID slotID, CK_MECHANISM_TYPE type, CK_ case CKM_AES_GCM: pInfo->ulMinKeySize = 16; pInfo->ulMaxKeySize = 32; - pInfo->flags |= CKF_ENCRYPT | CKF_DECRYPT; + pInfo->flags |= CKF_ENCRYPT | CKF_DECRYPT | CKF_WRAP | CKF_UNWRAP; break; case CKM_AES_KEY_WRAP: pInfo->ulMinKeySize = 16; @@ -2286,7 +2286,7 @@ CK_RV SoftHSM::SymEncryptInit(CK_SESSION_HANDLE hSession, CK_MECHANISM_PTR pMech size_t bb = 8; size_t counterBits = 0; ByteString aad; - size_t tagBytes = 0; + size_t tagBits = 0; switch(pMechanism->mechanism) { #ifndef WITH_FIPS case CKM_DES_ECB: @@ -2437,13 +2437,12 @@ CK_RV SoftHSM::SymEncryptInit(CK_SESSION_HANDLE hSession, CK_MECHANISM_PTR pMech aad.resize(CK_GCM_PARAMS_PTR(pMechanism->pParameter)->ulAADLen); if (CK_GCM_PARAMS_PTR(pMechanism->pParameter)->ulAADLen > 0) memcpy(&aad[0], CK_GCM_PARAMS_PTR(pMechanism->pParameter)->pAAD, CK_GCM_PARAMS_PTR(pMechanism->pParameter)->ulAADLen); - tagBytes = CK_GCM_PARAMS_PTR(pMechanism->pParameter)->ulTagBits; - if (tagBytes > 128 || tagBytes % 8 != 0) + tagBits = CK_GCM_PARAMS_PTR(pMechanism->pParameter)->ulTagBits; + if (tagBits < 64 || tagBits > 128 || tagBits % 8 != 0) { - DEBUG_MSG("Invalid ulTagBits value"); + DEBUG_MSG("Invalid ulTagBits value %d", tagBits); return CKR_ARGUMENTS_BAD; } - tagBytes = tagBytes / 8; break; default: return CKR_MECHANISM_INVALID; @@ -2464,7 +2463,7 @@ CK_RV SoftHSM::SymEncryptInit(CK_SESSION_HANDLE hSession, CK_MECHANISM_PTR pMech secretkey->setBitLen(secretkey->getKeyBits().size() * bb); // Initialize encryption - if (!cipher->encryptInit(secretkey, mode, iv, padding, counterBits, aad, tagBytes)) + if (!cipher->encryptInit(secretkey, mode, iv, padding, counterBits, aad, (tagBits >> 3))) { cipher->recycleKey(secretkey); CryptoFactory::i()->recycleSymmetricAlgorithm(cipher); @@ -2706,7 +2705,7 @@ static CK_RV AsymEncrypt(Session* session, CK_BYTE_PTR pData, CK_ULONG ulDataLen AsymMech::Type mechanism = session->getMechanism(); MechanismParam* mechanismParam = session->getMechanismParam(); PublicKey* publicKey = session->getPublicKey(); - + if (asymCrypto == NULL || !session->getAllowSinglePartOp() || publicKey == NULL) { session->resetOp(); @@ -3042,7 +3041,7 @@ CK_RV SoftHSM::SymDecryptInit(CK_SESSION_HANDLE hSession, CK_MECHANISM_PTR pMech size_t bb = 8; size_t counterBits = 0; ByteString aad; - size_t tagBytes = 0; + size_t tagBits = 0; switch(pMechanism->mechanism) { #ifndef WITH_FIPS case CKM_DES_ECB: @@ -3193,13 +3192,12 @@ CK_RV SoftHSM::SymDecryptInit(CK_SESSION_HANDLE hSession, CK_MECHANISM_PTR pMech aad.resize(CK_GCM_PARAMS_PTR(pMechanism->pParameter)->ulAADLen); if (CK_GCM_PARAMS_PTR(pMechanism->pParameter)->ulAADLen > 0) memcpy(&aad[0], CK_GCM_PARAMS_PTR(pMechanism->pParameter)->pAAD, CK_GCM_PARAMS_PTR(pMechanism->pParameter)->ulAADLen); - tagBytes = CK_GCM_PARAMS_PTR(pMechanism->pParameter)->ulTagBits; - if (tagBytes > 128 || tagBytes % 8 != 0) + tagBits = CK_GCM_PARAMS_PTR(pMechanism->pParameter)->ulTagBits; + if (tagBits < 64 || tagBits > 128 || tagBits % 8 != 0) { - DEBUG_MSG("Invalid ulTagBits value"); + DEBUG_MSG("Invalid ulTagBits value %d", tagBits); return CKR_ARGUMENTS_BAD; } - tagBytes = tagBytes / 8; break; default: return CKR_MECHANISM_INVALID; @@ -3220,7 +3218,7 @@ CK_RV SoftHSM::SymDecryptInit(CK_SESSION_HANDLE hSession, CK_MECHANISM_PTR pMech secretkey->setBitLen(secretkey->getKeyBits().size() * bb); // Initialize decryption - if (!cipher->decryptInit(secretkey, mode, iv, padding, counterBits, aad, tagBytes)) + if (!cipher->decryptInit(secretkey, mode, iv, padding, counterBits, aad, (tagBits >> 3))) { cipher->recycleKey(secretkey); CryptoFactory::i()->recycleSymmetricAlgorithm(cipher); @@ -6657,6 +6655,10 @@ CK_RV SoftHSM::WrapKeySym algo = SymAlgo::AES; break; + case CKM_AES_GCM: + algo = SymAlgo::AES; + break; + case CKM_DES3_CBC: algo = SymAlgo::DES3; break; @@ -6687,13 +6689,57 @@ CK_RV SoftHSM::WrapKeySym ByteString iv; ByteString encryptedFinal; + ByteString aad; + size_t tagBits = 0; + size_t counterBits = 0; switch(pMechanism->mechanism) { + case CKM_AES_GCM: + if (pMechanism->pParameter == NULL_PTR || + pMechanism->ulParameterLen != sizeof(CK_GCM_PARAMS)) + { + DEBUG_MSG("GCM mode requires parameters"); + return CKR_ARGUMENTS_BAD; + } + + iv.resize(CK_GCM_PARAMS_PTR(pMechanism->pParameter)->ulIvLen); + memcpy(&iv[0], CK_GCM_PARAMS_PTR(pMechanism->pParameter)->pIv, CK_GCM_PARAMS_PTR(pMechanism->pParameter)->ulIvLen); + aad.resize(CK_GCM_PARAMS_PTR(pMechanism->pParameter)->ulAADLen); + if (CK_GCM_PARAMS_PTR(pMechanism->pParameter)->ulAADLen > 0) + memcpy(&aad[0], CK_GCM_PARAMS_PTR(pMechanism->pParameter)->pAAD, CK_GCM_PARAMS_PTR(pMechanism->pParameter)->ulAADLen); + tagBits = CK_GCM_PARAMS_PTR(pMechanism->pParameter)->ulTagBits; + if (tagBits < 64 || tagBits > 128 || tagBits % 8 != 0) + { + DEBUG_MSG("Invalid ulTagBits value %d", tagBits); + return CKR_ARGUMENTS_BAD; + } + + if (!cipher->encryptInit(wrappingkey, SymMode::GCM, iv, false, counterBits, aad, (tagBits >> 3))) + { + cipher->recycleKey(wrappingkey); + CryptoFactory::i()->recycleSymmetricAlgorithm(cipher); + return CKR_MECHANISM_INVALID; + } + if (!cipher->encryptUpdate(keydata, wrapped)) + { + cipher->recycleKey(wrappingkey); + CryptoFactory::i()->recycleSymmetricAlgorithm(cipher); + return CKR_GENERAL_ERROR; + } + if (!cipher->encryptFinal(encryptedFinal)) + { + cipher->recycleKey(wrappingkey); + CryptoFactory::i()->recycleSymmetricAlgorithm(cipher); + return CKR_GENERAL_ERROR; + } + wrapped += encryptedFinal; + break; + case CKM_AES_CBC: - case CKM_AES_CBC_PAD: + case CKM_AES_CBC_PAD: case CKM_DES3_CBC: - case CKM_DES3_CBC_PAD: + case CKM_DES3_CBC_PAD: iv.resize(blocksize); memcpy(&iv[0], pMechanism->pParameter, blocksize); @@ -6718,6 +6764,7 @@ CK_RV SoftHSM::WrapKeySym } wrapped += encryptedFinal; break; + default: // Wrap the key if (!cipher->wrapKey(wrappingkey, mode, keydata, wrapped)) @@ -6821,7 +6868,7 @@ CK_RV SoftHSM::WrapKeyAsym cipher->recyclePublicKey(publicKey); CryptoFactory::i()->recycleAsymmetricAlgorithm(cipher); return rv; - } + } if (keydata.size() > modulus_length - 2 - (2 * hashLen)) { delete rsaOaepMechanismParam; @@ -6990,6 +7037,11 @@ CK_RV SoftHSM::C_WrapKey pMechanism->ulParameterLen != 16) return CKR_ARGUMENTS_BAD; break; + case CKM_AES_GCM: + if (pMechanism->pParameter == NULL_PTR || + pMechanism->ulParameterLen != sizeof(CK_GCM_PARAMS)) + return CKR_ARGUMENTS_BAD; + break; default: return CKR_MECHANISM_INVALID; } @@ -7016,23 +7068,43 @@ CK_RV SoftHSM::C_WrapKey } // Check wrapping key class and type - if ((pMechanism->mechanism == CKM_AES_KEY_WRAP || pMechanism->mechanism == CKM_AES_KEY_WRAP_PAD) && wrapKey->getUnsignedLongValue(CKA_CLASS, CKO_VENDOR_DEFINED) != CKO_SECRET_KEY) - return CKR_WRAPPING_KEY_TYPE_INCONSISTENT; - if ((pMechanism->mechanism == CKM_RSA_PKCS || pMechanism->mechanism == CKM_RSA_PKCS_OAEP || pMechanism->mechanism == CKM_RSA_AES_KEY_WRAP) && - wrapKey->getUnsignedLongValue(CKA_CLASS, CKO_VENDOR_DEFINED) != CKO_PUBLIC_KEY) - return CKR_WRAPPING_KEY_TYPE_INCONSISTENT; - if (pMechanism->mechanism == CKM_AES_KEY_WRAP && wrapKey->getUnsignedLongValue(CKA_KEY_TYPE, CKK_VENDOR_DEFINED) != CKK_AES) - return CKR_WRAPPING_KEY_TYPE_INCONSISTENT; - if (pMechanism->mechanism == CKM_AES_KEY_WRAP_PAD && wrapKey->getUnsignedLongValue(CKA_KEY_TYPE, CKK_VENDOR_DEFINED) != CKK_AES) - return CKR_WRAPPING_KEY_TYPE_INCONSISTENT; - if ((pMechanism->mechanism == CKM_RSA_PKCS || pMechanism->mechanism == CKM_RSA_PKCS_OAEP || pMechanism->mechanism == CKM_RSA_AES_KEY_WRAP) && - wrapKey->getUnsignedLongValue(CKA_KEY_TYPE, CKK_VENDOR_DEFINED) != CKK_RSA) - return CKR_WRAPPING_KEY_TYPE_INCONSISTENT; - if ((pMechanism->mechanism == CKM_AES_CBC || pMechanism->mechanism == CKM_AES_CBC_PAD) && wrapKey->getUnsignedLongValue(CKA_KEY_TYPE, CKK_VENDOR_DEFINED) != CKK_AES) - return CKR_WRAPPING_KEY_TYPE_INCONSISTENT; - if (pMechanism->mechanism == CKM_DES3_CBC && (wrapKey->getUnsignedLongValue(CKA_KEY_TYPE, CKK_VENDOR_DEFINED) != CKK_DES2 || - wrapKey->getUnsignedLongValue(CKA_KEY_TYPE, CKK_VENDOR_DEFINED) != CKK_DES3)) - return CKR_WRAPPING_KEY_TYPE_INCONSISTENT; + switch(pMechanism->mechanism) { + case CKM_AES_KEY_WRAP: + case CKM_AES_KEY_WRAP_PAD: + case CKM_AES_GCM: + case CKM_AES_CBC_PAD: + if (wrapKey->getUnsignedLongValue(CKA_CLASS, CKO_VENDOR_DEFINED) != CKO_SECRET_KEY || + wrapKey->getUnsignedLongValue(CKA_KEY_TYPE, CKK_VENDOR_DEFINED) != CKK_AES) + return CKR_WRAPPING_KEY_TYPE_INCONSISTENT; + break; + +#ifndef WITH_FIPS + case CKM_DES_CBC: + case CKM_DES_CBC_PAD: + if (wrapKey->getUnsignedLongValue(CKA_CLASS, CKO_VENDOR_DEFINED) != CKO_SECRET_KEY || + wrapKey->getUnsignedLongValue(CKA_KEY_TYPE, CKK_VENDOR_DEFINED) != CKK_DES) + return CKR_WRAPPING_KEY_TYPE_INCONSISTENT; + break; +#endif + + case CKM_DES3_CBC: + case CKM_DES3_CBC_PAD: + if (wrapKey->getUnsignedLongValue(CKA_CLASS, CKO_VENDOR_DEFINED) != CKO_SECRET_KEY || + wrapKey->getUnsignedLongValue(CKA_KEY_TYPE, CKK_VENDOR_DEFINED) != CKK_DES2 || + wrapKey->getUnsignedLongValue(CKA_KEY_TYPE, CKK_VENDOR_DEFINED) != CKK_DES3) + return CKR_WRAPPING_KEY_TYPE_INCONSISTENT; + break; + + case CKM_RSA_PKCS: + case CKM_RSA_PKCS_OAEP: + if (wrapKey->getUnsignedLongValue(CKA_CLASS, CKO_VENDOR_DEFINED) != CKO_PUBLIC_KEY || + wrapKey->getUnsignedLongValue(CKA_KEY_TYPE, CKK_VENDOR_DEFINED) != CKK_RSA) + return CKR_WRAPPING_KEY_TYPE_INCONSISTENT; + break; + + default: + break; + } // Check if the wrapping key can be used for wrapping if (wrapKey->getBooleanValue(CKA_WRAP, false) == false) @@ -7255,7 +7327,7 @@ CK_RV SoftHSM::UnwrapKeySym SymWrap::Type mode = SymWrap::Unknown; size_t bb = 8; size_t blocksize = 0; - + switch(pMechanism->mechanism) { #ifdef HAVE_AES_KEY_WRAP case CKM_AES_KEY_WRAP: @@ -7275,6 +7347,11 @@ CK_RV SoftHSM::UnwrapKeySym blocksize = 16; break; + case CKM_AES_GCM: + algo = SymAlgo::AES; + blocksize = 16; + break; + case CKM_DES3_CBC_PAD: algo = SymAlgo::DES3; blocksize = 8; @@ -7301,6 +7378,9 @@ CK_RV SoftHSM::UnwrapKeySym ByteString iv; ByteString decryptedFinal; + ByteString aad; + size_t tagBits = 0; + size_t counterBits = 0; CK_RV rv = CKR_OK; switch(pMechanism->mechanism) { @@ -7336,7 +7416,7 @@ CK_RV SoftHSM::UnwrapKeySym case CKM_DES3_CBC_PAD: iv.resize(blocksize); memcpy(&iv[0], pMechanism->pParameter, blocksize); - + if (!cipher->decryptInit(unwrappingkey, SymMode::CBC, iv, false)) { cipher->recycleKey(unwrappingkey); @@ -7365,7 +7445,48 @@ CK_RV SoftHSM::UnwrapKeySym return CKR_GENERAL_ERROR; // TODO should be another error } break; - + + case CKM_AES_GCM: + if (pMechanism->pParameter == NULL_PTR || + pMechanism->ulParameterLen != sizeof(CK_GCM_PARAMS)) + { + DEBUG_MSG("GCM mode requires parameters"); + return CKR_ARGUMENTS_BAD; + } + iv.resize(CK_GCM_PARAMS_PTR(pMechanism->pParameter)->ulIvLen); + memcpy(&iv[0], CK_GCM_PARAMS_PTR(pMechanism->pParameter)->pIv, CK_GCM_PARAMS_PTR(pMechanism->pParameter)->ulIvLen); + aad.resize(CK_GCM_PARAMS_PTR(pMechanism->pParameter)->ulAADLen); + if (CK_GCM_PARAMS_PTR(pMechanism->pParameter)->ulAADLen > 0) + memcpy(&aad[0], CK_GCM_PARAMS_PTR(pMechanism->pParameter)->pAAD, CK_GCM_PARAMS_PTR(pMechanism->pParameter)->ulAADLen); + tagBits = CK_GCM_PARAMS_PTR(pMechanism->pParameter)->ulTagBits; + if (tagBits < 64 || tagBits > 128 || tagBits % 8 != 0) + { + DEBUG_MSG("Invalid ulTagBits value: %d", tagBits); + return CKR_ARGUMENTS_BAD; + } + + if (!cipher->decryptInit(unwrappingkey, SymMode::GCM, iv, false, counterBits, aad, (tagBits >> 3))) + { + cipher->recycleKey(unwrappingkey); + CryptoFactory::i()->recycleSymmetricAlgorithm(cipher); + return CKR_MECHANISM_INVALID; + } + if (!cipher->decryptUpdate(wrapped, keydata)) + { + cipher->recycleKey(unwrappingkey); + CryptoFactory::i()->recycleSymmetricAlgorithm(cipher); + return CKR_GENERAL_ERROR; + } + // Finalize encryption + if (!cipher->decryptFinal(decryptedFinal)) + { + cipher->recycleKey(unwrappingkey); + CryptoFactory::i()->recycleSymmetricAlgorithm(cipher); + return CKR_GENERAL_ERROR; + } + keydata += decryptedFinal; + break; + default: // Unwrap the key rv = CKR_OK; @@ -7434,7 +7555,7 @@ CK_RV SoftHSM::UnwrapKeyAsym CryptoFactory::i()->recycleAsymmetricAlgorithm(cipher); return CKR_MECHANISM_INVALID; } - + if (pMechanism->mechanism == CKM_RSA_PKCS_OAEP) { RSAOaepMechanismParam* rsaOaepMechanismParam = new RSAOaepMechanismParam; @@ -7662,21 +7783,40 @@ CK_RV SoftHSM::C_UnwrapKey return rv; break; - case CKM_AES_CBC: - case CKM_AES_CBC_PAD: + case CKM_AES_CBC: + case CKM_AES_CBC_PAD: // TODO check block length if (pMechanism->pParameter == NULL_PTR || pMechanism->ulParameterLen != 16) return CKR_ARGUMENTS_BAD; break; - case CKM_DES3_CBC_PAD: + case CKM_DES3_CBC_PAD: // TODO check block length if (pMechanism->pParameter == NULL_PTR || pMechanism->ulParameterLen != 8) return CKR_ARGUMENTS_BAD; break; - + + case CKM_AES_GCM: + // for GCM, the shortest block is 16 bytes + authentication tag + // in this impementation, 96 bits are requested at least, in multiples of 8 bits + // possibles values are therefore: + // - 96 bits (12 bytes) + // - 104 bits (13 bytes) + // - 112 bits (14 bytes) + // - 120 bits (15 bytes) + // - 128 bits (16 bytes) + // minimum length of the overall message in bytes is therefore 16 + 12 = 28 bytes + // remainder lengths (after modulo 16) between 1 and 11 are forbidden + if ((ulWrappedKeyLen < 28) || ( (ulWrappedKeyLen % 16) && (ulWrappedKeyLen % 16) < 12) ) + return CKR_WRAPPED_KEY_LEN_RANGE; + // Does not handle optional init vector + if (pMechanism->pParameter == NULL_PTR || + pMechanism->ulParameterLen != sizeof(CK_GCM_PARAMS)) + return CKR_ARGUMENTS_BAD; + break; + default: return CKR_MECHANISM_INVALID; } @@ -7703,24 +7843,43 @@ CK_RV SoftHSM::C_UnwrapKey } // Check unwrapping key class and type - if ((pMechanism->mechanism == CKM_AES_KEY_WRAP || pMechanism->mechanism == CKM_AES_KEY_WRAP_PAD) && unwrapKey->getUnsignedLongValue(CKA_CLASS, CKO_VENDOR_DEFINED) != CKO_SECRET_KEY) - return CKR_UNWRAPPING_KEY_TYPE_INCONSISTENT; - if (pMechanism->mechanism == CKM_AES_KEY_WRAP && unwrapKey->getUnsignedLongValue(CKA_KEY_TYPE, CKK_VENDOR_DEFINED) != CKK_AES) - return CKR_UNWRAPPING_KEY_TYPE_INCONSISTENT; - if (pMechanism->mechanism == CKM_AES_KEY_WRAP_PAD && unwrapKey->getUnsignedLongValue(CKA_KEY_TYPE, CKK_VENDOR_DEFINED) != CKK_AES) - return CKR_UNWRAPPING_KEY_TYPE_INCONSISTENT; - if ((pMechanism->mechanism == CKM_RSA_PKCS || pMechanism->mechanism == CKM_RSA_PKCS_OAEP || pMechanism->mechanism == CKM_RSA_AES_KEY_WRAP) && - unwrapKey->getUnsignedLongValue(CKA_CLASS, CKO_VENDOR_DEFINED) != CKO_PRIVATE_KEY) - return CKR_UNWRAPPING_KEY_TYPE_INCONSISTENT; - if ((pMechanism->mechanism == CKM_RSA_PKCS || pMechanism->mechanism == CKM_RSA_PKCS_OAEP || pMechanism->mechanism == CKM_RSA_AES_KEY_WRAP) && - unwrapKey->getUnsignedLongValue(CKA_KEY_TYPE, CKK_VENDOR_DEFINED) != CKK_RSA) - return CKR_UNWRAPPING_KEY_TYPE_INCONSISTENT; - if ((pMechanism->mechanism == CKM_AES_CBC || pMechanism->mechanism == CKM_AES_CBC_PAD) && unwrapKey->getUnsignedLongValue(CKA_KEY_TYPE, CKK_VENDOR_DEFINED) != CKK_AES) - return CKR_WRAPPING_KEY_TYPE_INCONSISTENT; - if (pMechanism->mechanism == CKM_DES3_CBC && (unwrapKey->getUnsignedLongValue(CKA_KEY_TYPE, CKK_VENDOR_DEFINED) != CKK_DES2 || - unwrapKey->getUnsignedLongValue(CKA_KEY_TYPE, CKK_VENDOR_DEFINED) != CKK_DES3)) - return CKR_WRAPPING_KEY_TYPE_INCONSISTENT; - + switch(pMechanism->mechanism) + { + case CKM_AES_KEY_WRAP: + case CKM_AES_KEY_WRAP_PAD: + case CKM_AES_GCM: + case CKM_AES_CBC_PAD: + if (unwrapKey->getUnsignedLongValue(CKA_CLASS, CKO_VENDOR_DEFINED) != CKO_SECRET_KEY || + unwrapKey->getUnsignedLongValue(CKA_KEY_TYPE, CKK_VENDOR_DEFINED) != CKK_AES) + return CKR_UNWRAPPING_KEY_TYPE_INCONSISTENT; + break; + + #ifndef WITH_FIPS + case CKM_DES_CBC: + case CKM_DES_CBC_PAD: + if (unwrapKey->getUnsignedLongValue(CKA_CLASS, CKO_VENDOR_DEFINED) != CKO_SECRET_KEY || + unwrapKey->getUnsignedLongValue(CKA_KEY_TYPE, CKK_VENDOR_DEFINED) != CKK_DES) + return CKR_UNWRAPPING_KEY_TYPE_INCONSISTENT; + break; + #endif + + case CKM_DES3_CBC: + case CKM_DES3_CBC_PAD: + if (unwrapKey->getUnsignedLongValue(CKA_CLASS, CKO_VENDOR_DEFINED) != CKO_SECRET_KEY || + unwrapKey->getUnsignedLongValue(CKA_KEY_TYPE, CKK_VENDOR_DEFINED) != CKK_DES2 || + unwrapKey->getUnsignedLongValue(CKA_KEY_TYPE, CKK_VENDOR_DEFINED) != CKK_DES3) + return CKR_UNWRAPPING_KEY_TYPE_INCONSISTENT; + break; + + case CKM_RSA_PKCS: + case CKM_RSA_PKCS_OAEP: + if (unwrapKey->getUnsignedLongValue(CKA_CLASS, CKO_VENDOR_DEFINED) != CKO_PRIVATE_KEY || + unwrapKey->getUnsignedLongValue(CKA_KEY_TYPE, CKK_VENDOR_DEFINED) != CKK_RSA) + return CKR_UNWRAPPING_KEY_TYPE_INCONSISTENT; + break; + + } + // Check if the unwrapping key can be used for unwrapping if (unwrapKey->getBooleanValue(CKA_UNWRAP, false) == false) return CKR_KEY_FUNCTION_NOT_PERMITTED; @@ -8531,11 +8690,11 @@ CK_RV SoftHSM::generateAES if (rv == CKR_OK) { OSObject* osobject = (OSObject*)handleManager->getObject(*phKey); - if (osobject == NULL_PTR || !osobject->isValid()) + if (osobject == NULL_PTR || !osobject->isValid()) { rv = CKR_FUNCTION_FAILED; - } - else if (osobject->startTransaction()) + } + else if (osobject->startTransaction()) { bool bOK = true; @@ -13820,7 +13979,7 @@ CK_RV SoftHSM::MechParamCheckRSAPKCSOAEP(CK_MECHANISM_PTR pMechanism) return CKR_ARGUMENTS_BAD; } CK_RSA_PKCS_OAEP_PARAMS_PTR params = (CK_RSA_PKCS_OAEP_PARAMS_PTR)pMechanism->pParameter; - + if (params->source != CKZ_DATA_SPECIFIED) { ERROR_MSG("source must be CKZ_DATA_SPECIFIED"); @@ -13881,12 +14040,12 @@ CK_RV SoftHSM::BuildRSAOAEPParam(const CK_RSA_PKCS_OAEP_PARAMS *params, { ERROR_MSG("parameters is NULL for RSA OAEP encryption"); return CKR_ARGUMENTS_BAD; - } + } if (params->source != CKZ_DATA_SPECIFIED) { ERROR_MSG("source must be CKZ_DATA_SPECIFIED"); return CKR_ARGUMENTS_BAD; - } + } if ((params->pSourceData == NULL) && (params->ulSourceDataLen != 0)) { ERROR_MSG("pSourceData is NULL"); @@ -13946,7 +14105,7 @@ CK_RV SoftHSM::BuildRSAOAEPParam(const CK_RSA_PKCS_OAEP_PARAMS *params, } // copy label data to mechanismParam mechanismParam->label = ByteString(reinterpret_cast(params->pSourceData),params->ulSourceDataLen); - + return CKR_OK; } diff --git a/src/lib/test/SymmetricAlgorithmTests.cpp b/src/lib/test/SymmetricAlgorithmTests.cpp index 46f717b30..93e662f84 100644 --- a/src/lib/test/SymmetricAlgorithmTests.cpp +++ b/src/lib/test/SymmetricAlgorithmTests.cpp @@ -33,6 +33,8 @@ #include #include #include +#include +#include #include #include //#include @@ -62,91 +64,94 @@ WrappedMaterial rsa2048underdes56 CKM_DES_CBC_PAD, // mechanism CKO_PRIVATE_KEY, // wrapped object class CKK_RSA, // wrapped key type + 0, // tagBits (GCM only) { { // key 0xdf, 0xba, 0xd0, 0xdf, 0x91, 0xda, 0x3e, 0xf1, }, { // IV - 0x48, 0x66, 0xc8, 0x2c, 0xe1, 0x40, 0x52, 0xa9, + 0x48, 0x66, 0xc8, 0x2c, 0xe1, 0x40, 0x52, 0xa9, + }, + { // AAD (GCM only) }, { // wrapped RSA key 0x74, 0x55, 0xe1, 0x60, 0x4e, 0x73, 0x91, 0x7f, 0x2c, 0xd9, 0x8a, 0xb7, 0x0c, 0x0e, 0xc6, 0xa7, - 0x15, 0x3f, 0x9d, 0x72, 0x26, 0x7f, 0xb2, 0x02, 0x49, 0xe3, 0x43, 0x1f, 0x14, 0xba, 0xdb, 0xf0, - 0xbb, 0x12, 0x66, 0x68, 0xba, 0xc3, 0x13, 0x4a, 0x5f, 0x6c, 0x50, 0x5c, 0x8c, 0xf6, 0x2e, 0xe6, - 0xa1, 0xc6, 0x27, 0xc9, 0x6a, 0x5c, 0x80, 0xf6, 0x4c, 0x33, 0x2f, 0x5e, 0x00, 0xba, 0x94, 0x9a, - 0xa4, 0xbf, 0x92, 0x7b, 0xb3,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 +164,94 @@ WrappedMaterial rsa2048underdes112 CKM_DES3_CBC_PAD, // mechanism CKO_PRIVATE_KEY, // wrapped object class CKK_RSA, // wrapped key type + 0, // tagBits (GCM only) { { // key 0xef, 0x4c, 0x9d, 0x73, 0xc8, 0x45, 0x0d, 0x31, 0x97, 0x4a, 0xfe, 0x2f, 0x9d, 0x94, 0x98, 0x54, }, { // IV - 0x74, 0x83, 0xdb, 0xb8, 0xb3, 0x9f, 0x55, 0xdc, + 0x74, 0x83, 0xdb, 0xb8, 0xb3, 0x9f, 0x55, 0xdc, + }, + { // AAD (GCM only) }, { // wrapped RSA key - 0xca, 0x83, 0xa0, 0x2f, 0x06, 0xab, 0xc5, 0xf3, 0xa6, 0x10, 0x93, 0x75, 0x93, 0x8f, 0xa0, 0x9f, - 0x6e, 0x71, 0xbc, 0xa7, 0x69, 0xf8, 0x6c, 0xff, 0x92, 0xab, 0x6f, 0x08, 0xdd, 0x4b, 0xd3, 0x90, - 0x66, 0x1c, 0x94, 0xf6, 0x8b, 0xc5, 0xb7, 0xfb, 0x1c, 0xea, 0x17, 0xe6, 0xce, 0xb0, 0xe1, 0x6a, - 0x89, 0x0e, 0x32, 0xa8, 0xe9, 0x52, 0xad, 0x7a, 0x1f, 0x00, 0x79, 0x32, 0xd9, 0x06, 0xad, 0x00, - 0xeb, 0xbf, 0x97, 0x67, 0xca, 0x67, 0x6a, 0xb8, 0xcf, 0xc8, 0xfc, 0xd7, 0x23, 0xa3, 0x04, 0x2c, - 0xed, 0x0c, 0xf1, 0xc5, 0x0d, 0x4a, 0x29, 0xe3, 0x1d, 0x0c, 0xec, 0xae, 0x05, 0xd9, 0x39, 0x48, - 0x45, 0x20, 0x7e, 0x40, 0xf7, 0xa7, 0x68, 0xb5, 0x1a, 0xc6, 0x75, 0x97, 0x4d, 0xfd, 0x37, 0xcc, - 0xb1, 0xdb, 0x6d, 0x8a, 0x46, 0x2d, 0x3a, 0x59, 0xee, 0x4c, 0x21, 0x31, 0x92, 0x25,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xcd, 0x1d, 0x85, 0x3e, 0xe8, 0xe7, - 0x2e, 0x5b, 0x25, 0x24, 0xf6, 0x54, 0x60, 0xb2, 0x17, 0xcd, 0xe0, 0x11, 0x8f, 0xca, 0x24, 0x32, - 0x0c, 0x63, 0x9f, 0x2d, 0x7c, 0xe8, 0x7f, 0x53, 0x58, 0x7c, 0xeb, 0xd4, 0x16, 0x7b, 0x78, 0x50, - 0xf4, 0x75, 0xe5, 0x25, 0xf4, 0x47, 0xa1, 0x08, 0x82, 0x68, 0xd6, 0xb1, 0xbd, 0x9a, 0xa2, 0xa5, - 0x22, 0x7d, 0x43, 0xff, 0x9d, 0xdc, 0x7f, 0x48, 0x29, 0x22, 0x3e, 0xb8, 0xf5, 0xe2, 0x26, 0x16, - 0x85, 0xb8, 0x01, 0x4a, 0x1f, 0x81, 0xe0, 0x54, 0xde, 0xc0, 0x3e, 0x57, 0x33, 0x0f, 0x23, 0x31, - 0xae, 0x88, 0x3a, 0x42, 0x14, 0x24, 0xc1, 0x6f, 0x34, 0xb8, 0x37, 0x14, 0x29, 0x04, 0x01, 0x54, - 0xa1, 0x62, 0x89, 0x51, 0x35, 0xfe, 0x34, 0xa3, 0x19, 0x45, 0x23, 0x3a, 0x2a, 0x55, 0x9a, 0x51, - 0xec, 0x1e, 0x5a, 0x30, 0x3f, 0xce, 0xf2, 0x76, 0x0c, 0x9a, 0x87, 0xba, 0xc3, 0x6f, 0x71, 0x2e, - 0x0e, 0x2b, 0x00, 0x05, 0xfb, 0xa1, 0x10, 0x35, 0x4c, 0x27, 0x11, 0x2f, 0xfb, 0x45, 0x34, 0x2c, - 0x8d, 0x57, 0x2f, 0x80, 0x95, 0x46, 0x2a, 0xef, 0x09, 0x82, 0x12, 0x17, 0x62, 0xc8, 0x7d, 0xf5, - 0x51, 0x05, 0xb5, 0xfe, 0x2b, 0xcf, 0x46, 0xba, 0xd6, 0x89, 0x49, 0x90, 0xdc, 0x47, 0x13, 0x77, - 0xa6, 0xd8, 0x03, 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, 0x8f, 0xd2, 0x5f, 0xd5, 0x53, 0xa8, + 0x25, 0x63, 0x6c, 0xfa, 0x6c, 0x2c, 0xe7, 0xcc, 0x88, 0x25, 0xe8, 0x4a, 0x15, 0x5e, 0x44, 0x22, + 0x01, 0x2d, 0x19, 0x16, 0x81, 0xbe, 0x21, 0x59, 0x3d, 0x86, 0x36, 0xf3, 0xe0, 0x7a, 0x73, 0x11, + 0x4d, 0x4a, 0x35, 0xcc, 0x54, 0xbc, 0x90, 0x03, 0x9b, 0x62, 0xbe, 0x83, 0xee, 0x61, 0x45, 0xd8, + 0x53, 0x25, 0xa2, 0x46, 0x8c, 0xf9, 0xf2, 0x15, 0x8d, 0x6f, 0x51, 0x2a, 0x3b, 0x0d, 0x11, 0xb5, + 0x9d, 0x55, 0x20, 0x06, 0xed, 0xee, 0xc5, 0xb7, 0x08, 0xe7, 0x14, 0x1a, 0xee, 0x44, 0xef, 0x37, + 0xb6, 0xbf, 0x27, 0x68, 0x46, 0x35, 0x89, 0x84, 0x6a, 0x9c, 0x07, 0x2e, 0x87, 0xc5, 0x11, 0xf6, + 0xc4, 0x9b, 0x36, 0x10, 0xa1, 0xdd, 0x66, 0x85, 0x33, 0x72, 0x03, 0x41, 0x75, 0xa4, 0x04, 0x6b, + 0x17, 0x10, 0x55, 0xc6, 0xd8, 0x68, 0x9a, 0x55, 0xcb, 0xd7, 0xcd, 0x1d, 0x85, 0x3e, 0xe8, 0xe7, + 0x2e, 0x5b, 0x25, 0x24, 0xf6, 0x54, 0x60, 0xb2, 0x17, 0xcd, 0xe0, 0x11, 0x8f, 0xca, 0x24, 0x32, + 0x0c, 0x63, 0x9f, 0x2d, 0x7c, 0xe8, 0x7f, 0x53, 0x58, 0x7c, 0xeb, 0xd4, 0x16, 0x7b, 0x78, 0x50, + 0xf4, 0x75, 0xe5, 0x25, 0xf4, 0x47, 0xa1, 0x08, 0x82, 0x68, 0xd6, 0xb1, 0xbd, 0x9a, 0xa2, 0xa5, + 0x22, 0x7d, 0x43, 0xff, 0x9d, 0xdc, 0x7f, 0x48, 0x29, 0x22, 0x3e, 0xb8, 0xf5, 0xe2, 0x26, 0x16, + 0x85, 0xb8, 0x01, 0x4a, 0x1f, 0x81, 0xe0, 0x54, 0xde, 0xc0, 0x3e, 0x57, 0x33, 0x0f, 0x23, 0x31, + 0xae, 0x88, 0x3a, 0x42, 0x14, 0x24, 0xc1, 0x6f, 0x34, 0xb8, 0x37, 0x14, 0x29, 0x04, 0x01, 0x54, + 0xa1, 0x62, 0x89, 0x51, 0x35, 0xfe, 0x34, 0xa3, 0x19, 0x45, 0x23, 0x3a, 0x2a, 0x55, 0x9a, 0x51, + 0xec, 0x1e, 0x5a, 0x30, 0x3f, 0xce, 0xf2, 0x76, 0x0c, 0x9a, 0x87, 0xba, 0xc3, 0x6f, 0x71, 0x2e, + 0x0e, 0x2b, 0x00, 0x05, 0xfb, 0xa1, 0x10, 0x35, 0x4c, 0x27, 0x11, 0x2f, 0xfb, 0x45, 0x34, 0x2c, + 0x8d, 0x57, 0x2f, 0x80, 0x95, 0x46, 0x2a, 0xef, 0x09, 0x82, 0x12, 0x17, 0x62, 0xc8, 0x7d, 0xf5, + 0x51, 0x05, 0xb5, 0xfe, 0x2b, 0xcf, 0x46, 0xba, 0xd6, 0x89, 0x49, 0x90, 0xdc, 0x47, 0x13, 0x77, + 0xa6, 0xd8, 0x03, 0x68, 0x68, 0x6b, 0x40, 0xa4, 0x93, 0x74, 0x2c, 0x75, 0xdc, 0xfa, 0x31, 0xb1, + 0xaa, 0xc2, 0xc7, 0x77, 0x23, 0xcd, 0x7c, 0x2c, 0x9c, 0x1b, 0xe1, 0xe9, 0x09, 0x90, 0x5c, 0xbe, + 0xa6, 0xfc, 0x48, 0x8c, 0xf5, 0xce, 0xcd, 0x43, 0xa9, 0x96, 0x19, 0xb0, 0x47, 0x80, 0xf8, 0x04, + 0x40, 0x8f, 0x51, 0x5f, 0x34, 0x4a, 0x18, 0x6e, 0x07, 0xea, 0x12, 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0, 0x55, 0x7e, 0x0c, 0x62, 0xd7, 0xc8, + 0x7d, 0xfa, 0x5e, 0xde, 0x05, 0x84, 0x3d, 0x1d, 0xda, 0x42, 0xc8, 0xba, 0x50, 0x0a, 0x5b, 0xab, + 0xa4, 0xdd, 0x02, 0x4f, 0xa9, 0x73, 0xd0, 0xeb, 0x78, 0x4c, 0x24, 0xd2, 0xe1, 0x84, 0x07, 0x75, + 0xad, 0x4d, 0x8b, 0x00, 0x7b, 0x4e, 0x63, 0x1f, 0xeb, 0xe4, 0x42, 0x5e, 0xca, 0xe8, 0x8e, 0xcb, + 0xe4, 0x6f, 0x10, 0xd6, 0xe0, 0x4a, 0xd7, 0xea, 0x44, 0xd5, 0xaf, 0xb7, 0x7a, 0xdb, 0x33, 0x4b, + 0xfd, 0x8a, 0x7e, 0x28, 0x52, 0x61, 0xbe, 0x58, 0xb9, 0x03, 0xf7, 0x2d, 0x2a, 0x1c, 0xa8, 0x73, + 0x8f, 0xfd, 0x15, 0x77, 0xca, 0x02, 0xc1, 0x14, 0x3c, 0x15, 0xf9, 0xd6, 0xda, 0xdc, 0xfc, 0x1c, + 0x89, 0x0f, 0x19, 0xb6, 0x68, 0x80, 0x78, 0x09, 0x43, 0x4e, 0xd0, 0xf7, 0x61, 0xe7, 0x4f, 0x9b, + 0x6d, 0x38, 0x37, 0x74, 0x14, 0x4e, 0x6c, 0x7b, }, }, }; @@ -257,103 +265,107 @@ WrappedMaterial rsa2048underdes168 CKM_DES3_CBC_PAD, // mechanism CKO_PRIVATE_KEY, // wrapped object class CKK_RSA, // wrapped key type + 0, // tagBits (GCM only) { { // key 0xfe, 0x0e, 0x7f, 0x68, 0x9e, 0xcb, 0x23, 0x68, 0xb3, 0x51, 0xea, 0x49, 0x26, 0xf2, 0xf8, 0x49, 0x4c, 0xe0, 0x58, 0x25, 0xf7, 0x64, 0xc1, 0xf7, }, { // IV - 0x1e, 0x06, 0xbb, 0xa6, 0xd4, 0x3e, 0x1d, 0x05, + 0x1e, 0x06, 0xbb, 0xa6, 0xd4, 0x3e, 0x1d, 0x05, + }, + { // AAD (GCM only) }, { // wrapped RSA key - 0x45, 0x84, 0xa6, 0xc7, 0xec, 0x3c, 0x6b, 0x38, 0xbe, 0x6f, 0x0d, 0x9d, 0x3a, 0x80, 0x17, 0x2d, - 0xab, 0x6b, 0x6f, 0x82, 0x5a, 0x6d, 0x8e, 0x50, 0x84, 0xf2, 0x61, 0x29, 0xc8, 0x99, 0x97, 0xac, - 0x2a, 0xca, 0x1c, 0xb3, 0x45, 0x7c, 0xcf, 0xd8, 0xcb, 0xf8, 0x65, 0x85, 0xaf, 0x1f, 0x1f, 0xb0, - 0x60, 0x02, 0x8e, 0xa4, 0x21, 0x7c, 0x95, 0xd9, 0x37, 0x78, 0xad, 0x9e, 0x02, 0xbf, 0x97, 0xab, - 0x9c, 0x28, 0x55, 0xdc, 0x90, 0x8c, 0x74, 0xd2, 0x35, 0xdf, 0x15, 0x7f, 0x11, 0x70, 0x64, 0x91, - 0xb7, 0x43, 0x2b, 0x41, 0x8b, 0x23, 0x12, 0x3b, 0xc4, 0x68, 0x46, 0x39, 0x25, 0xaa, 0x22, 0xf9, - 0x42, 0x10, 0x4e, 0x1a, 0xda, 0xef, 0x25, 0x43, 0x1b, 0x43, 0x8c, 0x5e, 0xe5, 0x81, 0x93, 0x11, - 0x67, 0xa4, 0x4a, 0xb2, 0x47, 0x8e, 0x35, 0x80, 0xa1, 0xf6, 0x3a, 0x0c, 0x02, 0x1e, 0x5f, 0x6e, - 0x54, 0xd6, 0x45, 0xe3, 0xd7, 0x0f, 0x39, 0xc6, 0x76, 0x41, 0xf7, 0xcc, 0xd8, 0x28, 0xec, 0xe3, - 0x53, 0xfe, 0x86, 0x33, 0x62, 0x50, 0x36, 0xa6, 0x7a, 0xac, 0x24, 0x10, 0xcb, 0x4d, 0x2b, 0x76, - 0x44, 0xe9, 0x65, 0xa0, 0x13, 0xe8, 0x92, 0x9c, 0x0a, 0xe2, 0x66, 0x8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, 0x85, 0xaf, 0x1f, 0x1f, 0xb0, + 0x60, 0x02, 0x8e, 0xa4, 0x21, 0x7c, 0x95, 0xd9, 0x37, 0x78, 0xad, 0x9e, 0x02, 0xbf, 0x97, 0xab, + 0x9c, 0x28, 0x55, 0xdc, 0x90, 0x8c, 0x74, 0xd2, 0x35, 0xdf, 0x15, 0x7f, 0x11, 0x70, 0x64, 0x91, + 0xb7, 0x43, 0x2b, 0x41, 0x8b, 0x23, 0x12, 0x3b, 0xc4, 0x68, 0x46, 0x39, 0x25, 0xaa, 0x22, 0xf9, + 0x42, 0x10, 0x4e, 0x1a, 0xda, 0xef, 0x25, 0x43, 0x1b, 0x43, 0x8c, 0x5e, 0xe5, 0x81, 0x93, 0x11, + 0x67, 0xa4, 0x4a, 0xb2, 0x47, 0x8e, 0x35, 0x80, 0xa1, 0xf6, 0x3a, 0x0c, 0x02, 0x1e, 0x5f, 0x6e, + 0x54, 0xd6, 0x45, 0xe3, 0xd7, 0x0f, 0x39, 0xc6, 0x76, 0x41, 0xf7, 0xcc, 0xd8, 0x28, 0xec, 0xe3, + 0x53, 0xfe, 0x86, 0x33, 0x62, 0x50, 0x36, 0xa6, 0x7a, 0xac, 0x24, 0x10, 0xcb, 0x4d, 0x2b, 0x76, + 0x44, 0xe9, 0x65, 0xa0, 0x13, 0xe8, 0x92, 0x9c, 0x0a, 0xe2, 0x66, 0x8a, 0x46, 0x7d, 0x9e, 0xd4, + 0x76, 0xdc, 0x30, 0xc7, 0xd8, 0x23, 0x72, 0x53, 0xaf, 0x1f, 0xe7, 0xdf, 0xb3, 0x93, 0xea, 0xf8, + 0x09, 0xc3, 0xca, 0xa4, 0xc8, 0x52, 0x05, 0xd3, 0xc2, 0x08, 0x14, 0xd5, 0x50, 0x36, 0x68, 0xdc, + 0x9e, 0xdc, 0x1d, 0xca, 0x33, 0xbd, 0x64, 0xc7, 0x9f, 0x14, 0x51, 0x15, 0xd0, 0xc7, 0x2f, 0xef, + 0x20, 0x14, 0x2e,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5, 0xb5, 0x1c, 0xd8, 0x16, 0x59, 0xb9, 0x20, 0x40, 0x99, 0x53, 0x16, 0xc5, + 0x79, 0xe0, 0x40, 0x74, 0x5f, 0xa8, 0x21, 0x3c, 0x30, 0xbb, 0x3a, 0x11, 0x25, 0x0b, 0xb0, 0x77, + 0x94, 0xd7, 0x6c, 0x22, 0x34, 0x14, 0x7c, 0xec, 0x93, 0xdd, 0x04, 0xb8, 0x4a, 0x8b, 0x9d, 0xaf, + 0xc1, 0xe6, 0x5c, 0x28, 0xfc, 0x68, 0x68, 0x2a, 0x2f, 0x31, 0xd5, 0x52, 0xf0, 0xd0, 0x57, 0x1c, + 0x02, 0x65, 0xa9, 0xd0, 0x6b, 0x62, 0xb1, 0xed, 0xc0, 0x4e, 0x4b, 0x79, 0x46, 0x6e, 0xf6, 0x15, + 0x27, 0x44, 0xff, 0x0e, 0x89, 0xc1, 0xb2, 0xbe, }, }, }; -WrappedMaterial rsa2048underaes128 +WrappedMaterial rsa2048underaes128 { "RSA2048 wrapped under AES128 using CKM_AES_CBC_PAD", CKK_AES, // wrapping key type CKM_AES_CBC_PAD, // mechanism CKO_PRIVATE_KEY, // wrapped object class CKK_RSA, // wrapped key type + 0, // tagBits (GCM only) { { // key 0xd5, 0x20, 0xbc, 0xaa, 0x9c, 0x3f, 0x1f, 0x32, @@ -363,6 +375,8 @@ WrappedMaterial rsa2048underaes128 0x55, 0x7c, 0xc6, 0xab, 0xdf, 0xee, 0xa1, 0x10, 0xeb, 0x89, 0x42, 0x31, 0x72, 0x82, 0xbc, 0xeb }, + { // AAD (GCM only) + }, { // wrapped RSA key 0x7d, 0xa7, 0xa9, 0xe9, 0x8f, 0x73, 0x76, 0xde, 0x66, 0x9d, 0x81, 0x0b, 0x6f, 0xcb, 0x17, 0x87, 0xb7, 0x2d, 0xb8, 0xc0, 0x9e, 0xec, 0x1f, 0xd5, 0x4a, 0x3a, 0x82, 0x72, 0xe4, 0x65, 0x55, 0x1e, @@ -445,7 +459,7 @@ WrappedMaterial rsa2048underaes128 }, }; - + WrappedMaterial rsa2048underaes192 { "RSA2048 wrapped under AES192 using CKM_AES_CBC_PAD", @@ -453,13 +467,16 @@ WrappedMaterial rsa2048underaes192 CKM_AES_CBC_PAD, // mechanism CKO_PRIVATE_KEY, // wrapped object class CKK_RSA, // wrapped key type + 0, // tagBits (GCM only) { { // key - 0xe3, 0x38, 0xb0, 0xa3, 0xa9, 0x49, 0x66, 0xf3, 0x1b, 0xe8, 0xc6, 0x3c, 0x40, 0x9d, 0xe3, 0xf2, + 0xe3, 0x38, 0xb0, 0xa3, 0xa9, 0x49, 0x66, 0xf3, 0x1b, 0xe8, 0xc6, 0x3c, 0x40, 0x9d, 0xe3, 0xf2, 0xaa, 0x07, 0xae, 0x37, 0xea, 0x28, 0xbc, 0xde, }, { // IV - 0x48, 0x5c, 0x96, 0x7e, 0x41, 0x47, 0xcf, 0x17, 0x35, 0xa3, 0x12, 0xf1, 0x76, 0x2e, 0x12, 0xdc, + 0x48, 0x5c, 0x96, 0x7e, 0x41, 0x47, 0xcf, 0x17, 0x35, 0xa3, 0x12, 0xf1, 0x76, 0x2e, 0x12, 0xdc, + }, + { // AAD (GCM only) }, { // wrapped RSA key 0x90, 0xe2, 0x9d, 0x99, 0xcb, 0xc3, 0xfe, 0x34, 0x4f, 0xe1, 0x73, 0x7b, 0xc2, 0xde, 0xed, 0xf3, @@ -550,13 +567,16 @@ WrappedMaterial rsa2048underaes256 CKM_AES_CBC_PAD, // mechanism CKO_PRIVATE_KEY, // wrapped object class CKK_RSA, // wrapped key type + 0, // tagBits (GCM only) { { // key 0xda, 0x77, 0x34, 0x87, 0x98, 0x5c, 0xd3, 0x27, 0xc6, 0x11, 0x1a, 0x83, 0x65, 0x18, 0xb9, 0xe3, 0x55, 0x64, 0x2f, 0xe4, 0x47, 0x7e, 0xb5, 0xd8, 0x17, 0x54, 0xfa, 0xb9, 0x3b, 0x4b, 0x88, 0x2b, }, { // IV - 0x0e, 0xee, 0x81, 0x64, 0x0d, 0x6d, 0xe1, 0x6e, 0xca, 0xbb, 0x39, 0x0c, 0xda, 0xda, 0x86, 0xe6, + 0x0e, 0xee, 0x81, 0x64, 0x0d, 0x6d, 0xe1, 0x6e, 0xca, 0xbb, 0x39, 0x0c, 0xda, 0xda, 0x86, 0xe6, + }, + { // AAD (GCM only) }, { // wrapped RSA key 0x86, 0x36, 0x43, 0xcb, 0x0e, 0x85, 0xb7, 0xaa, 0x59, 0x16, 0x92, 0x70, 0x31, 0x06, 0x54, 0x22, @@ -640,12 +660,70 @@ WrappedMaterial rsa2048underaes256 } }; +WrappedMaterial aes128underaes256gcm +{ + "AES128 wrapped under AES256 using CKM_AES_GCM", + CKK_AES, // wrapping key type + CKM_AES_GCM, // mechanism + CKO_SECRET_KEY, // wrapped object class + CKK_AES, // wrapped key type + 128, // tagBits (GCM only) + { + { // key + 0x62, 0x63, 0xdf, 0x89, 0x9b, 0xf2, 0xeb, 0xb4, 0x84, 0x66, 0xf7, 0xe5, 0x51, 0xd0, 0x2c, 0x32, + 0x59, 0x90, 0xd7, 0x0b, 0xa0, 0xec, 0x33, 0xb2, 0xdd, 0x86, 0x3f, 0x40, 0x58, 0xb3, 0xa4, 0x65, + }, + { // IV + 0xfb, 0x71, 0x20, 0x70, 0x28, 0xc8, 0xd4, 0x19, 0xd5, 0xf2, 0x0f, 0x86, 0xb8, 0x8b, 0x22, 0x6d, + }, + { // AAD (GCM only) + // No AAD specified + }, + { // wrapped AES key + 0x0c, 0x82, 0x46, 0xdd, 0x1e, 0x07, 0x29, 0xf2, 0xbb, 0x54, 0x0f, 0xbb, 0xe0, 0xdd, 0x78, 0x77, + 0xca, 0x01, 0x41, 0x1d, 0xf0, 0xdd, 0x19, 0x36, 0x79, 0x1b, 0x52, 0xaa, 0xd3, 0x3d, 0x78, 0x06, + } + } +}; + +WrappedMaterial aes256underaes256gcm +{ + "AES256 wrapped under AES256 using CKM_AES_GCM", + CKK_AES, // wrapping key type + CKM_AES_GCM, // mechanism + CKO_SECRET_KEY, // wrapped object class + CKK_AES, // wrapped key type + 128, // tagBits (GCM only) + { + { // key + 0x62, 0x63, 0xdf, 0x89, 0x9b, 0xf2, 0xeb, 0xb4, 0x84, 0x66, 0xf7, 0xe5, 0x51, 0xd0, 0x2c, 0x32, + 0x59, 0x90, 0xd7, 0x0b, 0xa0, 0xec, 0x33, 0xb2, 0xdd, 0x86, 0x3f, 0x40, 0x58, 0xb3, 0xa4, 0x65, + }, + { // IV + 0x4a, 0x82, 0xd3, 0xaa, 0x41, 0xd1, 0x1b, 0xae, 0xd0, 0x61, 0xd8, 0x9f, 0xaf, 0x22, 0x86, 0xc9, + }, + { // AAD (GCM only) + 'd', 'd', 'd', 'd', + }, + { // wrapped AES key + 0x89, 0x12, 0xa1, 0x46, 0x12, 0x1c, 0x85, 0xcc, 0x88, 0xe1, 0xa8, 0x30, 0x5b, 0xdf, 0xc0, 0x27, + 0xf1, 0xb5, 0x29, 0xba, 0xea, 0x58, 0xd9, 0x58, 0xae, 0xe1, 0xf3, 0x69, 0x37, 0xcd, 0x7b, 0x20, + 0x61, 0x18, 0x2f, 0x19, 0xc4, 0xa8, 0xa5, 0x2b, 0xba, 0x3c, 0x1e, 0x03, 0x4e, 0x84, 0xb4, 0x3e, + } + } +}; + std::vector aesCBCWrappedKeys { rsa2048underaes128, rsa2048underaes192, rsa2048underaes256, }; +std::vector aesGCMWrappedKeys { + aes128underaes256gcm, + aes256underaes256gcm, +}; + std::vector desCBCWrappedKeys { #ifndef WITH_FIPS rsa2048underdes56, @@ -654,7 +732,15 @@ std::vector desCBCWrappedKeys { rsa2048underdes168, }; - +// a small helper function to display int as hex strings +// copied from https://stackoverflow.com/a/48643043/979318 +template +static inline std::string hex(T val, size_t width=sizeof(T)*2) +{ + std::stringstream ss; + ss << std::setfill('0') << std::setw(width) << std::hex << (val|0); + return ss.str(); +} CK_RV SymmetricAlgorithmTests::generateGenericKey(CK_SESSION_HANDLE hSession, CK_BBOOL bToken, CK_BBOOL bPrivate, CK_OBJECT_HANDLE &hKey) { @@ -910,7 +996,7 @@ void SymmetricAlgorithmTests::encryptDecrypt( if ( isSizeOK ) { CPPUNIT_ASSERT_EQUAL( (CK_RV)CKR_OK, rv ); std::vector vDecryptedData(ulDataLen); - CPPUNIT_ASSERT_EQUAL( (CK_RV)CKR_OK, CRYPTOKI_F_PTR( C_Decrypt(hSession,&vEncryptedData.front(),vEncryptedData.size(),&vDecryptedData.front(),&ulDataLen) ) ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "C_Decrypt() call fails with mechanism 0x" + hex(pMechanism->mechanism,8), (CK_RV)CKR_OK, CRYPTOKI_F_PTR( C_Decrypt(hSession,&vEncryptedData.front(),vEncryptedData.size(),&vDecryptedData.front(),&ulDataLen) ) ); vDecryptedData.resize(ulDataLen); CPPUNIT_ASSERT_MESSAGE("C_Encrypt C_Decrypt does not give the original", vData==vDecryptedData); } else { @@ -1095,15 +1181,39 @@ void SymmetricAlgorithmTests::aesWrapUnwrapGeneric(CK_MECHANISM_TYPE mechanismTy CK_KEY_TYPE genKeyType = CKK_GENERIC_SECRET; CK_BYTE keyPtr[128]; CK_ULONG keyLen = - mechanismType == CKM_AES_KEY_WRAP_PAD ? 125UL : 128UL; + mechanismType == CKM_AES_KEY_WRAP_PAD ? sizeof(keyPtr)-3 : sizeof(keyPtr); CK_RV rv; CK_BYTE ivPtr[16]; - if( mechanismType == CKM_AES_CBC_PAD || mechanismType == CKM_AES_CBC ) { - rv = CRYPTOKI_F_PTR( C_GenerateRandom(hSession, ivPtr, sizeof ivPtr) ); - CPPUNIT_ASSERT(rv == CKR_OK); - mechanism.pParameter = ivPtr; - mechanism.ulParameterLen = sizeof ivPtr; + CK_BYTE aad[64]; + CK_GCM_PARAMS gcmparams = { }; + + switch(mechanismType) + { + case CKM_AES_CBC: + case CKM_AES_CBC_PAD: + rv = CRYPTOKI_F_PTR( C_GenerateRandom(hSession, ivPtr, sizeof ivPtr) ); + CPPUNIT_ASSERT(rv == CKR_OK); + mechanism.pParameter = ivPtr; + mechanism.ulParameterLen = sizeof ivPtr; + break; + + case CKM_AES_GCM: + rv = CRYPTOKI_F_PTR( C_GenerateRandom(hSession, ivPtr, sizeof ivPtr) ); + CPPUNIT_ASSERT(rv == CKR_OK); + rv = CRYPTOKI_F_PTR( C_GenerateRandom(hSession, aad, sizeof aad) ); + CPPUNIT_ASSERT(rv == CKR_OK); + + gcmparams.pIv = ivPtr; + gcmparams.ulIvLen = sizeof ivPtr; + gcmparams.ulIvBits = gcmparams.ulIvLen<<3; + gcmparams.pAAD = aad; + gcmparams.ulAADLen = sizeof aad; + gcmparams.ulTagBits = 128; + + mechanism.pParameter = &gcmparams; + mechanism.ulParameterLen = sizeof gcmparams; + break; } CK_ATTRIBUTE attribs[] = { @@ -1342,7 +1452,7 @@ void SymmetricAlgorithmTests::wrapUnwrapRsa(CK_MECHANISM_TYPE mechanismType, CK_ mechanism.ulParameterLen = (mechanismType == CKM_AES_CBC_PAD || mechanismType == CKM_AES_CBC) ? 16 : 8; // falls through } - + CK_OBJECT_CLASS privateClass = CKO_PRIVATE_KEY; CK_KEY_TYPE keyType = CKK_RSA; CK_BYTE_PTR prkAttrPtr = NULL_PTR; @@ -1437,7 +1547,7 @@ void SymmetricAlgorithmTests::unwrapKnownKey(const CK_SESSION_HANDLE hSession, W { CKA_SENSITIVE, &bFalse, sizeof(bFalse) }, { CKA_EXTRACTABLE, &bTrue, sizeof(bTrue) }, }; - + hPrk = CK_INVALID_HANDLE; rv = CRYPTOKI_F_PTR( C_UnwrapKey( hSession, &sWrapped.mechanism(), @@ -1449,7 +1559,7 @@ void SymmetricAlgorithmTests::unwrapKnownKey(const CK_SESSION_HANDLE hSession, W CPPUNIT_ASSERT_MESSAGE(sWrapped.description(), rv == CKR_OK); CPPUNIT_ASSERT_MESSAGE(sWrapped.description(), hPrk != CK_INVALID_HANDLE); // no further test: if the key could be recreated as a PKCS8 structure, it means it was successully recovered - + rv = CRYPTOKI_F_PTR( C_DestroyObject(hSession, hPrk) ); CPPUNIT_ASSERT_MESSAGE(sWrapped.description(), rv == CKR_OK); } @@ -1768,6 +1878,7 @@ void SymmetricAlgorithmTests::testAesWrapUnwrap() aesWrapUnwrapGeneric(CKM_AES_KEY_WRAP, hSession, hKey); aesWrapUnwrapGeneric(CKM_AES_CBC_PAD, hSession, hKey); aesWrapUnwrapGeneric(CKM_AES_CBC, hSession, hKey); + aesWrapUnwrapGeneric(CKM_AES_GCM, hSession, hKey); aesWrapUnwrapNonModifiableGeneric(CKM_AES_KEY_WRAP, hSession, hKey); aesWrapUnwrapNonModifiableGeneric(CKM_AES_CBC_PAD, hSession, hKey); aesWrapUnwrapNonModifiableGeneric(CKM_AES_CBC, hSession, hKey); @@ -1792,6 +1903,11 @@ void SymmetricAlgorithmTests::testAesWrapUnwrap() { unwrapKnownKey(hSession, wrapped); } + + for ( auto &wrapped : aesGCMWrappedKeys ) + { + unwrapKnownKey(hSession, wrapped); + } } void SymmetricAlgorithmTests::testDesEncryptDecrypt() @@ -1917,7 +2033,7 @@ void SymmetricAlgorithmTests::testDesWrapUnwrap() for ( auto &wrapped : desCBCWrappedKeys ) { unwrapKnownKey(hSession, wrapped); - } + } } void SymmetricAlgorithmTests::testNullTemplate() @@ -2266,7 +2382,7 @@ void SymmetricAlgorithmTests::testEncDecFinalNULLValidation() rv = generateAesKey(hSession,IN_SESSION,IS_PUBLIC,hKey); CPPUNIT_ASSERT(rv == CKR_OK); - + CK_MECHANISM mechanism = { CKM_AES_CTR, NULL_PTR, 0 }; CK_AES_CTR_PARAMS ctrParams = { @@ -2325,7 +2441,7 @@ void SymmetricAlgorithmTests::testEncDecFinalNULLValidation() vDecryptedDataParted.resize(ulDataPartLen); rv = CRYPTOKI_F_PTR( C_DecryptUpdate(hSession,&vEncryptedData.front(),vEncryptedData.size(),&vDecryptedDataParted.front(),&ulDataPartLen) ); CPPUNIT_ASSERT_EQUAL( (CK_RV)CKR_OK, rv ); - + // Test input validation rv = CRYPTOKI_F_PTR( C_DecryptFinal(hSession, NULL_PTR, NULL_PTR) ); CPPUNIT_ASSERT_EQUAL( (CK_RV)CKR_ARGUMENTS_BAD, rv ); diff --git a/src/lib/test/SymmetricAlgorithmTests.h b/src/lib/test/SymmetricAlgorithmTests.h index 7d60fb576..94bd56fe4 100644 --- a/src/lib/test/SymmetricAlgorithmTests.h +++ b/src/lib/test/SymmetricAlgorithmTests.h @@ -59,7 +59,7 @@ class SymmetricAlgorithmTests : public TestsBase public: using Bytes = std::vector; - + void testAesEncryptDecrypt(); void testDesEncryptDecrypt(); void testAesWrapUnwrap(); @@ -129,6 +129,8 @@ class WrappedMaterial { CK_KEY_TYPE m_wrappedkeytype; CK_KEY_TYPE m_wrappingkeytype; CK_MECHANISM m_mechanism; + size_t m_tagbits; // for AES GCM + CK_GCM_PARAMS m_gcm_params; // for AES GCM public: @@ -137,11 +139,13 @@ class WrappedMaterial { CK_MECHANISM_TYPE mechType, CK_OBJECT_CLASS wrappedObjectClass, CK_KEY_TYPE wrappedKeyType, + size_t tagBits, std::initializer_list il ) : m_descr ( description ), m_wrappedobjectclass ( wrappedObjectClass ), m_wrappedkeytype ( wrappedKeyType ), - m_wrappingkeytype ( wrappingKeyType ) + m_wrappingkeytype ( wrappingKeyType ), + m_tagbits ( tagBits ) { for( auto &&i : il ) { m_data.emplace_back( std::move(i) ); @@ -151,8 +155,10 @@ class WrappedMaterial { std::string description() { return m_descr; } Bytes &wrappingKeyBytes() { return m_data[0]; } - Bytes &cbcIv() { return m_data[1]; } - Bytes &wrappedKey() { return m_data[2]; }; + Bytes &iv() { return m_data[1]; } + Bytes &aad() { return m_data[2]; } + size_t tagBits() { return m_tagbits; } + Bytes &wrappedKey() { return m_data[3]; }; CK_OBJECT_CLASS &wrappedObjectClass() { return m_wrappedobjectclass; }; CK_KEY_TYPE &wrappingKeyType() { return m_wrappingkeytype; }; CK_KEY_TYPE &wrappedKeyType() { return m_wrappedkeytype; }; @@ -162,6 +168,22 @@ class WrappedMaterial { // has data() can move around as we push to the vectors m_mechanism.pParameter = m_data[1].data(); m_mechanism.ulParameterLen = m_data[1].size(); + if( m_mechanism.mechanism == CKM_AES_GCM ) { + m_gcm_params = { + .pIv = m_data[1].data(), + .ulIvLen = m_data[1].size(), + .ulIvBits = m_data[1].size()<<3, + .pAAD = m_data[2].data(), + .ulAADLen = m_data[2].size(), + .ulTagBits = m_tagbits }; + + m_mechanism.pParameter = &m_gcm_params; + m_mechanism.ulParameterLen = sizeof(CK_GCM_PARAMS); + } else { + // other cases: pParameter points to the IV + m_mechanism.pParameter = m_data[1].data(); + m_mechanism.ulParameterLen = m_data[1].size(); + } return m_mechanism; }; };