(_krb5_aes_cts_encrypt): out iv is the iv of the next to last block,
fix decryption case too git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@13311 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -2203,6 +2203,7 @@ _krb5_aes_cts_encrypt(const unsigned char *in, unsigned char *out,
|
||||
|
||||
len -= AES_BLOCK_SIZE;
|
||||
|
||||
memcpy(tmp, in, AES_BLOCK_SIZE); /* save last iv */
|
||||
AES_decrypt(in, tmp2, key);
|
||||
|
||||
memcpy(tmp3, in + AES_BLOCK_SIZE, len);
|
||||
@@ -2214,6 +2215,7 @@ _krb5_aes_cts_encrypt(const unsigned char *in, unsigned char *out,
|
||||
AES_decrypt(tmp3, out, key);
|
||||
for (i = 0; i < AES_BLOCK_SIZE; i++)
|
||||
out[i] ^= ivec[i];
|
||||
memcpy(ivec, tmp, AES_BLOCK_SIZE);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user