Hi,

On Wed, Dec 01, 2021 at 07:07:23PM +0100, Arne Schwabe wrote:
> This field is only set once to cipher_kt_key_size(kt.cipher) at the same
> time that kt.cipher is set and therefore completely redundant.
[..]
> --- a/src/openvpn/crypto.c
> +++ b/src/openvpn/crypto.c
> @@ -744,8 +744,6 @@ init_key_type(struct key_type *kt, const char *ciphername,
>              msg(M_FATAL, "Cipher %s not supported", ciphername);
>          }
>  
> -        kt->cipher_length = cipher_kt_key_size(kt->cipher);
> -
>          /* check legal cipher mode */
>          aead_cipher = cipher_kt_mode_aead(kt->cipher);
>          if (!(cipher_kt_mode_cbc(kt->cipher)
> @@ -811,21 +809,20 @@ init_key_ctx(struct key_ctx *ctx, const struct key *key,
[..]
>          const char *ciphername = cipher_kt_name(kt->cipher);
>          msg(D_HANDSHAKE, "%s: Cipher '%s' initialized with %d bit key",
>              prefix,
>              ciphername,
> -            kt->cipher_length *8);
> +            cipher_kt_key_size(kt->cipher));

This does not look right.  Shouldn't it be "cipher_kt_key_size() * 8", then?

gert
-- 
"If was one thing all people took for granted, was conviction that if you 
 feed honest figures into a computer, honest figures come out. Never doubted 
 it myself till I met a computer with a sense of humor."
                             Robert A. Heinlein, The Moon is a Harsh Mistress

Gert Doering - Munich, Germany                             g...@greenie.muc.de

Attachment: signature.asc
Description: PGP signature

_______________________________________________
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

Reply via email to