OpenVAS Libraries  9.0.1
Data Structures | Macros | Typedefs | Functions
hmacmd5.h File Reference
#include "md5.h"

Go to the source code of this file.

Data Structures

struct  HMACMD5Context
 

Macros

#define uchar   unsigned char
 
#define ZERO_STRUCT(x)   memset((char *)&(x), 0, sizeof(x))
 
#define SAFE_FREE(x)   do { if ((x) != NULL) {free(x); x=NULL;} } while(0)
 
#define uint16   unsigned short
 
#define UCS2_SHIFT   0
 
#define UCS2_CHAR(c)   ((c) << UCS2_SHIFT)
 

Typedefs

typedef uint16 smb_ucs2_t
 

Functions

void hmac_md5_init_limK_to_64 (const uchar *key, int key_len, HMACMD5Context *ctx)
 The microsoft version of hmac_md5 initialisation. More...
 
void hmac_md5_update (const uchar *text, int text_len, HMACMD5Context *ctx)
 Update hmac_md5 "inner" buffer. More...
 
void hmac_md5_final (uchar *digest, HMACMD5Context *ctx)
 Finish off hmac_md5 "inner" buffer and generate outer one. More...
 
void hmac_md5 (uchar key[16], uchar *data, int data_len, uchar *digest)
 Function to calculate an HMAC MD5 digest from data. Use the microsoft hmacmd5 init method because the key is 16 bytes. More...
 

Macro Definition Documentation

◆ SAFE_FREE

#define SAFE_FREE (   x)    do { if ((x) != NULL) {free(x); x=NULL;} } while(0)

Free memory if the pointer and zero the pointer.

Note
You are explicitly allowed to pass NULL pointers – they will always be ignored.

◆ uchar

#define uchar   unsigned char

◆ UCS2_CHAR

#define UCS2_CHAR (   c)    ((c) << UCS2_SHIFT)

◆ UCS2_SHIFT

#define UCS2_SHIFT   0

◆ uint16

#define uint16   unsigned short

◆ ZERO_STRUCT

#define ZERO_STRUCT (   x)    memset((char *)&(x), 0, sizeof(x))

Typedef Documentation

◆ smb_ucs2_t

typedef uint16 smb_ucs2_t

Function Documentation

◆ hmac_md5()

void hmac_md5 ( uchar  key[16],
uchar data,
int  data_len,
uchar digest 
)

Function to calculate an HMAC MD5 digest from data. Use the microsoft hmacmd5 init method because the key is 16 bytes.

◆ hmac_md5_final()

void hmac_md5_final ( uchar digest,
HMACMD5Context ctx 
)

Finish off hmac_md5 "inner" buffer and generate outer one.

◆ hmac_md5_init_limK_to_64()

void hmac_md5_init_limK_to_64 ( const uchar key,
int  key_len,
HMACMD5Context ctx 
)

The microsoft version of hmac_md5 initialisation.

◆ hmac_md5_update()

void hmac_md5_update ( const uchar text,
int  text_len,
HMACMD5Context ctx 
)

Update hmac_md5 "inner" buffer.