summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjsing <>2022-09-10 17:45:10 +0000
committerjsing <>2022-09-10 17:45:10 +0000
commit8b1f87ff17c15812707feb063a073472bba18199 (patch)
tree605ee66692b0dd95f08a405d135414ba2d69e169 /src
parentde6c106921914263e126f0a65ff53578716ce425 (diff)
downloadopenbsd-8b1f87ff17c15812707feb063a073472bba18199.tar.gz
openbsd-8b1f87ff17c15812707feb063a073472bba18199.tar.bz2
openbsd-8b1f87ff17c15812707feb063a073472bba18199.zip
Increment the input and output position for EVP AES CFB1.
The length is decremented, however the input is repeatedly read from and output written to the same position. Correct this by actually incrementing the input and output pointers. Found via OpenSSL 604e591ed7, ok tb@
Diffstat (limited to 'src')
-rw-r--r--src/lib/libcrypto/evp/e_aes.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lib/libcrypto/evp/e_aes.c b/src/lib/libcrypto/evp/e_aes.c
index e6bba2b952..3661abcbfe 100644
--- a/src/lib/libcrypto/evp/e_aes.c
+++ b/src/lib/libcrypto/evp/e_aes.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: e_aes.c,v 1.47 2022/09/06 06:38:26 jsing Exp $ */ 1/* $OpenBSD: e_aes.c,v 1.48 2022/09/10 17:45:10 jsing Exp $ */
2/* ==================================================================== 2/* ====================================================================
3 * Copyright (c) 2001-2011 The OpenSSL Project. All rights reserved. 3 * Copyright (c) 2001-2011 The OpenSSL Project. All rights reserved.
4 * 4 *
@@ -511,6 +511,8 @@ aes_cfb1_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
511 CRYPTO_cfb128_1_encrypt(in, out, MAXBITCHUNK*8, &dat->ks, 511 CRYPTO_cfb128_1_encrypt(in, out, MAXBITCHUNK*8, &dat->ks,
512 ctx->iv, &ctx->num, ctx->encrypt, dat->block); 512 ctx->iv, &ctx->num, ctx->encrypt, dat->block);
513 len -= MAXBITCHUNK; 513 len -= MAXBITCHUNK;
514 in += MAXBITCHUNK;
515 out += MAXBITCHUNK;
514 } 516 }
515 if (len) 517 if (len)
516 CRYPTO_cfb128_1_encrypt(in, out, len*8, &dat->ks, 518 CRYPTO_cfb128_1_encrypt(in, out, len*8, &dat->ks,