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
This commit is contained in:
Love Hörnquist Åstrand
2008-08-18 20:15:30 +00:00
parent bbc4454631
commit 61fb057fe7

View File

@@ -765,6 +765,8 @@ int
EVP_CipherInit_ex(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *c, ENGINE *engine, EVP_CipherInit_ex(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *c, ENGINE *engine,
const void *key, const void *iv, int encp) const void *key, const void *iv, int encp)
{ {
ctx->buf_len = 0;
if (encp == -1) if (encp == -1)
encp = ctx->encrypt; encp = ctx->encrypt;
else else
@@ -846,6 +848,7 @@ EVP_CipherUpdate(EVP_CIPHER_CTX *ctx, void *out, int *outlen,
*outlen = 0; *outlen = 0;
return ret; return ret;
} }
ctx->buf_len += (inlen & ctx->block_mask);
return 0; return 0;
} }