From 38222b38b207daf873be88196a8bb44af6f5e586 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Love=20H=C3=B6rnquist=20=C3=85strand?= Date: Tue, 3 Feb 2004 21:04:41 +0000 Subject: [PATCH] (_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 --- lib/krb5/crypto.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/krb5/crypto.c b/lib/krb5/crypto.c index 29c37f3c2..d9f213094 100644 --- a/lib/krb5/crypto.c +++ b/lib/krb5/crypto.c @@ -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); } }