ISC DHCP  4.3.3
A reference DHCPv4 and DHCPv6 implementation
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
dst.h File Reference

Go to the source code of this file.

Data Structures

struct  dst_key
 

Macros

#define RAW_KEY_SIZE   8192 /* large enough to store any key */
 
#define SIG_MODE_INIT   1 /* initalize digest */
 
#define SIG_MODE_UPDATE   2 /* add data to digest */
 
#define SIG_MODE_FINAL   4 /* generate/verify signature */
 
#define SIG_MODE_ALL   (SIG_MODE_INIT|SIG_MODE_UPDATE|SIG_MODE_FINAL)
 
#define DST_FORCE_READ   0x1000000
 
#define DST_CAN_SIGN   0x010F
 
#define DST_NO_AUTHEN   0x8000
 
#define DST_EXTEND_FLAG   0x1000
 
#define DST_STANDARD   0
 
#define DST_PRIVATE   0x2000000
 
#define DST_PUBLIC   0x4000000
 
#define DST_RAND_SEMI   1
 
#define DST_RAND_STD   2
 
#define DST_RAND_KEY   3
 
#define DST_RAND_DSS   4
 
#define KEY_RSA   1
 
#define KEY_DH   2
 
#define KEY_DSA   3
 
#define KEY_PRIVATE   254
 
#define KEY_EXPAND   255
 
#define KEY_HMAC_MD5   157
 
#define KEY_HMAC_SHA1   158
 
#define UNKNOWN_KEYALG   0
 
#define DST_MAX_ALGS   KEY_HMAC_SHA1
 
#define DST_FLAGS_SIZE   2
 
#define DST_KEY_PROT   2
 
#define DST_KEY_ALG   3
 
#define DST_EXT_FLAG   4
 
#define DST_KEY_START   4
 
#define SIGN_F_NOKEY   0xC000
 
#define SIGN_INIT_FAILURE   (-23)
 
#define SIGN_UPDATE_FAILURE   (-24)
 
#define SIGN_FINAL_FAILURE   (-25)
 
#define VERIFY_INIT_FAILURE   (-26)
 
#define VERIFY_UPDATE_FAILURE   (-27)
 
#define VERIFY_FINAL_FAILURE   (-28)
 
#define MISSING_KEY_OR_SIGNATURE   (-30)
 
#define UNSUPPORTED_KEYALG   (-31)
 

Typedefs

typedef struct dst_key DST_KEY
 

Functions

void dst_init (void)
 
int dst_check_algorithm (const int)
 
int dst_sign_data (const int mode, DST_KEY *in_key, void **context, const u_char *data, const unsigned len, u_char *signature, const unsigned sig_len)
 
int dst_verify_data (const int mode, DST_KEY *in_key, void **context, const u_char *data, const unsigned len, const u_char *signature, const unsigned sig_len)
 
DST_KEYdst_read_key (const char *in_name, const unsigned in_id, const int in_alg, const int key_type)
 
int dst_write_key (const DST_KEY *key, const int key_type)
 
DST_KEYdst_dnskey_to_key (const char *in_name, const u_char *key, const unsigned len)
 
int dst_key_to_dnskey (const DST_KEY *key, u_char *out_storage, const unsigned out_len)
 
DST_KEYdst_buffer_to_key (const char *key_name, const int alg, const unsigned flags, const int protocol, const u_char *key_buf, const unsigned key_len)
 
int dst_key_to_buffer (DST_KEY *key, u_char *out_buff, unsigned buf_len)
 
DST_KEYdst_generate_key (const char *name, const int bits, const int exp, const unsigned flags, const int protocol, const int alg)
 
DST_KEYdst_free_key (DST_KEY *f_key)
 
int dst_compare_keys (const DST_KEY *key1, const DST_KEY *key2)
 
int dst_sig_size (DST_KEY *key)
 
int dst_random (const int mode, unsigned wanted, u_char *outran)
 
u_int16_t dst_s_dns_key_id (const u_char *dns_key_rdata, const unsigned rdata_len)
 
u_int16_t dst_s_id_calc (const u_char *key_data, const unsigned key_len)
 

Macro Definition Documentation

#define DST_CAN_SIGN   0x010F

Definition at line 98 of file dst.h.

#define DST_EXT_FLAG   4

Definition at line 125 of file dst.h.

#define DST_EXTEND_FLAG   0x1000

Definition at line 100 of file dst.h.

#define DST_FLAGS_SIZE   2

Definition at line 122 of file dst.h.

#define DST_FORCE_READ   0x1000000

Definition at line 97 of file dst.h.

#define DST_KEY_ALG   3

Definition at line 124 of file dst.h.

#define DST_KEY_PROT   2

Definition at line 123 of file dst.h.

#define DST_KEY_START   4

Definition at line 126 of file dst.h.

