summaryrefslogtreecommitdiff
path: root/crypto/ecdh.c
diff options
context:
space:
mode:
authorEric Biggers <ebiggers@google.com>2019-01-03 20:16:11 -0800
committerHerbert Xu <herbert@gondor.apana.org.au>2019-01-11 14:16:57 +0800
commit25ab3ef805058c211736157d5a978284296d7df5 (patch)
treee1594bcfd38ef9365447fbff9657afba705df42b /crypto/ecdh.c
parentac4ceaab9fb05b5d461e57d39afbfef1321e06f2 (diff)
downloadlinux-crypto-25ab3ef805058c211736157d5a978284296d7df5.tar.gz
linux-crypto-25ab3ef805058c211736157d5a978284296d7df5.zip
crypto: cfb - remove bogus memcpy() with src == dest
The memcpy() in crypto_cfb_decrypt_inplace() uses walk->iv as both the source and destination, which has undefined behavior. It is unneeded because walk->iv is already used to hold the previous ciphertext block; thus, walk->iv is already updated to its final value. So, remove it. Also, note that in-place decryption is the only case where the previous ciphertext block is not directly available. Therefore, as a related cleanup I also updated crypto_cfb_encrypt_segment() to directly use the previous ciphertext block rather than save it into walk->iv. This makes it consistent with in-place encryption and out-of-place decryption; now only in-place decryption is different, because it has to be. Fixes: df5fcebba63e ("crypto: cfb - add support for Cipher FeedBack mode") Cc: <stable@vger.kernel.org> # v4.17+ Cc: James Bottomley <James.Bottomley@HansenPartnership.com> Signed-off-by: Eric Biggers <ebiggers@google.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto/ecdh.c')
0 files changed, 0 insertions, 0 deletions