Better debug output from rlm_mschap
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Fri, 13 Jun 2014 15:37:24 +0000 (16:37 +0100)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Fri, 13 Jun 2014 15:40:12 +0000 (16:40 +0100)
src/modules/rlm_mschap/rlm_mschap.c

index cc3e87a..c44c0dd 100644 (file)
@@ -1102,17 +1102,18 @@ static int CC_HINT(nonnull (1, 2, 4, 5 ,6)) do_mschap(rlm_mschap_t *inst, REQUES
                 *      NT_KEY: 000102030405060708090a0b0c0d0e0f
                 */
                if (memcmp(buffer, "NT_KEY: ", 8) != 0) {
-                       REDEBUG("Invalid output from ntlm_auth: expecting NT_KEY");
+                       REDEBUG("Invalid output from ntlm_auth: expecting 'NT_KEY: ' prefix");
                        return -1;
                }
 
                /*
-                *      Check the length.  It should be at least 32,
-                *      with an LF at the end.
+                *      Check the length.  It should be at least 32, with an LF at the end.
                 */
                len = strlen(buffer + 8);
                if (len < 32) {
-                       REDEBUG2("Invalid output from ntlm_auth: NT_KEY has unexpected length");
+                       REDEBUG2("Invalid output from ntlm_auth: NT_KEY too short, expected 32 bytes got %zu bytes",
+                                len);
+
                        return -1;
                }