* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: nsupdate.c,v 1.173.66.8 2010/08/10 23:47:45 tbox Exp $ */
+/* $Id: nsupdate.c,v 1.186 2010/12/09 04:31:57 tbox Exp $ */
/*! \file */
debug("Creating key...");
+ if (sig0key != NULL)
+ dst_key_free(&sig0key);
+
/* Try reading the key from a K* pair */
result = dst_key_fromnamedfile(keyfile, NULL,
DST_TYPE_PRIVATE | DST_TYPE_KEY, mctx,
hmacname, dstkey, ISC_FALSE,
NULL, 0, 0, mctx, NULL,
&tsigkey);
+ dst_key_free(&dstkey);
if (result != ISC_R_SUCCESS) {
fprintf(stderr, "could not create key from %s: %s\n",
keyfile, isc_result_totext(result));
- dst_key_free(&dstkey);
return;
}
} else
- sig0key = dstkey;
+ dst_key_attach(dstkey, &sig0key);
}
static void
if (keystr != NULL)
setup_keystr();
- else if (local_only)
- read_sessionkey(mctx, lctx);
- else if (keyfile != NULL)
+ else if (local_only) {
+ result = read_sessionkey(mctx, lctx);
+ if (result != ISC_R_SUCCESS)
+ fatal("can't read key from %s: %s\n",
+ keyfile, isc_result_totext(result));
+ } else if (keyfile != NULL)
setup_keyfile(mctx, lctx);
}
{
isc_result_t result;
dns_request_t *request = NULL;
- unsigned int options = 0;
+ unsigned int options = DNS_REQUESTOPT_CASE;
ddebug("send_update()");