From 91793da94692a348327fa8950d3e57746af14e4c Mon Sep 17 00:00:00 2001 From: tb <> Date: Fri, 22 Dec 2023 10:20:33 +0000 Subject: evp_enc: make some flag checks explicit ok joshua jsing --- src/lib/libcrypto/evp/evp_enc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/lib') diff --git a/src/lib/libcrypto/evp/evp_enc.c b/src/lib/libcrypto/evp/evp_enc.c index d8c01cdc47..d0cd301e52 100644 --- a/src/lib/libcrypto/evp/evp_enc.c +++ b/src/lib/libcrypto/evp/evp_enc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: evp_enc.c,v 1.74 2023/12/21 20:50:43 tb Exp $ */ +/* $OpenBSD: evp_enc.c,v 1.75 2023/12/22 10:20:33 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -131,13 +131,13 @@ EVP_CipherInit_ex(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, ENGINE *engine, return 0; } - if (!(ctx->flags & EVP_CIPHER_CTX_FLAG_WRAP_ALLOW) && + if ((ctx->flags & EVP_CIPHER_CTX_FLAG_WRAP_ALLOW) == 0 && EVP_CIPHER_CTX_mode(ctx) == EVP_CIPH_WRAP_MODE) { EVPerror(EVP_R_WRAP_MODE_NOT_ALLOWED); return 0; } - if (!(EVP_CIPHER_CTX_flags(ctx) & EVP_CIPH_CUSTOM_IV)) { + if ((EVP_CIPHER_CTX_flags(ctx) & EVP_CIPH_CUSTOM_IV) == 0) { int iv_len; switch (EVP_CIPHER_CTX_mode(ctx)) { @@ -181,7 +181,7 @@ EVP_CipherInit_ex(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, ENGINE *engine, } } - if (key || (ctx->cipher->flags & EVP_CIPH_ALWAYS_CALL_INIT)) { + if (key != NULL || (ctx->cipher->flags & EVP_CIPH_ALWAYS_CALL_INIT) != 0) { if (!ctx->cipher->init(ctx, key, iv, enc)) return 0; } -- cgit v1.2.3-55-g6feb