Fix zmcrypt message (#2645)
* added more clarity on zm_crypt authentication errors * fixed variable namepull/2649/head
parent
dab9544845
commit
299f994506
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue