1/* 2 * Copyright (c) 2011-12 Apple Inc. All Rights Reserved. 3 * 4 * @APPLE_LICENSE_HEADER_START@ 5 * 6 * This file contains Original Code and/or Modifications of Original Code 7 * as defined in and that are subject to the Apple Public Source License 8 * Version 2.0 (the 'License'). You may not use this file except in 9 * compliance with the License. Please obtain a copy of the License at 10 * http://www.opensource.apple.com/apsl/ and read it before using this 11 * file. 12 * 13 * The Original Code and all software distributed under the License are 14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 * Please see the License for the specific language governing rights and 19 * limitations under the License. 20 * 21 * @APPLE_LICENSE_HEADER_END@ 22 */ 23 24/* 25 * Copyright (c) 2006 Kungliga Tekniska Högskolan 26 * (Royal Institute of Technology, Stockholm, Sweden). 27 * All rights reserved. 28 * 29 * Redistribution and use in source and binary forms, with or without 30 * modification, are permitted provided that the following conditions 31 * are met: 32 * 33 * 1. Redistributions of source code must retain the above copyright 34 * notice, this list of conditions and the following disclaimer. 35 * 36 * 2. Redistributions in binary form must reproduce the above copyright 37 * notice, this list of conditions and the following disclaimer in the 38 * documentation and/or other materials provided with the distribution. 39 * 40 * 3. Neither the name of the Institute nor the names of its contributors 41 * may be used to endorse or promote products derived from this software 42 * without specific prior written permission. 43 * 44 * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND 45 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 46 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 47 * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE 48 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 49 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 50 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 51 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 52 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 53 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 54 * SUCH DAMAGE. 55 */ 56 57#ifndef _OSSL_ENGINE_H_ 58#define _OSSL_ENGINE_H_ 1 59 60/* symbol renaming */ 61#define ENGINE_add_conf_module ossl_ENGINE_add_conf_module 62#define ENGINE_by_dso ossl_ENGINE_by_dso 63#define ENGINE_by_id ossl_ENGINE_by_id 64#define ENGINE_finish ossl_ENGINE_finish 65#define ENGINE_get_DH ossl_ENGINE_get_DH 66#define ENGINE_get_DSA ossl_ENGINE_get_DSA 67#define ENGINE_get_RSA ossl_ENGINE_get_RSA 68#define ENGINE_get_RAND ossl_ENGINE_get_RAND 69#define ENGINE_get_id ossl_ENGINE_get_id 70#define ENGINE_get_name ossl_ENGINE_get_name 71#define ENGINE_load_builtin_engines ossl_ENGINE_load_builtin_engines 72#define ENGINE_set_DH ossl_ENGINE_set_DH 73#define ENGINE_set_RSA ossl_ENGINE_set_RSA 74#define ENGINE_set_id ossl_ENGINE_set_id 75#define ENGINE_set_name ossl_ENGINE_set_name 76#define ENGINE_set_destroy_function ossl_ENGINE_set_destroy_function 77#define ENGINE_new ossl_ENGINE_new 78#define ENGINE_free ossl_ENGINE_free 79#define ENGINE_up_ref ossl_ENGINE_up_ref 80#define ENGINE_get_default_DH ossl_ENGINE_get_default_DH 81#define ENGINE_get_default_RSA ossl_ENGINE_get_default_RSA 82#define ENGINE_set_default_DH ossl_ENGINE_set_default_DH 83#define ENGINE_set_default_RSA ossl_ENGINE_set_default_RSA 84 85/* 86 * 87 */ 88 89typedef struct ossl_engine ENGINE; 90 91#include "ossl-rsa.h" 92#include "ossl-dsa.h" 93#include "ossl-dh.h" 94#include "ossl-rand.h" 95 96/* 97 * 98 */ 99 100#define OPENSSL_DYNAMIC_VERSION (unsigned long)0x00020000 101 102typedef int (*openssl_bind_engine)(ENGINE *, const char *, const void *); 103typedef unsigned long (*openssl_v_check)(unsigned long); 104 105ENGINE *ENGINE_new(void); 106int ENGINE_free(ENGINE *); 107void ENGINE_add_conf_module(void); 108void ENGINE_load_builtin_engines(void); 109ENGINE *ENGINE_by_id(const char *); 110ENGINE *ENGINE_by_dso(const char *, const char *); 111int ENGINE_finish(ENGINE *); 112int ENGINE_up_ref(ENGINE *); 113int ENGINE_set_id(ENGINE *, const char *); 114int ENGINE_set_name(ENGINE *, const char *); 115int ENGINE_set_DSA(ENGINE *, const DSA_METHOD *); 116int ENGINE_set_RSA(ENGINE *, const RSA_METHOD *); 117int ENGINE_set_DH(ENGINE *, const DH_METHOD *); 118 119int ENGINE_set_destroy_function(ENGINE *, void (*)(ENGINE *)); 120 121const char *ENGINE_get_id(const ENGINE *); 122const char *ENGINE_get_name(const ENGINE *); 123const DSA_METHOD *ENGINE_get_DSA(const ENGINE *); 124const RSA_METHOD *ENGINE_get_RSA(const ENGINE *); 125const DH_METHOD *ENGINE_get_DH(const ENGINE *); 126const RAND_METHOD *ENGINE_get_RAND(const ENGINE *); 127 128int ENGINE_set_default_RSA(ENGINE *); 129ENGINE *ENGINE_get_default_DSA(void); 130ENGINE *ENGINE_get_default_RSA(void); 131int ENGINE_set_default_DH(ENGINE *); 132ENGINE *ENGINE_get_default_DH(void); 133 134#endif /* __OSSL_ENGINE_H_ */ 135