Skip to contentSkip to conversation

ppp authentication bug fixes (resend)

PATCH In review Kristen Carlson Accardi 2 participants 4 messages Mar 27, 2010

lore
Share & tools
lore
#0 lore raw

cover ppp authentication bug fixes (resend)

Here are a couple bug fixes for the PPP authentication. First patch fixes the seg fault when the secret is empty, as reported by marcel. Second, if we do fail to authenticate, we need to change ppp phases to terminate the link.

Kristen Carlson Accardi (2):
ppp: allow empty secret for chap challenge
ppp: send PPP_FAIL when authentication fails

 gatchat/ppp_auth.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
#1 lore raw

PATCH 1/2 ppp: allow empty secret for chap challenge

Just do a checksum over the identifier if we have an empty password for our chap secret.

---
 gatchat/ppp_auth.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
gatchat/ppp_auth.c +2 -1
index 6c3913e..95b2f96 100644
@@ -83,7 +83,8 @@ static void chap_process_challenge(struct auth_data *auth, guint8 *packet)
 	if (!checksum)
 		return;
 	g_checksum_update(checksum, &header->identifier, 1);
-	g_checksum_update(checksum, (guchar *) secret, strlen(secret));
+	if (secret)
+		g_checksum_update(checksum, (guchar *) secret, strlen(secret));
 	g_checksum_update(checksum, &header->data[1], header->data[0]);
 
 	/* transmit a response packet */
Signature · 1 line
1.6.6.1
#2 lore raw

PATCH 2/2 ppp: send PPP_FAIL when authentication fails

In reply to Kristen Carlson Accardi
---
 gatchat/ppp_auth.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
gatchat/ppp_auth.c +2 -1
index 95b2f96..fe3c501 100644
@@ -128,7 +128,8 @@ static void chap_process_failure(struct auth_data *data, guint8 *packet)
 {
 	struct chap_header *header = (struct chap_header *) packet;
 
-	g_print("Failed to authenticate, message %s\n", header->data);
+	ppp_generate_event(data->ppp, PPP_FAIL);
+	g_printerr("Failed to authenticate, message %s\n", header->data);
 }
 
 /*
Signature · 1 line
1.6.6.1
#3 lore raw
In reply to Kristen Carlson Accardi

Hi Kristen,

Quoted 11 lines

Here are a couple bug fixes for the PPP authentication. First patch fixes the seg fault when the secret is empty, as reported by marcel. Second, if we do fail to authenticate, we need to change ppp phases to terminate the link.

Kristen Carlson Accardi (2):
ppp: allow empty secret for chap challenge
ppp: send PPP_FAIL when authentication fails

 gatchat/ppp_auth.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

this is funny. Even now patch 1/2 is missing on my side. However it seems that Denis can see it, so he took care of it.

Regards

Marcel