ds.c revision e20788e1216ed720aefa84f3295f7899d9f28c22
/*
* Copyright (C) 2004-2007, 2010, 2012, 2014 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 2002, 2003 Internet Software Consortium.
*
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
* REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
* LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
* OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: ds.c,v 1.13 2010/12/23 23:47:08 tbox Exp $ */
/*! \file */
#include <config.h>
#include <string.h>
#include <dns/fixedname.h>
#include <dns/rdatastruct.h>
#if defined(HAVE_OPENSSL_GOST) || defined(HAVE_PKCS11_GOST)
#include "dst_gost.h"
#endif
unsigned int digest_type, unsigned char *buffer,
{
unsigned char digest[ISC_SHA384_DIGESTLENGTH];
isc_region_t r;
isc_buffer_t b;
#if defined(HAVE_OPENSSL_GOST) || defined(HAVE_PKCS11_GOST)
#endif
return (ISC_R_NOTIMPLEMENTED);
switch (digest_type) {
case DNS_DSDIGEST_SHA1:
dns_name_toregion(name, &r);
dns_rdata_toregion(key, &r);
break;
#if defined(HAVE_OPENSSL_GOST) || defined(HAVE_PKCS11_GOST)
#define RETERR(x) do { \
isc_result_t ret = (x); \
if (ret != ISC_R_SUCCESS) { \
isc_gost_invalidate(&gost); \
return (ret); \
} \
} while (0)
case DNS_DSDIGEST_GOST:
dns_name_toregion(name, &r);
dns_rdata_toregion(key, &r);
break;
#endif
case DNS_DSDIGEST_SHA384:
dns_name_toregion(name, &r);
dns_rdata_toregion(key, &r);
break;
case DNS_DSDIGEST_SHA256:
default:
dns_name_toregion(name, &r);
dns_rdata_toregion(key, &r);
break;
}
switch (digest_type) {
case DNS_DSDIGEST_SHA1:
break;
#if defined(HAVE_OPENSSL_GOST) || defined(HAVE_PKCS11_GOST)
case DNS_DSDIGEST_GOST:
break;
#endif
case DNS_DSDIGEST_SHA384:
break;
case DNS_DSDIGEST_SHA256:
default:
break;
}
&ds, &b));
}