cwist
Modern C web framework with libttak runtime
Loading...
Searching...
No Matches
hmac.h File Reference

mbedTLS TLS backend: HMAC subset (HMAC-SHA256, one-shot + streaming). More...

#include <openssl/evp.h>
#include <stddef.h>
Include dependency graph for hmac.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define HMAC   cwist_mtls_HMAC
 
#define HMAC_CTX_new   cwist_mtls_HMAC_CTX_new
 
#define HMAC_CTX_free   cwist_mtls_HMAC_CTX_free
 
#define HMAC_Init_ex   cwist_mtls_HMAC_Init_ex
 
#define HMAC_Update   cwist_mtls_HMAC_Update
 
#define HMAC_Final   cwist_mtls_HMAC_Final
 

Typedefs

typedef struct cwist_mtls_hmac_ctx HMAC_CTX
 

Functions

unsigned char * cwist_mtls_HMAC (const EVP_MD *md, const void *key, int key_len, const unsigned char *msg, size_t msg_len, unsigned char *out, unsigned int *out_len)
 
HMAC_CTX * cwist_mtls_HMAC_CTX_new (void)
 
void cwist_mtls_HMAC_CTX_free (HMAC_CTX *ctx)
 
int cwist_mtls_HMAC_Init_ex (HMAC_CTX *ctx, const void *key, int key_len, const EVP_MD *md, void *engine)
 
int cwist_mtls_HMAC_Update (HMAC_CTX *ctx, const unsigned char *data, size_t len)
 
int cwist_mtls_HMAC_Final (HMAC_CTX *ctx, unsigned char *out, unsigned int *out_len)
 

Detailed Description

mbedTLS TLS backend: HMAC subset (HMAC-SHA256, one-shot + streaming).

Part of the CWIST TLS backend seam; see shim/openssl/ssl.h for the design. Backs signed session cookies (session.c), sequenced-chunk authentication (seq_auth.c) and JWT HS256.

Definition in file hmac.h.

Macro Definition Documentation

◆ HMAC

#define HMAC   cwist_mtls_HMAC

Definition at line 21 of file hmac.h.

◆ HMAC_CTX_free

#define HMAC_CTX_free   cwist_mtls_HMAC_CTX_free

Definition at line 23 of file hmac.h.

◆ HMAC_CTX_new

#define HMAC_CTX_new   cwist_mtls_HMAC_CTX_new

Definition at line 22 of file hmac.h.

◆ HMAC_Final

#define HMAC_Final   cwist_mtls_HMAC_Final

Definition at line 26 of file hmac.h.

◆ HMAC_Init_ex

#define HMAC_Init_ex   cwist_mtls_HMAC_Init_ex

Definition at line 24 of file hmac.h.

◆ HMAC_Update

#define HMAC_Update   cwist_mtls_HMAC_Update

Definition at line 25 of file hmac.h.

Typedef Documentation

◆ HMAC_CTX

typedef struct cwist_mtls_hmac_ctx HMAC_CTX

Definition at line 19 of file hmac.h.

Function Documentation

◆ cwist_mtls_HMAC()

unsigned char * cwist_mtls_HMAC ( const EVP_MD *  md,
const void *  key,
int  key_len,
const unsigned char *  msg,
size_t  msg_len,
unsigned char *  out,
unsigned int *  out_len 
)

Definition at line 169 of file backend_mbedtls.c.

References cap.

◆ cwist_mtls_HMAC_CTX_free()

void cwist_mtls_HMAC_CTX_free ( HMAC_CTX *  ctx)

Definition at line 196 of file backend_mbedtls.c.

References cap, and cwist_free().

◆ cwist_mtls_HMAC_CTX_new()

HMAC_CTX * cwist_mtls_HMAC_CTX_new ( void  )

Definition at line 189 of file backend_mbedtls.c.

References cap, and cwist_malloc().

◆ cwist_mtls_HMAC_Final()

int cwist_mtls_HMAC_Final ( HMAC_CTX *  ctx,
unsigned char *  out,
unsigned int *  out_len 
)

Definition at line 224 of file backend_mbedtls.c.

References cap.

◆ cwist_mtls_HMAC_Init_ex()

int cwist_mtls_HMAC_Init_ex ( HMAC_CTX *  ctx,
const void *  key,
int  key_len,
const EVP_MD *  md,
void *  engine 
)

Definition at line 202 of file backend_mbedtls.c.

References cap.

◆ cwist_mtls_HMAC_Update()

int cwist_mtls_HMAC_Update ( HMAC_CTX *  ctx,
const unsigned char *  data,
size_t  len 
)

Definition at line 219 of file backend_mbedtls.c.

References cap.