File 5271-Remove-and-or-in-public_key.patch of Package erlang
From 8a5ce1002342543b56e63a61df2cc9a7cbfa9b70 Mon Sep 17 00:00:00 2001
From: Maria Scott <maria-12648430@hnc-agency.org>
Date: Thu, 15 Jan 2026 10:48:59 +0100
Subject: [PATCH 1/2] Remove and/or in public_key
---
lib/public_key/src/pubkey_cert.erl | 4 +---
lib/public_key/src/pubkey_crl.erl | 10 ++++------
lib/public_key/src/pubkey_pbe.erl | 14 ++++++--------
3 files changed, 11 insertions(+), 17 deletions(-)
diff --git a/lib/public_key/src/pubkey_cert.erl b/lib/public_key/src/pubkey_cert.erl
index 95dba9b1a2..3f2c46e947 100644
--- a/lib/public_key/src/pubkey_cert.erl
+++ b/lib/public_key/src/pubkey_cert.erl
@@ -147,7 +147,7 @@ validate_time(OtpCert, UserState, VerifyFun) ->
NotBefore = time_str_2_gregorian_sec(notBefore, NotBeforeStr),
NotAfter = time_str_2_gregorian_sec(notAfter, NotAfterStr),
- case ((NotBefore =< Now) and (Now =< NotAfter)) of
+ case NotBefore =< Now andalso Now =< NotAfter of
true ->
UserState;
false ->
diff --git a/lib/public_key/src/pubkey_crl.erl b/lib/public_key/src/pubkey_crl.erl
index 8b4caf7074..1001dda856 100644
--- a/lib/public_key/src/pubkey_crl.erl
+++ b/lib/public_key/src/pubkey_crl.erl
@@ -139,7 +137,7 @@ verify_crl(OtpCert, DP, CRL, DerCRL, DeltaCRL, DerDeltaCRL, OtherDPCRLs,
DeltaRevoked = delta_revoked(DeltaCRL),
- ValidExt = verify_extensions(Extensions) and
+ ValidExt = verify_extensions(Extensions) andalso
verify_extensions(Revoked),
IntMask = compute_interim_reasons_mask(DP, IDP),
@@ -320,7 +318,7 @@ verify_issuer_and_scope(#'OTPCertificate'{tbsCertificate = TBSCert} = Cert,
when DPIssuer =/= asn1_NOVALUE ->
CRLIssuer = pubkey_cert_records:transform(TBSCRL#'TBSCertList'.issuer, decode),
Issuer = dp_crlissuer_to_issuer(DPIssuer),
- case pubkey_cert:is_issuer(Issuer, CRLIssuer) and is_indirect_crl(IDP) of
+ case pubkey_cert:is_issuer(Issuer, CRLIssuer) andalso is_indirect_crl(IDP) of
true ->
verify_scope(Cert, DP, IDP),
issuer_id(Cert, CRL);
@@ -602,7 +600,7 @@ check_revoked(#'DistributionPoint'{cRLIssuer = DPIssuer} = DP, IDP, DefaultIssue
Extensions}| Rest],
State) ->
Reason = revoked_reason(Extensions),
- case (DPIssuer =/= asn1_NOVALUE) and is_indirect_crl(IDP) of
+ case (DPIssuer =/= asn1_NOVALUE) andalso is_indirect_crl(IDP) of
true ->
handle_indirect_crl_check(DP, IDP, DefaultIssuer0, Names, SerialNr, Extensions, Reason, Rest, State);
false ->
@@ -683,7 +681,7 @@ status(Reason) ->
{revoked, Reason}.
verify_extensions([#'TBSCertList_revokedCertificates_SEQOF'{crlEntryExtensions = Ext} | Rest]) ->
- verify_extensions(pubkey_cert:extensions_list(Ext)) and verify_extensions(Rest);
+ verify_extensions(pubkey_cert:extensions_list(Ext)) andalso verify_extensions(Rest);
verify_extensions([]) ->
true;
verify_extensions(asn1_NOVALUE) ->
diff --git a/lib/public_key/src/pubkey_pbe.erl b/lib/public_key/src/pubkey_pbe.erl
index 10328c7eb6..d1dabb0389 100644
--- a/lib/public_key/src/pubkey_pbe.erl
+++ b/lib/public_key/src/pubkey_pbe.erl
@@ -285,14 +283,14 @@ pseudo_output_length(?'id-hmacWithSHA512') ->
derived_key_length(_, Len) when is_integer(Len) ->
Len;
-derived_key_length(Cipher,_) when (Cipher == ?'desCBC') or
- (Cipher == "DES-CBC") ->
+derived_key_length(Cipher,_) when Cipher == ?'desCBC';
+ Cipher == "DES-CBC" ->
8;
-derived_key_length(Cipher,_) when (Cipher == ?'rc2CBC') or
- (Cipher == "RC2-CBC") ->
+derived_key_length(Cipher,_) when Cipher == ?'rc2CBC';
+ Cipher == "RC2-CBC" ->
16;
-derived_key_length(Cipher,_) when (Cipher == ?'des-EDE3-CBC') or
- (Cipher == "DES-EDE3-CBC") ->
+derived_key_length(Cipher,_) when Cipher == ?'des-EDE3-CBC';
+ Cipher == "DES-EDE3-CBC" ->
24;
derived_key_length(Cipher,_) when (Cipher == "AES-128-CBC");
--
2.51.0