From 1f31ec76cd83a26559f7a7ee2623bce8b503473d Mon Sep 17 00:00:00 2001 From: tb <> Date: Sat, 24 Feb 2024 08:00:37 +0000 Subject: Remove custom key length handling No cipher in libcrypto is marked EVP_CIPH_CUSTOM_KEY_LENGTH and no control handler deals with EVP_CTRL_SET_KEY_LENGTH, which means that this code is dead as far as libcrypto is concerned. Almost nothing uses EVP_CIPHER_meth* (this was added for a single project) and nothing sets a custom ctrl. This isn't going to change anyway since EVP_CIPHER_meth* is deprecated in order to promote more provider beauty. ok beck jsing --- src/lib/libcrypto/evp/evp_cipher.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'src/lib') diff --git a/src/lib/libcrypto/evp/evp_cipher.c b/src/lib/libcrypto/evp/evp_cipher.c index 12fa6e1d27..c2a88a5591 100644 --- a/src/lib/libcrypto/evp/evp_cipher.c +++ b/src/lib/libcrypto/evp/evp_cipher.c @@ -1,4 +1,4 @@ -/* $OpenBSD: evp_cipher.c,v 1.19 2024/02/18 15:53:54 tb Exp $ */ +/* $OpenBSD: evp_cipher.c,v 1.20 2024/02/24 08:00:37 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -804,10 +804,6 @@ EVP_CIPHER_CTX_key_length(const EVP_CIPHER_CTX *ctx) int EVP_CIPHER_CTX_set_key_length(EVP_CIPHER_CTX *ctx, int key_len) { - /* XXX - remove this. It's unused. */ - if (ctx->cipher->flags & EVP_CIPH_CUSTOM_KEY_LENGTH) - return EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_SET_KEY_LENGTH, - key_len, NULL); if (ctx->key_len == key_len) return 1; if (key_len > 0 && (ctx->cipher->flags & EVP_CIPH_VARIABLE_LENGTH)) { -- cgit v1.2.3-55-g6feb