mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-09-01 23:25:38 +00:00
3
CHANGES
3
CHANGES
@@ -1,3 +1,6 @@
|
|||||||
|
4175. [bug] TKEY with GSS-API keys needed bigger buffers.
|
||||||
|
[RT #40333]
|
||||||
|
|
||||||
4174. [bug] "dnssec-coverage -r" didn't handle time unit
|
4174. [bug] "dnssec-coverage -r" didn't handle time unit
|
||||||
suffixes correctly. [RT #38444]
|
suffixes correctly. [RT #38444]
|
||||||
|
|
||||||
|
@@ -633,7 +633,6 @@ dst_gssapi_initctx(dns_name_t *name, isc_buffer_t *intoken,
|
|||||||
if (gouttoken.length != 0U) {
|
if (gouttoken.length != 0U) {
|
||||||
GBUFFER_TO_REGION(gouttoken, r);
|
GBUFFER_TO_REGION(gouttoken, r);
|
||||||
RETERR(isc_buffer_copyregion(outtoken, &r));
|
RETERR(isc_buffer_copyregion(outtoken, &r));
|
||||||
(void)gss_release_buffer(&minor, &gouttoken);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gret == GSS_S_COMPLETE)
|
if (gret == GSS_S_COMPLETE)
|
||||||
@@ -642,6 +641,8 @@ dst_gssapi_initctx(dns_name_t *name, isc_buffer_t *intoken,
|
|||||||
result = DNS_R_CONTINUE;
|
result = DNS_R_CONTINUE;
|
||||||
|
|
||||||
out:
|
out:
|
||||||
|
if (gouttoken.length != 0U)
|
||||||
|
(void)gss_release_buffer(&minor, &gouttoken);
|
||||||
(void)gss_release_name(&minor, &gname);
|
(void)gss_release_name(&minor, &gname);
|
||||||
return (result);
|
return (result);
|
||||||
#else
|
#else
|
||||||
|
@@ -15,9 +15,6 @@
|
|||||||
* PERFORMANCE OF THIS SOFTWARE.
|
* PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
|
||||||
* $Id$
|
|
||||||
*/
|
|
||||||
/*! \file */
|
/*! \file */
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
|
||||||
@@ -48,6 +45,7 @@
|
|||||||
|
|
||||||
#include "dst_internal.h"
|
#include "dst_internal.h"
|
||||||
|
|
||||||
|
#define TEMP_BUFFER_SZ 8192
|
||||||
#define TKEY_RANDOM_AMOUNT 16
|
#define TKEY_RANDOM_AMOUNT 16
|
||||||
|
|
||||||
#ifdef PKCS11CRYPTO
|
#ifdef PKCS11CRYPTO
|
||||||
@@ -74,19 +72,38 @@ tkey_log(const char *fmt, ...) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_dns_tkey_dumpmessage(dns_message_t *msg) {
|
dumpmessage(dns_message_t *msg) {
|
||||||
isc_buffer_t outbuf;
|
isc_buffer_t outbuf;
|
||||||
unsigned char output[4096];
|
unsigned char *output;
|
||||||
|
int len = TEMP_BUFFER_SZ;
|
||||||
isc_result_t result;
|
isc_result_t result;
|
||||||
|
|
||||||
isc_buffer_init(&outbuf, output, sizeof(output));
|
for (;;) {
|
||||||
result = dns_message_totext(msg, &dns_master_style_debug, 0,
|
output = isc_mem_get(msg->mctx, len);
|
||||||
&outbuf);
|
if (output == NULL)
|
||||||
if (result != ISC_R_SUCCESS)
|
return;
|
||||||
fprintf(stderr, "Warning: dns_message_totext returned: %s\n",
|
|
||||||
dns_result_totext(result));
|
isc_buffer_init(&outbuf, output, len);
|
||||||
fprintf(stderr, "%.*s\n", (int)isc_buffer_usedlength(&outbuf),
|
result = dns_message_totext(msg, &dns_master_style_debug,
|
||||||
(char *)isc_buffer_base(&outbuf));
|
0, &outbuf);
|
||||||
|
if (result == ISC_R_NOSPACE) {
|
||||||
|
isc_mem_put(msg->mctx, output, len);
|
||||||
|
len *= 2;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (result == ISC_R_SUCCESS)
|
||||||
|
tkey_log("%.*s",
|
||||||
|
(int)isc_buffer_usedlength(&outbuf),
|
||||||
|
(char *)isc_buffer_base(&outbuf));
|
||||||
|
else
|
||||||
|
tkey_log("Warning: dns_message_totext: %s",
|
||||||
|
dns_result_totext(result));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (output != NULL)
|
||||||
|
isc_mem_put(msg->mctx, output, len);
|
||||||
}
|
}
|
||||||
|
|
||||||
isc_result_t
|
isc_result_t
|
||||||
@@ -866,6 +883,7 @@ buildquery(dns_message_t *msg, dns_name_t *name,
|
|||||||
dns_rdata_t *rdata = NULL;
|
dns_rdata_t *rdata = NULL;
|
||||||
isc_buffer_t *dynbuf = NULL, *anamebuf = NULL, *qnamebuf = NULL;
|
isc_buffer_t *dynbuf = NULL, *anamebuf = NULL, *qnamebuf = NULL;
|
||||||
isc_result_t result;
|
isc_result_t result;
|
||||||
|
unsigned int len;
|
||||||
|
|
||||||
REQUIRE(msg != NULL);
|
REQUIRE(msg != NULL);
|
||||||
REQUIRE(name != NULL);
|
REQUIRE(name != NULL);
|
||||||
@@ -878,9 +896,10 @@ buildquery(dns_message_t *msg, dns_name_t *name,
|
|||||||
dns_rdataset_makequestion(question, dns_rdataclass_any,
|
dns_rdataset_makequestion(question, dns_rdataclass_any,
|
||||||
dns_rdatatype_tkey);
|
dns_rdatatype_tkey);
|
||||||
|
|
||||||
RETERR(isc_buffer_allocate(msg->mctx, &dynbuf, 4096));
|
len = 16 + tkey->algorithm.length + tkey->keylen + tkey->otherlen;
|
||||||
RETERR(isc_buffer_allocate(msg->mctx, &anamebuf, DNS_NAME_MAXWIRE));
|
RETERR(isc_buffer_allocate(msg->mctx, &dynbuf, len));
|
||||||
RETERR(isc_buffer_allocate(msg->mctx, &qnamebuf, DNS_NAME_MAXWIRE));
|
RETERR(isc_buffer_allocate(msg->mctx, &anamebuf, name->length));
|
||||||
|
RETERR(isc_buffer_allocate(msg->mctx, &qnamebuf, name->length));
|
||||||
RETERR(dns_message_gettemprdata(msg, &rdata));
|
RETERR(dns_message_gettemprdata(msg, &rdata));
|
||||||
|
|
||||||
RETERR(dns_rdata_fromstruct(rdata, dns_rdataclass_any,
|
RETERR(dns_rdata_fromstruct(rdata, dns_rdataclass_any,
|
||||||
@@ -896,10 +915,10 @@ buildquery(dns_message_t *msg, dns_name_t *name,
|
|||||||
RETERR(dns_rdatalist_tordataset(tkeylist, tkeyset));
|
RETERR(dns_rdatalist_tordataset(tkeylist, tkeyset));
|
||||||
|
|
||||||
dns_name_init(qname, NULL);
|
dns_name_init(qname, NULL);
|
||||||
dns_name_copy(name, qname, qnamebuf);
|
RETERR(dns_name_copy(name, qname, qnamebuf));
|
||||||
|
|
||||||
dns_name_init(aname, NULL);
|
dns_name_init(aname, NULL);
|
||||||
dns_name_copy(name, aname, anamebuf);
|
RETERR(dns_name_copy(name, aname, anamebuf));
|
||||||
|
|
||||||
ISC_LIST_APPEND(qname->list, question, link);
|
ISC_LIST_APPEND(qname->list, question, link);
|
||||||
ISC_LIST_APPEND(aname->list, tkeyset, link);
|
ISC_LIST_APPEND(aname->list, tkeyset, link);
|
||||||
@@ -934,7 +953,6 @@ buildquery(dns_message_t *msg, dns_name_t *name,
|
|||||||
isc_buffer_free(&qnamebuf);
|
isc_buffer_free(&qnamebuf);
|
||||||
if (anamebuf != NULL)
|
if (anamebuf != NULL)
|
||||||
isc_buffer_free(&anamebuf);
|
isc_buffer_free(&anamebuf);
|
||||||
printf("buildquery error\n");
|
|
||||||
return (result);
|
return (result);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1026,7 +1044,7 @@ dns_tkey_buildgssquery(dns_message_t *msg, dns_name_t *name, dns_name_t *gname,
|
|||||||
isc_result_t result;
|
isc_result_t result;
|
||||||
isc_stdtime_t now;
|
isc_stdtime_t now;
|
||||||
isc_buffer_t token;
|
isc_buffer_t token;
|
||||||
unsigned char array[4096];
|
unsigned char array[TEMP_BUFFER_SZ];
|
||||||
|
|
||||||
UNUSED(intoken);
|
UNUSED(intoken);
|
||||||
|
|
||||||
@@ -1063,12 +1081,7 @@ dns_tkey_buildgssquery(dns_message_t *msg, dns_name_t *name, dns_name_t *gname,
|
|||||||
tkey.other = NULL;
|
tkey.other = NULL;
|
||||||
tkey.otherlen = 0;
|
tkey.otherlen = 0;
|
||||||
|
|
||||||
RETERR(buildquery(msg, name, &tkey, win2k));
|
return (buildquery(msg, name, &tkey, win2k));
|
||||||
|
|
||||||
return (ISC_R_SUCCESS);
|
|
||||||
|
|
||||||
failure:
|
|
||||||
return (result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
isc_result_t
|
isc_result_t
|
||||||
@@ -1298,8 +1311,8 @@ dns_tkey_processgssresponse(dns_message_t *qmsg, dns_message_t *rmsg,
|
|||||||
!dns_name_equal(&rtkey.algorithm, &qtkey.algorithm)) {
|
!dns_name_equal(&rtkey.algorithm, &qtkey.algorithm)) {
|
||||||
tkey_log("dns_tkey_processgssresponse: tkey mode invalid "
|
tkey_log("dns_tkey_processgssresponse: tkey mode invalid "
|
||||||
"or error set(2) %d", rtkey.error);
|
"or error set(2) %d", rtkey.error);
|
||||||
_dns_tkey_dumpmessage(qmsg);
|
dumpmessage(qmsg);
|
||||||
_dns_tkey_dumpmessage(rmsg);
|
dumpmessage(rmsg);
|
||||||
result = DNS_R_INVALIDTKEY;
|
result = DNS_R_INVALIDTKEY;
|
||||||
goto failure;
|
goto failure;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user