Skip to content

Commit 092d4df

Browse files
committed
Fix the unused variable warning
1 parent 838a092 commit 092d4df

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

tests/pkcs11test.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16420,16 +16420,14 @@ static CK_RV test_wrap_key_ro_session(void* args)
1642016420
* platforms where CK_ULONG is 64-bit (LP64). */
1642116421
static CK_RV test_encrypt_data_len_range(void* args)
1642216422
{
16423+
#if SIZEOF_LONG > 4
1642316424
CK_SESSION_HANDLE session = *(CK_SESSION_HANDLE*)args;
1642416425
CK_RV ret;
1642516426
CK_OBJECT_HANDLE key;
1642616427
byte plain[16], enc[32], iv[16];
1642716428
CK_ULONG encSz;
1642816429
CK_MECHANISM mech;
1642916430

16430-
if (sizeof(CK_ULONG) <= sizeof(word32))
16431-
return CKR_SKIPPED;
16432-
1643316431
memset(plain, 9, sizeof(plain));
1643416432
memset(iv, 9, sizeof(iv));
1643516433
encSz = sizeof(enc);
@@ -16443,17 +16441,19 @@ static CK_RV test_encrypt_data_len_range(void* args)
1644316441
ret = funcList->C_EncryptInit(session, &mech, key);
1644416442
CHECK_CKR(ret, "AES-CBC Encrypt Init for data len range test");
1644516443
}
16446-
/* Pass a data length that overflows word32 (only testable on LP64) */
16447-
#if SIZEOF_LONG > 4
16444+
/* Pass a data length that overflows word32 */
1644816445
if (ret == CKR_OK) {
1644916446
CK_ULONG bigLen = ((CK_ULONG)1 << 32) + 16;
1645016447
ret = funcList->C_Encrypt(session, plain, bigLen, enc, &encSz);
1645116448
CHECK_CKR_FAIL(ret, CKR_DATA_LEN_RANGE,
1645216449
"AES-CBC Encrypt rejects oversized data length");
1645316450
}
16454-
#endif
1645516451

1645616452
return ret;
16453+
#else
16454+
(void)args;
16455+
return CKR_SKIPPED;
16456+
#endif
1645716457
}
1645816458
#endif /* HAVE_AES_CBC */
1645916459
#endif /* !NO_AES */

0 commit comments

Comments
 (0)