Deleted Added
full compact
readrec.c (59118) readrec.c (92906)
1/* readrec.c: The __opiereadrec() library function.
2
3%%% copyright-cmetz-96
1/* readrec.c: The __opiereadrec() library function.
2
3%%% copyright-cmetz-96
4This software is Copyright 1996-1998 by Craig Metz, All Rights Reserved.
5The Inner Net License Version 2 applies to this software.
4This software is Copyright 1996-2001 by Craig Metz, All Rights Reserved.
5The Inner Net License Version 3 applies to this software.
6You should have received a copy of the license with this software. If
7you didn't get a copy, you may request one from <license@inner.net>.
8
9 History:
10
6You should have received a copy of the license with this software. If
7you didn't get a copy, you may request one from <license@inner.net>.
8
9 History:
10
11 Modified by cmetz for OPIE 2.4. Check that seed, sequence number, and
12 response values are valid.
11 Modified by cmetz for OPIE 2.31. Removed active attack protection
12 support. Fixed a debug message typo. Keep going after bogus
13 records. Set read flag.
14 Created by cmetz for OPIE 2.3.
15*/
16#include "opie_cfg.h"
17
18#include <stdio.h>

--- 33 unchanged lines hidden (view full) ---

52
53 *(c2++) = 0;
54
55 {
56 char *c3;
57
58 opie->opie_n = strtoul(c, &c3, 10);
59
13 Modified by cmetz for OPIE 2.31. Removed active attack protection
14 support. Fixed a debug message typo. Keep going after bogus
15 records. Set read flag.
16 Created by cmetz for OPIE 2.3.
17*/
18#include "opie_cfg.h"
19
20#include <stdio.h>

--- 33 unchanged lines hidden (view full) ---

54
55 *(c2++) = 0;
56
57 {
58 char *c3;
59
60 opie->opie_n = strtoul(c, &c3, 10);
61
60 if (*c3)
62 if (*c3 || (opie->opie_n <= 0) || (opie->opie_n > 9999))
61 return -1;
62 };
63
64 if (!(c2 = strchr(opie->opie_seed = c2, ' ')))
65 return -1;
66
67 *(c2++) = 0;
68
63 return -1;
64 };
65
66 if (!(c2 = strchr(opie->opie_seed = c2, ' ')))
67 return -1;
68
69 *(c2++) = 0;
70
71 for (c = opie->opie_seed; *c; c++)
72 if (!isalnum(*c))
73 return -1;
74
69 while(*c2 == ' ') c2++;
70
71 if (!(c2 = strchr(opie->opie_val = c2, ' ')))
72 return -1;
73
74 *(c2++) = 0;
75
75 while(*c2 == ' ') c2++;
76
77 if (!(c2 = strchr(opie->opie_val = c2, ' ')))
78 return -1;
79
80 *(c2++) = 0;
81
82 {
83 struct opie_otpkey otpkey;
84
85 if (!opieatob8(&otpkey, opie->opie_val))
86 return -1;
87 }
88
76 return 0;
77}
78
79int __opiereadrec FUNCTION((opie), struct opie *opie)
80{
81 FILE *f = NULL;
82 int rval = -1;
83

--- 71 unchanged lines hidden ---
89 return 0;
90}
91
92int __opiereadrec FUNCTION((opie), struct opie *opie)
93{
94 FILE *f = NULL;
95 int rval = -1;
96

--- 71 unchanged lines hidden ---