Skip to content

Commit

Permalink
Merge pull request #7715 from kaleb-himes/C394706
Browse files Browse the repository at this point in the history
Address coverity issue 394706
  • Loading branch information
JacobBarthelmeh authored Jul 5, 2024
2 parents ac52660 + f42fb58 commit 7ef424b
Showing 1 changed file with 31 additions and 31 deletions.
62 changes: 31 additions & 31 deletions wolfcrypt/test/test.c
Original file line number Diff line number Diff line change
Expand Up @@ -28587,39 +28587,39 @@ WOLFSSL_TEST_SUBROUTINE wc_test_ret_t srtpkdf_test(void)
return WC_TEST_RET_ENC_NC;
for (i = 0; i < 32; i++) {
word32 kdr = 1U << i;
idx = wc_SRTP_KDF_kdr_to_idx(kdr);
if (idx != i)
return WC_TEST_RET_ENC_NC;
}

/* SRTCP w/ 48-bit IDX, 128-bit key test */
if (i == 0) {
ret = wc_SRTCP_KDF_ex(mk48_1, (word32)sizeof(mk48_1),
ms48_1, (word32)sizeof(ms48_1),
kdr_48_1, srtcp48idx_1, keyE, tv[i].keSz,
keyA, tv[i].kaSz, keyS, tv[i].ksSz,
WC_SRTCP_48BIT_IDX);
if (ret != 0)
return WC_TEST_RET_ENC_EC(ret);
if (XMEMCMP(keyE, srtcpKe_48_1, tv[i].keSz) != 0)
return WC_TEST_RET_ENC_NC;
if (XMEMCMP(keyA, srtcpKa_48_1, tv[i].kaSz) != 0)
return WC_TEST_RET_ENC_NC;
if (XMEMCMP(keyS, srtcpKs_48_1, tv[i].ksSz) != 0)
return WC_TEST_RET_ENC_NC;
/* SRTCP w/ 48-bit IDX, 128-bit key test */
if (i == 0) {
ret = wc_SRTCP_KDF_ex(mk48_1, (word32)sizeof(mk48_1),
ms48_1, (word32)sizeof(ms48_1),
kdr_48_1, srtcp48idx_1, keyE, tv[i].keSz,
keyA, tv[i].kaSz, keyS, tv[i].ksSz,
WC_SRTCP_48BIT_IDX);
if (ret != 0)
return WC_TEST_RET_ENC_EC(ret);
if (XMEMCMP(keyE, srtcpKe_48_1, tv[i].keSz) != 0)
return WC_TEST_RET_ENC_NC;
if (XMEMCMP(keyA, srtcpKa_48_1, tv[i].kaSz) != 0)
return WC_TEST_RET_ENC_NC;
if (XMEMCMP(keyS, srtcpKs_48_1, tv[i].ksSz) != 0)
return WC_TEST_RET_ENC_NC;

ret = wc_SRTCP_KDF_ex(mk48_2, (word32)sizeof(mk48_2),
ms48_2, (word32)sizeof(ms48_2),
kdr_48_2, srtcp48idx_2, keyE, tv[i].keSz,
keyA, tv[i].kaSz, keyS, tv[i].ksSz,
WC_SRTCP_48BIT_IDX);
if (ret != 0)
return WC_TEST_RET_ENC_EC(ret);
if (XMEMCMP(keyE, srtcpKe_48_2, tv[i].keSz) != 0)
return WC_TEST_RET_ENC_NC;
if (XMEMCMP(keyA, srtcpKa_48_2, tv[i].kaSz) != 0)
return WC_TEST_RET_ENC_NC;
if (XMEMCMP(keyS, srtcpKs_48_2, tv[i].ksSz) != 0)
ret = wc_SRTCP_KDF_ex(mk48_2, (word32)sizeof(mk48_2),
ms48_2, (word32)sizeof(ms48_2),
kdr_48_2, srtcp48idx_2, keyE, tv[i].keSz,
keyA, tv[i].kaSz, keyS, tv[i].ksSz,
WC_SRTCP_48BIT_IDX);
if (ret != 0)
return WC_TEST_RET_ENC_EC(ret);
if (XMEMCMP(keyE, srtcpKe_48_2, tv[i].keSz) != 0)
return WC_TEST_RET_ENC_NC;
if (XMEMCMP(keyA, srtcpKa_48_2, tv[i].kaSz) != 0)
return WC_TEST_RET_ENC_NC;
if (XMEMCMP(keyS, srtcpKs_48_2, tv[i].ksSz) != 0)
return WC_TEST_RET_ENC_NC;
}
idx = wc_SRTP_KDF_kdr_to_idx(kdr);
if (idx != i)
return WC_TEST_RET_ENC_NC;
}

Expand Down

0 comments on commit 7ef424b

Please sign in to comment.