OpenVPN
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)
 Compute resulting base64 length.
#define OPENVPN_BASE64_DECODED_LENGTH(base64_length)
 Compute the maximal number of bytes encoded in a base64 string.

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)
Value:
((base64_length / 4) * 3)

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

Definition at line 41 of file base64.h.

Referenced by in_extra_dispatch(), and tls_crypt_v2_write_client_key_file().

◆ OPENVPN_BASE64_LENGTH

#define OPENVPN_BASE64_LENGTH ( binary_length)
Value:
((((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.

Referenced by in_extra_dispatch().

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 )