mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-31 06:25:31 +00:00
2976. [bug] named die on exit after negotiating a GSS-TSIG key. [RT #3415]
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: tsig.c,v 1.141 2010/07/09 05:13:15 each Exp $
|
||||
* $Id: tsig.c,v 1.142 2010/12/02 23:22:42 marka Exp $
|
||||
*/
|
||||
/*! \file */
|
||||
#include <config.h>
|
||||
@@ -287,7 +287,7 @@ keyring_add(dns_tsig_keyring_t *ring, dns_name_t *name,
|
||||
|
||||
isc_result_t
|
||||
dns_tsigkey_createfromkey(dns_name_t *name, dns_name_t *algorithm,
|
||||
dst_key_t *dstkey, isc_boolean_t generated,
|
||||
dst_key_t **dstkeyp, isc_boolean_t generated,
|
||||
dns_name_t *creator, isc_stdtime_t inception,
|
||||
isc_stdtime_t expire, isc_mem_t *mctx,
|
||||
dns_tsig_keyring_t *ring, dns_tsigkey_t **key)
|
||||
@@ -295,6 +295,7 @@ dns_tsigkey_createfromkey(dns_name_t *name, dns_name_t *algorithm,
|
||||
dns_tsigkey_t *tkey;
|
||||
isc_result_t ret;
|
||||
unsigned int refs = 0;
|
||||
dst_key_t *dstkey;
|
||||
|
||||
REQUIRE(key == NULL || *key == NULL);
|
||||
REQUIRE(name != NULL);
|
||||
@@ -302,6 +303,10 @@ dns_tsigkey_createfromkey(dns_name_t *name, dns_name_t *algorithm,
|
||||
REQUIRE(mctx != NULL);
|
||||
REQUIRE(key != NULL || ring != NULL);
|
||||
|
||||
if (dstkeyp != NULL)
|
||||
dstkey = *dstkeyp;
|
||||
else
|
||||
dstkey = NULL;
|
||||
tkey = (dns_tsigkey_t *) isc_mem_get(mctx, sizeof(dns_tsigkey_t));
|
||||
if (tkey == NULL)
|
||||
return (ISC_R_NOMEMORY);
|
||||
@@ -436,6 +441,8 @@ dns_tsigkey_createfromkey(dns_name_t *name, dns_name_t *algorithm,
|
||||
namestr);
|
||||
}
|
||||
|
||||
if (dstkeyp != NULL)
|
||||
*dstkeyp = NULL;
|
||||
if (key != NULL)
|
||||
*key = tkey;
|
||||
|
||||
@@ -623,7 +630,7 @@ dns_tsigkey_create(dns_name_t *name, dns_name_t *algorithm,
|
||||
} else if (length > 0)
|
||||
return (DNS_R_BADALG);
|
||||
|
||||
result = dns_tsigkey_createfromkey(name, algorithm, dstkey,
|
||||
result = dns_tsigkey_createfromkey(name, algorithm, &dstkey,
|
||||
generated, creator,
|
||||
inception, expire, mctx, ring, key);
|
||||
if (result != ISC_R_SUCCESS && dstkey != NULL)
|
||||
|
Reference in New Issue
Block a user