lgoldstein commented on a change in pull request #158:
URL: https://github.com/apache/mina-sshd/pull/158#discussion_r470512809



##########
File path: 
sshd-common/src/main/java/org/apache/sshd/common/config/keys/KeyUtils.java
##########
@@ -141,6 +142,13 @@
     public static final String RSA_SHA256_CERT_TYPE_ALIAS = 
"[email protected]";
     public static final String RSA_SHA512_CERT_TYPE_ALIAS = 
"[email protected]";
 
+    private static final Map<String, String> CERT_TYPE_HASH_ALGORITHM_TYPE

Review comment:
       This should be wrapped inside a `Collections.unmodifiableMap`

##########
File path: 
sshd-common/src/main/java/org/apache/sshd/common/config/keys/KeyUtils.java
##########
@@ -1196,4 +1204,13 @@ public static boolean 
compareSkEd25519Keys(SkED25519PublicKey k1, SkED25519Publi
                     && 
SecurityUtils.compareEDDSAPPublicKeys(k1.getDelegatePublicKey(), 
k2.getDelegatePublicKey());
         }
     }
+
+    public static String getHashAlgorithmType(String keyType) {
+        String hashAlgorithmType = CERT_TYPE_HASH_ALGORITHM_TYPE.get(keyType);
+        if (hashAlgorithmType != null) {
+            return hashAlgorithmType;
+        } else {
+            return keyType;
+        }
+    }

Review comment:
       Code can be simplified as `return 
CERT_TYPE_HASH_ALGORITHM_TYPE.getOrDefault(keyYpe, keyType)`




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to