-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
All symlink files in `deps/openssl/openssl/include/openssl/` are removed and replaced with real header files to avoid issues on Windows. Two files of opensslconf.h in crypto and include dir are replaced to refer config/opensslconf.h. PR-URL: nodejs#16691 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Myles Borins <myles.borins@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Rod Vagg <rod@vagg.org> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Access has been restricted
You have triggered a rate limit.
Please wait a few minutes before you try again;
in some cases this may take up to an hour.
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,265 +1 @@ | ||
/* opensslconf.h */ | ||
/* WARNING: Generated automatically from opensslconf.h.in by Configure. */ | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
/* OpenSSL was configured with the following options: */ | ||
#ifndef OPENSSL_DOING_MAKEDEPEND | ||
|
||
|
||
#ifndef OPENSSL_NO_EC_NISTP_64_GCC_128 | ||
# define OPENSSL_NO_EC_NISTP_64_GCC_128 | ||
#endif | ||
#ifndef OPENSSL_NO_GMP | ||
# define OPENSSL_NO_GMP | ||
#endif | ||
#ifndef OPENSSL_NO_JPAKE | ||
# define OPENSSL_NO_JPAKE | ||
#endif | ||
#ifndef OPENSSL_NO_KRB5 | ||
# define OPENSSL_NO_KRB5 | ||
#endif | ||
#ifndef OPENSSL_NO_LIBUNBOUND | ||
# define OPENSSL_NO_LIBUNBOUND | ||
#endif | ||
#ifndef OPENSSL_NO_MD2 | ||
# define OPENSSL_NO_MD2 | ||
#endif | ||
#ifndef OPENSSL_NO_RC5 | ||
# define OPENSSL_NO_RC5 | ||
#endif | ||
#ifndef OPENSSL_NO_RFC3779 | ||
# define OPENSSL_NO_RFC3779 | ||
#endif | ||
#ifndef OPENSSL_NO_SCTP | ||
# define OPENSSL_NO_SCTP | ||
#endif | ||
#ifndef OPENSSL_NO_SSL_TRACE | ||
# define OPENSSL_NO_SSL_TRACE | ||
#endif | ||
#ifndef OPENSSL_NO_SSL2 | ||
# define OPENSSL_NO_SSL2 | ||
#endif | ||
#ifndef OPENSSL_NO_STORE | ||
# define OPENSSL_NO_STORE | ||
#endif | ||
#ifndef OPENSSL_NO_UNIT_TEST | ||
# define OPENSSL_NO_UNIT_TEST | ||
#endif | ||
#ifndef OPENSSL_NO_WEAK_SSL_CIPHERS | ||
# define OPENSSL_NO_WEAK_SSL_CIPHERS | ||
#endif | ||
|
||
#endif /* OPENSSL_DOING_MAKEDEPEND */ | ||
|
||
#ifndef OPENSSL_NO_DYNAMIC_ENGINE | ||
# define OPENSSL_NO_DYNAMIC_ENGINE | ||
#endif | ||
|
||
/* The OPENSSL_NO_* macros are also defined as NO_* if the application | ||
asks for it. This is a transient feature that is provided for those | ||
who haven't had the time to do the appropriate changes in their | ||
applications. */ | ||
#ifdef OPENSSL_ALGORITHM_DEFINES | ||
# if defined(OPENSSL_NO_EC_NISTP_64_GCC_128) && !defined(NO_EC_NISTP_64_GCC_128) | ||
# define NO_EC_NISTP_64_GCC_128 | ||
# endif | ||
# if defined(OPENSSL_NO_GMP) && !defined(NO_GMP) | ||
# define NO_GMP | ||
# endif | ||
# if defined(OPENSSL_NO_JPAKE) && !defined(NO_JPAKE) | ||
# define NO_JPAKE | ||
# endif | ||
# if defined(OPENSSL_NO_KRB5) && !defined(NO_KRB5) | ||
# define NO_KRB5 | ||
# endif | ||
# if defined(OPENSSL_NO_LIBUNBOUND) && !defined(NO_LIBUNBOUND) | ||
# define NO_LIBUNBOUND | ||
# endif | ||
# if defined(OPENSSL_NO_MD2) && !defined(NO_MD2) | ||
# define NO_MD2 | ||
# endif | ||
# if defined(OPENSSL_NO_RC5) && !defined(NO_RC5) | ||
# define NO_RC5 | ||
# endif | ||
# if defined(OPENSSL_NO_RFC3779) && !defined(NO_RFC3779) | ||
# define NO_RFC3779 | ||
# endif | ||
# if defined(OPENSSL_NO_SCTP) && !defined(NO_SCTP) | ||
# define NO_SCTP | ||
# endif | ||
# if defined(OPENSSL_NO_SSL_TRACE) && !defined(NO_SSL_TRACE) | ||
# define NO_SSL_TRACE | ||
# endif | ||
# if defined(OPENSSL_NO_SSL2) && !defined(NO_SSL2) | ||
# define NO_SSL2 | ||
# endif | ||
# if defined(OPENSSL_NO_STORE) && !defined(NO_STORE) | ||
# define NO_STORE | ||
# endif | ||
# if defined(OPENSSL_NO_UNIT_TEST) && !defined(NO_UNIT_TEST) | ||
# define NO_UNIT_TEST | ||
# endif | ||
# if defined(OPENSSL_NO_WEAK_SSL_CIPHERS) && !defined(NO_WEAK_SSL_CIPHERS) | ||
# define NO_WEAK_SSL_CIPHERS | ||
# endif | ||
#endif | ||
|
||
/* crypto/opensslconf.h.in */ | ||
|
||
/* Generate 80386 code? */ | ||
#undef I386_ONLY | ||
|
||
#if !(defined(VMS) || defined(__VMS)) /* VMS uses logical names instead */ | ||
#if defined(HEADER_CRYPTLIB_H) && !defined(OPENSSLDIR) | ||
#define ENGINESDIR "/usr/local/ssl/lib/engines" | ||
#define OPENSSLDIR "/usr/local/ssl" | ||
#endif | ||
#endif | ||
|
||
#undef OPENSSL_UNISTD | ||
#define OPENSSL_UNISTD <unistd.h> | ||
|
||
#undef OPENSSL_EXPORT_VAR_AS_FUNCTION | ||
|
||
#if defined(HEADER_IDEA_H) && !defined(IDEA_INT) | ||
#define IDEA_INT unsigned int | ||
#endif | ||
|
||
#if defined(HEADER_MD2_H) && !defined(MD2_INT) | ||
#define MD2_INT unsigned int | ||
#endif | ||
|
||
#if defined(HEADER_RC2_H) && !defined(RC2_INT) | ||
/* I need to put in a mod for the alpha - eay */ | ||
#define RC2_INT unsigned int | ||
#endif | ||
|
||
#if defined(HEADER_RC4_H) | ||
#if !defined(RC4_INT) | ||
/* using int types make the structure larger but make the code faster | ||
* on most boxes I have tested - up to %20 faster. */ | ||
/* | ||
* I don't know what does "most" mean, but declaring "int" is a must on: | ||
* - Intel P6 because partial register stalls are very expensive; | ||
* - elder Alpha because it lacks byte load/store instructions; | ||
*/ | ||
#define RC4_INT unsigned int | ||
#endif | ||
#if !defined(RC4_CHUNK) | ||
/* | ||
* This enables code handling data aligned at natural CPU word | ||
* boundary. See crypto/rc4/rc4_enc.c for further details. | ||
*/ | ||
#undef RC4_CHUNK | ||
#endif | ||
#endif | ||
|
||
#if (defined(HEADER_NEW_DES_H) || defined(HEADER_DES_H)) && !defined(DES_LONG) | ||
/* If this is set to 'unsigned int' on a DEC Alpha, this gives about a | ||
* %20 speed up (longs are 8 bytes, int's are 4). */ | ||
#ifndef DES_LONG | ||
#define DES_LONG unsigned long | ||
#endif | ||
#endif | ||
|
||
#if defined(HEADER_BN_H) && !defined(CONFIG_HEADER_BN_H) | ||
#define CONFIG_HEADER_BN_H | ||
#undef BN_LLONG | ||
|
||
/* Should we define BN_DIV2W here? */ | ||
|
||
/* Only one for the following should be defined */ | ||
#undef SIXTY_FOUR_BIT_LONG | ||
#undef SIXTY_FOUR_BIT | ||
#define THIRTY_TWO_BIT | ||
#endif | ||
|
||
#if defined(HEADER_RC4_LOCL_H) && !defined(CONFIG_HEADER_RC4_LOCL_H) | ||
#define CONFIG_HEADER_RC4_LOCL_H | ||
/* if this is defined data[i] is used instead of *data, this is a %20 | ||
* speedup on x86 */ | ||
#undef RC4_INDEX | ||
#endif | ||
|
||
#if defined(HEADER_BF_LOCL_H) && !defined(CONFIG_HEADER_BF_LOCL_H) | ||
#define CONFIG_HEADER_BF_LOCL_H | ||
#undef BF_PTR | ||
#endif /* HEADER_BF_LOCL_H */ | ||
|
||
#if defined(HEADER_DES_LOCL_H) && !defined(CONFIG_HEADER_DES_LOCL_H) | ||
#define CONFIG_HEADER_DES_LOCL_H | ||
#ifndef DES_DEFAULT_OPTIONS | ||
/* the following is tweaked from a config script, that is why it is a | ||
* protected undef/define */ | ||
#ifndef DES_PTR | ||
#undef DES_PTR | ||
#endif | ||
|
||
/* This helps C compiler generate the correct code for multiple functional | ||
* units. It reduces register dependancies at the expense of 2 more | ||
* registers */ | ||
#ifndef DES_RISC1 | ||
#undef DES_RISC1 | ||
#endif | ||
|
||
#ifndef DES_RISC2 | ||
#undef DES_RISC2 | ||
#endif | ||
|
||
#if defined(DES_RISC1) && defined(DES_RISC2) | ||
#error YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!! | ||
#endif | ||
|
||
/* Unroll the inner loop, this sometimes helps, sometimes hinders. | ||
* Very mucy CPU dependant */ | ||
#ifndef DES_UNROLL | ||
#undef DES_UNROLL | ||
#endif | ||
|
||
/* These default values were supplied by | ||
* Peter Gutman <pgut001@cs.auckland.ac.nz> | ||
* They are only used if nothing else has been defined */ | ||
#if !defined(DES_PTR) && !defined(DES_RISC1) && !defined(DES_RISC2) && !defined(DES_UNROLL) | ||
/* Special defines which change the way the code is built depending on the | ||
CPU and OS. For SGI machines you can use _MIPS_SZLONG (32 or 64) to find | ||
even newer MIPS CPU's, but at the moment one size fits all for | ||
optimization options. Older Sparc's work better with only UNROLL, but | ||
there's no way to tell at compile time what it is you're running on */ | ||
|
||
#if defined( __sun ) || defined ( sun ) /* Newer Sparc's */ | ||
# define DES_PTR | ||
# define DES_RISC1 | ||
# define DES_UNROLL | ||
#elif defined( __ultrix ) /* Older MIPS */ | ||
# define DES_PTR | ||
# define DES_RISC2 | ||
# define DES_UNROLL | ||
#elif defined( __osf1__ ) /* Alpha */ | ||
# define DES_PTR | ||
# define DES_RISC2 | ||
#elif defined ( _AIX ) /* RS6000 */ | ||
/* Unknown */ | ||
#elif defined( __hpux ) /* HP-PA */ | ||
/* Unknown */ | ||
#elif defined( __aux ) /* 68K */ | ||
/* Unknown */ | ||
#elif defined( __dgux ) /* 88K (but P6 in latest boxes) */ | ||
# define DES_UNROLL | ||
#elif defined( __sgi ) /* Newer MIPS */ | ||
# define DES_PTR | ||
# define DES_RISC2 | ||
# define DES_UNROLL | ||
#elif defined(i386) || defined(__i386__) /* x86 boxes, should be gcc */ | ||
# define DES_PTR | ||
# define DES_RISC1 | ||
# define DES_UNROLL | ||
#endif /* Systems-specific speed defines */ | ||
#endif | ||
|
||
#endif /* DES_DEFAULT_OPTIONS */ | ||
#endif /* HEADER_DES_LOCL_H */ | ||
#ifdef __cplusplus | ||
} | ||
#endif | ||
#include "../../config/opensslconf.h" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,149 @@ | ||
/* crypto/aes/aes.h */ | ||
/* ==================================================================== | ||
* Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
* modification, are permitted provided that the following conditions | ||
* are met: | ||
* | ||
* 1. Redistributions of source code must retain the above copyright | ||
* notice, this list of conditions and the following disclaimer. | ||
* | ||
* 2. Redistributions in binary form must reproduce the above copyright | ||
* notice, this list of conditions and the following disclaimer in | ||
* the documentation and/or other materials provided with the | ||
* distribution. | ||
* | ||
* 3. All advertising materials mentioning features or use of this | ||
* software must display the following acknowledgment: | ||
* "This product includes software developed by the OpenSSL Project | ||
* for use in the OpenSSL Toolkit. (http://www.openssl.org/)" | ||
* | ||
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to | ||
* endorse or promote products derived from this software without | ||
* prior written permission. For written permission, please contact | ||
* openssl-core@openssl.org. | ||
* | ||
* 5. Products derived from this software may not be called "OpenSSL" | ||
* nor may "OpenSSL" appear in their names without prior written | ||
* permission of the OpenSSL Project. | ||
* | ||
* 6. Redistributions of any form whatsoever must retain the following | ||
* acknowledgment: | ||
* "This product includes software developed by the OpenSSL Project | ||
* for use in the OpenSSL Toolkit (http://www.openssl.org/)" | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY | ||
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR | ||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
* OF THE POSSIBILITY OF SUCH DAMAGE. | ||
* ==================================================================== | ||
* | ||
*/ | ||
|
||
#ifndef HEADER_AES_H | ||
# define HEADER_AES_H | ||
|
||
# include <openssl/opensslconf.h> | ||
|
||
# ifdef OPENSSL_NO_AES | ||
# error AES is disabled. | ||
# endif | ||
|
||
# include <stddef.h> | ||
|
||
# define AES_ENCRYPT 1 | ||
# define AES_DECRYPT 0 | ||
|
||
/* | ||
* Because array size can't be a const in C, the following two are macros. | ||
* Both sizes are in bytes. | ||
*/ | ||
# define AES_MAXNR 14 | ||
# define AES_BLOCK_SIZE 16 | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
/* This should be a hidden type, but EVP requires that the size be known */ | ||
struct aes_key_st { | ||
# ifdef AES_LONG | ||
unsigned long rd_key[4 * (AES_MAXNR + 1)]; | ||
# else | ||
unsigned int rd_key[4 * (AES_MAXNR + 1)]; | ||
# endif | ||
int rounds; | ||
}; | ||
typedef struct aes_key_st AES_KEY; | ||
|
||
const char *AES_options(void); | ||
|
||
int AES_set_encrypt_key(const unsigned char *userKey, const int bits, | ||
AES_KEY *key); | ||
int AES_set_decrypt_key(const unsigned char *userKey, const int bits, | ||
AES_KEY *key); | ||
|
||
int private_AES_set_encrypt_key(const unsigned char *userKey, const int bits, | ||
AES_KEY *key); | ||
int private_AES_set_decrypt_key(const unsigned char *userKey, const int bits, | ||
AES_KEY *key); | ||
|
||
void AES_encrypt(const unsigned char *in, unsigned char *out, | ||
const AES_KEY *key); | ||
void AES_decrypt(const unsigned char *in, unsigned char *out, | ||
const AES_KEY *key); | ||
|
||
void AES_ecb_encrypt(const unsigned char *in, unsigned char *out, | ||
const AES_KEY *key, const int enc); | ||
void AES_cbc_encrypt(const unsigned char *in, unsigned char *out, | ||
size_t length, const AES_KEY *key, | ||
unsigned char *ivec, const int enc); | ||
void AES_cfb128_encrypt(const unsigned char *in, unsigned char *out, | ||
size_t length, const AES_KEY *key, | ||
unsigned char *ivec, int *num, const int enc); | ||
void AES_cfb1_encrypt(const unsigned char *in, unsigned char *out, | ||
size_t length, const AES_KEY *key, | ||
unsigned char *ivec, int *num, const int enc); | ||
void AES_cfb8_encrypt(const unsigned char *in, unsigned char *out, | ||
size_t length, const AES_KEY *key, | ||
unsigned char *ivec, int *num, const int enc); | ||
void AES_ofb128_encrypt(const unsigned char *in, unsigned char *out, | ||
size_t length, const AES_KEY *key, | ||
unsigned char *ivec, int *num); | ||
void AES_ctr128_encrypt(const unsigned char *in, unsigned char *out, | ||
size_t length, const AES_KEY *key, | ||
unsigned char ivec[AES_BLOCK_SIZE], | ||
unsigned char ecount_buf[AES_BLOCK_SIZE], | ||
unsigned int *num); | ||
/* NB: the IV is _two_ blocks long */ | ||
void AES_ige_encrypt(const unsigned char *in, unsigned char *out, | ||
size_t length, const AES_KEY *key, | ||
unsigned char *ivec, const int enc); | ||
/* NB: the IV is _four_ blocks long */ | ||
void AES_bi_ige_encrypt(const unsigned char *in, unsigned char *out, | ||
size_t length, const AES_KEY *key, | ||
const AES_KEY *key2, const unsigned char *ivec, | ||
const int enc); | ||
|
||
int AES_wrap_key(AES_KEY *key, const unsigned char *iv, | ||
unsigned char *out, | ||
const unsigned char *in, unsigned int inlen); | ||
int AES_unwrap_key(AES_KEY *key, const unsigned char *iv, | ||
unsigned char *out, | ||
const unsigned char *in, unsigned int inlen); | ||
|
||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif /* !HEADER_AES_H */ |
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,130 @@ | ||
/* crypto/bf/blowfish.h */ | ||
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | ||
* All rights reserved. | ||
* | ||
* This package is an SSL implementation written | ||
* by Eric Young (eay@cryptsoft.com). | ||
* The implementation was written so as to conform with Netscapes SSL. | ||
* | ||
* This library is free for commercial and non-commercial use as long as | ||
* the following conditions are aheared to. The following conditions | ||
* apply to all code found in this distribution, be it the RC4, RSA, | ||
* lhash, DES, etc., code; not just the SSL code. The SSL documentation | ||
* included with this distribution is covered by the same copyright terms | ||
* except that the holder is Tim Hudson (tjh@cryptsoft.com). | ||
* | ||
* Copyright remains Eric Young's, and as such any Copyright notices in | ||
* the code are not to be removed. | ||
* If this package is used in a product, Eric Young should be given attribution | ||
* as the author of the parts of the library used. | ||
* This can be in the form of a textual message at program startup or | ||
* in documentation (online or textual) provided with the package. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
* modification, are permitted provided that the following conditions | ||
* are met: | ||
* 1. Redistributions of source code must retain the copyright | ||
* notice, this list of conditions and the following disclaimer. | ||
* 2. Redistributions in binary form must reproduce the above copyright | ||
* notice, this list of conditions and the following disclaimer in the | ||
* documentation and/or other materials provided with the distribution. | ||
* 3. All advertising materials mentioning features or use of this software | ||
* must display the following acknowledgement: | ||
* "This product includes cryptographic software written by | ||
* Eric Young (eay@cryptsoft.com)" | ||
* The word 'cryptographic' can be left out if the rouines from the library | ||
* being used are not cryptographic related :-). | ||
* 4. If you include any Windows specific code (or a derivative thereof) from | ||
* the apps directory (application code) you must include an acknowledgement: | ||
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND | ||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE | ||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
* SUCH DAMAGE. | ||
* | ||
* The licence and distribution terms for any publically available version or | ||
* derivative of this code cannot be changed. i.e. this code cannot simply be | ||
* copied and put under another distribution licence | ||
* [including the GNU Public Licence.] | ||
*/ | ||
|
||
#ifndef HEADER_BLOWFISH_H | ||
# define HEADER_BLOWFISH_H | ||
|
||
# include <openssl/e_os2.h> | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
# ifdef OPENSSL_NO_BF | ||
# error BF is disabled. | ||
# endif | ||
|
||
# define BF_ENCRYPT 1 | ||
# define BF_DECRYPT 0 | ||
|
||
/*- | ||
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
* ! BF_LONG has to be at least 32 bits wide. If it's wider, then ! | ||
* ! BF_LONG_LOG2 has to be defined along. ! | ||
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
*/ | ||
|
||
# if defined(__LP32__) | ||
# define BF_LONG unsigned long | ||
# elif defined(OPENSSL_SYS_CRAY) || defined(__ILP64__) | ||
# define BF_LONG unsigned long | ||
# define BF_LONG_LOG2 3 | ||
/* | ||
* _CRAY note. I could declare short, but I have no idea what impact | ||
* does it have on performance on none-T3E machines. I could declare | ||
* int, but at least on C90 sizeof(int) can be chosen at compile time. | ||
* So I've chosen long... | ||
* <appro@fy.chalmers.se> | ||
*/ | ||
# else | ||
# define BF_LONG unsigned int | ||
# endif | ||
|
||
# define BF_ROUNDS 16 | ||
# define BF_BLOCK 8 | ||
|
||
typedef struct bf_key_st { | ||
BF_LONG P[BF_ROUNDS + 2]; | ||
BF_LONG S[4 * 256]; | ||
} BF_KEY; | ||
|
||
# ifdef OPENSSL_FIPS | ||
void private_BF_set_key(BF_KEY *key, int len, const unsigned char *data); | ||
# endif | ||
void BF_set_key(BF_KEY *key, int len, const unsigned char *data); | ||
|
||
void BF_encrypt(BF_LONG *data, const BF_KEY *key); | ||
void BF_decrypt(BF_LONG *data, const BF_KEY *key); | ||
|
||
void BF_ecb_encrypt(const unsigned char *in, unsigned char *out, | ||
const BF_KEY *key, int enc); | ||
void BF_cbc_encrypt(const unsigned char *in, unsigned char *out, long length, | ||
const BF_KEY *schedule, unsigned char *ivec, int enc); | ||
void BF_cfb64_encrypt(const unsigned char *in, unsigned char *out, | ||
long length, const BF_KEY *schedule, | ||
unsigned char *ivec, int *num, int enc); | ||
void BF_ofb64_encrypt(const unsigned char *in, unsigned char *out, | ||
long length, const BF_KEY *schedule, | ||
unsigned char *ivec, int *num); | ||
const char *BF_options(void); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif |
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
/* crypto/buffer/buffer.h */ | ||
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | ||
* All rights reserved. | ||
* | ||
* This package is an SSL implementation written | ||
* by Eric Young (eay@cryptsoft.com). | ||
* The implementation was written so as to conform with Netscapes SSL. | ||
* | ||
* This library is free for commercial and non-commercial use as long as | ||
* the following conditions are aheared to. The following conditions | ||
* apply to all code found in this distribution, be it the RC4, RSA, | ||
* lhash, DES, etc., code; not just the SSL code. The SSL documentation | ||
* included with this distribution is covered by the same copyright terms | ||
* except that the holder is Tim Hudson (tjh@cryptsoft.com). | ||
* | ||
* Copyright remains Eric Young's, and as such any Copyright notices in | ||
* the code are not to be removed. | ||
* If this package is used in a product, Eric Young should be given attribution | ||
* as the author of the parts of the library used. | ||
* This can be in the form of a textual message at program startup or | ||
* in documentation (online or textual) provided with the package. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
* modification, are permitted provided that the following conditions | ||
* are met: | ||
* 1. Redistributions of source code must retain the copyright | ||
* notice, this list of conditions and the following disclaimer. | ||
* 2. Redistributions in binary form must reproduce the above copyright | ||
* notice, this list of conditions and the following disclaimer in the | ||
* documentation and/or other materials provided with the distribution. | ||
* 3. All advertising materials mentioning features or use of this software | ||
* must display the following acknowledgement: | ||
* "This product includes cryptographic software written by | ||
* Eric Young (eay@cryptsoft.com)" | ||
* The word 'cryptographic' can be left out if the rouines from the library | ||
* being used are not cryptographic related :-). | ||
* 4. If you include any Windows specific code (or a derivative thereof) from | ||
* the apps directory (application code) you must include an acknowledgement: | ||
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND | ||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE | ||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
* SUCH DAMAGE. | ||
* | ||
* The licence and distribution terms for any publically available version or | ||
* derivative of this code cannot be changed. i.e. this code cannot simply be | ||
* copied and put under another distribution licence | ||
* [including the GNU Public Licence.] | ||
*/ | ||
|
||
#ifndef HEADER_BUFFER_H | ||
# define HEADER_BUFFER_H | ||
|
||
# include <openssl/ossl_typ.h> | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
# include <stddef.h> | ||
|
||
# if !defined(NO_SYS_TYPES_H) | ||
# include <sys/types.h> | ||
# endif | ||
|
||
/* Already declared in ossl_typ.h */ | ||
/* typedef struct buf_mem_st BUF_MEM; */ | ||
|
||
struct buf_mem_st { | ||
size_t length; /* current number of bytes */ | ||
char *data; | ||
size_t max; /* size of buffer */ | ||
}; | ||
|
||
BUF_MEM *BUF_MEM_new(void); | ||
void BUF_MEM_free(BUF_MEM *a); | ||
int BUF_MEM_grow(BUF_MEM *str, size_t len); | ||
int BUF_MEM_grow_clean(BUF_MEM *str, size_t len); | ||
size_t BUF_strnlen(const char *str, size_t maxlen); | ||
char *BUF_strdup(const char *str); | ||
|
||
/* | ||
* Like strndup, but in addition, explicitly guarantees to never read past the | ||
* first |siz| bytes of |str|. | ||
*/ | ||
char *BUF_strndup(const char *str, size_t siz); | ||
|
||
void *BUF_memdup(const void *data, size_t siz); | ||
void BUF_reverse(unsigned char *out, const unsigned char *in, size_t siz); | ||
|
||
/* safe string functions */ | ||
size_t BUF_strlcpy(char *dst, const char *src, size_t siz); | ||
size_t BUF_strlcat(char *dst, const char *src, size_t siz); | ||
|
||
/* BEGIN ERROR CODES */ | ||
/* | ||
* The following lines are auto generated by the script mkerr.pl. Any changes | ||
* made after this point may be overwritten when the script is next run. | ||
*/ | ||
void ERR_load_BUF_strings(void); | ||
|
||
/* Error codes for the BUF functions. */ | ||
|
||
/* Function codes. */ | ||
# define BUF_F_BUF_MEMDUP 103 | ||
# define BUF_F_BUF_MEM_GROW 100 | ||
# define BUF_F_BUF_MEM_GROW_CLEAN 105 | ||
# define BUF_F_BUF_MEM_NEW 101 | ||
# define BUF_F_BUF_STRDUP 102 | ||
# define BUF_F_BUF_STRNDUP 104 | ||
|
||
/* Reason codes. */ | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
#endif |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,132 @@ | ||
/* crypto/camellia/camellia.h */ | ||
/* ==================================================================== | ||
* Copyright (c) 2006 The OpenSSL Project. All rights reserved. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
* modification, are permitted provided that the following conditions | ||
* are met: | ||
* | ||
* 1. Redistributions of source code must retain the above copyright | ||
* notice, this list of conditions and the following disclaimer. | ||
* | ||
* 2. Redistributions in binary form must reproduce the above copyright | ||
* notice, this list of conditions and the following disclaimer in | ||
* the documentation and/or other materials provided with the | ||
* distribution. | ||
* | ||
* 3. All advertising materials mentioning features or use of this | ||
* software must display the following acknowledgment: | ||
* "This product includes software developed by the OpenSSL Project | ||
* for use in the OpenSSL Toolkit. (http://www.openssl.org/)" | ||
* | ||
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to | ||
* endorse or promote products derived from this software without | ||
* prior written permission. For written permission, please contact | ||
* openssl-core@openssl.org. | ||
* | ||
* 5. Products derived from this software may not be called "OpenSSL" | ||
* nor may "OpenSSL" appear in their names without prior written | ||
* permission of the OpenSSL Project. | ||
* | ||
* 6. Redistributions of any form whatsoever must retain the following | ||
* acknowledgment: | ||
* "This product includes software developed by the OpenSSL Project | ||
* for use in the OpenSSL Toolkit (http://www.openssl.org/)" | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY | ||
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR | ||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
* OF THE POSSIBILITY OF SUCH DAMAGE. | ||
* ==================================================================== | ||
* | ||
*/ | ||
|
||
#ifndef HEADER_CAMELLIA_H | ||
# define HEADER_CAMELLIA_H | ||
|
||
# include <openssl/opensslconf.h> | ||
|
||
# ifdef OPENSSL_NO_CAMELLIA | ||
# error CAMELLIA is disabled. | ||
# endif | ||
|
||
# include <stddef.h> | ||
|
||
# define CAMELLIA_ENCRYPT 1 | ||
# define CAMELLIA_DECRYPT 0 | ||
|
||
/* | ||
* Because array size can't be a const in C, the following two are macros. | ||
* Both sizes are in bytes. | ||
*/ | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
/* This should be a hidden type, but EVP requires that the size be known */ | ||
|
||
# define CAMELLIA_BLOCK_SIZE 16 | ||
# define CAMELLIA_TABLE_BYTE_LEN 272 | ||
# define CAMELLIA_TABLE_WORD_LEN (CAMELLIA_TABLE_BYTE_LEN / 4) | ||
|
||
typedef unsigned int KEY_TABLE_TYPE[CAMELLIA_TABLE_WORD_LEN]; /* to match | ||
* with WORD */ | ||
|
||
struct camellia_key_st { | ||
union { | ||
double d; /* ensures 64-bit align */ | ||
KEY_TABLE_TYPE rd_key; | ||
} u; | ||
int grand_rounds; | ||
}; | ||
typedef struct camellia_key_st CAMELLIA_KEY; | ||
|
||
# ifdef OPENSSL_FIPS | ||
int private_Camellia_set_key(const unsigned char *userKey, const int bits, | ||
CAMELLIA_KEY *key); | ||
# endif | ||
int Camellia_set_key(const unsigned char *userKey, const int bits, | ||
CAMELLIA_KEY *key); | ||
|
||
void Camellia_encrypt(const unsigned char *in, unsigned char *out, | ||
const CAMELLIA_KEY *key); | ||
void Camellia_decrypt(const unsigned char *in, unsigned char *out, | ||
const CAMELLIA_KEY *key); | ||
|
||
void Camellia_ecb_encrypt(const unsigned char *in, unsigned char *out, | ||
const CAMELLIA_KEY *key, const int enc); | ||
void Camellia_cbc_encrypt(const unsigned char *in, unsigned char *out, | ||
size_t length, const CAMELLIA_KEY *key, | ||
unsigned char *ivec, const int enc); | ||
void Camellia_cfb128_encrypt(const unsigned char *in, unsigned char *out, | ||
size_t length, const CAMELLIA_KEY *key, | ||
unsigned char *ivec, int *num, const int enc); | ||
void Camellia_cfb1_encrypt(const unsigned char *in, unsigned char *out, | ||
size_t length, const CAMELLIA_KEY *key, | ||
unsigned char *ivec, int *num, const int enc); | ||
void Camellia_cfb8_encrypt(const unsigned char *in, unsigned char *out, | ||
size_t length, const CAMELLIA_KEY *key, | ||
unsigned char *ivec, int *num, const int enc); | ||
void Camellia_ofb128_encrypt(const unsigned char *in, unsigned char *out, | ||
size_t length, const CAMELLIA_KEY *key, | ||
unsigned char *ivec, int *num); | ||
void Camellia_ctr128_encrypt(const unsigned char *in, unsigned char *out, | ||
size_t length, const CAMELLIA_KEY *key, | ||
unsigned char ivec[CAMELLIA_BLOCK_SIZE], | ||
unsigned char ecount_buf[CAMELLIA_BLOCK_SIZE], | ||
unsigned int *num); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif /* !HEADER_Camellia_H */ |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
/* crypto/cast/cast.h */ | ||
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | ||
* All rights reserved. | ||
* | ||
* This package is an SSL implementation written | ||
* by Eric Young (eay@cryptsoft.com). | ||
* The implementation was written so as to conform with Netscapes SSL. | ||
* | ||
* This library is free for commercial and non-commercial use as long as | ||
* the following conditions are aheared to. The following conditions | ||
* apply to all code found in this distribution, be it the RC4, RSA, | ||
* lhash, DES, etc., code; not just the SSL code. The SSL documentation | ||
* included with this distribution is covered by the same copyright terms | ||
* except that the holder is Tim Hudson (tjh@cryptsoft.com). | ||
* | ||
* Copyright remains Eric Young's, and as such any Copyright notices in | ||
* the code are not to be removed. | ||
* If this package is used in a product, Eric Young should be given attribution | ||
* as the author of the parts of the library used. | ||
* This can be in the form of a textual message at program startup or | ||
* in documentation (online or textual) provided with the package. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
* modification, are permitted provided that the following conditions | ||
* are met: | ||
* 1. Redistributions of source code must retain the copyright | ||
* notice, this list of conditions and the following disclaimer. | ||
* 2. Redistributions in binary form must reproduce the above copyright | ||
* notice, this list of conditions and the following disclaimer in the | ||
* documentation and/or other materials provided with the distribution. | ||
* 3. All advertising materials mentioning features or use of this software | ||
* must display the following acknowledgement: | ||
* "This product includes cryptographic software written by | ||
* Eric Young (eay@cryptsoft.com)" | ||
* The word 'cryptographic' can be left out if the rouines from the library | ||
* being used are not cryptographic related :-). | ||
* 4. If you include any Windows specific code (or a derivative thereof) from | ||
* the apps directory (application code) you must include an acknowledgement: | ||
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND | ||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE | ||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
* SUCH DAMAGE. | ||
* | ||
* The licence and distribution terms for any publically available version or | ||
* derivative of this code cannot be changed. i.e. this code cannot simply be | ||
* copied and put under another distribution licence | ||
* [including the GNU Public Licence.] | ||
*/ | ||
|
||
#ifndef HEADER_CAST_H | ||
# define HEADER_CAST_H | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
# include <openssl/opensslconf.h> | ||
|
||
# ifdef OPENSSL_NO_CAST | ||
# error CAST is disabled. | ||
# endif | ||
|
||
# define CAST_ENCRYPT 1 | ||
# define CAST_DECRYPT 0 | ||
|
||
# define CAST_LONG unsigned int | ||
|
||
# define CAST_BLOCK 8 | ||
# define CAST_KEY_LENGTH 16 | ||
|
||
typedef struct cast_key_st { | ||
CAST_LONG data[32]; | ||
int short_key; /* Use reduced rounds for short key */ | ||
} CAST_KEY; | ||
|
||
# ifdef OPENSSL_FIPS | ||
void private_CAST_set_key(CAST_KEY *key, int len, const unsigned char *data); | ||
# endif | ||
void CAST_set_key(CAST_KEY *key, int len, const unsigned char *data); | ||
void CAST_ecb_encrypt(const unsigned char *in, unsigned char *out, | ||
const CAST_KEY *key, int enc); | ||
void CAST_encrypt(CAST_LONG *data, const CAST_KEY *key); | ||
void CAST_decrypt(CAST_LONG *data, const CAST_KEY *key); | ||
void CAST_cbc_encrypt(const unsigned char *in, unsigned char *out, | ||
long length, const CAST_KEY *ks, unsigned char *iv, | ||
int enc); | ||
void CAST_cfb64_encrypt(const unsigned char *in, unsigned char *out, | ||
long length, const CAST_KEY *schedule, | ||
unsigned char *ivec, int *num, int enc); | ||
void CAST_ofb64_encrypt(const unsigned char *in, unsigned char *out, | ||
long length, const CAST_KEY *schedule, | ||
unsigned char *ivec, int *num); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
/* crypto/cmac/cmac.h */ | ||
/* | ||
* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | ||
* project. | ||
*/ | ||
/* ==================================================================== | ||
* Copyright (c) 2010 The OpenSSL Project. All rights reserved. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
* modification, are permitted provided that the following conditions | ||
* are met: | ||
* | ||
* 1. Redistributions of source code must retain the above copyright | ||
* notice, this list of conditions and the following disclaimer. | ||
* | ||
* 2. Redistributions in binary form must reproduce the above copyright | ||
* notice, this list of conditions and the following disclaimer in | ||
* the documentation and/or other materials provided with the | ||
* distribution. | ||
* | ||
* 3. All advertising materials mentioning features or use of this | ||
* software must display the following acknowledgment: | ||
* "This product includes software developed by the OpenSSL Project | ||
* for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" | ||
* | ||
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to | ||
* endorse or promote products derived from this software without | ||
* prior written permission. For written permission, please contact | ||
* licensing@OpenSSL.org. | ||
* | ||
* 5. Products derived from this software may not be called "OpenSSL" | ||
* nor may "OpenSSL" appear in their names without prior written | ||
* permission of the OpenSSL Project. | ||
* | ||
* 6. Redistributions of any form whatsoever must retain the following | ||
* acknowledgment: | ||
* "This product includes software developed by the OpenSSL Project | ||
* for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY | ||
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR | ||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
* OF THE POSSIBILITY OF SUCH DAMAGE. | ||
* ==================================================================== | ||
*/ | ||
|
||
#ifndef HEADER_CMAC_H | ||
# define HEADER_CMAC_H | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
# include <openssl/evp.h> | ||
|
||
/* Opaque */ | ||
typedef struct CMAC_CTX_st CMAC_CTX; | ||
|
||
CMAC_CTX *CMAC_CTX_new(void); | ||
void CMAC_CTX_cleanup(CMAC_CTX *ctx); | ||
void CMAC_CTX_free(CMAC_CTX *ctx); | ||
EVP_CIPHER_CTX *CMAC_CTX_get0_cipher_ctx(CMAC_CTX *ctx); | ||
int CMAC_CTX_copy(CMAC_CTX *out, const CMAC_CTX *in); | ||
|
||
int CMAC_Init(CMAC_CTX *ctx, const void *key, size_t keylen, | ||
const EVP_CIPHER *cipher, ENGINE *impl); | ||
int CMAC_Update(CMAC_CTX *ctx, const void *data, size_t dlen); | ||
int CMAC_Final(CMAC_CTX *ctx, unsigned char *out, size_t *poutlen); | ||
int CMAC_resume(CMAC_CTX *ctx); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
#endif |
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
|
||
#ifndef HEADER_COMP_H | ||
# define HEADER_COMP_H | ||
|
||
# include <openssl/crypto.h> | ||
|
||
# ifdef OPENSSL_NO_COMP | ||
# error COMP is disabled. | ||
# endif | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
typedef struct comp_ctx_st COMP_CTX; | ||
|
||
struct comp_method_st { | ||
int type; /* NID for compression library */ | ||
const char *name; /* A text string to identify the library */ | ||
int (*init) (COMP_CTX *ctx); | ||
void (*finish) (COMP_CTX *ctx); | ||
int (*compress) (COMP_CTX *ctx, | ||
unsigned char *out, unsigned int olen, | ||
unsigned char *in, unsigned int ilen); | ||
int (*expand) (COMP_CTX *ctx, | ||
unsigned char *out, unsigned int olen, | ||
unsigned char *in, unsigned int ilen); | ||
/* | ||
* The following two do NOTHING, but are kept for backward compatibility | ||
*/ | ||
long (*ctrl) (void); | ||
long (*callback_ctrl) (void); | ||
}; | ||
|
||
struct comp_ctx_st { | ||
COMP_METHOD *meth; | ||
unsigned long compress_in; | ||
unsigned long compress_out; | ||
unsigned long expand_in; | ||
unsigned long expand_out; | ||
CRYPTO_EX_DATA ex_data; | ||
}; | ||
|
||
COMP_CTX *COMP_CTX_new(COMP_METHOD *meth); | ||
void COMP_CTX_free(COMP_CTX *ctx); | ||
int COMP_compress_block(COMP_CTX *ctx, unsigned char *out, int olen, | ||
unsigned char *in, int ilen); | ||
int COMP_expand_block(COMP_CTX *ctx, unsigned char *out, int olen, | ||
unsigned char *in, int ilen); | ||
COMP_METHOD *COMP_rle(void); | ||
COMP_METHOD *COMP_zlib(void); | ||
void COMP_zlib_cleanup(void); | ||
|
||
# ifdef HEADER_BIO_H | ||
# ifdef ZLIB | ||
BIO_METHOD *BIO_f_zlib(void); | ||
# endif | ||
# endif | ||
|
||
/* BEGIN ERROR CODES */ | ||
/* | ||
* The following lines are auto generated by the script mkerr.pl. Any changes | ||
* made after this point may be overwritten when the script is next run. | ||
*/ | ||
void ERR_load_COMP_strings(void); | ||
|
||
/* Error codes for the COMP functions. */ | ||
|
||
/* Function codes. */ | ||
# define COMP_F_BIO_ZLIB_FLUSH 99 | ||
# define COMP_F_BIO_ZLIB_NEW 100 | ||
# define COMP_F_BIO_ZLIB_READ 101 | ||
# define COMP_F_BIO_ZLIB_WRITE 102 | ||
|
||
/* Reason codes. */ | ||
# define COMP_R_ZLIB_DEFLATE_ERROR 99 | ||
# define COMP_R_ZLIB_INFLATE_ERROR 100 | ||
# define COMP_R_ZLIB_NOT_SUPPORTED 101 | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
#endif |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,268 @@ | ||
/* crypto/conf/conf.h */ | ||
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | ||
* All rights reserved. | ||
* | ||
* This package is an SSL implementation written | ||
* by Eric Young (eay@cryptsoft.com). | ||
* The implementation was written so as to conform with Netscapes SSL. | ||
* | ||
* This library is free for commercial and non-commercial use as long as | ||
* the following conditions are aheared to. The following conditions | ||
* apply to all code found in this distribution, be it the RC4, RSA, | ||
* lhash, DES, etc., code; not just the SSL code. The SSL documentation | ||
* included with this distribution is covered by the same copyright terms | ||
* except that the holder is Tim Hudson (tjh@cryptsoft.com). | ||
* | ||
* Copyright remains Eric Young's, and as such any Copyright notices in | ||
* the code are not to be removed. | ||
* If this package is used in a product, Eric Young should be given attribution | ||
* as the author of the parts of the library used. | ||
* This can be in the form of a textual message at program startup or | ||
* in documentation (online or textual) provided with the package. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
* modification, are permitted provided that the following conditions | ||
* are met: | ||
* 1. Redistributions of source code must retain the copyright | ||
* notice, this list of conditions and the following disclaimer. | ||
* 2. Redistributions in binary form must reproduce the above copyright | ||
* notice, this list of conditions and the following disclaimer in the | ||
* documentation and/or other materials provided with the distribution. | ||
* 3. All advertising materials mentioning features or use of this software | ||
* must display the following acknowledgement: | ||
* "This product includes cryptographic software written by | ||
* Eric Young (eay@cryptsoft.com)" | ||
* The word 'cryptographic' can be left out if the rouines from the library | ||
* being used are not cryptographic related :-). | ||
* 4. If you include any Windows specific code (or a derivative thereof) from | ||
* the apps directory (application code) you must include an acknowledgement: | ||
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND | ||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE | ||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
* SUCH DAMAGE. | ||
* | ||
* The licence and distribution terms for any publically available version or | ||
* derivative of this code cannot be changed. i.e. this code cannot simply be | ||
* copied and put under another distribution licence | ||
* [including the GNU Public Licence.] | ||
*/ | ||
|
||
#ifndef HEADER_CONF_H | ||
# define HEADER_CONF_H | ||
|
||
# include <openssl/bio.h> | ||
# include <openssl/lhash.h> | ||
# include <openssl/stack.h> | ||
# include <openssl/safestack.h> | ||
# include <openssl/e_os2.h> | ||
|
||
# include <openssl/ossl_typ.h> | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
typedef struct { | ||
char *section; | ||
char *name; | ||
char *value; | ||
} CONF_VALUE; | ||
|
||
DECLARE_STACK_OF(CONF_VALUE) | ||
DECLARE_LHASH_OF(CONF_VALUE); | ||
|
||
struct conf_st; | ||
struct conf_method_st; | ||
typedef struct conf_method_st CONF_METHOD; | ||
|
||
struct conf_method_st { | ||
const char *name; | ||
CONF *(*create) (CONF_METHOD *meth); | ||
int (*init) (CONF *conf); | ||
int (*destroy) (CONF *conf); | ||
int (*destroy_data) (CONF *conf); | ||
int (*load_bio) (CONF *conf, BIO *bp, long *eline); | ||
int (*dump) (const CONF *conf, BIO *bp); | ||
int (*is_number) (const CONF *conf, char c); | ||
int (*to_int) (const CONF *conf, char c); | ||
int (*load) (CONF *conf, const char *name, long *eline); | ||
}; | ||
|
||
/* Module definitions */ | ||
|
||
typedef struct conf_imodule_st CONF_IMODULE; | ||
typedef struct conf_module_st CONF_MODULE; | ||
|
||
DECLARE_STACK_OF(CONF_MODULE) | ||
DECLARE_STACK_OF(CONF_IMODULE) | ||
|
||
/* DSO module function typedefs */ | ||
typedef int conf_init_func (CONF_IMODULE *md, const CONF *cnf); | ||
typedef void conf_finish_func (CONF_IMODULE *md); | ||
|
||
# define CONF_MFLAGS_IGNORE_ERRORS 0x1 | ||
# define CONF_MFLAGS_IGNORE_RETURN_CODES 0x2 | ||
# define CONF_MFLAGS_SILENT 0x4 | ||
# define CONF_MFLAGS_NO_DSO 0x8 | ||
# define CONF_MFLAGS_IGNORE_MISSING_FILE 0x10 | ||
# define CONF_MFLAGS_DEFAULT_SECTION 0x20 | ||
|
||
int CONF_set_default_method(CONF_METHOD *meth); | ||
void CONF_set_nconf(CONF *conf, LHASH_OF(CONF_VALUE) *hash); | ||
LHASH_OF(CONF_VALUE) *CONF_load(LHASH_OF(CONF_VALUE) *conf, const char *file, | ||
long *eline); | ||
# ifndef OPENSSL_NO_FP_API | ||
LHASH_OF(CONF_VALUE) *CONF_load_fp(LHASH_OF(CONF_VALUE) *conf, FILE *fp, | ||
long *eline); | ||
# endif | ||
LHASH_OF(CONF_VALUE) *CONF_load_bio(LHASH_OF(CONF_VALUE) *conf, BIO *bp, | ||
long *eline); | ||
STACK_OF(CONF_VALUE) *CONF_get_section(LHASH_OF(CONF_VALUE) *conf, | ||
const char *section); | ||
char *CONF_get_string(LHASH_OF(CONF_VALUE) *conf, const char *group, | ||
const char *name); | ||
long CONF_get_number(LHASH_OF(CONF_VALUE) *conf, const char *group, | ||
const char *name); | ||
void CONF_free(LHASH_OF(CONF_VALUE) *conf); | ||
int CONF_dump_fp(LHASH_OF(CONF_VALUE) *conf, FILE *out); | ||
int CONF_dump_bio(LHASH_OF(CONF_VALUE) *conf, BIO *out); | ||
|
||
void OPENSSL_config(const char *config_name); | ||
void OPENSSL_no_config(void); | ||
|
||
/* | ||
* New conf code. The semantics are different from the functions above. If | ||
* that wasn't the case, the above functions would have been replaced | ||
*/ | ||
|
||
struct conf_st { | ||
CONF_METHOD *meth; | ||
void *meth_data; | ||
LHASH_OF(CONF_VALUE) *data; | ||
}; | ||
|
||
CONF *NCONF_new(CONF_METHOD *meth); | ||
CONF_METHOD *NCONF_default(void); | ||
CONF_METHOD *NCONF_WIN32(void); | ||
# if 0 /* Just to give you an idea of what I have in | ||
* mind */ | ||
CONF_METHOD *NCONF_XML(void); | ||
# endif | ||
void NCONF_free(CONF *conf); | ||
void NCONF_free_data(CONF *conf); | ||
|
||
int NCONF_load(CONF *conf, const char *file, long *eline); | ||
# ifndef OPENSSL_NO_FP_API | ||
int NCONF_load_fp(CONF *conf, FILE *fp, long *eline); | ||
# endif | ||
int NCONF_load_bio(CONF *conf, BIO *bp, long *eline); | ||
STACK_OF(CONF_VALUE) *NCONF_get_section(const CONF *conf, | ||
const char *section); | ||
char *NCONF_get_string(const CONF *conf, const char *group, const char *name); | ||
int NCONF_get_number_e(const CONF *conf, const char *group, const char *name, | ||
long *result); | ||
int NCONF_dump_fp(const CONF *conf, FILE *out); | ||
int NCONF_dump_bio(const CONF *conf, BIO *out); | ||
|
||
# if 0 /* The following function has no error | ||
* checking, and should therefore be avoided */ | ||
long NCONF_get_number(CONF *conf, char *group, char *name); | ||
# else | ||
# define NCONF_get_number(c,g,n,r) NCONF_get_number_e(c,g,n,r) | ||
# endif | ||
|
||
/* Module functions */ | ||
|
||
int CONF_modules_load(const CONF *cnf, const char *appname, | ||
unsigned long flags); | ||
int CONF_modules_load_file(const char *filename, const char *appname, | ||
unsigned long flags); | ||
void CONF_modules_unload(int all); | ||
void CONF_modules_finish(void); | ||
void CONF_modules_free(void); | ||
int CONF_module_add(const char *name, conf_init_func *ifunc, | ||
conf_finish_func *ffunc); | ||
|
||
const char *CONF_imodule_get_name(const CONF_IMODULE *md); | ||
const char *CONF_imodule_get_value(const CONF_IMODULE *md); | ||
void *CONF_imodule_get_usr_data(const CONF_IMODULE *md); | ||
void CONF_imodule_set_usr_data(CONF_IMODULE *md, void *usr_data); | ||
CONF_MODULE *CONF_imodule_get_module(const CONF_IMODULE *md); | ||
unsigned long CONF_imodule_get_flags(const CONF_IMODULE *md); | ||
void CONF_imodule_set_flags(CONF_IMODULE *md, unsigned long flags); | ||
void *CONF_module_get_usr_data(CONF_MODULE *pmod); | ||
void CONF_module_set_usr_data(CONF_MODULE *pmod, void *usr_data); | ||
|
||
char *CONF_get1_default_config_file(void); | ||
|
||
int CONF_parse_list(const char *list, int sep, int nospc, | ||
int (*list_cb) (const char *elem, int len, void *usr), | ||
void *arg); | ||
|
||
void OPENSSL_load_builtin_modules(void); | ||
|
||
/* BEGIN ERROR CODES */ | ||
/* | ||
* The following lines are auto generated by the script mkerr.pl. Any changes | ||
* made after this point may be overwritten when the script is next run. | ||
*/ | ||
void ERR_load_CONF_strings(void); | ||
|
||
/* Error codes for the CONF functions. */ | ||
|
||
/* Function codes. */ | ||
# define CONF_F_CONF_DUMP_FP 104 | ||
# define CONF_F_CONF_LOAD 100 | ||
# define CONF_F_CONF_LOAD_BIO 102 | ||
# define CONF_F_CONF_LOAD_FP 103 | ||
# define CONF_F_CONF_MODULES_LOAD 116 | ||
# define CONF_F_CONF_PARSE_LIST 119 | ||
# define CONF_F_DEF_LOAD 120 | ||
# define CONF_F_DEF_LOAD_BIO 121 | ||
# define CONF_F_MODULE_INIT 115 | ||
# define CONF_F_MODULE_LOAD_DSO 117 | ||
# define CONF_F_MODULE_RUN 118 | ||
# define CONF_F_NCONF_DUMP_BIO 105 | ||
# define CONF_F_NCONF_DUMP_FP 106 | ||
# define CONF_F_NCONF_GET_NUMBER 107 | ||
# define CONF_F_NCONF_GET_NUMBER_E 112 | ||
# define CONF_F_NCONF_GET_SECTION 108 | ||
# define CONF_F_NCONF_GET_STRING 109 | ||
# define CONF_F_NCONF_LOAD 113 | ||
# define CONF_F_NCONF_LOAD_BIO 110 | ||
# define CONF_F_NCONF_LOAD_FP 114 | ||
# define CONF_F_NCONF_NEW 111 | ||
# define CONF_F_STR_COPY 101 | ||
|
||
/* Reason codes. */ | ||
# define CONF_R_ERROR_LOADING_DSO 110 | ||
# define CONF_R_LIST_CANNOT_BE_NULL 115 | ||
# define CONF_R_MISSING_CLOSE_SQUARE_BRACKET 100 | ||
# define CONF_R_MISSING_EQUAL_SIGN 101 | ||
# define CONF_R_MISSING_FINISH_FUNCTION 111 | ||
# define CONF_R_MISSING_INIT_FUNCTION 112 | ||
# define CONF_R_MODULE_INITIALIZATION_ERROR 109 | ||
# define CONF_R_NO_CLOSE_BRACE 102 | ||
# define CONF_R_NO_CONF 105 | ||
# define CONF_R_NO_CONF_OR_ENVIRONMENT_VARIABLE 106 | ||
# define CONF_R_NO_SECTION 107 | ||
# define CONF_R_NO_SUCH_FILE 114 | ||
# define CONF_R_NO_VALUE 108 | ||
# define CONF_R_UNABLE_TO_CREATE_NEW_SECTION 103 | ||
# define CONF_R_UNKNOWN_MODULE_NAME 113 | ||
# define CONF_R_VARIABLE_EXPANSION_TOO_LONG 116 | ||
# define CONF_R_VARIABLE_HAS_NO_VALUE 104 | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
#endif |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
/* conf_api.h */ | ||
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | ||
* All rights reserved. | ||
* | ||
* This package is an SSL implementation written | ||
* by Eric Young (eay@cryptsoft.com). | ||
* The implementation was written so as to conform with Netscapes SSL. | ||
* | ||
* This library is free for commercial and non-commercial use as long as | ||
* the following conditions are aheared to. The following conditions | ||
* apply to all code found in this distribution, be it the RC4, RSA, | ||
* lhash, DES, etc., code; not just the SSL code. The SSL documentation | ||
* included with this distribution is covered by the same copyright terms | ||
* except that the holder is Tim Hudson (tjh@cryptsoft.com). | ||
* | ||
* Copyright remains Eric Young's, and as such any Copyright notices in | ||
* the code are not to be removed. | ||
* If this package is used in a product, Eric Young should be given attribution | ||
* as the author of the parts of the library used. | ||
* This can be in the form of a textual message at program startup or | ||
* in documentation (online or textual) provided with the package. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
* modification, are permitted provided that the following conditions | ||
* are met: | ||
* 1. Redistributions of source code must retain the copyright | ||
* notice, this list of conditions and the following disclaimer. | ||
* 2. Redistributions in binary form must reproduce the above copyright | ||
* notice, this list of conditions and the following disclaimer in the | ||
* documentation and/or other materials provided with the distribution. | ||
* 3. All advertising materials mentioning features or use of this software | ||
* must display the following acknowledgement: | ||
* "This product includes cryptographic software written by | ||
* Eric Young (eay@cryptsoft.com)" | ||
* The word 'cryptographic' can be left out if the rouines from the library | ||
* being used are not cryptographic related :-). | ||
* 4. If you include any Windows specific code (or a derivative thereof) from | ||
* the apps directory (application code) you must include an acknowledgement: | ||
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND | ||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE | ||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
* SUCH DAMAGE. | ||
* | ||
* The licence and distribution terms for any publically available version or | ||
* derivative of this code cannot be changed. i.e. this code cannot simply be | ||
* copied and put under another distribution licence | ||
* [including the GNU Public Licence.] | ||
*/ | ||
|
||
#ifndef HEADER_CONF_API_H | ||
# define HEADER_CONF_API_H | ||
|
||
# include <openssl/lhash.h> | ||
# include <openssl/conf.h> | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
/* Up until OpenSSL 0.9.5a, this was new_section */ | ||
CONF_VALUE *_CONF_new_section(CONF *conf, const char *section); | ||
/* Up until OpenSSL 0.9.5a, this was get_section */ | ||
CONF_VALUE *_CONF_get_section(const CONF *conf, const char *section); | ||
/* Up until OpenSSL 0.9.5a, this was CONF_get_section */ | ||
STACK_OF(CONF_VALUE) *_CONF_get_section_values(const CONF *conf, | ||
const char *section); | ||
|
||
int _CONF_add_string(CONF *conf, CONF_VALUE *section, CONF_VALUE *value); | ||
char *_CONF_get_string(const CONF *conf, const char *section, | ||
const char *name); | ||
long _CONF_get_number(const CONF *conf, const char *section, | ||
const char *name); | ||
|
||
int _CONF_new_data(CONF *conf); | ||
void _CONF_free_data(CONF *conf); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
#endif |
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,257 @@ | ||
/* crypto/des/des.h */ | ||
/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) | ||
* All rights reserved. | ||
* | ||
* This package is an SSL implementation written | ||
* by Eric Young (eay@cryptsoft.com). | ||
* The implementation was written so as to conform with Netscapes SSL. | ||
* | ||
* This library is free for commercial and non-commercial use as long as | ||
* the following conditions are aheared to. The following conditions | ||
* apply to all code found in this distribution, be it the RC4, RSA, | ||
* lhash, DES, etc., code; not just the SSL code. The SSL documentation | ||
* included with this distribution is covered by the same copyright terms | ||
* except that the holder is Tim Hudson (tjh@cryptsoft.com). | ||
* | ||
* Copyright remains Eric Young's, and as such any Copyright notices in | ||
* the code are not to be removed. | ||
* If this package is used in a product, Eric Young should be given attribution | ||
* as the author of the parts of the library used. | ||
* This can be in the form of a textual message at program startup or | ||
* in documentation (online or textual) provided with the package. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
* modification, are permitted provided that the following conditions | ||
* are met: | ||
* 1. Redistributions of source code must retain the copyright | ||
* notice, this list of conditions and the following disclaimer. | ||
* 2. Redistributions in binary form must reproduce the above copyright | ||
* notice, this list of conditions and the following disclaimer in the | ||
* documentation and/or other materials provided with the distribution. | ||
* 3. All advertising materials mentioning features or use of this software | ||
* must display the following acknowledgement: | ||
* "This product includes cryptographic software written by | ||
* Eric Young (eay@cryptsoft.com)" | ||
* The word 'cryptographic' can be left out if the rouines from the library | ||
* being used are not cryptographic related :-). | ||
* 4. If you include any Windows specific code (or a derivative thereof) from | ||
* the apps directory (application code) you must include an acknowledgement: | ||
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND | ||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE | ||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
* SUCH DAMAGE. | ||
* | ||
* The licence and distribution terms for any publically available version or | ||
* derivative of this code cannot be changed. i.e. this code cannot simply be | ||
* copied and put under another distribution licence | ||
* [including the GNU Public Licence.] | ||
*/ | ||
|
||
#ifndef HEADER_NEW_DES_H | ||
# define HEADER_NEW_DES_H | ||
|
||
# include <openssl/e_os2.h> /* OPENSSL_EXTERN, OPENSSL_NO_DES, DES_LONG | ||
* (via openssl/opensslconf.h */ | ||
|
||
# ifdef OPENSSL_NO_DES | ||
# error DES is disabled. | ||
# endif | ||
|
||
# ifdef OPENSSL_BUILD_SHLIBCRYPTO | ||
# undef OPENSSL_EXTERN | ||
# define OPENSSL_EXTERN OPENSSL_EXPORT | ||
# endif | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
typedef unsigned char DES_cblock[8]; | ||
typedef /* const */ unsigned char const_DES_cblock[8]; | ||
/* | ||
* With "const", gcc 2.8.1 on Solaris thinks that DES_cblock * and | ||
* const_DES_cblock * are incompatible pointer types. | ||
*/ | ||
|
||
typedef struct DES_ks { | ||
union { | ||
DES_cblock cblock; | ||
/* | ||
* make sure things are correct size on machines with 8 byte longs | ||
*/ | ||
DES_LONG deslong[2]; | ||
} ks[16]; | ||
} DES_key_schedule; | ||
|
||
# ifndef OPENSSL_DISABLE_OLD_DES_SUPPORT | ||
# ifndef OPENSSL_ENABLE_OLD_DES_SUPPORT | ||
# define OPENSSL_ENABLE_OLD_DES_SUPPORT | ||
# endif | ||
# endif | ||
|
||
# ifdef OPENSSL_ENABLE_OLD_DES_SUPPORT | ||
# include <openssl/des_old.h> | ||
# endif | ||
|
||
# define DES_KEY_SZ (sizeof(DES_cblock)) | ||
# define DES_SCHEDULE_SZ (sizeof(DES_key_schedule)) | ||
|
||
# define DES_ENCRYPT 1 | ||
# define DES_DECRYPT 0 | ||
|
||
# define DES_CBC_MODE 0 | ||
# define DES_PCBC_MODE 1 | ||
|
||
# define DES_ecb2_encrypt(i,o,k1,k2,e) \ | ||
DES_ecb3_encrypt((i),(o),(k1),(k2),(k1),(e)) | ||
|
||
# define DES_ede2_cbc_encrypt(i,o,l,k1,k2,iv,e) \ | ||
DES_ede3_cbc_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(e)) | ||
|
||
# define DES_ede2_cfb64_encrypt(i,o,l,k1,k2,iv,n,e) \ | ||
DES_ede3_cfb64_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(n),(e)) | ||
|
||
# define DES_ede2_ofb64_encrypt(i,o,l,k1,k2,iv,n) \ | ||
DES_ede3_ofb64_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(n)) | ||
|
||
OPENSSL_DECLARE_GLOBAL(int, DES_check_key); /* defaults to false */ | ||
# define DES_check_key OPENSSL_GLOBAL_REF(DES_check_key) | ||
OPENSSL_DECLARE_GLOBAL(int, DES_rw_mode); /* defaults to DES_PCBC_MODE */ | ||
# define DES_rw_mode OPENSSL_GLOBAL_REF(DES_rw_mode) | ||
|
||
const char *DES_options(void); | ||
void DES_ecb3_encrypt(const_DES_cblock *input, DES_cblock *output, | ||
DES_key_schedule *ks1, DES_key_schedule *ks2, | ||
DES_key_schedule *ks3, int enc); | ||
DES_LONG DES_cbc_cksum(const unsigned char *input, DES_cblock *output, | ||
long length, DES_key_schedule *schedule, | ||
const_DES_cblock *ivec); | ||
/* DES_cbc_encrypt does not update the IV! Use DES_ncbc_encrypt instead. */ | ||
void DES_cbc_encrypt(const unsigned char *input, unsigned char *output, | ||
long length, DES_key_schedule *schedule, | ||
DES_cblock *ivec, int enc); | ||
void DES_ncbc_encrypt(const unsigned char *input, unsigned char *output, | ||
long length, DES_key_schedule *schedule, | ||
DES_cblock *ivec, int enc); | ||
void DES_xcbc_encrypt(const unsigned char *input, unsigned char *output, | ||
long length, DES_key_schedule *schedule, | ||
DES_cblock *ivec, const_DES_cblock *inw, | ||
const_DES_cblock *outw, int enc); | ||
void DES_cfb_encrypt(const unsigned char *in, unsigned char *out, int numbits, | ||
long length, DES_key_schedule *schedule, | ||
DES_cblock *ivec, int enc); | ||
void DES_ecb_encrypt(const_DES_cblock *input, DES_cblock *output, | ||
DES_key_schedule *ks, int enc); | ||
|
||
/* | ||
* This is the DES encryption function that gets called by just about every | ||
* other DES routine in the library. You should not use this function except | ||
* to implement 'modes' of DES. I say this because the functions that call | ||
* this routine do the conversion from 'char *' to long, and this needs to be | ||
* done to make sure 'non-aligned' memory access do not occur. The | ||
* characters are loaded 'little endian'. Data is a pointer to 2 unsigned | ||
* long's and ks is the DES_key_schedule to use. enc, is non zero specifies | ||
* encryption, zero if decryption. | ||
*/ | ||
void DES_encrypt1(DES_LONG *data, DES_key_schedule *ks, int enc); | ||
|
||
/* | ||
* This functions is the same as DES_encrypt1() except that the DES initial | ||
* permutation (IP) and final permutation (FP) have been left out. As for | ||
* DES_encrypt1(), you should not use this function. It is used by the | ||
* routines in the library that implement triple DES. IP() DES_encrypt2() | ||
* DES_encrypt2() DES_encrypt2() FP() is the same as DES_encrypt1() | ||
* DES_encrypt1() DES_encrypt1() except faster :-). | ||
*/ | ||
void DES_encrypt2(DES_LONG *data, DES_key_schedule *ks, int enc); | ||
|
||
void DES_encrypt3(DES_LONG *data, DES_key_schedule *ks1, | ||
DES_key_schedule *ks2, DES_key_schedule *ks3); | ||
void DES_decrypt3(DES_LONG *data, DES_key_schedule *ks1, | ||
DES_key_schedule *ks2, DES_key_schedule *ks3); | ||
void DES_ede3_cbc_encrypt(const unsigned char *input, unsigned char *output, | ||
long length, | ||
DES_key_schedule *ks1, DES_key_schedule *ks2, | ||
DES_key_schedule *ks3, DES_cblock *ivec, int enc); | ||
void DES_ede3_cbcm_encrypt(const unsigned char *in, unsigned char *out, | ||
long length, | ||
DES_key_schedule *ks1, DES_key_schedule *ks2, | ||
DES_key_schedule *ks3, | ||
DES_cblock *ivec1, DES_cblock *ivec2, int enc); | ||
void DES_ede3_cfb64_encrypt(const unsigned char *in, unsigned char *out, | ||
long length, DES_key_schedule *ks1, | ||
DES_key_schedule *ks2, DES_key_schedule *ks3, | ||
DES_cblock *ivec, int *num, int enc); | ||
void DES_ede3_cfb_encrypt(const unsigned char *in, unsigned char *out, | ||
int numbits, long length, DES_key_schedule *ks1, | ||
DES_key_schedule *ks2, DES_key_schedule *ks3, | ||
DES_cblock *ivec, int enc); | ||
void DES_ede3_ofb64_encrypt(const unsigned char *in, unsigned char *out, | ||
long length, DES_key_schedule *ks1, | ||
DES_key_schedule *ks2, DES_key_schedule *ks3, | ||
DES_cblock *ivec, int *num); | ||
# if 0 | ||
void DES_xwhite_in2out(const_DES_cblock *DES_key, const_DES_cblock *in_white, | ||
DES_cblock *out_white); | ||
# endif | ||
|
||
int DES_enc_read(int fd, void *buf, int len, DES_key_schedule *sched, | ||
DES_cblock *iv); | ||
int DES_enc_write(int fd, const void *buf, int len, DES_key_schedule *sched, | ||
DES_cblock *iv); | ||
char *DES_fcrypt(const char *buf, const char *salt, char *ret); | ||
char *DES_crypt(const char *buf, const char *salt); | ||
void DES_ofb_encrypt(const unsigned char *in, unsigned char *out, int numbits, | ||
long length, DES_key_schedule *schedule, | ||
DES_cblock *ivec); | ||
void DES_pcbc_encrypt(const unsigned char *input, unsigned char *output, | ||
long length, DES_key_schedule *schedule, | ||
DES_cblock *ivec, int enc); | ||
DES_LONG DES_quad_cksum(const unsigned char *input, DES_cblock output[], | ||
long length, int out_count, DES_cblock *seed); | ||
int DES_random_key(DES_cblock *ret); | ||
void DES_set_odd_parity(DES_cblock *key); | ||
int DES_check_key_parity(const_DES_cblock *key); | ||
int DES_is_weak_key(const_DES_cblock *key); | ||
/* | ||
* DES_set_key (= set_key = DES_key_sched = key_sched) calls | ||
* DES_set_key_checked if global variable DES_check_key is set, | ||
* DES_set_key_unchecked otherwise. | ||
*/ | ||
int DES_set_key(const_DES_cblock *key, DES_key_schedule *schedule); | ||
int DES_key_sched(const_DES_cblock *key, DES_key_schedule *schedule); | ||
int DES_set_key_checked(const_DES_cblock *key, DES_key_schedule *schedule); | ||
void DES_set_key_unchecked(const_DES_cblock *key, DES_key_schedule *schedule); | ||
# ifdef OPENSSL_FIPS | ||
void private_DES_set_key_unchecked(const_DES_cblock *key, | ||
DES_key_schedule *schedule); | ||
# endif | ||
void DES_string_to_key(const char *str, DES_cblock *key); | ||
void DES_string_to_2keys(const char *str, DES_cblock *key1, DES_cblock *key2); | ||
void DES_cfb64_encrypt(const unsigned char *in, unsigned char *out, | ||
long length, DES_key_schedule *schedule, | ||
DES_cblock *ivec, int *num, int enc); | ||
void DES_ofb64_encrypt(const unsigned char *in, unsigned char *out, | ||
long length, DES_key_schedule *schedule, | ||
DES_cblock *ivec, int *num); | ||
|
||
int DES_read_password(DES_cblock *key, const char *prompt, int verify); | ||
int DES_read_2passwords(DES_cblock *key1, DES_cblock *key2, | ||
const char *prompt, int verify); | ||
|
||
# define DES_fixup_key_parity DES_set_odd_parity | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif |
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,332 @@ | ||
/* crypto/dsa/dsa.h */ | ||
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | ||
* All rights reserved. | ||
* | ||
* This package is an SSL implementation written | ||
* by Eric Young (eay@cryptsoft.com). | ||
* The implementation was written so as to conform with Netscapes SSL. | ||
* | ||
* This library is free for commercial and non-commercial use as long as | ||
* the following conditions are aheared to. The following conditions | ||
* apply to all code found in this distribution, be it the RC4, RSA, | ||
* lhash, DES, etc., code; not just the SSL code. The SSL documentation | ||
* included with this distribution is covered by the same copyright terms | ||
* except that the holder is Tim Hudson (tjh@cryptsoft.com). | ||
* | ||
* Copyright remains Eric Young's, and as such any Copyright notices in | ||
* the code are not to be removed. | ||
* If this package is used in a product, Eric Young should be given attribution | ||
* as the author of the parts of the library used. | ||
* This can be in the form of a textual message at program startup or | ||
* in documentation (online or textual) provided with the package. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
* modification, are permitted provided that the following conditions | ||
* are met: | ||
* 1. Redistributions of source code must retain the copyright | ||
* notice, this list of conditions and the following disclaimer. | ||
* 2. Redistributions in binary form must reproduce the above copyright | ||
* notice, this list of conditions and the following disclaimer in the | ||
* documentation and/or other materials provided with the distribution. | ||
* 3. All advertising materials mentioning features or use of this software | ||
* must display the following acknowledgement: | ||
* "This product includes cryptographic software written by | ||
* Eric Young (eay@cryptsoft.com)" | ||
* The word 'cryptographic' can be left out if the rouines from the library | ||
* being used are not cryptographic related :-). | ||
* 4. If you include any Windows specific code (or a derivative thereof) from | ||
* the apps directory (application code) you must include an acknowledgement: | ||
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND | ||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE | ||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
* SUCH DAMAGE. | ||
* | ||
* The licence and distribution terms for any publically available version or | ||
* derivative of this code cannot be changed. i.e. this code cannot simply be | ||
* copied and put under another distribution licence | ||
* [including the GNU Public Licence.] | ||
*/ | ||
|
||
/* | ||
* The DSS routines are based on patches supplied by | ||
* Steven Schoch <schoch@sheba.arc.nasa.gov>. He basically did the | ||
* work and I have just tweaked them a little to fit into my | ||
* stylistic vision for SSLeay :-) */ | ||
|
||
#ifndef HEADER_DSA_H | ||
# define HEADER_DSA_H | ||
|
||
# include <openssl/e_os2.h> | ||
|
||
# ifdef OPENSSL_NO_DSA | ||
# error DSA is disabled. | ||
# endif | ||
|
||
# ifndef OPENSSL_NO_BIO | ||
# include <openssl/bio.h> | ||
# endif | ||
# include <openssl/crypto.h> | ||
# include <openssl/ossl_typ.h> | ||
|
||
# ifndef OPENSSL_NO_DEPRECATED | ||
# include <openssl/bn.h> | ||
# ifndef OPENSSL_NO_DH | ||
# include <openssl/dh.h> | ||
# endif | ||
# endif | ||
|
||
# ifndef OPENSSL_DSA_MAX_MODULUS_BITS | ||
# define OPENSSL_DSA_MAX_MODULUS_BITS 10000 | ||
# endif | ||
|
||
# define DSA_FLAG_CACHE_MONT_P 0x01 | ||
/* | ||
* new with 0.9.7h; the built-in DSA implementation now uses constant time | ||
* modular exponentiation for secret exponents by default. This flag causes | ||
* the faster variable sliding window method to be used for all exponents. | ||
*/ | ||
# define DSA_FLAG_NO_EXP_CONSTTIME 0x02 | ||
|
||
/* | ||
* If this flag is set the DSA method is FIPS compliant and can be used in | ||
* FIPS mode. This is set in the validated module method. If an application | ||
* sets this flag in its own methods it is its reposibility to ensure the | ||
* result is compliant. | ||
*/ | ||
|
||
# define DSA_FLAG_FIPS_METHOD 0x0400 | ||
|
||
/* | ||
* If this flag is set the operations normally disabled in FIPS mode are | ||
* permitted it is then the applications responsibility to ensure that the | ||
* usage is compliant. | ||
*/ | ||
|
||
# define DSA_FLAG_NON_FIPS_ALLOW 0x0400 | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
/* Already defined in ossl_typ.h */ | ||
/* typedef struct dsa_st DSA; */ | ||
/* typedef struct dsa_method DSA_METHOD; */ | ||
|
||
typedef struct DSA_SIG_st { | ||
BIGNUM *r; | ||
BIGNUM *s; | ||
} DSA_SIG; | ||
|
||
struct dsa_method { | ||
const char *name; | ||
DSA_SIG *(*dsa_do_sign) (const unsigned char *dgst, int dlen, DSA *dsa); | ||
int (*dsa_sign_setup) (DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp, | ||
BIGNUM **rp); | ||
int (*dsa_do_verify) (const unsigned char *dgst, int dgst_len, | ||
DSA_SIG *sig, DSA *dsa); | ||
int (*dsa_mod_exp) (DSA *dsa, BIGNUM *rr, BIGNUM *a1, BIGNUM *p1, | ||
BIGNUM *a2, BIGNUM *p2, BIGNUM *m, BN_CTX *ctx, | ||
BN_MONT_CTX *in_mont); | ||
/* Can be null */ | ||
int (*bn_mod_exp) (DSA *dsa, BIGNUM *r, BIGNUM *a, const BIGNUM *p, | ||
const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx); | ||
int (*init) (DSA *dsa); | ||
int (*finish) (DSA *dsa); | ||
int flags; | ||
char *app_data; | ||
/* If this is non-NULL, it is used to generate DSA parameters */ | ||
int (*dsa_paramgen) (DSA *dsa, int bits, | ||
const unsigned char *seed, int seed_len, | ||
int *counter_ret, unsigned long *h_ret, | ||
BN_GENCB *cb); | ||
/* If this is non-NULL, it is used to generate DSA keys */ | ||
int (*dsa_keygen) (DSA *dsa); | ||
}; | ||
|
||
struct dsa_st { | ||
/* | ||
* This first variable is used to pick up errors where a DSA is passed | ||
* instead of of a EVP_PKEY | ||
*/ | ||
int pad; | ||
long version; | ||
int write_params; | ||
BIGNUM *p; | ||
BIGNUM *q; /* == 20 */ | ||
BIGNUM *g; | ||
BIGNUM *pub_key; /* y public key */ | ||
BIGNUM *priv_key; /* x private key */ | ||
BIGNUM *kinv; /* Signing pre-calc */ | ||
BIGNUM *r; /* Signing pre-calc */ | ||
int flags; | ||
/* Normally used to cache montgomery values */ | ||
BN_MONT_CTX *method_mont_p; | ||
int references; | ||
CRYPTO_EX_DATA ex_data; | ||
const DSA_METHOD *meth; | ||
/* functional reference if 'meth' is ENGINE-provided */ | ||
ENGINE *engine; | ||
}; | ||
|
||
# define d2i_DSAparams_fp(fp,x) (DSA *)ASN1_d2i_fp((char *(*)())DSA_new, \ | ||
(char *(*)())d2i_DSAparams,(fp),(unsigned char **)(x)) | ||
# define i2d_DSAparams_fp(fp,x) ASN1_i2d_fp(i2d_DSAparams,(fp), \ | ||
(unsigned char *)(x)) | ||
# define d2i_DSAparams_bio(bp,x) ASN1_d2i_bio_of(DSA,DSA_new,d2i_DSAparams,bp,x) | ||
# define i2d_DSAparams_bio(bp,x) ASN1_i2d_bio_of_const(DSA,i2d_DSAparams,bp,x) | ||
|
||
DSA *DSAparams_dup(DSA *x); | ||
DSA_SIG *DSA_SIG_new(void); | ||
void DSA_SIG_free(DSA_SIG *a); | ||
int i2d_DSA_SIG(const DSA_SIG *a, unsigned char **pp); | ||
DSA_SIG *d2i_DSA_SIG(DSA_SIG **v, const unsigned char **pp, long length); | ||
|
||
DSA_SIG *DSA_do_sign(const unsigned char *dgst, int dlen, DSA *dsa); | ||
int DSA_do_verify(const unsigned char *dgst, int dgst_len, | ||
DSA_SIG *sig, DSA *dsa); | ||
|
||
const DSA_METHOD *DSA_OpenSSL(void); | ||
|
||
void DSA_set_default_method(const DSA_METHOD *); | ||
const DSA_METHOD *DSA_get_default_method(void); | ||
int DSA_set_method(DSA *dsa, const DSA_METHOD *); | ||
|
||
DSA *DSA_new(void); | ||
DSA *DSA_new_method(ENGINE *engine); | ||
void DSA_free(DSA *r); | ||
/* "up" the DSA object's reference count */ | ||
int DSA_up_ref(DSA *r); | ||
int DSA_size(const DSA *); | ||
/* next 4 return -1 on error */ | ||
int DSA_sign_setup(DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp, BIGNUM **rp); | ||
int DSA_sign(int type, const unsigned char *dgst, int dlen, | ||
unsigned char *sig, unsigned int *siglen, DSA *dsa); | ||
int DSA_verify(int type, const unsigned char *dgst, int dgst_len, | ||
const unsigned char *sigbuf, int siglen, DSA *dsa); | ||
int DSA_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, | ||
CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func); | ||
int DSA_set_ex_data(DSA *d, int idx, void *arg); | ||
void *DSA_get_ex_data(DSA *d, int idx); | ||
|
||
DSA *d2i_DSAPublicKey(DSA **a, const unsigned char **pp, long length); | ||
DSA *d2i_DSAPrivateKey(DSA **a, const unsigned char **pp, long length); | ||
DSA *d2i_DSAparams(DSA **a, const unsigned char **pp, long length); | ||
|
||
/* Deprecated version */ | ||
# ifndef OPENSSL_NO_DEPRECATED | ||
DSA *DSA_generate_parameters(int bits, | ||
unsigned char *seed, int seed_len, | ||
int *counter_ret, unsigned long *h_ret, void | ||
(*callback) (int, int, void *), void *cb_arg); | ||
# endif /* !defined(OPENSSL_NO_DEPRECATED) */ | ||
|
||
/* New version */ | ||
int DSA_generate_parameters_ex(DSA *dsa, int bits, | ||
const unsigned char *seed, int seed_len, | ||
int *counter_ret, unsigned long *h_ret, | ||
BN_GENCB *cb); | ||
|
||
int DSA_generate_key(DSA *a); | ||
int i2d_DSAPublicKey(const DSA *a, unsigned char **pp); | ||
int i2d_DSAPrivateKey(const DSA *a, unsigned char **pp); | ||
int i2d_DSAparams(const DSA *a, unsigned char **pp); | ||
|
||
# ifndef OPENSSL_NO_BIO | ||
int DSAparams_print(BIO *bp, const DSA *x); | ||
int DSA_print(BIO *bp, const DSA *x, int off); | ||
# endif | ||
# ifndef OPENSSL_NO_FP_API | ||
int DSAparams_print_fp(FILE *fp, const DSA *x); | ||
int DSA_print_fp(FILE *bp, const DSA *x, int off); | ||
# endif | ||
|
||
# define DSS_prime_checks 50 | ||
/* | ||
* Primality test according to FIPS PUB 186[-1], Appendix 2.1: 50 rounds of | ||
* Rabin-Miller | ||
*/ | ||
# define DSA_is_prime(n, callback, cb_arg) \ | ||
BN_is_prime(n, DSS_prime_checks, callback, NULL, cb_arg) | ||
|
||
# ifndef OPENSSL_NO_DH | ||
/* | ||
* Convert DSA structure (key or just parameters) into DH structure (be | ||
* careful to avoid small subgroup attacks when using this!) | ||
*/ | ||
DH *DSA_dup_DH(const DSA *r); | ||
# endif | ||
|
||
# define EVP_PKEY_CTX_set_dsa_paramgen_bits(ctx, nbits) \ | ||
EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DSA, EVP_PKEY_OP_PARAMGEN, \ | ||
EVP_PKEY_CTRL_DSA_PARAMGEN_BITS, nbits, NULL) | ||
|
||
# define EVP_PKEY_CTRL_DSA_PARAMGEN_BITS (EVP_PKEY_ALG_CTRL + 1) | ||
# define EVP_PKEY_CTRL_DSA_PARAMGEN_Q_BITS (EVP_PKEY_ALG_CTRL + 2) | ||
# define EVP_PKEY_CTRL_DSA_PARAMGEN_MD (EVP_PKEY_ALG_CTRL + 3) | ||
|
||
/* BEGIN ERROR CODES */ | ||
/* | ||
* The following lines are auto generated by the script mkerr.pl. Any changes | ||
* made after this point may be overwritten when the script is next run. | ||
*/ | ||
void ERR_load_DSA_strings(void); | ||
|
||
/* Error codes for the DSA functions. */ | ||
|
||
/* Function codes. */ | ||
# define DSA_F_D2I_DSA_SIG 110 | ||
# define DSA_F_DO_DSA_PRINT 104 | ||
# define DSA_F_DSAPARAMS_PRINT 100 | ||
# define DSA_F_DSAPARAMS_PRINT_FP 101 | ||
# define DSA_F_DSA_BUILTIN_PARAMGEN2 126 | ||
# define DSA_F_DSA_DO_SIGN 112 | ||
# define DSA_F_DSA_DO_VERIFY 113 | ||
# define DSA_F_DSA_GENERATE_KEY 124 | ||
# define DSA_F_DSA_GENERATE_PARAMETERS_EX 123 | ||
# define DSA_F_DSA_NEW_METHOD 103 | ||
# define DSA_F_DSA_PARAM_DECODE 119 | ||
# define DSA_F_DSA_PRINT_FP 105 | ||
# define DSA_F_DSA_PRIV_DECODE 115 | ||
# define DSA_F_DSA_PRIV_ENCODE 116 | ||
# define DSA_F_DSA_PUB_DECODE 117 | ||
# define DSA_F_DSA_PUB_ENCODE 118 | ||
# define DSA_F_DSA_SIGN 106 | ||
# define DSA_F_DSA_SIGN_SETUP 107 | ||
# define DSA_F_DSA_SIG_NEW 109 | ||
# define DSA_F_DSA_SIG_PRINT 125 | ||
# define DSA_F_DSA_VERIFY 108 | ||
# define DSA_F_I2D_DSA_SIG 111 | ||
# define DSA_F_OLD_DSA_PRIV_DECODE 122 | ||
# define DSA_F_PKEY_DSA_CTRL 120 | ||
# define DSA_F_PKEY_DSA_KEYGEN 121 | ||
# define DSA_F_SIG_CB 114 | ||
|
||
/* Reason codes. */ | ||
# define DSA_R_BAD_Q_VALUE 102 | ||
# define DSA_R_BN_DECODE_ERROR 108 | ||
# define DSA_R_BN_ERROR 109 | ||
# define DSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE 100 | ||
# define DSA_R_DECODE_ERROR 104 | ||
# define DSA_R_INVALID_DIGEST_TYPE 106 | ||
# define DSA_R_INVALID_PARAMETERS 112 | ||
# define DSA_R_MISSING_PARAMETERS 101 | ||
# define DSA_R_MODULUS_TOO_LARGE 103 | ||
# define DSA_R_NEED_NEW_SETUP_VALUES 110 | ||
# define DSA_R_NON_FIPS_DSA_METHOD 111 | ||
# define DSA_R_NO_PARAMETERS_SET 107 | ||
# define DSA_R_PARAMETER_ENCODING_ERROR 105 | ||
# define DSA_R_Q_NOT_PRIME 113 | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
#endif |
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,272 @@ | ||
/* ssl/dtls1.h */ | ||
/* | ||
* DTLS implementation written by Nagendra Modadugu | ||
* (nagendra@cs.stanford.edu) for the OpenSSL project 2005. | ||
*/ | ||
/* ==================================================================== | ||
* Copyright (c) 1999-2005 The OpenSSL Project. All rights reserved. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
* modification, are permitted provided that the following conditions | ||
* are met: | ||
* | ||
* 1. Redistributions of source code must retain the above copyright | ||
* notice, this list of conditions and the following disclaimer. | ||
* | ||
* 2. Redistributions in binary form must reproduce the above copyright | ||
* notice, this list of conditions and the following disclaimer in | ||
* the documentation and/or other materials provided with the | ||
* distribution. | ||
* | ||
* 3. All advertising materials mentioning features or use of this | ||
* software must display the following acknowledgment: | ||
* "This product includes software developed by the OpenSSL Project | ||
* for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" | ||
* | ||
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to | ||
* endorse or promote products derived from this software without | ||
* prior written permission. For written permission, please contact | ||
* openssl-core@OpenSSL.org. | ||
* | ||
* 5. Products derived from this software may not be called "OpenSSL" | ||
* nor may "OpenSSL" appear in their names without prior written | ||
* permission of the OpenSSL Project. | ||
* | ||
* 6. Redistributions of any form whatsoever must retain the following | ||
* acknowledgment: | ||
* "This product includes software developed by the OpenSSL Project | ||
* for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY | ||
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR | ||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
* OF THE POSSIBILITY OF SUCH DAMAGE. | ||
* ==================================================================== | ||
* | ||
* This product includes cryptographic software written by Eric Young | ||
* (eay@cryptsoft.com). This product includes software written by Tim | ||
* Hudson (tjh@cryptsoft.com). | ||
* | ||
*/ | ||
|
||
#ifndef HEADER_DTLS1_H | ||
# define HEADER_DTLS1_H | ||
|
||
# include <openssl/buffer.h> | ||
# include <openssl/pqueue.h> | ||
# ifdef OPENSSL_SYS_VMS | ||
# include <resource.h> | ||
# include <sys/timeb.h> | ||
# endif | ||
# ifdef OPENSSL_SYS_WIN32 | ||
/* Needed for struct timeval */ | ||
# include <winsock.h> | ||
# elif defined(OPENSSL_SYS_NETWARE) && !defined(_WINSOCK2API_) | ||
# include <sys/timeval.h> | ||
# else | ||
# if defined(OPENSSL_SYS_VXWORKS) | ||
# include <sys/times.h> | ||
# else | ||
# include <sys/time.h> | ||
# endif | ||
# endif | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
# define DTLS1_VERSION 0xFEFF | ||
# define DTLS1_2_VERSION 0xFEFD | ||
# define DTLS_MAX_VERSION DTLS1_2_VERSION | ||
# define DTLS1_VERSION_MAJOR 0xFE | ||
|
||
# define DTLS1_BAD_VER 0x0100 | ||
|
||
/* Special value for method supporting multiple versions */ | ||
# define DTLS_ANY_VERSION 0x1FFFF | ||
|
||
# if 0 | ||
/* this alert description is not specified anywhere... */ | ||
# define DTLS1_AD_MISSING_HANDSHAKE_MESSAGE 110 | ||
# endif | ||
|
||
/* lengths of messages */ | ||
# define DTLS1_COOKIE_LENGTH 256 | ||
|
||
# define DTLS1_RT_HEADER_LENGTH 13 | ||
|
||
# define DTLS1_HM_HEADER_LENGTH 12 | ||
|
||
# define DTLS1_HM_BAD_FRAGMENT -2 | ||
# define DTLS1_HM_FRAGMENT_RETRY -3 | ||
|
||
# define DTLS1_CCS_HEADER_LENGTH 1 | ||
|
||
# ifdef DTLS1_AD_MISSING_HANDSHAKE_MESSAGE | ||
# define DTLS1_AL_HEADER_LENGTH 7 | ||
# else | ||
# define DTLS1_AL_HEADER_LENGTH 2 | ||
# endif | ||
|
||
# ifndef OPENSSL_NO_SSL_INTERN | ||
|
||
# ifndef OPENSSL_NO_SCTP | ||
# define DTLS1_SCTP_AUTH_LABEL "EXPORTER_DTLS_OVER_SCTP" | ||
# endif | ||
|
||
/* Max MTU overhead we know about so far is 40 for IPv6 + 8 for UDP */ | ||
# define DTLS1_MAX_MTU_OVERHEAD 48 | ||
|
||
typedef struct dtls1_bitmap_st { | ||
unsigned long map; /* track 32 packets on 32-bit systems and 64 | ||
* - on 64-bit systems */ | ||
unsigned char max_seq_num[8]; /* max record number seen so far, 64-bit | ||
* value in big-endian encoding */ | ||
} DTLS1_BITMAP; | ||
|
||
struct dtls1_retransmit_state { | ||
EVP_CIPHER_CTX *enc_write_ctx; /* cryptographic state */ | ||
EVP_MD_CTX *write_hash; /* used for mac generation */ | ||
# ifndef OPENSSL_NO_COMP | ||
COMP_CTX *compress; /* compression */ | ||
# else | ||
char *compress; | ||
# endif | ||
SSL_SESSION *session; | ||
unsigned short epoch; | ||
}; | ||
|
||
struct hm_header_st { | ||
unsigned char type; | ||
unsigned long msg_len; | ||
unsigned short seq; | ||
unsigned long frag_off; | ||
unsigned long frag_len; | ||
unsigned int is_ccs; | ||
struct dtls1_retransmit_state saved_retransmit_state; | ||
}; | ||
|
||
struct ccs_header_st { | ||
unsigned char type; | ||
unsigned short seq; | ||
}; | ||
|
||
struct dtls1_timeout_st { | ||
/* Number of read timeouts so far */ | ||
unsigned int read_timeouts; | ||
/* Number of write timeouts so far */ | ||
unsigned int write_timeouts; | ||
/* Number of alerts received so far */ | ||
unsigned int num_alerts; | ||
}; | ||
|
||
typedef struct record_pqueue_st { | ||
unsigned short epoch; | ||
pqueue q; | ||
} record_pqueue; | ||
|
||
typedef struct hm_fragment_st { | ||
struct hm_header_st msg_header; | ||
unsigned char *fragment; | ||
unsigned char *reassembly; | ||
} hm_fragment; | ||
|
||
typedef struct dtls1_state_st { | ||
unsigned int send_cookie; | ||
unsigned char cookie[DTLS1_COOKIE_LENGTH]; | ||
unsigned char rcvd_cookie[DTLS1_COOKIE_LENGTH]; | ||
unsigned int cookie_len; | ||
/* | ||
* The current data and handshake epoch. This is initially | ||
* undefined, and starts at zero once the initial handshake is | ||
* completed | ||
*/ | ||
unsigned short r_epoch; | ||
unsigned short w_epoch; | ||
/* records being received in the current epoch */ | ||
DTLS1_BITMAP bitmap; | ||
/* renegotiation starts a new set of sequence numbers */ | ||
DTLS1_BITMAP next_bitmap; | ||
/* handshake message numbers */ | ||
unsigned short handshake_write_seq; | ||
unsigned short next_handshake_write_seq; | ||
unsigned short handshake_read_seq; | ||
/* save last sequence number for retransmissions */ | ||
unsigned char last_write_sequence[8]; | ||
/* Received handshake records (processed and unprocessed) */ | ||
record_pqueue unprocessed_rcds; | ||
record_pqueue processed_rcds; | ||
/* Buffered handshake messages */ | ||
pqueue buffered_messages; | ||
/* Buffered (sent) handshake records */ | ||
pqueue sent_messages; | ||
/* | ||
* Buffered application records. Only for records between CCS and | ||
* Finished to prevent either protocol violation or unnecessary message | ||
* loss. | ||
*/ | ||
record_pqueue buffered_app_data; | ||
/* Is set when listening for new connections with dtls1_listen() */ | ||
unsigned int listen; | ||
unsigned int link_mtu; /* max on-the-wire DTLS packet size */ | ||
unsigned int mtu; /* max DTLS packet size */ | ||
struct hm_header_st w_msg_hdr; | ||
struct hm_header_st r_msg_hdr; | ||
struct dtls1_timeout_st timeout; | ||
/* | ||
* Indicates when the last handshake msg or heartbeat sent will timeout | ||
*/ | ||
struct timeval next_timeout; | ||
/* Timeout duration */ | ||
unsigned short timeout_duration; | ||
/* | ||
* storage for Alert/Handshake protocol data received but not yet | ||
* processed by ssl3_read_bytes: | ||
*/ | ||
unsigned char alert_fragment[DTLS1_AL_HEADER_LENGTH]; | ||
unsigned int alert_fragment_len; | ||
unsigned char handshake_fragment[DTLS1_HM_HEADER_LENGTH]; | ||
unsigned int handshake_fragment_len; | ||
unsigned int retransmitting; | ||
/* | ||
* Set when the handshake is ready to process peer's ChangeCipherSpec message. | ||
* Cleared after the message has been processed. | ||
*/ | ||
unsigned int change_cipher_spec_ok; | ||
# ifndef OPENSSL_NO_SCTP | ||
/* used when SSL_ST_XX_FLUSH is entered */ | ||
int next_state; | ||
int shutdown_received; | ||
# endif | ||
} DTLS1_STATE; | ||
|
||
typedef struct dtls1_record_data_st { | ||
unsigned char *packet; | ||
unsigned int packet_length; | ||
SSL3_BUFFER rbuf; | ||
SSL3_RECORD rrec; | ||
# ifndef OPENSSL_NO_SCTP | ||
struct bio_dgram_sctp_rcvinfo recordinfo; | ||
# endif | ||
} DTLS1_RECORD_DATA; | ||
|
||
# endif | ||
|
||
/* Timeout multipliers (timeout slice is defined in apps/timeouts.h */ | ||
# define DTLS1_TMO_READ_COUNT 2 | ||
# define DTLS1_TMO_WRITE_COUNT 2 | ||
|
||
# define DTLS1_TMO_ALERT_COUNT 12 | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
#endif |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,328 @@ | ||
/* e_os2.h */ | ||
/* ==================================================================== | ||
* Copyright (c) 1998-2000 The OpenSSL Project. All rights reserved. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
* modification, are permitted provided that the following conditions | ||
* are met: | ||
* | ||
* 1. Redistributions of source code must retain the above copyright | ||
* notice, this list of conditions and the following disclaimer. | ||
* | ||
* 2. Redistributions in binary form must reproduce the above copyright | ||
* notice, this list of conditions and the following disclaimer in | ||
* the documentation and/or other materials provided with the | ||
* distribution. | ||
* | ||
* 3. All advertising materials mentioning features or use of this | ||
* software must display the following acknowledgment: | ||
* "This product includes software developed by the OpenSSL Project | ||
* for use in the OpenSSL Toolkit. (http://www.openssl.org/)" | ||
* | ||
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to | ||
* endorse or promote products derived from this software without | ||
* prior written permission. For written permission, please contact | ||
* openssl-core@openssl.org. | ||
* | ||
* 5. Products derived from this software may not be called "OpenSSL" | ||
* nor may "OpenSSL" appear in their names without prior written | ||
* permission of the OpenSSL Project. | ||
* | ||
* 6. Redistributions of any form whatsoever must retain the following | ||
* acknowledgment: | ||
* "This product includes software developed by the OpenSSL Project | ||
* for use in the OpenSSL Toolkit (http://www.openssl.org/)" | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY | ||
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR | ||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
* OF THE POSSIBILITY OF SUCH DAMAGE. | ||
* ==================================================================== | ||
* | ||
* This product includes cryptographic software written by Eric Young | ||
* (eay@cryptsoft.com). This product includes software written by Tim | ||
* Hudson (tjh@cryptsoft.com). | ||
* | ||
*/ | ||
|
||
#include <openssl/opensslconf.h> | ||
|
||
#ifndef HEADER_E_OS2_H | ||
# define HEADER_E_OS2_H | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
/****************************************************************************** | ||
* Detect operating systems. This probably needs completing. | ||
* The result is that at least one OPENSSL_SYS_os macro should be defined. | ||
* However, if none is defined, Unix is assumed. | ||
**/ | ||
|
||
# define OPENSSL_SYS_UNIX | ||
|
||
/* ---------------------- Macintosh, before MacOS X ----------------------- */ | ||
# if defined(__MWERKS__) && defined(macintosh) || defined(OPENSSL_SYSNAME_MAC) | ||
# undef OPENSSL_SYS_UNIX | ||
# define OPENSSL_SYS_MACINTOSH_CLASSIC | ||
# endif | ||
|
||
/* ---------------------- NetWare ----------------------------------------- */ | ||
# if defined(NETWARE) || defined(OPENSSL_SYSNAME_NETWARE) | ||
# undef OPENSSL_SYS_UNIX | ||
# define OPENSSL_SYS_NETWARE | ||
# endif | ||
|
||
/* --------------------- Microsoft operating systems ---------------------- */ | ||
|
||
/* | ||
* Note that MSDOS actually denotes 32-bit environments running on top of | ||
* MS-DOS, such as DJGPP one. | ||
*/ | ||
# if defined(OPENSSL_SYSNAME_MSDOS) | ||
# undef OPENSSL_SYS_UNIX | ||
# define OPENSSL_SYS_MSDOS | ||
# endif | ||
|
||
/* | ||
* For 32 bit environment, there seems to be the CygWin environment and then | ||
* all the others that try to do the same thing Microsoft does... | ||
*/ | ||
# if defined(OPENSSL_SYSNAME_UWIN) | ||
# undef OPENSSL_SYS_UNIX | ||
# define OPENSSL_SYS_WIN32_UWIN | ||
# else | ||
# if defined(__CYGWIN__) || defined(OPENSSL_SYSNAME_CYGWIN) | ||
# undef OPENSSL_SYS_UNIX | ||
# define OPENSSL_SYS_WIN32_CYGWIN | ||
# else | ||
# if defined(_WIN32) || defined(OPENSSL_SYSNAME_WIN32) | ||
# undef OPENSSL_SYS_UNIX | ||
# define OPENSSL_SYS_WIN32 | ||
# endif | ||
# if defined(_WIN64) || defined(OPENSSL_SYSNAME_WIN64) | ||
# undef OPENSSL_SYS_UNIX | ||
# if !defined(OPENSSL_SYS_WIN64) | ||
# define OPENSSL_SYS_WIN64 | ||
# endif | ||
# endif | ||
# if defined(OPENSSL_SYSNAME_WINNT) | ||
# undef OPENSSL_SYS_UNIX | ||
# define OPENSSL_SYS_WINNT | ||
# endif | ||
# if defined(OPENSSL_SYSNAME_WINCE) | ||
# undef OPENSSL_SYS_UNIX | ||
# define OPENSSL_SYS_WINCE | ||
# endif | ||
# endif | ||
# endif | ||
|
||
/* Anything that tries to look like Microsoft is "Windows" */ | ||
# if defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_WIN64) || defined(OPENSSL_SYS_WINNT) || defined(OPENSSL_SYS_WINCE) | ||
# undef OPENSSL_SYS_UNIX | ||
# define OPENSSL_SYS_WINDOWS | ||
# ifndef OPENSSL_SYS_MSDOS | ||
# define OPENSSL_SYS_MSDOS | ||
# endif | ||
# endif | ||
|
||
/* | ||
* DLL settings. This part is a bit tough, because it's up to the | ||
* application implementor how he or she will link the application, so it | ||
* requires some macro to be used. | ||
*/ | ||
# ifdef OPENSSL_SYS_WINDOWS | ||
# ifndef OPENSSL_OPT_WINDLL | ||
# if defined(_WINDLL) /* This is used when building OpenSSL to | ||
* indicate that DLL linkage should be used */ | ||
# define OPENSSL_OPT_WINDLL | ||
# endif | ||
# endif | ||
# endif | ||
|
||
/* ------------------------------- OpenVMS -------------------------------- */ | ||
# if defined(__VMS) || defined(VMS) || defined(OPENSSL_SYSNAME_VMS) | ||
# undef OPENSSL_SYS_UNIX | ||
# define OPENSSL_SYS_VMS | ||
# if defined(__DECC) | ||
# define OPENSSL_SYS_VMS_DECC | ||
# elif defined(__DECCXX) | ||
# define OPENSSL_SYS_VMS_DECC | ||
# define OPENSSL_SYS_VMS_DECCXX | ||
# else | ||
# define OPENSSL_SYS_VMS_NODECC | ||
# endif | ||
# endif | ||
|
||
/* -------------------------------- OS/2 ---------------------------------- */ | ||
# if defined(__EMX__) || defined(__OS2__) | ||
# undef OPENSSL_SYS_UNIX | ||
# define OPENSSL_SYS_OS2 | ||
# endif | ||
|
||
/* -------------------------------- Unix ---------------------------------- */ | ||
# ifdef OPENSSL_SYS_UNIX | ||
# if defined(linux) || defined(__linux__) || defined(OPENSSL_SYSNAME_LINUX) | ||
# define OPENSSL_SYS_LINUX | ||
# endif | ||
# ifdef OPENSSL_SYSNAME_MPE | ||
# define OPENSSL_SYS_MPE | ||
# endif | ||
# ifdef OPENSSL_SYSNAME_SNI | ||
# define OPENSSL_SYS_SNI | ||
# endif | ||
# ifdef OPENSSL_SYSNAME_ULTRASPARC | ||
# define OPENSSL_SYS_ULTRASPARC | ||
# endif | ||
# ifdef OPENSSL_SYSNAME_NEWS4 | ||
# define OPENSSL_SYS_NEWS4 | ||
# endif | ||
# ifdef OPENSSL_SYSNAME_MACOSX | ||
# define OPENSSL_SYS_MACOSX | ||
# endif | ||
# ifdef OPENSSL_SYSNAME_MACOSX_RHAPSODY | ||
# define OPENSSL_SYS_MACOSX_RHAPSODY | ||
# define OPENSSL_SYS_MACOSX | ||
# endif | ||
# ifdef OPENSSL_SYSNAME_SUNOS | ||
# define OPENSSL_SYS_SUNOS | ||
# endif | ||
# if defined(_CRAY) || defined(OPENSSL_SYSNAME_CRAY) | ||
# define OPENSSL_SYS_CRAY | ||
# endif | ||
# if defined(_AIX) || defined(OPENSSL_SYSNAME_AIX) | ||
# define OPENSSL_SYS_AIX | ||
# endif | ||
# endif | ||
|
||
/* -------------------------------- VOS ----------------------------------- */ | ||
# if defined(__VOS__) || defined(OPENSSL_SYSNAME_VOS) | ||
# define OPENSSL_SYS_VOS | ||
# ifdef __HPPA__ | ||
# define OPENSSL_SYS_VOS_HPPA | ||
# endif | ||
# ifdef __IA32__ | ||
# define OPENSSL_SYS_VOS_IA32 | ||
# endif | ||
# endif | ||
|
||
/* ------------------------------ VxWorks --------------------------------- */ | ||
# ifdef OPENSSL_SYSNAME_VXWORKS | ||
# define OPENSSL_SYS_VXWORKS | ||
# endif | ||
|
||
/* -------------------------------- BeOS ---------------------------------- */ | ||
# if defined(__BEOS__) | ||
# define OPENSSL_SYS_BEOS | ||
# include <sys/socket.h> | ||
# if defined(BONE_VERSION) | ||
# define OPENSSL_SYS_BEOS_BONE | ||
# else | ||
# define OPENSSL_SYS_BEOS_R5 | ||
# endif | ||
# endif | ||
|
||
/** | ||
* That's it for OS-specific stuff | ||
*****************************************************************************/ | ||
|
||
/* Specials for I/O an exit */ | ||
# ifdef OPENSSL_SYS_MSDOS | ||
# define OPENSSL_UNISTD_IO <io.h> | ||
# define OPENSSL_DECLARE_EXIT extern void exit(int); | ||
# else | ||
# define OPENSSL_UNISTD_IO OPENSSL_UNISTD | ||
# define OPENSSL_DECLARE_EXIT /* declared in unistd.h */ | ||
# endif | ||
|
||
/*- | ||
* Definitions of OPENSSL_GLOBAL and OPENSSL_EXTERN, to define and declare | ||
* certain global symbols that, with some compilers under VMS, have to be | ||
* defined and declared explicitely with globaldef and globalref. | ||
* Definitions of OPENSSL_EXPORT and OPENSSL_IMPORT, to define and declare | ||
* DLL exports and imports for compilers under Win32. These are a little | ||
* more complicated to use. Basically, for any library that exports some | ||
* global variables, the following code must be present in the header file | ||
* that declares them, before OPENSSL_EXTERN is used: | ||
* | ||
* #ifdef SOME_BUILD_FLAG_MACRO | ||
* # undef OPENSSL_EXTERN | ||
* # define OPENSSL_EXTERN OPENSSL_EXPORT | ||
* #endif | ||
* | ||
* The default is to have OPENSSL_EXPORT, OPENSSL_IMPORT and OPENSSL_GLOBAL | ||
* have some generally sensible values, and for OPENSSL_EXTERN to have the | ||
* value OPENSSL_IMPORT. | ||
*/ | ||
|
||
# if defined(OPENSSL_SYS_VMS_NODECC) | ||
# define OPENSSL_EXPORT globalref | ||
# define OPENSSL_IMPORT globalref | ||
# define OPENSSL_GLOBAL globaldef | ||
# elif defined(OPENSSL_SYS_WINDOWS) && defined(OPENSSL_OPT_WINDLL) | ||
# define OPENSSL_EXPORT extern __declspec(dllexport) | ||
# define OPENSSL_IMPORT extern __declspec(dllimport) | ||
# define OPENSSL_GLOBAL | ||
# else | ||
# define OPENSSL_EXPORT extern | ||
# define OPENSSL_IMPORT extern | ||
# define OPENSSL_GLOBAL | ||
# endif | ||
# define OPENSSL_EXTERN OPENSSL_IMPORT | ||
|
||
/*- | ||
* Macros to allow global variables to be reached through function calls when | ||
* required (if a shared library version requires it, for example. | ||
* The way it's done allows definitions like this: | ||
* | ||
* // in foobar.c | ||
* OPENSSL_IMPLEMENT_GLOBAL(int,foobar,0) | ||
* // in foobar.h | ||
* OPENSSL_DECLARE_GLOBAL(int,foobar); | ||
* #define foobar OPENSSL_GLOBAL_REF(foobar) | ||
*/ | ||
# ifdef OPENSSL_EXPORT_VAR_AS_FUNCTION | ||
# define OPENSSL_IMPLEMENT_GLOBAL(type,name,value) \ | ||
type *_shadow_##name(void) \ | ||
{ static type _hide_##name=value; return &_hide_##name; } | ||
# define OPENSSL_DECLARE_GLOBAL(type,name) type *_shadow_##name(void) | ||
# define OPENSSL_GLOBAL_REF(name) (*(_shadow_##name())) | ||
# else | ||
# define OPENSSL_IMPLEMENT_GLOBAL(type,name,value) OPENSSL_GLOBAL type _shadow_##name=value; | ||
# define OPENSSL_DECLARE_GLOBAL(type,name) OPENSSL_EXPORT type _shadow_##name | ||
# define OPENSSL_GLOBAL_REF(name) _shadow_##name | ||
# endif | ||
|
||
# if defined(OPENSSL_SYS_MACINTOSH_CLASSIC) && macintosh==1 && !defined(MAC_OS_GUSI_SOURCE) | ||
# define ossl_ssize_t long | ||
# endif | ||
|
||
# ifdef OPENSSL_SYS_MSDOS | ||
# define ossl_ssize_t long | ||
# endif | ||
|
||
# if defined(NeXT) || defined(OPENSSL_SYS_NEWS4) || defined(OPENSSL_SYS_SUNOS) | ||
# define ssize_t int | ||
# endif | ||
|
||
# if defined(__ultrix) && !defined(ssize_t) | ||
# define ossl_ssize_t int | ||
# endif | ||
|
||
# ifndef ossl_ssize_t | ||
# define ossl_ssize_t ssize_t | ||
# endif | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
#endif |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* crypto/ebcdic.h */ | ||
|
||
#ifndef HEADER_EBCDIC_H | ||
# define HEADER_EBCDIC_H | ||
|
||
# include <sys/types.h> | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
/* Avoid name clashes with other applications */ | ||
# define os_toascii _openssl_os_toascii | ||
# define os_toebcdic _openssl_os_toebcdic | ||
# define ebcdic2ascii _openssl_ebcdic2ascii | ||
# define ascii2ebcdic _openssl_ascii2ebcdic | ||
|
||
extern const unsigned char os_toascii[256]; | ||
extern const unsigned char os_toebcdic[256]; | ||
void *ebcdic2ascii(void *dest, const void *srce, size_t count); | ||
void *ascii2ebcdic(void *dest, const void *srce, size_t count); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
#endif |