summaryrefslogtreecommitdiffstats
path: root/base64.c
diff options
context:
space:
mode:
authorDavid Sommerseth <davids@redhat.com>2011-08-24 13:06:39 +0200
committerDavid Sommerseth <davids@redhat.com>2011-08-24 13:06:39 +0200
commit20fc33707eab708dfd7e8ffcf2eea0f8362b10b3 (patch)
tree7f60234df8fc0e073cf40ea25361d1e3f35bed50 /base64.c
parent3b75dec3e32e7d838ed56be5667d1cf3ac4cef18 (diff)
parent576dc96ca1ef1badb651e05ac694f07c91e02518 (diff)
downloadopenvpn-20fc33707eab708dfd7e8ffcf2eea0f8362b10b3.tar.gz
openvpn-20fc33707eab708dfd7e8ffcf2eea0f8362b10b3.tar.xz
openvpn-20fc33707eab708dfd7e8ffcf2eea0f8362b10b3.zip
Merge branch 'svn-merger'
Diffstat (limited to 'base64.c')
-rw-r--r--base64.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/base64.c b/base64.c
index 26ca7d7..95ccffc 100644
--- a/base64.c
+++ b/base64.c
@@ -41,7 +41,11 @@
static char base64_chars[] =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
-
+/*
+ * base64 encode input data of length size to malloced
+ * buffer which is returned as *str. Returns string
+ * length of *str.
+ */
int
base64_encode(const void *data, int size, char **str)
{
@@ -115,7 +119,11 @@ token_decode(const char *token)
return DECODE_ERROR;
return (marker << 24) | val;
}
-
+/*
+ * Decode base64 str, outputting data to buffer
+ * at data of length size. Return length of
+ * decoded data written or -1 on error or overflow.
+ */
int
base64_decode(const char *str, void *data, int size)
{