1654. [bug] isc_result_totext() contained array bounds read
error.
1653. [func] Add key type checking to dst_key_fromfilename(),
DST_TYPE_KEY should be used to read TSIG, TKEY and
SIG(0) keys.
1652. [bug] TKEY still uses KEY.
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: keycreate.c,v 1.7.12.4 2004/03/08 09:04:17 marka Exp $ */
|
||||
/* $Id: keycreate.c,v 1.7.12.5 2004/06/11 00:30:53 marka Exp $ */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
@@ -75,6 +75,7 @@ recvquery(isc_task_t *task, isc_event_t *event) {
|
||||
dns_message_t *query, *response;
|
||||
char keyname[256];
|
||||
isc_buffer_t keynamebuf;
|
||||
int type;
|
||||
|
||||
UNUSED(task);
|
||||
|
||||
@@ -115,8 +116,8 @@ recvquery(isc_task_t *task, isc_event_t *event) {
|
||||
CHECK("dst_key_buildfilename", result);
|
||||
printf("%.*s\n", (int)isc_buffer_usedlength(&keynamebuf),
|
||||
(char *)isc_buffer_base(&keynamebuf));
|
||||
result = dst_key_tofile(tsigkey->key,
|
||||
DST_TYPE_PRIVATE | DST_TYPE_PUBLIC, "");
|
||||
type = DST_TYPE_PRIVATE | DST_TYPE_PUBLIC | DST_TYPE_KEY;
|
||||
result = dst_key_tofile(tsigkey->key, type, "");
|
||||
CHECK("dst_key_tofile", result);
|
||||
|
||||
dns_message_destroy(&query);
|
||||
@@ -209,6 +210,7 @@ main(int argc, char *argv[]) {
|
||||
isc_logconfig_t *logconfig;
|
||||
isc_task_t *task;
|
||||
isc_result_t result;
|
||||
int type;
|
||||
|
||||
RUNCHECK(isc_app_start());
|
||||
|
||||
@@ -280,9 +282,8 @@ main(int argc, char *argv[]) {
|
||||
RUNCHECK(isc_app_onrun(mctx, task, sendquery, NULL));
|
||||
|
||||
ourkey = NULL;
|
||||
result = dst_key_fromnamedfile(ourkeyname,
|
||||
DST_TYPE_PUBLIC | DST_TYPE_PRIVATE,
|
||||
mctx, &ourkey);
|
||||
type = DST_TYPE_PUBLIC | DST_TYPE_PRIVATE | DST_TYPE_KEY;
|
||||
result = dst_key_fromnamedfile(ourkeyname, type, mctx, &ourkey);
|
||||
CHECK("dst_key_fromnamedfile", result);
|
||||
|
||||
isc_buffer_init(&nonce, noncedata, sizeof(noncedata));
|
||||
|
||||
Reference in New Issue
Block a user