Converted all references to dst_result_t to use isc_result_t instead
This commit is contained in:
@@ -19,7 +19,7 @@
|
||||
|
||||
/*
|
||||
* Principal Author: Brian Wellington
|
||||
* $Id: bsafe_link.c,v 1.11 1999/10/29 12:56:56 marka Exp $
|
||||
* $Id: bsafe_link.c,v 1.12 2000/03/06 20:05:58 bwelling Exp $
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
@@ -80,7 +80,7 @@ static unsigned char pkcs1[] =
|
||||
0x04, 0x10
|
||||
};
|
||||
|
||||
static dst_result_t dst_bsafe_md5digest(const unsigned int mode,
|
||||
static isc_result_t dst_bsafe_md5digest(const unsigned int mode,
|
||||
B_ALGORITHM_OBJ *digest_obj,
|
||||
isc_region_t *data,
|
||||
isc_buffer_t *digest);
|
||||
@@ -88,25 +88,25 @@ static dst_result_t dst_bsafe_md5digest(const unsigned int mode,
|
||||
static int dst_bsafe_key_size(RSA_Key *r_key);
|
||||
static isc_boolean_t dst_s_bsafe_itemcmp(ITEM i1, ITEM i2);
|
||||
|
||||
static dst_result_t dst_bsafe_sign(const unsigned int mode, dst_key_t *key,
|
||||
static isc_result_t dst_bsafe_sign(const unsigned int mode, dst_key_t *key,
|
||||
void **context, isc_region_t *data,
|
||||
isc_buffer_t *sig, isc_mem_t *mctx);
|
||||
static dst_result_t dst_bsafe_verify(const unsigned int mode,
|
||||
static isc_result_t dst_bsafe_verify(const unsigned int mode,
|
||||
dst_key_t *key,
|
||||
void **context, isc_region_t *data,
|
||||
isc_region_t *sig, isc_mem_t *mctx);
|
||||
static isc_boolean_t dst_bsafe_compare(const dst_key_t *key1,
|
||||
const dst_key_t *key2);
|
||||
static dst_result_t dst_bsafe_generate(dst_key_t *key, int exp,
|
||||
static isc_result_t dst_bsafe_generate(dst_key_t *key, int exp,
|
||||
isc_mem_t *mctx);
|
||||
static isc_boolean_t dst_bsafe_isprivate(const dst_key_t *key);
|
||||
static void dst_bsafe_destroy(void *key, isc_mem_t *mctx);
|
||||
static dst_result_t dst_bsafe_to_dns(const dst_key_t *in_key,
|
||||
static isc_result_t dst_bsafe_to_dns(const dst_key_t *in_key,
|
||||
isc_buffer_t *data);
|
||||
static dst_result_t dst_bsafe_from_dns(dst_key_t *key, isc_buffer_t *data,
|
||||
static isc_result_t dst_bsafe_from_dns(dst_key_t *key, isc_buffer_t *data,
|
||||
isc_mem_t *mctx);
|
||||
static dst_result_t dst_bsafe_to_file(const dst_key_t *key);
|
||||
static dst_result_t dst_bsafe_from_file(dst_key_t *key,
|
||||
static isc_result_t dst_bsafe_to_file(const dst_key_t *key);
|
||||
static isc_result_t dst_bsafe_from_file(dst_key_t *key,
|
||||
const isc_uint16_t id,
|
||||
isc_mem_t *mctx);
|
||||
|
||||
@@ -150,7 +150,7 @@ dst_s_bsafersa_init() {
|
||||
* ISC_R_SUCCESS Success
|
||||
* !ISC_R_SUCCESS Failure
|
||||
*/
|
||||
static dst_result_t
|
||||
static isc_result_t
|
||||
dst_bsafe_sign(const unsigned int mode, dst_key_t *key, void **context,
|
||||
isc_region_t *data, isc_buffer_t *sig, isc_mem_t *mctx)
|
||||
{
|
||||
@@ -159,7 +159,7 @@ dst_bsafe_sign(const unsigned int mode, dst_key_t *key, void **context,
|
||||
unsigned char digest_array[DNS_SIG_RSAMAXSIZE];
|
||||
isc_buffer_t digest;
|
||||
isc_region_t sig_region, digest_region;
|
||||
dst_result_t ret;
|
||||
isc_result_t ret;
|
||||
|
||||
if (mode & DST_SIGMODE_INIT) {
|
||||
md5_ctx = (B_ALGORITHM_OBJ *) isc_mem_get(mctx,
|
||||
@@ -277,7 +277,7 @@ dst_bsafe_sign(const unsigned int mode, dst_key_t *key, void **context,
|
||||
* ISC_R_SUCCESS Success
|
||||
* !ISC_R_SUCCESS Failure
|
||||
*/
|
||||
static dst_result_t
|
||||
static isc_result_t
|
||||
dst_bsafe_verify(const unsigned int mode, dst_key_t *key, void **context,
|
||||
isc_region_t *data, isc_region_t *sig, isc_mem_t *mctx)
|
||||
{
|
||||
@@ -286,7 +286,7 @@ dst_bsafe_verify(const unsigned int mode, dst_key_t *key, void **context,
|
||||
unsigned char work_area[DST_HASH_SIZE + sizeof(pkcs1)];
|
||||
isc_buffer_t work, digest;
|
||||
isc_region_t work_region, digest_region;
|
||||
dst_result_t ret;
|
||||
isc_result_t ret;
|
||||
int status = 0;
|
||||
|
||||
if (mode & DST_SIGMODE_INIT) {
|
||||
@@ -407,7 +407,7 @@ dst_bsafe_isprivate(const dst_key_t *key) {
|
||||
* !ISC_R_SUCCESS Failure
|
||||
*/
|
||||
|
||||
static dst_result_t
|
||||
static isc_result_t
|
||||
dst_bsafe_to_dns(const dst_key_t *key, isc_buffer_t *data) {
|
||||
B_KEY_OBJ public;
|
||||
A_RSA_KEY *pub = NULL;
|
||||
@@ -452,7 +452,7 @@ dst_bsafe_to_dns(const dst_key_t *key, isc_buffer_t *data) {
|
||||
* ISC_R_SUCCESS Success
|
||||
* !ISC_R_SUCCESS Failure
|
||||
*/
|
||||
static dst_result_t
|
||||
static isc_result_t
|
||||
dst_bsafe_from_dns(dst_key_t *key, isc_buffer_t *data, isc_mem_t *mctx) {
|
||||
unsigned int bytes;
|
||||
RSA_Key *rkey;
|
||||
@@ -558,7 +558,7 @@ dst_bsafe_from_dns(dst_key_t *key, isc_buffer_t *data, isc_mem_t *mctx) {
|
||||
* ISC_R_SUCCESS Success
|
||||
* !ISC_R_SUCCESS Failure
|
||||
*/
|
||||
static dst_result_t
|
||||
static isc_result_t
|
||||
dst_bsafe_to_file(const dst_key_t *key) {
|
||||
int cnt = 0;
|
||||
B_KEY_OBJ rkey;
|
||||
@@ -622,10 +622,10 @@ dst_bsafe_to_file(const dst_key_t *key) {
|
||||
* !ISC_R_SUCCESS Failure
|
||||
*/
|
||||
|
||||
static dst_result_t
|
||||
static isc_result_t
|
||||
dst_bsafe_from_file(dst_key_t *key, const isc_uint16_t id, isc_mem_t *mctx) {
|
||||
dst_private_t priv;
|
||||
dst_result_t ret;
|
||||
isc_result_t ret;
|
||||
isc_buffer_t b;
|
||||
int i;
|
||||
RSA_Key *rkey = NULL;
|
||||
@@ -771,7 +771,7 @@ dst_bsafe_destroy(void *key, isc_mem_t *mctx)
|
||||
* !ISC_R_SUCCESS Failure
|
||||
*/
|
||||
|
||||
static dst_result_t
|
||||
static isc_result_t
|
||||
dst_bsafe_generate(dst_key_t *key, int exp, isc_mem_t *mctx) {
|
||||
int status;
|
||||
B_KEY_OBJ private;
|
||||
@@ -785,7 +785,7 @@ dst_bsafe_generate(dst_key_t *key, int exp, isc_mem_t *mctx) {
|
||||
unsigned char randomSeed[256];
|
||||
isc_buffer_t b, rand;
|
||||
A_RSA_KEY *pub = NULL;
|
||||
dst_result_t ret;
|
||||
isc_result_t ret;
|
||||
|
||||
rsa = (RSA_Key *) isc_mem_get(mctx, sizeof(RSA_Key));
|
||||
if (rsa == NULL)
|
||||
@@ -1019,7 +1019,7 @@ dst_bsafe_key_size(RSA_Key *key)
|
||||
* dst_bsafe_md5digest(): function to digest data using MD5 digest function
|
||||
* if needed
|
||||
*/
|
||||
static dst_result_t
|
||||
static isc_result_t
|
||||
dst_bsafe_md5digest(const unsigned int mode, B_ALGORITHM_OBJ *digest_obj,
|
||||
isc_region_t *data, isc_buffer_t *digest)
|
||||
{
|
||||
|
||||
+22
-22
@@ -17,7 +17,7 @@
|
||||
|
||||
/*
|
||||
* Principal Author: Brian Wellington
|
||||
* $Id: dst_api.c,v 1.20 1999/12/23 00:09:04 explorer Exp $
|
||||
* $Id: dst_api.c,v 1.21 2000/03/06 20:05:58 bwelling Exp $
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
@@ -61,10 +61,10 @@ static void initialize(void);
|
||||
static dst_key_t * get_key_struct(const char *name, const int alg,
|
||||
const int flags, const int protocol,
|
||||
const int bits, isc_mem_t *mctx);
|
||||
static dst_result_t read_public_key(const char *name,
|
||||
static isc_result_t read_public_key(const char *name,
|
||||
const isc_uint16_t id, int in_alg,
|
||||
isc_mem_t *mctx, dst_key_t **keyp);
|
||||
static dst_result_t write_public_key(const dst_key_t *key);
|
||||
static isc_result_t write_public_key(const dst_key_t *key);
|
||||
|
||||
/*
|
||||
* dst_supported_algorithm
|
||||
@@ -106,7 +106,7 @@ dst_supported_algorithm(const int alg) {
|
||||
* ISC_R_SUCCESS Success
|
||||
* !ISC_R_SUCCESS Failure
|
||||
*/
|
||||
dst_result_t
|
||||
isc_result_t
|
||||
dst_sign(const unsigned int mode, dst_key_t *key, dst_context_t *context,
|
||||
isc_region_t *data, isc_buffer_t *sig)
|
||||
{
|
||||
@@ -155,7 +155,7 @@ dst_sign(const unsigned int mode, dst_key_t *key, dst_context_t *context,
|
||||
* !ISC_R_SUCCESS Failure
|
||||
*/
|
||||
|
||||
dst_result_t
|
||||
isc_result_t
|
||||
dst_verify(const unsigned int mode, dst_key_t *key, dst_context_t *context,
|
||||
isc_region_t *data, isc_region_t *sig)
|
||||
{
|
||||
@@ -202,7 +202,7 @@ dst_verify(const unsigned int mode, dst_key_t *key, dst_context_t *context,
|
||||
* ISC_R_SUCCESS Success
|
||||
* !ISC_R_SUCCESS Failure
|
||||
*/
|
||||
dst_result_t
|
||||
isc_result_t
|
||||
dst_digest(const unsigned int mode, const unsigned int alg,
|
||||
dst_context_t *context, isc_region_t *data, isc_buffer_t *digest)
|
||||
{
|
||||
@@ -233,7 +233,7 @@ dst_digest(const unsigned int mode, const unsigned int alg,
|
||||
* ISC_R_SUCCESS Success
|
||||
* !ISC_R_SUCCESS Failure
|
||||
*/
|
||||
dst_result_t
|
||||
isc_result_t
|
||||
dst_computesecret(const dst_key_t *pub, const dst_key_t *priv,
|
||||
isc_buffer_t *secret)
|
||||
{
|
||||
@@ -271,7 +271,7 @@ dst_computesecret(const dst_key_t *pub, const dst_key_t *priv,
|
||||
* ISC_R_SUCCESS Success
|
||||
* !ISC_R_SUCCESS Failure
|
||||
*/
|
||||
dst_result_t
|
||||
isc_result_t
|
||||
dst_key_tofile(const dst_key_t *key, const int type) {
|
||||
int ret = ISC_R_SUCCESS;
|
||||
|
||||
@@ -314,12 +314,12 @@ dst_key_tofile(const dst_key_t *key, const int type) {
|
||||
* ISC_R_SUCCESS Success
|
||||
* !ISC_R_SUCCESS Failure
|
||||
*/
|
||||
dst_result_t
|
||||
isc_result_t
|
||||
dst_key_fromfile(const char *name, const isc_uint16_t id, const int alg,
|
||||
const int type, isc_mem_t *mctx, dst_key_t **keyp)
|
||||
{
|
||||
dst_key_t *key = NULL, *pubkey = NULL;
|
||||
dst_result_t ret;
|
||||
isc_result_t ret;
|
||||
|
||||
RUNTIME_CHECK(isc_once_do(&once, initialize) == ISC_R_SUCCESS);
|
||||
REQUIRE(name != NULL);
|
||||
@@ -376,7 +376,7 @@ dst_key_fromfile(const char *name, const isc_uint16_t id, const int alg,
|
||||
* ISC_R_SUCCESS Success
|
||||
* !ISC_R_SUCCESS Failure
|
||||
*/
|
||||
dst_result_t
|
||||
isc_result_t
|
||||
dst_key_todns(const dst_key_t *key, isc_buffer_t *target) {
|
||||
isc_region_t r;
|
||||
|
||||
@@ -422,14 +422,14 @@ dst_key_todns(const dst_key_t *key, isc_buffer_t *target) {
|
||||
* !ISC_R_SUCCESS Failure
|
||||
*/
|
||||
|
||||
dst_result_t
|
||||
isc_result_t
|
||||
dst_key_fromdns(const char *name, isc_buffer_t *source, isc_mem_t *mctx,
|
||||
dst_key_t **keyp)
|
||||
{
|
||||
isc_region_t r;
|
||||
isc_uint8_t alg, proto;
|
||||
isc_uint32_t flags, extflags;
|
||||
dst_result_t ret;
|
||||
isc_result_t ret;
|
||||
|
||||
RUNTIME_CHECK(isc_once_do(&once, initialize) == ISC_R_SUCCESS);
|
||||
REQUIRE (name != NULL);
|
||||
@@ -482,12 +482,12 @@ dst_key_fromdns(const char *name, isc_buffer_t *source, isc_mem_t *mctx,
|
||||
* ISC_R_SUCCESS Success
|
||||
* !ISC_R_SUCCESS Failure
|
||||
*/
|
||||
dst_result_t
|
||||
isc_result_t
|
||||
dst_key_frombuffer(const char *name, const int alg, const int flags,
|
||||
const int protocol, isc_buffer_t *source, isc_mem_t *mctx,
|
||||
dst_key_t **keyp)
|
||||
{
|
||||
dst_result_t ret;
|
||||
isc_result_t ret;
|
||||
|
||||
RUNTIME_CHECK(isc_once_do(&once, initialize) == ISC_R_SUCCESS);
|
||||
REQUIRE(name != NULL);
|
||||
@@ -521,7 +521,7 @@ dst_key_frombuffer(const char *name, const int alg, const int flags,
|
||||
* ISC_R_SUCCESS Success
|
||||
* !ISC_R_SUCCESS Failure
|
||||
*/
|
||||
dst_result_t
|
||||
isc_result_t
|
||||
dst_key_tobuffer(const dst_key_t *key, isc_buffer_t *target) {
|
||||
RUNTIME_CHECK(isc_once_do(&once, initialize) == ISC_R_SUCCESS);
|
||||
REQUIRE(VALID_KEY(key));
|
||||
@@ -560,12 +560,12 @@ dst_key_tobuffer(const dst_key_t *key, isc_buffer_t *target) {
|
||||
* ISC_R_SUCCESS Success
|
||||
* !ISC_R_SUCCESS Failure
|
||||
*/
|
||||
dst_result_t
|
||||
isc_result_t
|
||||
dst_key_generate(const char *name, const int alg, const int bits,
|
||||
const int exp, const int flags, const int protocol,
|
||||
isc_mem_t *mctx, dst_key_t **keyp)
|
||||
{
|
||||
dst_result_t ret;
|
||||
isc_result_t ret;
|
||||
|
||||
RUNTIME_CHECK(isc_once_do(&once, initialize) == ISC_R_SUCCESS);
|
||||
REQUIRE(name != NULL);
|
||||
@@ -793,7 +793,7 @@ dst_secret_size(const dst_key_t *key, unsigned int *n) {
|
||||
* ISC_R_SUCCESS Success
|
||||
* !ISC_R_SUCCESS Failure
|
||||
*/
|
||||
dst_result_t
|
||||
isc_result_t
|
||||
dst_random_get(const unsigned int wanted, isc_buffer_t *target) {
|
||||
isc_region_t r;
|
||||
|
||||
@@ -910,7 +910,7 @@ get_key_struct(const char *name, const int alg, const int flags,
|
||||
* !ISC_R_SUCCESS Failure
|
||||
*/
|
||||
|
||||
static dst_result_t
|
||||
static isc_result_t
|
||||
read_public_key(const char *name, const isc_uint16_t id, int alg,
|
||||
isc_mem_t *mctx, dst_key_t **keyp)
|
||||
{
|
||||
@@ -1007,7 +1007,7 @@ cleanup:
|
||||
* !ISC_R_SUCCESS Failure
|
||||
*/
|
||||
|
||||
static dst_result_t
|
||||
static isc_result_t
|
||||
write_public_key(const dst_key_t *key) {
|
||||
FILE *fp;
|
||||
isc_buffer_t keyb, textb;
|
||||
@@ -1015,7 +1015,7 @@ write_public_key(const dst_key_t *key) {
|
||||
char filename[ISC_DIR_NAMEMAX];
|
||||
unsigned char key_array[DST_KEY_MAXSIZE];
|
||||
char text_array[DST_KEY_MAXSIZE];
|
||||
dst_result_t ret;
|
||||
isc_result_t ret;
|
||||
isc_result_t dnsret;
|
||||
dns_rdata_t rdata;
|
||||
|
||||
|
||||
@@ -57,27 +57,27 @@ struct dst_key {
|
||||
};
|
||||
|
||||
struct dst_func {
|
||||
dst_result_t (*sign)(const unsigned int mode, dst_key_t *key,
|
||||
isc_result_t (*sign)(const unsigned int mode, dst_key_t *key,
|
||||
void **context, isc_region_t *data,
|
||||
isc_buffer_t *sig, isc_mem_t *mctx);
|
||||
dst_result_t (*verify)(const unsigned int mode, dst_key_t *key,
|
||||
isc_result_t (*verify)(const unsigned int mode, dst_key_t *key,
|
||||
void **context, isc_region_t *data,
|
||||
isc_region_t *sig, isc_mem_t *mctx);
|
||||
dst_result_t (*computesecret)(const dst_key_t *pub,
|
||||
isc_result_t (*computesecret)(const dst_key_t *pub,
|
||||
const dst_key_t *priv,
|
||||
isc_buffer_t *secret);
|
||||
isc_boolean_t (*compare)(const dst_key_t *key1, const dst_key_t *key2);
|
||||
isc_boolean_t (*paramcompare)(const dst_key_t *key1,
|
||||
const dst_key_t *key2);
|
||||
dst_result_t (*generate)(dst_key_t *key, int parms, isc_mem_t *mctx);
|
||||
isc_result_t (*generate)(dst_key_t *key, int parms, isc_mem_t *mctx);
|
||||
isc_boolean_t (*isprivate)(const dst_key_t *key);
|
||||
void (*destroy)(void *key, isc_mem_t *mctx);
|
||||
/* conversion functions */
|
||||
dst_result_t (*to_dns)(const dst_key_t *key, isc_buffer_t *data);
|
||||
dst_result_t (*from_dns)(dst_key_t *key, isc_buffer_t *data,
|
||||
isc_result_t (*to_dns)(const dst_key_t *key, isc_buffer_t *data);
|
||||
isc_result_t (*from_dns)(dst_key_t *key, isc_buffer_t *data,
|
||||
isc_mem_t *mctx);
|
||||
dst_result_t (*to_file)(const dst_key_t *key);
|
||||
dst_result_t (*from_file)(dst_key_t *key, const isc_uint16_t id,
|
||||
isc_result_t (*to_file)(const dst_key_t *key);
|
||||
isc_result_t (*from_file)(dst_key_t *key, const isc_uint16_t id,
|
||||
isc_mem_t *mctx);
|
||||
};
|
||||
|
||||
@@ -107,7 +107,7 @@ int dst_s_build_filename(char *filename, const char *name,
|
||||
|
||||
|
||||
/* digest functions */
|
||||
dst_result_t dst_s_md5(const unsigned int mode, void **context,
|
||||
isc_result_t dst_s_md5(const unsigned int mode, void **context,
|
||||
isc_region_t *data, isc_buffer_t *digest,
|
||||
isc_mem_t *mctx);
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
/*
|
||||
* Principal Author: Brian Wellington
|
||||
* $Id: dst_result.c,v 1.3 1999/09/27 16:55:44 bwelling Exp $
|
||||
* $Id: dst_result.c,v 1.4 2000/03/06 20:05:59 bwelling Exp $
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
@@ -75,7 +75,7 @@ initialize(void) {
|
||||
}
|
||||
|
||||
char *
|
||||
dst_result_totext(dst_result_t result) {
|
||||
dst_result_totext(isc_result_t result) {
|
||||
initialize();
|
||||
|
||||
return (isc_result_totext(result));
|
||||
|
||||
+17
-17
@@ -17,7 +17,7 @@
|
||||
|
||||
/*
|
||||
* Principal Author: Brian Wellington
|
||||
* $Id: hmac_link.c,v 1.15 1999/10/29 05:25:57 marka Exp $
|
||||
* $Id: hmac_link.c,v 1.16 2000/03/06 20:05:59 bwelling Exp $
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
@@ -58,26 +58,26 @@ typedef struct hmackey {
|
||||
|
||||
static struct dst_func hmacmd5_functions;
|
||||
|
||||
static dst_result_t dst_hmacmd5_sign(const unsigned int mode,
|
||||
static isc_result_t dst_hmacmd5_sign(const unsigned int mode,
|
||||
dst_key_t *key,
|
||||
void **context, isc_region_t *data,
|
||||
isc_buffer_t *sig, isc_mem_t *mctx);
|
||||
static dst_result_t dst_hmacmd5_verify(const unsigned int mode,
|
||||
static isc_result_t dst_hmacmd5_verify(const unsigned int mode,
|
||||
dst_key_t *key,
|
||||
void **context, isc_region_t *data,
|
||||
isc_region_t *sig, isc_mem_t *mctx);
|
||||
static isc_boolean_t dst_hmacmd5_compare(const dst_key_t *key1,
|
||||
const dst_key_t *key2);
|
||||
static dst_result_t dst_hmacmd5_generate(dst_key_t *key, int exp,
|
||||
static isc_result_t dst_hmacmd5_generate(dst_key_t *key, int exp,
|
||||
isc_mem_t *mctx);
|
||||
static isc_boolean_t dst_hmacmd5_isprivate(const dst_key_t *key);
|
||||
static void dst_hmacmd5_destroy(void *key, isc_mem_t *mctx);
|
||||
static dst_result_t dst_hmacmd5_to_dns(const dst_key_t *in_key,
|
||||
static isc_result_t dst_hmacmd5_to_dns(const dst_key_t *in_key,
|
||||
isc_buffer_t *data);
|
||||
static dst_result_t dst_hmacmd5_from_dns(dst_key_t *key, isc_buffer_t *data,
|
||||
static isc_result_t dst_hmacmd5_from_dns(dst_key_t *key, isc_buffer_t *data,
|
||||
isc_mem_t *mctx);
|
||||
static dst_result_t dst_hmacmd5_to_file(const dst_key_t *key);
|
||||
static dst_result_t dst_hmacmd5_from_file(dst_key_t *key,
|
||||
static isc_result_t dst_hmacmd5_to_file(const dst_key_t *key);
|
||||
static isc_result_t dst_hmacmd5_from_file(dst_key_t *key,
|
||||
const isc_uint16_t id,
|
||||
isc_mem_t *mctx);
|
||||
|
||||
@@ -122,7 +122,7 @@ dst_s_hmacmd5_init()
|
||||
* ISC_R_SUCCESS Success
|
||||
* !ISC_R_SUCCESS Failure
|
||||
*/
|
||||
static dst_result_t
|
||||
static isc_result_t
|
||||
dst_hmacmd5_sign(const unsigned int mode, dst_key_t *key, void **context,
|
||||
isc_region_t *data, isc_buffer_t *sig, isc_mem_t *mctx)
|
||||
{
|
||||
@@ -187,7 +187,7 @@ dst_hmacmd5_sign(const unsigned int mode, dst_key_t *key, void **context,
|
||||
* ISC_R_SUCCESS Success
|
||||
* !ISC_R_SUCCESS Failure
|
||||
*/
|
||||
static dst_result_t
|
||||
static isc_result_t
|
||||
dst_hmacmd5_verify(const unsigned int mode, dst_key_t *key, void **context,
|
||||
isc_region_t *data, isc_region_t *sig, isc_mem_t *mctx)
|
||||
{
|
||||
@@ -265,7 +265,7 @@ dst_hmacmd5_isprivate(const dst_key_t *key) {
|
||||
* !ISC_R_SUCCESS Failure
|
||||
*/
|
||||
|
||||
static dst_result_t
|
||||
static isc_result_t
|
||||
dst_hmacmd5_to_dns(const dst_key_t *key, isc_buffer_t *data) {
|
||||
HMAC_Key *hkey;
|
||||
isc_region_t r;
|
||||
@@ -300,7 +300,7 @@ dst_hmacmd5_to_dns(const dst_key_t *key, isc_buffer_t *data) {
|
||||
* ISC_R_SUCCESS Success
|
||||
* !ISC_R_SUCCESS Failure
|
||||
*/
|
||||
static dst_result_t
|
||||
static isc_result_t
|
||||
dst_hmacmd5_from_dns(dst_key_t *key, isc_buffer_t *data, isc_mem_t *mctx) {
|
||||
HMAC_Key *hkey;
|
||||
isc_region_t r;
|
||||
@@ -355,7 +355,7 @@ dst_hmacmd5_from_dns(dst_key_t *key, isc_buffer_t *data, isc_mem_t *mctx) {
|
||||
* ISC_R_SUCCESS Success
|
||||
* !ISC_R_SUCCESS Failure
|
||||
*/
|
||||
static dst_result_t
|
||||
static isc_result_t
|
||||
dst_hmacmd5_to_file(const dst_key_t *key) {
|
||||
int i, cnt = 0;
|
||||
HMAC_Key *hkey;
|
||||
@@ -391,10 +391,10 @@ dst_hmacmd5_to_file(const dst_key_t *key) {
|
||||
* !ISC_R_SUCCESS Failure
|
||||
*/
|
||||
|
||||
static dst_result_t
|
||||
static isc_result_t
|
||||
dst_hmacmd5_from_file(dst_key_t *key, const isc_uint16_t id, isc_mem_t *mctx) {
|
||||
dst_private_t priv;
|
||||
dst_result_t ret;
|
||||
isc_result_t ret;
|
||||
isc_buffer_t b;
|
||||
HMAC_Key *hkey = NULL;
|
||||
#define DST_RET(a) {ret = a; goto err;}
|
||||
@@ -450,10 +450,10 @@ dst_hmacmd5_destroy(void *key, isc_mem_t *mctx) {
|
||||
* !ISC_R_SUCCESS Failure
|
||||
*/
|
||||
|
||||
static dst_result_t
|
||||
static isc_result_t
|
||||
dst_hmacmd5_generate(dst_key_t *key, int unused, isc_mem_t *mctx) {
|
||||
isc_buffer_t b;
|
||||
dst_result_t ret;
|
||||
isc_result_t ret;
|
||||
int bytes;
|
||||
unsigned char data[HMAC_LEN];
|
||||
|
||||
|
||||
@@ -79,7 +79,7 @@ dst_supported_algorithm(const int alg);
|
||||
* All allocated memory will be freed after the FINAL call. "sig"
|
||||
* will contain a signature if all operations completed successfully.
|
||||
*/
|
||||
dst_result_t
|
||||
isc_result_t
|
||||
dst_sign(const unsigned int mode, dst_key_t *key, dst_context_t *context,
|
||||
isc_region_t *data, isc_buffer_t *sig);
|
||||
|
||||
@@ -96,7 +96,7 @@ dst_sign(const unsigned int mode, dst_key_t *key, dst_context_t *context,
|
||||
* Ensures:
|
||||
* All allocated memory will be freed after the FINAL call.
|
||||
*/
|
||||
dst_result_t
|
||||
isc_result_t
|
||||
dst_verify(const unsigned int mode, dst_key_t *key, dst_context_t *context,
|
||||
isc_region_t *data, isc_region_t *sig);
|
||||
|
||||
@@ -114,7 +114,7 @@ dst_verify(const unsigned int mode, dst_key_t *key, dst_context_t *context,
|
||||
* All allocated memory will be freed after the FINAL call. "digest"
|
||||
* will contain a digest if all operations completed successfully.
|
||||
*/
|
||||
dst_result_t
|
||||
isc_result_t
|
||||
dst_digest(const unsigned int mode, const unsigned int alg,
|
||||
dst_context_t *context, isc_region_t *data, isc_buffer_t *digest);
|
||||
|
||||
@@ -130,7 +130,7 @@ dst_digest(const unsigned int mode, const unsigned int alg,
|
||||
* Ensures:
|
||||
* If successful, secret will contain the derived shared secret.
|
||||
*/
|
||||
dst_result_t
|
||||
isc_result_t
|
||||
dst_computesecret(const dst_key_t *pub, const dst_key_t *priv,
|
||||
isc_buffer_t *secret);
|
||||
|
||||
@@ -147,7 +147,7 @@ dst_computesecret(const dst_key_t *pub, const dst_key_t *priv,
|
||||
* Ensures:
|
||||
* If successful, *keyp will contain a valid key.
|
||||
*/
|
||||
dst_result_t
|
||||
isc_result_t
|
||||
dst_key_fromfile(const char *name, const isc_uint16_t id, const int alg,
|
||||
const int type, isc_mem_t *mctx, dst_key_t **keyp);
|
||||
|
||||
@@ -157,7 +157,7 @@ dst_key_fromfile(const char *name, const isc_uint16_t id, const int alg,
|
||||
* "key" is a valid key.
|
||||
* "type" is either DST_TYPE_PUBLIC, DST_TYPE_PRIVATE, or both.
|
||||
*/
|
||||
dst_result_t
|
||||
isc_result_t
|
||||
dst_key_tofile(const dst_key_t *key, const int type);
|
||||
|
||||
/* Converts a DNS KEY record into a DST key.
|
||||
@@ -172,7 +172,7 @@ dst_key_tofile(const dst_key_t *key, const int type);
|
||||
* If successful, *keyp will contain a valid key, and the consumed
|
||||
* pointer in data will be advanced.
|
||||
*/
|
||||
dst_result_t
|
||||
isc_result_t
|
||||
dst_key_fromdns(const char *name, isc_buffer_t *source, isc_mem_t *mctx,
|
||||
dst_key_t **keyp);
|
||||
|
||||
@@ -185,7 +185,7 @@ dst_key_fromdns(const char *name, isc_buffer_t *source, isc_mem_t *mctx,
|
||||
* Ensures:
|
||||
* If successful, the used pointer in 'target' is advanced by at least 4.
|
||||
*/
|
||||
dst_result_t
|
||||
isc_result_t
|
||||
dst_key_todns(const dst_key_t *key, isc_buffer_t *target);
|
||||
|
||||
/* Converts a buffer containing DNS KEY RDATA into a DST key.
|
||||
@@ -201,7 +201,7 @@ dst_key_todns(const dst_key_t *key, isc_buffer_t *target);
|
||||
* If successful, *keyp will contain a valid key, and the consumed
|
||||
* pointer in source will be advanced.
|
||||
*/
|
||||
dst_result_t
|
||||
isc_result_t
|
||||
dst_key_frombuffer(const char *name, const int alg, const int flags,
|
||||
const int protocol, isc_buffer_t *source, isc_mem_t *mctx,
|
||||
dst_key_t **keyp);
|
||||
@@ -215,7 +215,7 @@ dst_key_frombuffer(const char *name, const int alg, const int flags,
|
||||
* Ensures:
|
||||
* If successful, the used pointer in 'target' is advanced.
|
||||
*/
|
||||
dst_result_t
|
||||
isc_result_t
|
||||
dst_key_tobuffer(const dst_key_t *key, isc_buffer_t *target);
|
||||
|
||||
/* Generate a DST key (or keypair)
|
||||
@@ -229,7 +229,7 @@ dst_key_tobuffer(const dst_key_t *key, isc_buffer_t *target);
|
||||
* Ensures:
|
||||
* If successful, *keyp will contain a valid key.
|
||||
*/
|
||||
dst_result_t
|
||||
isc_result_t
|
||||
dst_key_generate(const char *name, const int alg, const int bits,
|
||||
const int param, const int flags, const int protocol,
|
||||
isc_mem_t *mctx, dst_key_t **keyp);
|
||||
@@ -324,7 +324,7 @@ dst_secret_size(const dst_key_t *key, unsigned int *n);
|
||||
* <= wanted bytes will be written to "data", and the used pointer will
|
||||
* be advanced.
|
||||
*/
|
||||
dst_result_t
|
||||
isc_result_t
|
||||
dst_random_get(const unsigned int wanted, isc_buffer_t *data);
|
||||
|
||||
ISC_LANG_ENDDECLS
|
||||
|
||||
@@ -7,8 +7,6 @@
|
||||
|
||||
ISC_LANG_BEGINDECLS
|
||||
|
||||
typedef unsigned int dst_result_t;
|
||||
|
||||
#define DST_R_UNSUPPORTEDALG (ISC_RESULTCLASS_DST + 0)
|
||||
#define DST_R_UNSUPPORTEDTYPE (ISC_RESULTCLASS_DST + 1)
|
||||
#define DST_R_UNSUPPORTEDMODE (ISC_RESULTCLASS_DST + 2)
|
||||
@@ -32,7 +30,7 @@ typedef unsigned int dst_result_t;
|
||||
#define DST_R_NRESULTS 19 /* Number of results */
|
||||
|
||||
|
||||
char * dst_result_totext(dst_result_t);
|
||||
char * dst_result_totext(isc_result_t);
|
||||
void dst_result_register(void);
|
||||
|
||||
ISC_LANG_ENDDECLS
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
/*
|
||||
* Principal Author: Brian Wellington
|
||||
* $Id: openssl_link.c,v 1.12 1999/10/29 12:56:57 marka Exp $
|
||||
* $Id: openssl_link.c,v 1.13 2000/03/06 20:06:00 bwelling Exp $
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
@@ -45,26 +45,26 @@
|
||||
|
||||
static struct dst_func openssl_functions;
|
||||
|
||||
static dst_result_t dst_openssl_sign(const unsigned int mode,
|
||||
static isc_result_t dst_openssl_sign(const unsigned int mode,
|
||||
dst_key_t *key,
|
||||
void **context, isc_region_t *data,
|
||||
isc_buffer_t *sig, isc_mem_t *mctx);
|
||||
static dst_result_t dst_openssl_verify(const unsigned int mode,
|
||||
static isc_result_t dst_openssl_verify(const unsigned int mode,
|
||||
dst_key_t *key,
|
||||
void **context, isc_region_t *data,
|
||||
isc_region_t *sig, isc_mem_t *mctx);
|
||||
static isc_boolean_t dst_openssl_compare(const dst_key_t *key1,
|
||||
const dst_key_t *key2);
|
||||
static dst_result_t dst_openssl_generate(dst_key_t *key, int unused,
|
||||
static isc_result_t dst_openssl_generate(dst_key_t *key, int unused,
|
||||
isc_mem_t *mctx);
|
||||
static isc_boolean_t dst_openssl_isprivate(const dst_key_t *key);
|
||||
static void dst_openssl_destroy(void *key, isc_mem_t *mctx);
|
||||
static dst_result_t dst_openssl_to_dns(const dst_key_t *in_key,
|
||||
static isc_result_t dst_openssl_to_dns(const dst_key_t *in_key,
|
||||
isc_buffer_t *data);
|
||||
static dst_result_t dst_openssl_from_dns(dst_key_t *key, isc_buffer_t *data,
|
||||
static isc_result_t dst_openssl_from_dns(dst_key_t *key, isc_buffer_t *data,
|
||||
isc_mem_t *mctx);
|
||||
static dst_result_t dst_openssl_to_file(const dst_key_t *key);
|
||||
static dst_result_t dst_openssl_from_file(dst_key_t *key,
|
||||
static isc_result_t dst_openssl_to_file(const dst_key_t *key);
|
||||
static isc_result_t dst_openssl_from_file(dst_key_t *key,
|
||||
const isc_uint16_t id,
|
||||
isc_mem_t *mctx);
|
||||
|
||||
@@ -113,7 +113,7 @@ dst_s_openssldsa_init() {
|
||||
* ISC_R_SUCCESS Success
|
||||
* !ISC_R_SUCCESS Failure
|
||||
*/
|
||||
static dst_result_t
|
||||
static isc_result_t
|
||||
dst_openssl_sign(const unsigned int mode, dst_key_t *key, void **context,
|
||||
isc_region_t *data, isc_buffer_t *sig, isc_mem_t *mctx)
|
||||
{
|
||||
@@ -185,7 +185,7 @@ dst_openssl_sign(const unsigned int mode, dst_key_t *key, void **context,
|
||||
* ISC_R_SUCCESS Success
|
||||
* !ISC_R_SUCCESS Failure
|
||||
*/
|
||||
static dst_result_t
|
||||
static isc_result_t
|
||||
dst_openssl_verify(const unsigned int mode, dst_key_t *key, void **context,
|
||||
isc_region_t *data, isc_region_t *sig, isc_mem_t *mctx)
|
||||
{
|
||||
@@ -267,7 +267,7 @@ dst_openssl_isprivate(const dst_key_t *key) {
|
||||
* !ISC_R_SUCCESS Failure
|
||||
*/
|
||||
|
||||
static dst_result_t
|
||||
static isc_result_t
|
||||
dst_openssl_to_dns(const dst_key_t *key, isc_buffer_t *data) {
|
||||
DSA *dsa;
|
||||
isc_region_t r;
|
||||
@@ -314,7 +314,7 @@ dst_openssl_to_dns(const dst_key_t *key, isc_buffer_t *data) {
|
||||
* ISC_R_SUCCESS Success
|
||||
* !ISC_R_SUCCESS Failure
|
||||
*/
|
||||
static dst_result_t
|
||||
static isc_result_t
|
||||
dst_openssl_from_dns(dst_key_t *key, isc_buffer_t *data, isc_mem_t *mctx) {
|
||||
DSA *dsa;
|
||||
isc_region_t r;
|
||||
@@ -379,7 +379,7 @@ dst_openssl_from_dns(dst_key_t *key, isc_buffer_t *data, isc_mem_t *mctx) {
|
||||
* ISC_R_SUCCESS Success
|
||||
* !ISC_R_SUCCESS Failure
|
||||
*/
|
||||
static dst_result_t
|
||||
static isc_result_t
|
||||
dst_openssl_to_file(const dst_key_t *key) {
|
||||
int cnt = 0;
|
||||
DSA *dsa;
|
||||
@@ -439,10 +439,10 @@ dst_openssl_to_file(const dst_key_t *key) {
|
||||
* !ISC_R_SUCCESS Failure
|
||||
*/
|
||||
|
||||
static dst_result_t
|
||||
static isc_result_t
|
||||
dst_openssl_from_file(dst_key_t *key, const isc_uint16_t id, isc_mem_t *mctx) {
|
||||
dst_private_t priv;
|
||||
dst_result_t ret;
|
||||
isc_result_t ret;
|
||||
isc_buffer_t dns;
|
||||
isc_region_t r;
|
||||
unsigned char dns_array[1024];
|
||||
@@ -539,13 +539,13 @@ dst_openssl_destroy(void *key, isc_mem_t *mctx) {
|
||||
* !ISC_R_SUCCESS Failure
|
||||
*/
|
||||
|
||||
static dst_result_t
|
||||
static isc_result_t
|
||||
dst_openssl_generate(dst_key_t *key, int unused, isc_mem_t *mctx) {
|
||||
DSA *dsa;
|
||||
unsigned char dns_array[1024];
|
||||
unsigned char rand_array[SHA_DIGEST_LENGTH];
|
||||
isc_buffer_t dns, rand;
|
||||
dst_result_t ret;
|
||||
isc_result_t ret;
|
||||
isc_region_t r;
|
||||
|
||||
unused = unused; /* make the compiler happy */
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
/*
|
||||
* Principal Author: Brian Wellington
|
||||
* $Id: openssldh_link.c,v 1.6 1999/10/29 12:56:57 marka Exp $
|
||||
* $Id: openssldh_link.c,v 1.7 2000/03/06 20:06:00 bwelling Exp $
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
@@ -50,24 +50,24 @@
|
||||
|
||||
static struct dst_func openssldh_functions;
|
||||
|
||||
static dst_result_t dst_openssldh_computesecret(const dst_key_t *pub,
|
||||
static isc_result_t dst_openssldh_computesecret(const dst_key_t *pub,
|
||||
const dst_key_t *priv,
|
||||
isc_buffer_t *secret);
|
||||
static isc_boolean_t dst_openssldh_compare(const dst_key_t *key1,
|
||||
const dst_key_t *key2);
|
||||
static isc_boolean_t dst_openssldh_paramcompare(const dst_key_t *key1,
|
||||
const dst_key_t *key2);
|
||||
static dst_result_t dst_openssldh_generate(dst_key_t *key, int generator,
|
||||
static isc_result_t dst_openssldh_generate(dst_key_t *key, int generator,
|
||||
isc_mem_t *mctx);
|
||||
static isc_boolean_t dst_openssldh_isprivate(const dst_key_t *key);
|
||||
static void dst_openssldh_destroy(void *key, isc_mem_t *mctx);
|
||||
static dst_result_t dst_openssldh_to_dns(const dst_key_t *in_key,
|
||||
static isc_result_t dst_openssldh_to_dns(const dst_key_t *in_key,
|
||||
isc_buffer_t *data);
|
||||
static dst_result_t dst_openssldh_from_dns(dst_key_t *key,
|
||||
static isc_result_t dst_openssldh_from_dns(dst_key_t *key,
|
||||
isc_buffer_t *data,
|
||||
isc_mem_t *mctx);
|
||||
static dst_result_t dst_openssldh_to_file(const dst_key_t *key);
|
||||
static dst_result_t dst_openssldh_from_file(dst_key_t *key,
|
||||
static isc_result_t dst_openssldh_to_file(const dst_key_t *key);
|
||||
static isc_result_t dst_openssldh_from_file(dst_key_t *key,
|
||||
const isc_uint16_t id,
|
||||
isc_mem_t *mctx);
|
||||
|
||||
@@ -120,7 +120,7 @@ dst_s_openssldh_init()
|
||||
* ISC_R_SUCCESS Success
|
||||
* !ISC_R_SUCCESS Failure
|
||||
*/
|
||||
static dst_result_t
|
||||
static isc_result_t
|
||||
dst_openssldh_computesecret(const dst_key_t *pub, const dst_key_t *priv,
|
||||
isc_buffer_t *secret)
|
||||
{
|
||||
@@ -173,7 +173,7 @@ dst_openssldh_isprivate(const dst_key_t *key) {
|
||||
* !ISC_R_SUCCESS Failure
|
||||
*/
|
||||
|
||||
static dst_result_t
|
||||
static isc_result_t
|
||||
dst_openssldh_to_dns(const dst_key_t *key, isc_buffer_t *data) {
|
||||
DH *dh;
|
||||
isc_region_t r;
|
||||
@@ -234,7 +234,7 @@ dst_openssldh_to_dns(const dst_key_t *key, isc_buffer_t *data) {
|
||||
* ISC_R_SUCCESS Success
|
||||
* !ISC_R_SUCCESS Failure
|
||||
*/
|
||||
static dst_result_t
|
||||
static isc_result_t
|
||||
dst_openssldh_from_dns(dst_key_t *key, isc_buffer_t *data, isc_mem_t *mctx) {
|
||||
DH *dh;
|
||||
isc_region_t r;
|
||||
@@ -363,7 +363,7 @@ dst_openssldh_from_dns(dst_key_t *key, isc_buffer_t *data, isc_mem_t *mctx) {
|
||||
* ISC_R_SUCCESS Success
|
||||
* !ISC_R_SUCCESS Failure
|
||||
*/
|
||||
static dst_result_t
|
||||
static isc_result_t
|
||||
dst_openssldh_to_file(const dst_key_t *key) {
|
||||
int cnt = 0;
|
||||
DH *dh;
|
||||
@@ -417,10 +417,10 @@ dst_openssldh_to_file(const dst_key_t *key) {
|
||||
* !ISC_R_SUCCESS Failure
|
||||
*/
|
||||
|
||||
static dst_result_t
|
||||
static isc_result_t
|
||||
dst_openssldh_from_file(dst_key_t *key, const isc_uint16_t id, isc_mem_t *mctx) {
|
||||
dst_private_t priv;
|
||||
dst_result_t ret;
|
||||
isc_result_t ret;
|
||||
isc_buffer_t dns;
|
||||
isc_region_t r;
|
||||
unsigned char dns_array[1024];
|
||||
@@ -535,7 +535,7 @@ dst_openssldh_destroy(void *key, isc_mem_t *mctx) {
|
||||
* !ISC_R_SUCCESS Failure
|
||||
*/
|
||||
|
||||
static dst_result_t
|
||||
static isc_result_t
|
||||
dst_openssldh_generate(dst_key_t *key, int generator, isc_mem_t *mctx) {
|
||||
DH *dh = NULL;
|
||||
unsigned char dns_array[1024];
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
/*
|
||||
* Principal Author: Brian Wellington
|
||||
* $Id: opensslmd5_link.c,v 1.2 1999/10/20 22:14:15 bwelling Exp $
|
||||
* $Id: opensslmd5_link.c,v 1.3 2000/03/06 20:06:01 bwelling Exp $
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
@@ -62,7 +62,7 @@
|
||||
* ISC_R_SUCCESS Success
|
||||
* !ISC_R_SUCCESS Failure
|
||||
*/
|
||||
dst_result_t
|
||||
isc_result_t
|
||||
dst_s_md5(const unsigned int mode, void **context, isc_region_t *data,
|
||||
isc_buffer_t *digest, isc_mem_t *mctx)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user