[java-opensaml] 08/09: OSJ-414 Suspicious comparison of Integer references in AttributeConsumingServiceSelector OSR-415 Suspicious comparison of Boolean references in SAML2AuthnRequestsSignedSecurityHandler
Scott Cantor
cantor.2 at osu.edu
Thu Mar 13 18:41:59 UTC 2025
This is an automated email from the git hooks/post-receive script.
scantor pushed a commit to branch maint-5.1
in repository java-opensaml.
View the commit online:
http://git.shibboleth.net/view/?p=java-opensaml.git;a=commit;h=f924c3fef9335674b92c1fb2c5aea3bfb0da39c7
commit f924c3fef9335674b92c1fb2c5aea3bfb0da39c7
Author: Rod Widdowson <rdw at steadingsoftware.com>
AuthorDate: Tue Mar 4 15:08:26 2025 +0000
OSJ-414 Suspicious comparison of Integer references in AttributeConsumingServiceSelector
OSR-415 Suspicious comparison of Boolean references in SAML2AuthnRequestsSignedSecurityHandler
https://shibboleth.atlassian.net/browse/OSJ-415
https://shibboleth.atlassian.net/browse/OSJ-416
In both cases replace
if (foo == methodCall())
with
if (foo.equals(methodCall()))
(with appropriate null guarding)
---
.../saml/metadata/support/AttributeConsumingServiceSelector.java | 2 +-
.../binding/security/impl/SAML2AuthnRequestsSignedSecurityHandler.java | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/opensaml-saml-api/src/main/java/org/opensaml/saml/metadata/support/AttributeConsumingServiceSelector.java b/opensaml-saml-api/src/main/java/org/opensaml/saml/metadata/support/AttributeConsumingServiceSelector.java
index 522560d5c..1f67c3389 100644
--- a/opensaml-saml-api/src/main/java/org/opensaml/saml/metadata/support/AttributeConsumingServiceSelector.java
+++ b/opensaml-saml-api/src/main/java/org/opensaml/saml/metadata/support/AttributeConsumingServiceSelector.java
@@ -211,7 +211,7 @@ public class AttributeConsumingServiceSelector {
// Check for null b/c don't ever want to fail with an NPE due to autoboxing.
// Note: metadata index property is an int, not an Integer.
if (index != null) {
- if (index == attribCS.getIndex()) {
+ if (index.equals(attribCS.getIndex())) {
log.debug("Selected AttributeConsumingService with index: {}", index);
return attribCS;
}
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/binding/security/impl/SAML2AuthnRequestsSignedSecurityHandler.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/binding/security/impl/SAML2AuthnRequestsSignedSecurityHandler.java
index 12ccdc2e1..a838a93af 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/binding/security/impl/SAML2AuthnRequestsSignedSecurityHandler.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/binding/security/impl/SAML2AuthnRequestsSignedSecurityHandler.java
@@ -102,7 +102,7 @@ public class SAML2AuthnRequestsSignedSecurityHandler extends AbstractMessageHand
final SPSSODescriptor spssoRole = (SPSSODescriptor) metadataContext.getRoleDescriptor();
assert spssoRole != null;
- if (spssoRole.isAuthnRequestsSigned() == Boolean.TRUE) {
+ if (Boolean.TRUE.equals(spssoRole.isAuthnRequestsSigned())) {
log.debug("SPSSODescriptor for entity ID '{}' indicates AuthnRequests must be signed", messageIssuer);
return true;
}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list