cryptlib.h revision 194206
1162911Ssimon/* crypto/cryptlib.h */ 2162911Ssimon/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 3162911Ssimon * All rights reserved. 4162911Ssimon * 5162911Ssimon * This package is an SSL implementation written 6162911Ssimon * by Eric Young (eay@cryptsoft.com). 7162911Ssimon * The implementation was written so as to conform with Netscapes SSL. 8162911Ssimon * 9162911Ssimon * This library is free for commercial and non-commercial use as long as 10296465Sdelphij * the following conditions are aheared to. The following conditions 11162911Ssimon * apply to all code found in this distribution, be it the RC4, RSA, 12162911Ssimon * lhash, DES, etc., code; not just the SSL code. The SSL documentation 13162911Ssimon * included with this distribution is covered by the same copyright terms 14162911Ssimon * except that the holder is Tim Hudson (tjh@cryptsoft.com). 15162911Ssimon * 16162911Ssimon * Copyright remains Eric Young's, and as such any Copyright notices in 17162911Ssimon * the code are not to be removed. 18162911Ssimon * If this package is used in a product, Eric Young should be given attribution 19162911Ssimon * as the author of the parts of the library used. 20162911Ssimon * This can be in the form of a textual message at program startup or 21162911Ssimon * in documentation (online or textual) provided with the package. 22162911Ssimon * 23162911Ssimon * Redistribution and use in source and binary forms, with or without 24162911Ssimon * modification, are permitted provided that the following conditions 25162911Ssimon * are met: 26162911Ssimon * 1. Redistributions of source code must retain the copyright 27162911Ssimon * notice, this list of conditions and the following disclaimer. 28162911Ssimon * 2. Redistributions in binary form must reproduce the above copyright 29162911Ssimon * notice, this list of conditions and the following disclaimer in the 30162911Ssimon * documentation and/or other materials provided with the distribution. 31162911Ssimon * 3. All advertising materials mentioning features or use of this software 32162911Ssimon * must display the following acknowledgement: 33162911Ssimon * "This product includes cryptographic software written by 34162911Ssimon * Eric Young (eay@cryptsoft.com)" 35162911Ssimon * The word 'cryptographic' can be left out if the rouines from the library 36162911Ssimon * being used are not cryptographic related :-). 37162911Ssimon * 4. If you include any Windows specific code (or a derivative thereof) from 38162911Ssimon * the apps directory (application code) you must include an acknowledgement: 39162911Ssimon * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" 40162911Ssimon * 41162911Ssimon * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND 42162911Ssimon * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 43162911Ssimon * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 44162911Ssimon * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 45162911Ssimon * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 46162911Ssimon * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 47162911Ssimon * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 48162911Ssimon * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 49162911Ssimon * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 50162911Ssimon * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 51162911Ssimon * SUCH DAMAGE. 52162911Ssimon * 53296465Sdelphij * The licence and distribution terms for any publically available version or 54162911Ssimon * derivative of this code cannot be changed. i.e. this code cannot simply be 55296465Sdelphij * copied and put under another distribution licence 56162911Ssimon * [including the GNU Public Licence.] 57296465Sdelphij */ 58296465Sdelphij 59296465Sdelphij#ifndef HEADER_CRYPTLIB_H 60162911Ssimon#define HEADER_CRYPTLIB_H 61296465Sdelphij 62296465Sdelphij#include <stdlib.h> 63162911Ssimon#include <string.h> 64296465Sdelphij 65296465Sdelphij#include "e_os.h" 66296465Sdelphij 67296465Sdelphij#ifdef OPENSSL_USE_APPLINK 68162911Ssimon#define BIO_FLAGS_UPLINK 0x8000 69162911Ssimon#include "ms/uplink.h" 70162911Ssimon#endif 71162911Ssimon 72162911Ssimon#include <openssl/crypto.h> 73162911Ssimon#include <openssl/buffer.h> 74162911Ssimon#include <openssl/bio.h> 75296465Sdelphij#include <openssl/err.h> 76296465Sdelphij#include <openssl/opensslconf.h> 77296465Sdelphij 78162911Ssimon#ifdef __cplusplus 79162911Ssimonextern "C" { 80162911Ssimon#endif 81162911Ssimon 82296465Sdelphij#ifndef OPENSSL_SYS_VMS 83296465Sdelphij#define X509_CERT_AREA OPENSSLDIR 84296465Sdelphij#define X509_CERT_DIR OPENSSLDIR "/certs" 85296465Sdelphij#define X509_CERT_FILE OPENSSLDIR "/cert.pem" 86296465Sdelphij#define X509_PRIVATE_DIR OPENSSLDIR "/private" 87296465Sdelphij#else 88162911Ssimon#define X509_CERT_AREA "SSLROOT:[000000]" 89162911Ssimon#define X509_CERT_DIR "SSLCERTS:" 90162911Ssimon#define X509_CERT_FILE "SSLCERTS:cert.pem" 91296465Sdelphij#define X509_PRIVATE_DIR "SSLPRIVATE:" 92194206Ssimon#endif 93296465Sdelphij 94296465Sdelphij#define X509_CERT_DIR_EVP "SSL_CERT_DIR" 95194206Ssimon#define X509_CERT_FILE_EVP "SSL_CERT_FILE" 96162911Ssimon 97296465Sdelphij/* size of string representations */ 98162911Ssimon#define DECIMAL_SIZE(type) ((sizeof(type)*8+2)/3+1) 99162911Ssimon#define HEX_SIZE(type) (sizeof(type)*2) 100296465Sdelphij 101162911Ssimonvoid OPENSSL_cpuid_setup(void); 102296465Sdelphijextern unsigned long OPENSSL_ia32cap_P; 103162911Ssimonvoid OPENSSL_showfatal(const char *,...); 104162911Ssimonvoid *OPENSSL_stderr(void); 105296465Sdelphijextern int OPENSSL_NONPIC_relocated; 106162911Ssimon 107296465Sdelphij#ifdef __cplusplus 108296465Sdelphij} 109162911Ssimon#endif 110296465Sdelphij 111296465Sdelphij#endif 112296465Sdelphij