summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/evp/e_rc4_hmac_md5.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/evp/e_rc4_hmac_md5.c')
-rw-r--r--src/lib/libcrypto/evp/e_rc4_hmac_md5.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lib/libcrypto/evp/e_rc4_hmac_md5.c b/src/lib/libcrypto/evp/e_rc4_hmac_md5.c
index a1fc0066e6..ac73361fa3 100644
--- a/src/lib/libcrypto/evp/e_rc4_hmac_md5.c
+++ b/src/lib/libcrypto/evp/e_rc4_hmac_md5.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: e_rc4_hmac_md5.c,v 1.7 2016/11/05 10:47:57 miod Exp $ */ 1/* $OpenBSD: e_rc4_hmac_md5.c,v 1.8 2017/01/31 13:17:21 inoguchi Exp $ */
2/* ==================================================================== 2/* ====================================================================
3 * Copyright (c) 2011 The OpenSSL Project. All rights reserved. 3 * Copyright (c) 2011 The OpenSSL Project. All rights reserved.
4 * 4 *
@@ -262,6 +262,8 @@ rc4_hmac_md5_ctrl(EVP_CIPHER_CTX *ctx, int type, int arg, void *ptr)
262 unsigned int len = p[arg - 2] << 8 | p[arg - 1]; 262 unsigned int len = p[arg - 2] << 8 | p[arg - 1];
263 263
264 if (!ctx->encrypt) { 264 if (!ctx->encrypt) {
265 if (len < MD5_DIGEST_LENGTH)
266 return -1;
265 len -= MD5_DIGEST_LENGTH; 267 len -= MD5_DIGEST_LENGTH;
266 p[arg - 2] = len >> 8; 268 p[arg - 2] = len >> 8;
267 p[arg - 1] = len; 269 p[arg - 1] = len;