File 1631-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
@@ -55,8 +55,6 @@
          x509_pkix_sign_types/1,
          root_cert/2]).
 
--compile(nowarn_obsolete_bool_op).
-
 -include("public_key_internal.hrl").
 
 %%====================================================================
@@ -185,7 +183,7 @@ parse_and_check_validity_dates(OtpCert) ->
         
         % Expiration check
         if
-            ((NotBefore =< Now) and (Now =< NotAfter)) -> ok;
+            NotBefore =< Now, Now =< NotAfter -> ok;
             true -> expired
         end
 
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
@@ -23,8 +23,6 @@
 -module(pubkey_crl).
 -moduledoc false.
 
--compile(nowarn_obsolete_bool_op).
-
 -include("public_key_internal.hrl").
 
 -export([validate/7, init_revokation_state/0, fresh_crl/3, verify_crl_signature/4,
@@ -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
@@ -24,8 +24,6 @@
 -module(pubkey_pbe).
 -moduledoc false.
 
--compile(nowarn_obsolete_bool_op).
-
 -include("PKCS-FRAME.hrl").
 -include("PKCS-1.hrl").
 -include("CMSAesRsaesOaep-2009.hrl").
@@ -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

openSUSE Build Service is sponsored by