Coda Distributed File System
Classes | Macros | Functions
secure.h File Reference
#include <sys/types.h>
#include <sys/socket.h>
#include <stdint.h>
Include dependency graph for secure.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  secure_encr
 
struct  secure_auth
 
struct  security_association
 

Macros

#define MAXPACKETSIZE   (4500)
 
#define MAXIVLEN   32
 
#define MAXICVLEN   32
 
#define SECURE_ENCR_NULL   11
 
#define SECURE_ENCR_AES_CBC   12
 
#define SECURE_ENCR_AES_CCM_8   14
 
#define SECURE_ENCR_AES_CCM_12   15
 
#define SECURE_ENCR_AES_CCM_16   16
 
#define SECURE_AUTH_NONE   0
 
#define SECURE_AUTH_AES_XCBC_96   9
 
#define SECURE_VERSION   1
 
#define SECURE_PBKDF_ITERATIONS   10000 /* see comments in secure_aes.c */
 

Functions

void secure_init (int verbose)
 
void secure_release (void)
 
const struct secure_authsecure_get_auth_byid (int id)
 
const struct secure_encrsecure_get_encr_byid (int id)
 
int secure_setup_encrypt (uint32_t secure_version, struct security_association *sa, const struct secure_auth *authenticate, const struct secure_encr *encrypt, const uint8_t *key, size_t len)
 
int secure_setup_decrypt (uint32_t secure_version, struct security_association *sa, const struct secure_auth *validate, const struct secure_encr *decrypt, const uint8_t *key, size_t len)
 
int secure_pbkdf (const uint8_t *password, size_t plen, const uint8_t *salt, size_t slen, size_t iterations, uint8_t *key, size_t keylen)
 
void secure_random_bytes (void *buf, size_t len)
 
ssize_t secure_sendto (int s, const void *buf, size_t len, int flags, const struct sockaddr *to, socklen_t tolen, struct security_association *sa)
 
ssize_t secure_recvfrom (int s, void *buf, size_t len, int flags, struct sockaddr *peer, socklen_t *peerlen, struct security_association **sa, struct security_association *(*GETSA)(uint32_t spi))
 
int secure_compare (const void *user_data, size_t user_len, const void *secret, size_t secret_len)
 

Macro Definition Documentation

◆ MAXICVLEN

#define MAXICVLEN   32

◆ MAXIVLEN

#define MAXIVLEN   32

◆ MAXPACKETSIZE

#define MAXPACKETSIZE   (4500)

◆ SECURE_AUTH_AES_XCBC_96

#define SECURE_AUTH_AES_XCBC_96   9

◆ SECURE_AUTH_NONE

#define SECURE_AUTH_NONE   0

◆ SECURE_ENCR_AES_CBC

#define SECURE_ENCR_AES_CBC   12

◆ SECURE_ENCR_AES_CCM_12

#define SECURE_ENCR_AES_CCM_12   15

◆ SECURE_ENCR_AES_CCM_16

#define SECURE_ENCR_AES_CCM_16   16

◆ SECURE_ENCR_AES_CCM_8

#define SECURE_ENCR_AES_CCM_8   14

◆ SECURE_ENCR_NULL

#define SECURE_ENCR_NULL   11

◆ SECURE_PBKDF_ITERATIONS

#define SECURE_PBKDF_ITERATIONS   10000 /* see comments in secure_aes.c */

◆ SECURE_VERSION

#define SECURE_VERSION   1

Function Documentation

◆ secure_compare()

int secure_compare ( const void *  user_data,
size_t  user_len,
const void *  secret,
size_t  secret_len 
)

◆ secure_get_auth_byid()

const struct secure_auth * secure_get_auth_byid ( int  id)

◆ secure_get_encr_byid()

const struct secure_encr * secure_get_encr_byid ( int  id)

◆ secure_init()

void secure_init ( int  verbose)

◆ secure_pbkdf()

int secure_pbkdf ( const uint8_t password,
size_t  plen,
const uint8_t salt,
size_t  slen,
size_t  iterations,
uint8_t key,
size_t  keylen 
)

◆ secure_random_bytes()

void secure_random_bytes ( void *  buf,
size_t  len 
)

◆ secure_recvfrom()

ssize_t secure_recvfrom ( int  s,
void *  buf,
size_t  len,
int  flags,
struct sockaddr *  peer,
socklen_t peerlen,
struct security_association **  sa,
struct security_association *(*)(uint32_t spi)  GETSA 
)

◆ secure_release()

void secure_release ( void  )

◆ secure_sendto()

ssize_t secure_sendto ( int  s,
const void *  buf,
size_t  len,
int  flags,
const struct sockaddr *  to,
socklen_t  tolen,
struct security_association sa 
)

◆ secure_setup_decrypt()

int secure_setup_decrypt ( uint32_t  secure_version,
struct security_association sa,
const struct secure_auth validate,
const struct secure_encr decrypt,
const uint8_t key,
size_t  len 
)

◆ secure_setup_encrypt()

int secure_setup_encrypt ( uint32_t  secure_version,
struct security_association sa,
const struct secure_auth authenticate,
const struct secure_encr encrypt,
const uint8_t key,
size_t  len 
)