James Moger
2014-03-27 8d96b960e472433d2b4a5b71df7000bf1fbde648
src/main/java/com/gitblit/transport/ssh/CachingPublicKeyAuthenticator.java
@@ -73,30 +73,30 @@
      return result;
   }
   protected boolean doAuthenticate(String username, PublicKey suppliedKey,
   private boolean doAuthenticate(String username, PublicKey suppliedKey,
         ServerSession session) {
      SshDaemonClient client = session.getAttribute(SshDaemonClient.KEY);
      Preconditions.checkState(client.getUser() == null);
      username = username.toLowerCase(Locale.US);
      List<PublicKey> keys = keyManager.getKeys(username);
      List<SshKey> keys = keyManager.getKeys(username);
      if (keys == null || keys.isEmpty()) {
         log.info("{} has not added any public keys for ssh authentication",
               username);
         return false;
      }
      for (PublicKey key : keys) {
      for (SshKey key : keys) {
         if (key.equals(suppliedKey)) {
            UserModel user = authManager.authenticate(username, key);
            if (user != null) {
               client.setUser(user);
               client.setKey(key);
               return true;
            }
         }
      }
      log.warn(
            "could not authenticate {} for SSH using the supplied public key",
      log.warn("could not authenticate {} for SSH using the supplied public key",
            username);
      return false;
   }