mirror of https://github.com/wolfSSL/wolfssh.git
Merge pull request #51 from JacobBarthelmeh/testing
Adds extra checks for AES buffer size and update verify mac return errorpull/53/head
commit
5e15ae7061
|
@ -4038,7 +4038,7 @@ static INLINE int Encrypt(WOLFSSH* ssh, byte* cipher, const byte* input,
|
|||
break;
|
||||
|
||||
case ID_AES128_CBC:
|
||||
if (wc_AesCbcEncrypt(&ssh->encryptCipher.aes,
|
||||
if (sz % AES_BLOCK_SIZE || wc_AesCbcEncrypt(&ssh->encryptCipher.aes,
|
||||
cipher, input, sz) < 0) {
|
||||
|
||||
ret = WS_ENCRYPT_E;
|
||||
|
@ -4070,7 +4070,7 @@ static INLINE int Decrypt(WOLFSSH* ssh, byte* plain, const byte* input,
|
|||
break;
|
||||
|
||||
case ID_AES128_CBC:
|
||||
if (wc_AesCbcDecrypt(&ssh->decryptCipher.aes,
|
||||
if (sz % AES_BLOCK_SIZE || wc_AesCbcDecrypt(&ssh->decryptCipher.aes,
|
||||
plain, input, sz) < 0) {
|
||||
|
||||
ret = WS_DECRYPT_E;
|
||||
|
@ -4367,7 +4367,7 @@ int DoReceive(WOLFSSH* ssh)
|
|||
}
|
||||
if (verifyResult != WS_SUCCESS) {
|
||||
WLOG(WS_LOG_DEBUG, "PR: VerifyMac fail");
|
||||
return ret;
|
||||
return verifyResult;
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
|
Loading…
Reference in New Issue