Adjust tests to changes related to x9.31 72/299472/3
authorKrzysztof Jackiewicz <k.jackiewicz@samsung.com>
Fri, 29 Sep 2023 11:29:57 +0000 (13:29 +0200)
committerDariusz Michaluk <d.michaluk@samsung.com>
Mon, 2 Oct 2023 14:18:44 +0000 (14:18 +0000)
X9.31 padding can not be used without a hashing function. Openssl does
not allow it. Adjust test to key-manager changes.

Change-Id: I23771afc3dedb4d05b241d17ade39eb9c13d52a1

src/ckm/unprivileged/sign-verify.cpp

index 27e97495c0dc6a78cdae6d1be9ecc5c46235d076..b0f7317ccd7b436e5aff88512f5d6f7f2236f7df 100644 (file)
@@ -355,8 +355,8 @@ void testSignVerify(Algo algo, size_t keyBits, int idx)
                     // no hash + padding + long message
                     expectInvalid(MESSAGE_LONG);
 
-                    // no hash + padding + short message
-                    if (algo == RSA)
+                    // no hash + padding other than X9.31 + short message
+                    if (algo == RSA && pad.first != CKMC_X931_PADDING)
                         expectSuccess(MESSAGE_SHORT);
                     else
                         expectInvalid(MESSAGE_SHORT); // no support for CKMC_HASH_NONE