#define DST_MAX_ALGS   KEY_HMAC_SHA1

Definition at line 119 of file dst.h.

#define DST_NO_AUTHEN   0x8000

Definition at line 99 of file dst.h.

#define DST_PRIVATE   0x2000000

Definition at line 102 of file dst.h.

#define DST_PUBLIC   0x4000000

Definition at line 103 of file dst.h.

#define DST_RAND_DSS   4

Definition at line 107 of file dst.h.

#define DST_RAND_KEY   3

Definition at line 106 of file dst.h.

#define DST_RAND_SEMI   1

Definition at line 104 of file dst.h.

#define DST_RAND_STD   2

Definition at line 105 of file dst.h.

#define DST_STANDARD   0

Definition at line 101 of file dst.h.

#define KEY_DH   2

Definition at line 112 of file dst.h.

#define KEY_DSA   3

Definition at line 113 of file dst.h.

#define KEY_EXPAND   255

Definition at line 115 of file dst.h.

#define KEY_HMAC_MD5   157

Definition at line 116 of file dst.h.

#define KEY_HMAC_SHA1   158

Definition at line 117 of file dst.h.

#define KEY_PRIVATE   254

Definition at line 114 of file dst.h.

#define KEY_RSA   1

Definition at line 111 of file dst.h.

#define MISSING_KEY_OR_SIGNATURE   (-30)

Definition at line 139 of file dst.h.

#define RAW_KEY_SIZE   8192 /* large enough to store any key */

Definition at line 87 of file dst.h.

#define SIG_MODE_ALL   (SIG_MODE_INIT|SIG_MODE_UPDATE|SIG_MODE_FINAL)

Definition at line 94 of file dst.h.

#define SIG_MODE_FINAL   4 /* generate/verify signature */

Definition at line 93 of file dst.h.

#define SIG_MODE_INIT   1 /* initalize digest */

Definition at line 91 of file dst.h.

#define SIG_MODE_UPDATE   2 /* add data to digest */

Definition at line 92 of file dst.h.

#define SIGN_F_NOKEY   0xC000

Definition at line 129 of file dst.h.

#define SIGN_FINAL_FAILURE   (-25)

Definition at line 135 of file dst.h.

#define SIGN_INIT_FAILURE   (-23)

Definition at line 133 of file dst.h.

#define SIGN_UPDATE_FAILURE   (-24)

Definition at line 134 of file dst.h.

#define UNKNOWN_KEYALG   0

Definition at line 118 of file dst.h.

#define UNSUPPORTED_KEYALG   (-31)

Definition at line 140 of file dst.h.

#define VERIFY_FINAL_FAILURE   (-28)

Definition at line 138 of file dst.h.

#define VERIFY_INIT_FAILURE   (-26)

Definition at line 136 of file dst.h.

#define VERIFY_UPDATE_FAILURE   (-27)

Definition at line 137 of file dst.h.

Typedef Documentation

typedef struct dst_key DST_KEY

Function Documentation

DST_KEY* dst_buffer_to_key ( const char *  key_name,
const int  alg,
const unsigned  flags,
const int  protocol,
const u_char *  key_buf,
const unsigned  key_len 
)
int dst_check_algorithm ( const int  )
int dst_compare_keys ( const DST_KEY key1,
const DST_KEY key2 
)
DST_KEY* dst_dnskey_to_key ( const char *  in_name,
const u_char *  key,
const unsigned  len 
)
DST_KEY* dst_free_key ( DST_KEY f_key)
DST_KEY* dst_generate_key ( const char *  name,
const int  bits,
const int  exp,
const unsigned  flags,
const int  protocol,
const int  alg 
)
void dst_init ( void  )
int dst_key_to_buffer ( DST_KEY key,
u_char *  out_buff,
unsigned  buf_len 
)
int dst_key_to_dnskey ( const DST_KEY key,
u_char *  out_storage,
const unsigned  out_len 
)
int dst_random ( const int  mode,
unsigned  wanted,
u_char *  outran 
)
DST_KEY* dst_read_key ( const char *  in_name,
const unsigned  in_id,
const int  in_alg,
const int  key_type 
)
u_int16_t dst_s_dns_key_id ( const u_char *  dns_key_rdata,
const unsigned  rdata_len 
)
u_int16_t dst_s_id_calc ( const u_char *  key_data,
const unsigned  key_len 
)
int dst_sig_size ( DST_KEY key)
int dst_sign_data ( const int  mode,
DST_KEY in_key,
void **  context,
const u_char *  data,
const unsigned  len,
u_char *  signature,
const unsigned  sig_len 
)
int dst_verify_data ( const int  mode,
DST_KEY in_key,
void **  context,
const u_char *  data,
const unsigned  len,
const u_char *  signature,
const unsigned  sig_len 
)
int dst_write_key ( const DST_KEY key,
const int  key_type 
)