Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/ssl_crypto.c
Original file line number Diff line number Diff line change
Expand Up @@ -2611,7 +2611,8 @@ WOLFSSL_DES_LONG wolfSSL_DES_cbc_cksum(const unsigned char* in,
WOLFSSL_ENTER("wolfSSL_DES_cbc_cksum");

/* Validate parameters. */
if ((in == NULL) || (out == NULL) || (sc == NULL) || (iv == NULL)) {
if ((in == NULL) || (out == NULL) || (sc == NULL) || (iv == NULL)
|| length <= 0) {
WOLFSSL_MSG("Bad argument passed in");
err = 1;
}
Expand Down
3 changes: 3 additions & 0 deletions tests/api/test_ossl_cipher.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,9 @@ int test_wolfSSL_DES(void)
ExpectIntEQ((DES_cbc_cksum(msg, NULL, sizeof(msg), &myDes, &iv)), 0);
ExpectIntEQ((DES_cbc_cksum(msg, &key, sizeof(msg), NULL, &iv)), 0);
ExpectIntEQ((DES_cbc_cksum(msg, &key, sizeof(msg), &myDes, NULL)), 0);
ExpectIntEQ((DES_cbc_cksum(msg, &key, 0, &myDes, &iv)), 0);
ExpectIntEQ((DES_cbc_cksum(msg, &key, -1, &myDes, &iv)), 0);

/* DES_cbc_cksum should return the last 4 of the last 8 bytes after
* DES_cbc_encrypt on the input */
XMEMSET(iv, 0, sizeof(DES_cblock));
Expand Down
Loading