aboutsummaryrefslogtreecommitdiff
path: root/providers/implementations/ciphers/cipher_tdes_common.c
diff options
context:
space:
mode:
Diffstat (limited to 'providers/implementations/ciphers/cipher_tdes_common.c')
-rw-r--r--providers/implementations/ciphers/cipher_tdes_common.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/providers/implementations/ciphers/cipher_tdes_common.c b/providers/implementations/ciphers/cipher_tdes_common.c
index 346aec05a1cc..af2f5b98415c 100644
--- a/providers/implementations/ciphers/cipher_tdes_common.c
+++ b/providers/implementations/ciphers/cipher_tdes_common.c
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2023 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
@@ -123,13 +123,12 @@ static int tdes_generatekey(PROV_CIPHER_CTX *ctx, void *ptr)
if (kl == 0 || RAND_priv_bytes_ex(ctx->libctx, ptr, kl, 0) <= 0)
return 0;
DES_set_odd_parity(deskey);
- if (kl >= 16)
+ if (kl >= 16) {
DES_set_odd_parity(deskey + 1);
- if (kl >= 24) {
- DES_set_odd_parity(deskey + 2);
- return 1;
+ if (kl >= 24)
+ DES_set_odd_parity(deskey + 2);
}
- return 0;
+ return 1;
}
int ossl_tdes_get_ctx_params(void *vctx, OSSL_PARAM params[])