Add connectionID to as many entries as possible

Signed-off-by: Jo Vandeginste <Jo.Vandeginste@kuleuven.be>
This commit is contained in:
Jo Vandeginste
2019-09-05 16:21:35 +02:00
committed by drakkan
parent 53d70b68d8
commit 0737c672f5
20 changed files with 156 additions and 156 deletions

View File

@@ -275,19 +275,19 @@ func checkUserAndPass(user User, password string) (User, error) {
if strings.HasPrefix(user.Password, argonPwdPrefix) {
match, err = argon2id.ComparePasswordAndHash(password, user.Password)
if err != nil {
logger.Warn(logSender, "error comparing password with argon hash: %v", err)
logger.Warn(logSender, "", "error comparing password with argon hash: %v", err)
return user, err
}
} else if strings.HasPrefix(user.Password, bcryptPwdPrefix) {
if err = bcrypt.CompareHashAndPassword([]byte(user.Password), []byte(password)); err != nil {
logger.Warn(logSender, "error comparing password with bcrypt hash: %v", err)
logger.Warn(logSender, "", "error comparing password with bcrypt hash: %v", err)
return user, err
}
match = true
} else if utils.IsStringPrefixInSlice(user.Password, pbkdfPwdPrefixes) {
match, err = comparePbkdf2PasswordAndHash(password, user.Password)
if err != nil {
logger.Warn(logSender, "error comparing password with pbkdf2 sha256 hash: %v", err)
logger.Warn(logSender, "", "error comparing password with pbkdf2 sha256 hash: %v", err)
return user, err
}
}
@@ -304,7 +304,7 @@ func checkUserAndPubKey(user User, pubKey string) (User, error) {
for i, k := range user.PublicKeys {
storedPubKey, _, _, _, err := ssh.ParseAuthorizedKey([]byte(k))
if err != nil {
logger.Warn(logSender, "error parsing stored public key %d for user %v: %v", i, user.Username, err)
logger.Warn(logSender, "", "error parsing stored public key %d for user %v: %v", i, user.Username, err)
return user, err
}
if string(storedPubKey.Marshal()) == pubKey {