diff options
Diffstat (limited to 'usr/src/lib/libresolv2/include/isc/dst.h')
-rw-r--r-- | usr/src/lib/libresolv2/include/isc/dst.h | 139 |
1 files changed, 57 insertions, 82 deletions
diff --git a/usr/src/lib/libresolv2/include/isc/dst.h b/usr/src/lib/libresolv2/include/isc/dst.h index 4460cf63ae..90a9e67468 100644 --- a/usr/src/lib/libresolv2/include/isc/dst.h +++ b/usr/src/lib/libresolv2/include/isc/dst.h @@ -1,25 +1,16 @@ -/* - * Copyright 2003 by Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - */ - #ifndef DST_H #define DST_H -#pragma ident "%Z%%M% %I% %E% SMI" - #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 */ - u_int32_t dk_flags; /* and the flags of the public key */ - u_int16_t dk_id; /* identifier of the 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 */ + u_int32_t dk_flags; /*%< and the flags of the public key */ + u_int16_t dk_id; /*%< identifier of the key */ } DST_KEY; #endif /* HAS_DST_KEY */ - -#ifdef ORIGINAL_ISC_CODE /* * do not taint namespace */ @@ -36,7 +27,6 @@ typedef struct dst_key { #define dst_init __dst_init #define dst_key_to_buffer __dst_key_to_buffer #define dst_key_to_dnskey __dst_key_to_dnskey -#define dst_random __dst_random #define dst_read_key __dst_read_key #define dst_rsaref_init __dst_rsaref_init #define dst_s_build_filename __dst_s_build_filename @@ -61,8 +51,6 @@ typedef struct dst_key { #define dst_sign_data __dst_sign_data #define dst_verify_data __dst_verify_data #define dst_write_key __dst_write_key -#else -#endif /* * DST Crypto API defintions @@ -70,78 +58,64 @@ typedef struct dst_key { void dst_init(void); int dst_check_algorithm(const int); -int dst_sign_data(const int mode, /* specifies INIT/UPDATE/FINAL/ALL */ - DST_KEY *in_key, /* the key to use */ - void **context, /* pointer to state structure */ - const u_char *data, /* data to be signed */ - const int len, /* length of input data */ - u_char *signature, /* buffer to write signature to */ - const int sig_len); /* size of output buffer */ - -int dst_verify_data(const int mode, /* specifies INIT/UPDATE/FINAL/ALL */ - DST_KEY *in_key, /* the key to use */ - void **context, /* pointer to state structure */ - const u_char *data, /* data to be verified */ - const int len, /* length of input data */ - const u_char *signature,/* buffer containing signature */ - const int sig_len); /* length of signature */ - - -DST_KEY *dst_read_key(const char *in_name, /* name of key */ - const u_int16_t in_id, /* key tag identifier */ - const int in_alg, /* key algorithm */ - const int key_type); /* Private/PublicKey wanted*/ - -int dst_write_key(const DST_KEY *key, /* key to write out */ - const int key_type); /* Public/Private */ - -DST_KEY *dst_dnskey_to_key(const char *in_name, /* KEY record name */ - const u_char *key, /* KEY RDATA */ - const int len); /* size of input buffer*/ - -int dst_key_to_dnskey(const DST_KEY *key, /* key to translate */ - u_char *out_storage, /* output buffer */ - const int out_len); /* size of out_storage*/ - - -DST_KEY *dst_buffer_to_key(const char *key_name, /* name of the key */ - const int alg, /* algorithm */ - const int flags, /* dns flags */ - const int protocol, /* dns protocol */ - const u_char *key_buf, /* key in dns wire fmt */ - const int key_len); /* size of key */ - - -int dst_key_to_buffer(DST_KEY *key, u_char *out_buff, int buf_len); - -DST_KEY *dst_generate_key(const char *name, /* name of new 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 */ - -DST_KEY *dst_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, int wanted, u_char *outran); +int dst_sign_data(const int, /*!< specifies INIT/UPDATE/FINAL/ALL */ + DST_KEY *, /*!< the key to use */ + void **, /*!< pointer to state structure */ + const u_char *, /*!< data to be signed */ + const int, /*!< length of input data */ + u_char *, /*!< buffer to write signature to */ + const int); /*!< size of output buffer */ +int dst_verify_data(const int, /*!< specifies INIT/UPDATE/FINAL/ALL */ + DST_KEY *, /*!< the key to use */ + void **, /*!< pointer to state structure */ + const u_char *, /*!< data to be verified */ + const int, /*!< length of input data */ + const u_char *, /*!< buffer containing signature */ + const int); /*!< length of signature */ +DST_KEY *dst_read_key(const char *, /*!< name of key */ + const u_int16_t, /*!< key tag identifier */ + const int, /*!< key algorithm */ + const int); /*!< Private/PublicKey wanted */ +int dst_write_key(const DST_KEY *, /*!< key to write out */ + const int); /*!< Public/Private */ +DST_KEY *dst_dnskey_to_key(const char *, /*!< KEY record name */ + const u_char *, /*!< KEY RDATA */ + const int); /*!< size of input buffer */ +int dst_key_to_dnskey(const DST_KEY *, /*!< key to translate */ + u_char *, /*!< output buffer */ + const int); /*!< size of out_storage */ +DST_KEY *dst_buffer_to_key(const char *, /*!< name of the key */ + const int, /*!< algorithm */ + const int, /*!< dns flags */ + const int, /*!< dns protocol */ + const u_char *, /*!< key in dns wire fmt */ + const int); /*!< size of key */ +int dst_key_to_buffer(DST_KEY *, u_char *, int); + +DST_KEY *dst_generate_key(const char *, /*!< name of new key */ + const int, /*!< key algorithm to generate */ + const int, /*!< size of new key */ + const int, /*!< alg dependent parameter */ + const int, /*!< key DNS flags */ + const int); /*!< key DNS protocol */ +DST_KEY *dst_free_key(DST_KEY *); +int dst_compare_keys(const DST_KEY *, const DST_KEY *); + +int dst_sig_size(DST_KEY *); /* support for dns key tags/ids */ -u_int16_t dst_s_dns_key_id(const u_char *dns_key_rdata, const int rdata_len); -u_int16_t dst_s_id_calc(const u_char *key_data, const int key_len); +u_int16_t dst_s_dns_key_id(const u_char *, const int); +u_int16_t dst_s_id_calc(const u_char *, const int); /* Used by callers as well as by the library. */ -#define RAW_KEY_SIZE 8192 /* large enough to store any key */ - +#define RAW_KEY_SIZE 8192 /*%< large enough to store any key */ /* DST_API control flags */ /* These are used used in functions dst_sign_data and dst_verify_data */ -#define SIG_MODE_INIT 1 /* initialize digest */ -#define SIG_MODE_UPDATE 2 /* add data to digest */ -#define SIG_MODE_FINAL 4 /* generate/verify signature */ +#define SIG_MODE_INIT 1 /*%< initialize 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) /* Flags for dst_read_private_key() */ @@ -191,3 +165,4 @@ u_int16_t dst_s_id_calc(const u_char *key_data, const int key_len); #define UNSUPPORTED_KEYALG (-31) #endif /* DST_H */ +/*! \file */ |