mirror of
https://github.com/isc-projects/bind9.git
synced 2026-02-25 02:42:33 -05:00
2559. [bug] dnssec-dsfromkey could compute bad DS records when
reading from a K* files. [RT #19357]
This commit is contained in:
parent
bf33eb0b52
commit
52dec6996a
2 changed files with 11 additions and 5 deletions
3
CHANGES
3
CHANGES
|
|
@ -1,3 +1,6 @@
|
|||
2559. [bug] dnssec-dsfromkey could compute bad DS records when
|
||||
reading from a K* files. [RT #19357]
|
||||
|
||||
2558. [func] Set the ownership of missing directories created
|
||||
for pid-file if -u has been specified on the command
|
||||
line. [RT #19328]
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: dnssec-dsfromkey.c,v 1.2 2008/11/07 02:28:49 marka Exp $ */
|
||||
/* $Id: dnssec-dsfromkey.c,v 1.3 2009/02/17 00:16:45 marka Exp $ */
|
||||
|
||||
/*! \file */
|
||||
|
||||
|
|
@ -111,18 +111,18 @@ loadkeys(char *dirname, char *setname)
|
|||
}
|
||||
|
||||
static void
|
||||
loadkey(char *filename, dns_rdata_t *rdata)
|
||||
loadkey(char *filename, unsigned char *key_buf, unsigned int key_buf_size,
|
||||
dns_rdata_t *rdata)
|
||||
{
|
||||
isc_result_t result;
|
||||
dst_key_t *key = NULL;
|
||||
unsigned char key_buf[DST_KEY_MAXSIZE];
|
||||
isc_buffer_t keyb;
|
||||
isc_region_t r;
|
||||
|
||||
dns_rdataset_init(&keyset);
|
||||
dns_rdata_init(rdata);
|
||||
|
||||
isc_buffer_init(&keyb, key_buf, sizeof(key_buf));
|
||||
isc_buffer_init(&keyb, key_buf, key_buf_size);
|
||||
|
||||
result = dst_key_fromnamedfile(filename, DST_TYPE_PUBLIC, mctx, &key);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
|
|
@ -360,7 +360,10 @@ main(int argc, char **argv) {
|
|||
emitds(dtype, &rdata);
|
||||
}
|
||||
} else {
|
||||
loadkey(argv[isc_commandline_index], &rdata);
|
||||
unsigned char key_buf[DST_KEY_MAXSIZE];
|
||||
|
||||
loadkey(argv[isc_commandline_index], key_buf,
|
||||
DST_KEY_MAXSIZE, &rdata);
|
||||
|
||||
if (both) {
|
||||
emitds(DNS_DSDIGEST_SHA1, &rdata);
|
||||
|
|
|
|||
Loading…
Reference in a new issue