test: add negative tests for KBKDF key size check under FIPS

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/25095)
This commit is contained in:
Pauli 2024-08-06 09:37:49 +10:00
parent ae87c48895
commit fd39d1c80c
2 changed files with 81 additions and 0 deletions

View File

@ -1855,3 +1855,56 @@ Ctrl.hexinfo = hexinfo:8e9db3335779db688bcfe096668d9c3bc64e193e3529c430e68d09d5
Ctrl.hexinfo = hexinfo:6c837dd6c0f94678f121a68ee1feea4735da85a49d34a5290aa39f7b Ctrl.hexinfo = hexinfo:6c837dd6c0f94678f121a68ee1feea4735da85a49d34a5290aa39f7b
Ctrl.hexinfo = hexinfo:40de435f Ctrl.hexinfo = hexinfo:40de435f
Output = 6db880daac98b078ee389a2164252ded61322d661e2b49247ea921e544675d8f17af2bf66dd40d81 Output = 6db880daac98b078ee389a2164252ded61322d661e2b49247ea921e544675d8f17af2bf66dd40d81
Title = Negative tests for FIPS minimum key length
FIPSversion = >=3.4.0
KDF = KBKDF
Ctrl.mode = mode:COUNTER
Ctrl.digest = digest:SHA512
Ctrl.mac = mac:HMAC
Ctrl.use-l = use-l:0
Ctrl.use-separator = use-separator:0
Ctrl.r = r:8
Ctrl.hexkey = hexkey:0ef9
Ctrl.hexinfo = hexinfo:56ec
Result = KDF_CTRL_ERROR
FIPSversion = >=3.4.0
KDF = KBKDF
Ctrl.mode = mode:COUNTER
Ctrl.digest = digest:SHA256
Ctrl.mac = mac:HMAC
Ctrl.use-l = use-l:0
Ctrl.use-separator = use-separator:0
Ctrl.r = r:8
Ctrl.hexkey = hexkey:0ef9
Ctrl.hexinfo = hexinfo:56ec
Ctrl.key-check = key-check:0
Unapproved = 1
Output = 9de01850c9d3d1cd0270b3ea9c9c683d
FIPSversion = >=3.4.0
KDF = KBKDF
Ctrl.mode = mode:COUNTER
Ctrl.cipher = cipher:AES128
Ctrl.mac = mac:CMAC
Ctrl.use-l = use-l:0
Ctrl.use-separator = use-separator:0
Ctrl.r = r:24
Ctrl.hexkey = hexkey:1122334455667788
Ctrl.hexinfo = hexinfo:1122334455667788
Result = KDF_CTRL_ERROR
Availablein = default
KDF = KBKDF
Ctrl.mode = mode:COUNTER
Ctrl.digest = digest:SHA256
Ctrl.mac = mac:HMAC
Ctrl.use-l = use-l:0
Ctrl.use-separator = use-separator:0
Ctrl.r = r:8
Ctrl.hexkey = hexkey:0ef9
Ctrl.hexinfo = hexinfo:56ec
Output = 9de01850c9d3d1cd0270b3ea9c9c683d

View File

