From: tb Date: Sat, 24 Feb 2024 08:00:37 +0000 (+0000) Subject: Remove custom key length handling X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=5e446fa12676e6fbdbfd3e1e8671c3fd8b8802bb;p=openbsd 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 --- diff --git a/lib/libcrypto/evp/evp_cipher.c b/lib/libcrypto/evp/evp_cipher.c index 12fa6e1d279..c2a88a5591c 100644 --- a/lib/libcrypto/evp/evp_cipher.c +++ b/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)) {