OpenSSL 1.1.1-pre2
This commit is contained in:
@@ -174,6 +174,27 @@ int EVP_DigestFinal_ex(EVP_MD_CTX *ctx, unsigned char *md, unsigned int *size)
|
||||
return ret;
|
||||
}
|
||||
|
||||
int EVP_DigestFinalXOF(EVP_MD_CTX *ctx, unsigned char *md, size_t size)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
if (ctx->digest->flags & EVP_MD_FLAG_XOF
|
||||
&& size <= INT_MAX
|
||||
&& ctx->digest->md_ctrl(ctx, EVP_MD_CTRL_XOF_LEN, (int)size, NULL)) {
|
||||
ret = ctx->digest->final(ctx, md);
|
||||
|
||||
if (ctx->digest->cleanup != NULL) {
|
||||
ctx->digest->cleanup(ctx);
|
||||
EVP_MD_CTX_set_flags(ctx, EVP_MD_CTX_FLAG_CLEANED);
|
||||
}
|
||||
OPENSSL_cleanse(ctx->md_data, ctx->digest->ctx_size);
|
||||
} else {
|
||||
EVPerr(EVP_F_EVP_DIGESTFINALXOF, EVP_R_NOT_XOF_OR_INVALID_LENGTH);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int EVP_MD_CTX_copy(EVP_MD_CTX *out, const EVP_MD_CTX *in)
|
||||
{
|
||||
EVP_MD_CTX_reset(out);
|
||||
|
||||
Reference in New Issue
Block a user