suricata
util-base64.c File Reference
#include "util-base64.h"
#include "util-unittest.h"
Include dependency graph for util-base64.c:

Go to the source code of this file.

Macros

#define BASE64_TABLE_MAX   122
 

Functions

Base64Ecode DecodeBase64 (uint8_t *dest, uint32_t dest_size, const uint8_t *src, uint32_t len, uint32_t *consumed_bytes, uint32_t *decoded_bytes, Base64Mode mode)
 Decodes a base64-encoded string buffer into an ascii-encoded byte buffer. More...
 
void Base64RegisterTests (void)
 

Detailed Description

Macro Definition Documentation

◆ BASE64_TABLE_MAX

#define BASE64_TABLE_MAX   122

Definition at line 29 of file util-base64.c.

Function Documentation

◆ Base64RegisterTests()

void Base64RegisterTests ( void  )

Definition at line 280 of file util-base64.c.

References UtRegisterTest().

Here is the call graph for this function:

◆ DecodeBase64()

Base64Ecode DecodeBase64 ( uint8_t *  dest,
uint32_t  dest_size,
const uint8_t *  src,
uint32_t  len,
uint32_t *  consumed_bytes,
uint32_t *  decoded_bytes,
Base64Mode  mode 
)

Decodes a base64-encoded string buffer into an ascii-encoded byte buffer.

Parameters
destThe destination byte buffer
dest_sizeThe destination byte buffer size
srcThe source string
lenThe length of the source string
consumed_bytesThe bytes that were actually processed/consumed
decoded_bytesThe bytes that were decoded
modeThe mode in which decoding should happen
Returns
Error code indicating success or failures with parsing

Definition at line 93 of file util-base64.c.

References B64_BLOCK, BASE64_ECODE_OK, len, and padding.

Referenced by DatasetAddSerialized(), DatasetRemoveSerialized(), and DetectBase64DecodeDoMatch().

Here is the caller graph for this function: