wpa_supplicant / hostapd  2.5
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Functions
base64.c File Reference

Base64 encoding/decoding (RFC1341) More...

#include "includes.h"
#include "os.h"
#include "base64.h"

Functions

unsigned char * base64_encode (const unsigned char *src, size_t len, size_t *out_len)
 Base64 encode. More...
 
unsigned char * base64_decode (const unsigned char *src, size_t len, size_t *out_len)
 Base64 decode. More...
 

Detailed Description

Base64 encoding/decoding (RFC1341)

Function Documentation

unsigned char* base64_decode ( const unsigned char *  src,
size_t  len,
size_t *  out_len 
)

Base64 decode.

Parameters
srcData to be decoded
lenLength of the data to be decoded
out_lenPointer to output length variable
Returns
Allocated buffer of out_len bytes of decoded data, or NULL on failure

Caller is responsible for freeing the returned buffer.

unsigned char* base64_encode ( const unsigned char *  src,
size_t  len,
size_t *  out_len 
)

Base64 encode.

Parameters
srcData to be encoded
lenLength of the data to be encoded
out_lenPointer to output length variable, or NULL if not used
Returns
Allocated buffer of out_len bytes of encoded data, or NULL on failure

Caller is responsible for freeing the returned buffer. Returned buffer is nul terminated to make it easier to use as a C string. The nul terminator is not included in out_len.