forked from wolfSSL/wolfssl
This commit is contained in:
@ -19196,7 +19196,8 @@ size_t wolfSSL_get_client_random(const WOLFSSL* ssl, unsigned char* out,
|
||||
(void)wc_Des3Init(&des, NULL, INVALID_DEVID);
|
||||
|
||||
if (enc) {
|
||||
wc_Des3_SetKey(&des, key, (const byte*)ivec, DES_ENCRYPTION);
|
||||
if (wc_Des3_SetKey(&des, key, (const byte*)ivec,
|
||||
DES_ENCRYPTION) == 0) {
|
||||
ret = wc_Des3_CbcEncrypt(&des, output, input, (word32)blk*DES_BLOCK_SIZE);
|
||||
#if defined(WOLFSSL_ASYNC_CRYPT)
|
||||
ret = wc_AsyncWait(ret, &des.asyncDev, WC_ASYNC_FLAG_NONE);
|
||||
@ -19213,8 +19214,10 @@ size_t wolfSSL_get_client_random(const WOLFSSL* ssl, unsigned char* out,
|
||||
(void)ret; /* ignore return codes for processing */
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
wc_Des3_SetKey(&des, key, (const byte*)ivec, DES_DECRYPTION);
|
||||
if (wc_Des3_SetKey(&des, key, (const byte*)ivec,
|
||||
DES_DECRYPTION) == 0) {
|
||||
ret = wc_Des3_CbcDecrypt(&des, output, input, (word32)blk*DES_BLOCK_SIZE);
|
||||
#if defined(WOLFSSL_ASYNC_CRYPT)
|
||||
ret = wc_AsyncWait(ret, &des.asyncDev, WC_ASYNC_FLAG_NONE);
|
||||
@ -19229,6 +19232,7 @@ size_t wolfSSL_get_client_random(const WOLFSSL* ssl, unsigned char* out,
|
||||
XMEMCPY(output+sz-lb_sz, lastblock, lb_sz);
|
||||
}
|
||||
}
|
||||
}
|
||||
wc_Des3Free(&des);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user