Revert "aes_crypt_cbc always returns zero so ignore its return value."

This reverts commit 4314970b0d.

Oops, it can return invalid length.
This commit is contained in:
Con Kolivas 2011-03-16 10:00:20 +11:00
parent 2d2a9bc1e9
commit ddcc45ebf0

View file

@ -1180,8 +1180,9 @@ retry:
if (encrypt_pad) if (encrypt_pad)
get_rand(cti->s_buf + cti->c_len, encrypt_pad); get_rand(cti->s_buf + cti->c_len, encrypt_pad);
print_maxverbose("Encrypting block \n"); print_maxverbose("Encrypting block \n");
aes_crypt_cbc(&control->aes_ctx, AES_ENCRYPT, padded_len, if (unlikely(aes_crypt_cbc(&control->aes_ctx, AES_ENCRYPT,
control->hash_iv, cti->s_buf, cti->s_buf); padded_len, control->hash_iv, cti->s_buf, cti->s_buf)))
failure("Failed to aes_crypt_cbc in compthread\n");
} else } else
padded_len = cti->c_len; padded_len = cti->c_len;
@ -1439,8 +1440,9 @@ fill_another:
if (ENCRYPT) { if (ENCRYPT) {
print_maxverbose("Decrypting block \n"); print_maxverbose("Decrypting block \n");
aes_crypt_cbc(&control->aes_ctx, AES_DECRYPT, padded_len, if (unlikely(aes_crypt_cbc(&control->aes_ctx, AES_DECRYPT,
control->hash_iv, s_buf, s_buf); padded_len, control->hash_iv, s_buf, s_buf)))
failure("Failed to aes_crypt_cbc in fill_buffer\n");
} }
ucthread[s->uthread_no].s_buf = s_buf; ucthread[s->uthread_no].s_buf = s_buf;