dst.h revision 6a8832f784bd53aa6afbda22f6187cea6490e1e1
#ifndef DST_H
#define DST_H
#ifndef HAS_DST_KEY
typedef struct dst_key {
char *dk_key_name; /* name of the key */
int dk_key_size; /* this is the size of the key in bits */
int dk_proto; /* what protocols this key can be used for */
int dk_alg; /* algorithm number from key record */
} DST_KEY;
#endif /* HAS_DST_KEY */
/*
* DST Crypto API defintions
*/
void dst_init(void);
int dst_check_algorithm(const int);
void **context, /* pointer to state structure */
const int len, /* length of input data */
const int sig_len); /* size of output buffer */
void **context, /* pointer to state structure */
const int len, /* length of input data */
const int sig_len); /* length of signature */
const int in_alg, /* key algorithm */
const int len); /* size of input buffer*/
const int out_len); /* size of out_storage*/
const int alg, /* algorithm */
const int flags, /* dns flags */
const int protocol, /* dns protocol */
const int key_len); /* size of key */
const int alg, /* key algorithm to generate */
const int bits, /* size of new key */
const int exp, /* alg dependent parameter*/
const int flags, /* key DNS flags */
const int protocol); /* key DNS protocol */
/* Used by callers as well as by the library. */
/* DST_API control flags */
/* These are used used in functions dst_sign_data and dst_verify_data */
/* Flags for dst_read_private_key() */
#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
/* DST algorithm codes */
#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
/* DST constants to locations in KEY record changes in new KEY record */
#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
#ifndef SIGN_F_NOKEY
#define SIGN_F_NOKEY 0xC000
#endif
/* error codes from dst routines */
#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)
#endif /* DST_H */