summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/evp/e_idea.c
diff options
context:
space:
mode:
authorjsing <>2022-09-10 17:39:47 +0000
committerjsing <>2022-09-10 17:39:47 +0000
commitbb3c52398649c1e41080621f529dbb1d1cee3afb (patch)
tree80e430face99f2837d3b687cded293385ab116a5 /src/lib/libcrypto/evp/e_idea.c
parentb9b7e24dd08d9f1c9b144d42e8f56eacfefeb36b (diff)
downloadopenbsd-bb3c52398649c1e41080621f529dbb1d1cee3afb.tar.gz
openbsd-bb3c52398649c1e41080621f529dbb1d1cee3afb.tar.bz2
openbsd-bb3c52398649c1e41080621f529dbb1d1cee3afb.zip
Use correct length for EVP CFB mode ciphers.
The BLOCK_CIPHER_* macros contained a bug where the total length is passed to the underlying cipher implementation, rather than the length of the current chunk. Correct this and use the chunk length instead. Should address the remaining issues reported by Coverity. ok tb@
Diffstat (limited to 'src/lib/libcrypto/evp/e_idea.c')
-rw-r--r--src/lib/libcrypto/evp/e_idea.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/libcrypto/evp/e_idea.c b/src/lib/libcrypto/evp/e_idea.c
index c7f2b30a44..8696fb2450 100644
--- a/src/lib/libcrypto/evp/e_idea.c
+++ b/src/lib/libcrypto/evp/e_idea.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: e_idea.c,v 1.15 2022/09/04 15:45:25 jsing Exp $ */ 1/* $OpenBSD: e_idea.c,v 1.16 2022/09/10 17:39:47 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -172,7 +172,7 @@ idea_cfb64_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, const unsigned char *
172 chunk = inl; 172 chunk = inl;
173 173
174 while (inl && inl >= chunk) { 174 while (inl && inl >= chunk) {
175 idea_cfb64_encrypt(in, out, (long)inl, &((EVP_IDEA_KEY *)ctx->cipher_data)->ks, ctx->iv, &ctx->num, ctx->encrypt); 175 idea_cfb64_encrypt(in, out, (long)chunk, &((EVP_IDEA_KEY *)ctx->cipher_data)->ks, ctx->iv, &ctx->num, ctx->encrypt);
176 inl -= chunk; 176 inl -= chunk;
177 in += chunk; 177 in += chunk;
178 out += chunk; 178 out += chunk;