dnsconf.c revision 0c27b3fe77ac1d5094ba3521e8142d9e7973133f
/*
* Copyright (C) 2009, 2012, 2016 Internet Systems Consortium, Inc. ("ISC")
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
/* $Id: dnsconf.c,v 1.3 2009/09/02 23:48:02 tbox Exp $ */
/*! \file */
#include <config.h>
#include <string.h>
#include <dns/fixedname.h>
#include <dns/rdatastruct.h>
/*!
* configuration data structure
*/
struct irs_dnsconf {
unsigned int magic;
};
static isc_result_t
{
const char *keystr, *keynamestr;
unsigned char keydata[4096];
unsigned char rrdata[4096];
isc_region_t r;
return (ISC_R_SUCCESS);
{
keydatabuf = NULL;
"protocol"));
"algorithm"));
"name"));
if (flags > 0xffff)
return (ISC_R_RANGE);
if (proto > 0xff)
return (ISC_R_RANGE);
if (alg > 0xff)
return (ISC_R_RANGE);
sizeof(keydata));
/* Configure key value */
if (result != ISC_R_SUCCESS)
return (result);
if (result != ISC_R_SUCCESS)
return (result);
isc_buffer_usedregion(&rrdatabuf, &r);
r.length);
if (result != ISC_R_SUCCESS)
return (result);
if (result != ISC_R_SUCCESS)
goto cleanup;
/* Configure key name */
strlen(keynamestr));
dns_rootname, 0, NULL);
if (result != ISC_R_SUCCESS)
return (result);
goto cleanup;
}
if (result != ISC_R_SUCCESS)
goto cleanup;
/* Add the key data to the list */
goto cleanup;
}
}
}
return (ISC_R_SUCCESS);
if (keydatabuf != NULL)
return (result);
}
{
return (ISC_R_NOMEMORY);
/*
* If the specified file does not exist, we'll simply with an empty
* configuration.
*/
if (!isc_file_exists(filename))
goto cleanup;
if (result != ISC_R_SUCCESS)
goto cleanup;
&cfgobj);
if (result != ISC_R_SUCCESS)
goto cleanup;
}
if (result == ISC_R_SUCCESS)
else
return (result);
}
void
}
}
return (&conf->trusted_keylist);
}