|
20 | 20 | * |
21 | 21 | * Test for GetEcbCheckValue error propagation (bug #496). |
22 | 22 | * |
23 | | - * GetEcbCheckValue always returns CKR_OK even when WP11_AesEcb_Encrypt fails. |
24 | | - * A generic secret key with an invalid AES key length (e.g. 5 bytes) causes |
25 | | - * the encrypt to fail, but C_GetAttributeValue still returns CKR_OK with |
26 | | - * uninitialized output. |
| 23 | + * Verifies that GetEcbCheckValue correctly propagates failures from |
| 24 | + * WP11_AesEcb_Encrypt. A generic secret key with an invalid AES key length |
| 25 | + * (e.g. 5 bytes) causes the encrypt to fail, and C_GetAttributeValue must |
| 26 | + * return CKR_FUNCTION_FAILED. |
27 | 27 | */ |
28 | 28 |
|
29 | 29 | #ifdef HAVE_CONFIG_H |
@@ -268,14 +268,12 @@ static int test_valid_key_check_value(CK_SESSION_HANDLE session) |
268 | 268 | } |
269 | 269 |
|
270 | 270 | /* |
271 | | - * Test 2 (bug demonstration): Create a 5-byte CKK_GENERIC_SECRET key and |
272 | | - * query CKA_CHECK_VALUE. The 5-byte key is not a valid AES key length, so |
273 | | - * WP11_AesEcb_Encrypt (called by GetEcbCheckValue) fails internally. |
| 271 | + * Test 2: Create a 5-byte CKK_GENERIC_SECRET key and query CKA_CHECK_VALUE. |
| 272 | + * The 5-byte key is not a valid AES key length, so WP11_AesEcb_Encrypt |
| 273 | + * (called by GetEcbCheckValue) fails internally. |
274 | 274 | * |
275 | | - * BUG #496: GetEcbCheckValue always returns CKR_OK regardless of whether the |
276 | | - * encrypt succeeded. This test expects CKR_OK (proving the bug exists). |
277 | | - * Once the bug is fixed, this test should be updated to expect |
278 | | - * CKR_FUNCTION_FAILED. |
| 275 | + * Verifies the fix for BUG #496: GetEcbCheckValue now correctly propagates |
| 276 | + * the encrypt failure, returning CKR_FUNCTION_FAILED. |
279 | 277 | */ |
280 | 278 | static int test_invalid_key_check_value(CK_SESSION_HANDLE session) |
281 | 279 | { |
|
0 commit comments