Commit 095a7ce
committed
params_test: fix TestPSSParams skip and TestOAEPParams failure with latest SoftHSMv3
needMech now probes via GetMechanismList instead of GetMechanismInfo; newer SoftHSMv3 returns CKR_MECHANISM_INVALID from C_GetMechanismInfo for mechanisms that are present in C_GetMechanismList.
TestPSSParams switches from CKM_RSA_PKCS_PSS (raw pre-hashed digest) to CKM_SHA256_RSA_PKCS_PSS (hash-then-sign); the raw PSS mechanism is no longer advertised by the latest SoftHSMv3.
TestOAEPParams was failing with CKR_KEY_FUNCTION_NOT_PERMITTED at EncryptInit because getRSA delegated to generateRSAKeyPair which only sets CKA_VERIFY/CKA_SIGN. getRSA now generates the key pair inline with CKA_ENCRYPT and CKA_DECRYPT set. Also fixes a typo in getRSA where the private key lookup used CKO_PUBLIC_KEY.
Tested with pqctoday-org/pqctoday-hsm@37bf66a
Signed-off-by: Nicolas-Peiffer <102670102+Nicolas-Peiffer@users.noreply.github.com>1 parent 2d9ce3d commit 095a7ce
1 file changed
Lines changed: 39 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
22 | | - | |
23 | | - | |
24 | | - | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
25 | 26 | | |
26 | | - | |
27 | | - | |
28 | | - | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
29 | 31 | | |
30 | 32 | | |
31 | 33 | | |
| |||
54 | 56 | | |
55 | 57 | | |
56 | 58 | | |
57 | | - | |
| 59 | + | |
58 | 60 | | |
59 | | - | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
60 | 86 | | |
61 | 87 | | |
62 | 88 | | |
| |||
65 | 91 | | |
66 | 92 | | |
67 | 93 | | |
68 | | - | |
| 94 | + | |
69 | 95 | | |
70 | 96 | | |
71 | | - | |
| 97 | + | |
72 | 98 | | |
73 | | - | |
| 99 | + | |
74 | 100 | | |
75 | 101 | | |
76 | 102 | | |
77 | | - | |
| 103 | + | |
78 | 104 | | |
79 | 105 | | |
80 | 106 | | |
81 | 107 | | |
82 | 108 | | |
83 | 109 | | |
84 | | - | |
| 110 | + | |
85 | 111 | | |
86 | 112 | | |
87 | 113 | | |
| |||
0 commit comments