mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-29 13:38:26 +00:00
2283. [bug] TSIG keys were not attaching to the memory
context. TSIG keys should use the rings memory context rather than the clients memory context. [RT #17377]
This commit is contained in:
parent
114c14f8ad
commit
dc19dcbc23
5
CHANGES
5
CHANGES
@ -1,3 +1,8 @@
|
|||||||
|
2283. [bug] TSIG keys were not attaching to the memory
|
||||||
|
context. TSIG keys should use the rings
|
||||||
|
memory context rather than the clients memory
|
||||||
|
context. [RT #17377]
|
||||||
|
|
||||||
2282. [bug] Acl code fixups. [RT #17346] [RT #17374]
|
2282. [bug] Acl code fixups. [RT #17346] [RT #17374]
|
||||||
|
|
||||||
2281. [bug] Attempts to use undefined acls were not being logged.
|
2281. [bug] Attempts to use undefined acls were not being logged.
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* $Id: tkey.c,v 1.86 2007/06/19 23:47:16 tbox Exp $
|
* $Id: tkey.c,v 1.87 2008/01/02 04:24:59 marka Exp $
|
||||||
*/
|
*/
|
||||||
/*! \file */
|
/*! \file */
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
@ -393,7 +393,7 @@ process_dhtkey(dns_message_t *msg, dns_name_t *signer, dns_name_t *name,
|
|||||||
isc_buffer_base(&secret),
|
isc_buffer_base(&secret),
|
||||||
isc_buffer_usedlength(&secret),
|
isc_buffer_usedlength(&secret),
|
||||||
ISC_TRUE, signer, tkeyin->inception,
|
ISC_TRUE, signer, tkeyin->inception,
|
||||||
tkeyin->expire, msg->mctx, ring, NULL));
|
tkeyin->expire, ring->mctx, ring, NULL));
|
||||||
|
|
||||||
/* This key is good for a long time */
|
/* This key is good for a long time */
|
||||||
tkeyout->inception = tkeyin->inception;
|
tkeyout->inception = tkeyin->inception;
|
||||||
@ -485,7 +485,7 @@ process_gsstkey(dns_message_t *msg, dns_name_t *signer, dns_name_t *name,
|
|||||||
dns_fixedname_name(&principal),
|
dns_fixedname_name(&principal),
|
||||||
tkeyin->inception,
|
tkeyin->inception,
|
||||||
tkeyin->expire,
|
tkeyin->expire,
|
||||||
msg->mctx, ring, NULL));
|
ring->mctx, ring, NULL));
|
||||||
}
|
}
|
||||||
|
|
||||||
isc_stdtime_get(&now);
|
isc_stdtime_get(&now);
|
||||||
@ -1270,7 +1270,7 @@ dns_tkey_processgssresponse(dns_message_t *qmsg, dns_message_t *rmsg,
|
|||||||
RETERR(dns_tsigkey_createfromkey(tkeyname, DNS_TSIG_GSSAPI_NAME,
|
RETERR(dns_tsigkey_createfromkey(tkeyname, DNS_TSIG_GSSAPI_NAME,
|
||||||
dstkey, ISC_FALSE, NULL,
|
dstkey, ISC_FALSE, NULL,
|
||||||
rtkey.inception, rtkey.expire,
|
rtkey.inception, rtkey.expire,
|
||||||
rmsg->mctx, ring, outkey));
|
ring->mctx, ring, outkey));
|
||||||
|
|
||||||
dns_rdata_freestruct(&rtkey);
|
dns_rdata_freestruct(&rtkey);
|
||||||
return (result);
|
return (result);
|
||||||
@ -1405,7 +1405,7 @@ dns_tkey_gssnegotiate(dns_message_t *qmsg, dns_message_t *rmsg,
|
|||||||
: DNS_TSIG_GSSAPI_NAME),
|
: DNS_TSIG_GSSAPI_NAME),
|
||||||
dstkey, ISC_TRUE, NULL,
|
dstkey, ISC_TRUE, NULL,
|
||||||
rtkey.inception, rtkey.expire,
|
rtkey.inception, rtkey.expire,
|
||||||
rmsg->mctx, ring, outkey));
|
ring->mctx, ring, outkey));
|
||||||
|
|
||||||
dns_rdata_freestruct(&rtkey);
|
dns_rdata_freestruct(&rtkey);
|
||||||
return (result);
|
return (result);
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* $Id: tsig.c,v 1.130 2007/09/24 17:18:25 each Exp $
|
* $Id: tsig.c,v 1.131 2008/01/02 04:24:59 marka Exp $
|
||||||
*/
|
*/
|
||||||
/*! \file */
|
/*! \file */
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
@ -341,7 +341,8 @@ dns_tsigkey_createfromkey(dns_name_t *name, dns_name_t *algorithm,
|
|||||||
tkey->generated = generated;
|
tkey->generated = generated;
|
||||||
tkey->inception = inception;
|
tkey->inception = inception;
|
||||||
tkey->expire = expire;
|
tkey->expire = expire;
|
||||||
tkey->mctx = mctx;
|
tkey->mctx = NULL;
|
||||||
|
isc_mem_attach(mctx, &tkey->mctx);
|
||||||
|
|
||||||
tkey->magic = TSIG_MAGIC;
|
tkey->magic = TSIG_MAGIC;
|
||||||
|
|
||||||
@ -603,7 +604,7 @@ tsigkey_free(dns_tsigkey_t *key) {
|
|||||||
isc_mem_put(key->mctx, key->creator, sizeof(dns_name_t));
|
isc_mem_put(key->mctx, key->creator, sizeof(dns_name_t));
|
||||||
}
|
}
|
||||||
isc_refcount_destroy(&key->refs);
|
isc_refcount_destroy(&key->refs);
|
||||||
isc_mem_put(key->mctx, key, sizeof(dns_tsigkey_t));
|
isc_mem_putanddetach(&key->mctx, key, sizeof(dns_tsigkey_t));
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -1525,8 +1526,9 @@ dns_tsigkeyring_create(isc_mem_t *mctx, dns_tsig_keyring_t **ringp) {
|
|||||||
return (result);
|
return (result);
|
||||||
}
|
}
|
||||||
|
|
||||||
ring->mctx = mctx;
|
|
||||||
ring->writecount = 0;
|
ring->writecount = 0;
|
||||||
|
ring->mctx = NULL;
|
||||||
|
isc_mem_attach(mctx, &ring->mctx);
|
||||||
|
|
||||||
*ringp = ring;
|
*ringp = ring;
|
||||||
return (ISC_R_SUCCESS);
|
return (ISC_R_SUCCESS);
|
||||||
@ -1544,5 +1546,5 @@ dns_tsigkeyring_destroy(dns_tsig_keyring_t **ringp) {
|
|||||||
|
|
||||||
dns_rbt_destroy(&ring->keys);
|
dns_rbt_destroy(&ring->keys);
|
||||||
isc_rwlock_destroy(&ring->lock);
|
isc_rwlock_destroy(&ring->lock);
|
||||||
isc_mem_put(ring->mctx, ring, sizeof(dns_tsig_keyring_t));
|
isc_mem_putanddetach(&ring->mctx, ring, sizeof(dns_tsig_keyring_t));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user