mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-30 18:57:27 +02:00
remove store of last block w/o padding and adjust padding last block case
This commit is contained in:
@ -358,15 +358,15 @@ WOLFSSL_API int wolfSSL_EVP_CipherUpdate(WOLFSSL_EVP_CIPHER_CTX *ctx,
|
||||
if ((ctx->flags & WOLFSSL_EVP_CIPH_NO_PADDING) ||
|
||||
(ctx->block_size == 1)) {
|
||||
ctx->lastUsed = 0;
|
||||
XMEMCPY(ctx->lastBlock, &out[ctx->block_size * blocks], ctx->block_size);
|
||||
*outl+= ctx->block_size * blocks;
|
||||
} else {
|
||||
if (inl == 0) {
|
||||
ctx->lastUsed = 1;
|
||||
blocks = blocks - 1; /* save last block to check padding in
|
||||
* EVP_CipherFinal call */
|
||||
XMEMCPY(ctx->lastBlock, &out[ctx->block_size * blocks],
|
||||
ctx->block_size);
|
||||
}
|
||||
XMEMCPY(ctx->lastBlock, &out[ctx->block_size * blocks], ctx->block_size);
|
||||
*outl+= ctx->block_size * blocks;
|
||||
}
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user