iPXE
|
Base64 encoding. More...
Go to the source code of this file.
Functions | |
FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
static size_t | base64_encoded_len (size_t raw_len) |
Calculate length of base64-encoded data. More... | |
static size_t | base64_decoded_max_len (const char *encoded) |
Calculate maximum length of base64-decoded string. More... | |
size_t | base64_encode (const void *raw, size_t raw_len, char *data, size_t len) |
Base64-encode data. More... | |
int | base64_decode (const char *encoded, void *data, size_t len) |
Base64-decode string. More... | |
Base64 encoding.
Definition in file base64.h.
FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
Calculate length of base64-encoded data.
raw_len | Raw data length |
encoded_len | Encoded string length (excluding NUL) |
Definition at line 21 of file base64.h.
References raw_len.
Referenced by base64_encode_okx(), http_format_ntlm_auth(), icert_encode(), ocsp_uri_string(), and validator_start_download().
|
inlinestatic |
Calculate maximum length of base64-decoded string.
encoded | Encoded string |
max_raw_len | Maximum length of raw data |
Note that the exact length of the raw data cannot be known until the string is decoded.
Definition at line 34 of file base64.h.
References strlen().
Referenced by base64_decode_okx(), ipair_rx_pubkey(), and pem_asn1().
Base64-encode data.
raw | Raw data |
raw_len | Length of raw data |
data | Buffer |
len | Length of buffer |
len | Encoded length |
Definition at line 51 of file base64.c.
References base64, bit, data, len, raw, raw_len, and tmp.
Referenced by base64_encode_okx(), format_base64_setting(), http_format_basic_auth(), http_format_ntlm_auth(), icert_encode(), ocsp_uri_string(), and validator_start_download().
int base64_decode | ( | const char * | encoded, |
void * | data, | ||
size_t | len | ||
) |
Base64-decode string.
encoded | Encoded string |
data | Buffer |
len | Length of buffer |
len | Length of data, or negative error |
Definition at line 91 of file base64.c.
References base64, bit, data, DBG, EINVAL, in, isspace(), len, memset(), offset, out, and strchr().
Referenced by base64_decode_okx(), http_parse_ntlm_auth(), ipair_rx_pubkey(), iscsi_large_binary_decode(), parse_base64_setting(), and pem_asn1().