suricata
util-base64.h File Reference
#include "suricata-common.h"
#include "threads.h"
#include "debug.h"
#include "decode.h"
#include "detect.h"
#include "detect-parse.h"
#include "detect-engine.h"
#include "detect-engine-mpm.h"
#include "detect-engine-state.h"
#include "flow.h"
#include "flow-var.h"
#include "flow-util.h"
#include "util-debug.h"
#include "util-spm-bm.h"
Include dependency graph for util-base64.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define ASCII_BLOCK   3
 
#define B64_BLOCK   4
 

Enumerations

enum  Base64Mode { BASE64_MODE_RELAX, BASE64_MODE_RFC2045, BASE64_MODE_STRICT }
 
enum  Base64Ecode { BASE64_ECODE_ERR = -1, BASE64_ECODE_OK = 0, BASE64_ECODE_BUF }
 

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

◆ ASCII_BLOCK

#define ASCII_BLOCK   3

Definition at line 49 of file util-base64.h.

◆ B64_BLOCK

#define B64_BLOCK   4

Definition at line 50 of file util-base64.h.

Enumeration Type Documentation

◆ Base64Ecode

Enumerator
BASE64_ECODE_ERR 
BASE64_ECODE_OK 
BASE64_ECODE_BUF 

Definition at line 57 of file util-base64.h.

◆ Base64Mode

enum Base64Mode
Enumerator
BASE64_MODE_RELAX 
BASE64_MODE_RFC2045 
BASE64_MODE_STRICT 

Definition at line 51 of file util-base64.h.

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: