diff options
| author | 2021-07-19 19:39:17 +0100 | |
|---|---|---|
| committer | 2021-07-19 19:39:17 +0100 | |
| commit | f9c273457d6c507013bd22169aad08445839bf4e (patch) | |
| tree | 173bdf77d65f29cc551bb8fc5f0f898aab8b388e /src/modules | |
| parent | Fix using the wrong variable for the ciphersuites in ssl_openssl. (diff) | |
Handle exceptions from hash providers in password_hash.
Diffstat (limited to 'src/modules')
| -rw-r--r-- | src/modules/m_password_hash.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/modules/m_password_hash.cpp b/src/modules/m_password_hash.cpp index 86611d908..322923959 100644 --- a/src/modules/m_password_hash.cpp +++ b/src/modules/m_password_hash.cpp @@ -71,9 +71,17 @@ class CommandMkpasswd : public Command return CMD_FAILURE; } - std::string hexsum = hp->Generate(parameters[1]); - user->WriteNotice(parameters[0] + " hashed password for " + parameters[1] + " is " + hexsum); - return CMD_SUCCESS; + try + { + std::string hexsum = hp->Generate(parameters[1]); + user->WriteNotice(parameters[0] + " hashed password for " + parameters[1] + " is " + hexsum); + return CMD_SUCCESS; + } + catch (const ModuleException& error) + { + user->WriteNotice("*** " + name + ": " + error.GetReason()); + return CMD_FAILURE; + } } }; |
