]> git.ozlabs.org Git - ppp.git/blobdiff - pppd/chap_ms.c
Accept Malformed Windows Success Message (#156)
[ppp.git] / pppd / chap_ms.c
index 016b42e0c10ee9a845a3e96ad8aa55dcb2b0464c..ffb6bd13c1ef45bc4956db1ee6bf494576444df0 100644 (file)
@@ -94,7 +94,6 @@
 #include "pppcrypt.h"
 #include "magic.h"
 
-static const char rcsid[] = RCSID;
 
 
 static void    ascii2unicode __P((char[], int, u_char[]));
@@ -382,7 +381,7 @@ chapms2_make_response(unsigned char *response, int id, char *our_name,
                      unsigned char *private)
 {
        const struct chapms2_response_cache_entry *cache_entry;
-       unsigned char auth_response[MS_AUTH_RESPONSE_LENGTH];
+       unsigned char auth_response[MS_AUTH_RESPONSE_LENGTH+1];
 
        challenge++;    /* skip length, should be 16 */
        *response++ = MS_CHAP2_RESPONSE_LEN;
@@ -424,6 +423,8 @@ chapms2_check_success(int id, unsigned char *msg, int len)
        len -= MS_AUTH_RESPONSE_LENGTH;
        if ((len >= 3) && !strncmp((char *)msg, " M=", 3)) {
                msg += 3; /* Eat the delimiter */
+       } else  if ((len >= 2) && !strncmp((char *)msg, "M=", 2)) {
+               msg += 2; /* Eat the delimiter */
        } else if (len) {
                /* Packet has extra text which does not begin " M=" */
                error("MS-CHAPv2 Success packet is badly formed.");