diff options
author | tb <> | 2024-02-24 08:00:37 +0000 |
---|---|---|
committer | tb <> | 2024-02-24 08:00:37 +0000 |
commit | 1f31ec76cd83a26559f7a7ee2623bce8b503473d (patch) | |
tree | 4c348bb661a53df990a06ab06c91de697295c9e6 | |
parent | 8d2b78c5e17d7734a67e7476a85adbbb8de41cf2 (diff) | |
download | openbsd-1f31ec76cd83a26559f7a7ee2623bce8b503473d.tar.gz openbsd-1f31ec76cd83a26559f7a7ee2623bce8b503473d.tar.bz2 openbsd-1f31ec76cd83a26559f7a7ee2623bce8b503473d.zip |
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
-rw-r--r-- | src/lib/libcrypto/evp/evp_cipher.c | 6 |
1 files changed, 1 insertions, 5 deletions
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 @@ | |||
1 | /* $OpenBSD: evp_cipher.c,v 1.19 2024/02/18 15:53:54 tb Exp $ */ | 1 | /* $OpenBSD: evp_cipher.c,v 1.20 2024/02/24 08:00:37 tb Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -804,10 +804,6 @@ EVP_CIPHER_CTX_key_length(const EVP_CIPHER_CTX *ctx) | |||
804 | int | 804 | int |
805 | EVP_CIPHER_CTX_set_key_length(EVP_CIPHER_CTX *ctx, int key_len) | 805 | EVP_CIPHER_CTX_set_key_length(EVP_CIPHER_CTX *ctx, int key_len) |
806 | { | 806 | { |
807 | /* XXX - remove this. It's unused. */ | ||
808 | if (ctx->cipher->flags & EVP_CIPH_CUSTOM_KEY_LENGTH) | ||
809 | return EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_SET_KEY_LENGTH, | ||
810 | key_len, NULL); | ||
811 | if (ctx->key_len == key_len) | 807 | if (ctx->key_len == key_len) |
812 | return 1; | 808 | return 1; |
813 | if (key_len > 0 && (ctx->cipher->flags & EVP_CIPH_VARIABLE_LENGTH)) { | 809 | if (key_len > 0 && (ctx->cipher->flags & EVP_CIPH_VARIABLE_LENGTH)) { |