diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2017-06-27 13:56:16 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2017-06-27 13:56:16 +0200 |
commit | 749384a154025e268b53cf3cc79eaeddde2b3ceb (patch) | |
tree | 27baa9e6aec76635d750405d90cd461440a656d1 /src/openvpn/base64.c | |
parent | db4f04c584f7d4e828b5d317cf40962b9d854ac5 (diff) |
initial stretch branch release 2.4.0-6
Diffstat (limited to 'src/openvpn/base64.c')
-rw-r--r-- | src/openvpn/base64.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/openvpn/base64.c b/src/openvpn/base64.c index 0ac65e9..c799ede 100644 --- a/src/openvpn/base64.c +++ b/src/openvpn/base64.c @@ -69,8 +69,7 @@ openvpn_base64_encode(const void *data, int size, char **str) } q = (const unsigned char *) data; i = 0; - for (i = 0; i < size; ) - { + for (i = 0; i < size; ) { c = q[i++]; c *= 256; if (i < size) @@ -108,12 +107,10 @@ pos(char c) { char *p; for (p = base64_chars; *p; p++) - { if (*p == c) { return p - base64_chars; } - } return -1; } @@ -129,8 +126,7 @@ token_decode(const char *token) { return DECODE_ERROR; } - for (i = 0; i < 4; i++) - { + for (i = 0; i < 4; i++) { val *= 64; if (token[i] == '=') { @@ -168,8 +164,7 @@ openvpn_base64_decode(const char *str, void *data, int size) { e = q + size; } - for (p = str; *p && (*p == '=' || strchr(base64_chars, *p)); p += 4) - { + for (p = str; *p && (*p == '=' || strchr(base64_chars, *p)); p += 4) { unsigned int val = token_decode(p); unsigned int marker = (val >> 24) & 0xff; if (val == DECODE_ERROR) |