dst_internal.h revision 78608b0a454246d0e1e0169f1d671b8427e48199
/*
* Portions Copyright (C) 2000-2002, 2004-2014, 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/.
*
* Portions Copyright (C) 1995-2000 by Network Associates, Inc.
*
* 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 AND NETWORK ASSOCIATES 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: dst_internal.h,v 1.31 2011/10/20 21:20:02 marka Exp $ */
#ifndef DST_DST_INTERNAL_H
#define DST_DST_INTERNAL_H 1
#include <isc/refcount.h>
#ifdef OPENSSL
#ifndef PK11_DH_DISABLE
#endif
#ifndef PK11_DSA_DISABLE
#endif
#endif
/***
*** Types
***/
typedef struct dst_func dst_func_t;
#ifndef PK11_MD5_DISABLE
typedef struct dst_hmacmd5_key dst_hmacmd5_key_t;
#endif
typedef struct dst_hmacsha1_key dst_hmacsha1_key_t;
typedef struct dst_hmacsha224_key dst_hmacsha224_key_t;
typedef struct dst_hmacsha256_key dst_hmacsha256_key_t;
typedef struct dst_hmacsha384_key dst_hmacsha384_key_t;
typedef struct dst_hmacsha512_key dst_hmacsha512_key_t;
/*%
* Indicate whether a DST context will be used for signing
* or for verification
*/
/*% DST Key Structure */
struct dst_key {
unsigned int magic;
unsigned int key_size; /*%< size of the key in bits */
unsigned int key_proto; /*%< protocols this key is used for */
unsigned int key_alg; /*%< algorithm of the key */
revoked */
char *engine; /*%< engine name (HSM) */
char *label; /*%< engine label (HSM) */
union {
void *generic;
#ifdef OPENSSL
#endif
#ifndef PK11_DSA_DISABLE
#endif
#ifndef PK11_DH_DISABLE
#endif
#endif
#ifndef PK11_MD5_DISABLE
#endif
} keydata; /*%< pointer to key in crypto pkg fmt */
inactive */
int fmt_major; /*%< private key format, major version */
int fmt_minor; /*%< private key format, minor version */
};
struct dst_context {
unsigned int magic;
union {
void *generic;
#ifndef PK11_MD5_DISABLE
#endif
#ifndef PK11_MD5_DISABLE
#endif
#ifdef OPENSSL
#endif
} ctxdata;
};
struct dst_func {
/*
* Context functions
*/
/*
* Key operations
*/
const isc_region_t *sig);
void (*callback)(int));
/* conversion functions */
/* cleanup */
void (*cleanup)(void);
int *length);
};
/*%
* Initializers
*/
#define dst__pkcs11_init pk11_initialize
#ifndef PK11_MD5_DISABLE
#endif
unsigned char algorithm);
#ifndef PK11_DSA_DISABLE
#endif
#ifndef PK11_DH_DISABLE
#endif
#ifdef HAVE_OPENSSL_ECDSA
#endif
#if defined(HAVE_OPENSSL_ED25519) || defined(HAVE_OPENSSL_ED448)
#endif
#ifdef HAVE_PKCS11_ECDSA
#endif
#if defined(HAVE_PKCS11_ED25519) || defined(HAVE_PKCS11_ED448)
#endif
#ifdef HAVE_OPENSSL_GOST
#endif
#ifdef HAVE_PKCS11_GOST
#endif
/*%
* Destructors
*/
void dst__openssl_destroy(void);
#define dst__pkcs11_destroy pk11_finalize
/*%
* Memory allocators using the DST memory pool.
*/
void dst__mem_free(void *ptr);
/*%
* Entropy retriever using the DST entropy pool.
*/
/*
* Entropy status hook.
*/
unsigned int dst__entropy_status(void);
#endif /* DST_DST_INTERNAL_H */
/*! \file */