summaryrefslogtreecommitdiffstats
path: root/crypto/modes
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/modes')
-rw-r--r--crypto/modes/cfb128.c5
-rw-r--r--crypto/modes/ctr128.c2
-rw-r--r--crypto/modes/ofb128.c5
3 files changed, 11 insertions, 1 deletions
diff --git a/crypto/modes/cfb128.c b/crypto/modes/cfb128.c
index fa94f047b5..f9c3c60536 100644
--- a/crypto/modes/cfb128.c
+++ b/crypto/modes/cfb128.c
@@ -30,6 +30,11 @@ void CRYPTO_cfb128_encrypt(const unsigned char *in, unsigned char *out,
unsigned int n;
size_t l = 0;
+ if (*num < 0) {
+ /* There is no good way to signal an error return from here */
+ *num = -1;
+ return;
+ }
n = *num;
if (enc) {
diff --git a/crypto/modes/ctr128.c b/crypto/modes/ctr128.c
index b902ee9b0b..2147751c58 100644
--- a/crypto/modes/ctr128.c
+++ b/crypto/modes/ctr128.c
@@ -155,7 +155,7 @@ void CRYPTO_ctr128_encrypt_ctr32(const unsigned char *in, unsigned char *out,
{
unsigned int n, ctr32;
- n = *num;
+ n = *num;
while (n && len) {
*(out++) = *(in++) ^ ecount_buf[n];
diff --git a/crypto/modes/ofb128.c b/crypto/modes/ofb128.c
index 829d724e2a..0b21380208 100644
--- a/crypto/modes/ofb128.c
+++ b/crypto/modes/ofb128.c
@@ -29,6 +29,11 @@ void CRYPTO_ofb128_encrypt(const unsigned char *in, unsigned char *out,
unsigned int n;
size_t l = 0;
+ if (*num < 0) {
+ /* There is no good way to signal an error return from here */
+ *num = -1;
+ return;
+ }
n = *num;
#if !defined(OPENSSL_SMALL_FOOTPRINT)