All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions | Variables
base64.c File Reference
#include <freeradius-devel/libradius.h>
#include <freeradius-devel/base64.h>
+ Include dependency graph for base64.c:

Go to the source code of this file.

Macros

#define B64(_)
 
#define us(x)   (uint8_t) x
 Encode/decode binary data using printable characters. More...
 

Functions

ssize_t fr_base64_decode (uint8_t *out, size_t outlen, char const *in, size_t inlen)
 
size_t fr_base64_encode (char *out, size_t outlen, uint8_t const *in, size_t inlen)
 Base 64 encode binary data. More...
 
bool fr_is_base64 (char c)
 Check if char is in Base64 alphabet. More...
 

Variables

static const signed char b64 [0x100]
 

Macro Definition Documentation

#define B64 (   _)

Definition at line 80 of file base64.c.

#define us (   x)    (uint8_t) x

Encode/decode binary data using printable characters.

Author
Simon Josefsson.
See Also
RFC 3548 http://www.ietf.org/rfc/rfc3548.txt.

Definition at line 30 of file base64.c.

Function Documentation

ssize_t fr_base64_decode ( uint8_t *  out,
size_t  outlen,
char const *  in,
size_t  inlen 
)

Definition at line 251 of file base64.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

size_t fr_base64_encode ( char *  out,
size_t  outlen,
uint8_t const *  in,
size_t  inlen 
)

Base 64 encode binary data.

Base64 encode IN array of size INLEN into OUT array of size OUTLEN.

Parameters
[out]outWhere to write Base64 string.
[in]outlensize of buffer including NULL byte.
[in]inData to encode.
[in]inlenLength of data to encode.
Returns
  • Amount of data we wrote to the buffer.
  • -1 if output buffer was too small.

Definition at line 44 of file base64.c.

+ Here is the caller graph for this function:

bool fr_is_base64 ( char  c)

Check if char is in Base64 alphabet.

Note that '=' is padding and not considered to be part of the alphabet.

Parameters
cchar to check.
Returns
  • true if c is a character from the Base64 alphabet.
  • false if character is not in the Base64 alphabet.

Definition at line 223 of file base64.c.

+ Here is the caller graph for this function:

Variable Documentation

const signed char b64[0x100]
static

Definition at line 147 of file base64.c.