Fix zmcrypt message (#2645)

* added more clarity on zm_crypt authentication errors

* fixed variable name
pull/2649/head
Pliable Pixels 2019-06-24 11:28:32 -04:00 committed by Isaac Connor
parent dab9544845
commit 299f994506
1 changed files with 7 additions and 3 deletions

View File

@ -4,6 +4,7 @@
#include "jwt.h"
#include <algorithm>
#include <openssl/sha.h>
#include <string.h>
// returns username if valid, "" if not
@ -110,10 +111,13 @@ bool verifyPassword(const char *username, const char *input_password, const char
BCrypt bcrypt;
std::string input_hash = bcrypt.generateHash(std::string(input_password));
password_correct = bcrypt.validatePassword(std::string(input_password), std::string(db_password_hash));
} else if (strncmp(db_password_hash, "-ZM-",4) == 0 ) {
Error("Authentication failed - migration of password not complete. Please log into web console for this user and retry this operation");
return false;
} else {
// plain
Warning("%s is using a plain text password, please do not use plain text", username);
Warning ("%s is using a plain text (not recommended) or scheme not understood", username);
password_correct = (strcmp(input_password, db_password_hash) == 0);
}
}
return password_correct;
}