diff options
-rw-r--r-- | manage.c | 7 | ||||
-rw-r--r-- | manage.h | 2 | ||||
-rw-r--r-- | push.c | 4 | ||||
-rw-r--r-- | ssl.c | 2 |
4 files changed, 9 insertions, 6 deletions
@@ -2273,9 +2273,12 @@ management_pre_tunnel_close (struct management *man) } void -management_auth_failure (struct management *man, const char *type) +management_auth_failure (struct management *man, const char *type, const char *reason) { - msg (M_CLIENT, ">PASSWORD:Verification Failed: '%s'", type); + if (reason) + msg (M_CLIENT, ">PASSWORD:Verification Failed: '%s' ['%s']", type, reason); + else + msg (M_CLIENT, ">PASSWORD:Verification Failed: '%s'", type); } static inline bool @@ -435,7 +435,7 @@ void management_echo (struct management *man, const char *string, const bool pul * OpenVPN calls here to indicate a password failure */ -void management_auth_failure (struct management *man, const char *type); +void management_auth_failure (struct management *man, const char *type, const char *reason); /* * These functions drive the bytecount in/out counters. @@ -63,11 +63,11 @@ receive_auth_failed (struct context *c, const struct buffer *buffer) #ifdef ENABLE_MANAGEMENT if (management) { - const char *reason = UP_TYPE_AUTH; + const char *reason = NULL; struct buffer buf = *buffer; if (buf_string_compare_advance (&buf, "AUTH_FAILED,") && BLEN (&buf)) reason = BSTR (&buf); - management_auth_failure (management, reason); + management_auth_failure (management, UP_TYPE_AUTH, reason); } #endif } @@ -1639,7 +1639,7 @@ init_ssl (const struct options *options) { #ifdef ENABLE_MANAGEMENT if (management && (ERR_GET_REASON (ERR_peek_error()) == EVP_R_BAD_DECRYPT)) - management_auth_failure (management, UP_TYPE_PRIVATE_KEY); + management_auth_failure (management, UP_TYPE_PRIVATE_KEY, NULL); #endif msg (M_WARN|M_SSL, "Cannot load private key file %s", options->priv_key_file); goto err; |