projects
/
moonshot.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
5e6d3b3
)
allow newlines in base64Valid check
author
Luke Howard
<lukeh@padl.com>
Mon, 16 May 2011 07:56:46 +0000
(09:56 +0200)
committer
Luke Howard
<lukeh@padl.com>
Mon, 16 May 2011 07:56:46 +0000
(09:56 +0200)
moonshot/mech_eap/util_base64.c
patch
|
blob
|
history
diff --git
a/moonshot/mech_eap/util_base64.c
b/moonshot/mech_eap/util_base64.c
index
134b2cc
..
aaa1ea8
100644
(file)
--- a/
moonshot/mech_eap/util_base64.c
+++ b/
moonshot/mech_eap/util_base64.c
@@
-144,15
+144,18
@@
base64Decode(const char *str, void *data)
int
base64Valid(const char *str)
{
int
base64Valid(const char *str)
{
- const char *p;
+ const char *p
= str
;
int valid = 1;
int valid = 1;
-
for (p = str; *p && (*p == '=' || strchr(base64_chars, *p)); p += 4
) {
+
while (*p && *p && (*p == '=' || strchr(base64_chars, *p))
) {
unsigned int val = token_decode(p);
if (val == DECODE_ERROR) {
valid = 0;
break;
}
unsigned int val = token_decode(p);
if (val == DECODE_ERROR) {
valid = 0;
break;
}
+ p += 4;
+ if (*p == '\n')
+ p++;
}
return valid;
}
}
return valid;
}