From 0947de58250a968ab0f143a98933fa9a14a36422 Mon Sep 17 00:00:00 2001 From: tb Date: Sat, 2 Mar 2024 09:59:56 +0000 Subject: [PATCH] Remove EVP_MD_meth* again Erlang upstream disabled the otp_test_engine for LibreSSL >= 3.5 without explanation. It was the only reason we added this garbage API in the first place. Meanwhile libfido2 started using it for a mock up of OpenSSL 3's broken fetch design with old API. This is pointless, so all this garbage goes away again (in particular we can remove the absolutely horrifying EVP_MD_meth_set_app_datasize() again). ok jsing --- lib/libcrypto/Symbols.list | 13 ---- lib/libcrypto/evp/evp.h | 20 +----- lib/libcrypto/evp/evp_digest.c | 114 +-------------------------------- 3 files changed, 2 insertions(+), 145 deletions(-) diff --git a/lib/libcrypto/Symbols.list b/lib/libcrypto/Symbols.list index 11702722bcf..94ccf0d0160 100644 --- a/lib/libcrypto/Symbols.list +++ b/lib/libcrypto/Symbols.list @@ -1264,19 +1264,6 @@ EVP_MD_block_size EVP_MD_do_all EVP_MD_do_all_sorted EVP_MD_flags -EVP_MD_meth_dup -EVP_MD_meth_free -EVP_MD_meth_new -EVP_MD_meth_set_app_datasize -EVP_MD_meth_set_cleanup -EVP_MD_meth_set_copy -EVP_MD_meth_set_ctrl -EVP_MD_meth_set_final -EVP_MD_meth_set_flags -EVP_MD_meth_set_init -EVP_MD_meth_set_input_blocksize -EVP_MD_meth_set_result_size -EVP_MD_meth_set_update EVP_MD_pkey_type EVP_MD_size EVP_MD_type diff --git a/lib/libcrypto/evp/evp.h b/lib/libcrypto/evp/evp.h index 36de06f49b4..09cd364ac40 100644 --- a/lib/libcrypto/evp/evp.h +++ b/lib/libcrypto/evp/evp.h @@ -1,4 +1,4 @@ -/* $OpenBSD: evp.h,v 1.124 2024/03/02 09:55:30 tb Exp $ */ +/* $OpenBSD: evp.h,v 1.125 2024/03/02 09:59:56 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -352,24 +352,6 @@ int EVP_MD_size(const EVP_MD *md); int EVP_MD_block_size(const EVP_MD *md); unsigned long EVP_MD_flags(const EVP_MD *md); -EVP_MD *EVP_MD_meth_new(int md_type, int pkey_type); -void EVP_MD_meth_free(EVP_MD *md); -EVP_MD *EVP_MD_meth_dup(const EVP_MD *md); -int EVP_MD_meth_set_input_blocksize(EVP_MD *md, int blocksize); -int EVP_MD_meth_set_result_size(EVP_MD *md, int resultsize); -int EVP_MD_meth_set_app_datasize(EVP_MD *md, int datasize); -int EVP_MD_meth_set_flags(EVP_MD *md, unsigned long flags); -int EVP_MD_meth_set_init(EVP_MD *md, int (*init)(EVP_MD_CTX *ctx)); -int EVP_MD_meth_set_update(EVP_MD *md, - int (*update)(EVP_MD_CTX *ctx, const void *data, size_t count)); -int EVP_MD_meth_set_final(EVP_MD *md, - int (*final)(EVP_MD_CTX *ctx, unsigned char *md)); -int EVP_MD_meth_set_copy(EVP_MD *md, - int (*copy)(EVP_MD_CTX *to, const EVP_MD_CTX *from)); -int EVP_MD_meth_set_cleanup(EVP_MD *md, int (*cleanup)(EVP_MD_CTX *ctx)); -int EVP_MD_meth_set_ctrl(EVP_MD *md, - int (*ctrl)(EVP_MD_CTX *ctx, int cmd, int p1, void *p2)); - const EVP_MD *EVP_MD_CTX_md(const EVP_MD_CTX *ctx); void *EVP_MD_CTX_md_data(const EVP_MD_CTX *ctx); EVP_PKEY_CTX *EVP_MD_CTX_pkey_ctx(const EVP_MD_CTX *ctx); diff --git a/lib/libcrypto/evp/evp_digest.c b/lib/libcrypto/evp/evp_digest.c index b8eedd429d0..d360760295b 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.11 2024/03/02 09:55:30 tb Exp $ */ +/* $OpenBSD: evp_digest.c,v 1.12 2024/03/02 09:59:56 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -470,115 +470,3 @@ EVP_MD_block_size(const EVP_MD *md) { return md->block_size; } - -/* - * XXX - remove everything below in the next bump. - */ - -EVP_MD * -EVP_MD_meth_new(int md_type, int pkey_type) -{ - EVP_MD *md; - - if ((md = calloc(1, sizeof(*md))) == NULL) - return NULL; - - md->type = md_type; - md->pkey_type = pkey_type; - - return md; -} - -EVP_MD * -EVP_MD_meth_dup(const EVP_MD *md) -{ - EVP_MD *to; - - if ((to = EVP_MD_meth_new(md->type, md->pkey_type)) == NULL) - return NULL; - - memcpy(to, md, sizeof(*to)); - - return to; -} - -void -EVP_MD_meth_free(EVP_MD *md) -{ - freezero(md, sizeof(*md)); -} - -int -EVP_MD_meth_set_input_blocksize(EVP_MD *md, int blocksize) -{ - md->block_size = blocksize; - return 1; -} - -int -EVP_MD_meth_set_result_size(EVP_MD *md, int result_size) -{ - md->md_size = result_size; - return 1; -} - -int -EVP_MD_meth_set_app_datasize(EVP_MD *md, int datasize) -{ - md->ctx_size = datasize; - return 1; -} - -int -EVP_MD_meth_set_flags(EVP_MD *md, unsigned long flags) -{ - md->flags = flags; - return 1; -} - -int -EVP_MD_meth_set_init(EVP_MD *md, int (*init)(EVP_MD_CTX *ctx)) -{ - md->init = init; - return 1; -} - -int -EVP_MD_meth_set_update(EVP_MD *md, - int (*update)(EVP_MD_CTX *ctx, const void *data, size_t count)) -{ - md->update = update; - return 1; -} - -int -EVP_MD_meth_set_final(EVP_MD *md, - int (*final)(EVP_MD_CTX *ctx, unsigned char *md)) -{ - md->final = final; - return 1; -} - -int -EVP_MD_meth_set_copy(EVP_MD *md, - int (*copy)(EVP_MD_CTX *to, const EVP_MD_CTX *from)) -{ - md->copy = copy; - return 1; -} - -int -EVP_MD_meth_set_cleanup(EVP_MD *md, - int (*cleanup)(EVP_MD_CTX *ctx)) -{ - md->cleanup = cleanup; - return 1; -} - -int -EVP_MD_meth_set_ctrl(EVP_MD *md, - int (*ctrl)(EVP_MD_CTX *ctx, int cmd, int p1, void *p2)) -{ - md->md_ctrl = ctrl; - return 1; -} -- 2.20.1