fix EVP_CipherFinal outlen for stream cipher

pull/1319/head
Takashi Kojo 2017-03-23 10:02:56 +09:00 committed by Jacob Barthelmeh
parent 27a9b23d2b
commit 6fd949279d
1 changed files with 3 additions and 3 deletions

View File

@ -413,7 +413,7 @@ WOLFSSL_API int wolfSSL_EVP_CipherFinal(WOLFSSL_EVP_CIPHER_CTX *ctx,
PRINT_BUF(out, ctx->block_size);
*outl = ctx->block_size;
}
} else *outl = 0;
} else {
if (ctx->block_size == 1){
*outl = 0; return WOLFSSL_SUCCESS;
@ -423,8 +423,8 @@ WOLFSSL_API int wolfSSL_EVP_CipherFinal(WOLFSSL_EVP_CIPHER_CTX *ctx,
if ((fl = checkPad(ctx, ctx->lastBlock)) >= 0) {
XMEMCPY(out, ctx->lastBlock, fl);
*outl = fl;
} else return WOLFSSL_FAILURE;
}
} else return 0;
} else *outl = 0;
}
return WOLFSSL_SUCCESS;
}