summaryrefslogtreecommitdiff
path: root/radius.c
diff options
context:
space:
mode:
authorSam Leffler <sam@FreeBSD.org>2009-01-15 04:25:21 +0000
committerSam Leffler <sam@FreeBSD.org>2009-01-15 04:25:21 +0000
commit22188e6ab4f02f981de3b9f228a40b1e8f98e6a1 (patch)
treee396cb7a4849178b23486ba07b66a6dfede1d1e9 /radius.c
parent17914a6ec9e4814998abdaec5a947b6a78709a19 (diff)
Notes
Diffstat (limited to 'radius.c')
-rw-r--r--radius.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/radius.c b/radius.c
index 743f3400f1de7..afa4f933ee98f 100644
--- a/radius.c
+++ b/radius.c
@@ -801,6 +801,7 @@ static u8 * decrypt_ms_key(const u8 *key, size_t len,
ppos = plain = os_malloc(plen);
if (plain == NULL)
return NULL;
+ plain[0] = 0;
while (left > 0) {
/* b(1) = MD5(Secret + Request-Authenticator + Salt)
@@ -825,7 +826,7 @@ static u8 * decrypt_ms_key(const u8 *key, size_t len,
left -= MD5_MAC_LEN;
}
- if (plain[0] > plen - 1) {
+ if (plain[0] == 0 || plain[0] > plen - 1) {
printf("Failed to decrypt MPPE key\n");
os_free(plain);
return NULL;