From c5de87b0860d7054faeba8fd14e26a6a60f6391f Mon Sep 17 00:00:00 2001 From: Brian Wellington Date: Mon, 15 May 2000 21:30:45 +0000 Subject: [PATCH] bug fixes from the last commit --- lib/dns/sec/dst/bsafe_link.c | 4 ++-- lib/dns/sec/dst/dst_parse.c | 7 ++++--- lib/dns/sec/dst/dst_parse.h | 4 ++-- lib/dns/sec/dst/hmac_link.c | 4 ++-- lib/dns/sec/dst/openssl_link.c | 4 ++-- lib/dns/sec/dst/openssldh_link.c | 4 ++-- 6 files changed, 14 insertions(+), 13 deletions(-) diff --git a/lib/dns/sec/dst/bsafe_link.c b/lib/dns/sec/dst/bsafe_link.c index 35ada0c2df..2aa51087a9 100644 --- a/lib/dns/sec/dst/bsafe_link.c +++ b/lib/dns/sec/dst/bsafe_link.c @@ -19,7 +19,7 @@ /* * Principal Author: Brian Wellington - * $Id: bsafe_link.c,v 1.18 2000/05/15 21:02:27 bwelling Exp $ + * $Id: bsafe_link.c,v 1.19 2000/05/15 21:30:39 bwelling Exp $ */ #if defined(BSAFE) || defined(DNSSAFE) @@ -623,7 +623,7 @@ dst_bsafe_from_file(dst_key_t *key, const isc_uint16_t id, isc_mem_t *mctx) { /* * Read private key file. */ - ret = dst_s_parse_private_key_file(key, &priv, mctx); + ret = dst_s_parse_private_key_file(key, id, &priv, mctx); if (ret != ISC_R_SUCCESS) return (ret); /* diff --git a/lib/dns/sec/dst/dst_parse.c b/lib/dns/sec/dst/dst_parse.c index e38a97ef42..f4f481a13a 100644 --- a/lib/dns/sec/dst/dst_parse.c +++ b/lib/dns/sec/dst/dst_parse.c @@ -19,7 +19,7 @@ /* * Principal Author: Brian Wellington - * $Id: dst_parse.c,v 1.14 2000/05/15 21:02:32 bwelling Exp $ + * $Id: dst_parse.c,v 1.15 2000/05/15 21:30:41 bwelling Exp $ */ #include @@ -187,8 +187,8 @@ dst_s_free_private_structure_fields(dst_private_t *priv, isc_mem_t *mctx) { } int -dst_s_parse_private_key_file(const dst_key_t *key, dst_private_t *priv, - isc_mem_t *mctx) +dst_s_parse_private_key_file(const dst_key_t *key, const isc_uint16_t id, + dst_private_t *priv, isc_mem_t *mctx) { char filename[ISC_DIR_NAMEMAX]; int n = 0, ret, major, minor; @@ -203,6 +203,7 @@ dst_s_parse_private_key_file(const dst_key_t *key, dst_private_t *priv, priv->nelements = 0; isc_buffer_init(&b, filename, sizeof(filename)); + key->key_id = id; ret = dst_key_buildfilename(key, DST_TYPE_PRIVATE, &b); if (ret != ISC_R_SUCCESS) return (ret); diff --git a/lib/dns/sec/dst/dst_parse.h b/lib/dns/sec/dst/dst_parse.h index 6264d8dc43..cc7390eea2 100644 --- a/lib/dns/sec/dst/dst_parse.h +++ b/lib/dns/sec/dst/dst_parse.h @@ -78,8 +78,8 @@ void dst_s_free_private_structure_fields(dst_private_t *priv, isc_mem_t *mctx); int -dst_s_parse_private_key_file(const dst_key_t *key, dst_private_t *priv, - isc_mem_t *mctx); +dst_s_parse_private_key_file(const dst_key_t *key, const isc_uint16_t id, + dst_private_t *priv, isc_mem_t *mctx); int dst_s_write_private_key_file(const dst_key_t *key, const dst_private_t *priv); diff --git a/lib/dns/sec/dst/hmac_link.c b/lib/dns/sec/dst/hmac_link.c index a65790f5a6..c6f3ca00a2 100644 --- a/lib/dns/sec/dst/hmac_link.c +++ b/lib/dns/sec/dst/hmac_link.c @@ -19,7 +19,7 @@ /* * Principal Author: Brian Wellington - * $Id: hmac_link.c,v 1.25 2000/05/15 21:02:35 bwelling Exp $ + * $Id: hmac_link.c,v 1.26 2000/05/15 21:30:43 bwelling Exp $ */ #include @@ -399,7 +399,7 @@ dst_hmacmd5_from_file(dst_key_t *key, const isc_uint16_t id, isc_mem_t *mctx) { #define DST_RET(a) {ret = a; goto err;} /* read private key file */ - ret = dst_s_parse_private_key_file(key, &priv, mctx); + ret = dst_s_parse_private_key_file(key, id, &priv, mctx); if (ret != ISC_R_SUCCESS) return (ret); diff --git a/lib/dns/sec/dst/openssl_link.c b/lib/dns/sec/dst/openssl_link.c index 8592be6109..0926b80289 100644 --- a/lib/dns/sec/dst/openssl_link.c +++ b/lib/dns/sec/dst/openssl_link.c @@ -19,7 +19,7 @@ /* * Principal Author: Brian Wellington - * $Id: openssl_link.c,v 1.22 2000/05/15 21:02:36 bwelling Exp $ + * $Id: openssl_link.c,v 1.23 2000/05/15 21:30:44 bwelling Exp $ */ #if defined(OPENSSL) @@ -450,7 +450,7 @@ dst_openssl_from_file(dst_key_t *key, const isc_uint16_t id, isc_mem_t *mctx) { #define DST_RET(a) {ret = a; goto err;} /* read private key file */ - ret = dst_s_parse_private_key_file(key, &priv, mctx); + ret = dst_s_parse_private_key_file(key, id, &priv, mctx); if (ret != ISC_R_SUCCESS) return (ret); diff --git a/lib/dns/sec/dst/openssldh_link.c b/lib/dns/sec/dst/openssldh_link.c index 49b918b558..6f05be7a39 100644 --- a/lib/dns/sec/dst/openssldh_link.c +++ b/lib/dns/sec/dst/openssldh_link.c @@ -19,7 +19,7 @@ /* * Principal Author: Brian Wellington - * $Id: openssldh_link.c,v 1.15 2000/05/15 21:02:37 bwelling Exp $ + * $Id: openssldh_link.c,v 1.16 2000/05/15 21:30:45 bwelling Exp $ */ #if defined(OPENSSL) @@ -441,7 +441,7 @@ dst_openssldh_from_file(dst_key_t *key, const isc_uint16_t id, #define DST_RET(a) {ret = a; goto err;} /* read private key file */ - ret = dst_s_parse_private_key_file(key, &priv, mctx); + ret = dst_s_parse_private_key_file(key, id, &priv, mctx); if (ret != ISC_R_SUCCESS) return (ret);