projects
/
moonshot.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
57135a1
)
ignore embedded newlines in base64
author
Luke Howard
<lukeh@padl.com>
Sun, 15 May 2011 22:52:02 +0000
(
00:52
+0200)
committer
Luke Howard
<lukeh@padl.com>
Sun, 15 May 2011 22:52:02 +0000
(
00:52
+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
5d5241d
..
134b2cc
100644
(file)
--- a/
moonshot/mech_eap/util_base64.c
+++ b/
moonshot/mech_eap/util_base64.c
@@
-122,7
+122,9
@@
base64Decode(const char *str, void *data)
unsigned char *q;
q = data;
unsigned char *q;
q = data;
- for (p = str; *p && (*p == '=' || strchr(base64_chars, *p)); p += 4) {
+ p = str;
+
+ while (*p && *p && (*p == '=' || strchr(base64_chars, *p))) {
unsigned int val = token_decode(p);
unsigned int marker = (val >> 24) & 0xff;
if (val == DECODE_ERROR)
unsigned int val = token_decode(p);
unsigned int marker = (val >> 24) & 0xff;
if (val == DECODE_ERROR)
@@
-132,6
+134,9
@@
base64Decode(const char *str, void *data)
*q++ = (val >> 8) & 0xff;
if (marker < 1)
*q++ = val & 0xff;
*q++ = (val >> 8) & 0xff;
if (marker < 1)
*q++ = val & 0xff;
+ p += 4;
+ if (*p == '\n')
+ p++;
}
return q - (unsigned char *) data;
}
}
return q - (unsigned char *) data;
}