OpenVPN
Macros | Functions
base64.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define OPENVPN_BASE64_LENGTH(binary_length)   ((((8 * binary_length) / 6) + 3) & ~3)
 Compute resulting base64 length. More...
 
#define OPENVPN_BASE64_DECODED_LENGTH(base64_length)   ((base64_length / 4) * 3)
 Compute the maximal number of bytes encoded in a base64 string. More...
 

Functions

int openvpn_base64_encode (const void *data, int size, char **str)
 
int openvpn_base64_decode (const char *str, void *data, int size)
 

Macro Definition Documentation

◆ OPENVPN_BASE64_DECODED_LENGTH

#define OPENVPN_BASE64_DECODED_LENGTH (   base64_length)    ((base64_length / 4) * 3)

Compute the maximal number of bytes encoded in a base64 string.

Definition at line 42 of file base64.h.

◆ OPENVPN_BASE64_LENGTH

#define OPENVPN_BASE64_LENGTH (   binary_length)    ((((8 * binary_length) / 6) + 3) & ~3)

Compute resulting base64 length.

6 bits per byte, padded to 4 bytes.

Definition at line 38 of file base64.h.

Function Documentation

◆ openvpn_base64_decode()

int openvpn_base64_decode ( const char *  str,
void *  data,
int  size 
)

◆ openvpn_base64_encode()

int openvpn_base64_encode ( const void *  data,
int  size,
char **  str 
)

Definition at line 52 of file base64.c.

References base64_chars.

Referenced by generate_auth_token(), get_sig_from_man(), get_user_pass_cr(), and make_base64_string2().