0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews * Copyright (C) 1999-2001, 2004-2007, 2009, 2010, 2012, 2014, 2016 Internet Systems Consortium, Inc. ("ISC")
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews * This Source Code Form is subject to the terms of the Mozilla Public
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews * License, v. 2.0. If a copy of the MPL was not distributed with this
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews * file, You can obtain one at http://mozilla.org/MPL/2.0/.
ca103999e64da0b16bb8b30589408f1556264dceAutomatic Updater/* $Id: tkeyconf.c,v 1.33 2010/12/20 23:47:20 tbox Exp $ */
6028d1ce0380d0ba7f6c6ecd1ad20b31ddd1becbDavid Lawrence#include <isc/string.h> /* Required for HP/UX (and others?) */
45e1bd63587102c3bb361eaca42ee7b714fb3542Mark Andrewsns_tkeyctx_fromconfig(const cfg_obj_t *options, isc_mem_t *mctx,
4e1d3e67cdc76609bad5f0310ac48de10b442b9fMark Andrews const char *s;
14c5931d3d52baf17a786153c35c05fa62f916dcBrian Wellington result = dns_tkeyctx_create(mctx, ectx, &tctx);
90c099e88e9f16bfee9edee3ac1a51fc98843772Brian Wellington result = cfg_map_get(options, "tkey-dhkey", &obj);
90c099e88e9f16bfee9edee3ac1a51fc98843772Brian Wellington s = cfg_obj_asstring(cfg_tuple_get(obj, "name"));
90c099e88e9f16bfee9edee3ac1a51fc98843772Brian Wellington n = cfg_obj_asuint32(cfg_tuple_get(obj, "keyid"));
307d2084502eddc7ce921e5ce439aec3531d90e0Tatuya JINMEI 神明達哉 RETERR(dns_name_fromtext(name, &b, dns_rootname, 0, NULL));
23fdb6a5a3d3d0e427682b68eea9553d2d326ad4Mark Andrews type = DST_TYPE_PUBLIC|DST_TYPE_PRIVATE|DST_TYPE_KEY;
a14762f207c36eb0171328802a570ceeddef581dDanny Mayer RETERR(dst_key_fromfile(name, (dns_keytag_t) n, DNS_KEYALG_DH,
90c099e88e9f16bfee9edee3ac1a51fc98843772Brian Wellington result = cfg_map_get(options, "tkey-domain", &obj);
307d2084502eddc7ce921e5ce439aec3531d90e0Tatuya JINMEI 神明達哉 RETERR(dns_name_fromtext(name, &b, dns_rootname, 0, NULL));
909e3c228813f05bcdebf403a69ed18406f86ec4Brian Wellington tctx->domain = isc_mem_get(mctx, sizeof(dns_name_t));
909e3c228813f05bcdebf403a69ed18406f86ec4Brian Wellington RETERR(dns_name_dup(name, mctx, tctx->domain));
90c099e88e9f16bfee9edee3ac1a51fc98843772Brian Wellington result = cfg_map_get(options, "tkey-gssapi-credential", &obj);
307d2084502eddc7ce921e5ce439aec3531d90e0Tatuya JINMEI 神明達哉 RETERR(dns_name_fromtext(name, &b, dns_rootname, 0, NULL));
307d2084502eddc7ce921e5ce439aec3531d90e0Tatuya JINMEI 神明達哉 RETERR(dst_gssapi_acquirecred(name, ISC_FALSE, &tctx->gsscred));
71bd858d8ed62672e7c23999dc7c02fd16a55089Evan Hunt result = cfg_map_get(options, "tkey-gssapi-keytab", &obj);