From 61fb057fe77d7169240e9a1cc22b8a8a7246afab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Love=20H=C3=B6rnquist=20=C3=85strand?= Date: Mon, 18 Aug 2008 20:15:30 +0000 Subject: [PATCH] Try to update buf_len to catch more errors git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23636 ec53bebd-3082-4978-b11e-865c3cabbd6b --- lib/hcrypto/evp.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/hcrypto/evp.c b/lib/hcrypto/evp.c index 4fbf295ea..ba6a1a763 100644 --- a/lib/hcrypto/evp.c +++ b/lib/hcrypto/evp.c @@ -765,6 +765,8 @@ int EVP_CipherInit_ex(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *c, ENGINE *engine, const void *key, const void *iv, int encp) { + ctx->buf_len = 0; + if (encp == -1) encp = ctx->encrypt; else @@ -846,6 +848,7 @@ EVP_CipherUpdate(EVP_CIPHER_CTX *ctx, void *out, int *outlen, *outlen = 0; return ret; } + ctx->buf_len += (inlen & ctx->block_mask); return 0; }