From 354be4ad0776835ab3178ad39b67c7a6230bd781 Mon Sep 17 00:00:00 2001 From: tb Date: Fri, 29 Dec 2023 07:02:28 +0000 Subject: [PATCH] Move init/reset next to cleanup This way new/free aka create/destroy are next to each other. reset/cleanup are the same thing and init will join the club after some other fixing because two APIs that do the exact same thing aren't enough. --- lib/libcrypto/evp/evp_digest.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/lib/libcrypto/evp/evp_digest.c b/lib/libcrypto/evp/evp_digest.c index 75787d3f7d2..e29081d3375 100644 --- a/lib/libcrypto/evp/evp_digest.c +++ b/lib/libcrypto/evp/evp_digest.c @@ -1,4 +1,4 @@ -/* $OpenBSD: evp_digest.c,v 1.3 2023/12/29 06:59:24 tb Exp $ */ +/* $OpenBSD: evp_digest.c,v 1.4 2023/12/29 07:02:28 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -234,18 +234,6 @@ EVP_MD_CTX_free(EVP_MD_CTX *ctx) free(ctx); } -void -EVP_MD_CTX_init(EVP_MD_CTX *ctx) -{ - memset(ctx, 0, sizeof(*ctx)); -} - -int -EVP_MD_CTX_reset(EVP_MD_CTX *ctx) -{ - return EVP_MD_CTX_cleanup(ctx); -} - EVP_MD_CTX * EVP_MD_CTX_create(void) { @@ -258,6 +246,18 @@ EVP_MD_CTX_destroy(EVP_MD_CTX *ctx) EVP_MD_CTX_free(ctx); } +void +EVP_MD_CTX_init(EVP_MD_CTX *ctx) +{ + memset(ctx, 0, sizeof(*ctx)); +} + +int +EVP_MD_CTX_reset(EVP_MD_CTX *ctx) +{ + return EVP_MD_CTX_cleanup(ctx); +} + /* This call frees resources associated with the context */ int EVP_MD_CTX_cleanup(EVP_MD_CTX *ctx) -- 2.20.1