From 8c61083a1257bb7310e9b5f9b2d76468ab5fdddd Mon Sep 17 00:00:00 2001 From: tb Date: Sun, 24 Oct 2021 13:51:07 +0000 Subject: [PATCH] Prepare to provide EVP_MD_CTX_get_md_data() ok beck jsing --- lib/libcrypto/evp/evp.h | 5 ++++- lib/libcrypto/evp/evp_lib.c | 8 +++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/lib/libcrypto/evp/evp.h b/lib/libcrypto/evp/evp.h index 06c529ef3f3..4e32a794b4c 100644 --- a/lib/libcrypto/evp/evp.h +++ b/lib/libcrypto/evp/evp.h @@ -1,4 +1,4 @@ -/* $OpenBSD: evp.h,v 1.83 2021/05/10 17:00:32 tb Exp $ */ +/* $OpenBSD: evp.h,v 1.84 2021/10/24 13:51:07 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -486,6 +486,9 @@ int EVP_MD_block_size(const EVP_MD *md); unsigned long EVP_MD_flags(const EVP_MD *md); const EVP_MD *EVP_MD_CTX_md(const EVP_MD_CTX *ctx); +#if defined(LIBRESSL_NEW_API) +void *EVP_MD_CTX_md_data(const EVP_MD_CTX *ctx); +#endif #define EVP_MD_CTX_size(e) EVP_MD_size(EVP_MD_CTX_md(e)) #define EVP_MD_CTX_block_size(e) EVP_MD_block_size(EVP_MD_CTX_md(e)) #define EVP_MD_CTX_type(e) EVP_MD_type(EVP_MD_CTX_md(e)) diff --git a/lib/libcrypto/evp/evp_lib.c b/lib/libcrypto/evp/evp_lib.c index 90107739e7d..83b81bd4292 100644 --- a/lib/libcrypto/evp/evp_lib.c +++ b/lib/libcrypto/evp/evp_lib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: evp_lib.c,v 1.17 2018/09/12 06:35:38 djm Exp $ */ +/* $OpenBSD: evp_lib.c,v 1.18 2021/10/24 13:51:07 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -353,6 +353,12 @@ EVP_MD_CTX_md(const EVP_MD_CTX *ctx) return ctx->digest; } +void * +EVP_MD_CTX_md_data(const EVP_MD_CTX *ctx) +{ + return ctx->md_data; +} + void EVP_MD_CTX_set_flags(EVP_MD_CTX *ctx, int flags) { -- 2.20.1