@ -915,3 +915,31 @@ Ctrl.hexkey = hexkey:C20388EF0DD7846578800D67AE371BDF83C40D435A1824ABF49EE8E6FCF
Ctrl.hexinfo = hexinfo:B6FE11FAFEE7DFF548EE70F73E8BE7CFFDC979BFF854D63C83A4AD145113B9126319CDB4319DDD5C389A9A5DB8751E69CB7B42F02C8D3484B34297DB44188FE34B286D5CF5B34A3FB9A54C2CD8897F1A80F22CE1F7053BD076C3687CDC960284C673E737909E5CF75C39F5685DAA471BBF7471479C56573360FEFB51ABA778AE0EAAD620A53E8FF139C9374E389BCE711413245544112F9D948D751F9096C194872D042C1C5C2FE3C9B658CBF3EBC0D61D8CE76C3B00DC12D6F37DD52159A892952A3AF871ECFEFC805F552123059011629778392856BFC22675181A59AF431FD87BD183FD226D96C510C3FA Ctrl.hexinfo = hexinfo:B6FE11FAFEE7DFF548EE70F73E8BE7CFFDC979BFF854D63C83A4AD145113B9126319CDB4319DDD5C389A9A5DB8751E69CB7B42F02C8D3484B34297DB44188FE34B286D5CF5B34A3FB9A54C2CD8897F1A80F22CE1F7053BD076C3687CDC960284C673E737909E5CF75C39F5685DAA471BBF7471479C56573360FEFB51ABA778AE0EAAD620A53E8FF139C9374E389BCE711413245544112F9D948D751F9096C194872D042C1C5C2FE3C9B658CBF3EBC0D61D8CE76C3B00DC12D6F37DD52159A892952A3AF871ECFEFC805F552123059011629778392856BFC22675181A59AF431FD87BD183FD226D96C510C3FA
Ctrl.hexsalt = hexsalt:6880828E58B6A49BF1D9AEDA6C27E8D59C28A67B2EBCC1CD09C964AD6516729CBAD08183E4C5A9AF5069D3F682CC636A77BF407431AF5AE90466530166F405C4CF30A6CF925F94DC9DD72B88A6C6345CCBCBA26BDA42CD619F14E378A246877BF279BCB6292E36192A1B Ctrl.hexsalt = hexsalt:6880828E58B6A49BF1D9AEDA6C27E8D59C28A67B2EBCC1CD09C964AD6516729CBAD08183E4C5A9AF5069D3F682CC636A77BF407431AF5AE90466530166F405C4CF30A6CF925F94DC9DD72B88A6C6345CCBCBA26BDA42CD619F14E378A246877BF279BCB6292E36192A1B
Output = B53FE7F63A41A69BAE048E78F620084D98BCDF8A2C2B825971634B376A365831F0D2F935B857E053EA97C0FB58299963212934AC992FD7C826C8C065DDA024E2A5942A34B78B4CDE76A2B10FA2D5243DE267D1034104DE1931161C8016FC9BBF90C56885BFA922F362AC1C14FE656C9D96076CFFA0EEAAAAA04847EB8251AD2B6924A9E44F2E5E301E6BB9152CD143B05DC12F9D12FD3E072C332264A692C88E2EB3CBAB4960E365CF3F4817C27922A8B0B7DF09E93F353B106C043F6E885A3306DDB308D64D83BB88DC501B1099C29D36FD92F803B59C260D11521ADC91C2DD1F576CBDBD740A22A37402F1613ABCAC979C0BCF2D36E6BBA39137E9B2927DCAFE376F552E861FCD0306FCE09FBDC4A95AB81B00DD17956E519D47BBFCDCE32447AF6BD74D7A6A3AE9677512D46CAA235043216D1CB1C1F7B8FA59FC7C01FD5FCAD64F2AE849E19280D817263E40024EBADDBAF68125DA352957BCD2897B9CD17B0E242D42159D32D1B3EBF1140269ED6758C251376C Output = B53FE7F63A41A69BAE048E78F620084D98BCDF8A2C2B825971634B376A365831F0D2F935B857E053EA97C0FB58299963212934AC992FD7C826C8C065DDA024E2A5942A34B78B4CDE76A2B10FA2D5243DE267D1034104DE1931161C8016FC9BBF90C56885BFA922F362AC1C14FE656C9D96076CFFA0EEAAAAA04847EB8251AD2B6924A9E44F2E5E301E6BB9152CD143B05DC12F9D12FD3E072C332264A692C88E2EB3CBAB4960E365CF3F4817C27922A8B0B7DF09E93F353B106C043F6E885A3306DDB308D64D83BB88DC501B1099C29D36FD92F803B59C260D11521ADC91C2DD1F576CBDBD740A22A37402F1613ABCAC979C0BCF2D36E6BBA39137E9B2927DCAFE376F552E861FCD0306FCE09FBDC4A95AB81B00DD17956E519D47BBFCDCE32447AF6BD74D7A6A3AE9677512D46CAA235043216D1CB1C1F7B8FA59FC7C01FD5FCAD64F2AE849E19280D817263E40024EBADDBAF68125DA352957BCD2897B9CD17B0E242D42159D32D1B3EBF1140269ED6758C251376C
Title = Negative test for FIPS minimum key length
FIPSversion = >=3.4.0
KDF = KBKDF
Ctrl.mac = mac:KMAC128
Ctrl.hexinfo = hexinfo:11223344
Ctrl.hexsalt = hexsalt:11223344
Ctrl.hexkey = hexkey:11223344
Result = KDF_CTRL_ERROR
FIPSversion = >=3.4.0
KDF = KBKDF
Ctrl.mac = mac:KMAC128
Ctrl.hexinfo = hexinfo:11223344
Ctrl.hexsalt = hexsalt:11223344
Ctrl.hexkey = hexkey:11223344
Ctrl.key-check = key-check:0
Unapproved = 1
Output = 44267b00467726e2dcaa33b463269d507001f4991f8e3bcd9c23a372f6f2bf887d92d8ce93392368ae3b3587f76e86af1b91a4a0cfc705ef612d0180147faac1097e2e54922b58293bfd25bd0e117651a7945245ecccf41055dffa8817a35dabb3acd3d4976e56d604877c360477cc4fba5b249dfed8082f05425dc40ffbb9e61e79a51b02eeae37bf1fc14ef99178c8e9b4cab82bb1942557c4167577a1119ad2dcfa6a09d1ee0ea8f98e9d9754d7efc3c90f6c291728675689e6d7e836cea5c8586fe8945f383ae51e244966bd54b66016db7b80e8c654d3217e0b98c2f9a4abda1ba4a442585ae1533d5bb0efaf0026de714d2c4e2e2dc3dfb2702dbb85f31139028016c1de9052c8e58355b3d9efe465d11d221720f5f29e8180e9833fe2f98e045ad4649ab9ae57022fed9b16843282475448bac3ff927e1c39b5dad3fec0478b8c484e0cf31909a8a76caf00e9b6a0825c9a1995868ca8741bc092bc95a684e7564fc5a9c0b21351111e25af3ad26ed4a0aeae
Availablein = default
KDF = KBKDF
Ctrl.mac = mac:KMAC128
Ctrl.hexinfo = hexinfo:11223344
Ctrl.hexsalt = hexsalt:11223344
Ctrl.hexkey = hexkey:11223344
Output = 44267b00467726e2dcaa33b463269d507001f4991f8e3bcd9c23a372f6f2bf887d92d8ce93392368ae3b3587f76e86af1b91a4a0cfc705ef612d0180147faac1097e2e54922b58293bfd25bd0e117651a7945245ecccf41055dffa8817a35dabb3acd3d4976e56d604877c360477cc4fba5b249dfed8082f05425dc40ffbb9e61e79a51b02eeae37bf1fc14ef99178c8e9b4cab82bb1942557c4167577a1119ad2dcfa6a09d1ee0ea8f98e9d9754d7efc3c90f6c291728675689e6d7e836cea5c8586fe8945f383ae51e244966bd54b66016db7b80e8c654d3217e0b98c2f9a4abda1ba4a442585ae1533d5bb0efaf0026de714d2c4e2e2dc3dfb2702dbb85f31139028016c1de9052c8e58355b3d9efe465d11d221720f5f29e8180e9833fe2f98e045ad4649ab9ae57022fed9b16843282475448bac3ff927e1c39b5dad3fec0478b8c484e0cf31909a8a76caf00e9b6a0825c9a1995868ca8741bc092bc95a684e7564fc5a9c0b21351111e25af3ad26ed4a0aeae