* aes.c (krb5int_aes_encrypt, krb5int_aes_decrypt): Copy out value for new IV
authorKen Raeburn <raeburn@mit.edu>
Mon, 9 Feb 2004 22:06:23 +0000 (22:06 +0000)
committerKen Raeburn <raeburn@mit.edu>
Mon, 9 Feb 2004 22:06:23 +0000 (22:06 +0000)
ticket: 2223
status: open

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16038 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/crypto/enc_provider/ChangeLog
src/lib/crypto/enc_provider/aes.c

index 35af03625810dc58f9b1c2a2374229a828a6ad3c..f27a6c356321b95bc3961635086e6f9ca6706219 100644 (file)
@@ -1,3 +1,8 @@
+2004-02-09  Ken Raeburn  <raeburn@mit.edu>
+
+       * aes.c (krb5int_aes_encrypt, krb5int_aes_decrypt): Copy out value
+       for new IV.
+
 2003-12-19  Ken Raeburn  <raeburn@mit.edu>
 
        * arcfour.c (arcfour_weakkey1, arcfour_weakkey2,
index c6b77f0ecf6f2f3093d9596a7be9479935d91bbc..2bbddddd98a672473a0e355b907d551169a647c7 100644 (file)
@@ -91,6 +91,8 @@ krb5int_aes_encrypt(const krb5_keyblock *key, const krb5_data *ivec,
        xorblock(tmp, tmp3);
        enc(tmp2, tmp, &ctx);
        memcpy(output->data + (nblocks - 2) * BLOCK_SIZE, tmp2, BLOCK_SIZE);
+       if (ivec)
+           memcpy(ivec->data, tmp2, BLOCK_SIZE);
     }
 
     return 0;
@@ -149,6 +151,9 @@ krb5int_aes_decrypt(const krb5_keyblock *key, const krb5_data *ivec,
        dec(tmp3, tmp2, &ctx);
        xorblock(tmp3, tmp);
        memcpy(output->data + (nblocks - 2) * BLOCK_SIZE, tmp3, BLOCK_SIZE);
+       if (ivec)
+           memcpy(ivec->data, input->data + (nblocks - 2) * BLOCK_SIZE,
+                  BLOCK_SIZE);
     }
 
     return 0;