summaryrefslogtreecommitdiffstats
path: root/crypto/idea
diff options
context:
space:
mode:
authorPauli <ppzgs1@gmail.com>2021-03-22 12:09:19 +1000
committerPauli <ppzgs1@gmail.com>2021-03-24 09:12:43 +1000
commit1634b2df9f12d3976129ba49e38638e3ab368e3d (patch)
tree946791596a0e09bb9b04f0f8065b1fb9831e36b5 /crypto/idea
parentfe10fa75216cb0e81eeee9bced2b4d26e05bf9e7 (diff)
enc: fix coverity 1451499, 1451501, 1451506, 1451507, 1351511, 1451514, 1451517, 1451523, 1451526m 1451528, 1451539, 1451441, 1451549, 1451568 & 1451572: improper use of negative value
Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14638)
Diffstat (limited to 'crypto/idea')
-rw-r--r--crypto/idea/i_cfb64.c5
-rw-r--r--crypto/idea/i_ofb64.c5
2 files changed, 10 insertions, 0 deletions
diff --git a/crypto/idea/i_cfb64.c b/crypto/idea/i_cfb64.c
index b9db1639cf..a477799edf 100644
--- a/crypto/idea/i_cfb64.c
+++ b/crypto/idea/i_cfb64.c
@@ -33,6 +33,11 @@ void IDEA_cfb64_encrypt(const unsigned char *in, unsigned char *out,
unsigned long ti[2];
unsigned char *iv, c, cc;
+ if (n < 0) {
+ *num = -1;
+ return;
+ }
+
iv = (unsigned char *)ivec;
if (encrypt) {
while (l--) {
diff --git a/crypto/idea/i_ofb64.c b/crypto/idea/i_ofb64.c
index 89ac18ce91..246886bdc4 100644
--- a/crypto/idea/i_ofb64.c
+++ b/crypto/idea/i_ofb64.c
@@ -35,6 +35,11 @@ void IDEA_ofb64_encrypt(const unsigned char *in, unsigned char *out,
unsigned char *iv;
int save = 0;
+ if (n < 0) {
+ *num = -1;
+ return;
+ }
+
iv = (unsigned char *)ivec;
n2l(iv, v0);
n2l(iv, v1);