Skip to content

Commit 17615c9

Browse files
committed
Fix stale comment
1 parent c6706d2 commit 17615c9

1 file changed

Lines changed: 9 additions & 11 deletions

File tree

tests/ecb_check_value_error_test.c

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@
2020
*
2121
* Test for GetEcbCheckValue error propagation (bug #496).
2222
*
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.
2727
*/
2828

2929
#ifdef HAVE_CONFIG_H
@@ -268,14 +268,12 @@ static int test_valid_key_check_value(CK_SESSION_HANDLE session)
268268
}
269269

270270
/*
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.
274274
*
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.
279277
*/
280278
static int test_invalid_key_check_value(CK_SESSION_HANDLE session)
281279
{

0 commit comments

Comments
 (0)