Merge pull request #1298 from toorls/dev-v3

fix cbc bug
This commit is contained in:
Zhi Guan
2022-08-25 15:01:12 +08:00
committed by GitHub

View File

@@ -294,7 +294,7 @@ int sm4_cbc_decrypt_update(SM4_CBC_CTX *ctx,
}
*outlen = 0;
if (ctx->block_nbytes < SM4_BLOCK_SIZE) {
if (ctx->block_nbytes) {
left = SM4_BLOCK_SIZE - ctx->block_nbytes;
if (inlen <= left) {
memcpy(ctx->block + ctx->block_nbytes, in, inlen);