summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortb <>2024-01-02 18:48:02 +0000
committertb <>2024-01-02 18:48:02 +0000
commit948d4ca4abdd228b02a462a961f27b0be0c78ac5 (patch)
treecdcd15adc6d695da9234a5a46df2a0b1dd34970f /src
parent5e559271f3dd87cf731e17c250fa2efb5e1e3fe8 (diff)
downloadopenbsd-948d4ca4abdd228b02a462a961f27b0be0c78ac5.tar.gz
openbsd-948d4ca4abdd228b02a462a961f27b0be0c78ac5.tar.bz2
openbsd-948d4ca4abdd228b02a462a961f27b0be0c78ac5.zip
Two spellings of key length are enough
The API is called EVP_CIPHER_CTX_set_key_length() it has an argument called keylen and, the EVP_CIPHER_CTX's member is called key_len. One of the three is trivial to adjust, so do it.
Diffstat (limited to 'src')
-rw-r--r--src/lib/libcrypto/evp/evp_cipher.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/lib/libcrypto/evp/evp_cipher.c b/src/lib/libcrypto/evp/evp_cipher.c
index 38aeaa0030..c762c968eb 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.6 2024/01/02 18:30:27 tb Exp $ */ 1/* $OpenBSD: evp_cipher.c,v 1.7 2024/01/02 18:48:02 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 *
@@ -643,15 +643,16 @@ EVP_CIPHER_CTX_cleanup(EVP_CIPHER_CTX *ctx)
643} 643}
644 644
645int 645int
646EVP_CIPHER_CTX_set_key_length(EVP_CIPHER_CTX *ctx, int keylen) 646EVP_CIPHER_CTX_set_key_length(EVP_CIPHER_CTX *ctx, int key_len)
647{ 647{
648 /* XXX - remove this. It's unused. */
648 if (ctx->cipher->flags & EVP_CIPH_CUSTOM_KEY_LENGTH) 649 if (ctx->cipher->flags & EVP_CIPH_CUSTOM_KEY_LENGTH)
649 return EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_SET_KEY_LENGTH, 650 return EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_SET_KEY_LENGTH,
650 keylen, NULL); 651 key_len, NULL);
651 if (ctx->key_len == keylen) 652 if (ctx->key_len == key_len)
652 return 1; 653 return 1;
653 if (keylen > 0 && (ctx->cipher->flags & EVP_CIPH_VARIABLE_LENGTH)) { 654 if (key_len > 0 && (ctx->cipher->flags & EVP_CIPH_VARIABLE_LENGTH)) {
654 ctx->key_len = keylen; 655 ctx->key_len = key_len;
655 return 1; 656 return 1;
656 } 657 }
657 EVPerror(EVP_R_INVALID_KEY_LENGTH); 658 EVPerror(EVP_R_INVALID_KEY_LENGTH);