auth.c (25560) | auth.c (25630) |
---|---|
1/* 2 * PPP Secret Key Module 3 * 4 * Written by Toshiharu OHNO (tony-o@iij.ad.jp) 5 * 6 * Copyright (C) 1994, Internet Initiative Japan, Inc. All rights reserverd. 7 * 8 * Redistribution and use in source and binary forms are permitted 9 * provided that the above copyright notice and this paragraph are 10 * duplicated in all such forms and that any documentation, 11 * advertising materials, and other materials related to such 12 * distribution and use acknowledge that the software was developed 13 * by the Internet Initiative Japan, Inc. The name of the 14 * IIJ may not be used to endorse or promote products derived 15 * from this software without specific prior written permission. 16 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR 17 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED 18 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. 19 * | 1/* 2 * PPP Secret Key Module 3 * 4 * Written by Toshiharu OHNO (tony-o@iij.ad.jp) 5 * 6 * Copyright (C) 1994, Internet Initiative Japan, Inc. All rights reserverd. 7 * 8 * Redistribution and use in source and binary forms are permitted 9 * provided that the above copyright notice and this paragraph are 10 * duplicated in all such forms and that any documentation, 11 * advertising materials, and other materials related to such 12 * distribution and use acknowledge that the software was developed 13 * by the Internet Initiative Japan, Inc. The name of the 14 * IIJ may not be used to endorse or promote products derived 15 * from this software without specific prior written permission. 16 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR 17 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED 18 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. 19 * |
20 * $Id: auth.c,v 1.10 1997/02/22 16:10:01 peter Exp $ | 20 * $Id: auth.c,v 1.11 1997/05/07 23:01:21 brian Exp $ |
21 * 22 * TODO: 23 * o Implement check against with registered IP addresses. 24 */ 25#include "fsm.h" 26#include "lcpproto.h" 27#include "ipcp.h" 28#include "vars.h" --- 78 unchanged lines hidden (view full) --- 107 continue; 108 if (strcmp(vector[0], system) == 0) { 109 ExpandString(vector[1], passwd, sizeof(passwd), 0); 110 if (strcmp(passwd, key) == 0) { 111 CloseSecret(fp); 112 bzero(&DefHisAddress, sizeof(DefHisAddress)); 113 n -= 2; 114 if (n > 0) { | 21 * 22 * TODO: 23 * o Implement check against with registered IP addresses. 24 */ 25#include "fsm.h" 26#include "lcpproto.h" 27#include "ipcp.h" 28#include "vars.h" --- 78 unchanged lines hidden (view full) --- 107 continue; 108 if (strcmp(vector[0], system) == 0) { 109 ExpandString(vector[1], passwd, sizeof(passwd), 0); 110 if (strcmp(passwd, key) == 0) { 111 CloseSecret(fp); 112 bzero(&DefHisAddress, sizeof(DefHisAddress)); 113 n -= 2; 114 if (n > 0) { |
115 ParseAddr(n--, &vector[2], 116 &DefHisAddress.ipaddr, &DefHisAddress.mask, &DefHisAddress.width); | 115 if (ParseAddr(n--, &vector[2], 116 &DefHisAddress.ipaddr, 117 &DefHisAddress.mask, 118 &DefHisAddress.width) == 0) { 119 return(0); /* Invalid */ 120 } |
117 } 118 IpcpInit(); 119 return(1); /* Valid */ 120 } 121 } 122 } 123 CloseSecret(fp); 124 return(0); /* Invalid */ --- 26 unchanged lines hidden (view full) --- 151 if (setaddr) { 152 bzero(&DefHisAddress, sizeof(DefHisAddress)); 153 } 154 n -= 2; 155 if (n > 0 && setaddr) { 156#ifdef DEBUG 157 LogPrintf(LOG_LCP_BIT, "*** n = %d, %s\n", n, vector[2]); 158#endif | 121 } 122 IpcpInit(); 123 return(1); /* Valid */ 124 } 125 } 126 } 127 CloseSecret(fp); 128 return(0); /* Invalid */ --- 26 unchanged lines hidden (view full) --- 155 if (setaddr) { 156 bzero(&DefHisAddress, sizeof(DefHisAddress)); 157 } 158 n -= 2; 159 if (n > 0 && setaddr) { 160#ifdef DEBUG 161 LogPrintf(LOG_LCP_BIT, "*** n = %d, %s\n", n, vector[2]); 162#endif |
159 ParseAddr(n--, &vector[2], 160 &DefHisAddress.ipaddr, &DefHisAddress.mask, &DefHisAddress.width); 161 IpcpInit(); | 163 if (ParseAddr(n--, &vector[2], 164 &DefHisAddress.ipaddr, 165 &DefHisAddress.mask, 166 &DefHisAddress.width) != 0) 167 IpcpInit(); |
162 } 163 return(passwd); 164 } 165 } 166 CloseSecret(fp); 167 return(NULL); /* Invalid */ 168} 169 --- 38 unchanged lines hidden --- | 168 } 169 return(passwd); 170 } 171 } 172 CloseSecret(fp); 173 return(NULL); /* Invalid */ 174} 175 --- 38 unchanged lines hidden --- |