[java-opensaml] branch main updated: OSJ-351 - Tweak AbstractEncryptedKeyResolver to be subclass friendly.

Scott Cantor cantor.2 at osu.edu
Tue Apr 5 17:43:24 UTC 2022


This is an automated email from the git hooks/post-receive script.

scantor pushed a commit to branch main
in repository java-opensaml.

View the commit online:
http://git.shibboleth.net/view/?p=java-opensaml.git;a=commit;h=2e73f8f297d1e3d132475b540898f307ba511dd9

The following commit(s) were added to refs/heads/main by this push:
     new 2e73f8f29 OSJ-351 - Tweak AbstractEncryptedKeyResolver to be subclass friendly.
2e73f8f29 is described below

commit 2e73f8f297d1e3d132475b540898f307ba511dd9
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Tue Apr 5 13:43:21 2022 -0400

    OSJ-351 - Tweak AbstractEncryptedKeyResolver to be subclass friendly.
    
    https://shibboleth.atlassian.net/browse/OSJ-351
---
 .../encryption/support/AbstractEncryptedKeyResolver.java       | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/encryption/support/AbstractEncryptedKeyResolver.java b/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/encryption/support/AbstractEncryptedKeyResolver.java
index d431fc237..07acb88cf 100644
--- a/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/encryption/support/AbstractEncryptedKeyResolver.java
+++ b/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/encryption/support/AbstractEncryptedKeyResolver.java
@@ -74,7 +74,6 @@ public abstract class AbstractEncryptedKeyResolver implements EncryptedKeyResolv
     }
 
     /** {@inheritDoc} */
-    @Override
     @Nonnull @NonnullElements @Unmodifiable @NotLive public Set<String> getRecipients() {
         return recipients;
     }
@@ -88,11 +87,16 @@ public abstract class AbstractEncryptedKeyResolver implements EncryptedKeyResolv
      */
     protected boolean matchRecipient(@Nullable final String recipient) {
         final String trimmedRecipient = StringSupport.trimOrNull(recipient);
-        if (trimmedRecipient == null || recipients.isEmpty()) {
+        if (trimmedRecipient == null) {
             return true;
         }
         
-        return recipients.contains(trimmedRecipient);
+        final Set<String> ourRecipients = getRecipients();
+        if (ourRecipients.isEmpty()) {
+            return true;
+        }
+        
+        return ourRecipients.contains(trimmedRecipient);
     }
     
     /**

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list