FliegenKLATSCH commented on a change in pull request #119: Add support for
openssh host key certificates
URL: https://github.com/apache/mina-sshd/pull/119#discussion_r410046948
##########
File path:
sshd-core/src/main/java/org/apache/sshd/server/session/AbstractServerSession.java
##########
@@ -367,9 +382,26 @@ protected String
resolveAvailableSignaturesProposal(FactoryManager proposedManag
KeyPairProvider kpp = getKeyPairProvider();
boolean debugEnabled = log.isDebugEnabled();
- Iterable<String> provided;
+ Set<String> provided = null;
try {
- provided = (kpp == null) ? null : kpp.getKeyTypes(this);
+ if (kpp != null) {
+ provided =
StreamSupport.stream(kpp.getKeyTypes(this).spliterator(), false)
+ .collect(Collectors.toSet());
+
+ HostKeyCertificateProvider hostKeyCertificateProvider =
getHostKeyCertificateProvider();
+ if (hostKeyCertificateProvider != null) {
+ Iterable<OpenSshCertificate> certificates =
hostKeyCertificateProvider.loadCertificates(this);
+ for (OpenSshCertificate certificate : certificates) {
+ // Add the certificate alg only if the corresponding
keyPair type is available
+ if (provided.contains(certificate.getRawKeyType())) {
+ provided.add(certificate.getKeyType());
+ } else {
Review comment:
Yes, but the call to `kpp.getKeyTypes(this)` did not change - it was there
already before. I iterate only over an already existing `Set` of `String`s.
That doesn't change anything regarding this lazy loading? Please correct me, if
I am mistaken..
----------------------------------------------------------------
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]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]