diff options
author | Ken Raeburn <raeburn@mit.edu> | 2004-02-09 22:06:23 +0000 |
---|---|---|
committer | Ken Raeburn <raeburn@mit.edu> | 2004-02-09 22:06:23 +0000 |
commit | abc5739f84e5d9e317295eb9e036aeacdc250cfc (patch) | |
tree | ce5a95a987a8183899fc6df7eca79789c395ffab /src | |
parent | 2e6b23bb9dbd7d851818b0b84be26959e24f1086 (diff) | |
download | krb5-abc5739f84e5d9e317295eb9e036aeacdc250cfc.tar.gz krb5-abc5739f84e5d9e317295eb9e036aeacdc250cfc.tar.xz krb5-abc5739f84e5d9e317295eb9e036aeacdc250cfc.zip |
* aes.c (krb5int_aes_encrypt, krb5int_aes_decrypt): Copy out value for new IV
ticket: 2223
status: open
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16038 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/crypto/enc_provider/ChangeLog | 5 | ||||
-rw-r--r-- | src/lib/crypto/enc_provider/aes.c | 5 |
2 files changed, 10 insertions, 0 deletions
diff --git a/src/lib/crypto/enc_provider/ChangeLog b/src/lib/crypto/enc_provider/ChangeLog index 35af036258..f27a6c3563 100644 --- a/src/lib/crypto/enc_provider/ChangeLog +++ b/src/lib/crypto/enc_provider/ChangeLog @@ -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, diff --git a/src/lib/crypto/enc_provider/aes.c b/src/lib/crypto/enc_provider/aes.c index c6b77f0ecf..2bbddddd98 100644 --- a/src/lib/crypto/enc_provider/aes.c +++ b/src/lib/crypto/enc_provider/aes.c @@ -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; |