From 88d64279bb52913afaeb3f23b394141b6971533a Mon Sep 17 00:00:00 2001 From: Brian Wellington Date: Tue, 6 Nov 2001 22:51:00 +0000 Subject: [PATCH] if the function table entry already exists when _init() is called, don't overwrite it. --- lib/dns/sec/dst/gssapi_link.c | 7 ++++--- lib/dns/sec/dst/hmac_link.c | 7 ++++--- lib/dns/sec/dst/openssldh_link.c | 20 +++++++++++--------- lib/dns/sec/dst/openssldsa_link.c | 7 ++++--- lib/dns/sec/dst/opensslrsa_link.c | 7 ++++--- 5 files changed, 27 insertions(+), 21 deletions(-) diff --git a/lib/dns/sec/dst/gssapi_link.c b/lib/dns/sec/dst/gssapi_link.c index 7cc6088c22..26f6018e7d 100644 --- a/lib/dns/sec/dst/gssapi_link.c +++ b/lib/dns/sec/dst/gssapi_link.c @@ -16,7 +16,7 @@ */ /* - * $Id: gssapi_link.c,v 1.8 2001/11/06 20:47:54 bwelling Exp $ + * $Id: gssapi_link.c,v 1.9 2001/11/06 22:50:55 bwelling Exp $ */ #ifdef GSSAPI @@ -209,8 +209,9 @@ static dst_func_t gssapi_functions = { isc_result_t dst__gssapi_init(dst_func_t **funcp) { - REQUIRE(funcp != NULL && *funcp == NULL); - *funcp = &gssapi_functions; + REQUIRE(funcp != NULL); + if (*funcp == NULL) + *funcp = &gssapi_functions; return (ISC_R_SUCCESS); } diff --git a/lib/dns/sec/dst/hmac_link.c b/lib/dns/sec/dst/hmac_link.c index 03246350f0..decd4babc4 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.55 2001/11/06 20:47:55 bwelling Exp $ + * $Id: hmac_link.c,v 1.56 2001/11/06 22:50:56 bwelling Exp $ */ #include @@ -277,7 +277,8 @@ static dst_func_t hmacmd5_functions = { isc_result_t dst__hmacmd5_init(dst_func_t **funcp) { - REQUIRE(funcp != NULL && *funcp == NULL); - *funcp = &hmacmd5_functions; + REQUIRE(funcp != NULL); + if (*funcp == NULL) + *funcp = &hmacmd5_functions; return (ISC_R_SUCCESS); } diff --git a/lib/dns/sec/dst/openssldh_link.c b/lib/dns/sec/dst/openssldh_link.c index 77d9861f06..7d06022228 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.40 2001/11/06 20:47:57 bwelling Exp $ + * $Id: openssldh_link.c,v 1.41 2001/11/06 22:50:57 bwelling Exp $ */ #ifdef OPENSSL @@ -536,14 +536,16 @@ static dst_func_t openssldh_functions = { isc_result_t dst__openssldh_init(dst_func_t **funcp) { - REQUIRE(funcp != NULL && *funcp == NULL); - BN_init(&bn2); - BN_init(&bn768); - BN_init(&bn1024); - BN_set_word(&bn2, 2); - BN_fromhex(&bn768, PRIME768); - BN_fromhex(&bn1024, PRIME1024); - *funcp = &openssldh_functions; + REQUIRE(funcp != NULL); + if (*funcp == NULL) { + BN_init(&bn2); + BN_init(&bn768); + BN_init(&bn1024); + BN_set_word(&bn2, 2); + BN_fromhex(&bn768, PRIME768); + BN_fromhex(&bn1024, PRIME1024); + *funcp = &openssldh_functions; + } return (ISC_R_SUCCESS); } diff --git a/lib/dns/sec/dst/openssldsa_link.c b/lib/dns/sec/dst/openssldsa_link.c index 32fa0e5761..d2183d71d0 100644 --- a/lib/dns/sec/dst/openssldsa_link.c +++ b/lib/dns/sec/dst/openssldsa_link.c @@ -17,7 +17,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: openssldsa_link.c,v 1.6 2001/11/06 20:47:58 bwelling Exp $ */ +/* $Id: openssldsa_link.c,v 1.7 2001/11/06 22:51:00 bwelling Exp $ */ #ifdef OPENSSL @@ -429,8 +429,9 @@ static dst_func_t openssldsa_functions = { isc_result_t dst__openssldsa_init(dst_func_t **funcp) { - REQUIRE(funcp != NULL && *funcp == NULL); - *funcp = &openssldsa_functions; + REQUIRE(funcp != NULL); + if (*funcp == NULL) + *funcp = &openssldsa_functions; return (ISC_R_SUCCESS); } diff --git a/lib/dns/sec/dst/opensslrsa_link.c b/lib/dns/sec/dst/opensslrsa_link.c index 052e85dff6..fa09a45113 100644 --- a/lib/dns/sec/dst/opensslrsa_link.c +++ b/lib/dns/sec/dst/opensslrsa_link.c @@ -17,7 +17,7 @@ /* * Principal Author: Brian Wellington - * $Id: opensslrsa_link.c,v 1.15 2001/11/06 20:47:59 bwelling Exp $ + * $Id: opensslrsa_link.c,v 1.16 2001/11/06 22:50:58 bwelling Exp $ */ #ifdef OPENSSL @@ -512,8 +512,9 @@ static dst_func_t opensslrsa_functions = { isc_result_t dst__opensslrsa_init(dst_func_t **funcp) { - REQUIRE(funcp != NULL && *funcp == NULL); - *funcp = &opensslrsa_functions; + REQUIRE(funcp != NULL); + if (*funcp == NULL) + *funcp = &opensslrsa_functions; return (ISC_R_SUCCESS); }