diff options
Diffstat (limited to 'gnu/java/security/Engine.java')
-rw-r--r-- | gnu/java/security/Engine.java | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/gnu/java/security/Engine.java b/gnu/java/security/Engine.java index 59a5d0e52..c6271e3f2 100644 --- a/gnu/java/security/Engine.java +++ b/gnu/java/security/Engine.java @@ -166,13 +166,16 @@ public final class Engine { alias = (String) provider.getProperty(key); - algorithm = alias; - if (count++ > MAX_ALIASES) - throw new NoSuchAlgorithmException("too many aliases"); - - // need to reset enumeration to now look for the alias - enumer = provider.propertyNames(); - + + if (! algorithm.equalsIgnoreCase(alias)) // does not refer to itself + { + algorithm = alias; + if (count++ > MAX_ALIASES) + throw new NoSuchAlgorithmException("too many aliases"); + + // need to reset enumeration to now look for the alias + enumer = provider.propertyNames(); + } } } |