/*
* Copyright (C) 2000, 2001, 2004, 2005, 2007, 2009, 2010, 2013-2016, 2018 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: keytable.c,v 1.41 2010/06/25 23:46:51 tbox Exp $ */
/*! \file */
#include <config.h>
#include <isc/refcount.h>
#include <dns/keytable.h>
#include <dns/fixedname.h>
struct dns_keytable {
/* Unlocked. */
unsigned int magic;
/* Locked by rwlock. */
};
struct dns_keynode {
unsigned int magic;
};
static void
}
/*
* Create a keytable.
*/
return (ISC_R_NOMEMORY);
}
if (result != ISC_R_SUCCESS) {
goto cleanup_keytable;
}
if (result != ISC_R_SUCCESS) {
goto cleanup_rbt;
}
if (result != ISC_R_SUCCESS) {
goto cleanup_rwlock;
}
if (result != ISC_R_SUCCESS) {
goto cleanup_active_nodes;
}
return (ISC_R_SUCCESS);
return (result);
}
void
/*
* Attach *targetp to source.
*/
}
void
unsigned int refs;
/*
* Detach *keytablep from its keytable.
*/
if (refs == 0) {
}
}
static isc_result_t
{
if (result != ISC_R_SUCCESS)
return (result);
if (result == ISC_R_EXISTS) {
/* Key already in table? */
dns_keynode_t *k;
break;
}
break;
}
if (k == NULL)
}
if (result == ISC_R_SUCCESS) {
}
}
if (result == ISC_R_SUCCESS) {
}
/* Key was already there? That's the same as a success */
if (result == ISC_R_EXISTS)
return (result);
}
{
}
}
if (result == ISC_R_SUCCESS) {
else
} else if (result == DNS_R_PARTIALMATCH)
return (result);
}
if (result == DNS_R_PARTIALMATCH)
if (result != ISC_R_SUCCESS)
goto finish;
goto finish;
}
{
goto finish;
}
break;
}
/*
* This is equivalent to:
* dns_keynode_attach(knode->next, &tmp);
* dns_keynode_detach(kprev);
* dns_keynode_attach(tmp, &kprev);
* dns_keynode_detach(&tmp);
*/
} else
return (result);
}
{
if (result == ISC_R_SUCCESS) {
} else
} else if (result == DNS_R_PARTIALMATCH)
return (result);
}
{
/*
* Return the next key after 'keynode', regardless of
* properties.
*/
return (ISC_R_NOTFOUND);
return (ISC_R_SUCCESS);
}
{
void *data;
/*
* Search for a key named 'name', matching 'algorithm' and 'tag' in
* 'keytable'.
*/
/*
* Note we don't want the DNS_R_PARTIALMATCH from dns_rbt_findname()
* as that indicates that 'name' was not found.
*
* DNS_R_PARTIALMATCH indicates that the name was found but we
* didn't get a match on algorithm and key id arguments.
*/
if (result == ISC_R_SUCCESS) {
break;
}
break;
}
} else
} else if (result == DNS_R_PARTIALMATCH)
return (result);
}
{
/*
* Search for the next key with the same properties as 'keynode' in
* 'keytable'.
*/
break;
}
break;
}
} else
return (result);
}
{
void *data;
/*
* Search for the deepest match in 'keytable'.
*/
return (result);
}
void
{
/*
* Give back a keynode found via dns_keytable_findkeynode().
*/
}
void
{
/*
* Give back a keynode found via dns_keytable_findkeynode().
*/
}
{
/*
* Is 'name' at or beneath a trusted key?
*/
*wantdnssecp = ISC_TRUE;
} else if (result == ISC_R_NOTFOUND) {
*wantdnssecp = ISC_FALSE;
}
return (result);
}
static isc_result_t
if (result != ISC_R_SUCCESS)
return (result);
isc_buffer_putstr(*b, str);
return (ISC_R_SUCCESS);
}
if (result != ISC_R_SUCCESS)
return (result);
if (isc_buffer_usedlength(text) != 0) {
} else if (result == ISC_R_SUCCESS)
else {
}
(char *) isc_buffer_base(text));
return (result);
}
if (result == ISC_R_NOTFOUND)
goto cleanup;
}
for (;;) {
continue;
if (result != ISC_R_SUCCESS)
break;
}
if (result == ISC_R_NOMORE)
break;
}
}
return (result);
}
void *arg)
{
if (result == ISC_R_NOTFOUND)
goto cleanup;
}
for (;;) {
if (result == ISC_R_NOMORE)
break;
}
}
return (result);
}
/*
* Get the DST key associated with keynode.
*/
}
/*
* Is this a managed key?
*/
}
return (ISC_R_NOMEMORY);
if (result != ISC_R_SUCCESS)
return (result);
return (ISC_R_SUCCESS);
}
void
}
void
unsigned int refs;
if (refs == 0) {
}
}
void
}
}