1
0
mirror of https://github.com/SoftEtherVPN/SoftEtherVPN.git synced 2025-07-06 15:54:57 +03:00

Win32 OpenSSL Header File: Ver 1.0.2j -> Ver 1.1.1

This commit is contained in:
Daiyuu Nobori
2018-10-09 19:29:11 +09:00
parent 03d78693a3
commit baff1b349c
111 changed files with 31609 additions and 38628 deletions

View File

@ -1,149 +1,92 @@
/* crypto/aes/aes.h */ /*
/* ==================================================================== * Copyright 2002-2016 The OpenSSL Project Authors. All Rights Reserved.
* Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved. *
* * Licensed under the OpenSSL license (the "License"). You may not use
* Redistribution and use in source and binary forms, with or without * this file except in compliance with the License. You can obtain a copy
* modification, are permitted provided that the following conditions * in the file LICENSE in the source distribution or at
* are met: * https://www.openssl.org/source/license.html
* */
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer. #ifndef HEADER_AES_H
* # define HEADER_AES_H
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in # include <openssl/opensslconf.h>
* the documentation and/or other materials provided with the
* distribution. # include <stddef.h>
* # ifdef __cplusplus
* 3. All advertising materials mentioning features or use of this extern "C" {
* software must display the following acknowledgment: # endif
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit. (http://www.openssl.org/)" # define AES_ENCRYPT 1
* # define AES_DECRYPT 0
* 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 * Because array size can't be a const in C, the following two are macros.
* openssl-core@openssl.org. * Both sizes are in bytes.
* */
* 5. Products derived from this software may not be called "OpenSSL" # define AES_MAXNR 14
* nor may "OpenSSL" appear in their names without prior written # define AES_BLOCK_SIZE 16
* permission of the OpenSSL Project.
* /* This should be a hidden type, but EVP requires that the size be known */
* 6. Redistributions of any form whatsoever must retain the following struct aes_key_st {
* acknowledgment: # ifdef AES_LONG
* "This product includes software developed by the OpenSSL Project unsigned long rd_key[4 * (AES_MAXNR + 1)];
* for use in the OpenSSL Toolkit (http://www.openssl.org/)" # else
* unsigned int rd_key[4 * (AES_MAXNR + 1)];
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY # endif
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE int rounds;
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR };
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR typedef struct aes_key_st AES_KEY;
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT const char *AES_options(void);
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) int AES_set_encrypt_key(const unsigned char *userKey, const int bits,
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, AES_KEY *key);
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) int AES_set_decrypt_key(const unsigned char *userKey, const int bits,
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED AES_KEY *key);
* OF THE POSSIBILITY OF SUCH DAMAGE.
* ==================================================================== 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);
#ifndef HEADER_AES_H
# define HEADER_AES_H void AES_ecb_encrypt(const unsigned char *in, unsigned char *out,
const AES_KEY *key, const int enc);
# include <openssl/opensslconf.h> void AES_cbc_encrypt(const unsigned char *in, unsigned char *out,
size_t length, const AES_KEY *key,
# ifdef OPENSSL_NO_AES unsigned char *ivec, const int enc);
# error AES is disabled. void AES_cfb128_encrypt(const unsigned char *in, unsigned char *out,
# endif size_t length, const AES_KEY *key,
unsigned char *ivec, int *num, const int enc);
# include <stddef.h> void AES_cfb1_encrypt(const unsigned char *in, unsigned char *out,
size_t length, const AES_KEY *key,
# define AES_ENCRYPT 1 unsigned char *ivec, int *num, const int enc);
# define AES_DECRYPT 0 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);
* Because array size can't be a const in C, the following two are macros. void AES_ofb128_encrypt(const unsigned char *in, unsigned char *out,
* Both sizes are in bytes. size_t length, const AES_KEY *key,
*/ unsigned char *ivec, int *num);
# define AES_MAXNR 14 /* NB: the IV is _two_ blocks long */
# define AES_BLOCK_SIZE 16 void AES_ige_encrypt(const unsigned char *in, unsigned char *out,
size_t length, const AES_KEY *key,
#ifdef __cplusplus unsigned char *ivec, const int enc);
extern "C" { /* NB: the IV is _four_ blocks long */
#endif void AES_bi_ige_encrypt(const unsigned char *in, unsigned char *out,
size_t length, const AES_KEY *key,
/* This should be a hidden type, but EVP requires that the size be known */ const AES_KEY *key2, const unsigned char *ivec,
struct aes_key_st { const int enc);
# ifdef AES_LONG
unsigned long rd_key[4 * (AES_MAXNR + 1)]; int AES_wrap_key(AES_KEY *key, const unsigned char *iv,
# else unsigned char *out,
unsigned int rd_key[4 * (AES_MAXNR + 1)]; const unsigned char *in, unsigned int inlen);
# endif int AES_unwrap_key(AES_KEY *key, const unsigned char *iv,
int rounds; unsigned char *out,
}; const unsigned char *in, unsigned int inlen);
typedef struct aes_key_st AES_KEY;
const char *AES_options(void); # ifdef __cplusplus
}
int AES_set_encrypt_key(const unsigned char *userKey, const int bits, # endif
AES_KEY *key);
int AES_set_decrypt_key(const unsigned char *userKey, const int bits, #endif
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 */

File diff suppressed because it is too large Load Diff

View File

@ -1,579 +1,10 @@
/* crypto/asn1/asn1_mac.h */ /*
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved.
* All rights reserved. *
* * Licensed under the OpenSSL license (the "License"). You may not use
* This package is an SSL implementation written * this file except in compliance with the License. You can obtain a copy
* by Eric Young (eay@cryptsoft.com). * in the file LICENSE in the source distribution or at
* The implementation was written so as to conform with Netscapes SSL. * https://www.openssl.org/source/license.html
* */
* This library is free for commercial and non-commercial use as long as
* the following conditions are aheared to. The following conditions #error "This file is obsolete; please update your software."
* 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_ASN1_MAC_H
# define HEADER_ASN1_MAC_H
# include <openssl/asn1.h>
#ifdef __cplusplus
extern "C" {
#endif
# ifndef ASN1_MAC_ERR_LIB
# define ASN1_MAC_ERR_LIB ERR_LIB_ASN1
# endif
# define ASN1_MAC_H_err(f,r,line) \
ERR_PUT_error(ASN1_MAC_ERR_LIB,(f),(r),__FILE__,(line))
# define M_ASN1_D2I_vars(a,type,func) \
ASN1_const_CTX c; \
type ret=NULL; \
\
c.pp=(const unsigned char **)pp; \
c.q= *(const unsigned char **)pp; \
c.error=ERR_R_NESTED_ASN1_ERROR; \
if ((a == NULL) || ((*a) == NULL)) \
{ if ((ret=(type)func()) == NULL) \
{ c.line=__LINE__; goto err; } } \
else ret=(*a);
# define M_ASN1_D2I_Init() \
c.p= *(const unsigned char **)pp; \
c.max=(length == 0)?0:(c.p+length);
# define M_ASN1_D2I_Finish_2(a) \
if (!asn1_const_Finish(&c)) \
{ c.line=__LINE__; goto err; } \
*(const unsigned char **)pp=c.p; \
if (a != NULL) (*a)=ret; \
return(ret);
# define M_ASN1_D2I_Finish(a,func,e) \
M_ASN1_D2I_Finish_2(a); \
err:\
ASN1_MAC_H_err((e),c.error,c.line); \
asn1_add_error(*(const unsigned char **)pp,(int)(c.q- *pp)); \
if ((ret != NULL) && ((a == NULL) || (*a != ret))) func(ret); \
return(NULL)
# define M_ASN1_D2I_start_sequence() \
if (!asn1_GetSequence(&c,&length)) \
{ c.line=__LINE__; goto err; }
/* Begin reading ASN1 without a surrounding sequence */
# define M_ASN1_D2I_begin() \
c.slen = length;
/* End reading ASN1 with no check on length */
# define M_ASN1_D2I_Finish_nolen(a, func, e) \
*pp=c.p; \
if (a != NULL) (*a)=ret; \
return(ret); \
err:\
ASN1_MAC_H_err((e),c.error,c.line); \
asn1_add_error(*pp,(int)(c.q- *pp)); \
if ((ret != NULL) && ((a == NULL) || (*a != ret))) func(ret); \
return(NULL)
# define M_ASN1_D2I_end_sequence() \
(((c.inf&1) == 0)?(c.slen <= 0): \
(c.eos=ASN1_const_check_infinite_end(&c.p,c.slen)))
/* Don't use this with d2i_ASN1_BOOLEAN() */
# define M_ASN1_D2I_get(b, func) \
c.q=c.p; \
if (func(&(b),&c.p,c.slen) == NULL) \
{c.line=__LINE__; goto err; } \
c.slen-=(c.p-c.q);
/* Don't use this with d2i_ASN1_BOOLEAN() */
# define M_ASN1_D2I_get_x(type,b,func) \
c.q=c.p; \
if (((D2I_OF(type))func)(&(b),&c.p,c.slen) == NULL) \
{c.line=__LINE__; goto err; } \
c.slen-=(c.p-c.q);
/* use this instead () */
# define M_ASN1_D2I_get_int(b,func) \
c.q=c.p; \
if (func(&(b),&c.p,c.slen) < 0) \
{c.line=__LINE__; goto err; } \
c.slen-=(c.p-c.q);
# define M_ASN1_D2I_get_opt(b,func,type) \
if ((c.slen != 0) && ((M_ASN1_next & (~V_ASN1_CONSTRUCTED)) \
== (V_ASN1_UNIVERSAL|(type)))) \
{ \
M_ASN1_D2I_get(b,func); \
}
# define M_ASN1_D2I_get_int_opt(b,func,type) \
if ((c.slen != 0) && ((M_ASN1_next & (~V_ASN1_CONSTRUCTED)) \
== (V_ASN1_UNIVERSAL|(type)))) \
{ \
M_ASN1_D2I_get_int(b,func); \
}
# define M_ASN1_D2I_get_imp(b,func, type) \
M_ASN1_next=(_tmp& V_ASN1_CONSTRUCTED)|type; \
c.q=c.p; \
if (func(&(b),&c.p,c.slen) == NULL) \
{c.line=__LINE__; M_ASN1_next_prev = _tmp; goto err; } \
c.slen-=(c.p-c.q);\
M_ASN1_next_prev=_tmp;
# define M_ASN1_D2I_get_IMP_opt(b,func,tag,type) \
if ((c.slen != 0) && ((M_ASN1_next & (~V_ASN1_CONSTRUCTED)) == \
(V_ASN1_CONTEXT_SPECIFIC|(tag)))) \
{ \
unsigned char _tmp = M_ASN1_next; \
M_ASN1_D2I_get_imp(b,func, type);\
}
# define M_ASN1_D2I_get_set(r,func,free_func) \
M_ASN1_D2I_get_imp_set(r,func,free_func, \
V_ASN1_SET,V_ASN1_UNIVERSAL);
# define M_ASN1_D2I_get_set_type(type,r,func,free_func) \
M_ASN1_D2I_get_imp_set_type(type,r,func,free_func, \
V_ASN1_SET,V_ASN1_UNIVERSAL);
# define M_ASN1_D2I_get_set_opt(r,func,free_func) \
if ((c.slen != 0) && (M_ASN1_next == (V_ASN1_UNIVERSAL| \
V_ASN1_CONSTRUCTED|V_ASN1_SET)))\
{ M_ASN1_D2I_get_set(r,func,free_func); }
# define M_ASN1_D2I_get_set_opt_type(type,r,func,free_func) \
if ((c.slen != 0) && (M_ASN1_next == (V_ASN1_UNIVERSAL| \
V_ASN1_CONSTRUCTED|V_ASN1_SET)))\
{ M_ASN1_D2I_get_set_type(type,r,func,free_func); }
# define M_ASN1_I2D_len_SET_opt(a,f) \
if ((a != NULL) && (sk_num(a) != 0)) \
M_ASN1_I2D_len_SET(a,f);
# define M_ASN1_I2D_put_SET_opt(a,f) \
if ((a != NULL) && (sk_num(a) != 0)) \
M_ASN1_I2D_put_SET(a,f);
# define M_ASN1_I2D_put_SEQUENCE_opt(a,f) \
if ((a != NULL) && (sk_num(a) != 0)) \
M_ASN1_I2D_put_SEQUENCE(a,f);
# define M_ASN1_I2D_put_SEQUENCE_opt_type(type,a,f) \
if ((a != NULL) && (sk_##type##_num(a) != 0)) \
M_ASN1_I2D_put_SEQUENCE_type(type,a,f);
# define M_ASN1_D2I_get_IMP_set_opt(b,func,free_func,tag) \
if ((c.slen != 0) && \
(M_ASN1_next == \
(V_ASN1_CONTEXT_SPECIFIC|V_ASN1_CONSTRUCTED|(tag))))\
{ \
M_ASN1_D2I_get_imp_set(b,func,free_func,\
tag,V_ASN1_CONTEXT_SPECIFIC); \
}
# define M_ASN1_D2I_get_IMP_set_opt_type(type,b,func,free_func,tag) \
if ((c.slen != 0) && \
(M_ASN1_next == \
(V_ASN1_CONTEXT_SPECIFIC|V_ASN1_CONSTRUCTED|(tag))))\
{ \
M_ASN1_D2I_get_imp_set_type(type,b,func,free_func,\
tag,V_ASN1_CONTEXT_SPECIFIC); \
}
# define M_ASN1_D2I_get_seq(r,func,free_func) \
M_ASN1_D2I_get_imp_set(r,func,free_func,\
V_ASN1_SEQUENCE,V_ASN1_UNIVERSAL);
# define M_ASN1_D2I_get_seq_type(type,r,func,free_func) \
M_ASN1_D2I_get_imp_set_type(type,r,func,free_func,\
V_ASN1_SEQUENCE,V_ASN1_UNIVERSAL)
# define M_ASN1_D2I_get_seq_opt(r,func,free_func) \
if ((c.slen != 0) && (M_ASN1_next == (V_ASN1_UNIVERSAL| \
V_ASN1_CONSTRUCTED|V_ASN1_SEQUENCE)))\
{ M_ASN1_D2I_get_seq(r,func,free_func); }
# define M_ASN1_D2I_get_seq_opt_type(type,r,func,free_func) \
if ((c.slen != 0) && (M_ASN1_next == (V_ASN1_UNIVERSAL| \
V_ASN1_CONSTRUCTED|V_ASN1_SEQUENCE)))\
{ M_ASN1_D2I_get_seq_type(type,r,func,free_func); }
# define M_ASN1_D2I_get_IMP_set(r,func,free_func,x) \
M_ASN1_D2I_get_imp_set(r,func,free_func,\
x,V_ASN1_CONTEXT_SPECIFIC);
# define M_ASN1_D2I_get_IMP_set_type(type,r,func,free_func,x) \
M_ASN1_D2I_get_imp_set_type(type,r,func,free_func,\
x,V_ASN1_CONTEXT_SPECIFIC);
# define M_ASN1_D2I_get_imp_set(r,func,free_func,a,b) \
c.q=c.p; \
if (d2i_ASN1_SET(&(r),&c.p,c.slen,(char *(*)())func,\
(void (*)())free_func,a,b) == NULL) \
{ c.line=__LINE__; goto err; } \
c.slen-=(c.p-c.q);
# define M_ASN1_D2I_get_imp_set_type(type,r,func,free_func,a,b) \
c.q=c.p; \
if (d2i_ASN1_SET_OF_##type(&(r),&c.p,c.slen,func,\
free_func,a,b) == NULL) \
{ c.line=__LINE__; goto err; } \
c.slen-=(c.p-c.q);
# define M_ASN1_D2I_get_set_strings(r,func,a,b) \
c.q=c.p; \
if (d2i_ASN1_STRING_SET(&(r),&c.p,c.slen,a,b) == NULL) \
{ c.line=__LINE__; goto err; } \
c.slen-=(c.p-c.q);
# define M_ASN1_D2I_get_EXP_opt(r,func,tag) \
if ((c.slen != 0L) && (M_ASN1_next == \
(V_ASN1_CONSTRUCTED|V_ASN1_CONTEXT_SPECIFIC|tag))) \
{ \
int Tinf,Ttag,Tclass; \
long Tlen; \
\
c.q=c.p; \
Tinf=ASN1_get_object(&c.p,&Tlen,&Ttag,&Tclass,c.slen); \
if (Tinf & 0x80) \
{ c.error=ERR_R_BAD_ASN1_OBJECT_HEADER; \
c.line=__LINE__; goto err; } \
if (Tinf == (V_ASN1_CONSTRUCTED+1)) \
Tlen = c.slen - (c.p - c.q) - 2; \
if (func(&(r),&c.p,Tlen) == NULL) \
{ c.line=__LINE__; goto err; } \
if (Tinf == (V_ASN1_CONSTRUCTED+1)) { \
Tlen = c.slen - (c.p - c.q); \
if(!ASN1_const_check_infinite_end(&c.p, Tlen)) \
{ c.error=ERR_R_MISSING_ASN1_EOS; \
c.line=__LINE__; goto err; } \
}\
c.slen-=(c.p-c.q); \
}
# define M_ASN1_D2I_get_EXP_set_opt(r,func,free_func,tag,b) \
if ((c.slen != 0) && (M_ASN1_next == \
(V_ASN1_CONSTRUCTED|V_ASN1_CONTEXT_SPECIFIC|tag))) \
{ \
int Tinf,Ttag,Tclass; \
long Tlen; \
\
c.q=c.p; \
Tinf=ASN1_get_object(&c.p,&Tlen,&Ttag,&Tclass,c.slen); \
if (Tinf & 0x80) \
{ c.error=ERR_R_BAD_ASN1_OBJECT_HEADER; \
c.line=__LINE__; goto err; } \
if (Tinf == (V_ASN1_CONSTRUCTED+1)) \
Tlen = c.slen - (c.p - c.q) - 2; \
if (d2i_ASN1_SET(&(r),&c.p,Tlen,(char *(*)())func, \
(void (*)())free_func, \
b,V_ASN1_UNIVERSAL) == NULL) \
{ c.line=__LINE__; goto err; } \
if (Tinf == (V_ASN1_CONSTRUCTED+1)) { \
Tlen = c.slen - (c.p - c.q); \
if(!ASN1_check_infinite_end(&c.p, Tlen)) \
{ c.error=ERR_R_MISSING_ASN1_EOS; \
c.line=__LINE__; goto err; } \
}\
c.slen-=(c.p-c.q); \
}
# define M_ASN1_D2I_get_EXP_set_opt_type(type,r,func,free_func,tag,b) \
if ((c.slen != 0) && (M_ASN1_next == \
(V_ASN1_CONSTRUCTED|V_ASN1_CONTEXT_SPECIFIC|tag))) \
{ \
int Tinf,Ttag,Tclass; \
long Tlen; \
\
c.q=c.p; \
Tinf=ASN1_get_object(&c.p,&Tlen,&Ttag,&Tclass,c.slen); \
if (Tinf & 0x80) \
{ c.error=ERR_R_BAD_ASN1_OBJECT_HEADER; \
c.line=__LINE__; goto err; } \
if (Tinf == (V_ASN1_CONSTRUCTED+1)) \
Tlen = c.slen - (c.p - c.q) - 2; \
if (d2i_ASN1_SET_OF_##type(&(r),&c.p,Tlen,func, \
free_func,b,V_ASN1_UNIVERSAL) == NULL) \
{ c.line=__LINE__; goto err; } \
if (Tinf == (V_ASN1_CONSTRUCTED+1)) { \
Tlen = c.slen - (c.p - c.q); \
if(!ASN1_check_infinite_end(&c.p, Tlen)) \
{ c.error=ERR_R_MISSING_ASN1_EOS; \
c.line=__LINE__; goto err; } \
}\
c.slen-=(c.p-c.q); \
}
/* New macros */
# define M_ASN1_New_Malloc(ret,type) \
if ((ret=(type *)OPENSSL_malloc(sizeof(type))) == NULL) \
{ c.line=__LINE__; goto err2; }
# define M_ASN1_New(arg,func) \
if (((arg)=func()) == NULL) return(NULL)
# define M_ASN1_New_Error(a) \
/*- err: ASN1_MAC_H_err((a),ERR_R_NESTED_ASN1_ERROR,c.line); \
return(NULL);*/ \
err2: ASN1_MAC_H_err((a),ERR_R_MALLOC_FAILURE,c.line); \
return(NULL)
/*
* BIG UGLY WARNING! This is so damn ugly I wanna puke. Unfortunately, some
* macros that use ASN1_const_CTX still insist on writing in the input
* stream. ARGH! ARGH! ARGH! Let's get rid of this macro package. Please? --
* Richard Levitte
*/
# define M_ASN1_next (*((unsigned char *)(c.p)))
# define M_ASN1_next_prev (*((unsigned char *)(c.q)))
/*************************************************/
# define M_ASN1_I2D_vars(a) int r=0,ret=0; \
unsigned char *p; \
if (a == NULL) return(0)
/* Length Macros */
# define M_ASN1_I2D_len(a,f) ret+=f(a,NULL)
# define M_ASN1_I2D_len_IMP_opt(a,f) if (a != NULL) M_ASN1_I2D_len(a,f)
# define M_ASN1_I2D_len_SET(a,f) \
ret+=i2d_ASN1_SET(a,NULL,f,V_ASN1_SET,V_ASN1_UNIVERSAL,IS_SET);
# define M_ASN1_I2D_len_SET_type(type,a,f) \
ret+=i2d_ASN1_SET_OF_##type(a,NULL,f,V_ASN1_SET, \
V_ASN1_UNIVERSAL,IS_SET);
# define M_ASN1_I2D_len_SEQUENCE(a,f) \
ret+=i2d_ASN1_SET(a,NULL,f,V_ASN1_SEQUENCE,V_ASN1_UNIVERSAL, \
IS_SEQUENCE);
# define M_ASN1_I2D_len_SEQUENCE_type(type,a,f) \
ret+=i2d_ASN1_SET_OF_##type(a,NULL,f,V_ASN1_SEQUENCE, \
V_ASN1_UNIVERSAL,IS_SEQUENCE)
# define M_ASN1_I2D_len_SEQUENCE_opt(a,f) \
if ((a != NULL) && (sk_num(a) != 0)) \
M_ASN1_I2D_len_SEQUENCE(a,f);
# define M_ASN1_I2D_len_SEQUENCE_opt_type(type,a,f) \
if ((a != NULL) && (sk_##type##_num(a) != 0)) \
M_ASN1_I2D_len_SEQUENCE_type(type,a,f);
# define M_ASN1_I2D_len_IMP_SET(a,f,x) \
ret+=i2d_ASN1_SET(a,NULL,f,x,V_ASN1_CONTEXT_SPECIFIC,IS_SET);
# define M_ASN1_I2D_len_IMP_SET_type(type,a,f,x) \
ret+=i2d_ASN1_SET_OF_##type(a,NULL,f,x, \
V_ASN1_CONTEXT_SPECIFIC,IS_SET);
# define M_ASN1_I2D_len_IMP_SET_opt(a,f,x) \
if ((a != NULL) && (sk_num(a) != 0)) \
ret+=i2d_ASN1_SET(a,NULL,f,x,V_ASN1_CONTEXT_SPECIFIC, \
IS_SET);
# define M_ASN1_I2D_len_IMP_SET_opt_type(type,a,f,x) \
if ((a != NULL) && (sk_##type##_num(a) != 0)) \
ret+=i2d_ASN1_SET_OF_##type(a,NULL,f,x, \
V_ASN1_CONTEXT_SPECIFIC,IS_SET);
# define M_ASN1_I2D_len_IMP_SEQUENCE(a,f,x) \
ret+=i2d_ASN1_SET(a,NULL,f,x,V_ASN1_CONTEXT_SPECIFIC, \
IS_SEQUENCE);
# define M_ASN1_I2D_len_IMP_SEQUENCE_opt(a,f,x) \
if ((a != NULL) && (sk_num(a) != 0)) \
ret+=i2d_ASN1_SET(a,NULL,f,x,V_ASN1_CONTEXT_SPECIFIC, \
IS_SEQUENCE);
# define M_ASN1_I2D_len_IMP_SEQUENCE_opt_type(type,a,f,x) \
if ((a != NULL) && (sk_##type##_num(a) != 0)) \
ret+=i2d_ASN1_SET_OF_##type(a,NULL,f,x, \
V_ASN1_CONTEXT_SPECIFIC, \
IS_SEQUENCE);
# define M_ASN1_I2D_len_EXP_opt(a,f,mtag,v) \
if (a != NULL)\
{ \
v=f(a,NULL); \
ret+=ASN1_object_size(1,v,mtag); \
}
# define M_ASN1_I2D_len_EXP_SET_opt(a,f,mtag,tag,v) \
if ((a != NULL) && (sk_num(a) != 0))\
{ \
v=i2d_ASN1_SET(a,NULL,f,tag,V_ASN1_UNIVERSAL,IS_SET); \
ret+=ASN1_object_size(1,v,mtag); \
}
# define M_ASN1_I2D_len_EXP_SEQUENCE_opt(a,f,mtag,tag,v) \
if ((a != NULL) && (sk_num(a) != 0))\
{ \
v=i2d_ASN1_SET(a,NULL,f,tag,V_ASN1_UNIVERSAL, \
IS_SEQUENCE); \
ret+=ASN1_object_size(1,v,mtag); \
}
# define M_ASN1_I2D_len_EXP_SEQUENCE_opt_type(type,a,f,mtag,tag,v) \
if ((a != NULL) && (sk_##type##_num(a) != 0))\
{ \
v=i2d_ASN1_SET_OF_##type(a,NULL,f,tag, \
V_ASN1_UNIVERSAL, \
IS_SEQUENCE); \
ret+=ASN1_object_size(1,v,mtag); \
}
/* Put Macros */
# define M_ASN1_I2D_put(a,f) f(a,&p)
# define M_ASN1_I2D_put_IMP_opt(a,f,t) \
if (a != NULL) \
{ \
unsigned char *q=p; \
f(a,&p); \
*q=(V_ASN1_CONTEXT_SPECIFIC|t|(*q&V_ASN1_CONSTRUCTED));\
}
# define M_ASN1_I2D_put_SET(a,f) i2d_ASN1_SET(a,&p,f,V_ASN1_SET,\
V_ASN1_UNIVERSAL,IS_SET)
# define M_ASN1_I2D_put_SET_type(type,a,f) \
i2d_ASN1_SET_OF_##type(a,&p,f,V_ASN1_SET,V_ASN1_UNIVERSAL,IS_SET)
# define M_ASN1_I2D_put_IMP_SET(a,f,x) i2d_ASN1_SET(a,&p,f,x,\
V_ASN1_CONTEXT_SPECIFIC,IS_SET)
# define M_ASN1_I2D_put_IMP_SET_type(type,a,f,x) \
i2d_ASN1_SET_OF_##type(a,&p,f,x,V_ASN1_CONTEXT_SPECIFIC,IS_SET)
# define M_ASN1_I2D_put_IMP_SEQUENCE(a,f,x) i2d_ASN1_SET(a,&p,f,x,\
V_ASN1_CONTEXT_SPECIFIC,IS_SEQUENCE)
# define M_ASN1_I2D_put_SEQUENCE(a,f) i2d_ASN1_SET(a,&p,f,V_ASN1_SEQUENCE,\
V_ASN1_UNIVERSAL,IS_SEQUENCE)
# define M_ASN1_I2D_put_SEQUENCE_type(type,a,f) \
i2d_ASN1_SET_OF_##type(a,&p,f,V_ASN1_SEQUENCE,V_ASN1_UNIVERSAL, \
IS_SEQUENCE)
# define M_ASN1_I2D_put_SEQUENCE_opt(a,f) \
if ((a != NULL) && (sk_num(a) != 0)) \
M_ASN1_I2D_put_SEQUENCE(a,f);
# define M_ASN1_I2D_put_IMP_SET_opt(a,f,x) \
if ((a != NULL) && (sk_num(a) != 0)) \
{ i2d_ASN1_SET(a,&p,f,x,V_ASN1_CONTEXT_SPECIFIC, \
IS_SET); }
# define M_ASN1_I2D_put_IMP_SET_opt_type(type,a,f,x) \
if ((a != NULL) && (sk_##type##_num(a) != 0)) \
{ i2d_ASN1_SET_OF_##type(a,&p,f,x, \
V_ASN1_CONTEXT_SPECIFIC, \
IS_SET); }
# define M_ASN1_I2D_put_IMP_SEQUENCE_opt(a,f,x) \
if ((a != NULL) && (sk_num(a) != 0)) \
{ i2d_ASN1_SET(a,&p,f,x,V_ASN1_CONTEXT_SPECIFIC, \
IS_SEQUENCE); }
# define M_ASN1_I2D_put_IMP_SEQUENCE_opt_type(type,a,f,x) \
if ((a != NULL) && (sk_##type##_num(a) != 0)) \
{ i2d_ASN1_SET_OF_##type(a,&p,f,x, \
V_ASN1_CONTEXT_SPECIFIC, \
IS_SEQUENCE); }
# define M_ASN1_I2D_put_EXP_opt(a,f,tag,v) \
if (a != NULL) \
{ \
ASN1_put_object(&p,1,v,tag,V_ASN1_CONTEXT_SPECIFIC); \
f(a,&p); \
}
# define M_ASN1_I2D_put_EXP_SET_opt(a,f,mtag,tag,v) \
if ((a != NULL) && (sk_num(a) != 0)) \
{ \
ASN1_put_object(&p,1,v,mtag,V_ASN1_CONTEXT_SPECIFIC); \
i2d_ASN1_SET(a,&p,f,tag,V_ASN1_UNIVERSAL,IS_SET); \
}
# define M_ASN1_I2D_put_EXP_SEQUENCE_opt(a,f,mtag,tag,v) \
if ((a != NULL) && (sk_num(a) != 0)) \
{ \
ASN1_put_object(&p,1,v,mtag,V_ASN1_CONTEXT_SPECIFIC); \
i2d_ASN1_SET(a,&p,f,tag,V_ASN1_UNIVERSAL,IS_SEQUENCE); \
}
# define M_ASN1_I2D_put_EXP_SEQUENCE_opt_type(type,a,f,mtag,tag,v) \
if ((a != NULL) && (sk_##type##_num(a) != 0)) \
{ \
ASN1_put_object(&p,1,v,mtag,V_ASN1_CONTEXT_SPECIFIC); \
i2d_ASN1_SET_OF_##type(a,&p,f,tag,V_ASN1_UNIVERSAL, \
IS_SEQUENCE); \
}
# define M_ASN1_I2D_seq_total() \
r=ASN1_object_size(1,ret,V_ASN1_SEQUENCE); \
if (pp == NULL) return(r); \
p= *pp; \
ASN1_put_object(&p,1,ret,V_ASN1_SEQUENCE,V_ASN1_UNIVERSAL)
# define M_ASN1_I2D_INF_seq_start(tag,ctx) \
*(p++)=(V_ASN1_CONSTRUCTED|(tag)|(ctx)); \
*(p++)=0x80
# define M_ASN1_I2D_INF_seq_end() *(p++)=0x00; *(p++)=0x00
# define M_ASN1_I2D_finish() *pp=p; \
return(r);
int asn1_GetSequence(ASN1_const_CTX *c, long *length);
void asn1_add_error(const unsigned char *address, int offset);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,252 @@
/*
* Generated by util/mkerr.pl DO NOT EDIT
* Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/license.html
*/
#ifndef HEADER_ASN1ERR_H
# define HEADER_ASN1ERR_H
# ifdef __cplusplus
extern "C"
# endif
int ERR_load_ASN1_strings(void);
/*
* ASN1 function codes.
*/
# define ASN1_F_A2D_ASN1_OBJECT 100
# define ASN1_F_A2I_ASN1_INTEGER 102
# define ASN1_F_A2I_ASN1_STRING 103
# define ASN1_F_APPEND_EXP 176
# define ASN1_F_ASN1_BIO_INIT 113
# define ASN1_F_ASN1_BIT_STRING_SET_BIT 183
# define ASN1_F_ASN1_CB 177
# define ASN1_F_ASN1_CHECK_TLEN 104
# define ASN1_F_ASN1_COLLECT 106
# define ASN1_F_ASN1_D2I_EX_PRIMITIVE 108
# define ASN1_F_ASN1_D2I_FP 109
# define ASN1_F_ASN1_D2I_READ_BIO 107
# define ASN1_F_ASN1_DIGEST 184
# define ASN1_F_ASN1_DO_ADB 110
# define ASN1_F_ASN1_DO_LOCK 233
# define ASN1_F_ASN1_DUP 111
# define ASN1_F_ASN1_ENC_SAVE 115
# define ASN1_F_ASN1_EX_C2I 204
# define ASN1_F_ASN1_FIND_END 190
# define ASN1_F_ASN1_GENERALIZEDTIME_ADJ 216
# define ASN1_F_ASN1_GENERATE_V3 178
# define ASN1_F_ASN1_GET_INT64 224
# define ASN1_F_ASN1_GET_OBJECT 114
# define ASN1_F_ASN1_GET_UINT64 225
# define ASN1_F_ASN1_I2D_BIO 116
# define ASN1_F_ASN1_I2D_FP 117
# define ASN1_F_ASN1_ITEM_D2I_FP 206
# define ASN1_F_ASN1_ITEM_DUP 191
# define ASN1_F_ASN1_ITEM_EMBED_D2I 120
# define ASN1_F_ASN1_ITEM_EMBED_NEW 121
# define ASN1_F_ASN1_ITEM_FLAGS_I2D 118
# define ASN1_F_ASN1_ITEM_I2D_BIO 192
# define ASN1_F_ASN1_ITEM_I2D_FP 193
# define ASN1_F_ASN1_ITEM_PACK 198
# define ASN1_F_ASN1_ITEM_SIGN 195
# define ASN1_F_ASN1_ITEM_SIGN_CTX 220
# define ASN1_F_ASN1_ITEM_UNPACK 199
# define ASN1_F_ASN1_ITEM_VERIFY 197
# define ASN1_F_ASN1_MBSTRING_NCOPY 122
# define ASN1_F_ASN1_OBJECT_NEW 123
# define ASN1_F_ASN1_OUTPUT_DATA 214
# define ASN1_F_ASN1_PCTX_NEW 205
# define ASN1_F_ASN1_PRIMITIVE_NEW 119
# define ASN1_F_ASN1_SCTX_NEW 221
# define ASN1_F_ASN1_SIGN 128
# define ASN1_F_ASN1_STR2TYPE 179
# define ASN1_F_ASN1_STRING_GET_INT64 227
# define ASN1_F_ASN1_STRING_GET_UINT64 230
# define ASN1_F_ASN1_STRING_SET 186
# define ASN1_F_ASN1_STRING_TABLE_ADD 129
# define ASN1_F_ASN1_STRING_TO_BN 228
# define ASN1_F_ASN1_STRING_TYPE_NEW 130
# define ASN1_F_ASN1_TEMPLATE_EX_D2I 132
# define ASN1_F_ASN1_TEMPLATE_NEW 133
# define ASN1_F_ASN1_TEMPLATE_NOEXP_D2I 131
# define ASN1_F_ASN1_TIME_ADJ 217
# define ASN1_F_ASN1_TYPE_GET_INT_OCTETSTRING 134
# define ASN1_F_ASN1_TYPE_GET_OCTETSTRING 135
# define ASN1_F_ASN1_UTCTIME_ADJ 218
# define ASN1_F_ASN1_VERIFY 137
# define ASN1_F_B64_READ_ASN1 209
# define ASN1_F_B64_WRITE_ASN1 210
# define ASN1_F_BIO_NEW_NDEF 208
# define ASN1_F_BITSTR_CB 180
# define ASN1_F_BN_TO_ASN1_STRING 229
# define ASN1_F_C2I_ASN1_BIT_STRING 189
# define ASN1_F_C2I_ASN1_INTEGER 194
# define ASN1_F_C2I_ASN1_OBJECT 196
# define ASN1_F_C2I_IBUF 226
# define ASN1_F_C2I_UINT64_INT 101
# define ASN1_F_COLLECT_DATA 140
# define ASN1_F_D2I_ASN1_OBJECT 147
# define ASN1_F_D2I_ASN1_UINTEGER 150
# define ASN1_F_D2I_AUTOPRIVATEKEY 207
# define ASN1_F_D2I_PRIVATEKEY 154
# define ASN1_F_D2I_PUBLICKEY 155
# define ASN1_F_DO_BUF 142
# define ASN1_F_DO_CREATE 124
# define ASN1_F_DO_DUMP 125
# define ASN1_F_DO_TCREATE 222
# define ASN1_F_I2A_ASN1_OBJECT 126
# define ASN1_F_I2D_ASN1_BIO_STREAM 211
# define ASN1_F_I2D_ASN1_OBJECT 143
# define ASN1_F_I2D_DSA_PUBKEY 161
# define ASN1_F_I2D_EC_PUBKEY 181
# define ASN1_F_I2D_PRIVATEKEY 163
# define ASN1_F_I2D_PUBLICKEY 164
# define ASN1_F_I2D_RSA_PUBKEY 165
# define ASN1_F_LONG_C2I 166
# define ASN1_F_NDEF_PREFIX 127
# define ASN1_F_NDEF_SUFFIX 136
# define ASN1_F_OID_MODULE_INIT 174
# define ASN1_F_PARSE_TAGGING 182
# define ASN1_F_PKCS5_PBE2_SET_IV 167
# define ASN1_F_PKCS5_PBE2_SET_SCRYPT 231
# define ASN1_F_PKCS5_PBE_SET 202
# define ASN1_F_PKCS5_PBE_SET0_ALGOR 215
# define ASN1_F_PKCS5_PBKDF2_SET 219
# define ASN1_F_PKCS5_SCRYPT_SET 232
# define ASN1_F_SMIME_READ_ASN1 212
# define ASN1_F_SMIME_TEXT 213
# define ASN1_F_STABLE_GET 138
# define ASN1_F_STBL_MODULE_INIT 223
# define ASN1_F_UINT32_C2I 105
# define ASN1_F_UINT32_NEW 139
# define ASN1_F_UINT64_C2I 112
# define ASN1_F_UINT64_NEW 141
# define ASN1_F_X509_CRL_ADD0_REVOKED 169
# define ASN1_F_X509_INFO_NEW 170
# define ASN1_F_X509_NAME_ENCODE 203
# define ASN1_F_X509_NAME_EX_D2I 158
# define ASN1_F_X509_NAME_EX_NEW 171
# define ASN1_F_X509_PKEY_NEW 173
/*
* ASN1 reason codes.
*/
# define ASN1_R_ADDING_OBJECT 171
# define ASN1_R_ASN1_PARSE_ERROR 203
# define ASN1_R_ASN1_SIG_PARSE_ERROR 204
# define ASN1_R_AUX_ERROR 100
# define ASN1_R_BAD_OBJECT_HEADER 102
# define ASN1_R_BMPSTRING_IS_WRONG_LENGTH 214
# define ASN1_R_BN_LIB 105
# define ASN1_R_BOOLEAN_IS_WRONG_LENGTH 106
# define ASN1_R_BUFFER_TOO_SMALL 107
# define ASN1_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER 108
# define ASN1_R_CONTEXT_NOT_INITIALISED 217
# define ASN1_R_DATA_IS_WRONG 109
# define ASN1_R_DECODE_ERROR 110
# define ASN1_R_DEPTH_EXCEEDED 174
# define ASN1_R_DIGEST_AND_KEY_TYPE_NOT_SUPPORTED 198
# define ASN1_R_ENCODE_ERROR 112
# define ASN1_R_ERROR_GETTING_TIME 173
# define ASN1_R_ERROR_LOADING_SECTION 172
# define ASN1_R_ERROR_SETTING_CIPHER_PARAMS 114
# define ASN1_R_EXPECTING_AN_INTEGER 115
# define ASN1_R_EXPECTING_AN_OBJECT 116
# define ASN1_R_EXPLICIT_LENGTH_MISMATCH 119
# define ASN1_R_EXPLICIT_TAG_NOT_CONSTRUCTED 120
# define ASN1_R_FIELD_MISSING 121
# define ASN1_R_FIRST_NUM_TOO_LARGE 122
# define ASN1_R_HEADER_TOO_LONG 123
# define ASN1_R_ILLEGAL_BITSTRING_FORMAT 175
# define ASN1_R_ILLEGAL_BOOLEAN 176
# define ASN1_R_ILLEGAL_CHARACTERS 124
# define ASN1_R_ILLEGAL_FORMAT 177
# define ASN1_R_ILLEGAL_HEX 178
# define ASN1_R_ILLEGAL_IMPLICIT_TAG 179
# define ASN1_R_ILLEGAL_INTEGER 180
# define ASN1_R_ILLEGAL_NEGATIVE_VALUE 226
# define ASN1_R_ILLEGAL_NESTED_TAGGING 181
# define ASN1_R_ILLEGAL_NULL 125
# define ASN1_R_ILLEGAL_NULL_VALUE 182
# define ASN1_R_ILLEGAL_OBJECT 183
# define ASN1_R_ILLEGAL_OPTIONAL_ANY 126
# define ASN1_R_ILLEGAL_OPTIONS_ON_ITEM_TEMPLATE 170
# define ASN1_R_ILLEGAL_PADDING 221
# define ASN1_R_ILLEGAL_TAGGED_ANY 127
# define ASN1_R_ILLEGAL_TIME_VALUE 184
# define ASN1_R_ILLEGAL_ZERO_CONTENT 222
# define ASN1_R_INTEGER_NOT_ASCII_FORMAT 185
# define ASN1_R_INTEGER_TOO_LARGE_FOR_LONG 128
# define ASN1_R_INVALID_BIT_STRING_BITS_LEFT 220
# define ASN1_R_INVALID_BMPSTRING_LENGTH 129
# define ASN1_R_INVALID_DIGIT 130
# define ASN1_R_INVALID_MIME_TYPE 205
# define ASN1_R_INVALID_MODIFIER 186
# define ASN1_R_INVALID_NUMBER 187
# define ASN1_R_INVALID_OBJECT_ENCODING 216
# define ASN1_R_INVALID_SCRYPT_PARAMETERS 227
# define ASN1_R_INVALID_SEPARATOR 131
# define ASN1_R_INVALID_STRING_TABLE_VALUE 218
# define ASN1_R_INVALID_UNIVERSALSTRING_LENGTH 133
# define ASN1_R_INVALID_UTF8STRING 134
# define ASN1_R_INVALID_VALUE 219
# define ASN1_R_LIST_ERROR 188
# define ASN1_R_MIME_NO_CONTENT_TYPE 206
# define ASN1_R_MIME_PARSE_ERROR 207
# define ASN1_R_MIME_SIG_PARSE_ERROR 208
# define ASN1_R_MISSING_EOC 137
# define ASN1_R_MISSING_SECOND_NUMBER 138
# define ASN1_R_MISSING_VALUE 189
# define ASN1_R_MSTRING_NOT_UNIVERSAL 139
# define ASN1_R_MSTRING_WRONG_TAG 140
# define ASN1_R_NESTED_ASN1_STRING 197
# define ASN1_R_NESTED_TOO_DEEP 201
# define ASN1_R_NON_HEX_CHARACTERS 141
# define ASN1_R_NOT_ASCII_FORMAT 190
# define ASN1_R_NOT_ENOUGH_DATA 142
# define ASN1_R_NO_CONTENT_TYPE 209
# define ASN1_R_NO_MATCHING_CHOICE_TYPE 143
# define ASN1_R_NO_MULTIPART_BODY_FAILURE 210
# define ASN1_R_NO_MULTIPART_BOUNDARY 211
# define ASN1_R_NO_SIG_CONTENT_TYPE 212
# define ASN1_R_NULL_IS_WRONG_LENGTH 144
# define ASN1_R_OBJECT_NOT_ASCII_FORMAT 191
# define ASN1_R_ODD_NUMBER_OF_CHARS 145
# define ASN1_R_SECOND_NUMBER_TOO_LARGE 147
# define ASN1_R_SEQUENCE_LENGTH_MISMATCH 148
# define ASN1_R_SEQUENCE_NOT_CONSTRUCTED 149
# define ASN1_R_SEQUENCE_OR_SET_NEEDS_CONFIG 192
# define ASN1_R_SHORT_LINE 150
# define ASN1_R_SIG_INVALID_MIME_TYPE 213
# define ASN1_R_STREAMING_NOT_SUPPORTED 202
# define ASN1_R_STRING_TOO_LONG 151
# define ASN1_R_STRING_TOO_SHORT 152
# define ASN1_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD 154
# define ASN1_R_TIME_NOT_ASCII_FORMAT 193
# define ASN1_R_TOO_LARGE 223
# define ASN1_R_TOO_LONG 155
# define ASN1_R_TOO_SMALL 224
# define ASN1_R_TYPE_NOT_CONSTRUCTED 156
# define ASN1_R_TYPE_NOT_PRIMITIVE 195
# define ASN1_R_UNEXPECTED_EOC 159
# define ASN1_R_UNIVERSALSTRING_IS_WRONG_LENGTH 215
# define ASN1_R_UNKNOWN_FORMAT 160
# define ASN1_R_UNKNOWN_MESSAGE_DIGEST_ALGORITHM 161
# define ASN1_R_UNKNOWN_OBJECT_TYPE 162
# define ASN1_R_UNKNOWN_PUBLIC_KEY_TYPE 163
# define ASN1_R_UNKNOWN_SIGNATURE_ALGORITHM 199
# define ASN1_R_UNKNOWN_TAG 194
# define ASN1_R_UNSUPPORTED_ANY_DEFINED_BY_TYPE 164
# define ASN1_R_UNSUPPORTED_CIPHER 228
# define ASN1_R_UNSUPPORTED_PUBLIC_KEY_TYPE 167
# define ASN1_R_UNSUPPORTED_TYPE 196
# define ASN1_R_WRONG_INTEGER_TYPE 225
# define ASN1_R_WRONG_PUBLIC_KEY_TYPE 200
# define ASN1_R_WRONG_TAG 168
#endif

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,76 @@
/*
* Copyright 2015-2018 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/license.html
*/
#include <stdlib.h>
#ifndef HEADER_ASYNC_H
# define HEADER_ASYNC_H
#if defined(_WIN32)
# if defined(BASETYPES) || defined(_WINDEF_H)
/* application has to include <windows.h> to use this */
#define OSSL_ASYNC_FD HANDLE
#define OSSL_BAD_ASYNC_FD INVALID_HANDLE_VALUE
# endif
#else
#define OSSL_ASYNC_FD int
#define OSSL_BAD_ASYNC_FD -1
#endif
# include <openssl/asyncerr.h>
# ifdef __cplusplus
extern "C" {
# endif
typedef struct async_job_st ASYNC_JOB;
typedef struct async_wait_ctx_st ASYNC_WAIT_CTX;
#define ASYNC_ERR 0
#define ASYNC_NO_JOBS 1
#define ASYNC_PAUSE 2
#define ASYNC_FINISH 3
int ASYNC_init_thread(size_t max_size, size_t init_size);
void ASYNC_cleanup_thread(void);
#ifdef OSSL_ASYNC_FD
ASYNC_WAIT_CTX *ASYNC_WAIT_CTX_new(void);
void ASYNC_WAIT_CTX_free(ASYNC_WAIT_CTX *ctx);
int ASYNC_WAIT_CTX_set_wait_fd(ASYNC_WAIT_CTX *ctx, const void *key,
OSSL_ASYNC_FD fd,
void *custom_data,
void (*cleanup)(ASYNC_WAIT_CTX *, const void *,
OSSL_ASYNC_FD, void *));
int ASYNC_WAIT_CTX_get_fd(ASYNC_WAIT_CTX *ctx, const void *key,
OSSL_ASYNC_FD *fd, void **custom_data);
int ASYNC_WAIT_CTX_get_all_fds(ASYNC_WAIT_CTX *ctx, OSSL_ASYNC_FD *fd,
size_t *numfds);
int ASYNC_WAIT_CTX_get_changed_fds(ASYNC_WAIT_CTX *ctx, OSSL_ASYNC_FD *addfd,
size_t *numaddfds, OSSL_ASYNC_FD *delfd,
size_t *numdelfds);
int ASYNC_WAIT_CTX_clear_fd(ASYNC_WAIT_CTX *ctx, const void *key);
#endif
int ASYNC_is_capable(void);
int ASYNC_start_job(ASYNC_JOB **job, ASYNC_WAIT_CTX *ctx, int *ret,
int (*func)(void *), void *args, size_t size);
int ASYNC_pause_job(void);
ASYNC_JOB *ASYNC_get_current_job(void);
ASYNC_WAIT_CTX *ASYNC_get_wait_ctx(ASYNC_JOB *job);
void ASYNC_block_pause(void);
void ASYNC_unblock_pause(void);
# ifdef __cplusplus
}
# endif
#endif

View File

@ -0,0 +1,38 @@
/*
* Generated by util/mkerr.pl DO NOT EDIT
* Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/license.html
*/
#ifndef HEADER_ASYNCERR_H
# define HEADER_ASYNCERR_H
# ifdef __cplusplus
extern "C"
# endif
int ERR_load_ASYNC_strings(void);
/*
* ASYNC function codes.
*/
# define ASYNC_F_ASYNC_CTX_NEW 100
# define ASYNC_F_ASYNC_INIT_THREAD 101
# define ASYNC_F_ASYNC_JOB_NEW 102
# define ASYNC_F_ASYNC_PAUSE_JOB 103
# define ASYNC_F_ASYNC_START_FUNC 104
# define ASYNC_F_ASYNC_START_JOB 105
# define ASYNC_F_ASYNC_WAIT_CTX_SET_WAIT_FD 106
/*
* ASYNC reason codes.
*/
# define ASYNC_R_FAILED_TO_SET_POOL 101
# define ASYNC_R_FAILED_TO_SWAP_CONTEXT 102
# define ASYNC_R_INIT_FAILED 105
# define ASYNC_R_INVALID_POOL_SIZE 103
#endif

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,120 @@
/*
* Generated by util/mkerr.pl DO NOT EDIT
* Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/license.html
*/
#ifndef HEADER_BIOERR_H
# define HEADER_BIOERR_H
# ifdef __cplusplus
extern "C"
# endif
int ERR_load_BIO_strings(void);
/*
* BIO function codes.
*/
# define BIO_F_ACPT_STATE 100
# define BIO_F_ADDRINFO_WRAP 148
# define BIO_F_ADDR_STRINGS 134
# define BIO_F_BIO_ACCEPT 101
# define BIO_F_BIO_ACCEPT_EX 137
# define BIO_F_BIO_ACCEPT_NEW 152
# define BIO_F_BIO_ADDR_NEW 144
# define BIO_F_BIO_BIND 147
# define BIO_F_BIO_CALLBACK_CTRL 131
# define BIO_F_BIO_CONNECT 138
# define BIO_F_BIO_CONNECT_NEW 153
# define BIO_F_BIO_CTRL 103
# define BIO_F_BIO_GETS 104
# define BIO_F_BIO_GET_HOST_IP 106
# define BIO_F_BIO_GET_NEW_INDEX 102
# define BIO_F_BIO_GET_PORT 107
# define BIO_F_BIO_LISTEN 139
# define BIO_F_BIO_LOOKUP 135
# define BIO_F_BIO_LOOKUP_EX 143
# define BIO_F_BIO_MAKE_PAIR 121
# define BIO_F_BIO_METH_NEW 146
# define BIO_F_BIO_NEW 108
# define BIO_F_BIO_NEW_DGRAM_SCTP 145
# define BIO_F_BIO_NEW_FILE 109
# define BIO_F_BIO_NEW_MEM_BUF 126
# define BIO_F_BIO_NREAD 123
# define BIO_F_BIO_NREAD0 124
# define BIO_F_BIO_NWRITE 125
# define BIO_F_BIO_NWRITE0 122
# define BIO_F_BIO_PARSE_HOSTSERV 136
# define BIO_F_BIO_PUTS 110
# define BIO_F_BIO_READ 111
# define BIO_F_BIO_READ_EX 105
# define BIO_F_BIO_READ_INTERN 120
# define BIO_F_BIO_SOCKET 140
# define BIO_F_BIO_SOCKET_NBIO 142
# define BIO_F_BIO_SOCK_INFO 141
# define BIO_F_BIO_SOCK_INIT 112
# define BIO_F_BIO_WRITE 113
# define BIO_F_BIO_WRITE_EX 119
# define BIO_F_BIO_WRITE_INTERN 128
# define BIO_F_BUFFER_CTRL 114
# define BIO_F_CONN_CTRL 127
# define BIO_F_CONN_STATE 115
# define BIO_F_DGRAM_SCTP_NEW 149
# define BIO_F_DGRAM_SCTP_READ 132
# define BIO_F_DGRAM_SCTP_WRITE 133
# define BIO_F_DOAPR_OUTCH 150
# define BIO_F_FILE_CTRL 116
# define BIO_F_FILE_READ 130
# define BIO_F_LINEBUFFER_CTRL 129
# define BIO_F_LINEBUFFER_NEW 151
# define BIO_F_MEM_WRITE 117
# define BIO_F_NBIOF_NEW 154
# define BIO_F_SLG_WRITE 155
# define BIO_F_SSL_NEW 118
/*
* BIO reason codes.
*/
# define BIO_R_ACCEPT_ERROR 100
# define BIO_R_ADDRINFO_ADDR_IS_NOT_AF_INET 141
# define BIO_R_AMBIGUOUS_HOST_OR_SERVICE 129
# define BIO_R_BAD_FOPEN_MODE 101
# define BIO_R_BROKEN_PIPE 124
# define BIO_R_CONNECT_ERROR 103
# define BIO_R_GETHOSTBYNAME_ADDR_IS_NOT_AF_INET 107
# define BIO_R_GETSOCKNAME_ERROR 132
# define BIO_R_GETSOCKNAME_TRUNCATED_ADDRESS 133
# define BIO_R_GETTING_SOCKTYPE 134
# define BIO_R_INVALID_ARGUMENT 125
# define BIO_R_INVALID_SOCKET 135
# define BIO_R_IN_USE 123
# define BIO_R_LENGTH_TOO_LONG 102
# define BIO_R_LISTEN_V6_ONLY 136
# define BIO_R_LOOKUP_RETURNED_NOTHING 142
# define BIO_R_MALFORMED_HOST_OR_SERVICE 130
# define BIO_R_NBIO_CONNECT_ERROR 110
# define BIO_R_NO_ACCEPT_ADDR_OR_SERVICE_SPECIFIED 143
# define BIO_R_NO_HOSTNAME_OR_SERVICE_SPECIFIED 144
# define BIO_R_NO_PORT_DEFINED 113
# define BIO_R_NO_SUCH_FILE 128
# define BIO_R_NULL_PARAMETER 115
# define BIO_R_UNABLE_TO_BIND_SOCKET 117
# define BIO_R_UNABLE_TO_CREATE_SOCKET 118
# define BIO_R_UNABLE_TO_KEEPALIVE 137
# define BIO_R_UNABLE_TO_LISTEN_SOCKET 119
# define BIO_R_UNABLE_TO_NODELAY 138
# define BIO_R_UNABLE_TO_REUSEADDR 139
# define BIO_R_UNAVAILABLE_IP_FAMILY 145
# define BIO_R_UNINITIALIZED 120
# define BIO_R_UNKNOWN_INFO_TYPE 140
# define BIO_R_UNSUPPORTED_IP_FAMILY 146
# define BIO_R_UNSUPPORTED_METHOD 121
# define BIO_R_UNSUPPORTED_PROTOCOL_FAMILY 131
# define BIO_R_WRITE_TO_READ_ONLY_BIO 126
# define BIO_R_WSASTARTUP 122
#endif

View File

@ -1,130 +1,61 @@
/* crypto/bf/blowfish.h */ /*
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
* All rights reserved. *
* * Licensed under the OpenSSL license (the "License"). You may not use
* This package is an SSL implementation written * this file except in compliance with the License. You can obtain a copy
* by Eric Young (eay@cryptsoft.com). * in the file LICENSE in the source distribution or at
* The implementation was written so as to conform with Netscapes SSL. * https://www.openssl.org/source/license.html
* */
* This library is free for commercial and non-commercial use as long as
* the following conditions are aheared to. The following conditions #ifndef HEADER_BLOWFISH_H
* apply to all code found in this distribution, be it the RC4, RSA, # define HEADER_BLOWFISH_H
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
* included with this distribution is covered by the same copyright terms # include <openssl/opensslconf.h>
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
* # ifndef OPENSSL_NO_BF
* Copyright remains Eric Young's, and as such any Copyright notices in # include <openssl/e_os2.h>
* the code are not to be removed. # ifdef __cplusplus
* If this package is used in a product, Eric Young should be given attribution extern "C" {
* as the author of the parts of the library used. # endif
* This can be in the form of a textual message at program startup or
* in documentation (online or textual) provided with the package. # define BF_ENCRYPT 1
* # define BF_DECRYPT 0
* 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 * ! BF_LONG has to be at least 32 bits wide. !
* 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 # define BF_LONG unsigned int
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software # define BF_ROUNDS 16
* must display the following acknowledgement: # define BF_BLOCK 8
* "This product includes cryptographic software written by
* Eric Young (eay@cryptsoft.com)" typedef struct bf_key_st {
* The word 'cryptographic' can be left out if the rouines from the library BF_LONG P[BF_ROUNDS + 2];
* being used are not cryptographic related :-). BF_LONG S[4 * 256];
* 4. If you include any Windows specific code (or a derivative thereof) from } BF_KEY;
* the apps directory (application code) you must include an acknowledgement:
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" void BF_set_key(BF_KEY *key, int len, const unsigned char *data);
*
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND void BF_encrypt(BF_LONG *data, const BF_KEY *key);
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE void BF_decrypt(BF_LONG *data, const BF_KEY *key);
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE void BF_ecb_encrypt(const unsigned char *in, unsigned char *out,
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL const BF_KEY *key, int enc);
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS void BF_cbc_encrypt(const unsigned char *in, unsigned char *out, long length,
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) const BF_KEY *schedule, unsigned char *ivec, int enc);
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT void BF_cfb64_encrypt(const unsigned char *in, unsigned char *out,
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY long length, const BF_KEY *schedule,
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF unsigned char *ivec, int *num, int enc);
* SUCH DAMAGE. void BF_ofb64_encrypt(const unsigned char *in, unsigned char *out,
* long length, const BF_KEY *schedule,
* The licence and distribution terms for any publically available version or unsigned char *ivec, int *num);
* derivative of this code cannot be changed. i.e. this code cannot simply be const char *BF_options(void);
* copied and put under another distribution licence
* [including the GNU Public Licence.] # ifdef __cplusplus
*/ }
# endif
#ifndef HEADER_BLOWFISH_H # endif
# define HEADER_BLOWFISH_H
#endif
# 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

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,96 @@
/*
* Generated by util/mkerr.pl DO NOT EDIT
* Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/license.html
*/
#ifndef HEADER_BNERR_H
# define HEADER_BNERR_H
# ifdef __cplusplus
extern "C"
# endif
int ERR_load_BN_strings(void);
/*
* BN function codes.
*/
# define BN_F_BNRAND 127
# define BN_F_BNRAND_RANGE 138
# define BN_F_BN_BLINDING_CONVERT_EX 100
# define BN_F_BN_BLINDING_CREATE_PARAM 128
# define BN_F_BN_BLINDING_INVERT_EX 101
# define BN_F_BN_BLINDING_NEW 102
# define BN_F_BN_BLINDING_UPDATE 103
# define BN_F_BN_BN2DEC 104
# define BN_F_BN_BN2HEX 105
# define BN_F_BN_COMPUTE_WNAF 142
# define BN_F_BN_CTX_GET 116
# define BN_F_BN_CTX_NEW 106
# define BN_F_BN_CTX_START 129
# define BN_F_BN_DIV 107
# define BN_F_BN_DIV_RECP 130
# define BN_F_BN_EXP 123
# define BN_F_BN_EXPAND_INTERNAL 120
# define BN_F_BN_GENCB_NEW 143
# define BN_F_BN_GENERATE_DSA_NONCE 140
# define BN_F_BN_GENERATE_PRIME_EX 141
# define BN_F_BN_GF2M_MOD 131
# define BN_F_BN_GF2M_MOD_EXP 132
# define BN_F_BN_GF2M_MOD_MUL 133
# define BN_F_BN_GF2M_MOD_SOLVE_QUAD 134
# define BN_F_BN_GF2M_MOD_SOLVE_QUAD_ARR 135
# define BN_F_BN_GF2M_MOD_SQR 136
# define BN_F_BN_GF2M_MOD_SQRT 137
# define BN_F_BN_LSHIFT 145
# define BN_F_BN_MOD_EXP2_MONT 118
# define BN_F_BN_MOD_EXP_MONT 109
# define BN_F_BN_MOD_EXP_MONT_CONSTTIME 124
# define BN_F_BN_MOD_EXP_MONT_WORD 117
# define BN_F_BN_MOD_EXP_RECP 125
# define BN_F_BN_MOD_EXP_SIMPLE 126
# define BN_F_BN_MOD_INVERSE 110
# define BN_F_BN_MOD_INVERSE_NO_BRANCH 139
# define BN_F_BN_MOD_LSHIFT_QUICK 119
# define BN_F_BN_MOD_SQRT 121
# define BN_F_BN_MONT_CTX_NEW 149
# define BN_F_BN_MPI2BN 112
# define BN_F_BN_NEW 113
# define BN_F_BN_POOL_GET 147
# define BN_F_BN_RAND 114
# define BN_F_BN_RAND_RANGE 122
# define BN_F_BN_RECP_CTX_NEW 150
# define BN_F_BN_RSHIFT 146
# define BN_F_BN_SET_WORDS 144
# define BN_F_BN_STACK_PUSH 148
# define BN_F_BN_USUB 115
/*
* BN reason codes.
*/
# define BN_R_ARG2_LT_ARG3 100
# define BN_R_BAD_RECIPROCAL 101
# define BN_R_BIGNUM_TOO_LONG 114
# define BN_R_BITS_TOO_SMALL 118
# define BN_R_CALLED_WITH_EVEN_MODULUS 102
# define BN_R_DIV_BY_ZERO 103
# define BN_R_ENCODING_ERROR 104
# define BN_R_EXPAND_ON_STATIC_BIGNUM_DATA 105
# define BN_R_INPUT_NOT_REDUCED 110
# define BN_R_INVALID_LENGTH 106
# define BN_R_INVALID_RANGE 115
# define BN_R_INVALID_SHIFT 119
# define BN_R_NOT_A_SQUARE 111
# define BN_R_NOT_INITIALIZED 107
# define BN_R_NO_INVERSE 108
# define BN_R_NO_SOLUTION 116
# define BN_R_PRIVATE_KEY_TOO_LARGE 117
# define BN_R_P_IS_NOT_PRIME 112
# define BN_R_TOO_MANY_ITERATIONS 113
# define BN_R_TOO_MANY_TEMPORARY_VARIABLES 109
#endif

View File

@ -1,125 +1,58 @@
/* crypto/buffer/buffer.h */ /*
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
* All rights reserved. *
* * Licensed under the OpenSSL license (the "License"). You may not use
* This package is an SSL implementation written * this file except in compliance with the License. You can obtain a copy
* by Eric Young (eay@cryptsoft.com). * in the file LICENSE in the source distribution or at
* The implementation was written so as to conform with Netscapes SSL. * https://www.openssl.org/source/license.html
* */
* This library is free for commercial and non-commercial use as long as
* the following conditions are aheared to. The following conditions #ifndef HEADER_BUFFER_H
* apply to all code found in this distribution, be it the RC4, RSA, # define HEADER_BUFFER_H
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
* included with this distribution is covered by the same copyright terms # include <openssl/ossl_typ.h>
* except that the holder is Tim Hudson (tjh@cryptsoft.com). # ifndef HEADER_CRYPTO_H
* # include <openssl/crypto.h>
* Copyright remains Eric Young's, and as such any Copyright notices in # endif
* the code are not to be removed. # include <openssl/buffererr.h>
* 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 #ifdef __cplusplus
* in documentation (online or textual) provided with the package. extern "C" {
* #endif
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions # include <stddef.h>
* are met: # include <sys/types.h>
* 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 * These names are outdated as of OpenSSL 1.1; a future release
* notice, this list of conditions and the following disclaimer in the * will move them to be deprecated.
* documentation and/or other materials provided with the distribution. */
* 3. All advertising materials mentioning features or use of this software # define BUF_strdup(s) OPENSSL_strdup(s)
* must display the following acknowledgement: # define BUF_strndup(s, size) OPENSSL_strndup(s, size)
* "This product includes cryptographic software written by # define BUF_memdup(data, size) OPENSSL_memdup(data, size)
* Eric Young (eay@cryptsoft.com)" # define BUF_strlcpy(dst, src, size) OPENSSL_strlcpy(dst, src, size)
* The word 'cryptographic' can be left out if the rouines from the library # define BUF_strlcat(dst, src, size) OPENSSL_strlcat(dst, src, size)
* being used are not cryptographic related :-). # define BUF_strnlen(str, maxlen) OPENSSL_strnlen(str, maxlen)
* 4. If you include any Windows specific code (or a derivative thereof) from
* the apps directory (application code) you must include an acknowledgement: struct buf_mem_st {
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" size_t length; /* current number of bytes */
* char *data;
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND size_t max; /* size of buffer */
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE unsigned long flags;
* 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 # define BUF_MEM_FLAG_SECURE 0x01
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) BUF_MEM *BUF_MEM_new(void);
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT BUF_MEM *BUF_MEM_new_ex(unsigned long flags);
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY void BUF_MEM_free(BUF_MEM *a);
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF size_t BUF_MEM_grow(BUF_MEM *str, size_t len);
* SUCH DAMAGE. size_t BUF_MEM_grow_clean(BUF_MEM *str, size_t len);
* void BUF_reverse(unsigned char *out, const unsigned char *in, size_t siz);
* 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 # ifdef __cplusplus
* [including the GNU Public Licence.] }
*/ # endif
#endif
#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

View File

@ -0,0 +1,30 @@
/*
* Generated by util/mkerr.pl DO NOT EDIT
* Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/license.html
*/
#ifndef HEADER_BUFERR_H
# define HEADER_BUFERR_H
# ifdef __cplusplus
extern "C"
# endif
int ERR_load_BUF_strings(void);
/*
* BUF function codes.
*/
# define BUF_F_BUF_MEM_GROW 100
# define BUF_F_BUF_MEM_GROW_CLEAN 105
# define BUF_F_BUF_MEM_NEW 101
/*
* BUF reason codes.
*/
#endif

View File

@ -1,132 +1,83 @@
/* crypto/camellia/camellia.h */ /*
/* ==================================================================== * Copyright 2006-2016 The OpenSSL Project Authors. All Rights Reserved.
* Copyright (c) 2006 The OpenSSL Project. All rights reserved. *
* * Licensed under the OpenSSL license (the "License"). You may not use
* Redistribution and use in source and binary forms, with or without * this file except in compliance with the License. You can obtain a copy
* modification, are permitted provided that the following conditions * in the file LICENSE in the source distribution or at
* are met: * https://www.openssl.org/source/license.html
* */
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer. #ifndef HEADER_CAMELLIA_H
* # define HEADER_CAMELLIA_H
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in # include <openssl/opensslconf.h>
* the documentation and/or other materials provided with the
* distribution. # ifndef OPENSSL_NO_CAMELLIA
* # include <stddef.h>
* 3. All advertising materials mentioning features or use of this #ifdef __cplusplus
* software must display the following acknowledgment: extern "C" {
* "This product includes software developed by the OpenSSL Project #endif
* for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
* # define CAMELLIA_ENCRYPT 1
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to # define CAMELLIA_DECRYPT 0
* endorse or promote products derived from this software without
* prior written permission. For written permission, please contact /*
* openssl-core@openssl.org. * Because array size can't be a const in C, the following two are macros.
* * Both sizes are in bytes.
* 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. /* This should be a hidden type, but EVP requires that the size be known */
*
* 6. Redistributions of any form whatsoever must retain the following # define CAMELLIA_BLOCK_SIZE 16
* acknowledgment: # define CAMELLIA_TABLE_BYTE_LEN 272
* "This product includes software developed by the OpenSSL Project # define CAMELLIA_TABLE_WORD_LEN (CAMELLIA_TABLE_BYTE_LEN / 4)
* for use in the OpenSSL Toolkit (http://www.openssl.org/)"
* typedef unsigned int KEY_TABLE_TYPE[CAMELLIA_TABLE_WORD_LEN]; /* to match
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY * with WORD */
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR struct camellia_key_st {
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR union {
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, double d; /* ensures 64-bit align */
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT KEY_TABLE_TYPE rd_key;
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; } u;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) int grand_rounds;
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, };
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) typedef struct camellia_key_st CAMELLIA_KEY;
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE. 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);
#ifndef HEADER_CAMELLIA_H void Camellia_decrypt(const unsigned char *in, unsigned char *out,
# define HEADER_CAMELLIA_H const CAMELLIA_KEY *key);
# include <openssl/opensslconf.h> void Camellia_ecb_encrypt(const unsigned char *in, unsigned char *out,
const CAMELLIA_KEY *key, const int enc);
# ifdef OPENSSL_NO_CAMELLIA void Camellia_cbc_encrypt(const unsigned char *in, unsigned char *out,
# error CAMELLIA is disabled. size_t length, const CAMELLIA_KEY *key,
# endif unsigned char *ivec, const int enc);
void Camellia_cfb128_encrypt(const unsigned char *in, unsigned char *out,
# include <stddef.h> size_t length, const CAMELLIA_KEY *key,
unsigned char *ivec, int *num, const int enc);
# define CAMELLIA_ENCRYPT 1 void Camellia_cfb1_encrypt(const unsigned char *in, unsigned char *out,
# define CAMELLIA_DECRYPT 0 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,
* Because array size can't be a const in C, the following two are macros. size_t length, const CAMELLIA_KEY *key,
* Both sizes are in bytes. 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,
#ifdef __cplusplus unsigned char *ivec, int *num);
extern "C" { void Camellia_ctr128_encrypt(const unsigned char *in, unsigned char *out,
#endif size_t length, const CAMELLIA_KEY *key,
unsigned char ivec[CAMELLIA_BLOCK_SIZE],
/* This should be a hidden type, but EVP requires that the size be known */ unsigned char ecount_buf[CAMELLIA_BLOCK_SIZE],
unsigned int *num);
# define CAMELLIA_BLOCK_SIZE 16
# define CAMELLIA_TABLE_BYTE_LEN 272 # ifdef __cplusplus
# define CAMELLIA_TABLE_WORD_LEN (CAMELLIA_TABLE_BYTE_LEN / 4) }
# endif
typedef unsigned int KEY_TABLE_TYPE[CAMELLIA_TABLE_WORD_LEN]; /* to match # endif
* with WORD */
#endif
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 */

View File

@ -1,107 +1,53 @@
/* crypto/cast/cast.h */ /*
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
* All rights reserved. *
* * Licensed under the OpenSSL license (the "License"). You may not use
* This package is an SSL implementation written * this file except in compliance with the License. You can obtain a copy
* by Eric Young (eay@cryptsoft.com). * in the file LICENSE in the source distribution or at
* The implementation was written so as to conform with Netscapes SSL. * https://www.openssl.org/source/license.html
* */
* This library is free for commercial and non-commercial use as long as
* the following conditions are aheared to. The following conditions #ifndef HEADER_CAST_H
* apply to all code found in this distribution, be it the RC4, RSA, # define HEADER_CAST_H
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
* included with this distribution is covered by the same copyright terms # include <openssl/opensslconf.h>
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
* # ifndef OPENSSL_NO_CAST
* Copyright remains Eric Young's, and as such any Copyright notices in # ifdef __cplusplus
* the code are not to be removed. extern "C" {
* If this package is used in a product, Eric Young should be given attribution # endif
* as the author of the parts of the library used.
* This can be in the form of a textual message at program startup or # define CAST_ENCRYPT 1
* in documentation (online or textual) provided with the package. # define CAST_DECRYPT 0
*
* Redistribution and use in source and binary forms, with or without # define CAST_LONG unsigned int
* modification, are permitted provided that the following conditions
* are met: # define CAST_BLOCK 8
* 1. Redistributions of source code must retain the copyright # define CAST_KEY_LENGTH 16
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright typedef struct cast_key_st {
* notice, this list of conditions and the following disclaimer in the CAST_LONG data[32];
* documentation and/or other materials provided with the distribution. int short_key; /* Use reduced rounds for short key */
* 3. All advertising materials mentioning features or use of this software } CAST_KEY;
* must display the following acknowledgement:
* "This product includes cryptographic software written by void CAST_set_key(CAST_KEY *key, int len, const unsigned char *data);
* Eric Young (eay@cryptsoft.com)" void CAST_ecb_encrypt(const unsigned char *in, unsigned char *out,
* The word 'cryptographic' can be left out if the rouines from the library const CAST_KEY *key, int enc);
* being used are not cryptographic related :-). void CAST_encrypt(CAST_LONG *data, const CAST_KEY *key);
* 4. If you include any Windows specific code (or a derivative thereof) from void CAST_decrypt(CAST_LONG *data, const CAST_KEY *key);
* the apps directory (application code) you must include an acknowledgement: void CAST_cbc_encrypt(const unsigned char *in, unsigned char *out,
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" long length, const CAST_KEY *ks, unsigned char *iv,
* int enc);
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND void CAST_cfb64_encrypt(const unsigned char *in, unsigned char *out,
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE long length, const CAST_KEY *schedule,
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE unsigned char *ivec, int *num, int enc);
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE void CAST_ofb64_encrypt(const unsigned char *in, unsigned char *out,
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL long length, const CAST_KEY *schedule,
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS unsigned char *ivec, int *num);
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT # ifdef __cplusplus
* 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 # endif
* SUCH DAMAGE. # endif
*
* The licence and distribution terms for any publically available version or #endif
* 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

View File

@ -1,82 +1,41 @@
/* crypto/cmac/cmac.h */ /*
/* * Copyright 2010-2016 The OpenSSL Project Authors. All Rights Reserved.
* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL *
* project. * Licensed under the OpenSSL license (the "License"). You may not use
*/ * this file except in compliance with the License. You can obtain a copy
/* ==================================================================== * in the file LICENSE in the source distribution or at
* Copyright (c) 2010 The OpenSSL Project. All rights reserved. * https://www.openssl.org/source/license.html
* */
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions #ifndef HEADER_CMAC_H
* are met: # define HEADER_CMAC_H
*
* 1. Redistributions of source code must retain the above copyright # ifndef OPENSSL_NO_CMAC
* notice, this list of conditions and the following disclaimer.
* #ifdef __cplusplus
* 2. Redistributions in binary form must reproduce the above copyright extern "C" {
* notice, this list of conditions and the following disclaimer in #endif
* the documentation and/or other materials provided with the
* distribution. # include <openssl/evp.h>
*
* 3. All advertising materials mentioning features or use of this /* Opaque */
* software must display the following acknowledgment: typedef struct CMAC_CTX_st CMAC_CTX;
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" CMAC_CTX *CMAC_CTX_new(void);
* void CMAC_CTX_cleanup(CMAC_CTX *ctx);
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to void CMAC_CTX_free(CMAC_CTX *ctx);
* endorse or promote products derived from this software without EVP_CIPHER_CTX *CMAC_CTX_get0_cipher_ctx(CMAC_CTX *ctx);
* prior written permission. For written permission, please contact int CMAC_CTX_copy(CMAC_CTX *out, const CMAC_CTX *in);
* licensing@OpenSSL.org.
* int CMAC_Init(CMAC_CTX *ctx, const void *key, size_t keylen,
* 5. Products derived from this software may not be called "OpenSSL" const EVP_CIPHER *cipher, ENGINE *impl);
* nor may "OpenSSL" appear in their names without prior written int CMAC_Update(CMAC_CTX *ctx, const void *data, size_t dlen);
* permission of the OpenSSL Project. int CMAC_Final(CMAC_CTX *ctx, unsigned char *out, size_t *poutlen);
* int CMAC_resume(CMAC_CTX *ctx);
* 6. Redistributions of any form whatsoever must retain the following
* acknowledgment: #ifdef __cplusplus
* "This product includes software developed by the OpenSSL Project }
* for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" #endif
*
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY # endif
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE #endif
* 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

View File

@ -1,555 +1,342 @@
/* crypto/cms/cms.h */ /*
/* * Copyright 2008-2018 The OpenSSL Project Authors. All Rights Reserved.
* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL *
* project. * Licensed under the OpenSSL license (the "License"). You may not use
*/ * this file except in compliance with the License. You can obtain a copy
/* ==================================================================== * in the file LICENSE in the source distribution or at
* Copyright (c) 2008 The OpenSSL Project. All rights reserved. * https://www.openssl.org/source/license.html
* */
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions #ifndef HEADER_CMS_H
* are met: # define HEADER_CMS_H
*
* 1. Redistributions of source code must retain the above copyright # include <openssl/opensslconf.h>
* notice, this list of conditions and the following disclaimer.
* # ifndef OPENSSL_NO_CMS
* 2. Redistributions in binary form must reproduce the above copyright # include <openssl/x509.h>
* notice, this list of conditions and the following disclaimer in # include <openssl/x509v3.h>
* the documentation and/or other materials provided with the # include <openssl/cmserr.h>
* distribution. # ifdef __cplusplus
* extern "C" {
* 3. All advertising materials mentioning features or use of this # endif
* software must display the following acknowledgment:
* "This product includes software developed by the OpenSSL Project typedef struct CMS_ContentInfo_st CMS_ContentInfo;
* for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" typedef struct CMS_SignerInfo_st CMS_SignerInfo;
* typedef struct CMS_CertificateChoices CMS_CertificateChoices;
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to typedef struct CMS_RevocationInfoChoice_st CMS_RevocationInfoChoice;
* endorse or promote products derived from this software without typedef struct CMS_RecipientInfo_st CMS_RecipientInfo;
* prior written permission. For written permission, please contact typedef struct CMS_ReceiptRequest_st CMS_ReceiptRequest;
* licensing@OpenSSL.org. typedef struct CMS_Receipt_st CMS_Receipt;
* typedef struct CMS_RecipientEncryptedKey_st CMS_RecipientEncryptedKey;
* 5. Products derived from this software may not be called "OpenSSL" typedef struct CMS_OtherKeyAttribute_st CMS_OtherKeyAttribute;
* nor may "OpenSSL" appear in their names without prior written
* permission of the OpenSSL Project. DEFINE_STACK_OF(CMS_SignerInfo)
* DEFINE_STACK_OF(CMS_RecipientEncryptedKey)
* 6. Redistributions of any form whatsoever must retain the following DEFINE_STACK_OF(CMS_RecipientInfo)
* acknowledgment: DEFINE_STACK_OF(CMS_RevocationInfoChoice)
* "This product includes software developed by the OpenSSL Project DECLARE_ASN1_FUNCTIONS(CMS_ContentInfo)
* for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" DECLARE_ASN1_FUNCTIONS(CMS_ReceiptRequest)
* DECLARE_ASN1_PRINT_FUNCTION(CMS_ContentInfo)
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # define CMS_SIGNERINFO_ISSUER_SERIAL 0
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR # define CMS_SIGNERINFO_KEYIDENTIFIER 1
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, # define CMS_RECIPINFO_NONE -1
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT # define CMS_RECIPINFO_TRANS 0
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; # define CMS_RECIPINFO_AGREE 1
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) # define CMS_RECIPINFO_KEK 2
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, # define CMS_RECIPINFO_PASS 3
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) # define CMS_RECIPINFO_OTHER 4
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE. /* S/MIME related flags */
* ====================================================================
*/ # define CMS_TEXT 0x1
# define CMS_NOCERTS 0x2
#ifndef HEADER_CMS_H # define CMS_NO_CONTENT_VERIFY 0x4
# define HEADER_CMS_H # define CMS_NO_ATTR_VERIFY 0x8
# define CMS_NOSIGS \
# include <openssl/x509.h> (CMS_NO_CONTENT_VERIFY|CMS_NO_ATTR_VERIFY)
# define CMS_NOINTERN 0x10
# ifdef OPENSSL_NO_CMS # define CMS_NO_SIGNER_CERT_VERIFY 0x20
# error CMS is disabled. # define CMS_NOVERIFY 0x20
# endif # define CMS_DETACHED 0x40
# define CMS_BINARY 0x80
#ifdef __cplusplus # define CMS_NOATTR 0x100
extern "C" { # define CMS_NOSMIMECAP 0x200
#endif # define CMS_NOOLDMIMETYPE 0x400
# define CMS_CRLFEOL 0x800
typedef struct CMS_ContentInfo_st CMS_ContentInfo; # define CMS_STREAM 0x1000
typedef struct CMS_SignerInfo_st CMS_SignerInfo; # define CMS_NOCRL 0x2000
typedef struct CMS_CertificateChoices CMS_CertificateChoices; # define CMS_PARTIAL 0x4000
typedef struct CMS_RevocationInfoChoice_st CMS_RevocationInfoChoice; # define CMS_REUSE_DIGEST 0x8000
typedef struct CMS_RecipientInfo_st CMS_RecipientInfo; # define CMS_USE_KEYID 0x10000
typedef struct CMS_ReceiptRequest_st CMS_ReceiptRequest; # define CMS_DEBUG_DECRYPT 0x20000
typedef struct CMS_Receipt_st CMS_Receipt; # define CMS_KEY_PARAM 0x40000
typedef struct CMS_RecipientEncryptedKey_st CMS_RecipientEncryptedKey; # define CMS_ASCIICRLF 0x80000
typedef struct CMS_OtherKeyAttribute_st CMS_OtherKeyAttribute;
const ASN1_OBJECT *CMS_get0_type(const CMS_ContentInfo *cms);
DECLARE_STACK_OF(CMS_SignerInfo)
DECLARE_STACK_OF(GENERAL_NAMES) BIO *CMS_dataInit(CMS_ContentInfo *cms, BIO *icont);
DECLARE_STACK_OF(CMS_RecipientEncryptedKey) int CMS_dataFinal(CMS_ContentInfo *cms, BIO *bio);
DECLARE_ASN1_FUNCTIONS(CMS_ContentInfo)
DECLARE_ASN1_FUNCTIONS(CMS_ReceiptRequest) ASN1_OCTET_STRING **CMS_get0_content(CMS_ContentInfo *cms);
DECLARE_ASN1_PRINT_FUNCTION(CMS_ContentInfo) int CMS_is_detached(CMS_ContentInfo *cms);
int CMS_set_detached(CMS_ContentInfo *cms, int detached);
# define CMS_SIGNERINFO_ISSUER_SERIAL 0
# define CMS_SIGNERINFO_KEYIDENTIFIER 1 # ifdef HEADER_PEM_H
DECLARE_PEM_rw_const(CMS, CMS_ContentInfo)
# define CMS_RECIPINFO_NONE -1 # endif
# define CMS_RECIPINFO_TRANS 0 int CMS_stream(unsigned char ***boundary, CMS_ContentInfo *cms);
# define CMS_RECIPINFO_AGREE 1 CMS_ContentInfo *d2i_CMS_bio(BIO *bp, CMS_ContentInfo **cms);
# define CMS_RECIPINFO_KEK 2 int i2d_CMS_bio(BIO *bp, CMS_ContentInfo *cms);
# define CMS_RECIPINFO_PASS 3
# define CMS_RECIPINFO_OTHER 4 BIO *BIO_new_CMS(BIO *out, CMS_ContentInfo *cms);
int i2d_CMS_bio_stream(BIO *out, CMS_ContentInfo *cms, BIO *in, int flags);
/* S/MIME related flags */ int PEM_write_bio_CMS_stream(BIO *out, CMS_ContentInfo *cms, BIO *in,
int flags);
# define CMS_TEXT 0x1 CMS_ContentInfo *SMIME_read_CMS(BIO *bio, BIO **bcont);
# define CMS_NOCERTS 0x2 int SMIME_write_CMS(BIO *bio, CMS_ContentInfo *cms, BIO *data, int flags);
# define CMS_NO_CONTENT_VERIFY 0x4
# define CMS_NO_ATTR_VERIFY 0x8 int CMS_final(CMS_ContentInfo *cms, BIO *data, BIO *dcont,
# define CMS_NOSIGS \ unsigned int flags);
(CMS_NO_CONTENT_VERIFY|CMS_NO_ATTR_VERIFY)
# define CMS_NOINTERN 0x10 CMS_ContentInfo *CMS_sign(X509 *signcert, EVP_PKEY *pkey,
# define CMS_NO_SIGNER_CERT_VERIFY 0x20 STACK_OF(X509) *certs, BIO *data,
# define CMS_NOVERIFY 0x20 unsigned int flags);
# define CMS_DETACHED 0x40
# define CMS_BINARY 0x80 CMS_ContentInfo *CMS_sign_receipt(CMS_SignerInfo *si,
# define CMS_NOATTR 0x100 X509 *signcert, EVP_PKEY *pkey,
# define CMS_NOSMIMECAP 0x200 STACK_OF(X509) *certs, unsigned int flags);
# define CMS_NOOLDMIMETYPE 0x400
# define CMS_CRLFEOL 0x800 int CMS_data(CMS_ContentInfo *cms, BIO *out, unsigned int flags);
# define CMS_STREAM 0x1000 CMS_ContentInfo *CMS_data_create(BIO *in, unsigned int flags);
# define CMS_NOCRL 0x2000
# define CMS_PARTIAL 0x4000 int CMS_digest_verify(CMS_ContentInfo *cms, BIO *dcont, BIO *out,
# define CMS_REUSE_DIGEST 0x8000 unsigned int flags);
# define CMS_USE_KEYID 0x10000 CMS_ContentInfo *CMS_digest_create(BIO *in, const EVP_MD *md,
# define CMS_DEBUG_DECRYPT 0x20000 unsigned int flags);
# define CMS_KEY_PARAM 0x40000
int CMS_EncryptedData_decrypt(CMS_ContentInfo *cms,
const ASN1_OBJECT *CMS_get0_type(CMS_ContentInfo *cms); const unsigned char *key, size_t keylen,
BIO *dcont, BIO *out, unsigned int flags);
BIO *CMS_dataInit(CMS_ContentInfo *cms, BIO *icont);
int CMS_dataFinal(CMS_ContentInfo *cms, BIO *bio); CMS_ContentInfo *CMS_EncryptedData_encrypt(BIO *in, const EVP_CIPHER *cipher,
const unsigned char *key,
ASN1_OCTET_STRING **CMS_get0_content(CMS_ContentInfo *cms); size_t keylen, unsigned int flags);
int CMS_is_detached(CMS_ContentInfo *cms);
int CMS_set_detached(CMS_ContentInfo *cms, int detached); int CMS_EncryptedData_set1_key(CMS_ContentInfo *cms, const EVP_CIPHER *ciph,
const unsigned char *key, size_t keylen);
# ifdef HEADER_PEM_H
DECLARE_PEM_rw_const(CMS, CMS_ContentInfo) int CMS_verify(CMS_ContentInfo *cms, STACK_OF(X509) *certs,
# endif X509_STORE *store, BIO *dcont, BIO *out, unsigned int flags);
int CMS_stream(unsigned char ***boundary, CMS_ContentInfo *cms);
CMS_ContentInfo *d2i_CMS_bio(BIO *bp, CMS_ContentInfo **cms); int CMS_verify_receipt(CMS_ContentInfo *rcms, CMS_ContentInfo *ocms,
int i2d_CMS_bio(BIO *bp, CMS_ContentInfo *cms); STACK_OF(X509) *certs,
X509_STORE *store, unsigned int flags);
BIO *BIO_new_CMS(BIO *out, CMS_ContentInfo *cms);
int i2d_CMS_bio_stream(BIO *out, CMS_ContentInfo *cms, BIO *in, int flags); STACK_OF(X509) *CMS_get0_signers(CMS_ContentInfo *cms);
int PEM_write_bio_CMS_stream(BIO *out, CMS_ContentInfo *cms, BIO *in,
int flags); CMS_ContentInfo *CMS_encrypt(STACK_OF(X509) *certs, BIO *in,
CMS_ContentInfo *SMIME_read_CMS(BIO *bio, BIO **bcont); const EVP_CIPHER *cipher, unsigned int flags);
int SMIME_write_CMS(BIO *bio, CMS_ContentInfo *cms, BIO *data, int flags);
int CMS_decrypt(CMS_ContentInfo *cms, EVP_PKEY *pkey, X509 *cert,
int CMS_final(CMS_ContentInfo *cms, BIO *data, BIO *dcont, BIO *dcont, BIO *out, unsigned int flags);
unsigned int flags);
int CMS_decrypt_set1_pkey(CMS_ContentInfo *cms, EVP_PKEY *pk, X509 *cert);
CMS_ContentInfo *CMS_sign(X509 *signcert, EVP_PKEY *pkey, int CMS_decrypt_set1_key(CMS_ContentInfo *cms,
STACK_OF(X509) *certs, BIO *data, unsigned char *key, size_t keylen,
unsigned int flags); const unsigned char *id, size_t idlen);
int CMS_decrypt_set1_password(CMS_ContentInfo *cms,
CMS_ContentInfo *CMS_sign_receipt(CMS_SignerInfo *si, unsigned char *pass, ossl_ssize_t passlen);
X509 *signcert, EVP_PKEY *pkey,
STACK_OF(X509) *certs, unsigned int flags); STACK_OF(CMS_RecipientInfo) *CMS_get0_RecipientInfos(CMS_ContentInfo *cms);
int CMS_RecipientInfo_type(CMS_RecipientInfo *ri);
int CMS_data(CMS_ContentInfo *cms, BIO *out, unsigned int flags); EVP_PKEY_CTX *CMS_RecipientInfo_get0_pkey_ctx(CMS_RecipientInfo *ri);
CMS_ContentInfo *CMS_data_create(BIO *in, unsigned int flags); CMS_ContentInfo *CMS_EnvelopedData_create(const EVP_CIPHER *cipher);
CMS_RecipientInfo *CMS_add1_recipient_cert(CMS_ContentInfo *cms,
int CMS_digest_verify(CMS_ContentInfo *cms, BIO *dcont, BIO *out, X509 *recip, unsigned int flags);
unsigned int flags); int CMS_RecipientInfo_set0_pkey(CMS_RecipientInfo *ri, EVP_PKEY *pkey);
CMS_ContentInfo *CMS_digest_create(BIO *in, const EVP_MD *md, int CMS_RecipientInfo_ktri_cert_cmp(CMS_RecipientInfo *ri, X509 *cert);
unsigned int flags); int CMS_RecipientInfo_ktri_get0_algs(CMS_RecipientInfo *ri,
EVP_PKEY **pk, X509 **recip,
int CMS_EncryptedData_decrypt(CMS_ContentInfo *cms, X509_ALGOR **palg);
const unsigned char *key, size_t keylen, int CMS_RecipientInfo_ktri_get0_signer_id(CMS_RecipientInfo *ri,
BIO *dcont, BIO *out, unsigned int flags); ASN1_OCTET_STRING **keyid,
X509_NAME **issuer,
CMS_ContentInfo *CMS_EncryptedData_encrypt(BIO *in, const EVP_CIPHER *cipher, ASN1_INTEGER **sno);
const unsigned char *key,
size_t keylen, unsigned int flags); CMS_RecipientInfo *CMS_add0_recipient_key(CMS_ContentInfo *cms, int nid,
unsigned char *key, size_t keylen,
int CMS_EncryptedData_set1_key(CMS_ContentInfo *cms, const EVP_CIPHER *ciph, unsigned char *id, size_t idlen,
const unsigned char *key, size_t keylen); ASN1_GENERALIZEDTIME *date,
ASN1_OBJECT *otherTypeId,
int CMS_verify(CMS_ContentInfo *cms, STACK_OF(X509) *certs, ASN1_TYPE *otherType);
X509_STORE *store, BIO *dcont, BIO *out, unsigned int flags);
int CMS_RecipientInfo_kekri_get0_id(CMS_RecipientInfo *ri,
int CMS_verify_receipt(CMS_ContentInfo *rcms, CMS_ContentInfo *ocms, X509_ALGOR **palg,
STACK_OF(X509) *certs, ASN1_OCTET_STRING **pid,
X509_STORE *store, unsigned int flags); ASN1_GENERALIZEDTIME **pdate,
ASN1_OBJECT **potherid,
STACK_OF(X509) *CMS_get0_signers(CMS_ContentInfo *cms); ASN1_TYPE **pothertype);
CMS_ContentInfo *CMS_encrypt(STACK_OF(X509) *certs, BIO *in, int CMS_RecipientInfo_set0_key(CMS_RecipientInfo *ri,
const EVP_CIPHER *cipher, unsigned int flags); unsigned char *key, size_t keylen);
int CMS_decrypt(CMS_ContentInfo *cms, EVP_PKEY *pkey, X509 *cert, int CMS_RecipientInfo_kekri_id_cmp(CMS_RecipientInfo *ri,
BIO *dcont, BIO *out, unsigned int flags); const unsigned char *id, size_t idlen);
int CMS_decrypt_set1_pkey(CMS_ContentInfo *cms, EVP_PKEY *pk, X509 *cert); int CMS_RecipientInfo_set0_password(CMS_RecipientInfo *ri,
int CMS_decrypt_set1_key(CMS_ContentInfo *cms, unsigned char *pass,
unsigned char *key, size_t keylen, ossl_ssize_t passlen);
unsigned char *id, size_t idlen);
int CMS_decrypt_set1_password(CMS_ContentInfo *cms, CMS_RecipientInfo *CMS_add0_recipient_password(CMS_ContentInfo *cms,
unsigned char *pass, ossl_ssize_t passlen); int iter, int wrap_nid,
int pbe_nid,
STACK_OF(CMS_RecipientInfo) *CMS_get0_RecipientInfos(CMS_ContentInfo *cms); unsigned char *pass,
int CMS_RecipientInfo_type(CMS_RecipientInfo *ri); ossl_ssize_t passlen,
EVP_PKEY_CTX *CMS_RecipientInfo_get0_pkey_ctx(CMS_RecipientInfo *ri); const EVP_CIPHER *kekciph);
CMS_ContentInfo *CMS_EnvelopedData_create(const EVP_CIPHER *cipher);
CMS_RecipientInfo *CMS_add1_recipient_cert(CMS_ContentInfo *cms, int CMS_RecipientInfo_decrypt(CMS_ContentInfo *cms, CMS_RecipientInfo *ri);
X509 *recip, unsigned int flags); int CMS_RecipientInfo_encrypt(CMS_ContentInfo *cms, CMS_RecipientInfo *ri);
int CMS_RecipientInfo_set0_pkey(CMS_RecipientInfo *ri, EVP_PKEY *pkey);
int CMS_RecipientInfo_ktri_cert_cmp(CMS_RecipientInfo *ri, X509 *cert); int CMS_uncompress(CMS_ContentInfo *cms, BIO *dcont, BIO *out,
int CMS_RecipientInfo_ktri_get0_algs(CMS_RecipientInfo *ri, unsigned int flags);
EVP_PKEY **pk, X509 **recip, CMS_ContentInfo *CMS_compress(BIO *in, int comp_nid, unsigned int flags);
X509_ALGOR **palg);
int CMS_RecipientInfo_ktri_get0_signer_id(CMS_RecipientInfo *ri, int CMS_set1_eContentType(CMS_ContentInfo *cms, const ASN1_OBJECT *oid);
ASN1_OCTET_STRING **keyid, const ASN1_OBJECT *CMS_get0_eContentType(CMS_ContentInfo *cms);
X509_NAME **issuer,
ASN1_INTEGER **sno); CMS_CertificateChoices *CMS_add0_CertificateChoices(CMS_ContentInfo *cms);
int CMS_add0_cert(CMS_ContentInfo *cms, X509 *cert);
CMS_RecipientInfo *CMS_add0_recipient_key(CMS_ContentInfo *cms, int nid, int CMS_add1_cert(CMS_ContentInfo *cms, X509 *cert);
unsigned char *key, size_t keylen, STACK_OF(X509) *CMS_get1_certs(CMS_ContentInfo *cms);
unsigned char *id, size_t idlen,
ASN1_GENERALIZEDTIME *date, CMS_RevocationInfoChoice *CMS_add0_RevocationInfoChoice(CMS_ContentInfo *cms);
ASN1_OBJECT *otherTypeId, int CMS_add0_crl(CMS_ContentInfo *cms, X509_CRL *crl);
ASN1_TYPE *otherType); int CMS_add1_crl(CMS_ContentInfo *cms, X509_CRL *crl);
STACK_OF(X509_CRL) *CMS_get1_crls(CMS_ContentInfo *cms);
int CMS_RecipientInfo_kekri_get0_id(CMS_RecipientInfo *ri,
X509_ALGOR **palg, int CMS_SignedData_init(CMS_ContentInfo *cms);
ASN1_OCTET_STRING **pid, CMS_SignerInfo *CMS_add1_signer(CMS_ContentInfo *cms,
ASN1_GENERALIZEDTIME **pdate, X509 *signer, EVP_PKEY *pk, const EVP_MD *md,
ASN1_OBJECT **potherid, unsigned int flags);
ASN1_TYPE **pothertype); EVP_PKEY_CTX *CMS_SignerInfo_get0_pkey_ctx(CMS_SignerInfo *si);
EVP_MD_CTX *CMS_SignerInfo_get0_md_ctx(CMS_SignerInfo *si);
int CMS_RecipientInfo_set0_key(CMS_RecipientInfo *ri, STACK_OF(CMS_SignerInfo) *CMS_get0_SignerInfos(CMS_ContentInfo *cms);
unsigned char *key, size_t keylen);
void CMS_SignerInfo_set1_signer_cert(CMS_SignerInfo *si, X509 *signer);
int CMS_RecipientInfo_kekri_id_cmp(CMS_RecipientInfo *ri, int CMS_SignerInfo_get0_signer_id(CMS_SignerInfo *si,
const unsigned char *id, size_t idlen); ASN1_OCTET_STRING **keyid,
X509_NAME **issuer, ASN1_INTEGER **sno);
int CMS_RecipientInfo_set0_password(CMS_RecipientInfo *ri, int CMS_SignerInfo_cert_cmp(CMS_SignerInfo *si, X509 *cert);
unsigned char *pass, int CMS_set1_signers_certs(CMS_ContentInfo *cms, STACK_OF(X509) *certs,
ossl_ssize_t passlen); unsigned int flags);
void CMS_SignerInfo_get0_algs(CMS_SignerInfo *si, EVP_PKEY **pk,
CMS_RecipientInfo *CMS_add0_recipient_password(CMS_ContentInfo *cms, X509 **signer, X509_ALGOR **pdig,
int iter, int wrap_nid, X509_ALGOR **psig);
int pbe_nid, ASN1_OCTET_STRING *CMS_SignerInfo_get0_signature(CMS_SignerInfo *si);
unsigned char *pass, int CMS_SignerInfo_sign(CMS_SignerInfo *si);
ossl_ssize_t passlen, int CMS_SignerInfo_verify(CMS_SignerInfo *si);
const EVP_CIPHER *kekciph); int CMS_SignerInfo_verify_content(CMS_SignerInfo *si, BIO *chain);
int CMS_RecipientInfo_decrypt(CMS_ContentInfo *cms, CMS_RecipientInfo *ri); int CMS_add_smimecap(CMS_SignerInfo *si, STACK_OF(X509_ALGOR) *algs);
int CMS_RecipientInfo_encrypt(CMS_ContentInfo *cms, CMS_RecipientInfo *ri); int CMS_add_simple_smimecap(STACK_OF(X509_ALGOR) **algs,
int algnid, int keysize);
int CMS_uncompress(CMS_ContentInfo *cms, BIO *dcont, BIO *out, int CMS_add_standard_smimecap(STACK_OF(X509_ALGOR) **smcap);
unsigned int flags);
CMS_ContentInfo *CMS_compress(BIO *in, int comp_nid, unsigned int flags); int CMS_signed_get_attr_count(const CMS_SignerInfo *si);
int CMS_signed_get_attr_by_NID(const CMS_SignerInfo *si, int nid,
int CMS_set1_eContentType(CMS_ContentInfo *cms, const ASN1_OBJECT *oid); int lastpos);
const ASN1_OBJECT *CMS_get0_eContentType(CMS_ContentInfo *cms); int CMS_signed_get_attr_by_OBJ(const CMS_SignerInfo *si, const ASN1_OBJECT *obj,
int lastpos);
CMS_CertificateChoices *CMS_add0_CertificateChoices(CMS_ContentInfo *cms); X509_ATTRIBUTE *CMS_signed_get_attr(const CMS_SignerInfo *si, int loc);
int CMS_add0_cert(CMS_ContentInfo *cms, X509 *cert); X509_ATTRIBUTE *CMS_signed_delete_attr(CMS_SignerInfo *si, int loc);
int CMS_add1_cert(CMS_ContentInfo *cms, X509 *cert); int CMS_signed_add1_attr(CMS_SignerInfo *si, X509_ATTRIBUTE *attr);
STACK_OF(X509) *CMS_get1_certs(CMS_ContentInfo *cms); int CMS_signed_add1_attr_by_OBJ(CMS_SignerInfo *si,
const ASN1_OBJECT *obj, int type,
CMS_RevocationInfoChoice *CMS_add0_RevocationInfoChoice(CMS_ContentInfo *cms); const void *bytes, int len);
int CMS_add0_crl(CMS_ContentInfo *cms, X509_CRL *crl); int CMS_signed_add1_attr_by_NID(CMS_SignerInfo *si,
int CMS_add1_crl(CMS_ContentInfo *cms, X509_CRL *crl); int nid, int type,
STACK_OF(X509_CRL) *CMS_get1_crls(CMS_ContentInfo *cms); const void *bytes, int len);
int CMS_signed_add1_attr_by_txt(CMS_SignerInfo *si,
int CMS_SignedData_init(CMS_ContentInfo *cms); const char *attrname, int type,
CMS_SignerInfo *CMS_add1_signer(CMS_ContentInfo *cms, const void *bytes, int len);
X509 *signer, EVP_PKEY *pk, const EVP_MD *md, void *CMS_signed_get0_data_by_OBJ(CMS_SignerInfo *si, const ASN1_OBJECT *oid,
unsigned int flags); int lastpos, int type);
EVP_PKEY_CTX *CMS_SignerInfo_get0_pkey_ctx(CMS_SignerInfo *si);
EVP_MD_CTX *CMS_SignerInfo_get0_md_ctx(CMS_SignerInfo *si); int CMS_unsigned_get_attr_count(const CMS_SignerInfo *si);
STACK_OF(CMS_SignerInfo) *CMS_get0_SignerInfos(CMS_ContentInfo *cms); int CMS_unsigned_get_attr_by_NID(const CMS_SignerInfo *si, int nid,
int lastpos);
void CMS_SignerInfo_set1_signer_cert(CMS_SignerInfo *si, X509 *signer); int CMS_unsigned_get_attr_by_OBJ(const CMS_SignerInfo *si,
int CMS_SignerInfo_get0_signer_id(CMS_SignerInfo *si, const ASN1_OBJECT *obj, int lastpos);
ASN1_OCTET_STRING **keyid, X509_ATTRIBUTE *CMS_unsigned_get_attr(const CMS_SignerInfo *si, int loc);
X509_NAME **issuer, ASN1_INTEGER **sno); X509_ATTRIBUTE *CMS_unsigned_delete_attr(CMS_SignerInfo *si, int loc);
int CMS_SignerInfo_cert_cmp(CMS_SignerInfo *si, X509 *cert); int CMS_unsigned_add1_attr(CMS_SignerInfo *si, X509_ATTRIBUTE *attr);
int CMS_set1_signers_certs(CMS_ContentInfo *cms, STACK_OF(X509) *certs, int CMS_unsigned_add1_attr_by_OBJ(CMS_SignerInfo *si,
unsigned int flags); const ASN1_OBJECT *obj, int type,
void CMS_SignerInfo_get0_algs(CMS_SignerInfo *si, EVP_PKEY **pk, const void *bytes, int len);
X509 **signer, X509_ALGOR **pdig, int CMS_unsigned_add1_attr_by_NID(CMS_SignerInfo *si,
X509_ALGOR **psig); int nid, int type,
ASN1_OCTET_STRING *CMS_SignerInfo_get0_signature(CMS_SignerInfo *si); const void *bytes, int len);
int CMS_SignerInfo_sign(CMS_SignerInfo *si); int CMS_unsigned_add1_attr_by_txt(CMS_SignerInfo *si,
int CMS_SignerInfo_verify(CMS_SignerInfo *si); const char *attrname, int type,
int CMS_SignerInfo_verify_content(CMS_SignerInfo *si, BIO *chain); const void *bytes, int len);
void *CMS_unsigned_get0_data_by_OBJ(CMS_SignerInfo *si, ASN1_OBJECT *oid,
int CMS_add_smimecap(CMS_SignerInfo *si, STACK_OF(X509_ALGOR) *algs); int lastpos, int type);
int CMS_add_simple_smimecap(STACK_OF(X509_ALGOR) **algs,
int algnid, int keysize); # ifdef HEADER_X509V3_H
int CMS_add_standard_smimecap(STACK_OF(X509_ALGOR) **smcap);
int CMS_get1_ReceiptRequest(CMS_SignerInfo *si, CMS_ReceiptRequest **prr);
int CMS_signed_get_attr_count(const CMS_SignerInfo *si); CMS_ReceiptRequest *CMS_ReceiptRequest_create0(unsigned char *id, int idlen,
int CMS_signed_get_attr_by_NID(const CMS_SignerInfo *si, int nid, int allorfirst,
int lastpos); STACK_OF(GENERAL_NAMES)
int CMS_signed_get_attr_by_OBJ(const CMS_SignerInfo *si, ASN1_OBJECT *obj, *receiptList, STACK_OF(GENERAL_NAMES)
int lastpos); *receiptsTo);
X509_ATTRIBUTE *CMS_signed_get_attr(const CMS_SignerInfo *si, int loc); int CMS_add1_ReceiptRequest(CMS_SignerInfo *si, CMS_ReceiptRequest *rr);
X509_ATTRIBUTE *CMS_signed_delete_attr(CMS_SignerInfo *si, int loc); void CMS_ReceiptRequest_get0_values(CMS_ReceiptRequest *rr,
int CMS_signed_add1_attr(CMS_SignerInfo *si, X509_ATTRIBUTE *attr); ASN1_STRING **pcid,
int CMS_signed_add1_attr_by_OBJ(CMS_SignerInfo *si, int *pallorfirst,
const ASN1_OBJECT *obj, int type, STACK_OF(GENERAL_NAMES) **plist,
const void *bytes, int len); STACK_OF(GENERAL_NAMES) **prto);
int CMS_signed_add1_attr_by_NID(CMS_SignerInfo *si, # endif
int nid, int type, int CMS_RecipientInfo_kari_get0_alg(CMS_RecipientInfo *ri,
const void *bytes, int len); X509_ALGOR **palg,
int CMS_signed_add1_attr_by_txt(CMS_SignerInfo *si, ASN1_OCTET_STRING **pukm);
const char *attrname, int type, STACK_OF(CMS_RecipientEncryptedKey)
const void *bytes, int len); *CMS_RecipientInfo_kari_get0_reks(CMS_RecipientInfo *ri);
void *CMS_signed_get0_data_by_OBJ(CMS_SignerInfo *si, ASN1_OBJECT *oid,
int lastpos, int type); int CMS_RecipientInfo_kari_get0_orig_id(CMS_RecipientInfo *ri,
X509_ALGOR **pubalg,
int CMS_unsigned_get_attr_count(const CMS_SignerInfo *si); ASN1_BIT_STRING **pubkey,
int CMS_unsigned_get_attr_by_NID(const CMS_SignerInfo *si, int nid, ASN1_OCTET_STRING **keyid,
int lastpos); X509_NAME **issuer,
int CMS_unsigned_get_attr_by_OBJ(const CMS_SignerInfo *si, ASN1_OBJECT *obj, ASN1_INTEGER **sno);
int lastpos);
X509_ATTRIBUTE *CMS_unsigned_get_attr(const CMS_SignerInfo *si, int loc); int CMS_RecipientInfo_kari_orig_id_cmp(CMS_RecipientInfo *ri, X509 *cert);
X509_ATTRIBUTE *CMS_unsigned_delete_attr(CMS_SignerInfo *si, int loc);
int CMS_unsigned_add1_attr(CMS_SignerInfo *si, X509_ATTRIBUTE *attr); int CMS_RecipientEncryptedKey_get0_id(CMS_RecipientEncryptedKey *rek,
int CMS_unsigned_add1_attr_by_OBJ(CMS_SignerInfo *si, ASN1_OCTET_STRING **keyid,
const ASN1_OBJECT *obj, int type, ASN1_GENERALIZEDTIME **tm,
const void *bytes, int len); CMS_OtherKeyAttribute **other,
int CMS_unsigned_add1_attr_by_NID(CMS_SignerInfo *si, X509_NAME **issuer, ASN1_INTEGER **sno);
int nid, int type, int CMS_RecipientEncryptedKey_cert_cmp(CMS_RecipientEncryptedKey *rek,
const void *bytes, int len); X509 *cert);
int CMS_unsigned_add1_attr_by_txt(CMS_SignerInfo *si, int CMS_RecipientInfo_kari_set0_pkey(CMS_RecipientInfo *ri, EVP_PKEY *pk);
const char *attrname, int type, EVP_CIPHER_CTX *CMS_RecipientInfo_kari_get0_ctx(CMS_RecipientInfo *ri);
const void *bytes, int len); int CMS_RecipientInfo_kari_decrypt(CMS_ContentInfo *cms,
void *CMS_unsigned_get0_data_by_OBJ(CMS_SignerInfo *si, ASN1_OBJECT *oid, CMS_RecipientInfo *ri,
int lastpos, int type); CMS_RecipientEncryptedKey *rek);
# ifdef HEADER_X509V3_H int CMS_SharedInfo_encode(unsigned char **pder, X509_ALGOR *kekalg,
ASN1_OCTET_STRING *ukm, int keylen);
int CMS_get1_ReceiptRequest(CMS_SignerInfo *si, CMS_ReceiptRequest **prr);
CMS_ReceiptRequest *CMS_ReceiptRequest_create0(unsigned char *id, int idlen, /* Backward compatibility for spelling errors. */
int allorfirst, # define CMS_R_UNKNOWN_DIGEST_ALGORITM CMS_R_UNKNOWN_DIGEST_ALGORITHM
STACK_OF(GENERAL_NAMES) # define CMS_R_UNSUPPORTED_RECPIENTINFO_TYPE \
*receiptList, STACK_OF(GENERAL_NAMES) CMS_R_UNSUPPORTED_RECIPIENTINFO_TYPE
*receiptsTo);
int CMS_add1_ReceiptRequest(CMS_SignerInfo *si, CMS_ReceiptRequest *rr); # ifdef __cplusplus
void CMS_ReceiptRequest_get0_values(CMS_ReceiptRequest *rr, }
ASN1_STRING **pcid, # endif
int *pallorfirst, # endif
STACK_OF(GENERAL_NAMES) **plist, #endif
STACK_OF(GENERAL_NAMES) **prto);
# endif
int CMS_RecipientInfo_kari_get0_alg(CMS_RecipientInfo *ri,
X509_ALGOR **palg,
ASN1_OCTET_STRING **pukm);
STACK_OF(CMS_RecipientEncryptedKey)
*CMS_RecipientInfo_kari_get0_reks(CMS_RecipientInfo *ri);
int CMS_RecipientInfo_kari_get0_orig_id(CMS_RecipientInfo *ri,
X509_ALGOR **pubalg,
ASN1_BIT_STRING **pubkey,
ASN1_OCTET_STRING **keyid,
X509_NAME **issuer,
ASN1_INTEGER **sno);
int CMS_RecipientInfo_kari_orig_id_cmp(CMS_RecipientInfo *ri, X509 *cert);
int CMS_RecipientEncryptedKey_get0_id(CMS_RecipientEncryptedKey *rek,
ASN1_OCTET_STRING **keyid,
ASN1_GENERALIZEDTIME **tm,
CMS_OtherKeyAttribute **other,
X509_NAME **issuer, ASN1_INTEGER **sno);
int CMS_RecipientEncryptedKey_cert_cmp(CMS_RecipientEncryptedKey *rek,
X509 *cert);
int CMS_RecipientInfo_kari_set0_pkey(CMS_RecipientInfo *ri, EVP_PKEY *pk);
EVP_CIPHER_CTX *CMS_RecipientInfo_kari_get0_ctx(CMS_RecipientInfo *ri);
int CMS_RecipientInfo_kari_decrypt(CMS_ContentInfo *cms,
CMS_RecipientInfo *ri,
CMS_RecipientEncryptedKey *rek);
int CMS_SharedInfo_encode(unsigned char **pder, X509_ALGOR *kekalg,
ASN1_OCTET_STRING *ukm, int keylen);
/* 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_CMS_strings(void);
/* Error codes for the CMS functions. */
/* Function codes. */
# define CMS_F_CHECK_CONTENT 99
# define CMS_F_CMS_ADD0_CERT 164
# define CMS_F_CMS_ADD0_RECIPIENT_KEY 100
# define CMS_F_CMS_ADD0_RECIPIENT_PASSWORD 165
# define CMS_F_CMS_ADD1_RECEIPTREQUEST 158
# define CMS_F_CMS_ADD1_RECIPIENT_CERT 101
# define CMS_F_CMS_ADD1_SIGNER 102
# define CMS_F_CMS_ADD1_SIGNINGTIME 103
# define CMS_F_CMS_COMPRESS 104
# define CMS_F_CMS_COMPRESSEDDATA_CREATE 105
# define CMS_F_CMS_COMPRESSEDDATA_INIT_BIO 106
# define CMS_F_CMS_COPY_CONTENT 107
# define CMS_F_CMS_COPY_MESSAGEDIGEST 108
# define CMS_F_CMS_DATA 109
# define CMS_F_CMS_DATAFINAL 110
# define CMS_F_CMS_DATAINIT 111
# define CMS_F_CMS_DECRYPT 112
# define CMS_F_CMS_DECRYPT_SET1_KEY 113
# define CMS_F_CMS_DECRYPT_SET1_PASSWORD 166
# define CMS_F_CMS_DECRYPT_SET1_PKEY 114
# define CMS_F_CMS_DIGESTALGORITHM_FIND_CTX 115
# define CMS_F_CMS_DIGESTALGORITHM_INIT_BIO 116
# define CMS_F_CMS_DIGESTEDDATA_DO_FINAL 117
# define CMS_F_CMS_DIGEST_VERIFY 118
# define CMS_F_CMS_ENCODE_RECEIPT 161
# define CMS_F_CMS_ENCRYPT 119
# define CMS_F_CMS_ENCRYPTEDCONTENT_INIT_BIO 120
# define CMS_F_CMS_ENCRYPTEDDATA_DECRYPT 121
# define CMS_F_CMS_ENCRYPTEDDATA_ENCRYPT 122
# define CMS_F_CMS_ENCRYPTEDDATA_SET1_KEY 123
# define CMS_F_CMS_ENVELOPEDDATA_CREATE 124
# define CMS_F_CMS_ENVELOPEDDATA_INIT_BIO 125
# define CMS_F_CMS_ENVELOPED_DATA_INIT 126
# define CMS_F_CMS_ENV_ASN1_CTRL 171
# define CMS_F_CMS_FINAL 127
# define CMS_F_CMS_GET0_CERTIFICATE_CHOICES 128
# define CMS_F_CMS_GET0_CONTENT 129
# define CMS_F_CMS_GET0_ECONTENT_TYPE 130
# define CMS_F_CMS_GET0_ENVELOPED 131
# define CMS_F_CMS_GET0_REVOCATION_CHOICES 132
# define CMS_F_CMS_GET0_SIGNED 133
# define CMS_F_CMS_MSGSIGDIGEST_ADD1 162
# define CMS_F_CMS_RECEIPTREQUEST_CREATE0 159
# define CMS_F_CMS_RECEIPT_VERIFY 160
# define CMS_F_CMS_RECIPIENTINFO_DECRYPT 134
# define CMS_F_CMS_RECIPIENTINFO_ENCRYPT 169
# define CMS_F_CMS_RECIPIENTINFO_KARI_ENCRYPT 178
# define CMS_F_CMS_RECIPIENTINFO_KARI_GET0_ALG 175
# define CMS_F_CMS_RECIPIENTINFO_KARI_GET0_ORIG_ID 173
# define CMS_F_CMS_RECIPIENTINFO_KARI_GET0_REKS 172
# define CMS_F_CMS_RECIPIENTINFO_KARI_ORIG_ID_CMP 174
# define CMS_F_CMS_RECIPIENTINFO_KEKRI_DECRYPT 135
# define CMS_F_CMS_RECIPIENTINFO_KEKRI_ENCRYPT 136
# define CMS_F_CMS_RECIPIENTINFO_KEKRI_GET0_ID 137
# define CMS_F_CMS_RECIPIENTINFO_KEKRI_ID_CMP 138
# define CMS_F_CMS_RECIPIENTINFO_KTRI_CERT_CMP 139
# define CMS_F_CMS_RECIPIENTINFO_KTRI_DECRYPT 140
# define CMS_F_CMS_RECIPIENTINFO_KTRI_ENCRYPT 141
# define CMS_F_CMS_RECIPIENTINFO_KTRI_GET0_ALGS 142
# define CMS_F_CMS_RECIPIENTINFO_KTRI_GET0_SIGNER_ID 143
# define CMS_F_CMS_RECIPIENTINFO_PWRI_CRYPT 167
# define CMS_F_CMS_RECIPIENTINFO_SET0_KEY 144
# define CMS_F_CMS_RECIPIENTINFO_SET0_PASSWORD 168
# define CMS_F_CMS_RECIPIENTINFO_SET0_PKEY 145
# define CMS_F_CMS_SD_ASN1_CTRL 170
# define CMS_F_CMS_SET1_IAS 176
# define CMS_F_CMS_SET1_KEYID 177
# define CMS_F_CMS_SET1_SIGNERIDENTIFIER 146
# define CMS_F_CMS_SET_DETACHED 147
# define CMS_F_CMS_SIGN 148
# define CMS_F_CMS_SIGNED_DATA_INIT 149
# define CMS_F_CMS_SIGNERINFO_CONTENT_SIGN 150
# define CMS_F_CMS_SIGNERINFO_SIGN 151
# define CMS_F_CMS_SIGNERINFO_VERIFY 152
# define CMS_F_CMS_SIGNERINFO_VERIFY_CERT 153
# define CMS_F_CMS_SIGNERINFO_VERIFY_CONTENT 154
# define CMS_F_CMS_SIGN_RECEIPT 163
# define CMS_F_CMS_STREAM 155
# define CMS_F_CMS_UNCOMPRESS 156
# define CMS_F_CMS_VERIFY 157
/* Reason codes. */
# define CMS_R_ADD_SIGNER_ERROR 99
# define CMS_R_CERTIFICATE_ALREADY_PRESENT 175
# define CMS_R_CERTIFICATE_HAS_NO_KEYID 160
# define CMS_R_CERTIFICATE_VERIFY_ERROR 100
# define CMS_R_CIPHER_INITIALISATION_ERROR 101
# define CMS_R_CIPHER_PARAMETER_INITIALISATION_ERROR 102
# define CMS_R_CMS_DATAFINAL_ERROR 103
# define CMS_R_CMS_LIB 104
# define CMS_R_CONTENTIDENTIFIER_MISMATCH 170
# define CMS_R_CONTENT_NOT_FOUND 105
# define CMS_R_CONTENT_TYPE_MISMATCH 171
# define CMS_R_CONTENT_TYPE_NOT_COMPRESSED_DATA 106
# define CMS_R_CONTENT_TYPE_NOT_ENVELOPED_DATA 107
# define CMS_R_CONTENT_TYPE_NOT_SIGNED_DATA 108
# define CMS_R_CONTENT_VERIFY_ERROR 109
# define CMS_R_CTRL_ERROR 110
# define CMS_R_CTRL_FAILURE 111
# define CMS_R_DECRYPT_ERROR 112
# define CMS_R_DIGEST_ERROR 161
# define CMS_R_ERROR_GETTING_PUBLIC_KEY 113
# define CMS_R_ERROR_READING_MESSAGEDIGEST_ATTRIBUTE 114
# define CMS_R_ERROR_SETTING_KEY 115
# define CMS_R_ERROR_SETTING_RECIPIENTINFO 116
# define CMS_R_INVALID_ENCRYPTED_KEY_LENGTH 117
# define CMS_R_INVALID_KEY_ENCRYPTION_PARAMETER 176
# define CMS_R_INVALID_KEY_LENGTH 118
# define CMS_R_MD_BIO_INIT_ERROR 119
# define CMS_R_MESSAGEDIGEST_ATTRIBUTE_WRONG_LENGTH 120
# define CMS_R_MESSAGEDIGEST_WRONG_LENGTH 121
# define CMS_R_MSGSIGDIGEST_ERROR 172
# define CMS_R_MSGSIGDIGEST_VERIFICATION_FAILURE 162
# define CMS_R_MSGSIGDIGEST_WRONG_LENGTH 163
# define CMS_R_NEED_ONE_SIGNER 164
# define CMS_R_NOT_A_SIGNED_RECEIPT 165
# define CMS_R_NOT_ENCRYPTED_DATA 122
# define CMS_R_NOT_KEK 123
# define CMS_R_NOT_KEY_AGREEMENT 181
# define CMS_R_NOT_KEY_TRANSPORT 124
# define CMS_R_NOT_PWRI 177
# define CMS_R_NOT_SUPPORTED_FOR_THIS_KEY_TYPE 125
# define CMS_R_NO_CIPHER 126
# define CMS_R_NO_CONTENT 127
# define CMS_R_NO_CONTENT_TYPE 173
# define CMS_R_NO_DEFAULT_DIGEST 128
# define CMS_R_NO_DIGEST_SET 129
# define CMS_R_NO_KEY 130
# define CMS_R_NO_KEY_OR_CERT 174
# define CMS_R_NO_MATCHING_DIGEST 131
# define CMS_R_NO_MATCHING_RECIPIENT 132
# define CMS_R_NO_MATCHING_SIGNATURE 166
# define CMS_R_NO_MSGSIGDIGEST 167
# define CMS_R_NO_PASSWORD 178
# define CMS_R_NO_PRIVATE_KEY 133
# define CMS_R_NO_PUBLIC_KEY 134
# define CMS_R_NO_RECEIPT_REQUEST 168
# define CMS_R_NO_SIGNERS 135
# define CMS_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE 136
# define CMS_R_RECEIPT_DECODE_ERROR 169
# define CMS_R_RECIPIENT_ERROR 137
# define CMS_R_SIGNER_CERTIFICATE_NOT_FOUND 138
# define CMS_R_SIGNFINAL_ERROR 139
# define CMS_R_SMIME_TEXT_ERROR 140
# define CMS_R_STORE_INIT_ERROR 141
# define CMS_R_TYPE_NOT_COMPRESSED_DATA 142
# define CMS_R_TYPE_NOT_DATA 143
# define CMS_R_TYPE_NOT_DIGESTED_DATA 144
# define CMS_R_TYPE_NOT_ENCRYPTED_DATA 145
# define CMS_R_TYPE_NOT_ENVELOPED_DATA 146
# define CMS_R_UNABLE_TO_FINALIZE_CONTEXT 147
# define CMS_R_UNKNOWN_CIPHER 148
# define CMS_R_UNKNOWN_DIGEST_ALGORIHM 149
# define CMS_R_UNKNOWN_ID 150
# define CMS_R_UNSUPPORTED_COMPRESSION_ALGORITHM 151
# define CMS_R_UNSUPPORTED_CONTENT_TYPE 152
# define CMS_R_UNSUPPORTED_KEK_ALGORITHM 153
# define CMS_R_UNSUPPORTED_KEY_ENCRYPTION_ALGORITHM 179
# define CMS_R_UNSUPPORTED_RECIPIENT_TYPE 154
# define CMS_R_UNSUPPORTED_RECPIENTINFO_TYPE 155
# define CMS_R_UNSUPPORTED_TYPE 156
# define CMS_R_UNWRAP_ERROR 157
# define CMS_R_UNWRAP_FAILURE 180
# define CMS_R_VERIFICATION_FAILURE 158
# define CMS_R_WRAP_ERROR 159
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,196 @@
/*
* Generated by util/mkerr.pl DO NOT EDIT
* Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/license.html
*/
#ifndef HEADER_CMSERR_H
# define HEADER_CMSERR_H
# include <openssl/opensslconf.h>
# ifndef OPENSSL_NO_CMS
# ifdef __cplusplus
extern "C"
# endif
int ERR_load_CMS_strings(void);
/*
* CMS function codes.
*/
# define CMS_F_CHECK_CONTENT 99
# define CMS_F_CMS_ADD0_CERT 164
# define CMS_F_CMS_ADD0_RECIPIENT_KEY 100
# define CMS_F_CMS_ADD0_RECIPIENT_PASSWORD 165
# define CMS_F_CMS_ADD1_RECEIPTREQUEST 158
# define CMS_F_CMS_ADD1_RECIPIENT_CERT 101
# define CMS_F_CMS_ADD1_SIGNER 102
# define CMS_F_CMS_ADD1_SIGNINGTIME 103
# define CMS_F_CMS_COMPRESS 104
# define CMS_F_CMS_COMPRESSEDDATA_CREATE 105
# define CMS_F_CMS_COMPRESSEDDATA_INIT_BIO 106
# define CMS_F_CMS_COPY_CONTENT 107
# define CMS_F_CMS_COPY_MESSAGEDIGEST 108
# define CMS_F_CMS_DATA 109
# define CMS_F_CMS_DATAFINAL 110
# define CMS_F_CMS_DATAINIT 111
# define CMS_F_CMS_DECRYPT 112
# define CMS_F_CMS_DECRYPT_SET1_KEY 113
# define CMS_F_CMS_DECRYPT_SET1_PASSWORD 166
# define CMS_F_CMS_DECRYPT_SET1_PKEY 114
# define CMS_F_CMS_DIGESTALGORITHM_FIND_CTX 115
# define CMS_F_CMS_DIGESTALGORITHM_INIT_BIO 116
# define CMS_F_CMS_DIGESTEDDATA_DO_FINAL 117
# define CMS_F_CMS_DIGEST_VERIFY 118
# define CMS_F_CMS_ENCODE_RECEIPT 161
# define CMS_F_CMS_ENCRYPT 119
# define CMS_F_CMS_ENCRYPTEDCONTENT_INIT 179
# define CMS_F_CMS_ENCRYPTEDCONTENT_INIT_BIO 120
# define CMS_F_CMS_ENCRYPTEDDATA_DECRYPT 121
# define CMS_F_CMS_ENCRYPTEDDATA_ENCRYPT 122
# define CMS_F_CMS_ENCRYPTEDDATA_SET1_KEY 123
# define CMS_F_CMS_ENVELOPEDDATA_CREATE 124
# define CMS_F_CMS_ENVELOPEDDATA_INIT_BIO 125
# define CMS_F_CMS_ENVELOPED_DATA_INIT 126
# define CMS_F_CMS_ENV_ASN1_CTRL 171
# define CMS_F_CMS_FINAL 127
# define CMS_F_CMS_GET0_CERTIFICATE_CHOICES 128
# define CMS_F_CMS_GET0_CONTENT 129
# define CMS_F_CMS_GET0_ECONTENT_TYPE 130
# define CMS_F_CMS_GET0_ENVELOPED 131
# define CMS_F_CMS_GET0_REVOCATION_CHOICES 132
# define CMS_F_CMS_GET0_SIGNED 133
# define CMS_F_CMS_MSGSIGDIGEST_ADD1 162
# define CMS_F_CMS_RECEIPTREQUEST_CREATE0 159
# define CMS_F_CMS_RECEIPT_VERIFY 160
# define CMS_F_CMS_RECIPIENTINFO_DECRYPT 134
# define CMS_F_CMS_RECIPIENTINFO_ENCRYPT 169
# define CMS_F_CMS_RECIPIENTINFO_KARI_ENCRYPT 178
# define CMS_F_CMS_RECIPIENTINFO_KARI_GET0_ALG 175
# define CMS_F_CMS_RECIPIENTINFO_KARI_GET0_ORIG_ID 173
# define CMS_F_CMS_RECIPIENTINFO_KARI_GET0_REKS 172
# define CMS_F_CMS_RECIPIENTINFO_KARI_ORIG_ID_CMP 174
# define CMS_F_CMS_RECIPIENTINFO_KEKRI_DECRYPT 135
# define CMS_F_CMS_RECIPIENTINFO_KEKRI_ENCRYPT 136
# define CMS_F_CMS_RECIPIENTINFO_KEKRI_GET0_ID 137
# define CMS_F_CMS_RECIPIENTINFO_KEKRI_ID_CMP 138
# define CMS_F_CMS_RECIPIENTINFO_KTRI_CERT_CMP 139
# define CMS_F_CMS_RECIPIENTINFO_KTRI_DECRYPT 140
# define CMS_F_CMS_RECIPIENTINFO_KTRI_ENCRYPT 141
# define CMS_F_CMS_RECIPIENTINFO_KTRI_GET0_ALGS 142
# define CMS_F_CMS_RECIPIENTINFO_KTRI_GET0_SIGNER_ID 143
# define CMS_F_CMS_RECIPIENTINFO_PWRI_CRYPT 167
# define CMS_F_CMS_RECIPIENTINFO_SET0_KEY 144
# define CMS_F_CMS_RECIPIENTINFO_SET0_PASSWORD 168
# define CMS_F_CMS_RECIPIENTINFO_SET0_PKEY 145
# define CMS_F_CMS_SD_ASN1_CTRL 170
# define CMS_F_CMS_SET1_IAS 176
# define CMS_F_CMS_SET1_KEYID 177
# define CMS_F_CMS_SET1_SIGNERIDENTIFIER 146
# define CMS_F_CMS_SET_DETACHED 147
# define CMS_F_CMS_SIGN 148
# define CMS_F_CMS_SIGNED_DATA_INIT 149
# define CMS_F_CMS_SIGNERINFO_CONTENT_SIGN 150
# define CMS_F_CMS_SIGNERINFO_SIGN 151
# define CMS_F_CMS_SIGNERINFO_VERIFY 152
# define CMS_F_CMS_SIGNERINFO_VERIFY_CERT 153
# define CMS_F_CMS_SIGNERINFO_VERIFY_CONTENT 154
# define CMS_F_CMS_SIGN_RECEIPT 163
# define CMS_F_CMS_STREAM 155
# define CMS_F_CMS_UNCOMPRESS 156
# define CMS_F_CMS_VERIFY 157
# define CMS_F_KEK_UNWRAP_KEY 180
/*
* CMS reason codes.
*/
# define CMS_R_ADD_SIGNER_ERROR 99
# define CMS_R_CERTIFICATE_ALREADY_PRESENT 175
# define CMS_R_CERTIFICATE_HAS_NO_KEYID 160
# define CMS_R_CERTIFICATE_VERIFY_ERROR 100
# define CMS_R_CIPHER_INITIALISATION_ERROR 101
# define CMS_R_CIPHER_PARAMETER_INITIALISATION_ERROR 102
# define CMS_R_CMS_DATAFINAL_ERROR 103
# define CMS_R_CMS_LIB 104
# define CMS_R_CONTENTIDENTIFIER_MISMATCH 170
# define CMS_R_CONTENT_NOT_FOUND 105
# define CMS_R_CONTENT_TYPE_MISMATCH 171
# define CMS_R_CONTENT_TYPE_NOT_COMPRESSED_DATA 106
# define CMS_R_CONTENT_TYPE_NOT_ENVELOPED_DATA 107
# define CMS_R_CONTENT_TYPE_NOT_SIGNED_DATA 108
# define CMS_R_CONTENT_VERIFY_ERROR 109
# define CMS_R_CTRL_ERROR 110
# define CMS_R_CTRL_FAILURE 111
# define CMS_R_DECRYPT_ERROR 112
# define CMS_R_ERROR_GETTING_PUBLIC_KEY 113
# define CMS_R_ERROR_READING_MESSAGEDIGEST_ATTRIBUTE 114
# define CMS_R_ERROR_SETTING_KEY 115
# define CMS_R_ERROR_SETTING_RECIPIENTINFO 116
# define CMS_R_INVALID_ENCRYPTED_KEY_LENGTH 117
# define CMS_R_INVALID_KEY_ENCRYPTION_PARAMETER 176
# define CMS_R_INVALID_KEY_LENGTH 118
# define CMS_R_MD_BIO_INIT_ERROR 119
# define CMS_R_MESSAGEDIGEST_ATTRIBUTE_WRONG_LENGTH 120
# define CMS_R_MESSAGEDIGEST_WRONG_LENGTH 121
# define CMS_R_MSGSIGDIGEST_ERROR 172
# define CMS_R_MSGSIGDIGEST_VERIFICATION_FAILURE 162
# define CMS_R_MSGSIGDIGEST_WRONG_LENGTH 163
# define CMS_R_NEED_ONE_SIGNER 164
# define CMS_R_NOT_A_SIGNED_RECEIPT 165
# define CMS_R_NOT_ENCRYPTED_DATA 122
# define CMS_R_NOT_KEK 123
# define CMS_R_NOT_KEY_AGREEMENT 181
# define CMS_R_NOT_KEY_TRANSPORT 124
# define CMS_R_NOT_PWRI 177
# define CMS_R_NOT_SUPPORTED_FOR_THIS_KEY_TYPE 125
# define CMS_R_NO_CIPHER 126
# define CMS_R_NO_CONTENT 127
# define CMS_R_NO_CONTENT_TYPE 173
# define CMS_R_NO_DEFAULT_DIGEST 128
# define CMS_R_NO_DIGEST_SET 129
# define CMS_R_NO_KEY 130
# define CMS_R_NO_KEY_OR_CERT 174
# define CMS_R_NO_MATCHING_DIGEST 131
# define CMS_R_NO_MATCHING_RECIPIENT 132
# define CMS_R_NO_MATCHING_SIGNATURE 166
# define CMS_R_NO_MSGSIGDIGEST 167
# define CMS_R_NO_PASSWORD 178
# define CMS_R_NO_PRIVATE_KEY 133
# define CMS_R_NO_PUBLIC_KEY 134
# define CMS_R_NO_RECEIPT_REQUEST 168
# define CMS_R_NO_SIGNERS 135
# define CMS_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE 136
# define CMS_R_RECEIPT_DECODE_ERROR 169
# define CMS_R_RECIPIENT_ERROR 137
# define CMS_R_SIGNER_CERTIFICATE_NOT_FOUND 138
# define CMS_R_SIGNFINAL_ERROR 139
# define CMS_R_SMIME_TEXT_ERROR 140
# define CMS_R_STORE_INIT_ERROR 141
# define CMS_R_TYPE_NOT_COMPRESSED_DATA 142
# define CMS_R_TYPE_NOT_DATA 143
# define CMS_R_TYPE_NOT_DIGESTED_DATA 144
# define CMS_R_TYPE_NOT_ENCRYPTED_DATA 145
# define CMS_R_TYPE_NOT_ENVELOPED_DATA 146
# define CMS_R_UNABLE_TO_FINALIZE_CONTEXT 147
# define CMS_R_UNKNOWN_CIPHER 148
# define CMS_R_UNKNOWN_DIGEST_ALGORITHM 149
# define CMS_R_UNKNOWN_ID 150
# define CMS_R_UNSUPPORTED_COMPRESSION_ALGORITHM 151
# define CMS_R_UNSUPPORTED_CONTENT_TYPE 152
# define CMS_R_UNSUPPORTED_KEK_ALGORITHM 153
# define CMS_R_UNSUPPORTED_KEY_ENCRYPTION_ALGORITHM 179
# define CMS_R_UNSUPPORTED_RECIPIENTINFO_TYPE 155
# define CMS_R_UNSUPPORTED_RECIPIENT_TYPE 154
# define CMS_R_UNSUPPORTED_TYPE 156
# define CMS_R_UNWRAP_ERROR 157
# define CMS_R_UNWRAP_FAILURE 180
# define CMS_R_VERIFICATION_FAILURE 158
# define CMS_R_WRAP_ERROR 159
# endif
#endif

View File

@ -1,83 +1,53 @@
/*
#ifndef HEADER_COMP_H * Copyright 2015-2018 The OpenSSL Project Authors. All Rights Reserved.
# define HEADER_COMP_H *
* Licensed under the OpenSSL license (the "License"). You may not use
# include <openssl/crypto.h> * this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at
# ifdef OPENSSL_NO_COMP * https://www.openssl.org/source/license.html
# error COMP is disabled. */
# endif
#ifndef HEADER_COMP_H
#ifdef __cplusplus # define HEADER_COMP_H
extern "C" {
#endif # include <openssl/opensslconf.h>
typedef struct comp_ctx_st COMP_CTX; # ifndef OPENSSL_NO_COMP
# include <openssl/crypto.h>
struct comp_method_st { # include <openssl/comperr.h>
int type; /* NID for compression library */ # ifdef __cplusplus
const char *name; /* A text string to identify the library */ extern "C" {
int (*init) (COMP_CTX *ctx); # endif
void (*finish) (COMP_CTX *ctx);
int (*compress) (COMP_CTX *ctx,
unsigned char *out, unsigned int olen,
unsigned char *in, unsigned int ilen); COMP_CTX *COMP_CTX_new(COMP_METHOD *meth);
int (*expand) (COMP_CTX *ctx, const COMP_METHOD *COMP_CTX_get_method(const COMP_CTX *ctx);
unsigned char *out, unsigned int olen, int COMP_CTX_get_type(const COMP_CTX* comp);
unsigned char *in, unsigned int ilen); int COMP_get_type(const COMP_METHOD *meth);
/* const char *COMP_get_name(const COMP_METHOD *meth);
* The following two do NOTHING, but are kept for backward compatibility void COMP_CTX_free(COMP_CTX *ctx);
*/
long (*ctrl) (void); int COMP_compress_block(COMP_CTX *ctx, unsigned char *out, int olen,
long (*callback_ctrl) (void); unsigned char *in, int ilen);
}; int COMP_expand_block(COMP_CTX *ctx, unsigned char *out, int olen,
unsigned char *in, int ilen);
struct comp_ctx_st {
COMP_METHOD *meth; COMP_METHOD *COMP_zlib(void);
unsigned long compress_in;
unsigned long compress_out; #if OPENSSL_API_COMPAT < 0x10100000L
unsigned long expand_in; #define COMP_zlib_cleanup() while(0) continue
unsigned long expand_out; #endif
CRYPTO_EX_DATA ex_data;
}; # ifdef HEADER_BIO_H
# ifdef ZLIB
COMP_CTX *COMP_CTX_new(COMP_METHOD *meth); const BIO_METHOD *BIO_f_zlib(void);
void COMP_CTX_free(COMP_CTX *ctx); # endif
int COMP_compress_block(COMP_CTX *ctx, unsigned char *out, int olen, # endif
unsigned char *in, int ilen);
int COMP_expand_block(COMP_CTX *ctx, unsigned char *out, int olen,
unsigned char *in, int ilen); # ifdef __cplusplus
COMP_METHOD *COMP_rle(void); }
COMP_METHOD *COMP_zlib(void); # endif
void COMP_zlib_cleanup(void); # endif
#endif
# 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

View File

@ -0,0 +1,40 @@
/*
* Generated by util/mkerr.pl DO NOT EDIT
* Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/license.html
*/
#ifndef HEADER_COMPERR_H
# define HEADER_COMPERR_H
# include <openssl/opensslconf.h>
# ifndef OPENSSL_NO_COMP
# ifdef __cplusplus
extern "C"
# endif
int ERR_load_COMP_strings(void);
/*
* COMP 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
# define COMP_F_COMP_CTX_NEW 103
/*
* COMP reason codes.
*/
# define COMP_R_ZLIB_DEFLATE_ERROR 99
# define COMP_R_ZLIB_INFLATE_ERROR 100
# define COMP_R_ZLIB_NOT_SUPPORTED 101
# endif
#endif

View File

@ -1,267 +1,168 @@
/* crypto/conf/conf.h */ /*
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
* All rights reserved. *
* * Licensed under the OpenSSL license (the "License"). You may not use
* This package is an SSL implementation written * this file except in compliance with the License. You can obtain a copy
* by Eric Young (eay@cryptsoft.com). * in the file LICENSE in the source distribution or at
* The implementation was written so as to conform with Netscapes SSL. * https://www.openssl.org/source/license.html
* */
* This library is free for commercial and non-commercial use as long as
* the following conditions are aheared to. The following conditions #ifndef HEADER_CONF_H
* apply to all code found in this distribution, be it the RC4, RSA, # define HEADER_CONF_H
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
* included with this distribution is covered by the same copyright terms # include <openssl/bio.h>
* except that the holder is Tim Hudson (tjh@cryptsoft.com). # include <openssl/lhash.h>
* # include <openssl/safestack.h>
* Copyright remains Eric Young's, and as such any Copyright notices in # include <openssl/e_os2.h>
* the code are not to be removed. # include <openssl/ossl_typ.h>
* If this package is used in a product, Eric Young should be given attribution # include <openssl/conferr.h>
* as the author of the parts of the library used.
* This can be in the form of a textual message at program startup or #ifdef __cplusplus
* in documentation (online or textual) provided with the package. extern "C" {
* #endif
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions typedef struct {
* are met: char *section;
* 1. Redistributions of source code must retain the copyright char *name;
* notice, this list of conditions and the following disclaimer. char *value;
* 2. Redistributions in binary form must reproduce the above copyright } CONF_VALUE;
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution. DEFINE_STACK_OF(CONF_VALUE)
* 3. All advertising materials mentioning features or use of this software DEFINE_LHASH_OF(CONF_VALUE);
* must display the following acknowledgement:
* "This product includes cryptographic software written by struct conf_st;
* Eric Young (eay@cryptsoft.com)" struct conf_method_st;
* The word 'cryptographic' can be left out if the rouines from the library typedef struct conf_method_st CONF_METHOD;
* being used are not cryptographic related :-).
* 4. If you include any Windows specific code (or a derivative thereof) from struct conf_method_st {
* the apps directory (application code) you must include an acknowledgement: const char *name;
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" CONF *(*create) (CONF_METHOD *meth);
* int (*init) (CONF *conf);
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND int (*destroy) (CONF *conf);
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE int (*destroy_data) (CONF *conf);
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE int (*load_bio) (CONF *conf, BIO *bp, long *eline);
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE int (*dump) (const CONF *conf, BIO *bp);
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL int (*is_number) (const CONF *conf, char c);
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS int (*to_int) (const CONF *conf, char c);
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) int (*load) (CONF *conf, const char *name, long *eline);
* 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 /* Module definitions */
* SUCH DAMAGE.
* typedef struct conf_imodule_st CONF_IMODULE;
* The licence and distribution terms for any publically available version or typedef struct conf_module_st CONF_MODULE;
* derivative of this code cannot be changed. i.e. this code cannot simply be
* copied and put under another distribution licence DEFINE_STACK_OF(CONF_MODULE)
* [including the GNU Public Licence.] DEFINE_STACK_OF(CONF_IMODULE)
*/
/* DSO module function typedefs */
#ifndef HEADER_CONF_H typedef int conf_init_func (CONF_IMODULE *md, const CONF *cnf);
# define HEADER_CONF_H typedef void conf_finish_func (CONF_IMODULE *md);
# include <openssl/bio.h> # define CONF_MFLAGS_IGNORE_ERRORS 0x1
# include <openssl/lhash.h> # define CONF_MFLAGS_IGNORE_RETURN_CODES 0x2
# include <openssl/stack.h> # define CONF_MFLAGS_SILENT 0x4
# include <openssl/safestack.h> # define CONF_MFLAGS_NO_DSO 0x8
# include <openssl/e_os2.h> # define CONF_MFLAGS_IGNORE_MISSING_FILE 0x10
# define CONF_MFLAGS_DEFAULT_SECTION 0x20
# include <openssl/ossl_typ.h>
int CONF_set_default_method(CONF_METHOD *meth);
#ifdef __cplusplus void CONF_set_nconf(CONF *conf, LHASH_OF(CONF_VALUE) *hash);
extern "C" { LHASH_OF(CONF_VALUE) *CONF_load(LHASH_OF(CONF_VALUE) *conf, const char *file,
#endif long *eline);
# ifndef OPENSSL_NO_STDIO
typedef struct { LHASH_OF(CONF_VALUE) *CONF_load_fp(LHASH_OF(CONF_VALUE) *conf, FILE *fp,
char *section; long *eline);
char *name; # endif
char *value; LHASH_OF(CONF_VALUE) *CONF_load_bio(LHASH_OF(CONF_VALUE) *conf, BIO *bp,
} CONF_VALUE; long *eline);
STACK_OF(CONF_VALUE) *CONF_get_section(LHASH_OF(CONF_VALUE) *conf,
DECLARE_STACK_OF(CONF_VALUE) const char *section);
DECLARE_LHASH_OF(CONF_VALUE); char *CONF_get_string(LHASH_OF(CONF_VALUE) *conf, const char *group,
const char *name);
struct conf_st; long CONF_get_number(LHASH_OF(CONF_VALUE) *conf, const char *group,
struct conf_method_st; const char *name);
typedef struct conf_method_st CONF_METHOD; void CONF_free(LHASH_OF(CONF_VALUE) *conf);
#ifndef OPENSSL_NO_STDIO
struct conf_method_st { int CONF_dump_fp(LHASH_OF(CONF_VALUE) *conf, FILE *out);
const char *name; #endif
CONF *(*create) (CONF_METHOD *meth); int CONF_dump_bio(LHASH_OF(CONF_VALUE) *conf, BIO *out);
int (*init) (CONF *conf);
int (*destroy) (CONF *conf); DEPRECATEDIN_1_1_0(void OPENSSL_config(const char *config_name))
int (*destroy_data) (CONF *conf);
int (*load_bio) (CONF *conf, BIO *bp, long *eline); #if OPENSSL_API_COMPAT < 0x10100000L
int (*dump) (const CONF *conf, BIO *bp); # define OPENSSL_no_config() \
int (*is_number) (const CONF *conf, char c); OPENSSL_init_crypto(OPENSSL_INIT_NO_LOAD_CONFIG, NULL)
int (*to_int) (const CONF *conf, char c); #endif
int (*load) (CONF *conf, const char *name, long *eline);
}; /*
* New conf code. The semantics are different from the functions above. If
/* Module definitions */ * that wasn't the case, the above functions would have been replaced
*/
typedef struct conf_imodule_st CONF_IMODULE;
typedef struct conf_module_st CONF_MODULE; struct conf_st {
CONF_METHOD *meth;
DECLARE_STACK_OF(CONF_MODULE) void *meth_data;
DECLARE_STACK_OF(CONF_IMODULE) LHASH_OF(CONF_VALUE) *data;
};
/* DSO module function typedefs */
typedef int conf_init_func (CONF_IMODULE *md, const CONF *cnf); CONF *NCONF_new(CONF_METHOD *meth);
typedef void conf_finish_func (CONF_IMODULE *md); CONF_METHOD *NCONF_default(void);
CONF_METHOD *NCONF_WIN32(void);
# define CONF_MFLAGS_IGNORE_ERRORS 0x1 void NCONF_free(CONF *conf);
# define CONF_MFLAGS_IGNORE_RETURN_CODES 0x2 void NCONF_free_data(CONF *conf);
# define CONF_MFLAGS_SILENT 0x4
# define CONF_MFLAGS_NO_DSO 0x8 int NCONF_load(CONF *conf, const char *file, long *eline);
# define CONF_MFLAGS_IGNORE_MISSING_FILE 0x10 # ifndef OPENSSL_NO_STDIO
# define CONF_MFLAGS_DEFAULT_SECTION 0x20 int NCONF_load_fp(CONF *conf, FILE *fp, long *eline);
# endif
int CONF_set_default_method(CONF_METHOD *meth); int NCONF_load_bio(CONF *conf, BIO *bp, long *eline);
void CONF_set_nconf(CONF *conf, LHASH_OF(CONF_VALUE) *hash); STACK_OF(CONF_VALUE) *NCONF_get_section(const CONF *conf,
LHASH_OF(CONF_VALUE) *CONF_load(LHASH_OF(CONF_VALUE) *conf, const char *file, const char *section);
long *eline); char *NCONF_get_string(const CONF *conf, const char *group, const char *name);
# ifndef OPENSSL_NO_FP_API int NCONF_get_number_e(const CONF *conf, const char *group, const char *name,
LHASH_OF(CONF_VALUE) *CONF_load_fp(LHASH_OF(CONF_VALUE) *conf, FILE *fp, long *result);
long *eline); #ifndef OPENSSL_NO_STDIO
# endif int NCONF_dump_fp(const CONF *conf, FILE *out);
LHASH_OF(CONF_VALUE) *CONF_load_bio(LHASH_OF(CONF_VALUE) *conf, BIO *bp, #endif
long *eline); int NCONF_dump_bio(const CONF *conf, BIO *out);
STACK_OF(CONF_VALUE) *CONF_get_section(LHASH_OF(CONF_VALUE) *conf,
const char *section); #define NCONF_get_number(c,g,n,r) NCONF_get_number_e(c,g,n,r)
char *CONF_get_string(LHASH_OF(CONF_VALUE) *conf, const char *group,
const char *name); /* Module functions */
long CONF_get_number(LHASH_OF(CONF_VALUE) *conf, const char *group,
const char *name); int CONF_modules_load(const CONF *cnf, const char *appname,
void CONF_free(LHASH_OF(CONF_VALUE) *conf); unsigned long flags);
int CONF_dump_fp(LHASH_OF(CONF_VALUE) *conf, FILE *out); int CONF_modules_load_file(const char *filename, const char *appname,
int CONF_dump_bio(LHASH_OF(CONF_VALUE) *conf, BIO *out); unsigned long flags);
void CONF_modules_unload(int all);
void OPENSSL_config(const char *config_name); void CONF_modules_finish(void);
void OPENSSL_no_config(void); #if OPENSSL_API_COMPAT < 0x10100000L
# define CONF_modules_free() while(0) continue
/* #endif
* New conf code. The semantics are different from the functions above. If int CONF_module_add(const char *name, conf_init_func *ifunc,
* that wasn't the case, the above functions would have been replaced conf_finish_func *ffunc);
*/
const char *CONF_imodule_get_name(const CONF_IMODULE *md);
struct conf_st { const char *CONF_imodule_get_value(const CONF_IMODULE *md);
CONF_METHOD *meth; void *CONF_imodule_get_usr_data(const CONF_IMODULE *md);
void *meth_data; void CONF_imodule_set_usr_data(CONF_IMODULE *md, void *usr_data);
LHASH_OF(CONF_VALUE) *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);
CONF *NCONF_new(CONF_METHOD *meth); void *CONF_module_get_usr_data(CONF_MODULE *pmod);
CONF_METHOD *NCONF_default(void); void CONF_module_set_usr_data(CONF_MODULE *pmod, void *usr_data);
CONF_METHOD *NCONF_WIN32(void);
# if 0 /* Just to give you an idea of what I have in char *CONF_get1_default_config_file(void);
* mind */
CONF_METHOD *NCONF_XML(void); int CONF_parse_list(const char *list, int sep, int nospc,
# endif int (*list_cb) (const char *elem, int len, void *usr),
void NCONF_free(CONF *conf); void *arg);
void NCONF_free_data(CONF *conf);
void OPENSSL_load_builtin_modules(void);
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); # ifdef __cplusplus
# endif }
int NCONF_load_bio(CONF *conf, BIO *bp, long *eline); # endif
STACK_OF(CONF_VALUE) *NCONF_get_section(const CONF *conf, #endif
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_HAS_NO_VALUE 104
#ifdef __cplusplus
}
#endif
#endif

View File

@ -1,89 +1,40 @@
/* conf_api.h */ /*
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
* All rights reserved. *
* * Licensed under the OpenSSL license (the "License"). You may not use
* This package is an SSL implementation written * this file except in compliance with the License. You can obtain a copy
* by Eric Young (eay@cryptsoft.com). * in the file LICENSE in the source distribution or at
* The implementation was written so as to conform with Netscapes SSL. * https://www.openssl.org/source/license.html
* */
* This library is free for commercial and non-commercial use as long as
* the following conditions are aheared to. The following conditions #ifndef HEADER_CONF_API_H
* apply to all code found in this distribution, be it the RC4, RSA, # define HEADER_CONF_API_H
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
* included with this distribution is covered by the same copyright terms # include <openssl/lhash.h>
* except that the holder is Tim Hudson (tjh@cryptsoft.com). # include <openssl/conf.h>
*
* Copyright remains Eric Young's, and as such any Copyright notices in #ifdef __cplusplus
* the code are not to be removed. extern "C" {
* If this package is used in a product, Eric Young should be given attribution #endif
* as the author of the parts of the library used.
* This can be in the form of a textual message at program startup or /* Up until OpenSSL 0.9.5a, this was new_section */
* in documentation (online or textual) provided with the package. CONF_VALUE *_CONF_new_section(CONF *conf, const char *section);
* /* Up until OpenSSL 0.9.5a, this was get_section */
* Redistribution and use in source and binary forms, with or without CONF_VALUE *_CONF_get_section(const CONF *conf, const char *section);
* modification, are permitted provided that the following conditions /* Up until OpenSSL 0.9.5a, this was CONF_get_section */
* are met: STACK_OF(CONF_VALUE) *_CONF_get_section_values(const CONF *conf,
* 1. Redistributions of source code must retain the copyright const char *section);
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright int _CONF_add_string(CONF *conf, CONF_VALUE *section, CONF_VALUE *value);
* notice, this list of conditions and the following disclaimer in the char *_CONF_get_string(const CONF *conf, const char *section,
* documentation and/or other materials provided with the distribution. const char *name);
* 3. All advertising materials mentioning features or use of this software long _CONF_get_number(const CONF *conf, const char *section,
* must display the following acknowledgement: const char *name);
* "This product includes cryptographic software written by
* Eric Young (eay@cryptsoft.com)" int _CONF_new_data(CONF *conf);
* The word 'cryptographic' can be left out if the rouines from the library void _CONF_free_data(CONF *conf);
* being used are not cryptographic related :-).
* 4. If you include any Windows specific code (or a derivative thereof) from #ifdef __cplusplus
* the apps directory (application code) you must include an acknowledgement: }
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" #endif
* #endif
* 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

View File

@ -0,0 +1,72 @@
/*
* Generated by util/mkerr.pl DO NOT EDIT
* Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/license.html
*/
#ifndef HEADER_CONFERR_H
# define HEADER_CONFERR_H
# ifdef __cplusplus
extern "C"
# endif
int ERR_load_CONF_strings(void);
/*
* CONF function codes.
*/
# define CONF_F_CONF_DUMP_FP 104
# define CONF_F_CONF_LOAD 100
# define CONF_F_CONF_LOAD_FP 103
# define CONF_F_CONF_PARSE_LIST 119
# define CONF_F_DEF_LOAD 120
# define CONF_F_DEF_LOAD_BIO 121
# define CONF_F_GET_NEXT_FILE 107
# define CONF_F_MODULE_ADD 122
# 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_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_PROCESS_INCLUDE 116
# define CONF_F_SSL_MODULE_INIT 123
# define CONF_F_STR_COPY 101
/*
* CONF 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_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_NUMBER_TOO_LARGE 121
# define CONF_R_RECURSIVE_DIRECTORY_INCLUDE 111
# define CONF_R_SSL_COMMAND_SECTION_EMPTY 117
# define CONF_R_SSL_COMMAND_SECTION_NOT_FOUND 118
# define CONF_R_SSL_SECTION_EMPTY 119
# define CONF_R_SSL_SECTION_NOT_FOUND 120
# 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
#endif

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,53 @@
/*
* Generated by util/mkerr.pl DO NOT EDIT
* Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/license.html
*/
#ifndef HEADER_CRYPTOERR_H
# define HEADER_CRYPTOERR_H
# ifdef __cplusplus
extern "C"
# endif
int ERR_load_CRYPTO_strings(void);
/*
* CRYPTO function codes.
*/
# define CRYPTO_F_CMAC_CTX_NEW 120
# define CRYPTO_F_CRYPTO_DUP_EX_DATA 110
# define CRYPTO_F_CRYPTO_FREE_EX_DATA 111
# define CRYPTO_F_CRYPTO_GET_EX_NEW_INDEX 100
# define CRYPTO_F_CRYPTO_MEMDUP 115
# define CRYPTO_F_CRYPTO_NEW_EX_DATA 112
# define CRYPTO_F_CRYPTO_OCB128_COPY_CTX 121
# define CRYPTO_F_CRYPTO_OCB128_INIT 122
# define CRYPTO_F_CRYPTO_SET_EX_DATA 102
# define CRYPTO_F_FIPS_MODE_SET 109
# define CRYPTO_F_GET_AND_LOCK 113
# define CRYPTO_F_OPENSSL_ATEXIT 114
# define CRYPTO_F_OPENSSL_BUF2HEXSTR 117
# define CRYPTO_F_OPENSSL_FOPEN 119
# define CRYPTO_F_OPENSSL_HEXSTR2BUF 118
# define CRYPTO_F_OPENSSL_INIT_CRYPTO 116
# define CRYPTO_F_OPENSSL_LH_NEW 126
# define CRYPTO_F_OPENSSL_SK_DEEP_COPY 127
# define CRYPTO_F_OPENSSL_SK_DUP 128
# define CRYPTO_F_PKEY_HMAC_INIT 123
# define CRYPTO_F_PKEY_POLY1305_INIT 124
# define CRYPTO_F_PKEY_SIPHASH_INIT 125
# define CRYPTO_F_SK_RESERVE 129
/*
* CRYPTO reason codes.
*/
# define CRYPTO_R_FIPS_MODE_NOT_SUPPORTED 101
# define CRYPTO_R_ILLEGAL_HEX_DIGIT 102
# define CRYPTO_R_ODD_NUMBER_OF_DIGITS 103
#endif

View File

@ -0,0 +1,476 @@
/*
* Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/license.html
*/
#ifndef HEADER_CT_H
# define HEADER_CT_H
# include <openssl/opensslconf.h>
# ifndef OPENSSL_NO_CT
# include <openssl/ossl_typ.h>
# include <openssl/safestack.h>
# include <openssl/x509.h>
# include <openssl/cterr.h>
# ifdef __cplusplus
extern "C" {
# endif
/* Minimum RSA key size, from RFC6962 */
# define SCT_MIN_RSA_BITS 2048
/* All hashes are SHA256 in v1 of Certificate Transparency */
# define CT_V1_HASHLEN SHA256_DIGEST_LENGTH
typedef enum {
CT_LOG_ENTRY_TYPE_NOT_SET = -1,
CT_LOG_ENTRY_TYPE_X509 = 0,
CT_LOG_ENTRY_TYPE_PRECERT = 1
} ct_log_entry_type_t;
typedef enum {
SCT_VERSION_NOT_SET = -1,
SCT_VERSION_V1 = 0
} sct_version_t;
typedef enum {
SCT_SOURCE_UNKNOWN,
SCT_SOURCE_TLS_EXTENSION,
SCT_SOURCE_X509V3_EXTENSION,
SCT_SOURCE_OCSP_STAPLED_RESPONSE
} sct_source_t;
typedef enum {
SCT_VALIDATION_STATUS_NOT_SET,
SCT_VALIDATION_STATUS_UNKNOWN_LOG,
SCT_VALIDATION_STATUS_VALID,
SCT_VALIDATION_STATUS_INVALID,
SCT_VALIDATION_STATUS_UNVERIFIED,
SCT_VALIDATION_STATUS_UNKNOWN_VERSION
} sct_validation_status_t;
DEFINE_STACK_OF(SCT)
DEFINE_STACK_OF(CTLOG)
/******************************************
* CT policy evaluation context functions *
******************************************/
/*
* Creates a new, empty policy evaluation context.
* The caller is responsible for calling CT_POLICY_EVAL_CTX_free when finished
* with the CT_POLICY_EVAL_CTX.
*/
CT_POLICY_EVAL_CTX *CT_POLICY_EVAL_CTX_new(void);
/* Deletes a policy evaluation context and anything it owns. */
void CT_POLICY_EVAL_CTX_free(CT_POLICY_EVAL_CTX *ctx);
/* Gets the peer certificate that the SCTs are for */
X509* CT_POLICY_EVAL_CTX_get0_cert(const CT_POLICY_EVAL_CTX *ctx);
/*
* Sets the certificate associated with the received SCTs.
* Increments the reference count of cert.
* Returns 1 on success, 0 otherwise.
*/
int CT_POLICY_EVAL_CTX_set1_cert(CT_POLICY_EVAL_CTX *ctx, X509 *cert);
/* Gets the issuer of the aforementioned certificate */
X509* CT_POLICY_EVAL_CTX_get0_issuer(const CT_POLICY_EVAL_CTX *ctx);
/*
* Sets the issuer of the certificate associated with the received SCTs.
* Increments the reference count of issuer.
* Returns 1 on success, 0 otherwise.
*/
int CT_POLICY_EVAL_CTX_set1_issuer(CT_POLICY_EVAL_CTX *ctx, X509 *issuer);
/* Gets the CT logs that are trusted sources of SCTs */
const CTLOG_STORE *CT_POLICY_EVAL_CTX_get0_log_store(const CT_POLICY_EVAL_CTX *ctx);
/* Sets the log store that is in use. It must outlive the CT_POLICY_EVAL_CTX. */
void CT_POLICY_EVAL_CTX_set_shared_CTLOG_STORE(CT_POLICY_EVAL_CTX *ctx,
CTLOG_STORE *log_store);
/*
* Gets the time, in milliseconds since the Unix epoch, that will be used as the
* current time when checking whether an SCT was issued in the future.
* Such SCTs will fail validation, as required by RFC6962.
*/
uint64_t CT_POLICY_EVAL_CTX_get_time(const CT_POLICY_EVAL_CTX *ctx);
/*
* Sets the time to evaluate SCTs against, in milliseconds since the Unix epoch.
* If an SCT's timestamp is after this time, it will be interpreted as having
* been issued in the future. RFC6962 states that "TLS clients MUST reject SCTs
* whose timestamp is in the future", so an SCT will not validate in this case.
*/
void CT_POLICY_EVAL_CTX_set_time(CT_POLICY_EVAL_CTX *ctx, uint64_t time_in_ms);
/*****************
* SCT functions *
*****************/
/*
* Creates a new, blank SCT.
* The caller is responsible for calling SCT_free when finished with the SCT.
*/
SCT *SCT_new(void);
/*
* Creates a new SCT from some base64-encoded strings.
* The caller is responsible for calling SCT_free when finished with the SCT.
*/
SCT *SCT_new_from_base64(unsigned char version,
const char *logid_base64,
ct_log_entry_type_t entry_type,
uint64_t timestamp,
const char *extensions_base64,
const char *signature_base64);
/*
* Frees the SCT and the underlying data structures.
*/
void SCT_free(SCT *sct);
/*
* Free a stack of SCTs, and the underlying SCTs themselves.
* Intended to be compatible with X509V3_EXT_FREE.
*/
void SCT_LIST_free(STACK_OF(SCT) *a);
/*
* Returns the version of the SCT.
*/
sct_version_t SCT_get_version(const SCT *sct);
/*
* Set the version of an SCT.
* Returns 1 on success, 0 if the version is unrecognized.
*/
__owur int SCT_set_version(SCT *sct, sct_version_t version);
/*
* Returns the log entry type of the SCT.
*/
ct_log_entry_type_t SCT_get_log_entry_type(const SCT *sct);
/*
* Set the log entry type of an SCT.
* Returns 1 on success, 0 otherwise.
*/
__owur int SCT_set_log_entry_type(SCT *sct, ct_log_entry_type_t entry_type);
/*
* Gets the ID of the log that an SCT came from.
* Ownership of the log ID remains with the SCT.
* Returns the length of the log ID.
*/
size_t SCT_get0_log_id(const SCT *sct, unsigned char **log_id);
/*
* Set the log ID of an SCT to point directly to the *log_id specified.
* The SCT takes ownership of the specified pointer.
* Returns 1 on success, 0 otherwise.
*/
__owur int SCT_set0_log_id(SCT *sct, unsigned char *log_id, size_t log_id_len);
/*
* Set the log ID of an SCT.
* This makes a copy of the log_id.
* Returns 1 on success, 0 otherwise.
*/
__owur int SCT_set1_log_id(SCT *sct, const unsigned char *log_id,
size_t log_id_len);
/*
* Returns the timestamp for the SCT (epoch time in milliseconds).
*/
uint64_t SCT_get_timestamp(const SCT *sct);
/*
* Set the timestamp of an SCT (epoch time in milliseconds).
*/
void SCT_set_timestamp(SCT *sct, uint64_t timestamp);
/*
* Return the NID for the signature used by the SCT.
* For CT v1, this will be either NID_sha256WithRSAEncryption or
* NID_ecdsa_with_SHA256 (or NID_undef if incorrect/unset).
*/
int SCT_get_signature_nid(const SCT *sct);
/*
* Set the signature type of an SCT
* For CT v1, this should be either NID_sha256WithRSAEncryption or
* NID_ecdsa_with_SHA256.
* Returns 1 on success, 0 otherwise.
*/
__owur int SCT_set_signature_nid(SCT *sct, int nid);
/*
* Set *ext to point to the extension data for the SCT. ext must not be NULL.
* The SCT retains ownership of this pointer.
* Returns length of the data pointed to.
*/
size_t SCT_get0_extensions(const SCT *sct, unsigned char **ext);
/*
* Set the extensions of an SCT to point directly to the *ext specified.
* The SCT takes ownership of the specified pointer.
*/
void SCT_set0_extensions(SCT *sct, unsigned char *ext, size_t ext_len);
/*
* Set the extensions of an SCT.
* This takes a copy of the ext.
* Returns 1 on success, 0 otherwise.
*/
__owur int SCT_set1_extensions(SCT *sct, const unsigned char *ext,
size_t ext_len);
/*
* Set *sig to point to the signature for the SCT. sig must not be NULL.
* The SCT retains ownership of this pointer.
* Returns length of the data pointed to.
*/
size_t SCT_get0_signature(const SCT *sct, unsigned char **sig);
/*
* Set the signature of an SCT to point directly to the *sig specified.
* The SCT takes ownership of the specified pointer.
*/
void SCT_set0_signature(SCT *sct, unsigned char *sig, size_t sig_len);
/*
* Set the signature of an SCT to be a copy of the *sig specified.
* Returns 1 on success, 0 otherwise.
*/
__owur int SCT_set1_signature(SCT *sct, const unsigned char *sig,
size_t sig_len);
/*
* The origin of this SCT, e.g. TLS extension, OCSP response, etc.
*/
sct_source_t SCT_get_source(const SCT *sct);
/*
* Set the origin of this SCT, e.g. TLS extension, OCSP response, etc.
* Returns 1 on success, 0 otherwise.
*/
__owur int SCT_set_source(SCT *sct, sct_source_t source);
/*
* Returns a text string describing the validation status of |sct|.
*/
const char *SCT_validation_status_string(const SCT *sct);
/*
* Pretty-prints an |sct| to |out|.
* It will be indented by the number of spaces specified by |indent|.
* If |logs| is not NULL, it will be used to lookup the CT log that the SCT came
* from, so that the log name can be printed.
*/
void SCT_print(const SCT *sct, BIO *out, int indent, const CTLOG_STORE *logs);
/*
* Pretty-prints an |sct_list| to |out|.
* It will be indented by the number of spaces specified by |indent|.
* SCTs will be delimited by |separator|.
* If |logs| is not NULL, it will be used to lookup the CT log that each SCT
* came from, so that the log names can be printed.
*/
void SCT_LIST_print(const STACK_OF(SCT) *sct_list, BIO *out, int indent,
const char *separator, const CTLOG_STORE *logs);
/*
* Gets the last result of validating this SCT.
* If it has not been validated yet, returns SCT_VALIDATION_STATUS_NOT_SET.
*/
sct_validation_status_t SCT_get_validation_status(const SCT *sct);
/*
* Validates the given SCT with the provided context.
* Sets the "validation_status" field of the SCT.
* Returns 1 if the SCT is valid and the signature verifies.
* Returns 0 if the SCT is invalid or could not be verified.
* Returns -1 if an error occurs.
*/
__owur int SCT_validate(SCT *sct, const CT_POLICY_EVAL_CTX *ctx);
/*
* Validates the given list of SCTs with the provided context.
* Sets the "validation_status" field of each SCT.
* Returns 1 if there are no invalid SCTs and all signatures verify.
* Returns 0 if at least one SCT is invalid or could not be verified.
* Returns a negative integer if an error occurs.
*/
__owur int SCT_LIST_validate(const STACK_OF(SCT) *scts,
CT_POLICY_EVAL_CTX *ctx);
/*********************************
* SCT parsing and serialisation *
*********************************/
/*
* Serialize (to TLS format) a stack of SCTs and return the length.
* "a" must not be NULL.
* If "pp" is NULL, just return the length of what would have been serialized.
* If "pp" is not NULL and "*pp" is null, function will allocate a new pointer
* for data that caller is responsible for freeing (only if function returns
* successfully).
* If "pp" is NULL and "*pp" is not NULL, caller is responsible for ensuring
* that "*pp" is large enough to accept all of the serialized data.
* Returns < 0 on error, >= 0 indicating bytes written (or would have been)
* on success.
*/
__owur int i2o_SCT_LIST(const STACK_OF(SCT) *a, unsigned char **pp);
/*
* Convert TLS format SCT list to a stack of SCTs.
* If "a" or "*a" is NULL, a new stack will be created that the caller is
* responsible for freeing (by calling SCT_LIST_free).
* "**pp" and "*pp" must not be NULL.
* Upon success, "*pp" will point to after the last bytes read, and a stack
* will be returned.
* Upon failure, a NULL pointer will be returned, and the position of "*pp" is
* not defined.
*/
STACK_OF(SCT) *o2i_SCT_LIST(STACK_OF(SCT) **a, const unsigned char **pp,
size_t len);
/*
* Serialize (to DER format) a stack of SCTs and return the length.
* "a" must not be NULL.
* If "pp" is NULL, just returns the length of what would have been serialized.
* If "pp" is not NULL and "*pp" is null, function will allocate a new pointer
* for data that caller is responsible for freeing (only if function returns
* successfully).
* If "pp" is NULL and "*pp" is not NULL, caller is responsible for ensuring
* that "*pp" is large enough to accept all of the serialized data.
* Returns < 0 on error, >= 0 indicating bytes written (or would have been)
* on success.
*/
__owur int i2d_SCT_LIST(const STACK_OF(SCT) *a, unsigned char **pp);
/*
* Parses an SCT list in DER format and returns it.
* If "a" or "*a" is NULL, a new stack will be created that the caller is
* responsible for freeing (by calling SCT_LIST_free).
* "**pp" and "*pp" must not be NULL.
* Upon success, "*pp" will point to after the last bytes read, and a stack
* will be returned.
* Upon failure, a NULL pointer will be returned, and the position of "*pp" is
* not defined.
*/
STACK_OF(SCT) *d2i_SCT_LIST(STACK_OF(SCT) **a, const unsigned char **pp,
long len);
/*
* Serialize (to TLS format) an |sct| and write it to |out|.
* If |out| is null, no SCT will be output but the length will still be returned.
* If |out| points to a null pointer, a string will be allocated to hold the
* TLS-format SCT. It is the responsibility of the caller to free it.
* If |out| points to an allocated string, the TLS-format SCT will be written
* to it.
* The length of the SCT in TLS format will be returned.
*/
__owur int i2o_SCT(const SCT *sct, unsigned char **out);
/*
* Parses an SCT in TLS format and returns it.
* If |psct| is not null, it will end up pointing to the parsed SCT. If it
* already points to a non-null pointer, the pointer will be free'd.
* |in| should be a pointer to a string containing the TLS-format SCT.
* |in| will be advanced to the end of the SCT if parsing succeeds.
* |len| should be the length of the SCT in |in|.
* Returns NULL if an error occurs.
* If the SCT is an unsupported version, only the SCT's 'sct' and 'sct_len'
* fields will be populated (with |in| and |len| respectively).
*/
SCT *o2i_SCT(SCT **psct, const unsigned char **in, size_t len);
/********************
* CT log functions *
********************/
/*
* Creates a new CT log instance with the given |public_key| and |name|.
* Takes ownership of |public_key| but copies |name|.
* Returns NULL if malloc fails or if |public_key| cannot be converted to DER.
* Should be deleted by the caller using CTLOG_free when no longer needed.
*/
CTLOG *CTLOG_new(EVP_PKEY *public_key, const char *name);
/*
* Creates a new CTLOG instance with the base64-encoded SubjectPublicKeyInfo DER
* in |pkey_base64|. The |name| is a string to help users identify this log.
* Returns 1 on success, 0 on failure.
* Should be deleted by the caller using CTLOG_free when no longer needed.
*/
int CTLOG_new_from_base64(CTLOG ** ct_log,
const char *pkey_base64, const char *name);
/*
* Deletes a CT log instance and its fields.
*/
void CTLOG_free(CTLOG *log);
/* Gets the name of the CT log */
const char *CTLOG_get0_name(const CTLOG *log);
/* Gets the ID of the CT log */
void CTLOG_get0_log_id(const CTLOG *log, const uint8_t **log_id,
size_t *log_id_len);
/* Gets the public key of the CT log */
EVP_PKEY *CTLOG_get0_public_key(const CTLOG *log);
/**************************
* CT log store functions *
**************************/
/*
* Creates a new CT log store.
* Should be deleted by the caller using CTLOG_STORE_free when no longer needed.
*/
CTLOG_STORE *CTLOG_STORE_new(void);
/*
* Deletes a CT log store and all of the CT log instances held within.
*/
void CTLOG_STORE_free(CTLOG_STORE *store);
/*
* Finds a CT log in the store based on its log ID.
* Returns the CT log, or NULL if no match is found.
*/
const CTLOG *CTLOG_STORE_get0_log_by_id(const CTLOG_STORE *store,
const uint8_t *log_id,
size_t log_id_len);
/*
* Loads a CT log list into a |store| from a |file|.
* Returns 1 if loading is successful, or 0 otherwise.
*/
__owur int CTLOG_STORE_load_file(CTLOG_STORE *store, const char *file);
/*
* Loads the default CT log list into a |store|.
* See internal/cryptlib.h for the environment variable and file path that are
* consulted to find the default file.
* Returns 1 if loading is successful, or 0 otherwise.
*/
__owur int CTLOG_STORE_load_default_file(CTLOG_STORE *store);
# ifdef __cplusplus
}
# endif
# endif
#endif

View File

@ -0,0 +1,76 @@
/*
* Generated by util/mkerr.pl DO NOT EDIT
* Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/license.html
*/
#ifndef HEADER_CTERR_H
# define HEADER_CTERR_H
# include <openssl/opensslconf.h>
# ifndef OPENSSL_NO_CT
# ifdef __cplusplus
extern "C"
# endif
int ERR_load_CT_strings(void);
/*
* CT function codes.
*/
# define CT_F_CTLOG_NEW 117
# define CT_F_CTLOG_NEW_FROM_BASE64 118
# define CT_F_CTLOG_NEW_FROM_CONF 119
# define CT_F_CTLOG_STORE_LOAD_CTX_NEW 122
# define CT_F_CTLOG_STORE_LOAD_FILE 123
# define CT_F_CTLOG_STORE_LOAD_LOG 130
# define CT_F_CTLOG_STORE_NEW 131
# define CT_F_CT_BASE64_DECODE 124
# define CT_F_CT_POLICY_EVAL_CTX_NEW 133
# define CT_F_CT_V1_LOG_ID_FROM_PKEY 125
# define CT_F_I2O_SCT 107
# define CT_F_I2O_SCT_LIST 108
# define CT_F_I2O_SCT_SIGNATURE 109
# define CT_F_O2I_SCT 110
# define CT_F_O2I_SCT_LIST 111
# define CT_F_O2I_SCT_SIGNATURE 112
# define CT_F_SCT_CTX_NEW 126
# define CT_F_SCT_CTX_VERIFY 128
# define CT_F_SCT_NEW 100
# define CT_F_SCT_NEW_FROM_BASE64 127
# define CT_F_SCT_SET0_LOG_ID 101
# define CT_F_SCT_SET1_EXTENSIONS 114
# define CT_F_SCT_SET1_LOG_ID 115
# define CT_F_SCT_SET1_SIGNATURE 116
# define CT_F_SCT_SET_LOG_ENTRY_TYPE 102
# define CT_F_SCT_SET_SIGNATURE_NID 103
# define CT_F_SCT_SET_VERSION 104
/*
* CT reason codes.
*/
# define CT_R_BASE64_DECODE_ERROR 108
# define CT_R_INVALID_LOG_ID_LENGTH 100
# define CT_R_LOG_CONF_INVALID 109
# define CT_R_LOG_CONF_INVALID_KEY 110
# define CT_R_LOG_CONF_MISSING_DESCRIPTION 111
# define CT_R_LOG_CONF_MISSING_KEY 112
# define CT_R_LOG_KEY_INVALID 113
# define CT_R_SCT_FUTURE_TIMESTAMP 116
# define CT_R_SCT_INVALID 104
# define CT_R_SCT_INVALID_SIGNATURE 107
# define CT_R_SCT_LIST_INVALID 105
# define CT_R_SCT_LOG_ID_MISMATCH 114
# define CT_R_SCT_NOT_SET 106
# define CT_R_SCT_UNSUPPORTED_VERSION 115
# define CT_R_UNRECOGNIZED_SIGNATURE_NID 101
# define CT_R_UNSUPPORTED_ENTRY_TYPE 102
# define CT_R_UNSUPPORTED_VERSION 103
# endif
#endif

View File

@ -1,257 +1,174 @@
/* crypto/des/des.h */ /*
/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
* All rights reserved. *
* * Licensed under the OpenSSL license (the "License"). You may not use
* This package is an SSL implementation written * this file except in compliance with the License. You can obtain a copy
* by Eric Young (eay@cryptsoft.com). * in the file LICENSE in the source distribution or at
* The implementation was written so as to conform with Netscapes SSL. * https://www.openssl.org/source/license.html
* */
* This library is free for commercial and non-commercial use as long as
* the following conditions are aheared to. The following conditions #ifndef HEADER_DES_H
* apply to all code found in this distribution, be it the RC4, RSA, # define HEADER_DES_H
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
* included with this distribution is covered by the same copyright terms # include <openssl/opensslconf.h>
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
* # ifndef OPENSSL_NO_DES
* Copyright remains Eric Young's, and as such any Copyright notices in # ifdef __cplusplus
* the code are not to be removed. extern "C" {
* If this package is used in a product, Eric Young should be given attribution # endif
* as the author of the parts of the library used. # include <openssl/e_os2.h>
* This can be in the form of a textual message at program startup or
* in documentation (online or textual) provided with the package. typedef unsigned int DES_LONG;
*
* Redistribution and use in source and binary forms, with or without # ifdef OPENSSL_BUILD_SHLIBCRYPTO
* modification, are permitted provided that the following conditions # undef OPENSSL_EXTERN
* are met: # define OPENSSL_EXTERN OPENSSL_EXPORT
* 1. Redistributions of source code must retain the copyright # endif
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright typedef unsigned char DES_cblock[8];
* notice, this list of conditions and the following disclaimer in the typedef /* const */ unsigned char const_DES_cblock[8];
* documentation and/or other materials provided with the distribution. /*
* 3. All advertising materials mentioning features or use of this software * With "const", gcc 2.8.1 on Solaris thinks that DES_cblock * and
* must display the following acknowledgement: * const_DES_cblock * are incompatible pointer types.
* "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 typedef struct DES_ks {
* being used are not cryptographic related :-). union {
* 4. If you include any Windows specific code (or a derivative thereof) from DES_cblock cblock;
* the apps directory (application code) you must include an acknowledgement: /*
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" * make sure things are correct size on machines with 8 byte longs
* */
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND DES_LONG deslong[2];
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE } ks[16];
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE } DES_key_schedule;
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL # define DES_KEY_SZ (sizeof(DES_cblock))
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS # define DES_SCHEDULE_SZ (sizeof(DES_key_schedule))
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT # define DES_ENCRYPT 1
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY # define DES_DECRYPT 0
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. # define DES_CBC_MODE 0
* # define DES_PCBC_MODE 1
* 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 # define DES_ecb2_encrypt(i,o,k1,k2,e) \
* copied and put under another distribution licence DES_ecb3_encrypt((i),(o),(k1),(k2),(k1),(e))
* [including the GNU Public Licence.]
*/ # define DES_ede2_cbc_encrypt(i,o,l,k1,k2,iv,e) \
DES_ede3_cbc_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(e))
#ifndef HEADER_NEW_DES_H
# define HEADER_NEW_DES_H # 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))
# include <openssl/e_os2.h> /* OPENSSL_EXTERN, OPENSSL_NO_DES, DES_LONG
* (via openssl/opensslconf.h */ # define DES_ede2_ofb64_encrypt(i,o,l,k1,k2,iv,n) \
DES_ede3_ofb64_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(n))
# ifdef OPENSSL_NO_DES
# error DES is disabled. OPENSSL_DECLARE_GLOBAL(int, DES_check_key); /* defaults to false */
# endif # define DES_check_key OPENSSL_GLOBAL_REF(DES_check_key)
# ifdef OPENSSL_BUILD_SHLIBCRYPTO const char *DES_options(void);
# undef OPENSSL_EXTERN void DES_ecb3_encrypt(const_DES_cblock *input, DES_cblock *output,
# define OPENSSL_EXTERN OPENSSL_EXPORT DES_key_schedule *ks1, DES_key_schedule *ks2,
# endif DES_key_schedule *ks3, int enc);
DES_LONG DES_cbc_cksum(const unsigned char *input, DES_cblock *output,
#ifdef __cplusplus long length, DES_key_schedule *schedule,
extern "C" { const_DES_cblock *ivec);
#endif /* DES_cbc_encrypt does not update the IV! Use DES_ncbc_encrypt instead. */
void DES_cbc_encrypt(const unsigned char *input, unsigned char *output,
typedef unsigned char DES_cblock[8]; long length, DES_key_schedule *schedule,
typedef /* const */ unsigned char const_DES_cblock[8]; DES_cblock *ivec, int enc);
/* void DES_ncbc_encrypt(const unsigned char *input, unsigned char *output,
* With "const", gcc 2.8.1 on Solaris thinks that DES_cblock * and long length, DES_key_schedule *schedule,
* const_DES_cblock * are incompatible pointer types. DES_cblock *ivec, int enc);
*/ void DES_xcbc_encrypt(const unsigned char *input, unsigned char *output,
long length, DES_key_schedule *schedule,
typedef struct DES_ks { DES_cblock *ivec, const_DES_cblock *inw,
union { const_DES_cblock *outw, int enc);
DES_cblock cblock; void DES_cfb_encrypt(const unsigned char *in, unsigned char *out, int numbits,
/* long length, DES_key_schedule *schedule,
* make sure things are correct size on machines with 8 byte longs DES_cblock *ivec, int enc);
*/ void DES_ecb_encrypt(const_DES_cblock *input, DES_cblock *output,
DES_LONG deslong[2]; DES_key_schedule *ks, int enc);
} ks[16];
} DES_key_schedule; /*
* This is the DES encryption function that gets called by just about every
# ifndef OPENSSL_DISABLE_OLD_DES_SUPPORT * other DES routine in the library. You should not use this function except
# ifndef OPENSSL_ENABLE_OLD_DES_SUPPORT * to implement 'modes' of DES. I say this because the functions that call
# define OPENSSL_ENABLE_OLD_DES_SUPPORT * this routine do the conversion from 'char *' to long, and this needs to be
# endif * done to make sure 'non-aligned' memory access do not occur. The
# endif * 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
# ifdef OPENSSL_ENABLE_OLD_DES_SUPPORT * encryption, zero if decryption.
# include <openssl/des_old.h> */
# endif void DES_encrypt1(DES_LONG *data, DES_key_schedule *ks, int enc);
# define DES_KEY_SZ (sizeof(DES_cblock)) /*
# define DES_SCHEDULE_SZ (sizeof(DES_key_schedule)) * 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
# define DES_ENCRYPT 1 * DES_encrypt1(), you should not use this function. It is used by the
# define DES_DECRYPT 0 * routines in the library that implement triple DES. IP() DES_encrypt2()
* DES_encrypt2() DES_encrypt2() FP() is the same as DES_encrypt1()
# define DES_CBC_MODE 0 * DES_encrypt1() DES_encrypt1() except faster :-).
# define DES_PCBC_MODE 1 */
void DES_encrypt2(DES_LONG *data, DES_key_schedule *ks, int enc);
# define DES_ecb2_encrypt(i,o,k1,k2,e) \
DES_ecb3_encrypt((i),(o),(k1),(k2),(k1),(e)) void DES_encrypt3(DES_LONG *data, DES_key_schedule *ks1,
DES_key_schedule *ks2, DES_key_schedule *ks3);
# define DES_ede2_cbc_encrypt(i,o,l,k1,k2,iv,e) \ void DES_decrypt3(DES_LONG *data, DES_key_schedule *ks1,
DES_ede3_cbc_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(e)) DES_key_schedule *ks2, DES_key_schedule *ks3);
void DES_ede3_cbc_encrypt(const unsigned char *input, unsigned char *output,
# define DES_ede2_cfb64_encrypt(i,o,l,k1,k2,iv,n,e) \ long length,
DES_ede3_cfb64_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(n),(e)) DES_key_schedule *ks1, DES_key_schedule *ks2,
DES_key_schedule *ks3, DES_cblock *ivec, int enc);
# define DES_ede2_ofb64_encrypt(i,o,l,k1,k2,iv,n) \ void DES_ede3_cfb64_encrypt(const unsigned char *in, unsigned char *out,
DES_ede3_ofb64_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(n)) long length, DES_key_schedule *ks1,
DES_key_schedule *ks2, DES_key_schedule *ks3,
OPENSSL_DECLARE_GLOBAL(int, DES_check_key); /* defaults to false */ DES_cblock *ivec, int *num, int enc);
# define DES_check_key OPENSSL_GLOBAL_REF(DES_check_key) void DES_ede3_cfb_encrypt(const unsigned char *in, unsigned char *out,
OPENSSL_DECLARE_GLOBAL(int, DES_rw_mode); /* defaults to DES_PCBC_MODE */ int numbits, long length, DES_key_schedule *ks1,
# define DES_rw_mode OPENSSL_GLOBAL_REF(DES_rw_mode) DES_key_schedule *ks2, DES_key_schedule *ks3,
DES_cblock *ivec, int enc);
const char *DES_options(void); void DES_ede3_ofb64_encrypt(const unsigned char *in, unsigned char *out,
void DES_ecb3_encrypt(const_DES_cblock *input, DES_cblock *output, long length, DES_key_schedule *ks1,
DES_key_schedule *ks1, DES_key_schedule *ks2, DES_key_schedule *ks2, DES_key_schedule *ks3,
DES_key_schedule *ks3, int enc); DES_cblock *ivec, int *num);
DES_LONG DES_cbc_cksum(const unsigned char *input, DES_cblock *output, char *DES_fcrypt(const char *buf, const char *salt, char *ret);
long length, DES_key_schedule *schedule, char *DES_crypt(const char *buf, const char *salt);
const_DES_cblock *ivec); void DES_ofb_encrypt(const unsigned char *in, unsigned char *out, int numbits,
/* DES_cbc_encrypt does not update the IV! Use DES_ncbc_encrypt instead. */ long length, DES_key_schedule *schedule,
void DES_cbc_encrypt(const unsigned char *input, unsigned char *output, DES_cblock *ivec);
long length, DES_key_schedule *schedule, void DES_pcbc_encrypt(const unsigned char *input, unsigned char *output,
DES_cblock *ivec, int enc); long length, DES_key_schedule *schedule,
void DES_ncbc_encrypt(const unsigned char *input, unsigned char *output, DES_cblock *ivec, int enc);
long length, DES_key_schedule *schedule, DES_LONG DES_quad_cksum(const unsigned char *input, DES_cblock output[],
DES_cblock *ivec, int enc); long length, int out_count, DES_cblock *seed);
void DES_xcbc_encrypt(const unsigned char *input, unsigned char *output, int DES_random_key(DES_cblock *ret);
long length, DES_key_schedule *schedule, void DES_set_odd_parity(DES_cblock *key);
DES_cblock *ivec, const_DES_cblock *inw, int DES_check_key_parity(const_DES_cblock *key);
const_DES_cblock *outw, int enc); int DES_is_weak_key(const_DES_cblock *key);
void DES_cfb_encrypt(const unsigned char *in, unsigned char *out, int numbits, /*
long length, DES_key_schedule *schedule, * DES_set_key (= set_key = DES_key_sched = key_sched) calls
DES_cblock *ivec, int enc); * DES_set_key_checked if global variable DES_check_key is set,
void DES_ecb_encrypt(const_DES_cblock *input, DES_cblock *output, * DES_set_key_unchecked otherwise.
DES_key_schedule *ks, int enc); */
int DES_set_key(const_DES_cblock *key, DES_key_schedule *schedule);
/* int DES_key_sched(const_DES_cblock *key, DES_key_schedule *schedule);
* This is the DES encryption function that gets called by just about every int DES_set_key_checked(const_DES_cblock *key, DES_key_schedule *schedule);
* other DES routine in the library. You should not use this function except void DES_set_key_unchecked(const_DES_cblock *key, DES_key_schedule *schedule);
* to implement 'modes' of DES. I say this because the functions that call void DES_string_to_key(const char *str, DES_cblock *key);
* this routine do the conversion from 'char *' to long, and this needs to be void DES_string_to_2keys(const char *str, DES_cblock *key1, DES_cblock *key2);
* done to make sure 'non-aligned' memory access do not occur. The void DES_cfb64_encrypt(const unsigned char *in, unsigned char *out,
* characters are loaded 'little endian'. Data is a pointer to 2 unsigned long length, DES_key_schedule *schedule,
* long's and ks is the DES_key_schedule to use. enc, is non zero specifies DES_cblock *ivec, int *num, int enc);
* encryption, zero if decryption. void DES_ofb64_encrypt(const unsigned char *in, unsigned char *out,
*/ long length, DES_key_schedule *schedule,
void DES_encrypt1(DES_LONG *data, DES_key_schedule *ks, int enc); DES_cblock *ivec, int *num);
/* # define DES_fixup_key_parity DES_set_odd_parity
* 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 # ifdef __cplusplus
* DES_encrypt1(), you should not use this function. It is used by the }
* routines in the library that implement triple DES. IP() DES_encrypt2() # endif
* DES_encrypt2() DES_encrypt2() FP() is the same as DES_encrypt1() # endif
* DES_encrypt1() DES_encrypt1() except faster :-).
*/ #endif
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

View File

@ -1,497 +0,0 @@
/* crypto/des/des_old.h */
/*-
* WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
*
* The function names in here are deprecated and are only present to
* provide an interface compatible with openssl 0.9.6 and older as
* well as libdes. OpenSSL now provides functions where "des_" has
* been replaced with "DES_" in the names, to make it possible to
* make incompatible changes that are needed for C type security and
* other stuff.
*
* This include files has two compatibility modes:
*
* - If OPENSSL_DES_LIBDES_COMPATIBILITY is defined, you get an API
* that is compatible with libdes and SSLeay.
* - If OPENSSL_DES_LIBDES_COMPATIBILITY isn't defined, you get an
* API that is compatible with OpenSSL 0.9.5x to 0.9.6x.
*
* Note that these modes break earlier snapshots of OpenSSL, where
* libdes compatibility was the only available mode or (later on) the
* prefered compatibility mode. However, after much consideration
* (and more or less violent discussions with external parties), it
* was concluded that OpenSSL should be compatible with earlier versions
* of itself before anything else. Also, in all honesty, libdes is
* an old beast that shouldn't really be used any more.
*
* Please consider starting to use the DES_ functions rather than the
* des_ ones. The des_ functions will disappear completely before
* OpenSSL 1.0!
*
* WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
*/
/*
* Written by Richard Levitte (richard@levitte.org) for the OpenSSL project
* 2001.
*/
/* ====================================================================
* 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.
* ====================================================================
*
* 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_DES_H
# define HEADER_DES_H
# include <openssl/e_os2.h> /* OPENSSL_EXTERN, OPENSSL_NO_DES, DES_LONG */
# ifdef OPENSSL_NO_DES
# error DES is disabled.
# endif
# ifndef HEADER_NEW_DES_H
# error You must include des.h, not des_old.h directly.
# endif
# ifdef _KERBEROS_DES_H
# error <openssl/des_old.h> replaces <kerberos/des.h>.
# endif
# include <openssl/symhacks.h>
# ifdef OPENSSL_BUILD_SHLIBCRYPTO
# undef OPENSSL_EXTERN
# define OPENSSL_EXTERN OPENSSL_EXPORT
# endif
#ifdef __cplusplus
extern "C" {
#endif
# ifdef _
# undef _
# endif
typedef unsigned char _ossl_old_des_cblock[8];
typedef struct _ossl_old_des_ks_struct {
union {
_ossl_old_des_cblock _;
/*
* make sure things are correct size on machines with 8 byte longs
*/
DES_LONG pad[2];
} ks;
} _ossl_old_des_key_schedule[16];
# ifndef OPENSSL_DES_LIBDES_COMPATIBILITY
# define des_cblock DES_cblock
# define const_des_cblock const_DES_cblock
# define des_key_schedule DES_key_schedule
# define des_ecb3_encrypt(i,o,k1,k2,k3,e)\
DES_ecb3_encrypt((i),(o),&(k1),&(k2),&(k3),(e))
# define des_ede3_cbc_encrypt(i,o,l,k1,k2,k3,iv,e)\
DES_ede3_cbc_encrypt((i),(o),(l),&(k1),&(k2),&(k3),(iv),(e))
# define des_ede3_cbcm_encrypt(i,o,l,k1,k2,k3,iv1,iv2,e)\
DES_ede3_cbcm_encrypt((i),(o),(l),&(k1),&(k2),&(k3),(iv1),(iv2),(e))
# define des_ede3_cfb64_encrypt(i,o,l,k1,k2,k3,iv,n,e)\
DES_ede3_cfb64_encrypt((i),(o),(l),&(k1),&(k2),&(k3),(iv),(n),(e))
# define des_ede3_ofb64_encrypt(i,o,l,k1,k2,k3,iv,n)\
DES_ede3_ofb64_encrypt((i),(o),(l),&(k1),&(k2),&(k3),(iv),(n))
# define des_options()\
DES_options()
# define des_cbc_cksum(i,o,l,k,iv)\
DES_cbc_cksum((i),(o),(l),&(k),(iv))
# define des_cbc_encrypt(i,o,l,k,iv,e)\
DES_cbc_encrypt((i),(o),(l),&(k),(iv),(e))
# define des_ncbc_encrypt(i,o,l,k,iv,e)\
DES_ncbc_encrypt((i),(o),(l),&(k),(iv),(e))
# define des_xcbc_encrypt(i,o,l,k,iv,inw,outw,e)\
DES_xcbc_encrypt((i),(o),(l),&(k),(iv),(inw),(outw),(e))
# define des_cfb_encrypt(i,o,n,l,k,iv,e)\
DES_cfb_encrypt((i),(o),(n),(l),&(k),(iv),(e))
# define des_ecb_encrypt(i,o,k,e)\
DES_ecb_encrypt((i),(o),&(k),(e))
# define des_encrypt1(d,k,e)\
DES_encrypt1((d),&(k),(e))
# define des_encrypt2(d,k,e)\
DES_encrypt2((d),&(k),(e))
# define des_encrypt3(d,k1,k2,k3)\
DES_encrypt3((d),&(k1),&(k2),&(k3))
# define des_decrypt3(d,k1,k2,k3)\
DES_decrypt3((d),&(k1),&(k2),&(k3))
# define des_xwhite_in2out(k,i,o)\
DES_xwhite_in2out((k),(i),(o))
# define des_enc_read(f,b,l,k,iv)\
DES_enc_read((f),(b),(l),&(k),(iv))
# define des_enc_write(f,b,l,k,iv)\
DES_enc_write((f),(b),(l),&(k),(iv))
# define des_fcrypt(b,s,r)\
DES_fcrypt((b),(s),(r))
# if 0
# define des_crypt(b,s)\
DES_crypt((b),(s))
# if !defined(PERL5) && !defined(__FreeBSD__) && !defined(NeXT) && !defined(__OpenBSD__)
# define crypt(b,s)\
DES_crypt((b),(s))
# endif
# endif
# define des_ofb_encrypt(i,o,n,l,k,iv)\
DES_ofb_encrypt((i),(o),(n),(l),&(k),(iv))
# define des_pcbc_encrypt(i,o,l,k,iv,e)\
DES_pcbc_encrypt((i),(o),(l),&(k),(iv),(e))
# define des_quad_cksum(i,o,l,c,s)\
DES_quad_cksum((i),(o),(l),(c),(s))
# define des_random_seed(k)\
_ossl_096_des_random_seed((k))
# define des_random_key(r)\
DES_random_key((r))
# define des_read_password(k,p,v) \
DES_read_password((k),(p),(v))
# define des_read_2passwords(k1,k2,p,v) \
DES_read_2passwords((k1),(k2),(p),(v))
# define des_set_odd_parity(k)\
DES_set_odd_parity((k))
# define des_check_key_parity(k)\
DES_check_key_parity((k))
# define des_is_weak_key(k)\
DES_is_weak_key((k))
# define des_set_key(k,ks)\
DES_set_key((k),&(ks))
# define des_key_sched(k,ks)\
DES_key_sched((k),&(ks))
# define des_set_key_checked(k,ks)\
DES_set_key_checked((k),&(ks))
# define des_set_key_unchecked(k,ks)\
DES_set_key_unchecked((k),&(ks))
# define des_string_to_key(s,k)\
DES_string_to_key((s),(k))
# define des_string_to_2keys(s,k1,k2)\
DES_string_to_2keys((s),(k1),(k2))
# define des_cfb64_encrypt(i,o,l,ks,iv,n,e)\
DES_cfb64_encrypt((i),(o),(l),&(ks),(iv),(n),(e))
# define des_ofb64_encrypt(i,o,l,ks,iv,n)\
DES_ofb64_encrypt((i),(o),(l),&(ks),(iv),(n))
# 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))
# define des_check_key DES_check_key
# define des_rw_mode DES_rw_mode
# else /* libdes compatibility */
/*
* Map all symbol names to _ossl_old_des_* form, so we avoid all clashes with
* libdes
*/
# define des_cblock _ossl_old_des_cblock
# define des_key_schedule _ossl_old_des_key_schedule
# define des_ecb3_encrypt(i,o,k1,k2,k3,e)\
_ossl_old_des_ecb3_encrypt((i),(o),(k1),(k2),(k3),(e))
# define des_ede3_cbc_encrypt(i,o,l,k1,k2,k3,iv,e)\
_ossl_old_des_ede3_cbc_encrypt((i),(o),(l),(k1),(k2),(k3),(iv),(e))
# define des_ede3_cfb64_encrypt(i,o,l,k1,k2,k3,iv,n,e)\
_ossl_old_des_ede3_cfb64_encrypt((i),(o),(l),(k1),(k2),(k3),(iv),(n),(e))
# define des_ede3_ofb64_encrypt(i,o,l,k1,k2,k3,iv,n)\
_ossl_old_des_ede3_ofb64_encrypt((i),(o),(l),(k1),(k2),(k3),(iv),(n))
# define des_options()\
_ossl_old_des_options()
# define des_cbc_cksum(i,o,l,k,iv)\
_ossl_old_des_cbc_cksum((i),(o),(l),(k),(iv))
# define des_cbc_encrypt(i,o,l,k,iv,e)\
_ossl_old_des_cbc_encrypt((i),(o),(l),(k),(iv),(e))
# define des_ncbc_encrypt(i,o,l,k,iv,e)\
_ossl_old_des_ncbc_encrypt((i),(o),(l),(k),(iv),(e))
# define des_xcbc_encrypt(i,o,l,k,iv,inw,outw,e)\
_ossl_old_des_xcbc_encrypt((i),(o),(l),(k),(iv),(inw),(outw),(e))
# define des_cfb_encrypt(i,o,n,l,k,iv,e)\
_ossl_old_des_cfb_encrypt((i),(o),(n),(l),(k),(iv),(e))
# define des_ecb_encrypt(i,o,k,e)\
_ossl_old_des_ecb_encrypt((i),(o),(k),(e))
# define des_encrypt(d,k,e)\
_ossl_old_des_encrypt((d),(k),(e))
# define des_encrypt2(d,k,e)\
_ossl_old_des_encrypt2((d),(k),(e))
# define des_encrypt3(d,k1,k2,k3)\
_ossl_old_des_encrypt3((d),(k1),(k2),(k3))
# define des_decrypt3(d,k1,k2,k3)\
_ossl_old_des_decrypt3((d),(k1),(k2),(k3))
# define des_xwhite_in2out(k,i,o)\
_ossl_old_des_xwhite_in2out((k),(i),(o))
# define des_enc_read(f,b,l,k,iv)\
_ossl_old_des_enc_read((f),(b),(l),(k),(iv))
# define des_enc_write(f,b,l,k,iv)\
_ossl_old_des_enc_write((f),(b),(l),(k),(iv))
# define des_fcrypt(b,s,r)\
_ossl_old_des_fcrypt((b),(s),(r))
# define des_crypt(b,s)\
_ossl_old_des_crypt((b),(s))
# if 0
# define crypt(b,s)\
_ossl_old_crypt((b),(s))
# endif
# define des_ofb_encrypt(i,o,n,l,k,iv)\
_ossl_old_des_ofb_encrypt((i),(o),(n),(l),(k),(iv))
# define des_pcbc_encrypt(i,o,l,k,iv,e)\
_ossl_old_des_pcbc_encrypt((i),(o),(l),(k),(iv),(e))
# define des_quad_cksum(i,o,l,c,s)\
_ossl_old_des_quad_cksum((i),(o),(l),(c),(s))
# define des_random_seed(k)\
_ossl_old_des_random_seed((k))
# define des_random_key(r)\
_ossl_old_des_random_key((r))
# define des_read_password(k,p,v) \
_ossl_old_des_read_password((k),(p),(v))
# define des_read_2passwords(k1,k2,p,v) \
_ossl_old_des_read_2passwords((k1),(k2),(p),(v))
# define des_set_odd_parity(k)\
_ossl_old_des_set_odd_parity((k))
# define des_is_weak_key(k)\
_ossl_old_des_is_weak_key((k))
# define des_set_key(k,ks)\
_ossl_old_des_set_key((k),(ks))
# define des_key_sched(k,ks)\
_ossl_old_des_key_sched((k),(ks))
# define des_string_to_key(s,k)\
_ossl_old_des_string_to_key((s),(k))
# define des_string_to_2keys(s,k1,k2)\
_ossl_old_des_string_to_2keys((s),(k1),(k2))
# define des_cfb64_encrypt(i,o,l,ks,iv,n,e)\
_ossl_old_des_cfb64_encrypt((i),(o),(l),(ks),(iv),(n),(e))
# define des_ofb64_encrypt(i,o,l,ks,iv,n)\
_ossl_old_des_ofb64_encrypt((i),(o),(l),(ks),(iv),(n))
# 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))
# define des_check_key DES_check_key
# define des_rw_mode DES_rw_mode
# endif
const char *_ossl_old_des_options(void);
void _ossl_old_des_ecb3_encrypt(_ossl_old_des_cblock *input,
_ossl_old_des_cblock *output,
_ossl_old_des_key_schedule ks1,
_ossl_old_des_key_schedule ks2,
_ossl_old_des_key_schedule ks3, int enc);
DES_LONG _ossl_old_des_cbc_cksum(_ossl_old_des_cblock *input,
_ossl_old_des_cblock *output, long length,
_ossl_old_des_key_schedule schedule,
_ossl_old_des_cblock *ivec);
void _ossl_old_des_cbc_encrypt(_ossl_old_des_cblock *input,
_ossl_old_des_cblock *output, long length,
_ossl_old_des_key_schedule schedule,
_ossl_old_des_cblock *ivec, int enc);
void _ossl_old_des_ncbc_encrypt(_ossl_old_des_cblock *input,
_ossl_old_des_cblock *output, long length,
_ossl_old_des_key_schedule schedule,
_ossl_old_des_cblock *ivec, int enc);
void _ossl_old_des_xcbc_encrypt(_ossl_old_des_cblock *input,
_ossl_old_des_cblock *output, long length,
_ossl_old_des_key_schedule schedule,
_ossl_old_des_cblock *ivec,
_ossl_old_des_cblock *inw,
_ossl_old_des_cblock *outw, int enc);
void _ossl_old_des_cfb_encrypt(unsigned char *in, unsigned char *out,
int numbits, long length,
_ossl_old_des_key_schedule schedule,
_ossl_old_des_cblock *ivec, int enc);
void _ossl_old_des_ecb_encrypt(_ossl_old_des_cblock *input,
_ossl_old_des_cblock *output,
_ossl_old_des_key_schedule ks, int enc);
void _ossl_old_des_encrypt(DES_LONG *data, _ossl_old_des_key_schedule ks,
int enc);
void _ossl_old_des_encrypt2(DES_LONG *data, _ossl_old_des_key_schedule ks,
int enc);
void _ossl_old_des_encrypt3(DES_LONG *data, _ossl_old_des_key_schedule ks1,
_ossl_old_des_key_schedule ks2,
_ossl_old_des_key_schedule ks3);
void _ossl_old_des_decrypt3(DES_LONG *data, _ossl_old_des_key_schedule ks1,
_ossl_old_des_key_schedule ks2,
_ossl_old_des_key_schedule ks3);
void _ossl_old_des_ede3_cbc_encrypt(_ossl_old_des_cblock *input,
_ossl_old_des_cblock *output, long length,
_ossl_old_des_key_schedule ks1,
_ossl_old_des_key_schedule ks2,
_ossl_old_des_key_schedule ks3,
_ossl_old_des_cblock *ivec, int enc);
void _ossl_old_des_ede3_cfb64_encrypt(unsigned char *in, unsigned char *out,
long length,
_ossl_old_des_key_schedule ks1,
_ossl_old_des_key_schedule ks2,
_ossl_old_des_key_schedule ks3,
_ossl_old_des_cblock *ivec, int *num,
int enc);
void _ossl_old_des_ede3_ofb64_encrypt(unsigned char *in, unsigned char *out,
long length,
_ossl_old_des_key_schedule ks1,
_ossl_old_des_key_schedule ks2,
_ossl_old_des_key_schedule ks3,
_ossl_old_des_cblock *ivec, int *num);
# if 0
void _ossl_old_des_xwhite_in2out(_ossl_old_des_cblock (*des_key),
_ossl_old_des_cblock (*in_white),
_ossl_old_des_cblock (*out_white));
# endif
int _ossl_old_des_enc_read(int fd, char *buf, int len,
_ossl_old_des_key_schedule sched,
_ossl_old_des_cblock *iv);
int _ossl_old_des_enc_write(int fd, char *buf, int len,
_ossl_old_des_key_schedule sched,
_ossl_old_des_cblock *iv);
char *_ossl_old_des_fcrypt(const char *buf, const char *salt, char *ret);
char *_ossl_old_des_crypt(const char *buf, const char *salt);
# if !defined(PERL5) && !defined(NeXT)
char *_ossl_old_crypt(const char *buf, const char *salt);
# endif
void _ossl_old_des_ofb_encrypt(unsigned char *in, unsigned char *out,
int numbits, long length,
_ossl_old_des_key_schedule schedule,
_ossl_old_des_cblock *ivec);
void _ossl_old_des_pcbc_encrypt(_ossl_old_des_cblock *input,
_ossl_old_des_cblock *output, long length,
_ossl_old_des_key_schedule schedule,
_ossl_old_des_cblock *ivec, int enc);
DES_LONG _ossl_old_des_quad_cksum(_ossl_old_des_cblock *input,
_ossl_old_des_cblock *output, long length,
int out_count, _ossl_old_des_cblock *seed);
void _ossl_old_des_random_seed(_ossl_old_des_cblock key);
void _ossl_old_des_random_key(_ossl_old_des_cblock ret);
int _ossl_old_des_read_password(_ossl_old_des_cblock *key, const char *prompt,
int verify);
int _ossl_old_des_read_2passwords(_ossl_old_des_cblock *key1,
_ossl_old_des_cblock *key2,
const char *prompt, int verify);
void _ossl_old_des_set_odd_parity(_ossl_old_des_cblock *key);
int _ossl_old_des_is_weak_key(_ossl_old_des_cblock *key);
int _ossl_old_des_set_key(_ossl_old_des_cblock *key,
_ossl_old_des_key_schedule schedule);
int _ossl_old_des_key_sched(_ossl_old_des_cblock *key,
_ossl_old_des_key_schedule schedule);
void _ossl_old_des_string_to_key(char *str, _ossl_old_des_cblock *key);
void _ossl_old_des_string_to_2keys(char *str, _ossl_old_des_cblock *key1,
_ossl_old_des_cblock *key2);
void _ossl_old_des_cfb64_encrypt(unsigned char *in, unsigned char *out,
long length,
_ossl_old_des_key_schedule schedule,
_ossl_old_des_cblock *ivec, int *num,
int enc);
void _ossl_old_des_ofb64_encrypt(unsigned char *in, unsigned char *out,
long length,
_ossl_old_des_key_schedule schedule,
_ossl_old_des_cblock *ivec, int *num);
void _ossl_096_des_random_seed(des_cblock *key);
/*
* The following definitions provide compatibility with the MIT Kerberos
* library. The _ossl_old_des_key_schedule structure is not binary
* compatible.
*/
# define _KERBEROS_DES_H
# define KRBDES_ENCRYPT DES_ENCRYPT
# define KRBDES_DECRYPT DES_DECRYPT
# ifdef KERBEROS
# define ENCRYPT DES_ENCRYPT
# define DECRYPT DES_DECRYPT
# endif
# ifndef NCOMPAT
# define C_Block des_cblock
# define Key_schedule des_key_schedule
# define KEY_SZ DES_KEY_SZ
# define string_to_key des_string_to_key
# define read_pw_string des_read_pw_string
# define random_key des_random_key
# define pcbc_encrypt des_pcbc_encrypt
# define set_key des_set_key
# define key_sched des_key_sched
# define ecb_encrypt des_ecb_encrypt
# define cbc_encrypt des_cbc_encrypt
# define ncbc_encrypt des_ncbc_encrypt
# define xcbc_encrypt des_xcbc_encrypt
# define cbc_cksum des_cbc_cksum
# define quad_cksum des_quad_cksum
# define check_parity des_check_key_parity
# endif
# define des_fixup_key_parity DES_fixup_key_parity
#ifdef __cplusplus
}
#endif
/* for DES_read_pw_string et al */
# include <openssl/ui_compat.h>
#endif

View File

@ -1,393 +1,340 @@
/* crypto/dh/dh.h */ /*
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
* All rights reserved. *
* * Licensed under the OpenSSL license (the "License"). You may not use
* This package is an SSL implementation written * this file except in compliance with the License. You can obtain a copy
* by Eric Young (eay@cryptsoft.com). * in the file LICENSE in the source distribution or at
* The implementation was written so as to conform with Netscapes SSL. * https://www.openssl.org/source/license.html
* */
* This library is free for commercial and non-commercial use as long as
* the following conditions are aheared to. The following conditions #ifndef HEADER_DH_H
* apply to all code found in this distribution, be it the RC4, RSA, # define HEADER_DH_H
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
* included with this distribution is covered by the same copyright terms # include <openssl/opensslconf.h>
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
* # ifndef OPENSSL_NO_DH
* Copyright remains Eric Young's, and as such any Copyright notices in # include <openssl/e_os2.h>
* the code are not to be removed. # include <openssl/bio.h>
* If this package is used in a product, Eric Young should be given attribution # include <openssl/asn1.h>
* as the author of the parts of the library used. # include <openssl/ossl_typ.h>
* This can be in the form of a textual message at program startup or # if OPENSSL_API_COMPAT < 0x10100000L
* in documentation (online or textual) provided with the package. # include <openssl/bn.h>
* # endif
* Redistribution and use in source and binary forms, with or without # include <openssl/dherr.h>
* modification, are permitted provided that the following conditions
* are met: # ifdef __cplusplus
* 1. Redistributions of source code must retain the copyright extern "C" {
* notice, this list of conditions and the following disclaimer. # endif
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the # ifndef OPENSSL_DH_MAX_MODULUS_BITS
* documentation and/or other materials provided with the distribution. # define OPENSSL_DH_MAX_MODULUS_BITS 10000
* 3. All advertising materials mentioning features or use of this software # endif
* must display the following acknowledgement:
* "This product includes cryptographic software written by # define OPENSSL_DH_FIPS_MIN_MODULUS_BITS 1024
* Eric Young (eay@cryptsoft.com)"
* The word 'cryptographic' can be left out if the rouines from the library # define DH_FLAG_CACHE_MONT_P 0x01
* being used are not cryptographic related :-).
* 4. If you include any Windows specific code (or a derivative thereof) from # if OPENSSL_API_COMPAT < 0x10100000L
* the apps directory (application code) you must include an acknowledgement: /*
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" * Does nothing. Previously this switched off constant time behaviour.
* */
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND # define DH_FLAG_NO_EXP_CONSTTIME 0x00
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # endif
* 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 * If this flag is set the DH method is FIPS compliant and can be used in
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * FIPS mode. This is set in the validated module method. If an application
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * sets this flag in its own methods it is its responsibility to ensure the
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * result is compliant.
* 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. # define DH_FLAG_FIPS_METHOD 0x0400
*
* 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 * If this flag is set the operations normally disabled in FIPS mode are
* copied and put under another distribution licence * permitted it is then the applications responsibility to ensure that the
* [including the GNU Public Licence.] * usage is compliant.
*/ */
#ifndef HEADER_DH_H # define DH_FLAG_NON_FIPS_ALLOW 0x0400
# define HEADER_DH_H
/* Already defined in ossl_typ.h */
# include <openssl/e_os2.h> /* typedef struct dh_st DH; */
/* typedef struct dh_method DH_METHOD; */
# ifdef OPENSSL_NO_DH
# error DH is disabled. DECLARE_ASN1_ITEM(DHparams)
# endif
# define DH_GENERATOR_2 2
# ifndef OPENSSL_NO_BIO /* #define DH_GENERATOR_3 3 */
# include <openssl/bio.h> # define DH_GENERATOR_5 5
# endif
# include <openssl/ossl_typ.h> /* DH_check error codes */
# ifndef OPENSSL_NO_DEPRECATED # define DH_CHECK_P_NOT_PRIME 0x01
# include <openssl/bn.h> # define DH_CHECK_P_NOT_SAFE_PRIME 0x02
# endif # define DH_UNABLE_TO_CHECK_GENERATOR 0x04
# define DH_NOT_SUITABLE_GENERATOR 0x08
# ifndef OPENSSL_DH_MAX_MODULUS_BITS # define DH_CHECK_Q_NOT_PRIME 0x10
# define OPENSSL_DH_MAX_MODULUS_BITS 10000 # define DH_CHECK_INVALID_Q_VALUE 0x20
# endif # define DH_CHECK_INVALID_J_VALUE 0x40
# define DH_FLAG_CACHE_MONT_P 0x01 /* DH_check_pub_key error codes */
# define DH_CHECK_PUBKEY_TOO_SMALL 0x01
/* # define DH_CHECK_PUBKEY_TOO_LARGE 0x02
* new with 0.9.7h; the built-in DH # define DH_CHECK_PUBKEY_INVALID 0x04
* implementation now uses constant time
* modular exponentiation for secret exponents /*
* by default. This flag causes the * primes p where (p-1)/2 is prime too are called "safe"; we define this for
* faster variable sliding window method to * backward compatibility:
* be used for all exponents. */
*/ # define DH_CHECK_P_NOT_STRONG_PRIME DH_CHECK_P_NOT_SAFE_PRIME
# define DH_FLAG_NO_EXP_CONSTTIME 0x02
# define d2i_DHparams_fp(fp,x) \
/* (DH *)ASN1_d2i_fp((char *(*)())DH_new, \
* If this flag is set the DH method is FIPS compliant and can be used in (char *(*)())d2i_DHparams, \
* FIPS mode. This is set in the validated module method. If an application (fp), \
* sets this flag in its own methods it is its reposibility to ensure the (unsigned char **)(x))
* result is compliant. # define i2d_DHparams_fp(fp,x) \
*/ ASN1_i2d_fp(i2d_DHparams,(fp), (unsigned char *)(x))
# define d2i_DHparams_bio(bp,x) \
# define DH_FLAG_FIPS_METHOD 0x0400 ASN1_d2i_bio_of(DH, DH_new, d2i_DHparams, bp, x)
# define i2d_DHparams_bio(bp,x) \
/* ASN1_i2d_bio_of_const(DH,i2d_DHparams,bp,x)
* If this flag is set the operations normally disabled in FIPS mode are
* permitted it is then the applications responsibility to ensure that the # define d2i_DHxparams_fp(fp,x) \
* usage is compliant. (DH *)ASN1_d2i_fp((char *(*)())DH_new, \
*/ (char *(*)())d2i_DHxparams, \
(fp), \
# define DH_FLAG_NON_FIPS_ALLOW 0x0400 (unsigned char **)(x))
# define i2d_DHxparams_fp(fp,x) \
#ifdef __cplusplus ASN1_i2d_fp(i2d_DHxparams,(fp), (unsigned char *)(x))
extern "C" { # define d2i_DHxparams_bio(bp,x) \
#endif ASN1_d2i_bio_of(DH, DH_new, d2i_DHxparams, bp, x)
# define i2d_DHxparams_bio(bp,x) \
/* Already defined in ossl_typ.h */ ASN1_i2d_bio_of_const(DH, i2d_DHxparams, bp, x)
/* typedef struct dh_st DH; */
/* typedef struct dh_method DH_METHOD; */ DH *DHparams_dup(DH *);
struct dh_method { const DH_METHOD *DH_OpenSSL(void);
const char *name;
/* Methods here */ void DH_set_default_method(const DH_METHOD *meth);
int (*generate_key) (DH *dh); const DH_METHOD *DH_get_default_method(void);
int (*compute_key) (unsigned char *key, const BIGNUM *pub_key, DH *dh); int DH_set_method(DH *dh, const DH_METHOD *meth);
/* Can be null */ DH *DH_new_method(ENGINE *engine);
int (*bn_mod_exp) (const DH *dh, BIGNUM *r, const BIGNUM *a,
const BIGNUM *p, const BIGNUM *m, BN_CTX *ctx, DH *DH_new(void);
BN_MONT_CTX *m_ctx); void DH_free(DH *dh);
int (*init) (DH *dh); int DH_up_ref(DH *dh);
int (*finish) (DH *dh); int DH_bits(const DH *dh);
int flags; int DH_size(const DH *dh);
char *app_data; int DH_security_bits(const DH *dh);
/* If this is non-NULL, it will be used to generate parameters */ #define DH_get_ex_new_index(l, p, newf, dupf, freef) \
int (*generate_params) (DH *dh, int prime_len, int generator, CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_DH, l, p, newf, dupf, freef)
BN_GENCB *cb); int DH_set_ex_data(DH *d, int idx, void *arg);
}; void *DH_get_ex_data(DH *d, int idx);
struct dh_st { /* Deprecated version */
/* DEPRECATEDIN_0_9_8(DH *DH_generate_parameters(int prime_len, int generator,
* This first argument is used to pick up errors when a DH is passed void (*callback) (int, int,
* instead of a EVP_PKEY void *),
*/ void *cb_arg))
int pad;
int version; /* New version */
BIGNUM *p; int DH_generate_parameters_ex(DH *dh, int prime_len, int generator,
BIGNUM *g; BN_GENCB *cb);
long length; /* optional */
BIGNUM *pub_key; /* g^x % p */ int DH_check_params_ex(const DH *dh);
BIGNUM *priv_key; /* x */ int DH_check_ex(const DH *dh);
int flags; int DH_check_pub_key_ex(const DH *dh, const BIGNUM *pub_key);
BN_MONT_CTX *method_mont_p; int DH_check_params(const DH *dh, int *ret);
/* Place holders if we want to do X9.42 DH */ int DH_check(const DH *dh, int *codes);
BIGNUM *q; int DH_check_pub_key(const DH *dh, const BIGNUM *pub_key, int *codes);
BIGNUM *j; int DH_generate_key(DH *dh);
unsigned char *seed; int DH_compute_key(unsigned char *key, const BIGNUM *pub_key, DH *dh);
int seedlen; int DH_compute_key_padded(unsigned char *key, const BIGNUM *pub_key, DH *dh);
BIGNUM *counter; DH *d2i_DHparams(DH **a, const unsigned char **pp, long length);
int references; int i2d_DHparams(const DH *a, unsigned char **pp);
CRYPTO_EX_DATA ex_data; DH *d2i_DHxparams(DH **a, const unsigned char **pp, long length);
const DH_METHOD *meth; int i2d_DHxparams(const DH *a, unsigned char **pp);
ENGINE *engine; # ifndef OPENSSL_NO_STDIO
}; int DHparams_print_fp(FILE *fp, const DH *x);
# endif
# define DH_GENERATOR_2 2 int DHparams_print(BIO *bp, const DH *x);
/* #define DH_GENERATOR_3 3 */
# define DH_GENERATOR_5 5 /* RFC 5114 parameters */
DH *DH_get_1024_160(void);
/* DH_check error codes */ DH *DH_get_2048_224(void);
# define DH_CHECK_P_NOT_PRIME 0x01 DH *DH_get_2048_256(void);
# define DH_CHECK_P_NOT_SAFE_PRIME 0x02
# define DH_UNABLE_TO_CHECK_GENERATOR 0x04 /* Named parameters, currently RFC7919 */
# define DH_NOT_SUITABLE_GENERATOR 0x08 DH *DH_new_by_nid(int nid);
# define DH_CHECK_Q_NOT_PRIME 0x10 int DH_get_nid(const DH *dh);
# define DH_CHECK_INVALID_Q_VALUE 0x20
# define DH_CHECK_INVALID_J_VALUE 0x40 # ifndef OPENSSL_NO_CMS
/* RFC2631 KDF */
/* DH_check_pub_key error codes */ int DH_KDF_X9_42(unsigned char *out, size_t outlen,
# define DH_CHECK_PUBKEY_TOO_SMALL 0x01 const unsigned char *Z, size_t Zlen,
# define DH_CHECK_PUBKEY_TOO_LARGE 0x02 ASN1_OBJECT *key_oid,
# define DH_CHECK_PUBKEY_INVALID 0x04 const unsigned char *ukm, size_t ukmlen, const EVP_MD *md);
# endif
/*
* primes p where (p-1)/2 is prime too are called "safe"; we define this for void DH_get0_pqg(const DH *dh,
* backward compatibility: const BIGNUM **p, const BIGNUM **q, const BIGNUM **g);
*/ int DH_set0_pqg(DH *dh, BIGNUM *p, BIGNUM *q, BIGNUM *g);
# define DH_CHECK_P_NOT_STRONG_PRIME DH_CHECK_P_NOT_SAFE_PRIME void DH_get0_key(const DH *dh,
const BIGNUM **pub_key, const BIGNUM **priv_key);
# define d2i_DHparams_fp(fp,x) (DH *)ASN1_d2i_fp((char *(*)())DH_new, \ int DH_set0_key(DH *dh, BIGNUM *pub_key, BIGNUM *priv_key);
(char *(*)())d2i_DHparams,(fp),(unsigned char **)(x)) const BIGNUM *DH_get0_p(const DH *dh);
# define i2d_DHparams_fp(fp,x) ASN1_i2d_fp(i2d_DHparams,(fp), \ const BIGNUM *DH_get0_q(const DH *dh);
(unsigned char *)(x)) const BIGNUM *DH_get0_g(const DH *dh);
# define d2i_DHparams_bio(bp,x) ASN1_d2i_bio_of(DH,DH_new,d2i_DHparams,bp,x) const BIGNUM *DH_get0_priv_key(const DH *dh);
# define i2d_DHparams_bio(bp,x) ASN1_i2d_bio_of_const(DH,i2d_DHparams,bp,x) const BIGNUM *DH_get0_pub_key(const DH *dh);
void DH_clear_flags(DH *dh, int flags);
DH *DHparams_dup(DH *); int DH_test_flags(const DH *dh, int flags);
void DH_set_flags(DH *dh, int flags);
const DH_METHOD *DH_OpenSSL(void); ENGINE *DH_get0_engine(DH *d);
long DH_get_length(const DH *dh);
void DH_set_default_method(const DH_METHOD *meth); int DH_set_length(DH *dh, long length);
const DH_METHOD *DH_get_default_method(void);
int DH_set_method(DH *dh, const DH_METHOD *meth); DH_METHOD *DH_meth_new(const char *name, int flags);
DH *DH_new_method(ENGINE *engine); void DH_meth_free(DH_METHOD *dhm);
DH_METHOD *DH_meth_dup(const DH_METHOD *dhm);
DH *DH_new(void); const char *DH_meth_get0_name(const DH_METHOD *dhm);
void DH_free(DH *dh); int DH_meth_set1_name(DH_METHOD *dhm, const char *name);
int DH_up_ref(DH *dh); int DH_meth_get_flags(const DH_METHOD *dhm);
int DH_size(const DH *dh); int DH_meth_set_flags(DH_METHOD *dhm, int flags);
int DH_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, void *DH_meth_get0_app_data(const DH_METHOD *dhm);
CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func); int DH_meth_set0_app_data(DH_METHOD *dhm, void *app_data);
int DH_set_ex_data(DH *d, int idx, void *arg); int (*DH_meth_get_generate_key(const DH_METHOD *dhm)) (DH *);
void *DH_get_ex_data(DH *d, int idx); int DH_meth_set_generate_key(DH_METHOD *dhm, int (*generate_key) (DH *));
int (*DH_meth_get_compute_key(const DH_METHOD *dhm))
/* Deprecated version */ (unsigned char *key, const BIGNUM *pub_key, DH *dh);
# ifndef OPENSSL_NO_DEPRECATED int DH_meth_set_compute_key(DH_METHOD *dhm,
DH *DH_generate_parameters(int prime_len, int generator, int (*compute_key) (unsigned char *key, const BIGNUM *pub_key, DH *dh));
void (*callback) (int, int, void *), void *cb_arg); int (*DH_meth_get_bn_mod_exp(const DH_METHOD *dhm))
# endif /* !defined(OPENSSL_NO_DEPRECATED) */ (const DH *, BIGNUM *, const BIGNUM *, const BIGNUM *, const BIGNUM *,
BN_CTX *, BN_MONT_CTX *);
/* New version */ int DH_meth_set_bn_mod_exp(DH_METHOD *dhm,
int DH_generate_parameters_ex(DH *dh, int prime_len, int generator, int (*bn_mod_exp) (const DH *, BIGNUM *, const BIGNUM *, const BIGNUM *,
BN_GENCB *cb); const BIGNUM *, BN_CTX *, BN_MONT_CTX *));
int (*DH_meth_get_init(const DH_METHOD *dhm))(DH *);
int DH_check(const DH *dh, int *codes); int DH_meth_set_init(DH_METHOD *dhm, int (*init)(DH *));
int DH_check_pub_key(const DH *dh, const BIGNUM *pub_key, int *codes); int (*DH_meth_get_finish(const DH_METHOD *dhm)) (DH *);
int DH_generate_key(DH *dh); int DH_meth_set_finish(DH_METHOD *dhm, int (*finish) (DH *));
int DH_compute_key(unsigned char *key, const BIGNUM *pub_key, DH *dh); int (*DH_meth_get_generate_params(const DH_METHOD *dhm))
int DH_compute_key_padded(unsigned char *key, const BIGNUM *pub_key, DH *dh); (DH *, int, int, BN_GENCB *);
DH *d2i_DHparams(DH **a, const unsigned char **pp, long length); int DH_meth_set_generate_params(DH_METHOD *dhm,
int i2d_DHparams(const DH *a, unsigned char **pp); int (*generate_params) (DH *, int, int, BN_GENCB *));
DH *d2i_DHxparams(DH **a, const unsigned char **pp, long length);
int i2d_DHxparams(const DH *a, unsigned char **pp);
# ifndef OPENSSL_NO_FP_API # define EVP_PKEY_CTX_set_dh_paramgen_prime_len(ctx, len) \
int DHparams_print_fp(FILE *fp, const DH *x); EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DH, EVP_PKEY_OP_PARAMGEN, \
# endif EVP_PKEY_CTRL_DH_PARAMGEN_PRIME_LEN, len, NULL)
# ifndef OPENSSL_NO_BIO
int DHparams_print(BIO *bp, const DH *x); # define EVP_PKEY_CTX_set_dh_paramgen_subprime_len(ctx, len) \
# else EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DH, EVP_PKEY_OP_PARAMGEN, \
int DHparams_print(char *bp, const DH *x); EVP_PKEY_CTRL_DH_PARAMGEN_SUBPRIME_LEN, len, NULL)
# endif
# define EVP_PKEY_CTX_set_dh_paramgen_type(ctx, typ) \
/* RFC 5114 parameters */ EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DH, EVP_PKEY_OP_PARAMGEN, \
DH *DH_get_1024_160(void); EVP_PKEY_CTRL_DH_PARAMGEN_TYPE, typ, NULL)
DH *DH_get_2048_224(void);
DH *DH_get_2048_256(void); # define EVP_PKEY_CTX_set_dh_paramgen_generator(ctx, gen) \
EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DH, EVP_PKEY_OP_PARAMGEN, \
/* RFC2631 KDF */ EVP_PKEY_CTRL_DH_PARAMGEN_GENERATOR, gen, NULL)
int DH_KDF_X9_42(unsigned char *out, size_t outlen,
const unsigned char *Z, size_t Zlen, # define EVP_PKEY_CTX_set_dh_rfc5114(ctx, gen) \
ASN1_OBJECT *key_oid, EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, EVP_PKEY_OP_PARAMGEN, \
const unsigned char *ukm, size_t ukmlen, const EVP_MD *md); EVP_PKEY_CTRL_DH_RFC5114, gen, NULL)
# define EVP_PKEY_CTX_set_dh_paramgen_prime_len(ctx, len) \ # define EVP_PKEY_CTX_set_dhx_rfc5114(ctx, gen) \
EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DH, EVP_PKEY_OP_PARAMGEN, \ EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, EVP_PKEY_OP_PARAMGEN, \
EVP_PKEY_CTRL_DH_PARAMGEN_PRIME_LEN, len, NULL) EVP_PKEY_CTRL_DH_RFC5114, gen, NULL)
# define EVP_PKEY_CTX_set_dh_paramgen_subprime_len(ctx, len) \ # define EVP_PKEY_CTX_set_dh_nid(ctx, nid) \
EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DH, EVP_PKEY_OP_PARAMGEN, \ EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DH, \
EVP_PKEY_CTRL_DH_PARAMGEN_SUBPRIME_LEN, len, NULL) EVP_PKEY_OP_PARAMGEN | EVP_PKEY_OP_KEYGEN, \
EVP_PKEY_CTRL_DH_NID, nid, NULL)
# define EVP_PKEY_CTX_set_dh_paramgen_type(ctx, typ) \
EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DH, EVP_PKEY_OP_PARAMGEN, \ # define EVP_PKEY_CTX_set_dh_pad(ctx, pad) \
EVP_PKEY_CTRL_DH_PARAMGEN_TYPE, typ, NULL) EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DH, EVP_PKEY_OP_DERIVE, \
EVP_PKEY_CTRL_DH_PAD, pad, NULL)
# define EVP_PKEY_CTX_set_dh_paramgen_generator(ctx, gen) \
EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DH, EVP_PKEY_OP_PARAMGEN, \ # define EVP_PKEY_CTX_set_dh_kdf_type(ctx, kdf) \
EVP_PKEY_CTRL_DH_PARAMGEN_GENERATOR, gen, NULL) EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \
EVP_PKEY_OP_DERIVE, \
# define EVP_PKEY_CTX_set_dh_rfc5114(ctx, gen) \ EVP_PKEY_CTRL_DH_KDF_TYPE, kdf, NULL)
EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, EVP_PKEY_OP_PARAMGEN, \
EVP_PKEY_CTRL_DH_RFC5114, gen, NULL) # define EVP_PKEY_CTX_get_dh_kdf_type(ctx) \
EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \
# define EVP_PKEY_CTX_set_dhx_rfc5114(ctx, gen) \ EVP_PKEY_OP_DERIVE, \
EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, EVP_PKEY_OP_PARAMGEN, \ EVP_PKEY_CTRL_DH_KDF_TYPE, -2, NULL)
EVP_PKEY_CTRL_DH_RFC5114, gen, NULL)
# define EVP_PKEY_CTX_set0_dh_kdf_oid(ctx, oid) \
# define EVP_PKEY_CTX_set_dh_kdf_type(ctx, kdf) \ EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \
EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \ EVP_PKEY_OP_DERIVE, \
EVP_PKEY_OP_DERIVE, \ EVP_PKEY_CTRL_DH_KDF_OID, 0, (void *)(oid))
EVP_PKEY_CTRL_DH_KDF_TYPE, kdf, NULL)
# define EVP_PKEY_CTX_get0_dh_kdf_oid(ctx, poid) \
# define EVP_PKEY_CTX_get_dh_kdf_type(ctx) \ EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \
EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \ EVP_PKEY_OP_DERIVE, \
EVP_PKEY_OP_DERIVE, \ EVP_PKEY_CTRL_GET_DH_KDF_OID, 0, (void *)(poid))
EVP_PKEY_CTRL_DH_KDF_TYPE, -2, NULL)
# define EVP_PKEY_CTX_set_dh_kdf_md(ctx, md) \
# define EVP_PKEY_CTX_set0_dh_kdf_oid(ctx, oid) \ EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \
EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \ EVP_PKEY_OP_DERIVE, \
EVP_PKEY_OP_DERIVE, \ EVP_PKEY_CTRL_DH_KDF_MD, 0, (void *)(md))
EVP_PKEY_CTRL_DH_KDF_OID, 0, (void *)oid)
# define EVP_PKEY_CTX_get_dh_kdf_md(ctx, pmd) \
# define EVP_PKEY_CTX_get0_dh_kdf_oid(ctx, poid) \ EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \
EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \ EVP_PKEY_OP_DERIVE, \
EVP_PKEY_OP_DERIVE, \ EVP_PKEY_CTRL_GET_DH_KDF_MD, 0, (void *)(pmd))
EVP_PKEY_CTRL_GET_DH_KDF_OID, 0, (void *)poid)
# define EVP_PKEY_CTX_set_dh_kdf_outlen(ctx, len) \
# define EVP_PKEY_CTX_set_dh_kdf_md(ctx, md) \ EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \
EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \ EVP_PKEY_OP_DERIVE, \
EVP_PKEY_OP_DERIVE, \ EVP_PKEY_CTRL_DH_KDF_OUTLEN, len, NULL)
EVP_PKEY_CTRL_DH_KDF_MD, 0, (void *)md)
# define EVP_PKEY_CTX_get_dh_kdf_outlen(ctx, plen) \
# define EVP_PKEY_CTX_get_dh_kdf_md(ctx, pmd) \ EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \
EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \ EVP_PKEY_OP_DERIVE, \
EVP_PKEY_OP_DERIVE, \ EVP_PKEY_CTRL_GET_DH_KDF_OUTLEN, 0, (void *)(plen))
EVP_PKEY_CTRL_GET_DH_KDF_MD, 0, (void *)pmd)
# define EVP_PKEY_CTX_set0_dh_kdf_ukm(ctx, p, plen) \
# define EVP_PKEY_CTX_set_dh_kdf_outlen(ctx, len) \ EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \
EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \ EVP_PKEY_OP_DERIVE, \
EVP_PKEY_OP_DERIVE, \ EVP_PKEY_CTRL_DH_KDF_UKM, plen, (void *)(p))
EVP_PKEY_CTRL_DH_KDF_OUTLEN, len, NULL)
# define EVP_PKEY_CTX_get0_dh_kdf_ukm(ctx, p) \
# define EVP_PKEY_CTX_get_dh_kdf_outlen(ctx, plen) \ EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \
EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \ EVP_PKEY_OP_DERIVE, \
EVP_PKEY_OP_DERIVE, \ EVP_PKEY_CTRL_GET_DH_KDF_UKM, 0, (void *)(p))
EVP_PKEY_CTRL_GET_DH_KDF_OUTLEN, 0, (void *)plen)
# define EVP_PKEY_CTRL_DH_PARAMGEN_PRIME_LEN (EVP_PKEY_ALG_CTRL + 1)
# define EVP_PKEY_CTX_set0_dh_kdf_ukm(ctx, p, plen) \ # define EVP_PKEY_CTRL_DH_PARAMGEN_GENERATOR (EVP_PKEY_ALG_CTRL + 2)
EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \ # define EVP_PKEY_CTRL_DH_RFC5114 (EVP_PKEY_ALG_CTRL + 3)
EVP_PKEY_OP_DERIVE, \ # define EVP_PKEY_CTRL_DH_PARAMGEN_SUBPRIME_LEN (EVP_PKEY_ALG_CTRL + 4)
EVP_PKEY_CTRL_DH_KDF_UKM, plen, (void *)p) # define EVP_PKEY_CTRL_DH_PARAMGEN_TYPE (EVP_PKEY_ALG_CTRL + 5)
# define EVP_PKEY_CTRL_DH_KDF_TYPE (EVP_PKEY_ALG_CTRL + 6)
# define EVP_PKEY_CTX_get0_dh_kdf_ukm(ctx, p) \ # define EVP_PKEY_CTRL_DH_KDF_MD (EVP_PKEY_ALG_CTRL + 7)
EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \ # define EVP_PKEY_CTRL_GET_DH_KDF_MD (EVP_PKEY_ALG_CTRL + 8)
EVP_PKEY_OP_DERIVE, \ # define EVP_PKEY_CTRL_DH_KDF_OUTLEN (EVP_PKEY_ALG_CTRL + 9)
EVP_PKEY_CTRL_GET_DH_KDF_UKM, 0, (void *)p) # define EVP_PKEY_CTRL_GET_DH_KDF_OUTLEN (EVP_PKEY_ALG_CTRL + 10)
# define EVP_PKEY_CTRL_DH_KDF_UKM (EVP_PKEY_ALG_CTRL + 11)
# define EVP_PKEY_CTRL_DH_PARAMGEN_PRIME_LEN (EVP_PKEY_ALG_CTRL + 1) # define EVP_PKEY_CTRL_GET_DH_KDF_UKM (EVP_PKEY_ALG_CTRL + 12)
# define EVP_PKEY_CTRL_DH_PARAMGEN_GENERATOR (EVP_PKEY_ALG_CTRL + 2) # define EVP_PKEY_CTRL_DH_KDF_OID (EVP_PKEY_ALG_CTRL + 13)
# define EVP_PKEY_CTRL_DH_RFC5114 (EVP_PKEY_ALG_CTRL + 3) # define EVP_PKEY_CTRL_GET_DH_KDF_OID (EVP_PKEY_ALG_CTRL + 14)
# define EVP_PKEY_CTRL_DH_PARAMGEN_SUBPRIME_LEN (EVP_PKEY_ALG_CTRL + 4) # define EVP_PKEY_CTRL_DH_NID (EVP_PKEY_ALG_CTRL + 15)
# define EVP_PKEY_CTRL_DH_PARAMGEN_TYPE (EVP_PKEY_ALG_CTRL + 5) # define EVP_PKEY_CTRL_DH_PAD (EVP_PKEY_ALG_CTRL + 16)
# define EVP_PKEY_CTRL_DH_KDF_TYPE (EVP_PKEY_ALG_CTRL + 6)
# define EVP_PKEY_CTRL_DH_KDF_MD (EVP_PKEY_ALG_CTRL + 7) /* KDF types */
# define EVP_PKEY_CTRL_GET_DH_KDF_MD (EVP_PKEY_ALG_CTRL + 8) # define EVP_PKEY_DH_KDF_NONE 1
# define EVP_PKEY_CTRL_DH_KDF_OUTLEN (EVP_PKEY_ALG_CTRL + 9) # ifndef OPENSSL_NO_CMS
# define EVP_PKEY_CTRL_GET_DH_KDF_OUTLEN (EVP_PKEY_ALG_CTRL + 10) # define EVP_PKEY_DH_KDF_X9_42 2
# define EVP_PKEY_CTRL_DH_KDF_UKM (EVP_PKEY_ALG_CTRL + 11) # endif
# define EVP_PKEY_CTRL_GET_DH_KDF_UKM (EVP_PKEY_ALG_CTRL + 12)
# define EVP_PKEY_CTRL_DH_KDF_OID (EVP_PKEY_ALG_CTRL + 13)
# define EVP_PKEY_CTRL_GET_DH_KDF_OID (EVP_PKEY_ALG_CTRL + 14) # ifdef __cplusplus
}
/* KDF types */ # endif
# define EVP_PKEY_DH_KDF_NONE 1 # endif
# define EVP_PKEY_DH_KDF_X9_42 2 #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_DH_strings(void);
/* Error codes for the DH functions. */
/* Function codes. */
# define DH_F_COMPUTE_KEY 102
# define DH_F_DHPARAMS_PRINT_FP 101
# define DH_F_DH_BUILTIN_GENPARAMS 106
# define DH_F_DH_CMS_DECRYPT 117
# define DH_F_DH_CMS_SET_PEERKEY 118
# define DH_F_DH_CMS_SET_SHARED_INFO 119
# define DH_F_DH_COMPUTE_KEY 114
# define DH_F_DH_GENERATE_KEY 115
# define DH_F_DH_GENERATE_PARAMETERS_EX 116
# define DH_F_DH_NEW_METHOD 105
# define DH_F_DH_PARAM_DECODE 107
# define DH_F_DH_PRIV_DECODE 110
# define DH_F_DH_PRIV_ENCODE 111
# define DH_F_DH_PUB_DECODE 108
# define DH_F_DH_PUB_ENCODE 109
# define DH_F_DO_DH_PRINT 100
# define DH_F_GENERATE_KEY 103
# define DH_F_GENERATE_PARAMETERS 104
# define DH_F_PKEY_DH_DERIVE 112
# define DH_F_PKEY_DH_KEYGEN 113
/* Reason codes. */
# define DH_R_BAD_GENERATOR 101
# define DH_R_BN_DECODE_ERROR 109
# define DH_R_BN_ERROR 106
# define DH_R_DECODE_ERROR 104
# define DH_R_INVALID_PUBKEY 102
# define DH_R_KDF_PARAMETER_ERROR 112
# define DH_R_KEYS_NOT_SET 108
# define DH_R_KEY_SIZE_TOO_SMALL 110
# define DH_R_MODULUS_TOO_LARGE 103
# define DH_R_NON_FIPS_METHOD 111
# define DH_R_NO_PARAMETERS_SET 107
# define DH_R_NO_PRIVATE_VALUE 100
# define DH_R_PARAMETER_ENCODING_ERROR 105
# define DH_R_PEER_KEY_ERROR 113
# define DH_R_SHARED_INFO_ERROR 114
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,84 @@
/*
* Generated by util/mkerr.pl DO NOT EDIT
* Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/license.html
*/
#ifndef HEADER_DHERR_H
# define HEADER_DHERR_H
# include <openssl/opensslconf.h>
# ifndef OPENSSL_NO_DH
# ifdef __cplusplus
extern "C"
# endif
int ERR_load_DH_strings(void);
/*
* DH function codes.
*/
# define DH_F_COMPUTE_KEY 102
# define DH_F_DHPARAMS_PRINT_FP 101
# define DH_F_DH_BUILTIN_GENPARAMS 106
# define DH_F_DH_CHECK_EX 121
# define DH_F_DH_CHECK_PARAMS_EX 122
# define DH_F_DH_CHECK_PUB_KEY_EX 123
# define DH_F_DH_CMS_DECRYPT 114
# define DH_F_DH_CMS_SET_PEERKEY 115
# define DH_F_DH_CMS_SET_SHARED_INFO 116
# define DH_F_DH_METH_DUP 117
# define DH_F_DH_METH_NEW 118
# define DH_F_DH_METH_SET1_NAME 119
# define DH_F_DH_NEW_BY_NID 104
# define DH_F_DH_NEW_METHOD 105
# define DH_F_DH_PARAM_DECODE 107
# define DH_F_DH_PKEY_PUBLIC_CHECK 124
# define DH_F_DH_PRIV_DECODE 110
# define DH_F_DH_PRIV_ENCODE 111
# define DH_F_DH_PUB_DECODE 108
# define DH_F_DH_PUB_ENCODE 109
# define DH_F_DO_DH_PRINT 100
# define DH_F_GENERATE_KEY 103
# define DH_F_PKEY_DH_CTRL_STR 120
# define DH_F_PKEY_DH_DERIVE 112
# define DH_F_PKEY_DH_INIT 125
# define DH_F_PKEY_DH_KEYGEN 113
/*
* DH reason codes.
*/
# define DH_R_BAD_GENERATOR 101
# define DH_R_BN_DECODE_ERROR 109
# define DH_R_BN_ERROR 106
# define DH_R_CHECK_INVALID_J_VALUE 115
# define DH_R_CHECK_INVALID_Q_VALUE 116
# define DH_R_CHECK_PUBKEY_INVALID 122
# define DH_R_CHECK_PUBKEY_TOO_LARGE 123
# define DH_R_CHECK_PUBKEY_TOO_SMALL 124
# define DH_R_CHECK_P_NOT_PRIME 117
# define DH_R_CHECK_P_NOT_SAFE_PRIME 118
# define DH_R_CHECK_Q_NOT_PRIME 119
# define DH_R_DECODE_ERROR 104
# define DH_R_INVALID_PARAMETER_NAME 110
# define DH_R_INVALID_PARAMETER_NID 114
# define DH_R_INVALID_PUBKEY 102
# define DH_R_KDF_PARAMETER_ERROR 112
# define DH_R_KEYS_NOT_SET 108
# define DH_R_MISSING_PUBKEY 125
# define DH_R_MODULUS_TOO_LARGE 103
# define DH_R_NOT_SUITABLE_GENERATOR 120
# define DH_R_NO_PARAMETERS_SET 107
# define DH_R_NO_PRIVATE_VALUE 100
# define DH_R_PARAMETER_ENCODING_ERROR 105
# define DH_R_PEER_KEY_ERROR 111
# define DH_R_SHARED_INFO_ERROR 113
# define DH_R_UNABLE_TO_CHECK_GENERATOR 121
# endif
#endif

View File

@ -1,332 +1,238 @@
/* crypto/dsa/dsa.h */ /*
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
* All rights reserved. *
* * Licensed under the OpenSSL license (the "License"). You may not use
* This package is an SSL implementation written * this file except in compliance with the License. You can obtain a copy
* by Eric Young (eay@cryptsoft.com). * in the file LICENSE in the source distribution or at
* The implementation was written so as to conform with Netscapes SSL. * https://www.openssl.org/source/license.html
* */
* This library is free for commercial and non-commercial use as long as
* the following conditions are aheared to. The following conditions #ifndef HEADER_DSA_H
* apply to all code found in this distribution, be it the RC4, RSA, # define HEADER_DSA_H
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
* included with this distribution is covered by the same copyright terms # include <openssl/opensslconf.h>
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
* # ifndef OPENSSL_NO_DSA
* Copyright remains Eric Young's, and as such any Copyright notices in # ifdef __cplusplus
* the code are not to be removed. extern "C" {
* If this package is used in a product, Eric Young should be given attribution # endif
* as the author of the parts of the library used. # include <openssl/e_os2.h>
* This can be in the form of a textual message at program startup or # include <openssl/bio.h>
* in documentation (online or textual) provided with the package. # include <openssl/crypto.h>
* # include <openssl/ossl_typ.h>
* Redistribution and use in source and binary forms, with or without # include <openssl/bn.h>
* modification, are permitted provided that the following conditions # if OPENSSL_API_COMPAT < 0x10100000L
* are met: # include <openssl/dh.h>
* 1. Redistributions of source code must retain the copyright # endif
* notice, this list of conditions and the following disclaimer. # include <openssl/dsaerr.h>
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the # ifndef OPENSSL_DSA_MAX_MODULUS_BITS
* documentation and/or other materials provided with the distribution. # define OPENSSL_DSA_MAX_MODULUS_BITS 10000
* 3. All advertising materials mentioning features or use of this software # endif
* must display the following acknowledgement:
* "This product includes cryptographic software written by # define OPENSSL_DSA_FIPS_MIN_MODULUS_BITS 1024
* Eric Young (eay@cryptsoft.com)"
* The word 'cryptographic' can be left out if the rouines from the library # define DSA_FLAG_CACHE_MONT_P 0x01
* being used are not cryptographic related :-). # if OPENSSL_API_COMPAT < 0x10100000L
* 4. If you include any Windows specific code (or a derivative thereof) from /*
* the apps directory (application code) you must include an acknowledgement: * Does nothing. Previously this switched off constant time behaviour.
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" */
* # define DSA_FLAG_NO_EXP_CONSTTIME 0x00
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND # endif
* 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 * If this flag is set the DSA method is FIPS compliant and can be used in
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * FIPS mode. This is set in the validated module method. If an application
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * sets this flag in its own methods it is its responsibility to ensure the
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * result is compliant.
* 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 # define DSA_FLAG_FIPS_METHOD 0x0400
* SUCH DAMAGE.
* /*
* The licence and distribution terms for any publically available version or * If this flag is set the operations normally disabled in FIPS mode are
* derivative of this code cannot be changed. i.e. this code cannot simply be * permitted it is then the applications responsibility to ensure that the
* copied and put under another distribution licence * usage is compliant.
* [including the GNU Public Licence.] */
*/
# define DSA_FLAG_NON_FIPS_ALLOW 0x0400
/* # define DSA_FLAG_FIPS_CHECKED 0x0800
* The DSS routines are based on patches supplied by
* Steven Schoch <schoch@sheba.arc.nasa.gov>. He basically did the /* Already defined in ossl_typ.h */
* work and I have just tweaked them a little to fit into my /* typedef struct dsa_st DSA; */
* stylistic vision for SSLeay :-) */ /* typedef struct dsa_method DSA_METHOD; */
#ifndef HEADER_DSA_H typedef struct DSA_SIG_st DSA_SIG;
# define HEADER_DSA_H
# define d2i_DSAparams_fp(fp,x) (DSA *)ASN1_d2i_fp((char *(*)())DSA_new, \
# include <openssl/e_os2.h> (char *(*)())d2i_DSAparams,(fp),(unsigned char **)(x))
# define i2d_DSAparams_fp(fp,x) ASN1_i2d_fp(i2d_DSAparams,(fp), \
# ifdef OPENSSL_NO_DSA (unsigned char *)(x))
# error DSA is disabled. # define d2i_DSAparams_bio(bp,x) ASN1_d2i_bio_of(DSA,DSA_new,d2i_DSAparams,bp,x)
# endif # define i2d_DSAparams_bio(bp,x) ASN1_i2d_bio_of_const(DSA,i2d_DSAparams,bp,x)
# ifndef OPENSSL_NO_BIO DSA *DSAparams_dup(DSA *x);
# include <openssl/bio.h> DSA_SIG *DSA_SIG_new(void);
# endif void DSA_SIG_free(DSA_SIG *a);
# include <openssl/crypto.h> int i2d_DSA_SIG(const DSA_SIG *a, unsigned char **pp);
# include <openssl/ossl_typ.h> DSA_SIG *d2i_DSA_SIG(DSA_SIG **v, const unsigned char **pp, long length);
void DSA_SIG_get0(const DSA_SIG *sig, const BIGNUM **pr, const BIGNUM **ps);
# ifndef OPENSSL_NO_DEPRECATED int DSA_SIG_set0(DSA_SIG *sig, BIGNUM *r, BIGNUM *s);
# include <openssl/bn.h>
# ifndef OPENSSL_NO_DH DSA_SIG *DSA_do_sign(const unsigned char *dgst, int dlen, DSA *dsa);
# include <openssl/dh.h> int DSA_do_verify(const unsigned char *dgst, int dgst_len,
# endif DSA_SIG *sig, DSA *dsa);
# endif
const DSA_METHOD *DSA_OpenSSL(void);
# ifndef OPENSSL_DSA_MAX_MODULUS_BITS
# define OPENSSL_DSA_MAX_MODULUS_BITS 10000 void DSA_set_default_method(const DSA_METHOD *);
# endif const DSA_METHOD *DSA_get_default_method(void);
int DSA_set_method(DSA *dsa, const DSA_METHOD *);
# define DSA_FLAG_CACHE_MONT_P 0x01 const DSA_METHOD *DSA_get_method(DSA *d);
/*
* new with 0.9.7h; the built-in DSA implementation now uses constant time DSA *DSA_new(void);
* modular exponentiation for secret exponents by default. This flag causes DSA *DSA_new_method(ENGINE *engine);
* the faster variable sliding window method to be used for all exponents. void DSA_free(DSA *r);
*/ /* "up" the DSA object's reference count */
# define DSA_FLAG_NO_EXP_CONSTTIME 0x02 int DSA_up_ref(DSA *r);
int DSA_size(const DSA *);
/* int DSA_bits(const DSA *d);
* If this flag is set the DSA method is FIPS compliant and can be used in int DSA_security_bits(const DSA *d);
* FIPS mode. This is set in the validated module method. If an application /* next 4 return -1 on error */
* sets this flag in its own methods it is its reposibility to ensure the DEPRECATEDIN_1_2_0(int DSA_sign_setup(DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp, BIGNUM **rp))
* result is compliant. 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,
# define DSA_FLAG_FIPS_METHOD 0x0400 const unsigned char *sigbuf, int siglen, DSA *dsa);
#define DSA_get_ex_new_index(l, p, newf, dupf, freef) \
/* CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_DSA, l, p, newf, dupf, freef)
* If this flag is set the operations normally disabled in FIPS mode are int DSA_set_ex_data(DSA *d, int idx, void *arg);
* permitted it is then the applications responsibility to ensure that the void *DSA_get_ex_data(DSA *d, int idx);
* usage is compliant.
*/ DSA *d2i_DSAPublicKey(DSA **a, const unsigned char **pp, long length);
DSA *d2i_DSAPrivateKey(DSA **a, const unsigned char **pp, long length);
# define DSA_FLAG_NON_FIPS_ALLOW 0x0400 DSA *d2i_DSAparams(DSA **a, const unsigned char **pp, long length);
#ifdef __cplusplus /* Deprecated version */
extern "C" { DEPRECATEDIN_0_9_8(DSA *DSA_generate_parameters(int bits,
#endif unsigned char *seed,
int seed_len,
/* Already defined in ossl_typ.h */ int *counter_ret,
/* typedef struct dsa_st DSA; */ unsigned long *h_ret, void
/* typedef struct dsa_method DSA_METHOD; */ (*callback) (int, int,
void *),
typedef struct DSA_SIG_st { void *cb_arg))
BIGNUM *r;
BIGNUM *s; /* New version */
} DSA_SIG; int DSA_generate_parameters_ex(DSA *dsa, int bits,
const unsigned char *seed, int seed_len,
struct dsa_method { int *counter_ret, unsigned long *h_ret,
const char *name; BN_GENCB *cb);
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, int DSA_generate_key(DSA *a);
BIGNUM **rp); int i2d_DSAPublicKey(const DSA *a, unsigned char **pp);
int (*dsa_do_verify) (const unsigned char *dgst, int dgst_len, int i2d_DSAPrivateKey(const DSA *a, unsigned char **pp);
DSA_SIG *sig, DSA *dsa); int i2d_DSAparams(const DSA *a, unsigned char **pp);
int (*dsa_mod_exp) (DSA *dsa, BIGNUM *rr, BIGNUM *a1, BIGNUM *p1,
BIGNUM *a2, BIGNUM *p2, BIGNUM *m, BN_CTX *ctx, int DSAparams_print(BIO *bp, const DSA *x);
BN_MONT_CTX *in_mont); int DSA_print(BIO *bp, const DSA *x, int off);
/* Can be null */ # ifndef OPENSSL_NO_STDIO
int (*bn_mod_exp) (DSA *dsa, BIGNUM *r, BIGNUM *a, const BIGNUM *p, int DSAparams_print_fp(FILE *fp, const DSA *x);
const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx); int DSA_print_fp(FILE *bp, const DSA *x, int off);
int (*init) (DSA *dsa); # endif
int (*finish) (DSA *dsa);
int flags; # define DSS_prime_checks 64
char *app_data; /*
/* If this is non-NULL, it is used to generate DSA parameters */ * Primality test according to FIPS PUB 186-4, Appendix C.3. Since we only
int (*dsa_paramgen) (DSA *dsa, int bits, * have one value here we set the number of checks to 64 which is the 128 bit
const unsigned char *seed, int seed_len, * security level that is the highest level and valid for creating a 3072 bit
int *counter_ret, unsigned long *h_ret, * DSA key.
BN_GENCB *cb); */
/* If this is non-NULL, it is used to generate DSA keys */ # define DSA_is_prime(n, callback, cb_arg) \
int (*dsa_keygen) (DSA *dsa); BN_is_prime(n, DSS_prime_checks, callback, NULL, cb_arg)
};
# ifndef OPENSSL_NO_DH
struct dsa_st { /*
/* * Convert DSA structure (key or just parameters) into DH structure (be
* This first variable is used to pick up errors where a DSA is passed * careful to avoid small subgroup attacks when using this!)
* instead of of a EVP_PKEY */
*/ DH *DSA_dup_DH(const DSA *r);
int pad; # endif
long version;
int write_params; # define EVP_PKEY_CTX_set_dsa_paramgen_bits(ctx, nbits) \
BIGNUM *p; EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DSA, EVP_PKEY_OP_PARAMGEN, \
BIGNUM *q; /* == 20 */ EVP_PKEY_CTRL_DSA_PARAMGEN_BITS, nbits, NULL)
BIGNUM *g;
BIGNUM *pub_key; /* y public key */ # define EVP_PKEY_CTRL_DSA_PARAMGEN_BITS (EVP_PKEY_ALG_CTRL + 1)
BIGNUM *priv_key; /* x private key */ # define EVP_PKEY_CTRL_DSA_PARAMGEN_Q_BITS (EVP_PKEY_ALG_CTRL + 2)
BIGNUM *kinv; /* Signing pre-calc */ # define EVP_PKEY_CTRL_DSA_PARAMGEN_MD (EVP_PKEY_ALG_CTRL + 3)
BIGNUM *r; /* Signing pre-calc */
int flags; void DSA_get0_pqg(const DSA *d,
/* Normally used to cache montgomery values */ const BIGNUM **p, const BIGNUM **q, const BIGNUM **g);
BN_MONT_CTX *method_mont_p; int DSA_set0_pqg(DSA *d, BIGNUM *p, BIGNUM *q, BIGNUM *g);
int references; void DSA_get0_key(const DSA *d,
CRYPTO_EX_DATA ex_data; const BIGNUM **pub_key, const BIGNUM **priv_key);
const DSA_METHOD *meth; int DSA_set0_key(DSA *d, BIGNUM *pub_key, BIGNUM *priv_key);
/* functional reference if 'meth' is ENGINE-provided */ const BIGNUM *DSA_get0_p(const DSA *d);
ENGINE *engine; const BIGNUM *DSA_get0_q(const DSA *d);
}; const BIGNUM *DSA_get0_g(const DSA *d);
const BIGNUM *DSA_get0_pub_key(const DSA *d);
# define d2i_DSAparams_fp(fp,x) (DSA *)ASN1_d2i_fp((char *(*)())DSA_new, \ const BIGNUM *DSA_get0_priv_key(const DSA *d);
(char *(*)())d2i_DSAparams,(fp),(unsigned char **)(x)) void DSA_clear_flags(DSA *d, int flags);
# define i2d_DSAparams_fp(fp,x) ASN1_i2d_fp(i2d_DSAparams,(fp), \ int DSA_test_flags(const DSA *d, int flags);
(unsigned char *)(x)) void DSA_set_flags(DSA *d, int flags);
# define d2i_DSAparams_bio(bp,x) ASN1_d2i_bio_of(DSA,DSA_new,d2i_DSAparams,bp,x) ENGINE *DSA_get0_engine(DSA *d);
# define i2d_DSAparams_bio(bp,x) ASN1_i2d_bio_of_const(DSA,i2d_DSAparams,bp,x)
DSA_METHOD *DSA_meth_new(const char *name, int flags);
DSA *DSAparams_dup(DSA *x); void DSA_meth_free(DSA_METHOD *dsam);
DSA_SIG *DSA_SIG_new(void); DSA_METHOD *DSA_meth_dup(const DSA_METHOD *dsam);
void DSA_SIG_free(DSA_SIG *a); const char *DSA_meth_get0_name(const DSA_METHOD *dsam);
int i2d_DSA_SIG(const DSA_SIG *a, unsigned char **pp); int DSA_meth_set1_name(DSA_METHOD *dsam, const char *name);
DSA_SIG *d2i_DSA_SIG(DSA_SIG **v, const unsigned char **pp, long length); int DSA_meth_get_flags(const DSA_METHOD *dsam);
int DSA_meth_set_flags(DSA_METHOD *dsam, int flags);
DSA_SIG *DSA_do_sign(const unsigned char *dgst, int dlen, DSA *dsa); void *DSA_meth_get0_app_data(const DSA_METHOD *dsam);
int DSA_do_verify(const unsigned char *dgst, int dgst_len, int DSA_meth_set0_app_data(DSA_METHOD *dsam, void *app_data);
DSA_SIG *sig, DSA *dsa); DSA_SIG *(*DSA_meth_get_sign(const DSA_METHOD *dsam))
(const unsigned char *, int, DSA *);
const DSA_METHOD *DSA_OpenSSL(void); int DSA_meth_set_sign(DSA_METHOD *dsam,
DSA_SIG *(*sign) (const unsigned char *, int, DSA *));
void DSA_set_default_method(const DSA_METHOD *); int (*DSA_meth_get_sign_setup(const DSA_METHOD *dsam))
const DSA_METHOD *DSA_get_default_method(void); (DSA *, BN_CTX *, BIGNUM **, BIGNUM **);
int DSA_set_method(DSA *dsa, const DSA_METHOD *); int DSA_meth_set_sign_setup(DSA_METHOD *dsam,
int (*sign_setup) (DSA *, BN_CTX *, BIGNUM **, BIGNUM **));
DSA *DSA_new(void); int (*DSA_meth_get_verify(const DSA_METHOD *dsam))
DSA *DSA_new_method(ENGINE *engine); (const unsigned char *, int, DSA_SIG *, DSA *);
void DSA_free(DSA *r); int DSA_meth_set_verify(DSA_METHOD *dsam,
/* "up" the DSA object's reference count */ int (*verify) (const unsigned char *, int, DSA_SIG *, DSA *));
int DSA_up_ref(DSA *r); int (*DSA_meth_get_mod_exp(const DSA_METHOD *dsam))
int DSA_size(const DSA *); (DSA *, BIGNUM *, const BIGNUM *, const BIGNUM *, const BIGNUM *,
/* next 4 return -1 on error */ const BIGNUM *, const BIGNUM *, BN_CTX *, BN_MONT_CTX *);
int DSA_sign_setup(DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp, BIGNUM **rp); int DSA_meth_set_mod_exp(DSA_METHOD *dsam,
int DSA_sign(int type, const unsigned char *dgst, int dlen, int (*mod_exp) (DSA *, BIGNUM *, const BIGNUM *, const BIGNUM *,
unsigned char *sig, unsigned int *siglen, DSA *dsa); const BIGNUM *, const BIGNUM *, const BIGNUM *, BN_CTX *,
int DSA_verify(int type, const unsigned char *dgst, int dgst_len, BN_MONT_CTX *));
const unsigned char *sigbuf, int siglen, DSA *dsa); int (*DSA_meth_get_bn_mod_exp(const DSA_METHOD *dsam))
int DSA_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, (DSA *, BIGNUM *, const BIGNUM *, const BIGNUM *, const BIGNUM *,
CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func); BN_CTX *, BN_MONT_CTX *);
int DSA_set_ex_data(DSA *d, int idx, void *arg); int DSA_meth_set_bn_mod_exp(DSA_METHOD *dsam,
void *DSA_get_ex_data(DSA *d, int idx); int (*bn_mod_exp) (DSA *, BIGNUM *, const BIGNUM *, const BIGNUM *,
const BIGNUM *, BN_CTX *, BN_MONT_CTX *));
DSA *d2i_DSAPublicKey(DSA **a, const unsigned char **pp, long length); int (*DSA_meth_get_init(const DSA_METHOD *dsam))(DSA *);
DSA *d2i_DSAPrivateKey(DSA **a, const unsigned char **pp, long length); int DSA_meth_set_init(DSA_METHOD *dsam, int (*init)(DSA *));
DSA *d2i_DSAparams(DSA **a, const unsigned char **pp, long length); int (*DSA_meth_get_finish(const DSA_METHOD *dsam)) (DSA *);
int DSA_meth_set_finish(DSA_METHOD *dsam, int (*finish) (DSA *));
/* Deprecated version */ int (*DSA_meth_get_paramgen(const DSA_METHOD *dsam))
# ifndef OPENSSL_NO_DEPRECATED (DSA *, int, const unsigned char *, int, int *, unsigned long *,
DSA *DSA_generate_parameters(int bits, BN_GENCB *);
unsigned char *seed, int seed_len, int DSA_meth_set_paramgen(DSA_METHOD *dsam,
int *counter_ret, unsigned long *h_ret, void int (*paramgen) (DSA *, int, const unsigned char *, int, int *,
(*callback) (int, int, void *), void *cb_arg); unsigned long *, BN_GENCB *));
# endif /* !defined(OPENSSL_NO_DEPRECATED) */ int (*DSA_meth_get_keygen(const DSA_METHOD *dsam)) (DSA *);
int DSA_meth_set_keygen(DSA_METHOD *dsam, int (*keygen) (DSA *));
/* New version */
int DSA_generate_parameters_ex(DSA *dsa, int bits,
const unsigned char *seed, int seed_len, # ifdef __cplusplus
int *counter_ret, unsigned long *h_ret, }
BN_GENCB *cb); # endif
# endif
int DSA_generate_key(DSA *a); #endif
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

View File

@ -0,0 +1,67 @@
/*
* Generated by util/mkerr.pl DO NOT EDIT
* Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/license.html
*/
#ifndef HEADER_DSAERR_H
# define HEADER_DSAERR_H
# include <openssl/opensslconf.h>
# ifndef OPENSSL_NO_DSA
# ifdef __cplusplus
extern "C"
# endif
int ERR_load_DSA_strings(void);
/*
* DSA function codes.
*/
# define DSA_F_DSAPARAMS_PRINT 100
# define DSA_F_DSAPARAMS_PRINT_FP 101
# define DSA_F_DSA_BUILTIN_PARAMGEN 125
# 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_METH_DUP 127
# define DSA_F_DSA_METH_NEW 128
# define DSA_F_DSA_METH_SET1_NAME 129
# 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 102
# define DSA_F_OLD_DSA_PRIV_DECODE 122
# define DSA_F_PKEY_DSA_CTRL 120
# define DSA_F_PKEY_DSA_CTRL_STR 104
# define DSA_F_PKEY_DSA_KEYGEN 121
/*
* DSA 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_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_NO_PARAMETERS_SET 107
# define DSA_R_PARAMETER_ENCODING_ERROR 105
# define DSA_R_Q_NOT_PRIME 113
# define DSA_R_SEED_LEN_SMALL 110
# endif
#endif

View File

@ -1,451 +0,0 @@
/* dso.h */
/*
* Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL project
* 2000.
*/
/* ====================================================================
* Copyright (c) 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
* 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.
* ====================================================================
*
* 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_DSO_H
# define HEADER_DSO_H
# include <openssl/crypto.h>
#ifdef __cplusplus
extern "C" {
#endif
/* These values are used as commands to DSO_ctrl() */
# define DSO_CTRL_GET_FLAGS 1
# define DSO_CTRL_SET_FLAGS 2
# define DSO_CTRL_OR_FLAGS 3
/*
* By default, DSO_load() will translate the provided filename into a form
* typical for the platform (more specifically the DSO_METHOD) using the
* dso_name_converter function of the method. Eg. win32 will transform "blah"
* into "blah.dll", and dlfcn will transform it into "libblah.so". The
* behaviour can be overriden by setting the name_converter callback in the
* DSO object (using DSO_set_name_converter()). This callback could even
* utilise the DSO_METHOD's converter too if it only wants to override
* behaviour for one or two possible DSO methods. However, the following flag
* can be set in a DSO to prevent *any* native name-translation at all - eg.
* if the caller has prompted the user for a path to a driver library so the
* filename should be interpreted as-is.
*/
# define DSO_FLAG_NO_NAME_TRANSLATION 0x01
/*
* An extra flag to give if only the extension should be added as
* translation. This is obviously only of importance on Unix and other
* operating systems where the translation also may prefix the name with
* something, like 'lib', and ignored everywhere else. This flag is also
* ignored if DSO_FLAG_NO_NAME_TRANSLATION is used at the same time.
*/
# define DSO_FLAG_NAME_TRANSLATION_EXT_ONLY 0x02
/*
* The following flag controls the translation of symbol names to upper case.
* This is currently only being implemented for OpenVMS.
*/
# define DSO_FLAG_UPCASE_SYMBOL 0x10
/*
* This flag loads the library with public symbols. Meaning: The exported
* symbols of this library are public to all libraries loaded after this
* library. At the moment only implemented in unix.
*/
# define DSO_FLAG_GLOBAL_SYMBOLS 0x20
typedef void (*DSO_FUNC_TYPE) (void);
typedef struct dso_st DSO;
/*
* The function prototype used for method functions (or caller-provided
* callbacks) that transform filenames. They are passed a DSO structure
* pointer (or NULL if they are to be used independantly of a DSO object) and
* a filename to transform. They should either return NULL (if there is an
* error condition) or a newly allocated string containing the transformed
* form that the caller will need to free with OPENSSL_free() when done.
*/
typedef char *(*DSO_NAME_CONVERTER_FUNC)(DSO *, const char *);
/*
* The function prototype used for method functions (or caller-provided
* callbacks) that merge two file specifications. They are passed a DSO
* structure pointer (or NULL if they are to be used independantly of a DSO
* object) and two file specifications to merge. They should either return
* NULL (if there is an error condition) or a newly allocated string
* containing the result of merging that the caller will need to free with
* OPENSSL_free() when done. Here, merging means that bits and pieces are
* taken from each of the file specifications and added together in whatever
* fashion that is sensible for the DSO method in question. The only rule
* that really applies is that if the two specification contain pieces of the
* same type, the copy from the first string takes priority. One could see
* it as the first specification is the one given by the user and the second
* being a bunch of defaults to add on if they're missing in the first.
*/
typedef char *(*DSO_MERGER_FUNC)(DSO *, const char *, const char *);
typedef struct dso_meth_st {
const char *name;
/*
* Loads a shared library, NB: new DSO_METHODs must ensure that a
* successful load populates the loaded_filename field, and likewise a
* successful unload OPENSSL_frees and NULLs it out.
*/
int (*dso_load) (DSO *dso);
/* Unloads a shared library */
int (*dso_unload) (DSO *dso);
/* Binds a variable */
void *(*dso_bind_var) (DSO *dso, const char *symname);
/*
* Binds a function - assumes a return type of DSO_FUNC_TYPE. This should
* be cast to the real function prototype by the caller. Platforms that
* don't have compatible representations for different prototypes (this
* is possible within ANSI C) are highly unlikely to have shared
* libraries at all, let alone a DSO_METHOD implemented for them.
*/
DSO_FUNC_TYPE (*dso_bind_func) (DSO *dso, const char *symname);
/* I don't think this would actually be used in any circumstances. */
# if 0
/* Unbinds a variable */
int (*dso_unbind_var) (DSO *dso, char *symname, void *symptr);
/* Unbinds a function */
int (*dso_unbind_func) (DSO *dso, char *symname, DSO_FUNC_TYPE symptr);
# endif
/*
* The generic (yuck) "ctrl()" function. NB: Negative return values
* (rather than zero) indicate errors.
*/
long (*dso_ctrl) (DSO *dso, int cmd, long larg, void *parg);
/*
* The default DSO_METHOD-specific function for converting filenames to a
* canonical native form.
*/
DSO_NAME_CONVERTER_FUNC dso_name_converter;
/*
* The default DSO_METHOD-specific function for converting filenames to a
* canonical native form.
*/
DSO_MERGER_FUNC dso_merger;
/* [De]Initialisation handlers. */
int (*init) (DSO *dso);
int (*finish) (DSO *dso);
/* Return pathname of the module containing location */
int (*pathbyaddr) (void *addr, char *path, int sz);
/* Perform global symbol lookup, i.e. among *all* modules */
void *(*globallookup) (const char *symname);
} DSO_METHOD;
/**********************************************************************/
/* The low-level handle type used to refer to a loaded shared library */
struct dso_st {
DSO_METHOD *meth;
/*
* Standard dlopen uses a (void *). Win32 uses a HANDLE. VMS doesn't use
* anything but will need to cache the filename for use in the dso_bind
* handler. All in all, let each method control its own destiny.
* "Handles" and such go in a STACK.
*/
STACK_OF(void) *meth_data;
int references;
int flags;
/*
* For use by applications etc ... use this for your bits'n'pieces, don't
* touch meth_data!
*/
CRYPTO_EX_DATA ex_data;
/*
* If this callback function pointer is set to non-NULL, then it will be
* used in DSO_load() in place of meth->dso_name_converter. NB: This
* should normally set using DSO_set_name_converter().
*/
DSO_NAME_CONVERTER_FUNC name_converter;
/*
* If this callback function pointer is set to non-NULL, then it will be
* used in DSO_load() in place of meth->dso_merger. NB: This should
* normally set using DSO_set_merger().
*/
DSO_MERGER_FUNC merger;
/*
* This is populated with (a copy of) the platform-independant filename
* used for this DSO.
*/
char *filename;
/*
* This is populated with (a copy of) the translated filename by which
* the DSO was actually loaded. It is NULL iff the DSO is not currently
* loaded. NB: This is here because the filename translation process may
* involve a callback being invoked more than once not only to convert to
* a platform-specific form, but also to try different filenames in the
* process of trying to perform a load. As such, this variable can be
* used to indicate (a) whether this DSO structure corresponds to a
* loaded library or not, and (b) the filename with which it was actually
* loaded.
*/
char *loaded_filename;
};
DSO *DSO_new(void);
DSO *DSO_new_method(DSO_METHOD *method);
int DSO_free(DSO *dso);
int DSO_flags(DSO *dso);
int DSO_up_ref(DSO *dso);
long DSO_ctrl(DSO *dso, int cmd, long larg, void *parg);
/*
* This function sets the DSO's name_converter callback. If it is non-NULL,
* then it will be used instead of the associated DSO_METHOD's function. If
* oldcb is non-NULL then it is set to the function pointer value being
* replaced. Return value is non-zero for success.
*/
int DSO_set_name_converter(DSO *dso, DSO_NAME_CONVERTER_FUNC cb,
DSO_NAME_CONVERTER_FUNC *oldcb);
/*
* These functions can be used to get/set the platform-independant filename
* used for a DSO. NB: set will fail if the DSO is already loaded.
*/
const char *DSO_get_filename(DSO *dso);
int DSO_set_filename(DSO *dso, const char *filename);
/*
* This function will invoke the DSO's name_converter callback to translate a
* filename, or if the callback isn't set it will instead use the DSO_METHOD's
* converter. If "filename" is NULL, the "filename" in the DSO itself will be
* used. If the DSO_FLAG_NO_NAME_TRANSLATION flag is set, then the filename is
* simply duplicated. NB: This function is usually called from within a
* DSO_METHOD during the processing of a DSO_load() call, and is exposed so
* that caller-created DSO_METHODs can do the same thing. A non-NULL return
* value will need to be OPENSSL_free()'d.
*/
char *DSO_convert_filename(DSO *dso, const char *filename);
/*
* This function will invoke the DSO's merger callback to merge two file
* specifications, or if the callback isn't set it will instead use the
* DSO_METHOD's merger. A non-NULL return value will need to be
* OPENSSL_free()'d.
*/
char *DSO_merge(DSO *dso, const char *filespec1, const char *filespec2);
/*
* If the DSO is currently loaded, this returns the filename that it was
* loaded under, otherwise it returns NULL. So it is also useful as a test as
* to whether the DSO is currently loaded. NB: This will not necessarily
* return the same value as DSO_convert_filename(dso, dso->filename), because
* the DSO_METHOD's load function may have tried a variety of filenames (with
* and/or without the aid of the converters) before settling on the one it
* actually loaded.
*/
const char *DSO_get_loaded_filename(DSO *dso);
void DSO_set_default_method(DSO_METHOD *meth);
DSO_METHOD *DSO_get_default_method(void);
DSO_METHOD *DSO_get_method(DSO *dso);
DSO_METHOD *DSO_set_method(DSO *dso, DSO_METHOD *meth);
/*
* The all-singing all-dancing load function, you normally pass NULL for the
* first and third parameters. Use DSO_up and DSO_free for subsequent
* reference count handling. Any flags passed in will be set in the
* constructed DSO after its init() function but before the load operation.
* If 'dso' is non-NULL, 'flags' is ignored.
*/
DSO *DSO_load(DSO *dso, const char *filename, DSO_METHOD *meth, int flags);
/* This function binds to a variable inside a shared library. */
void *DSO_bind_var(DSO *dso, const char *symname);
/* This function binds to a function inside a shared library. */
DSO_FUNC_TYPE DSO_bind_func(DSO *dso, const char *symname);
/*
* This method is the default, but will beg, borrow, or steal whatever method
* should be the default on any particular platform (including
* DSO_METH_null() if necessary).
*/
DSO_METHOD *DSO_METHOD_openssl(void);
/*
* This method is defined for all platforms - if a platform has no DSO
* support then this will be the only method!
*/
DSO_METHOD *DSO_METHOD_null(void);
/*
* If DSO_DLFCN is defined, the standard dlfcn.h-style functions (dlopen,
* dlclose, dlsym, etc) will be used and incorporated into this method. If
* not, this method will return NULL.
*/
DSO_METHOD *DSO_METHOD_dlfcn(void);
/*
* If DSO_DL is defined, the standard dl.h-style functions (shl_load,
* shl_unload, shl_findsym, etc) will be used and incorporated into this
* method. If not, this method will return NULL.
*/
DSO_METHOD *DSO_METHOD_dl(void);
/* If WIN32 is defined, use DLLs. If not, return NULL. */
DSO_METHOD *DSO_METHOD_win32(void);
/* If VMS is defined, use shared images. If not, return NULL. */
DSO_METHOD *DSO_METHOD_vms(void);
/*
* This function writes null-terminated pathname of DSO module containing
* 'addr' into 'sz' large caller-provided 'path' and returns the number of
* characters [including trailing zero] written to it. If 'sz' is 0 or
* negative, 'path' is ignored and required amount of charachers [including
* trailing zero] to accomodate pathname is returned. If 'addr' is NULL, then
* pathname of cryptolib itself is returned. Negative or zero return value
* denotes error.
*/
int DSO_pathbyaddr(void *addr, char *path, int sz);
/*
* This function should be used with caution! It looks up symbols in *all*
* loaded modules and if module gets unloaded by somebody else attempt to
* dereference the pointer is doomed to have fatal consequences. Primary
* usage for this function is to probe *core* system functionality, e.g.
* check if getnameinfo(3) is available at run-time without bothering about
* OS-specific details such as libc.so.versioning or where does it actually
* reside: in libc itself or libsocket.
*/
void *DSO_global_lookup(const char *name);
/* If BeOS is defined, use shared images. If not, return NULL. */
DSO_METHOD *DSO_METHOD_beos(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_DSO_strings(void);
/* Error codes for the DSO functions. */
/* Function codes. */
# define DSO_F_BEOS_BIND_FUNC 144
# define DSO_F_BEOS_BIND_VAR 145
# define DSO_F_BEOS_LOAD 146
# define DSO_F_BEOS_NAME_CONVERTER 147
# define DSO_F_BEOS_UNLOAD 148
# define DSO_F_DLFCN_BIND_FUNC 100
# define DSO_F_DLFCN_BIND_VAR 101
# define DSO_F_DLFCN_LOAD 102
# define DSO_F_DLFCN_MERGER 130
# define DSO_F_DLFCN_NAME_CONVERTER 123
# define DSO_F_DLFCN_UNLOAD 103
# define DSO_F_DL_BIND_FUNC 104
# define DSO_F_DL_BIND_VAR 105
# define DSO_F_DL_LOAD 106
# define DSO_F_DL_MERGER 131
# define DSO_F_DL_NAME_CONVERTER 124
# define DSO_F_DL_UNLOAD 107
# define DSO_F_DSO_BIND_FUNC 108
# define DSO_F_DSO_BIND_VAR 109
# define DSO_F_DSO_CONVERT_FILENAME 126
# define DSO_F_DSO_CTRL 110
# define DSO_F_DSO_FREE 111
# define DSO_F_DSO_GET_FILENAME 127
# define DSO_F_DSO_GET_LOADED_FILENAME 128
# define DSO_F_DSO_GLOBAL_LOOKUP 139
# define DSO_F_DSO_LOAD 112
# define DSO_F_DSO_MERGE 132
# define DSO_F_DSO_NEW_METHOD 113
# define DSO_F_DSO_PATHBYADDR 140
# define DSO_F_DSO_SET_FILENAME 129
# define DSO_F_DSO_SET_NAME_CONVERTER 122
# define DSO_F_DSO_UP_REF 114
# define DSO_F_GLOBAL_LOOKUP_FUNC 138
# define DSO_F_PATHBYADDR 137
# define DSO_F_VMS_BIND_SYM 115
# define DSO_F_VMS_LOAD 116
# define DSO_F_VMS_MERGER 133
# define DSO_F_VMS_UNLOAD 117
# define DSO_F_WIN32_BIND_FUNC 118
# define DSO_F_WIN32_BIND_VAR 119
# define DSO_F_WIN32_GLOBALLOOKUP 142
# define DSO_F_WIN32_GLOBALLOOKUP_FUNC 143
# define DSO_F_WIN32_JOINER 135
# define DSO_F_WIN32_LOAD 120
# define DSO_F_WIN32_MERGER 134
# define DSO_F_WIN32_NAME_CONVERTER 125
# define DSO_F_WIN32_PATHBYADDR 141
# define DSO_F_WIN32_SPLITTER 136
# define DSO_F_WIN32_UNLOAD 121
/* Reason codes. */
# define DSO_R_CTRL_FAILED 100
# define DSO_R_DSO_ALREADY_LOADED 110
# define DSO_R_EMPTY_FILE_STRUCTURE 113
# define DSO_R_FAILURE 114
# define DSO_R_FILENAME_TOO_BIG 101
# define DSO_R_FINISH_FAILED 102
# define DSO_R_INCORRECT_FILE_SYNTAX 115
# define DSO_R_LOAD_FAILED 103
# define DSO_R_NAME_TRANSLATION_FAILED 109
# define DSO_R_NO_FILENAME 111
# define DSO_R_NO_FILE_SPECIFICATION 116
# define DSO_R_NULL_HANDLE 104
# define DSO_R_SET_FILENAME_FAILED 112
# define DSO_R_STACK_ERROR 105
# define DSO_R_SYM_FAILURE 106
# define DSO_R_UNLOAD_FAILED 107
# define DSO_R_UNSUPPORTED 108
#ifdef __cplusplus
}
#endif
#endif

View File

@ -1,272 +1,55 @@
/* ssl/dtls1.h */ /*
/* * Copyright 2005-2018 The OpenSSL Project Authors. All Rights Reserved.
* DTLS implementation written by Nagendra Modadugu *
* (nagendra@cs.stanford.edu) for the OpenSSL project 2005. * Licensed under the OpenSSL license (the "License"). You may not use
*/ * this file except in compliance with the License. You can obtain a copy
/* ==================================================================== * in the file LICENSE in the source distribution or at
* Copyright (c) 1999-2005 The OpenSSL Project. All rights reserved. * https://www.openssl.org/source/license.html
* */
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions #ifndef HEADER_DTLS1_H
* are met: # define HEADER_DTLS1_H
*
* 1. Redistributions of source code must retain the above copyright #ifdef __cplusplus
* notice, this list of conditions and the following disclaimer. extern "C" {
* #endif
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in # define DTLS1_VERSION 0xFEFF
* the documentation and/or other materials provided with the # define DTLS1_2_VERSION 0xFEFD
* distribution. # define DTLS_MIN_VERSION DTLS1_VERSION
* # define DTLS_MAX_VERSION DTLS1_2_VERSION
* 3. All advertising materials mentioning features or use of this # define DTLS1_VERSION_MAJOR 0xFE
* software must display the following acknowledgment:
* "This product includes software developed by the OpenSSL Project # define DTLS1_BAD_VER 0x0100
* for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
* /* Special value for method supporting multiple versions */
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to # define DTLS_ANY_VERSION 0x1FFFF
* endorse or promote products derived from this software without
* prior written permission. For written permission, please contact /* lengths of messages */
* openssl-core@OpenSSL.org. /*
* * Actually the max cookie length in DTLS is 255. But we can't change this now
* 5. Products derived from this software may not be called "OpenSSL" * due to compatibility concerns.
* nor may "OpenSSL" appear in their names without prior written */
* permission of the OpenSSL Project. # define DTLS1_COOKIE_LENGTH 256
*
* 6. Redistributions of any form whatsoever must retain the following # define DTLS1_RT_HEADER_LENGTH 13
* acknowledgment:
* "This product includes software developed by the OpenSSL Project # define DTLS1_HM_HEADER_LENGTH 12
* for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
* # define DTLS1_HM_BAD_FRAGMENT -2
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY # define DTLS1_HM_FRAGMENT_RETRY -3
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR # define DTLS1_CCS_HEADER_LENGTH 1
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, # define DTLS1_AL_HEADER_LENGTH 2
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; /* Timeout multipliers (timeout slice is defined in apps/timeouts.h */
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) # define DTLS1_TMO_READ_COUNT 2
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, # define DTLS1_TMO_WRITE_COUNT 2
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED # define DTLS1_TMO_ALERT_COUNT 12
* OF THE POSSIBILITY OF SUCH DAMAGE.
* ==================================================================== #ifdef __cplusplus
* }
* This product includes cryptographic software written by Eric Young #endif
* (eay@cryptsoft.com). This product includes software written by Tim #endif
* 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

View File

@ -1,333 +1,293 @@
/* e_os2.h */ /*
/* ==================================================================== * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
* Copyright (c) 1998-2000 The OpenSSL Project. All rights reserved. *
* * Licensed under the OpenSSL license (the "License"). You may not use
* Redistribution and use in source and binary forms, with or without * this file except in compliance with the License. You can obtain a copy
* modification, are permitted provided that the following conditions * in the file LICENSE in the source distribution or at
* are met: * https://www.openssl.org/source/license.html
* */
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer. #ifndef HEADER_E_OS2_H
* # define HEADER_E_OS2_H
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in # include <openssl/opensslconf.h>
* the documentation and/or other materials provided with the
* distribution. #ifdef __cplusplus
* extern "C" {
* 3. All advertising materials mentioning features or use of this #endif
* 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/)" * Detect operating systems. This probably needs completing.
* * The result is that at least one OPENSSL_SYS_os macro should be defined.
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to * However, if none is defined, Unix is assumed.
* endorse or promote products derived from this software without **/
* prior written permission. For written permission, please contact
* openssl-core@openssl.org. # define OPENSSL_SYS_UNIX
*
* 5. Products derived from this software may not be called "OpenSSL" /* --------------------- Microsoft operating systems ---------------------- */
* nor may "OpenSSL" appear in their names without prior written
* permission of the OpenSSL Project. /*
* * Note that MSDOS actually denotes 32-bit environments running on top of
* 6. Redistributions of any form whatsoever must retain the following * MS-DOS, such as DJGPP one.
* acknowledgment: */
* "This product includes software developed by the OpenSSL Project # if defined(OPENSSL_SYS_MSDOS)
* for use in the OpenSSL Toolkit (http://www.openssl.org/)" # undef OPENSSL_SYS_UNIX
* # endif
* 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 * For 32 bit environment, there seems to be the CygWin environment and then
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR * all the others that try to do the same thing Microsoft does...
* 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; * UEFI lives here because it might be built with a Microsoft toolchain and
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * we need to avoid the false positive match on Windows.
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, */
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) # if defined(OPENSSL_SYS_UEFI)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED # undef OPENSSL_SYS_UNIX
* OF THE POSSIBILITY OF SUCH DAMAGE. # elif defined(OPENSSL_SYS_UWIN)
* ==================================================================== # undef OPENSSL_SYS_UNIX
* # define OPENSSL_SYS_WIN32_UWIN
* This product includes cryptographic software written by Eric Young # else
* (eay@cryptsoft.com). This product includes software written by Tim # if defined(__CYGWIN__) || defined(OPENSSL_SYS_CYGWIN)
* Hudson (tjh@cryptsoft.com). # define OPENSSL_SYS_WIN32_CYGWIN
* # else
*/ # if defined(_WIN32) || defined(OPENSSL_SYS_WIN32)
# undef OPENSSL_SYS_UNIX
#include <openssl/opensslconf.h> # if !defined(OPENSSL_SYS_WIN32)
# define OPENSSL_SYS_WIN32
#ifndef HEADER_E_OS2_H # endif
# define HEADER_E_OS2_H # endif
# if defined(_WIN64) || defined(OPENSSL_SYS_WIN64)
#ifdef __cplusplus # undef OPENSSL_SYS_UNIX
extern "C" { # if !defined(OPENSSL_SYS_WIN64)
#endif # define OPENSSL_SYS_WIN64
# endif
/****************************************************************************** # endif
* Detect operating systems. This probably needs completing. # if defined(OPENSSL_SYS_WINNT)
* The result is that at least one OPENSSL_SYS_os macro should be defined. # undef OPENSSL_SYS_UNIX
* However, if none is defined, Unix is assumed. # endif
**/ # if defined(OPENSSL_SYS_WINCE)
# undef OPENSSL_SYS_UNIX
# define OPENSSL_SYS_UNIX # endif
# endif
/* ---------------------- Macintosh, before MacOS X ----------------------- */ # endif
# if defined(__MWERKS__) && defined(macintosh) || defined(OPENSSL_SYSNAME_MAC)
# undef OPENSSL_SYS_UNIX /* Anything that tries to look like Microsoft is "Windows" */
# define OPENSSL_SYS_MACINTOSH_CLASSIC # if defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_WIN64) || defined(OPENSSL_SYS_WINNT) || defined(OPENSSL_SYS_WINCE)
# endif # undef OPENSSL_SYS_UNIX
# define OPENSSL_SYS_WINDOWS
/* ---------------------- NetWare ----------------------------------------- */ # ifndef OPENSSL_SYS_MSDOS
# if defined(NETWARE) || defined(OPENSSL_SYSNAME_NETWARE) # define OPENSSL_SYS_MSDOS
# undef OPENSSL_SYS_UNIX # endif
# define OPENSSL_SYS_NETWARE # endif
# endif
/*
/* --------------------- Microsoft operating systems ---------------------- */ * 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.
* Note that MSDOS actually denotes 32-bit environments running on top of */
* MS-DOS, such as DJGPP one. # ifdef OPENSSL_SYS_WINDOWS
*/ # ifndef OPENSSL_OPT_WINDLL
# if defined(OPENSSL_SYSNAME_MSDOS) # if defined(_WINDLL) /* This is used when building OpenSSL to
# undef OPENSSL_SYS_UNIX * indicate that DLL linkage should be used */
# define OPENSSL_SYS_MSDOS # define OPENSSL_OPT_WINDLL
# endif # endif
# endif
/* # 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... /* ------------------------------- OpenVMS -------------------------------- */
*/ # if defined(__VMS) || defined(VMS) || defined(OPENSSL_SYS_VMS)
# if defined(OPENSSL_SYSNAME_UWIN) # if !defined(OPENSSL_SYS_VMS)
# undef OPENSSL_SYS_UNIX # undef OPENSSL_SYS_UNIX
# define OPENSSL_SYS_WIN32_UWIN # endif
# else # define OPENSSL_SYS_VMS
# if defined(__CYGWIN__) || defined(OPENSSL_SYSNAME_CYGWIN) # if defined(__DECC)
# undef OPENSSL_SYS_UNIX # define OPENSSL_SYS_VMS_DECC
# define OPENSSL_SYS_WIN32_CYGWIN # elif defined(__DECCXX)
# else # define OPENSSL_SYS_VMS_DECC
# if defined(_WIN32) || defined(OPENSSL_SYSNAME_WIN32) # define OPENSSL_SYS_VMS_DECCXX
# undef OPENSSL_SYS_UNIX # else
# define OPENSSL_SYS_WIN32 # define OPENSSL_SYS_VMS_NODECC
# endif # endif
# if defined(_WIN64) || defined(OPENSSL_SYSNAME_WIN64) # endif
# undef OPENSSL_SYS_UNIX
# if !defined(OPENSSL_SYS_WIN64) /* -------------------------------- Unix ---------------------------------- */
# define OPENSSL_SYS_WIN64 # ifdef OPENSSL_SYS_UNIX
# endif # if defined(linux) || defined(__linux__) && !defined(OPENSSL_SYS_LINUX)
# endif # define OPENSSL_SYS_LINUX
# if defined(OPENSSL_SYSNAME_WINNT) # endif
# undef OPENSSL_SYS_UNIX # if defined(_AIX) && !defined(OPENSSL_SYS_AIX)
# define OPENSSL_SYS_WINNT # define OPENSSL_SYS_AIX
# endif # endif
# if defined(OPENSSL_SYSNAME_WINCE) # endif
# undef OPENSSL_SYS_UNIX
# define OPENSSL_SYS_WINCE /* -------------------------------- VOS ----------------------------------- */
# endif # if defined(__VOS__) && !defined(OPENSSL_SYS_VOS)
# endif # define OPENSSL_SYS_VOS
# endif # ifdef __HPPA__
# define OPENSSL_SYS_VOS_HPPA
/* Anything that tries to look like Microsoft is "Windows" */ # endif
# if defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_WIN64) || defined(OPENSSL_SYS_WINNT) || defined(OPENSSL_SYS_WINCE) # ifdef __IA32__
# undef OPENSSL_SYS_UNIX # define OPENSSL_SYS_VOS_IA32
# define OPENSSL_SYS_WINDOWS # endif
# ifndef OPENSSL_SYS_MSDOS # endif
# define OPENSSL_SYS_MSDOS
# endif /**
# endif * That's it for OS-specific stuff
*****************************************************************************/
/*
* DLL settings. This part is a bit tough, because it's up to the /* Specials for I/O an exit */
* application implementor how he or she will link the application, so it # ifdef OPENSSL_SYS_MSDOS
* requires some macro to be used. # define OPENSSL_UNISTD_IO <io.h>
*/ # define OPENSSL_DECLARE_EXIT extern void exit(int);
# ifdef OPENSSL_SYS_WINDOWS # else
# ifndef OPENSSL_OPT_WINDLL # define OPENSSL_UNISTD_IO OPENSSL_UNISTD
# if defined(_WINDLL) /* This is used when building OpenSSL to # define OPENSSL_DECLARE_EXIT /* declared in unistd.h */
* indicate that DLL linkage should be used */ # endif
# define OPENSSL_OPT_WINDLL
# endif /*-
# endif * OPENSSL_EXTERN is normally used to declare a symbol with possible extra
# endif * attributes to handle its presence in a shared library.
* OPENSSL_EXPORT is used to define a symbol with extra possible attributes
/* ------------------------------- OpenVMS -------------------------------- */ * to make it visible in a shared library.
# if defined(__VMS) || defined(VMS) || defined(OPENSSL_SYSNAME_VMS) * Care needs to be taken when a header file is used both to declare and
# undef OPENSSL_SYS_UNIX * define symbols. Basically, for any library that exports some global
# define OPENSSL_SYS_VMS * variables, the following code must be present in the header file that
# if defined(__DECC) * declares them, before OPENSSL_EXTERN is used:
# define OPENSSL_SYS_VMS_DECC *
# elif defined(__DECCXX) * #ifdef SOME_BUILD_FLAG_MACRO
# define OPENSSL_SYS_VMS_DECC * # undef OPENSSL_EXTERN
# define OPENSSL_SYS_VMS_DECCXX * # define OPENSSL_EXTERN OPENSSL_EXPORT
# else * #endif
# define OPENSSL_SYS_VMS_NODECC *
# endif * The default is to have OPENSSL_EXPORT and OPENSSL_EXTERN
# endif * have some generally sensible values.
*/
/* -------------------------------- OS/2 ---------------------------------- */
# if defined(__EMX__) || defined(__OS2__) # if defined(OPENSSL_SYS_WINDOWS) && defined(OPENSSL_OPT_WINDLL)
# undef OPENSSL_SYS_UNIX # define OPENSSL_EXPORT extern __declspec(dllexport)
# define OPENSSL_SYS_OS2 # define OPENSSL_EXTERN extern __declspec(dllimport)
# endif # else
# define OPENSSL_EXPORT extern
/* -------------------------------- Unix ---------------------------------- */ # define OPENSSL_EXTERN extern
# ifdef OPENSSL_SYS_UNIX # endif
# if defined(linux) || defined(__linux__) || defined(OPENSSL_SYSNAME_LINUX)
# define OPENSSL_SYS_LINUX /*-
# endif * Macros to allow global variables to be reached through function calls when
# ifdef OPENSSL_SYSNAME_MPE * required (if a shared library version requires it, for example.
# define OPENSSL_SYS_MPE * The way it's done allows definitions like this:
# endif *
# ifdef OPENSSL_SYSNAME_SNI * // in foobar.c
# define OPENSSL_SYS_SNI * OPENSSL_IMPLEMENT_GLOBAL(int,foobar,0)
# endif * // in foobar.h
# ifdef OPENSSL_SYSNAME_ULTRASPARC * OPENSSL_DECLARE_GLOBAL(int,foobar);
# define OPENSSL_SYS_ULTRASPARC * #define foobar OPENSSL_GLOBAL_REF(foobar)
# endif */
# ifdef OPENSSL_SYSNAME_NEWS4 # ifdef OPENSSL_EXPORT_VAR_AS_FUNCTION
# define OPENSSL_SYS_NEWS4 # define OPENSSL_IMPLEMENT_GLOBAL(type,name,value) \
# endif type *_shadow_##name(void) \
# ifdef OPENSSL_SYSNAME_MACOSX { static type _hide_##name=value; return &_hide_##name; }
# define OPENSSL_SYS_MACOSX # define OPENSSL_DECLARE_GLOBAL(type,name) type *_shadow_##name(void)
# endif # define OPENSSL_GLOBAL_REF(name) (*(_shadow_##name()))
# ifdef OPENSSL_SYSNAME_MACOSX_RHAPSODY # else
# define OPENSSL_SYS_MACOSX_RHAPSODY # define OPENSSL_IMPLEMENT_GLOBAL(type,name,value) type _shadow_##name=value;
# define OPENSSL_SYS_MACOSX # define OPENSSL_DECLARE_GLOBAL(type,name) OPENSSL_EXPORT type _shadow_##name
# endif # define OPENSSL_GLOBAL_REF(name) _shadow_##name
# ifdef OPENSSL_SYSNAME_SUNOS # endif
# define OPENSSL_SYS_SUNOS
# endif # ifdef _WIN32
# if defined(_CRAY) || defined(OPENSSL_SYSNAME_CRAY) # ifdef _WIN64
# define OPENSSL_SYS_CRAY # define ossl_ssize_t __int64
# endif # define OSSL_SSIZE_MAX _I64_MAX
# if defined(_AIX) || defined(OPENSSL_SYSNAME_AIX) # else
# define OPENSSL_SYS_AIX # define ossl_ssize_t int
# endif # define OSSL_SSIZE_MAX INT_MAX
# endif # endif
# endif
/* -------------------------------- VOS ----------------------------------- */
# if defined(__VOS__) || defined(OPENSSL_SYSNAME_VOS) # if defined(OPENSSL_SYS_UEFI) && !defined(ossl_ssize_t)
# define OPENSSL_SYS_VOS # define ossl_ssize_t INTN
# ifdef __HPPA__ # define OSSL_SSIZE_MAX MAX_INTN
# define OPENSSL_SYS_VOS_HPPA # endif
# endif
# ifdef __IA32__ # ifndef ossl_ssize_t
# define OPENSSL_SYS_VOS_IA32 # define ossl_ssize_t ssize_t
# endif # if defined(SSIZE_MAX)
# endif # define OSSL_SSIZE_MAX SSIZE_MAX
# elif defined(_POSIX_SSIZE_MAX)
/* ------------------------------ VxWorks --------------------------------- */ # define OSSL_SSIZE_MAX _POSIX_SSIZE_MAX
# ifdef OPENSSL_SYSNAME_VXWORKS # else
# define OPENSSL_SYS_VXWORKS # define OSSL_SSIZE_MAX ((ssize_t)(SIZE_MAX>>1))
# endif # endif
# endif
/* -------------------------------- BeOS ---------------------------------- */
# if defined(__BEOS__) # ifdef DEBUG_UNUSED
# define OPENSSL_SYS_BEOS # define __owur __attribute__((__warn_unused_result__))
# include <sys/socket.h> # else
# if defined(BONE_VERSION) # define __owur
# define OPENSSL_SYS_BEOS_BONE # endif
# else
# define OPENSSL_SYS_BEOS_R5 /* Standard integer types */
# endif # if defined(OPENSSL_SYS_UEFI)
# endif typedef INT8 int8_t;
typedef UINT8 uint8_t;
/** typedef INT16 int16_t;
* That's it for OS-specific stuff typedef UINT16 uint16_t;
*****************************************************************************/ typedef INT32 int32_t;
typedef UINT32 uint32_t;
/* Specials for I/O an exit */ typedef INT64 int64_t;
# ifdef OPENSSL_SYS_MSDOS typedef UINT64 uint64_t;
# define OPENSSL_UNISTD_IO <io.h> # elif (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || \
# define OPENSSL_DECLARE_EXIT extern void exit(int); defined(__osf__) || defined(__sgi) || defined(__hpux) || \
# else defined(OPENSSL_SYS_VMS) || defined (__OpenBSD__)
# define OPENSSL_UNISTD_IO OPENSSL_UNISTD # include <inttypes.h>
# define OPENSSL_DECLARE_EXIT /* declared in unistd.h */ # elif defined(_MSC_VER) && _MSC_VER<=1500
# endif /*
* minimally required typdefs for systems not supporting inttypes.h or
/*- * stdint.h: currently just older VC++
* Definitions of OPENSSL_GLOBAL and OPENSSL_EXTERN, to define and declare */
* certain global symbols that, with some compilers under VMS, have to be typedef signed char int8_t;
* defined and declared explicitely with globaldef and globalref. typedef unsigned char uint8_t;
* Definitions of OPENSSL_EXPORT and OPENSSL_IMPORT, to define and declare typedef short int16_t;
* DLL exports and imports for compilers under Win32. These are a little typedef unsigned short uint16_t;
* more complicated to use. Basically, for any library that exports some typedef int int32_t;
* global variables, the following code must be present in the header file typedef unsigned int uint32_t;
* that declares them, before OPENSSL_EXTERN is used: typedef __int64 int64_t;
* typedef unsigned __int64 uint64_t;
* #ifdef SOME_BUILD_FLAG_MACRO # else
* # undef OPENSSL_EXTERN # include <stdint.h>
* # define OPENSSL_EXTERN OPENSSL_EXPORT # endif
* #endif
* /* ossl_inline: portable inline definition usable in public headers */
* The default is to have OPENSSL_EXPORT, OPENSSL_IMPORT and OPENSSL_GLOBAL # if !defined(inline) && !defined(__cplusplus)
* have some generally sensible values, and for OPENSSL_EXTERN to have the # if defined(__STDC_VERSION__) && __STDC_VERSION__>=199901L
* value OPENSSL_IMPORT. /* just use inline */
*/ # define ossl_inline inline
# elif defined(__GNUC__) && __GNUC__>=2
# if defined(OPENSSL_SYS_VMS_NODECC) # define ossl_inline __inline__
# define OPENSSL_EXPORT globalref # elif defined(_MSC_VER)
# define OPENSSL_IMPORT globalref /*
# define OPENSSL_GLOBAL globaldef * Visual Studio: inline is available in C++ only, however
# elif defined(OPENSSL_SYS_WINDOWS) && defined(OPENSSL_OPT_WINDLL) * __inline is available for C, see
# define OPENSSL_EXPORT extern __declspec(dllexport) * http://msdn.microsoft.com/en-us/library/z8y1yy88.aspx
# define OPENSSL_IMPORT extern __declspec(dllimport) */
# define OPENSSL_GLOBAL # define ossl_inline __inline
# else # else
# define OPENSSL_EXPORT extern # define ossl_inline
# define OPENSSL_IMPORT extern # endif
# define OPENSSL_GLOBAL # else
# endif # define ossl_inline inline
# define OPENSSL_EXTERN OPENSSL_IMPORT # endif
/*- # if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
* Macros to allow global variables to be reached through function calls when # define ossl_noreturn _Noreturn
* required (if a shared library version requires it, for example. # elif defined(__GNUC__) && __GNUC__ >= 2
* The way it's done allows definitions like this: # define ossl_noreturn __attribute__((noreturn))
* # else
* // in foobar.c # define ossl_noreturn
* OPENSSL_IMPLEMENT_GLOBAL(int,foobar,0) # endif
* // in foobar.h
* OPENSSL_DECLARE_GLOBAL(int,foobar); #ifdef __cplusplus
* #define foobar OPENSSL_GLOBAL_REF(foobar) }
*/ #endif
# ifdef OPENSSL_EXPORT_VAR_AS_FUNCTION #endif
# 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
#ifndef _MSC_VER
#undef OPENSSL_SYS_WIN32
#undef OPENSSL_SYS_WINDOWS
#endif // _MSC_VER

View File

@ -1,26 +1,33 @@
/* crypto/ebcdic.h */ /*
* Copyright 1999-2016 The OpenSSL Project Authors. All Rights Reserved.
#ifndef HEADER_EBCDIC_H *
# define HEADER_EBCDIC_H * Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
# include <sys/types.h> * in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/license.html
#ifdef __cplusplus */
extern "C" {
#endif #ifndef HEADER_EBCDIC_H
# define HEADER_EBCDIC_H
/* Avoid name clashes with other applications */
# define os_toascii _openssl_os_toascii # include <stdlib.h>
# define os_toebcdic _openssl_os_toebcdic
# define ebcdic2ascii _openssl_ebcdic2ascii #ifdef __cplusplus
# define ascii2ebcdic _openssl_ascii2ebcdic extern "C" {
#endif
extern const unsigned char os_toascii[256];
extern const unsigned char os_toebcdic[256]; /* Avoid name clashes with other applications */
void *ebcdic2ascii(void *dest, const void *srce, size_t count); # define os_toascii _openssl_os_toascii
void *ascii2ebcdic(void *dest, const void *srce, size_t count); # define os_toebcdic _openssl_os_toebcdic
# define ebcdic2ascii _openssl_ebcdic2ascii
#ifdef __cplusplus # define ascii2ebcdic _openssl_ascii2ebcdic
}
#endif extern const unsigned char os_toascii[256];
#endif 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

File diff suppressed because it is too large Load Diff

View File

@ -1,134 +1,10 @@
/* crypto/ecdh/ecdh.h */ /*
/* ==================================================================== * Copyright 2002-2016 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. *
* * Licensed under the OpenSSL license (the "License"). You may not use
* The Elliptic Curve Public-Key Crypto Library (ECC Code) included * this file except in compliance with the License. You can obtain a copy
* herein is developed by SUN MICROSYSTEMS, INC., and is contributed * in the file LICENSE in the source distribution or at
* to the OpenSSL project. * https://www.openssl.org/source/license.html
* */
* The ECC Code is licensed pursuant to the OpenSSL open source
* license provided below. #include <openssl/ec.h>
*
* The ECDH software is originally written by Douglas Stebila of
* Sun Microsystems Laboratories.
*
*/
/* ====================================================================
* Copyright (c) 2000-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
* 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.
* ====================================================================
*
* 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_ECDH_H
# define HEADER_ECDH_H
# include <openssl/opensslconf.h>
# ifdef OPENSSL_NO_ECDH
# error ECDH is disabled.
# endif
# include <openssl/ec.h>
# include <openssl/ossl_typ.h>
# ifndef OPENSSL_NO_DEPRECATED
# include <openssl/bn.h>
# endif
#ifdef __cplusplus
extern "C" {
#endif
# define EC_FLAG_COFACTOR_ECDH 0x1000
const ECDH_METHOD *ECDH_OpenSSL(void);
void ECDH_set_default_method(const ECDH_METHOD *);
const ECDH_METHOD *ECDH_get_default_method(void);
int ECDH_set_method(EC_KEY *, const ECDH_METHOD *);
int ECDH_compute_key(void *out, size_t outlen, const EC_POINT *pub_key,
EC_KEY *ecdh, void *(*KDF) (const void *in, size_t inlen,
void *out, size_t *outlen));
int ECDH_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new
*new_func, CRYPTO_EX_dup *dup_func,
CRYPTO_EX_free *free_func);
int ECDH_set_ex_data(EC_KEY *d, int idx, void *arg);
void *ECDH_get_ex_data(EC_KEY *d, int idx);
int ECDH_KDF_X9_62(unsigned char *out, size_t outlen,
const unsigned char *Z, size_t Zlen,
const unsigned char *sinfo, size_t sinfolen,
const EVP_MD *md);
/* 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_ECDH_strings(void);
/* Error codes for the ECDH functions. */
/* Function codes. */
# define ECDH_F_ECDH_CHECK 102
# define ECDH_F_ECDH_COMPUTE_KEY 100
# define ECDH_F_ECDH_DATA_NEW_METHOD 101
/* Reason codes. */
# define ECDH_R_KDF_FAILED 102
# define ECDH_R_NON_FIPS_METHOD 103
# define ECDH_R_NO_PRIVATE_VALUE 100
# define ECDH_R_POINT_ARITHMETIC_FAILURE 101
#ifdef __cplusplus
}
#endif
#endif

View File

@ -1,335 +1,10 @@
/* crypto/ecdsa/ecdsa.h */ /*
/** * Copyright 2002-2016 The OpenSSL Project Authors. All Rights Reserved.
* \file crypto/ecdsa/ecdsa.h Include file for the OpenSSL ECDSA functions *
* \author Written by Nils Larsch for the OpenSSL project * Licensed under the OpenSSL license (the "License"). You may not use
*/ * this file except in compliance with the License. You can obtain a copy
/* ==================================================================== * in the file LICENSE in the source distribution or at
* Copyright (c) 2000-2005 The OpenSSL Project. All rights reserved. * https://www.openssl.org/source/license.html
* */
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions #include <openssl/ec.h>
* 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.
* ====================================================================
*
* 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_ECDSA_H
# define HEADER_ECDSA_H
# include <openssl/opensslconf.h>
# ifdef OPENSSL_NO_ECDSA
# error ECDSA is disabled.
# endif
# include <openssl/ec.h>
# include <openssl/ossl_typ.h>
# ifndef OPENSSL_NO_DEPRECATED
# include <openssl/bn.h>
# endif
#ifdef __cplusplus
extern "C" {
#endif
typedef struct ECDSA_SIG_st {
BIGNUM *r;
BIGNUM *s;
} ECDSA_SIG;
/** Allocates and initialize a ECDSA_SIG structure
* \return pointer to a ECDSA_SIG structure or NULL if an error occurred
*/
ECDSA_SIG *ECDSA_SIG_new(void);
/** frees a ECDSA_SIG structure
* \param sig pointer to the ECDSA_SIG structure
*/
void ECDSA_SIG_free(ECDSA_SIG *sig);
/** DER encode content of ECDSA_SIG object (note: this function modifies *pp
* (*pp += length of the DER encoded signature)).
* \param sig pointer to the ECDSA_SIG object
* \param pp pointer to a unsigned char pointer for the output or NULL
* \return the length of the DER encoded ECDSA_SIG object or 0
*/
int i2d_ECDSA_SIG(const ECDSA_SIG *sig, unsigned char **pp);
/** Decodes a DER encoded ECDSA signature (note: this function changes *pp
* (*pp += len)).
* \param sig pointer to ECDSA_SIG pointer (may be NULL)
* \param pp memory buffer with the DER encoded signature
* \param len length of the buffer
* \return pointer to the decoded ECDSA_SIG structure (or NULL)
*/
ECDSA_SIG *d2i_ECDSA_SIG(ECDSA_SIG **sig, const unsigned char **pp, long len);
/** Computes the ECDSA signature of the given hash value using
* the supplied private key and returns the created signature.
* \param dgst pointer to the hash value
* \param dgst_len length of the hash value
* \param eckey EC_KEY object containing a private EC key
* \return pointer to a ECDSA_SIG structure or NULL if an error occurred
*/
ECDSA_SIG *ECDSA_do_sign(const unsigned char *dgst, int dgst_len,
EC_KEY *eckey);
/** Computes ECDSA signature of a given hash value using the supplied
* private key (note: sig must point to ECDSA_size(eckey) bytes of memory).
* \param dgst pointer to the hash value to sign
* \param dgstlen length of the hash value
* \param kinv BIGNUM with a pre-computed inverse k (optional)
* \param rp BIGNUM with a pre-computed rp value (optioanl),
* see ECDSA_sign_setup
* \param eckey EC_KEY object containing a private EC key
* \return pointer to a ECDSA_SIG structure or NULL if an error occurred
*/
ECDSA_SIG *ECDSA_do_sign_ex(const unsigned char *dgst, int dgstlen,
const BIGNUM *kinv, const BIGNUM *rp,
EC_KEY *eckey);
/** Verifies that the supplied signature is a valid ECDSA
* signature of the supplied hash value using the supplied public key.
* \param dgst pointer to the hash value
* \param dgst_len length of the hash value
* \param sig ECDSA_SIG structure
* \param eckey EC_KEY object containing a public EC key
* \return 1 if the signature is valid, 0 if the signature is invalid
* and -1 on error
*/
int ECDSA_do_verify(const unsigned char *dgst, int dgst_len,
const ECDSA_SIG *sig, EC_KEY *eckey);
const ECDSA_METHOD *ECDSA_OpenSSL(void);
/** Sets the default ECDSA method
* \param meth new default ECDSA_METHOD
*/
void ECDSA_set_default_method(const ECDSA_METHOD *meth);
/** Returns the default ECDSA method
* \return pointer to ECDSA_METHOD structure containing the default method
*/
const ECDSA_METHOD *ECDSA_get_default_method(void);
/** Sets method to be used for the ECDSA operations
* \param eckey EC_KEY object
* \param meth new method
* \return 1 on success and 0 otherwise
*/
int ECDSA_set_method(EC_KEY *eckey, const ECDSA_METHOD *meth);
/** Returns the maximum length of the DER encoded signature
* \param eckey EC_KEY object
* \return numbers of bytes required for the DER encoded signature
*/
int ECDSA_size(const EC_KEY *eckey);
/** Precompute parts of the signing operation
* \param eckey EC_KEY object containing a private EC key
* \param ctx BN_CTX object (optional)
* \param kinv BIGNUM pointer for the inverse of k
* \param rp BIGNUM pointer for x coordinate of k * generator
* \return 1 on success and 0 otherwise
*/
int ECDSA_sign_setup(EC_KEY *eckey, BN_CTX *ctx, BIGNUM **kinv, BIGNUM **rp);
/** Computes ECDSA signature of a given hash value using the supplied
* private key (note: sig must point to ECDSA_size(eckey) bytes of memory).
* \param type this parameter is ignored
* \param dgst pointer to the hash value to sign
* \param dgstlen length of the hash value
* \param sig memory for the DER encoded created signature
* \param siglen pointer to the length of the returned signature
* \param eckey EC_KEY object containing a private EC key
* \return 1 on success and 0 otherwise
*/
int ECDSA_sign(int type, const unsigned char *dgst, int dgstlen,
unsigned char *sig, unsigned int *siglen, EC_KEY *eckey);
/** Computes ECDSA signature of a given hash value using the supplied
* private key (note: sig must point to ECDSA_size(eckey) bytes of memory).
* \param type this parameter is ignored
* \param dgst pointer to the hash value to sign
* \param dgstlen length of the hash value
* \param sig buffer to hold the DER encoded signature
* \param siglen pointer to the length of the returned signature
* \param kinv BIGNUM with a pre-computed inverse k (optional)
* \param rp BIGNUM with a pre-computed rp value (optioanl),
* see ECDSA_sign_setup
* \param eckey EC_KEY object containing a private EC key
* \return 1 on success and 0 otherwise
*/
int ECDSA_sign_ex(int type, const unsigned char *dgst, int dgstlen,
unsigned char *sig, unsigned int *siglen,
const BIGNUM *kinv, const BIGNUM *rp, EC_KEY *eckey);
/** Verifies that the given signature is valid ECDSA signature
* of the supplied hash value using the specified public key.
* \param type this parameter is ignored
* \param dgst pointer to the hash value
* \param dgstlen length of the hash value
* \param sig pointer to the DER encoded signature
* \param siglen length of the DER encoded signature
* \param eckey EC_KEY object containing a public EC key
* \return 1 if the signature is valid, 0 if the signature is invalid
* and -1 on error
*/
int ECDSA_verify(int type, const unsigned char *dgst, int dgstlen,
const unsigned char *sig, int siglen, EC_KEY *eckey);
/* the standard ex_data functions */
int ECDSA_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new
*new_func, CRYPTO_EX_dup *dup_func,
CRYPTO_EX_free *free_func);
int ECDSA_set_ex_data(EC_KEY *d, int idx, void *arg);
void *ECDSA_get_ex_data(EC_KEY *d, int idx);
/** Allocates and initialize a ECDSA_METHOD structure
* \param ecdsa_method pointer to ECDSA_METHOD to copy. (May be NULL)
* \return pointer to a ECDSA_METHOD structure or NULL if an error occurred
*/
ECDSA_METHOD *ECDSA_METHOD_new(const ECDSA_METHOD *ecdsa_method);
/** frees a ECDSA_METHOD structure
* \param ecdsa_method pointer to the ECDSA_METHOD structure
*/
void ECDSA_METHOD_free(ECDSA_METHOD *ecdsa_method);
/** Sets application specific data in the ECDSA_METHOD
* \param ecdsa_method pointer to existing ECDSA_METHOD
* \param app application specific data to set
*/
void ECDSA_METHOD_set_app_data(ECDSA_METHOD *ecdsa_method, void *app);
/** Returns application specific data from a ECDSA_METHOD structure
* \param ecdsa_method pointer to ECDSA_METHOD structure
* \return pointer to application specific data.
*/
void *ECDSA_METHOD_get_app_data(ECDSA_METHOD *ecdsa_method);
/** Set the ECDSA_do_sign function in the ECDSA_METHOD
* \param ecdsa_method pointer to existing ECDSA_METHOD
* \param ecdsa_do_sign a funtion of type ECDSA_do_sign
*/
void ECDSA_METHOD_set_sign(ECDSA_METHOD *ecdsa_method,
ECDSA_SIG *(*ecdsa_do_sign) (const unsigned char
*dgst, int dgst_len,
const BIGNUM *inv,
const BIGNUM *rp,
EC_KEY *eckey));
/** Set the ECDSA_sign_setup function in the ECDSA_METHOD
* \param ecdsa_method pointer to existing ECDSA_METHOD
* \param ecdsa_sign_setup a funtion of type ECDSA_sign_setup
*/
void ECDSA_METHOD_set_sign_setup(ECDSA_METHOD *ecdsa_method,
int (*ecdsa_sign_setup) (EC_KEY *eckey,
BN_CTX *ctx,
BIGNUM **kinv,
BIGNUM **r));
/** Set the ECDSA_do_verify function in the ECDSA_METHOD
* \param ecdsa_method pointer to existing ECDSA_METHOD
* \param ecdsa_do_verify a funtion of type ECDSA_do_verify
*/
void ECDSA_METHOD_set_verify(ECDSA_METHOD *ecdsa_method,
int (*ecdsa_do_verify) (const unsigned char
*dgst, int dgst_len,
const ECDSA_SIG *sig,
EC_KEY *eckey));
void ECDSA_METHOD_set_flags(ECDSA_METHOD *ecdsa_method, int flags);
/** Set the flags field in the ECDSA_METHOD
* \param ecdsa_method pointer to existing ECDSA_METHOD
* \param flags flags value to set
*/
void ECDSA_METHOD_set_name(ECDSA_METHOD *ecdsa_method, char *name);
/** Set the name field in the ECDSA_METHOD
* \param ecdsa_method pointer to existing ECDSA_METHOD
* \param name name to set
*/
/* 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_ECDSA_strings(void);
/* Error codes for the ECDSA functions. */
/* Function codes. */
# define ECDSA_F_ECDSA_CHECK 104
# define ECDSA_F_ECDSA_DATA_NEW_METHOD 100
# define ECDSA_F_ECDSA_DO_SIGN 101
# define ECDSA_F_ECDSA_DO_VERIFY 102
# define ECDSA_F_ECDSA_METHOD_NEW 105
# define ECDSA_F_ECDSA_SIGN_SETUP 103
/* Reason codes. */
# define ECDSA_R_BAD_SIGNATURE 100
# define ECDSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE 101
# define ECDSA_R_ERR_EC_LIB 102
# define ECDSA_R_MISSING_PARAMETERS 103
# define ECDSA_R_NEED_NEW_SETUP_VALUES 106
# define ECDSA_R_NON_FIPS_METHOD 107
# define ECDSA_R_RANDOM_NUMBER_GENERATION_FAILED 104
# define ECDSA_R_SIGNATURE_MALLOC_FAILED 105
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,267 @@
/*
* Generated by util/mkerr.pl DO NOT EDIT
* Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/license.html
*/
#ifndef HEADER_ECERR_H
# define HEADER_ECERR_H
# include <openssl/opensslconf.h>
# ifndef OPENSSL_NO_EC
# ifdef __cplusplus
extern "C"
# endif
int ERR_load_EC_strings(void);
/*
* EC function codes.
*/
# define EC_F_BN_TO_FELEM 224
# define EC_F_D2I_ECPARAMETERS 144
# define EC_F_D2I_ECPKPARAMETERS 145
# define EC_F_D2I_ECPRIVATEKEY 146
# define EC_F_DO_EC_KEY_PRINT 221
# define EC_F_ECDH_CMS_DECRYPT 238
# define EC_F_ECDH_CMS_SET_SHARED_INFO 239
# define EC_F_ECDH_COMPUTE_KEY 246
# define EC_F_ECDH_SIMPLE_COMPUTE_KEY 257
# define EC_F_ECDSA_DO_SIGN_EX 251
# define EC_F_ECDSA_DO_VERIFY 252
# define EC_F_ECDSA_SIGN_EX 254
# define EC_F_ECDSA_SIGN_SETUP 248
# define EC_F_ECDSA_SIG_NEW 265
# define EC_F_ECDSA_VERIFY 253
# define EC_F_ECD_ITEM_VERIFY 270
# define EC_F_ECKEY_PARAM2TYPE 223
# define EC_F_ECKEY_PARAM_DECODE 212
# define EC_F_ECKEY_PRIV_DECODE 213
# define EC_F_ECKEY_PRIV_ENCODE 214
# define EC_F_ECKEY_PUB_DECODE 215
# define EC_F_ECKEY_PUB_ENCODE 216
# define EC_F_ECKEY_TYPE2PARAM 220
# define EC_F_ECPARAMETERS_PRINT 147
# define EC_F_ECPARAMETERS_PRINT_FP 148
# define EC_F_ECPKPARAMETERS_PRINT 149
# define EC_F_ECPKPARAMETERS_PRINT_FP 150
# define EC_F_ECP_NISTZ256_GET_AFFINE 240
# define EC_F_ECP_NISTZ256_INV_MOD_ORD 275
# define EC_F_ECP_NISTZ256_MULT_PRECOMPUTE 243
# define EC_F_ECP_NISTZ256_POINTS_MUL 241
# define EC_F_ECP_NISTZ256_PRE_COMP_NEW 244
# define EC_F_ECP_NISTZ256_WINDOWED_MUL 242
# define EC_F_ECX_KEY_OP 266
# define EC_F_ECX_PRIV_ENCODE 267
# define EC_F_ECX_PUB_ENCODE 268
# define EC_F_EC_ASN1_GROUP2CURVE 153
# define EC_F_EC_ASN1_GROUP2FIELDID 154
# define EC_F_EC_GF2M_MONTGOMERY_POINT_MULTIPLY 208
# define EC_F_EC_GF2M_SIMPLE_GROUP_CHECK_DISCRIMINANT 159
# define EC_F_EC_GF2M_SIMPLE_GROUP_SET_CURVE 195
# define EC_F_EC_GF2M_SIMPLE_LADDER_POST 285
# define EC_F_EC_GF2M_SIMPLE_LADDER_PRE 288
# define EC_F_EC_GF2M_SIMPLE_OCT2POINT 160
# define EC_F_EC_GF2M_SIMPLE_POINT2OCT 161
# define EC_F_EC_GF2M_SIMPLE_POINTS_MUL 289
# define EC_F_EC_GF2M_SIMPLE_POINT_GET_AFFINE_COORDINATES 162
# define EC_F_EC_GF2M_SIMPLE_POINT_SET_AFFINE_COORDINATES 163
# define EC_F_EC_GF2M_SIMPLE_SET_COMPRESSED_COORDINATES 164
# define EC_F_EC_GFP_MONT_FIELD_DECODE 133
# define EC_F_EC_GFP_MONT_FIELD_ENCODE 134
# define EC_F_EC_GFP_MONT_FIELD_MUL 131
# define EC_F_EC_GFP_MONT_FIELD_SET_TO_ONE 209
# define EC_F_EC_GFP_MONT_FIELD_SQR 132
# define EC_F_EC_GFP_MONT_GROUP_SET_CURVE 189
# define EC_F_EC_GFP_NISTP224_GROUP_SET_CURVE 225
# define EC_F_EC_GFP_NISTP224_POINTS_MUL 228
# define EC_F_EC_GFP_NISTP224_POINT_GET_AFFINE_COORDINATES 226
# define EC_F_EC_GFP_NISTP256_GROUP_SET_CURVE 230
# define EC_F_EC_GFP_NISTP256_POINTS_MUL 231
# define EC_F_EC_GFP_NISTP256_POINT_GET_AFFINE_COORDINATES 232
# define EC_F_EC_GFP_NISTP521_GROUP_SET_CURVE 233
# define EC_F_EC_GFP_NISTP521_POINTS_MUL 234
# define EC_F_EC_GFP_NISTP521_POINT_GET_AFFINE_COORDINATES 235
# define EC_F_EC_GFP_NIST_FIELD_MUL 200
# define EC_F_EC_GFP_NIST_FIELD_SQR 201
# define EC_F_EC_GFP_NIST_GROUP_SET_CURVE 202
# define EC_F_EC_GFP_SIMPLE_BLIND_COORDINATES 287
# define EC_F_EC_GFP_SIMPLE_GROUP_CHECK_DISCRIMINANT 165
# define EC_F_EC_GFP_SIMPLE_GROUP_SET_CURVE 166
# define EC_F_EC_GFP_SIMPLE_MAKE_AFFINE 102
# define EC_F_EC_GFP_SIMPLE_OCT2POINT 103
# define EC_F_EC_GFP_SIMPLE_POINT2OCT 104
# define EC_F_EC_GFP_SIMPLE_POINTS_MAKE_AFFINE 137
# define EC_F_EC_GFP_SIMPLE_POINT_GET_AFFINE_COORDINATES 167
# define EC_F_EC_GFP_SIMPLE_POINT_SET_AFFINE_COORDINATES 168
# define EC_F_EC_GFP_SIMPLE_SET_COMPRESSED_COORDINATES 169
# define EC_F_EC_GROUP_CHECK 170
# define EC_F_EC_GROUP_CHECK_DISCRIMINANT 171
# define EC_F_EC_GROUP_COPY 106
# define EC_F_EC_GROUP_GET_CURVE 291
# define EC_F_EC_GROUP_GET_CURVE_GF2M 172
# define EC_F_EC_GROUP_GET_CURVE_GFP 130
# define EC_F_EC_GROUP_GET_DEGREE 173
# define EC_F_EC_GROUP_GET_ECPARAMETERS 261
# define EC_F_EC_GROUP_GET_ECPKPARAMETERS 262
# define EC_F_EC_GROUP_GET_PENTANOMIAL_BASIS 193
# define EC_F_EC_GROUP_GET_TRINOMIAL_BASIS 194
# define EC_F_EC_GROUP_NEW 108
# define EC_F_EC_GROUP_NEW_BY_CURVE_NAME 174
# define EC_F_EC_GROUP_NEW_FROM_DATA 175
# define EC_F_EC_GROUP_NEW_FROM_ECPARAMETERS 263
# define EC_F_EC_GROUP_NEW_FROM_ECPKPARAMETERS 264
# define EC_F_EC_GROUP_SET_CURVE 292
# define EC_F_EC_GROUP_SET_CURVE_GF2M 176
# define EC_F_EC_GROUP_SET_CURVE_GFP 109
# define EC_F_EC_GROUP_SET_GENERATOR 111
# define EC_F_EC_GROUP_SET_SEED 286
# define EC_F_EC_KEY_CHECK_KEY 177
# define EC_F_EC_KEY_COPY 178
# define EC_F_EC_KEY_GENERATE_KEY 179
# define EC_F_EC_KEY_NEW 182
# define EC_F_EC_KEY_NEW_METHOD 245
# define EC_F_EC_KEY_OCT2PRIV 255
# define EC_F_EC_KEY_PRINT 180
# define EC_F_EC_KEY_PRINT_FP 181
# define EC_F_EC_KEY_PRIV2BUF 279
# define EC_F_EC_KEY_PRIV2OCT 256
# define EC_F_EC_KEY_SET_PUBLIC_KEY_AFFINE_COORDINATES 229
# define EC_F_EC_KEY_SIMPLE_CHECK_KEY 258
# define EC_F_EC_KEY_SIMPLE_OCT2PRIV 259
# define EC_F_EC_KEY_SIMPLE_PRIV2OCT 260
# define EC_F_EC_PKEY_CHECK 273
# define EC_F_EC_PKEY_PARAM_CHECK 274
# define EC_F_EC_POINTS_MAKE_AFFINE 136
# define EC_F_EC_POINTS_MUL 290
# define EC_F_EC_POINT_ADD 112
# define EC_F_EC_POINT_BN2POINT 280
# define EC_F_EC_POINT_CMP 113
# define EC_F_EC_POINT_COPY 114
# define EC_F_EC_POINT_DBL 115
# define EC_F_EC_POINT_GET_AFFINE_COORDINATES 293
# define EC_F_EC_POINT_GET_AFFINE_COORDINATES_GF2M 183
# define EC_F_EC_POINT_GET_AFFINE_COORDINATES_GFP 116
# define EC_F_EC_POINT_GET_JPROJECTIVE_COORDINATES_GFP 117
# define EC_F_EC_POINT_INVERT 210
# define EC_F_EC_POINT_IS_AT_INFINITY 118
# define EC_F_EC_POINT_IS_ON_CURVE 119
# define EC_F_EC_POINT_MAKE_AFFINE 120
# define EC_F_EC_POINT_NEW 121
# define EC_F_EC_POINT_OCT2POINT 122
# define EC_F_EC_POINT_POINT2BUF 281
# define EC_F_EC_POINT_POINT2OCT 123
# define EC_F_EC_POINT_SET_AFFINE_COORDINATES 294
# define EC_F_EC_POINT_SET_AFFINE_COORDINATES_GF2M 185
# define EC_F_EC_POINT_SET_AFFINE_COORDINATES_GFP 124
# define EC_F_EC_POINT_SET_COMPRESSED_COORDINATES 295
# define EC_F_EC_POINT_SET_COMPRESSED_COORDINATES_GF2M 186
# define EC_F_EC_POINT_SET_COMPRESSED_COORDINATES_GFP 125
# define EC_F_EC_POINT_SET_JPROJECTIVE_COORDINATES_GFP 126
# define EC_F_EC_POINT_SET_TO_INFINITY 127
# define EC_F_EC_PRE_COMP_NEW 196
# define EC_F_EC_SCALAR_MUL_LADDER 284
# define EC_F_EC_WNAF_MUL 187
# define EC_F_EC_WNAF_PRECOMPUTE_MULT 188
# define EC_F_I2D_ECPARAMETERS 190
# define EC_F_I2D_ECPKPARAMETERS 191
# define EC_F_I2D_ECPRIVATEKEY 192
# define EC_F_I2O_ECPUBLICKEY 151
# define EC_F_NISTP224_PRE_COMP_NEW 227
# define EC_F_NISTP256_PRE_COMP_NEW 236
# define EC_F_NISTP521_PRE_COMP_NEW 237
# define EC_F_O2I_ECPUBLICKEY 152
# define EC_F_OLD_EC_PRIV_DECODE 222
# define EC_F_OSSL_ECDH_COMPUTE_KEY 247
# define EC_F_OSSL_ECDSA_SIGN_SIG 249
# define EC_F_OSSL_ECDSA_VERIFY_SIG 250
# define EC_F_PKEY_ECD_CTRL 271
# define EC_F_PKEY_ECD_DIGESTSIGN 272
# define EC_F_PKEY_ECD_DIGESTSIGN25519 276
# define EC_F_PKEY_ECD_DIGESTSIGN448 277
# define EC_F_PKEY_ECX_DERIVE 269
# define EC_F_PKEY_EC_CTRL 197
# define EC_F_PKEY_EC_CTRL_STR 198
# define EC_F_PKEY_EC_DERIVE 217
# define EC_F_PKEY_EC_INIT 282
# define EC_F_PKEY_EC_KDF_DERIVE 283
# define EC_F_PKEY_EC_KEYGEN 199
# define EC_F_PKEY_EC_PARAMGEN 219
# define EC_F_PKEY_EC_SIGN 218
# define EC_F_VALIDATE_ECX_DERIVE 278
/*
* EC reason codes.
*/
# define EC_R_ASN1_ERROR 115
# define EC_R_BAD_SIGNATURE 156
# define EC_R_BIGNUM_OUT_OF_RANGE 144
# define EC_R_BUFFER_TOO_SMALL 100
# define EC_R_COORDINATES_OUT_OF_RANGE 146
# define EC_R_CURVE_DOES_NOT_SUPPORT_ECDH 160
# define EC_R_CURVE_DOES_NOT_SUPPORT_SIGNING 159
# define EC_R_D2I_ECPKPARAMETERS_FAILURE 117
# define EC_R_DECODE_ERROR 142
# define EC_R_DISCRIMINANT_IS_ZERO 118
# define EC_R_EC_GROUP_NEW_BY_NAME_FAILURE 119
# define EC_R_FIELD_TOO_LARGE 143
# define EC_R_GF2M_NOT_SUPPORTED 147
# define EC_R_GROUP2PKPARAMETERS_FAILURE 120
# define EC_R_I2D_ECPKPARAMETERS_FAILURE 121
# define EC_R_INCOMPATIBLE_OBJECTS 101
# define EC_R_INVALID_ARGUMENT 112
# define EC_R_INVALID_COMPRESSED_POINT 110
# define EC_R_INVALID_COMPRESSION_BIT 109
# define EC_R_INVALID_CURVE 141
# define EC_R_INVALID_DIGEST 151
# define EC_R_INVALID_DIGEST_TYPE 138
# define EC_R_INVALID_ENCODING 102
# define EC_R_INVALID_FIELD 103
# define EC_R_INVALID_FORM 104
# define EC_R_INVALID_GROUP_ORDER 122
# define EC_R_INVALID_KEY 116
# define EC_R_INVALID_OUTPUT_LENGTH 161
# define EC_R_INVALID_PEER_KEY 133
# define EC_R_INVALID_PENTANOMIAL_BASIS 132
# define EC_R_INVALID_PRIVATE_KEY 123
# define EC_R_INVALID_TRINOMIAL_BASIS 137
# define EC_R_KDF_PARAMETER_ERROR 148
# define EC_R_KEYS_NOT_SET 140
# define EC_R_LADDER_POST_FAILURE 136
# define EC_R_LADDER_PRE_FAILURE 153
# define EC_R_LADDER_STEP_FAILURE 162
# define EC_R_MISSING_PARAMETERS 124
# define EC_R_MISSING_PRIVATE_KEY 125
# define EC_R_NEED_NEW_SETUP_VALUES 157
# define EC_R_NOT_A_NIST_PRIME 135
# define EC_R_NOT_IMPLEMENTED 126
# define EC_R_NOT_INITIALIZED 111
# define EC_R_NO_PARAMETERS_SET 139
# define EC_R_NO_PRIVATE_VALUE 154
# define EC_R_OPERATION_NOT_SUPPORTED 152
# define EC_R_PASSED_NULL_PARAMETER 134
# define EC_R_PEER_KEY_ERROR 149
# define EC_R_PKPARAMETERS2GROUP_FAILURE 127
# define EC_R_POINT_ARITHMETIC_FAILURE 155
# define EC_R_POINT_AT_INFINITY 106
# define EC_R_POINT_COORDINATES_BLIND_FAILURE 163
# define EC_R_POINT_IS_NOT_ON_CURVE 107
# define EC_R_RANDOM_NUMBER_GENERATION_FAILED 158
# define EC_R_SHARED_INFO_ERROR 150
# define EC_R_SLOT_FULL 108
# define EC_R_UNDEFINED_GENERATOR 113
# define EC_R_UNDEFINED_ORDER 128
# define EC_R_UNKNOWN_COFACTOR 164
# define EC_R_UNKNOWN_GROUP 129
# define EC_R_UNKNOWN_ORDER 114
# define EC_R_UNSUPPORTED_FIELD 131
# define EC_R_WRONG_CURVE_PARAMETERS 145
# define EC_R_WRONG_ORDER 130
# endif
#endif

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,107 @@
/*
* Generated by util/mkerr.pl DO NOT EDIT
* Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/license.html
*/
#ifndef HEADER_ENGINEERR_H
# define HEADER_ENGINEERR_H
# include <openssl/opensslconf.h>
# ifndef OPENSSL_NO_ENGINE
# ifdef __cplusplus
extern "C"
# endif
int ERR_load_ENGINE_strings(void);
/*
* ENGINE function codes.
*/
# define ENGINE_F_DIGEST_UPDATE 198
# define ENGINE_F_DYNAMIC_CTRL 180
# define ENGINE_F_DYNAMIC_GET_DATA_CTX 181
# define ENGINE_F_DYNAMIC_LOAD 182
# define ENGINE_F_DYNAMIC_SET_DATA_CTX 183
# define ENGINE_F_ENGINE_ADD 105
# define ENGINE_F_ENGINE_BY_ID 106
# define ENGINE_F_ENGINE_CMD_IS_EXECUTABLE 170
# define ENGINE_F_ENGINE_CTRL 142
# define ENGINE_F_ENGINE_CTRL_CMD 178
# define ENGINE_F_ENGINE_CTRL_CMD_STRING 171
# define ENGINE_F_ENGINE_FINISH 107
# define ENGINE_F_ENGINE_GET_CIPHER 185
# define ENGINE_F_ENGINE_GET_DIGEST 186
# define ENGINE_F_ENGINE_GET_FIRST 195
# define ENGINE_F_ENGINE_GET_LAST 196
# define ENGINE_F_ENGINE_GET_NEXT 115
# define ENGINE_F_ENGINE_GET_PKEY_ASN1_METH 193
# define ENGINE_F_ENGINE_GET_PKEY_METH 192
# define ENGINE_F_ENGINE_GET_PREV 116
# define ENGINE_F_ENGINE_INIT 119
# define ENGINE_F_ENGINE_LIST_ADD 120
# define ENGINE_F_ENGINE_LIST_REMOVE 121
# define ENGINE_F_ENGINE_LOAD_PRIVATE_KEY 150
# define ENGINE_F_ENGINE_LOAD_PUBLIC_KEY 151
# define ENGINE_F_ENGINE_LOAD_SSL_CLIENT_CERT 194
# define ENGINE_F_ENGINE_NEW 122
# define ENGINE_F_ENGINE_PKEY_ASN1_FIND_STR 197
# define ENGINE_F_ENGINE_REMOVE 123
# define ENGINE_F_ENGINE_SET_DEFAULT_STRING 189
# define ENGINE_F_ENGINE_SET_ID 129
# define ENGINE_F_ENGINE_SET_NAME 130
# define ENGINE_F_ENGINE_TABLE_REGISTER 184
# define ENGINE_F_ENGINE_UNLOCKED_FINISH 191
# define ENGINE_F_ENGINE_UP_REF 190
# define ENGINE_F_INT_CLEANUP_ITEM 199
# define ENGINE_F_INT_CTRL_HELPER 172
# define ENGINE_F_INT_ENGINE_CONFIGURE 188
# define ENGINE_F_INT_ENGINE_MODULE_INIT 187
# define ENGINE_F_OSSL_HMAC_INIT 200
/*
* ENGINE reason codes.
*/
# define ENGINE_R_ALREADY_LOADED 100
# define ENGINE_R_ARGUMENT_IS_NOT_A_NUMBER 133
# define ENGINE_R_CMD_NOT_EXECUTABLE 134
# define ENGINE_R_COMMAND_TAKES_INPUT 135
# define ENGINE_R_COMMAND_TAKES_NO_INPUT 136
# define ENGINE_R_CONFLICTING_ENGINE_ID 103
# define ENGINE_R_CTRL_COMMAND_NOT_IMPLEMENTED 119
# define ENGINE_R_DSO_FAILURE 104
# define ENGINE_R_DSO_NOT_FOUND 132
# define ENGINE_R_ENGINES_SECTION_ERROR 148
# define ENGINE_R_ENGINE_CONFIGURATION_ERROR 102
# define ENGINE_R_ENGINE_IS_NOT_IN_LIST 105
# define ENGINE_R_ENGINE_SECTION_ERROR 149
# define ENGINE_R_FAILED_LOADING_PRIVATE_KEY 128
# define ENGINE_R_FAILED_LOADING_PUBLIC_KEY 129
# define ENGINE_R_FINISH_FAILED 106
# define ENGINE_R_ID_OR_NAME_MISSING 108
# define ENGINE_R_INIT_FAILED 109
# define ENGINE_R_INTERNAL_LIST_ERROR 110
# define ENGINE_R_INVALID_ARGUMENT 143
# define ENGINE_R_INVALID_CMD_NAME 137
# define ENGINE_R_INVALID_CMD_NUMBER 138
# define ENGINE_R_INVALID_INIT_VALUE 151
# define ENGINE_R_INVALID_STRING 150
# define ENGINE_R_NOT_INITIALISED 117
# define ENGINE_R_NOT_LOADED 112
# define ENGINE_R_NO_CONTROL_FUNCTION 120
# define ENGINE_R_NO_INDEX 144
# define ENGINE_R_NO_LOAD_FUNCTION 125
# define ENGINE_R_NO_REFERENCE 130
# define ENGINE_R_NO_SUCH_ENGINE 116
# define ENGINE_R_UNIMPLEMENTED_CIPHER 146
# define ENGINE_R_UNIMPLEMENTED_DIGEST 147
# define ENGINE_R_UNIMPLEMENTED_PUBLIC_KEY_METHOD 101
# define ENGINE_R_VERSION_INCOMPATIBILITY 145
# endif
#endif

View File

@ -1,389 +1,273 @@
/* crypto/err/err.h */ /*
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
* All rights reserved. *
* * Licensed under the OpenSSL license (the "License"). You may not use
* This package is an SSL implementation written * this file except in compliance with the License. You can obtain a copy
* by Eric Young (eay@cryptsoft.com). * in the file LICENSE in the source distribution or at
* The implementation was written so as to conform with Netscapes SSL. * https://www.openssl.org/source/license.html
* */
* This library is free for commercial and non-commercial use as long as
* the following conditions are aheared to. The following conditions #ifndef HEADER_ERR_H
* apply to all code found in this distribution, be it the RC4, RSA, # define HEADER_ERR_H
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
* included with this distribution is covered by the same copyright terms # include <openssl/e_os2.h>
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
* # ifndef OPENSSL_NO_STDIO
* Copyright remains Eric Young's, and as such any Copyright notices in # include <stdio.h>
* the code are not to be removed. # include <stdlib.h>
* If this package is used in a product, Eric Young should be given attribution # endif
* as the author of the parts of the library used.
* This can be in the form of a textual message at program startup or # include <openssl/ossl_typ.h>
* in documentation (online or textual) provided with the package. # include <openssl/bio.h>
* # include <openssl/lhash.h>
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions #ifdef __cplusplus
* are met: extern "C" {
* 1. Redistributions of source code must retain the copyright #endif
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright # ifndef OPENSSL_NO_ERR
* notice, this list of conditions and the following disclaimer in the # define ERR_PUT_error(a,b,c,d,e) ERR_put_error(a,b,c,d,e)
* documentation and/or other materials provided with the distribution. # else
* 3. All advertising materials mentioning features or use of this software # define ERR_PUT_error(a,b,c,d,e) ERR_put_error(a,b,c,NULL,0)
* must display the following acknowledgement: # endif
* "This product includes cryptographic software written by
* Eric Young (eay@cryptsoft.com)" # include <errno.h>
* The word 'cryptographic' can be left out if the rouines from the library
* being used are not cryptographic related :-). # define ERR_TXT_MALLOCED 0x01
* 4. If you include any Windows specific code (or a derivative thereof) from # define ERR_TXT_STRING 0x02
* the apps directory (application code) you must include an acknowledgement:
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" # define ERR_FLAG_MARK 0x01
*
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND # define ERR_NUM_ERRORS 16
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE typedef struct err_state_st {
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE int err_flags[ERR_NUM_ERRORS];
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE unsigned long err_buffer[ERR_NUM_ERRORS];
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL char *err_data[ERR_NUM_ERRORS];
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS int err_data_flags[ERR_NUM_ERRORS];
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) const char *err_file[ERR_NUM_ERRORS];
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT int err_line[ERR_NUM_ERRORS];
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY int top, bottom;
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF } ERR_STATE;
* SUCH DAMAGE.
* /* library */
* The licence and distribution terms for any publically available version or # define ERR_LIB_NONE 1
* derivative of this code cannot be changed. i.e. this code cannot simply be # define ERR_LIB_SYS 2
* copied and put under another distribution licence # define ERR_LIB_BN 3
* [including the GNU Public Licence.] # define ERR_LIB_RSA 4
*/ # define ERR_LIB_DH 5
/* ==================================================================== # define ERR_LIB_EVP 6
* Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved. # define ERR_LIB_BUF 7
* # define ERR_LIB_OBJ 8
* Redistribution and use in source and binary forms, with or without # define ERR_LIB_PEM 9
* modification, are permitted provided that the following conditions # define ERR_LIB_DSA 10
* are met: # define ERR_LIB_X509 11
* /* #define ERR_LIB_METH 12 */
* 1. Redistributions of source code must retain the above copyright # define ERR_LIB_ASN1 13
* notice, this list of conditions and the following disclaimer. # define ERR_LIB_CONF 14
* # define ERR_LIB_CRYPTO 15
* 2. Redistributions in binary form must reproduce the above copyright # define ERR_LIB_EC 16
* notice, this list of conditions and the following disclaimer in # define ERR_LIB_SSL 20
* the documentation and/or other materials provided with the /* #define ERR_LIB_SSL23 21 */
* distribution. /* #define ERR_LIB_SSL2 22 */
* /* #define ERR_LIB_SSL3 23 */
* 3. All advertising materials mentioning features or use of this /* #define ERR_LIB_RSAREF 30 */
* software must display the following acknowledgment: /* #define ERR_LIB_PROXY 31 */
* "This product includes software developed by the OpenSSL Project # define ERR_LIB_BIO 32
* for use in the OpenSSL Toolkit. (http://www.openssl.org/)" # define ERR_LIB_PKCS7 33
* # define ERR_LIB_X509V3 34
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to # define ERR_LIB_PKCS12 35
* endorse or promote products derived from this software without # define ERR_LIB_RAND 36
* prior written permission. For written permission, please contact # define ERR_LIB_DSO 37
* openssl-core@openssl.org. # define ERR_LIB_ENGINE 38
* # define ERR_LIB_OCSP 39
* 5. Products derived from this software may not be called "OpenSSL" # define ERR_LIB_UI 40
* nor may "OpenSSL" appear in their names without prior written # define ERR_LIB_COMP 41
* permission of the OpenSSL Project. # define ERR_LIB_ECDSA 42
* # define ERR_LIB_ECDH 43
* 6. Redistributions of any form whatsoever must retain the following # define ERR_LIB_OSSL_STORE 44
* acknowledgment: # define ERR_LIB_FIPS 45
* "This product includes software developed by the OpenSSL Project # define ERR_LIB_CMS 46
* for use in the OpenSSL Toolkit (http://www.openssl.org/)" # define ERR_LIB_TS 47
* # define ERR_LIB_HMAC 48
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY /* # define ERR_LIB_JPAKE 49 */
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # define ERR_LIB_CT 50
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR # define ERR_LIB_ASYNC 51
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR # define ERR_LIB_KDF 52
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, # define ERR_LIB_SM2 53
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; # define ERR_LIB_USER 128
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, # define SYSerr(f,r) ERR_PUT_error(ERR_LIB_SYS,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) # define BNerr(f,r) ERR_PUT_error(ERR_LIB_BN,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED # define RSAerr(f,r) ERR_PUT_error(ERR_LIB_RSA,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
* OF THE POSSIBILITY OF SUCH DAMAGE. # define DHerr(f,r) ERR_PUT_error(ERR_LIB_DH,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
* ==================================================================== # define EVPerr(f,r) ERR_PUT_error(ERR_LIB_EVP,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
* # define BUFerr(f,r) ERR_PUT_error(ERR_LIB_BUF,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
* This product includes cryptographic software written by Eric Young # define OBJerr(f,r) ERR_PUT_error(ERR_LIB_OBJ,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
* (eay@cryptsoft.com). This product includes software written by Tim # define PEMerr(f,r) ERR_PUT_error(ERR_LIB_PEM,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
* Hudson (tjh@cryptsoft.com). # define DSAerr(f,r) ERR_PUT_error(ERR_LIB_DSA,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
* # define X509err(f,r) ERR_PUT_error(ERR_LIB_X509,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
*/ # define ASN1err(f,r) ERR_PUT_error(ERR_LIB_ASN1,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
# define CONFerr(f,r) ERR_PUT_error(ERR_LIB_CONF,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
#ifndef HEADER_ERR_H # define CRYPTOerr(f,r) ERR_PUT_error(ERR_LIB_CRYPTO,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
# define HEADER_ERR_H # define ECerr(f,r) ERR_PUT_error(ERR_LIB_EC,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
# define SSLerr(f,r) ERR_PUT_error(ERR_LIB_SSL,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
# include <openssl/e_os2.h> # define BIOerr(f,r) ERR_PUT_error(ERR_LIB_BIO,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
# define PKCS7err(f,r) ERR_PUT_error(ERR_LIB_PKCS7,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
# ifndef OPENSSL_NO_FP_API # define X509V3err(f,r) ERR_PUT_error(ERR_LIB_X509V3,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
# include <stdio.h> # define PKCS12err(f,r) ERR_PUT_error(ERR_LIB_PKCS12,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
# include <stdlib.h> # define RANDerr(f,r) ERR_PUT_error(ERR_LIB_RAND,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
# endif # define DSOerr(f,r) ERR_PUT_error(ERR_LIB_DSO,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
# define ENGINEerr(f,r) ERR_PUT_error(ERR_LIB_ENGINE,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
# include <openssl/ossl_typ.h> # define OCSPerr(f,r) ERR_PUT_error(ERR_LIB_OCSP,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
# ifndef OPENSSL_NO_BIO # define UIerr(f,r) ERR_PUT_error(ERR_LIB_UI,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
# include <openssl/bio.h> # define COMPerr(f,r) ERR_PUT_error(ERR_LIB_COMP,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
# endif # define ECDSAerr(f,r) ERR_PUT_error(ERR_LIB_ECDSA,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
# ifndef OPENSSL_NO_LHASH # define ECDHerr(f,r) ERR_PUT_error(ERR_LIB_ECDH,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
# include <openssl/lhash.h> # define OSSL_STOREerr(f,r) ERR_PUT_error(ERR_LIB_OSSL_STORE,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
# endif # define FIPSerr(f,r) ERR_PUT_error(ERR_LIB_FIPS,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
# define CMSerr(f,r) ERR_PUT_error(ERR_LIB_CMS,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
#ifdef __cplusplus # define TSerr(f,r) ERR_PUT_error(ERR_LIB_TS,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
extern "C" { # define HMACerr(f,r) ERR_PUT_error(ERR_LIB_HMAC,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
#endif # define CTerr(f,r) ERR_PUT_error(ERR_LIB_CT,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
# define ASYNCerr(f,r) ERR_PUT_error(ERR_LIB_ASYNC,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
# ifndef OPENSSL_NO_ERR # define KDFerr(f,r) ERR_PUT_error(ERR_LIB_KDF,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
# define ERR_PUT_error(a,b,c,d,e) ERR_put_error(a,b,c,d,e) # define SM2err(f,r) ERR_PUT_error(ERR_LIB_SM2,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
# else
# define ERR_PUT_error(a,b,c,d,e) ERR_put_error(a,b,c,NULL,0) # define ERR_PACK(l,f,r) ( \
# endif (((unsigned int)(l) & 0x0FF) << 24L) | \
(((unsigned int)(f) & 0xFFF) << 12L) | \
# include <errno.h> (((unsigned int)(r) & 0xFFF) ) )
# define ERR_GET_LIB(l) (int)(((l) >> 24L) & 0x0FFL)
# define ERR_TXT_MALLOCED 0x01 # define ERR_GET_FUNC(l) (int)(((l) >> 12L) & 0xFFFL)
# define ERR_TXT_STRING 0x02 # define ERR_GET_REASON(l) (int)( (l) & 0xFFFL)
# define ERR_FATAL_ERROR(l) (int)( (l) & ERR_R_FATAL)
# define ERR_FLAG_MARK 0x01
/* OS functions */
# define ERR_NUM_ERRORS 16 # define SYS_F_FOPEN 1
typedef struct err_state_st { # define SYS_F_CONNECT 2
CRYPTO_THREADID tid; # define SYS_F_GETSERVBYNAME 3
int err_flags[ERR_NUM_ERRORS]; # define SYS_F_SOCKET 4
unsigned long err_buffer[ERR_NUM_ERRORS]; # define SYS_F_IOCTLSOCKET 5
char *err_data[ERR_NUM_ERRORS]; # define SYS_F_BIND 6
int err_data_flags[ERR_NUM_ERRORS]; # define SYS_F_LISTEN 7
const char *err_file[ERR_NUM_ERRORS]; # define SYS_F_ACCEPT 8
int err_line[ERR_NUM_ERRORS]; # define SYS_F_WSASTARTUP 9/* Winsock stuff */
int top, bottom; # define SYS_F_OPENDIR 10
} ERR_STATE; # define SYS_F_FREAD 11
# define SYS_F_GETADDRINFO 12
/* library */ # define SYS_F_GETNAMEINFO 13
# define ERR_LIB_NONE 1 # define SYS_F_SETSOCKOPT 14
# define ERR_LIB_SYS 2 # define SYS_F_GETSOCKOPT 15
# define ERR_LIB_BN 3 # define SYS_F_GETSOCKNAME 16
# define ERR_LIB_RSA 4 # define SYS_F_GETHOSTBYNAME 17
# define ERR_LIB_DH 5 # define SYS_F_FFLUSH 18
# define ERR_LIB_EVP 6 # define SYS_F_OPEN 19
# define ERR_LIB_BUF 7 # define SYS_F_CLOSE 20
# define ERR_LIB_OBJ 8 # define SYS_F_IOCTL 21
# define ERR_LIB_PEM 9 # define SYS_F_STAT 22
# define ERR_LIB_DSA 10 # define SYS_F_FCNTL 23
# define ERR_LIB_X509 11 # define SYS_F_FSTAT 24
/* #define ERR_LIB_METH 12 */
# define ERR_LIB_ASN1 13 /* reasons */
# define ERR_LIB_CONF 14 # define ERR_R_SYS_LIB ERR_LIB_SYS/* 2 */
# define ERR_LIB_CRYPTO 15 # define ERR_R_BN_LIB ERR_LIB_BN/* 3 */
# define ERR_LIB_EC 16 # define ERR_R_RSA_LIB ERR_LIB_RSA/* 4 */
# define ERR_LIB_SSL 20 # define ERR_R_DH_LIB ERR_LIB_DH/* 5 */
/* #define ERR_LIB_SSL23 21 */ # define ERR_R_EVP_LIB ERR_LIB_EVP/* 6 */
/* #define ERR_LIB_SSL2 22 */ # define ERR_R_BUF_LIB ERR_LIB_BUF/* 7 */
/* #define ERR_LIB_SSL3 23 */ # define ERR_R_OBJ_LIB ERR_LIB_OBJ/* 8 */
/* #define ERR_LIB_RSAREF 30 */ # define ERR_R_PEM_LIB ERR_LIB_PEM/* 9 */
/* #define ERR_LIB_PROXY 31 */ # define ERR_R_DSA_LIB ERR_LIB_DSA/* 10 */
# define ERR_LIB_BIO 32 # define ERR_R_X509_LIB ERR_LIB_X509/* 11 */
# define ERR_LIB_PKCS7 33 # define ERR_R_ASN1_LIB ERR_LIB_ASN1/* 13 */
# define ERR_LIB_X509V3 34 # define ERR_R_EC_LIB ERR_LIB_EC/* 16 */
# define ERR_LIB_PKCS12 35 # define ERR_R_BIO_LIB ERR_LIB_BIO/* 32 */
# define ERR_LIB_RAND 36 # define ERR_R_PKCS7_LIB ERR_LIB_PKCS7/* 33 */
# define ERR_LIB_DSO 37 # define ERR_R_X509V3_LIB ERR_LIB_X509V3/* 34 */
# define ERR_LIB_ENGINE 38 # define ERR_R_ENGINE_LIB ERR_LIB_ENGINE/* 38 */
# define ERR_LIB_OCSP 39 # define ERR_R_UI_LIB ERR_LIB_UI/* 40 */
# define ERR_LIB_UI 40 # define ERR_R_ECDSA_LIB ERR_LIB_ECDSA/* 42 */
# define ERR_LIB_COMP 41 # define ERR_R_OSSL_STORE_LIB ERR_LIB_OSSL_STORE/* 44 */
# define ERR_LIB_ECDSA 42
# define ERR_LIB_ECDH 43 # define ERR_R_NESTED_ASN1_ERROR 58
# define ERR_LIB_STORE 44 # define ERR_R_MISSING_ASN1_EOS 63
# define ERR_LIB_FIPS 45
# define ERR_LIB_CMS 46 /* fatal error */
# define ERR_LIB_TS 47 # define ERR_R_FATAL 64
# define ERR_LIB_HMAC 48 # define ERR_R_MALLOC_FAILURE (1|ERR_R_FATAL)
# define ERR_LIB_JPAKE 49 # define ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED (2|ERR_R_FATAL)
# define ERR_R_PASSED_NULL_PARAMETER (3|ERR_R_FATAL)
# define ERR_LIB_USER 128 # define ERR_R_INTERNAL_ERROR (4|ERR_R_FATAL)
# define ERR_R_DISABLED (5|ERR_R_FATAL)
# define SYSerr(f,r) ERR_PUT_error(ERR_LIB_SYS,(f),(r),__FILE__,__LINE__) # define ERR_R_INIT_FAIL (6|ERR_R_FATAL)
# define BNerr(f,r) ERR_PUT_error(ERR_LIB_BN,(f),(r),__FILE__,__LINE__) # define ERR_R_PASSED_INVALID_ARGUMENT (7)
# define RSAerr(f,r) ERR_PUT_error(ERR_LIB_RSA,(f),(r),__FILE__,__LINE__) # define ERR_R_OPERATION_FAIL (8|ERR_R_FATAL)
# define DHerr(f,r) ERR_PUT_error(ERR_LIB_DH,(f),(r),__FILE__,__LINE__)
# define EVPerr(f,r) ERR_PUT_error(ERR_LIB_EVP,(f),(r),__FILE__,__LINE__) /*
# define BUFerr(f,r) ERR_PUT_error(ERR_LIB_BUF,(f),(r),__FILE__,__LINE__) * 99 is the maximum possible ERR_R_... code, higher values are reserved for
# define OBJerr(f,r) ERR_PUT_error(ERR_LIB_OBJ,(f),(r),__FILE__,__LINE__) * the individual libraries
# define PEMerr(f,r) ERR_PUT_error(ERR_LIB_PEM,(f),(r),__FILE__,__LINE__) */
# define DSAerr(f,r) ERR_PUT_error(ERR_LIB_DSA,(f),(r),__FILE__,__LINE__)
# define X509err(f,r) ERR_PUT_error(ERR_LIB_X509,(f),(r),__FILE__,__LINE__) typedef struct ERR_string_data_st {
# define ASN1err(f,r) ERR_PUT_error(ERR_LIB_ASN1,(f),(r),__FILE__,__LINE__) unsigned long error;
# define CONFerr(f,r) ERR_PUT_error(ERR_LIB_CONF,(f),(r),__FILE__,__LINE__) const char *string;
# define CRYPTOerr(f,r) ERR_PUT_error(ERR_LIB_CRYPTO,(f),(r),__FILE__,__LINE__) } ERR_STRING_DATA;
# define ECerr(f,r) ERR_PUT_error(ERR_LIB_EC,(f),(r),__FILE__,__LINE__)
# define SSLerr(f,r) ERR_PUT_error(ERR_LIB_SSL,(f),(r),__FILE__,__LINE__) DEFINE_LHASH_OF(ERR_STRING_DATA);
# define BIOerr(f,r) ERR_PUT_error(ERR_LIB_BIO,(f),(r),__FILE__,__LINE__)
# define PKCS7err(f,r) ERR_PUT_error(ERR_LIB_PKCS7,(f),(r),__FILE__,__LINE__) void ERR_put_error(int lib, int func, int reason, const char *file, int line);
# define X509V3err(f,r) ERR_PUT_error(ERR_LIB_X509V3,(f),(r),__FILE__,__LINE__) void ERR_set_error_data(char *data, int flags);
# define PKCS12err(f,r) ERR_PUT_error(ERR_LIB_PKCS12,(f),(r),__FILE__,__LINE__)
# define RANDerr(f,r) ERR_PUT_error(ERR_LIB_RAND,(f),(r),__FILE__,__LINE__) unsigned long ERR_get_error(void);
# define DSOerr(f,r) ERR_PUT_error(ERR_LIB_DSO,(f),(r),__FILE__,__LINE__) unsigned long ERR_get_error_line(const char **file, int *line);
# define ENGINEerr(f,r) ERR_PUT_error(ERR_LIB_ENGINE,(f),(r),__FILE__,__LINE__) unsigned long ERR_get_error_line_data(const char **file, int *line,
# define OCSPerr(f,r) ERR_PUT_error(ERR_LIB_OCSP,(f),(r),__FILE__,__LINE__) const char **data, int *flags);
# define UIerr(f,r) ERR_PUT_error(ERR_LIB_UI,(f),(r),__FILE__,__LINE__) unsigned long ERR_peek_error(void);
# define COMPerr(f,r) ERR_PUT_error(ERR_LIB_COMP,(f),(r),__FILE__,__LINE__) unsigned long ERR_peek_error_line(const char **file, int *line);
# define ECDSAerr(f,r) ERR_PUT_error(ERR_LIB_ECDSA,(f),(r),__FILE__,__LINE__) unsigned long ERR_peek_error_line_data(const char **file, int *line,
# define ECDHerr(f,r) ERR_PUT_error(ERR_LIB_ECDH,(f),(r),__FILE__,__LINE__) const char **data, int *flags);
# define STOREerr(f,r) ERR_PUT_error(ERR_LIB_STORE,(f),(r),__FILE__,__LINE__) unsigned long ERR_peek_last_error(void);
# define FIPSerr(f,r) ERR_PUT_error(ERR_LIB_FIPS,(f),(r),__FILE__,__LINE__) unsigned long ERR_peek_last_error_line(const char **file, int *line);
# define CMSerr(f,r) ERR_PUT_error(ERR_LIB_CMS,(f),(r),__FILE__,__LINE__) unsigned long ERR_peek_last_error_line_data(const char **file, int *line,
# define TSerr(f,r) ERR_PUT_error(ERR_LIB_TS,(f),(r),__FILE__,__LINE__) const char **data, int *flags);
# define HMACerr(f,r) ERR_PUT_error(ERR_LIB_HMAC,(f),(r),__FILE__,__LINE__) void ERR_clear_error(void);
# define JPAKEerr(f,r) ERR_PUT_error(ERR_LIB_JPAKE,(f),(r),__FILE__,__LINE__) char *ERR_error_string(unsigned long e, char *buf);
void ERR_error_string_n(unsigned long e, char *buf, size_t len);
/* const char *ERR_lib_error_string(unsigned long e);
* Borland C seems too stupid to be able to shift and do longs in the const char *ERR_func_error_string(unsigned long e);
* pre-processor :-( const char *ERR_reason_error_string(unsigned long e);
*/ void ERR_print_errors_cb(int (*cb) (const char *str, size_t len, void *u),
# define ERR_PACK(l,f,r) (((((unsigned long)l)&0xffL)*0x1000000)| \ void *u);
((((unsigned long)f)&0xfffL)*0x1000)| \ # ifndef OPENSSL_NO_STDIO
((((unsigned long)r)&0xfffL))) void ERR_print_errors_fp(FILE *fp);
# define ERR_GET_LIB(l) (int)((((unsigned long)l)>>24L)&0xffL) # endif
# define ERR_GET_FUNC(l) (int)((((unsigned long)l)>>12L)&0xfffL) void ERR_print_errors(BIO *bp);
# define ERR_GET_REASON(l) (int)((l)&0xfffL) void ERR_add_error_data(int num, ...);
# define ERR_FATAL_ERROR(l) (int)((l)&ERR_R_FATAL) void ERR_add_error_vdata(int num, va_list args);
int ERR_load_strings(int lib, ERR_STRING_DATA *str);
/* OS functions */ int ERR_load_strings_const(const ERR_STRING_DATA *str);
# define SYS_F_FOPEN 1 int ERR_unload_strings(int lib, ERR_STRING_DATA *str);
# define SYS_F_CONNECT 2 int ERR_load_ERR_strings(void);
# define SYS_F_GETSERVBYNAME 3
# define SYS_F_SOCKET 4 #if OPENSSL_API_COMPAT < 0x10100000L
# define SYS_F_IOCTLSOCKET 5 # define ERR_load_crypto_strings() \
# define SYS_F_BIND 6 OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CRYPTO_STRINGS, NULL)
# define SYS_F_LISTEN 7 # define ERR_free_strings() while(0) continue
# define SYS_F_ACCEPT 8 #endif
# define SYS_F_WSASTARTUP 9/* Winsock stuff */
# define SYS_F_OPENDIR 10 DEPRECATEDIN_1_1_0(void ERR_remove_thread_state(void *))
# define SYS_F_FREAD 11 DEPRECATEDIN_1_0_0(void ERR_remove_state(unsigned long pid))
ERR_STATE *ERR_get_state(void);
/* reasons */
# define ERR_R_SYS_LIB ERR_LIB_SYS/* 2 */ int ERR_get_next_error_library(void);
# define ERR_R_BN_LIB ERR_LIB_BN/* 3 */
# define ERR_R_RSA_LIB ERR_LIB_RSA/* 4 */ int ERR_set_mark(void);
# define ERR_R_DH_LIB ERR_LIB_DH/* 5 */ int ERR_pop_to_mark(void);
# define ERR_R_EVP_LIB ERR_LIB_EVP/* 6 */ int ERR_clear_last_mark(void);
# define ERR_R_BUF_LIB ERR_LIB_BUF/* 7 */
# define ERR_R_OBJ_LIB ERR_LIB_OBJ/* 8 */ #ifdef __cplusplus
# define ERR_R_PEM_LIB ERR_LIB_PEM/* 9 */ }
# define ERR_R_DSA_LIB ERR_LIB_DSA/* 10 */ #endif
# define ERR_R_X509_LIB ERR_LIB_X509/* 11 */
# define ERR_R_ASN1_LIB ERR_LIB_ASN1/* 13 */ #endif
# define ERR_R_CONF_LIB ERR_LIB_CONF/* 14 */
# define ERR_R_CRYPTO_LIB ERR_LIB_CRYPTO/* 15 */
# define ERR_R_EC_LIB ERR_LIB_EC/* 16 */
# define ERR_R_SSL_LIB ERR_LIB_SSL/* 20 */
# define ERR_R_BIO_LIB ERR_LIB_BIO/* 32 */
# define ERR_R_PKCS7_LIB ERR_LIB_PKCS7/* 33 */
# define ERR_R_X509V3_LIB ERR_LIB_X509V3/* 34 */
# define ERR_R_PKCS12_LIB ERR_LIB_PKCS12/* 35 */
# define ERR_R_RAND_LIB ERR_LIB_RAND/* 36 */
# define ERR_R_DSO_LIB ERR_LIB_DSO/* 37 */
# define ERR_R_ENGINE_LIB ERR_LIB_ENGINE/* 38 */
# define ERR_R_OCSP_LIB ERR_LIB_OCSP/* 39 */
# define ERR_R_UI_LIB ERR_LIB_UI/* 40 */
# define ERR_R_COMP_LIB ERR_LIB_COMP/* 41 */
# define ERR_R_ECDSA_LIB ERR_LIB_ECDSA/* 42 */
# define ERR_R_ECDH_LIB ERR_LIB_ECDH/* 43 */
# define ERR_R_STORE_LIB ERR_LIB_STORE/* 44 */
# define ERR_R_TS_LIB ERR_LIB_TS/* 45 */
# define ERR_R_NESTED_ASN1_ERROR 58
# define ERR_R_BAD_ASN1_OBJECT_HEADER 59
# define ERR_R_BAD_GET_ASN1_OBJECT_CALL 60
# define ERR_R_EXPECTING_AN_ASN1_SEQUENCE 61
# define ERR_R_ASN1_LENGTH_MISMATCH 62
# define ERR_R_MISSING_ASN1_EOS 63
/* fatal error */
# define ERR_R_FATAL 64
# define ERR_R_MALLOC_FAILURE (1|ERR_R_FATAL)
# define ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED (2|ERR_R_FATAL)
# define ERR_R_PASSED_NULL_PARAMETER (3|ERR_R_FATAL)
# define ERR_R_INTERNAL_ERROR (4|ERR_R_FATAL)
# define ERR_R_DISABLED (5|ERR_R_FATAL)
/*
* 99 is the maximum possible ERR_R_... code, higher values are reserved for
* the individual libraries
*/
typedef struct ERR_string_data_st {
unsigned long error;
const char *string;
} ERR_STRING_DATA;
void ERR_put_error(int lib, int func, int reason, const char *file, int line);
void ERR_set_error_data(char *data, int flags);
unsigned long ERR_get_error(void);
unsigned long ERR_get_error_line(const char **file, int *line);
unsigned long ERR_get_error_line_data(const char **file, int *line,
const char **data, int *flags);
unsigned long ERR_peek_error(void);
unsigned long ERR_peek_error_line(const char **file, int *line);
unsigned long ERR_peek_error_line_data(const char **file, int *line,
const char **data, int *flags);
unsigned long ERR_peek_last_error(void);
unsigned long ERR_peek_last_error_line(const char **file, int *line);
unsigned long ERR_peek_last_error_line_data(const char **file, int *line,
const char **data, int *flags);
void ERR_clear_error(void);
char *ERR_error_string(unsigned long e, char *buf);
void ERR_error_string_n(unsigned long e, char *buf, size_t len);
const char *ERR_lib_error_string(unsigned long e);
const char *ERR_func_error_string(unsigned long e);
const char *ERR_reason_error_string(unsigned long e);
void ERR_print_errors_cb(int (*cb) (const char *str, size_t len, void *u),
void *u);
# ifndef OPENSSL_NO_FP_API
void ERR_print_errors_fp(FILE *fp);
# endif
# ifndef OPENSSL_NO_BIO
void ERR_print_errors(BIO *bp);
# endif
void ERR_add_error_data(int num, ...);
void ERR_add_error_vdata(int num, va_list args);
void ERR_load_strings(int lib, ERR_STRING_DATA str[]);
void ERR_unload_strings(int lib, ERR_STRING_DATA str[]);
void ERR_load_ERR_strings(void);
void ERR_load_crypto_strings(void);
void ERR_free_strings(void);
void ERR_remove_thread_state(const CRYPTO_THREADID *tid);
# ifndef OPENSSL_NO_DEPRECATED
void ERR_remove_state(unsigned long pid); /* if zero we look it up */
# endif
ERR_STATE *ERR_get_state(void);
# ifndef OPENSSL_NO_LHASH
LHASH_OF(ERR_STRING_DATA) *ERR_get_string_table(void);
LHASH_OF(ERR_STATE) *ERR_get_err_state_table(void);
void ERR_release_err_state_table(LHASH_OF(ERR_STATE) **hash);
# endif
int ERR_get_next_error_library(void);
int ERR_set_mark(void);
int ERR_pop_to_mark(void);
/* Already defined in ossl_typ.h */
/* typedef struct st_ERR_FNS ERR_FNS; */
/*
* An application can use this function and provide the return value to
* loaded modules that should use the application's ERR state/functionality
*/
const ERR_FNS *ERR_get_implementation(void);
/*
* A loaded module should call this function prior to any ERR operations
* using the application's "ERR_FNS".
*/
int ERR_set_implementation(const ERR_FNS *fns);
#ifdef __cplusplus
}
#endif
#endif

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,193 @@
/*
* Generated by util/mkerr.pl DO NOT EDIT
* Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/license.html
*/
#ifndef HEADER_EVPERR_H
# define HEADER_EVPERR_H
# ifdef __cplusplus
extern "C"
# endif
int ERR_load_EVP_strings(void);
/*
* EVP function codes.
*/
# define EVP_F_AESNI_INIT_KEY 165
# define EVP_F_AES_GCM_CTRL 196
# define EVP_F_AES_INIT_KEY 133
# define EVP_F_AES_OCB_CIPHER 169
# define EVP_F_AES_T4_INIT_KEY 178
# define EVP_F_AES_WRAP_CIPHER 170
# define EVP_F_ALG_MODULE_INIT 177
# define EVP_F_ARIA_CCM_INIT_KEY 175
# define EVP_F_ARIA_GCM_CTRL 197
# define EVP_F_ARIA_GCM_INIT_KEY 176
# define EVP_F_ARIA_INIT_KEY 185
# define EVP_F_B64_NEW 198
# define EVP_F_CAMELLIA_INIT_KEY 159
# define EVP_F_CHACHA20_POLY1305_CTRL 182
# define EVP_F_CMLL_T4_INIT_KEY 179
# define EVP_F_DES_EDE3_WRAP_CIPHER 171
# define EVP_F_DO_SIGVER_INIT 161
# define EVP_F_ENC_NEW 199
# define EVP_F_EVP_CIPHERINIT_EX 123
# define EVP_F_EVP_CIPHER_ASN1_TO_PARAM 204
# define EVP_F_EVP_CIPHER_CTX_COPY 163
# define EVP_F_EVP_CIPHER_CTX_CTRL 124
# define EVP_F_EVP_CIPHER_CTX_SET_KEY_LENGTH 122
# define EVP_F_EVP_CIPHER_PARAM_TO_ASN1 205
# define EVP_F_EVP_DECRYPTFINAL_EX 101
# define EVP_F_EVP_DECRYPTUPDATE 166
# define EVP_F_EVP_DIGESTFINALXOF 174
# define EVP_F_EVP_DIGESTINIT_EX 128
# define EVP_F_EVP_ENCRYPTFINAL_EX 127
# define EVP_F_EVP_ENCRYPTUPDATE 167
# define EVP_F_EVP_MD_CTX_COPY_EX 110
# define EVP_F_EVP_MD_SIZE 162
# define EVP_F_EVP_OPENINIT 102
# define EVP_F_EVP_PBE_ALG_ADD 115
# define EVP_F_EVP_PBE_ALG_ADD_TYPE 160
# define EVP_F_EVP_PBE_CIPHERINIT 116
# define EVP_F_EVP_PBE_SCRYPT 181
# define EVP_F_EVP_PKCS82PKEY 111
# define EVP_F_EVP_PKEY2PKCS8 113
# define EVP_F_EVP_PKEY_ASN1_ADD0 188
# define EVP_F_EVP_PKEY_CHECK 186
# define EVP_F_EVP_PKEY_COPY_PARAMETERS 103
# define EVP_F_EVP_PKEY_CTX_CTRL 137
# define EVP_F_EVP_PKEY_CTX_CTRL_STR 150
# define EVP_F_EVP_PKEY_CTX_DUP 156
# define EVP_F_EVP_PKEY_CTX_MD 168
# define EVP_F_EVP_PKEY_DECRYPT 104
# define EVP_F_EVP_PKEY_DECRYPT_INIT 138
# define EVP_F_EVP_PKEY_DECRYPT_OLD 151
# define EVP_F_EVP_PKEY_DERIVE 153
# define EVP_F_EVP_PKEY_DERIVE_INIT 154
# define EVP_F_EVP_PKEY_DERIVE_SET_PEER 155
# define EVP_F_EVP_PKEY_ENCRYPT 105
# define EVP_F_EVP_PKEY_ENCRYPT_INIT 139
# define EVP_F_EVP_PKEY_ENCRYPT_OLD 152
# define EVP_F_EVP_PKEY_GET0_DH 119
# define EVP_F_EVP_PKEY_GET0_DSA 120
# define EVP_F_EVP_PKEY_GET0_EC_KEY 131
# define EVP_F_EVP_PKEY_GET0_HMAC 183
# define EVP_F_EVP_PKEY_GET0_POLY1305 184
# define EVP_F_EVP_PKEY_GET0_RSA 121
# define EVP_F_EVP_PKEY_GET0_SIPHASH 172
# define EVP_F_EVP_PKEY_GET_RAW_PRIVATE_KEY 202
# define EVP_F_EVP_PKEY_GET_RAW_PUBLIC_KEY 203
# define EVP_F_EVP_PKEY_KEYGEN 146
# define EVP_F_EVP_PKEY_KEYGEN_INIT 147
# define EVP_F_EVP_PKEY_METH_ADD0 194
# define EVP_F_EVP_PKEY_METH_NEW 195
# define EVP_F_EVP_PKEY_NEW 106
# define EVP_F_EVP_PKEY_NEW_CMAC_KEY 193
# define EVP_F_EVP_PKEY_NEW_RAW_PRIVATE_KEY 191
# define EVP_F_EVP_PKEY_NEW_RAW_PUBLIC_KEY 192
# define EVP_F_EVP_PKEY_PARAMGEN 148
# define EVP_F_EVP_PKEY_PARAMGEN_INIT 149
# define EVP_F_EVP_PKEY_PARAM_CHECK 189
# define EVP_F_EVP_PKEY_PUBLIC_CHECK 190
# define EVP_F_EVP_PKEY_SET1_ENGINE 187
# define EVP_F_EVP_PKEY_SET_ALIAS_TYPE 206
# define EVP_F_EVP_PKEY_SIGN 140
# define EVP_F_EVP_PKEY_SIGN_INIT 141
# define EVP_F_EVP_PKEY_VERIFY 142
# define EVP_F_EVP_PKEY_VERIFY_INIT 143
# define EVP_F_EVP_PKEY_VERIFY_RECOVER 144
# define EVP_F_EVP_PKEY_VERIFY_RECOVER_INIT 145
# define EVP_F_EVP_SIGNFINAL 107
# define EVP_F_EVP_VERIFYFINAL 108
# define EVP_F_INT_CTX_NEW 157
# define EVP_F_OK_NEW 200
# define EVP_F_PKCS5_PBE_KEYIVGEN 117
# define EVP_F_PKCS5_V2_PBE_KEYIVGEN 118
# define EVP_F_PKCS5_V2_PBKDF2_KEYIVGEN 164
# define EVP_F_PKCS5_V2_SCRYPT_KEYIVGEN 180
# define EVP_F_PKEY_SET_TYPE 158
# define EVP_F_RC2_MAGIC_TO_METH 109
# define EVP_F_RC5_CTRL 125
# define EVP_F_S390X_AES_GCM_CTRL 201
# define EVP_F_UPDATE 173
/*
* EVP reason codes.
*/
# define EVP_R_AES_KEY_SETUP_FAILED 143
# define EVP_R_ARIA_KEY_SETUP_FAILED 176
# define EVP_R_BAD_DECRYPT 100
# define EVP_R_BUFFER_TOO_SMALL 155
# define EVP_R_CAMELLIA_KEY_SETUP_FAILED 157
# define EVP_R_CIPHER_PARAMETER_ERROR 122
# define EVP_R_COMMAND_NOT_SUPPORTED 147
# define EVP_R_COPY_ERROR 173
# define EVP_R_CTRL_NOT_IMPLEMENTED 132
# define EVP_R_CTRL_OPERATION_NOT_IMPLEMENTED 133
# define EVP_R_DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH 138
# define EVP_R_DECODE_ERROR 114
# define EVP_R_DIFFERENT_KEY_TYPES 101
# define EVP_R_DIFFERENT_PARAMETERS 153
# define EVP_R_ERROR_LOADING_SECTION 165
# define EVP_R_ERROR_SETTING_FIPS_MODE 166
# define EVP_R_EXPECTING_AN_HMAC_KEY 174
# define EVP_R_EXPECTING_AN_RSA_KEY 127
# define EVP_R_EXPECTING_A_DH_KEY 128
# define EVP_R_EXPECTING_A_DSA_KEY 129
# define EVP_R_EXPECTING_A_EC_KEY 142
# define EVP_R_EXPECTING_A_POLY1305_KEY 164
# define EVP_R_EXPECTING_A_SIPHASH_KEY 175
# define EVP_R_FIPS_MODE_NOT_SUPPORTED 167
# define EVP_R_GET_RAW_KEY_FAILED 182
# define EVP_R_ILLEGAL_SCRYPT_PARAMETERS 171
# define EVP_R_INITIALIZATION_ERROR 134
# define EVP_R_INPUT_NOT_INITIALIZED 111
# define EVP_R_INVALID_DIGEST 152
# define EVP_R_INVALID_FIPS_MODE 168
# define EVP_R_INVALID_KEY 163
# define EVP_R_INVALID_KEY_LENGTH 130
# define EVP_R_INVALID_OPERATION 148
# define EVP_R_KEYGEN_FAILURE 120
# define EVP_R_KEY_SETUP_FAILED 180
# define EVP_R_MEMORY_LIMIT_EXCEEDED 172
# define EVP_R_MESSAGE_DIGEST_IS_NULL 159
# define EVP_R_METHOD_NOT_SUPPORTED 144
# define EVP_R_MISSING_PARAMETERS 103
# define EVP_R_NOT_XOF_OR_INVALID_LENGTH 178
# define EVP_R_NO_CIPHER_SET 131
# define EVP_R_NO_DEFAULT_DIGEST 158
# define EVP_R_NO_DIGEST_SET 139
# define EVP_R_NO_KEY_SET 154
# define EVP_R_NO_OPERATION_SET 149
# define EVP_R_ONLY_ONESHOT_SUPPORTED 177
# define EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE 150
# define EVP_R_OPERATON_NOT_INITIALIZED 151
# define EVP_R_PARTIALLY_OVERLAPPING 162
# define EVP_R_PBKDF2_ERROR 181
# define EVP_R_PKEY_APPLICATION_ASN1_METHOD_ALREADY_REGISTERED 179
# define EVP_R_PRIVATE_KEY_DECODE_ERROR 145
# define EVP_R_PRIVATE_KEY_ENCODE_ERROR 146
# define EVP_R_PUBLIC_KEY_NOT_RSA 106
# define EVP_R_UNKNOWN_CIPHER 160
# define EVP_R_UNKNOWN_DIGEST 161
# define EVP_R_UNKNOWN_OPTION 169
# define EVP_R_UNKNOWN_PBE_ALGORITHM 121
# define EVP_R_UNSUPPORTED_ALGORITHM 156
# define EVP_R_UNSUPPORTED_CIPHER 107
# define EVP_R_UNSUPPORTED_KEYLENGTH 123
# define EVP_R_UNSUPPORTED_KEY_DERIVATION_FUNCTION 124
# define EVP_R_UNSUPPORTED_KEY_SIZE 108
# define EVP_R_UNSUPPORTED_NUMBER_OF_ROUNDS 135
# define EVP_R_UNSUPPORTED_PRF 125
# define EVP_R_UNSUPPORTED_PRIVATE_KEY_ALGORITHM 118
# define EVP_R_UNSUPPORTED_SALT_TYPE 126
# define EVP_R_WRAP_MODE_NOT_ALLOWED 170
# define EVP_R_WRONG_FINAL_BLOCK_LENGTH 109
#endif

View File

@ -1,109 +1,51 @@
/* crypto/hmac/hmac.h */ /*
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
* All rights reserved. *
* * Licensed under the OpenSSL license (the "License"). You may not use
* This package is an SSL implementation written * this file except in compliance with the License. You can obtain a copy
* by Eric Young (eay@cryptsoft.com). * in the file LICENSE in the source distribution or at
* The implementation was written so as to conform with Netscapes SSL. * https://www.openssl.org/source/license.html
* */
* This library is free for commercial and non-commercial use as long as
* the following conditions are aheared to. The following conditions #ifndef HEADER_HMAC_H
* apply to all code found in this distribution, be it the RC4, RSA, # define HEADER_HMAC_H
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
* included with this distribution is covered by the same copyright terms # include <openssl/opensslconf.h>
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
* # include <openssl/evp.h>
* Copyright remains Eric Young's, and as such any Copyright notices in
* the code are not to be removed. # if OPENSSL_API_COMPAT < 0x10200000L
* If this package is used in a product, Eric Young should be given attribution # define HMAC_MAX_MD_CBLOCK 128 /* Deprecated */
* as the author of the parts of the library used. # endif
* This can be in the form of a textual message at program startup or
* in documentation (online or textual) provided with the package. #ifdef __cplusplus
* extern "C" {
* Redistribution and use in source and binary forms, with or without #endif
* modification, are permitted provided that the following conditions
* are met: size_t HMAC_size(const HMAC_CTX *e);
* 1. Redistributions of source code must retain the copyright HMAC_CTX *HMAC_CTX_new(void);
* notice, this list of conditions and the following disclaimer. int HMAC_CTX_reset(HMAC_CTX *ctx);
* 2. Redistributions in binary form must reproduce the above copyright void HMAC_CTX_free(HMAC_CTX *ctx);
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution. DEPRECATEDIN_1_1_0(__owur int HMAC_Init(HMAC_CTX *ctx, const void *key, int len,
* 3. All advertising materials mentioning features or use of this software const EVP_MD *md))
* must display the following acknowledgement:
* "This product includes cryptographic software written by /*__owur*/ int HMAC_Init_ex(HMAC_CTX *ctx, const void *key, int len,
* Eric Young (eay@cryptsoft.com)" const EVP_MD *md, ENGINE *impl);
* The word 'cryptographic' can be left out if the rouines from the library /*__owur*/ int HMAC_Update(HMAC_CTX *ctx, const unsigned char *data,
* being used are not cryptographic related :-). size_t len);
* 4. If you include any Windows specific code (or a derivative thereof) from /*__owur*/ int HMAC_Final(HMAC_CTX *ctx, unsigned char *md,
* the apps directory (application code) you must include an acknowledgement: unsigned int *len);
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" unsigned char *HMAC(const EVP_MD *evp_md, const void *key, int key_len,
* const unsigned char *d, size_t n, unsigned char *md,
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND unsigned int *md_len);
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE __owur int HMAC_CTX_copy(HMAC_CTX *dctx, HMAC_CTX *sctx);
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE void HMAC_CTX_set_flags(HMAC_CTX *ctx, unsigned long flags);
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL const EVP_MD *HMAC_CTX_get_md(const HMAC_CTX *ctx);
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) #ifdef __cplusplus
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT }
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY #endif
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. #endif
*
* 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_HMAC_H
# define HEADER_HMAC_H
# include <openssl/opensslconf.h>
# ifdef OPENSSL_NO_HMAC
# error HMAC is disabled.
# endif
# include <openssl/evp.h>
# define HMAC_MAX_MD_CBLOCK 128/* largest known is SHA512 */
#ifdef __cplusplus
extern "C" {
#endif
typedef struct hmac_ctx_st {
const EVP_MD *md;
EVP_MD_CTX md_ctx;
EVP_MD_CTX i_ctx;
EVP_MD_CTX o_ctx;
unsigned int key_length;
unsigned char key[HMAC_MAX_MD_CBLOCK];
} HMAC_CTX;
# define HMAC_size(e) (EVP_MD_size((e)->md))
void HMAC_CTX_init(HMAC_CTX *ctx);
void HMAC_CTX_cleanup(HMAC_CTX *ctx);
/* deprecated */
# define HMAC_cleanup(ctx) HMAC_CTX_cleanup(ctx)
/* deprecated */
int HMAC_Init(HMAC_CTX *ctx, const void *key, int len, const EVP_MD *md);
int HMAC_Init_ex(HMAC_CTX *ctx, const void *key, int len,
const EVP_MD *md, ENGINE *impl);
int HMAC_Update(HMAC_CTX *ctx, const unsigned char *data, size_t len);
int HMAC_Final(HMAC_CTX *ctx, unsigned char *md, unsigned int *len);
unsigned char *HMAC(const EVP_MD *evp_md, const void *key, int key_len,
const unsigned char *d, size_t n, unsigned char *md,
unsigned int *md_len);
int HMAC_CTX_copy(HMAC_CTX *dctx, HMAC_CTX *sctx);
void HMAC_CTX_set_flags(HMAC_CTX *ctx, unsigned long flags);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -1,105 +1,64 @@
/* crypto/idea/idea.h */ /*
/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
* All rights reserved. *
* * Licensed under the OpenSSL license (the "License"). You may not use
* This package is an SSL implementation written * this file except in compliance with the License. You can obtain a copy
* by Eric Young (eay@cryptsoft.com). * in the file LICENSE in the source distribution or at
* The implementation was written so as to conform with Netscapes SSL. * https://www.openssl.org/source/license.html
* */
* This library is free for commercial and non-commercial use as long as
* the following conditions are aheared to. The following conditions #ifndef HEADER_IDEA_H
* apply to all code found in this distribution, be it the RC4, RSA, # define HEADER_IDEA_H
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
* included with this distribution is covered by the same copyright terms # include <openssl/opensslconf.h>
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
* # ifndef OPENSSL_NO_IDEA
* Copyright remains Eric Young's, and as such any Copyright notices in # ifdef __cplusplus
* the code are not to be removed. extern "C" {
* If this package is used in a product, Eric Young should be given attribution # endif
* as the author of the parts of the library used.
* This can be in the form of a textual message at program startup or typedef unsigned int IDEA_INT;
* in documentation (online or textual) provided with the package.
* # define IDEA_ENCRYPT 1
* Redistribution and use in source and binary forms, with or without # define IDEA_DECRYPT 0
* modification, are permitted provided that the following conditions
* are met: # define IDEA_BLOCK 8
* 1. Redistributions of source code must retain the copyright # define IDEA_KEY_LENGTH 16
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright typedef struct idea_key_st {
* notice, this list of conditions and the following disclaimer in the IDEA_INT data[9][6];
* documentation and/or other materials provided with the distribution. } IDEA_KEY_SCHEDULE;
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement: const char *IDEA_options(void);
* "This product includes cryptographic software written by void IDEA_ecb_encrypt(const unsigned char *in, unsigned char *out,
* Eric Young (eay@cryptsoft.com)" IDEA_KEY_SCHEDULE *ks);
* The word 'cryptographic' can be left out if the rouines from the library void IDEA_set_encrypt_key(const unsigned char *key, IDEA_KEY_SCHEDULE *ks);
* being used are not cryptographic related :-). void IDEA_set_decrypt_key(IDEA_KEY_SCHEDULE *ek, IDEA_KEY_SCHEDULE *dk);
* 4. If you include any Windows specific code (or a derivative thereof) from void IDEA_cbc_encrypt(const unsigned char *in, unsigned char *out,
* the apps directory (application code) you must include an acknowledgement: long length, IDEA_KEY_SCHEDULE *ks, unsigned char *iv,
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" int enc);
* void IDEA_cfb64_encrypt(const unsigned char *in, unsigned char *out,
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND long length, IDEA_KEY_SCHEDULE *ks, unsigned char *iv,
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE int *num, int enc);
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE void IDEA_ofb64_encrypt(const unsigned char *in, unsigned char *out,
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE long length, IDEA_KEY_SCHEDULE *ks, unsigned char *iv,
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL int *num);
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS void IDEA_encrypt(unsigned long *in, IDEA_KEY_SCHEDULE *ks);
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT # if OPENSSL_API_COMPAT < 0x10100000L
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY # define idea_options IDEA_options
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # define idea_ecb_encrypt IDEA_ecb_encrypt
* SUCH DAMAGE. # define idea_set_encrypt_key IDEA_set_encrypt_key
* # define idea_set_decrypt_key IDEA_set_decrypt_key
* The licence and distribution terms for any publically available version or # define idea_cbc_encrypt IDEA_cbc_encrypt
* derivative of this code cannot be changed. i.e. this code cannot simply be # define idea_cfb64_encrypt IDEA_cfb64_encrypt
* copied and put under another distribution licence # define idea_ofb64_encrypt IDEA_ofb64_encrypt
* [including the GNU Public Licence.] # define idea_encrypt IDEA_encrypt
*/ # endif
#ifndef HEADER_IDEA_H # ifdef __cplusplus
# define HEADER_IDEA_H }
# endif
# include <openssl/opensslconf.h>/* IDEA_INT, OPENSSL_NO_IDEA */ # endif
# ifdef OPENSSL_NO_IDEA #endif
# error IDEA is disabled.
# endif
# define IDEA_ENCRYPT 1
# define IDEA_DECRYPT 0
# define IDEA_BLOCK 8
# define IDEA_KEY_LENGTH 16
#ifdef __cplusplus
extern "C" {
#endif
typedef struct idea_key_st {
IDEA_INT data[9][6];
} IDEA_KEY_SCHEDULE;
const char *idea_options(void);
void idea_ecb_encrypt(const unsigned char *in, unsigned char *out,
IDEA_KEY_SCHEDULE *ks);
# ifdef OPENSSL_FIPS
void private_idea_set_encrypt_key(const unsigned char *key,
IDEA_KEY_SCHEDULE *ks);
# endif
void idea_set_encrypt_key(const unsigned char *key, IDEA_KEY_SCHEDULE *ks);
void idea_set_decrypt_key(IDEA_KEY_SCHEDULE *ek, IDEA_KEY_SCHEDULE *dk);
void idea_cbc_encrypt(const unsigned char *in, unsigned char *out,
long length, IDEA_KEY_SCHEDULE *ks, unsigned char *iv,
int enc);
void idea_cfb64_encrypt(const unsigned char *in, unsigned char *out,
long length, IDEA_KEY_SCHEDULE *ks, unsigned char *iv,
int *num, int enc);
void idea_ofb64_encrypt(const unsigned char *in, unsigned char *out,
long length, IDEA_KEY_SCHEDULE *ks, unsigned char *iv,
int *num);
void idea_encrypt(unsigned long *in, IDEA_KEY_SCHEDULE *ks);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,97 @@
/*
* Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/license.html
*/
#ifndef HEADER_KDF_H
# define HEADER_KDF_H
# include <openssl/kdferr.h>
#ifdef __cplusplus
extern "C" {
#endif
# define EVP_PKEY_CTRL_TLS_MD (EVP_PKEY_ALG_CTRL)
# define EVP_PKEY_CTRL_TLS_SECRET (EVP_PKEY_ALG_CTRL + 1)
# define EVP_PKEY_CTRL_TLS_SEED (EVP_PKEY_ALG_CTRL + 2)
# define EVP_PKEY_CTRL_HKDF_MD (EVP_PKEY_ALG_CTRL + 3)
# define EVP_PKEY_CTRL_HKDF_SALT (EVP_PKEY_ALG_CTRL + 4)
# define EVP_PKEY_CTRL_HKDF_KEY (EVP_PKEY_ALG_CTRL + 5)
# define EVP_PKEY_CTRL_HKDF_INFO (EVP_PKEY_ALG_CTRL + 6)
# define EVP_PKEY_CTRL_HKDF_MODE (EVP_PKEY_ALG_CTRL + 7)
# define EVP_PKEY_CTRL_PASS (EVP_PKEY_ALG_CTRL + 8)
# define EVP_PKEY_CTRL_SCRYPT_SALT (EVP_PKEY_ALG_CTRL + 9)
# define EVP_PKEY_CTRL_SCRYPT_N (EVP_PKEY_ALG_CTRL + 10)
# define EVP_PKEY_CTRL_SCRYPT_R (EVP_PKEY_ALG_CTRL + 11)
# define EVP_PKEY_CTRL_SCRYPT_P (EVP_PKEY_ALG_CTRL + 12)
# define EVP_PKEY_CTRL_SCRYPT_MAXMEM_BYTES (EVP_PKEY_ALG_CTRL + 13)
# define EVP_PKEY_HKDEF_MODE_EXTRACT_AND_EXPAND 0
# define EVP_PKEY_HKDEF_MODE_EXTRACT_ONLY 1
# define EVP_PKEY_HKDEF_MODE_EXPAND_ONLY 2
# define EVP_PKEY_CTX_set_tls1_prf_md(pctx, md) \
EVP_PKEY_CTX_ctrl(pctx, -1, EVP_PKEY_OP_DERIVE, \
EVP_PKEY_CTRL_TLS_MD, 0, (void *)(md))
# define EVP_PKEY_CTX_set1_tls1_prf_secret(pctx, sec, seclen) \
EVP_PKEY_CTX_ctrl(pctx, -1, EVP_PKEY_OP_DERIVE, \
EVP_PKEY_CTRL_TLS_SECRET, seclen, (void *)(sec))
# define EVP_PKEY_CTX_add1_tls1_prf_seed(pctx, seed, seedlen) \
EVP_PKEY_CTX_ctrl(pctx, -1, EVP_PKEY_OP_DERIVE, \
EVP_PKEY_CTRL_TLS_SEED, seedlen, (void *)(seed))
# define EVP_PKEY_CTX_set_hkdf_md(pctx, md) \
EVP_PKEY_CTX_ctrl(pctx, -1, EVP_PKEY_OP_DERIVE, \
EVP_PKEY_CTRL_HKDF_MD, 0, (void *)(md))
# define EVP_PKEY_CTX_set1_hkdf_salt(pctx, salt, saltlen) \
EVP_PKEY_CTX_ctrl(pctx, -1, EVP_PKEY_OP_DERIVE, \
EVP_PKEY_CTRL_HKDF_SALT, saltlen, (void *)(salt))
# define EVP_PKEY_CTX_set1_hkdf_key(pctx, key, keylen) \
EVP_PKEY_CTX_ctrl(pctx, -1, EVP_PKEY_OP_DERIVE, \
EVP_PKEY_CTRL_HKDF_KEY, keylen, (void *)(key))
# define EVP_PKEY_CTX_add1_hkdf_info(pctx, info, infolen) \
EVP_PKEY_CTX_ctrl(pctx, -1, EVP_PKEY_OP_DERIVE, \
EVP_PKEY_CTRL_HKDF_INFO, infolen, (void *)(info))
# define EVP_PKEY_CTX_hkdf_mode(pctx, mode) \
EVP_PKEY_CTX_ctrl(pctx, -1, EVP_PKEY_OP_DERIVE, \
EVP_PKEY_CTRL_HKDF_MODE, mode, NULL)
# define EVP_PKEY_CTX_set1_pbe_pass(pctx, pass, passlen) \
EVP_PKEY_CTX_ctrl(pctx, -1, EVP_PKEY_OP_DERIVE, \
EVP_PKEY_CTRL_PASS, passlen, (void *)(pass))
# define EVP_PKEY_CTX_set1_scrypt_salt(pctx, salt, saltlen) \
EVP_PKEY_CTX_ctrl(pctx, -1, EVP_PKEY_OP_DERIVE, \
EVP_PKEY_CTRL_SCRYPT_SALT, saltlen, (void *)(salt))
# define EVP_PKEY_CTX_set_scrypt_N(pctx, n) \
EVP_PKEY_CTX_ctrl_uint64(pctx, -1, EVP_PKEY_OP_DERIVE, \
EVP_PKEY_CTRL_SCRYPT_N, n)
# define EVP_PKEY_CTX_set_scrypt_r(pctx, r) \
EVP_PKEY_CTX_ctrl_uint64(pctx, -1, EVP_PKEY_OP_DERIVE, \
EVP_PKEY_CTRL_SCRYPT_R, r)
# define EVP_PKEY_CTX_set_scrypt_p(pctx, p) \
EVP_PKEY_CTX_ctrl_uint64(pctx, -1, EVP_PKEY_OP_DERIVE, \
EVP_PKEY_CTRL_SCRYPT_P, p)
# define EVP_PKEY_CTX_set_scrypt_maxmem_bytes(pctx, maxmem_bytes) \
EVP_PKEY_CTX_ctrl_uint64(pctx, -1, EVP_PKEY_OP_DERIVE, \
EVP_PKEY_CTRL_SCRYPT_MAXMEM_BYTES, maxmem_bytes)
# ifdef __cplusplus
}
# endif
#endif

View File

@ -0,0 +1,51 @@
/*
* Generated by util/mkerr.pl DO NOT EDIT
* Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/license.html
*/
#ifndef HEADER_KDFERR_H
# define HEADER_KDFERR_H
# ifdef __cplusplus
extern "C"
# endif
int ERR_load_KDF_strings(void);
/*
* KDF function codes.
*/
# define KDF_F_PKEY_HKDF_CTRL_STR 103
# define KDF_F_PKEY_HKDF_DERIVE 102
# define KDF_F_PKEY_HKDF_INIT 108
# define KDF_F_PKEY_SCRYPT_CTRL_STR 104
# define KDF_F_PKEY_SCRYPT_CTRL_UINT64 105
# define KDF_F_PKEY_SCRYPT_DERIVE 109
# define KDF_F_PKEY_SCRYPT_INIT 106
# define KDF_F_PKEY_SCRYPT_SET_MEMBUF 107
# define KDF_F_PKEY_TLS1_PRF_CTRL_STR 100
# define KDF_F_PKEY_TLS1_PRF_DERIVE 101
# define KDF_F_PKEY_TLS1_PRF_INIT 110
# define KDF_F_TLS1_PRF_ALG 111
/*
* KDF reason codes.
*/
# define KDF_R_INVALID_DIGEST 100
# define KDF_R_MISSING_ITERATION_COUNT 109
# define KDF_R_MISSING_KEY 104
# define KDF_R_MISSING_MESSAGE_DIGEST 105
# define KDF_R_MISSING_PARAMETER 101
# define KDF_R_MISSING_PASS 110
# define KDF_R_MISSING_SALT 111
# define KDF_R_MISSING_SECRET 107
# define KDF_R_MISSING_SEED 106
# define KDF_R_UNKNOWN_PARAMETER_TYPE 103
# define KDF_R_VALUE_ERROR 108
# define KDF_R_VALUE_MISSING 102
#endif

View File

@ -1,240 +0,0 @@
/* krb5_asn.h */
/*
* Written by Vern Staats <staatsvr@asc.hpc.mil> for the OpenSSL project, **
* using ocsp/{*.h,*asn*.c} as a starting point
*/
/* ====================================================================
* 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).
*
*/
#ifndef HEADER_KRB5_ASN_H
# define HEADER_KRB5_ASN_H
/*
* #include <krb5.h>
*/
# include <openssl/safestack.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* ASN.1 from Kerberos RFC 1510
*/
/*- EncryptedData ::= SEQUENCE {
* etype[0] INTEGER, -- EncryptionType
* kvno[1] INTEGER OPTIONAL,
* cipher[2] OCTET STRING -- ciphertext
* }
*/
typedef struct krb5_encdata_st {
ASN1_INTEGER *etype;
ASN1_INTEGER *kvno;
ASN1_OCTET_STRING *cipher;
} KRB5_ENCDATA;
DECLARE_STACK_OF(KRB5_ENCDATA)
/*- PrincipalName ::= SEQUENCE {
* name-type[0] INTEGER,
* name-string[1] SEQUENCE OF GeneralString
* }
*/
typedef struct krb5_princname_st {
ASN1_INTEGER *nametype;
STACK_OF(ASN1_GENERALSTRING) *namestring;
} KRB5_PRINCNAME;
DECLARE_STACK_OF(KRB5_PRINCNAME)
/*- Ticket ::= [APPLICATION 1] SEQUENCE {
* tkt-vno[0] INTEGER,
* realm[1] Realm,
* sname[2] PrincipalName,
* enc-part[3] EncryptedData
* }
*/
typedef struct krb5_tktbody_st {
ASN1_INTEGER *tktvno;
ASN1_GENERALSTRING *realm;
KRB5_PRINCNAME *sname;
KRB5_ENCDATA *encdata;
} KRB5_TKTBODY;
typedef STACK_OF(KRB5_TKTBODY) KRB5_TICKET;
DECLARE_STACK_OF(KRB5_TKTBODY)
/*- AP-REQ ::= [APPLICATION 14] SEQUENCE {
* pvno[0] INTEGER,
* msg-type[1] INTEGER,
* ap-options[2] APOptions,
* ticket[3] Ticket,
* authenticator[4] EncryptedData
* }
*
* APOptions ::= BIT STRING {
* reserved(0), use-session-key(1), mutual-required(2) }
*/
typedef struct krb5_ap_req_st {
ASN1_INTEGER *pvno;
ASN1_INTEGER *msgtype;
ASN1_BIT_STRING *apoptions;
KRB5_TICKET *ticket;
KRB5_ENCDATA *authenticator;
} KRB5_APREQBODY;
typedef STACK_OF(KRB5_APREQBODY) KRB5_APREQ;
DECLARE_STACK_OF(KRB5_APREQBODY)
/* Authenticator Stuff */
/*- Checksum ::= SEQUENCE {
* cksumtype[0] INTEGER,
* checksum[1] OCTET STRING
* }
*/
typedef struct krb5_checksum_st {
ASN1_INTEGER *ctype;
ASN1_OCTET_STRING *checksum;
} KRB5_CHECKSUM;
DECLARE_STACK_OF(KRB5_CHECKSUM)
/*- EncryptionKey ::= SEQUENCE {
* keytype[0] INTEGER,
* keyvalue[1] OCTET STRING
* }
*/
typedef struct krb5_encryptionkey_st {
ASN1_INTEGER *ktype;
ASN1_OCTET_STRING *keyvalue;
} KRB5_ENCKEY;
DECLARE_STACK_OF(KRB5_ENCKEY)
/*- AuthorizationData ::= SEQUENCE OF SEQUENCE {
* ad-type[0] INTEGER,
* ad-data[1] OCTET STRING
* }
*/
typedef struct krb5_authorization_st {
ASN1_INTEGER *adtype;
ASN1_OCTET_STRING *addata;
} KRB5_AUTHDATA;
DECLARE_STACK_OF(KRB5_AUTHDATA)
/*- -- Unencrypted authenticator
* Authenticator ::= [APPLICATION 2] SEQUENCE {
* authenticator-vno[0] INTEGER,
* crealm[1] Realm,
* cname[2] PrincipalName,
* cksum[3] Checksum OPTIONAL,
* cusec[4] INTEGER,
* ctime[5] KerberosTime,
* subkey[6] EncryptionKey OPTIONAL,
* seq-number[7] INTEGER OPTIONAL,
* authorization-data[8] AuthorizationData OPTIONAL
* }
*/
typedef struct krb5_authenticator_st {
ASN1_INTEGER *avno;
ASN1_GENERALSTRING *crealm;
KRB5_PRINCNAME *cname;
KRB5_CHECKSUM *cksum;
ASN1_INTEGER *cusec;
ASN1_GENERALIZEDTIME *ctime;
KRB5_ENCKEY *subkey;
ASN1_INTEGER *seqnum;
KRB5_AUTHDATA *authorization;
} KRB5_AUTHENTBODY;
typedef STACK_OF(KRB5_AUTHENTBODY) KRB5_AUTHENT;
DECLARE_STACK_OF(KRB5_AUTHENTBODY)
/*- DECLARE_ASN1_FUNCTIONS(type) = DECLARE_ASN1_FUNCTIONS_name(type, type) =
* type *name##_new(void);
* void name##_free(type *a);
* DECLARE_ASN1_ENCODE_FUNCTIONS(type, name, name) =
* DECLARE_ASN1_ENCODE_FUNCTIONS(type, itname, name) =
* type *d2i_##name(type **a, const unsigned char **in, long len);
* int i2d_##name(type *a, unsigned char **out);
* DECLARE_ASN1_ITEM(itname) = OPENSSL_EXTERN const ASN1_ITEM itname##_it
*/
DECLARE_ASN1_FUNCTIONS(KRB5_ENCDATA)
DECLARE_ASN1_FUNCTIONS(KRB5_PRINCNAME)
DECLARE_ASN1_FUNCTIONS(KRB5_TKTBODY)
DECLARE_ASN1_FUNCTIONS(KRB5_APREQBODY)
DECLARE_ASN1_FUNCTIONS(KRB5_TICKET)
DECLARE_ASN1_FUNCTIONS(KRB5_APREQ)
DECLARE_ASN1_FUNCTIONS(KRB5_CHECKSUM)
DECLARE_ASN1_FUNCTIONS(KRB5_ENCKEY)
DECLARE_ASN1_FUNCTIONS(KRB5_AUTHDATA)
DECLARE_ASN1_FUNCTIONS(KRB5_AUTHENTBODY)
DECLARE_ASN1_FUNCTIONS(KRB5_AUTHENT)
/* 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.
*/
#ifdef __cplusplus
}
#endif
#endif

View File

@ -1,197 +0,0 @@
/* ssl/kssl.h */
/*
* Written by Vern Staats <staatsvr@asc.hpc.mil> for the OpenSSL project
* 2000. project 2000.
*/
/* ====================================================================
* Copyright (c) 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
* 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.
* ====================================================================
*
* This product includes cryptographic software written by Eric Young
* (eay@cryptsoft.com). This product includes software written by Tim
* Hudson (tjh@cryptsoft.com).
*
*/
/*
** 19990701 VRS Started.
*/
#ifndef KSSL_H
# define KSSL_H
# include <openssl/opensslconf.h>
# ifndef OPENSSL_NO_KRB5
# include <stdio.h>
# include <ctype.h>
# include <krb5.h>
# ifdef OPENSSL_SYS_WIN32
/*
* These can sometimes get redefined indirectly by krb5 header files after
* they get undefed in ossl_typ.h
*/
# undef X509_NAME
# undef X509_EXTENSIONS
# undef OCSP_REQUEST
# undef OCSP_RESPONSE
# endif
#ifdef __cplusplus
extern "C" {
#endif
/*
* Depending on which KRB5 implementation used, some types from
* the other may be missing. Resolve that here and now
*/
# ifdef KRB5_HEIMDAL
typedef unsigned char krb5_octet;
# define FAR
# else
# ifndef FAR
# define FAR
# endif
# endif
/*-
* Uncomment this to debug kssl problems or
* to trace usage of the Kerberos session key
*
* #define KSSL_DEBUG
*/
# ifndef KRB5SVC
# define KRB5SVC "host"
# endif
# ifndef KRB5KEYTAB
# define KRB5KEYTAB "/etc/krb5.keytab"
# endif
# ifndef KRB5SENDAUTH
# define KRB5SENDAUTH 1
# endif
# ifndef KRB5CHECKAUTH
# define KRB5CHECKAUTH 1
# endif
# ifndef KSSL_CLOCKSKEW
# define KSSL_CLOCKSKEW 300;
# endif
# define KSSL_ERR_MAX 255
typedef struct kssl_err_st {
int reason;
char text[KSSL_ERR_MAX + 1];
} KSSL_ERR;
/*- Context for passing
* (1) Kerberos session key to SSL, and
* (2) Config data between application and SSL lib
*/
typedef struct kssl_ctx_st {
/* used by: disposition: */
char *service_name; /* C,S default ok (kssl) */
char *service_host; /* C input, REQUIRED */
char *client_princ; /* S output from krb5 ticket */
char *keytab_file; /* S NULL (/etc/krb5.keytab) */
char *cred_cache; /* C NULL (default) */
krb5_enctype enctype;
int length;
krb5_octet FAR *key;
} KSSL_CTX;
# define KSSL_CLIENT 1
# define KSSL_SERVER 2
# define KSSL_SERVICE 3
# define KSSL_KEYTAB 4
# define KSSL_CTX_OK 0
# define KSSL_CTX_ERR 1
# define KSSL_NOMEM 2
/* Public (for use by applications that use OpenSSL with Kerberos 5 support */
krb5_error_code kssl_ctx_setstring(KSSL_CTX *kssl_ctx, int which, char *text);
KSSL_CTX *kssl_ctx_new(void);
KSSL_CTX *kssl_ctx_free(KSSL_CTX *kssl_ctx);
void kssl_ctx_show(KSSL_CTX *kssl_ctx);
krb5_error_code kssl_ctx_setprinc(KSSL_CTX *kssl_ctx, int which,
krb5_data *realm, krb5_data *entity,
int nentities);
krb5_error_code kssl_cget_tkt(KSSL_CTX *kssl_ctx, krb5_data **enc_tktp,
krb5_data *authenp, KSSL_ERR *kssl_err);
krb5_error_code kssl_sget_tkt(KSSL_CTX *kssl_ctx, krb5_data *indata,
krb5_ticket_times *ttimes, KSSL_ERR *kssl_err);
krb5_error_code kssl_ctx_setkey(KSSL_CTX *kssl_ctx, krb5_keyblock *session);
void kssl_err_set(KSSL_ERR *kssl_err, int reason, char *text);
void kssl_krb5_free_data_contents(krb5_context context, krb5_data *data);
krb5_error_code kssl_build_principal_2(krb5_context context,
krb5_principal *princ, int rlen,
const char *realm, int slen,
const char *svc, int hlen,
const char *host);
krb5_error_code kssl_validate_times(krb5_timestamp atime,
krb5_ticket_times *ttimes);
krb5_error_code kssl_check_authent(KSSL_CTX *kssl_ctx, krb5_data *authentp,
krb5_timestamp *atimep,
KSSL_ERR *kssl_err);
unsigned char *kssl_skip_confound(krb5_enctype enctype, unsigned char *authn);
void SSL_set0_kssl_ctx(SSL *s, KSSL_CTX *kctx);
KSSL_CTX *SSL_get0_kssl_ctx(SSL *s);
char *kssl_ctx_get0_client_princ(KSSL_CTX *kctx);
#ifdef __cplusplus
}
#endif
# endif /* OPENSSL_NO_KRB5 */
#endif /* KSSL_H */

View File

@ -1,240 +1,217 @@
/* crypto/lhash/lhash.h */ /*
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
* All rights reserved. *
* * Licensed under the OpenSSL license (the "License"). You may not use
* This package is an SSL implementation written * this file except in compliance with the License. You can obtain a copy
* by Eric Young (eay@cryptsoft.com). * in the file LICENSE in the source distribution or at
* The implementation was written so as to conform with Netscapes SSL. * https://www.openssl.org/source/license.html
* */
* 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, * Header for dynamic hash table routines Author - Eric Young
* 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). #ifndef HEADER_LHASH_H
* # define HEADER_LHASH_H
* Copyright remains Eric Young's, and as such any Copyright notices in
* the code are not to be removed. # include <openssl/e_os2.h>
* If this package is used in a product, Eric Young should be given attribution # include <openssl/bio.h>
* as the author of the parts of the library used.
* This can be in the form of a textual message at program startup or #ifdef __cplusplus
* in documentation (online or textual) provided with the package. extern "C" {
* #endif
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions typedef struct lhash_node_st OPENSSL_LH_NODE;
* are met: typedef int (*OPENSSL_LH_COMPFUNC) (const void *, const void *);
* 1. Redistributions of source code must retain the copyright typedef unsigned long (*OPENSSL_LH_HASHFUNC) (const void *);
* notice, this list of conditions and the following disclaimer. typedef void (*OPENSSL_LH_DOALL_FUNC) (void *);
* 2. Redistributions in binary form must reproduce the above copyright typedef void (*OPENSSL_LH_DOALL_FUNCARG) (void *, void *);
* notice, this list of conditions and the following disclaimer in the typedef struct lhash_st OPENSSL_LHASH;
* 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: * Macros for declaring and implementing type-safe wrappers for LHASH
* "This product includes cryptographic software written by * callbacks. This way, callbacks can be provided to LHASH structures without
* Eric Young (eay@cryptsoft.com)" * function pointer casting and the macro-defined callbacks provide
* The word 'cryptographic' can be left out if the rouines from the library * per-variable casting before deferring to the underlying type-specific
* being used are not cryptographic related :-). * callbacks. NB: It is possible to place a "static" in front of both the
* 4. If you include any Windows specific code (or a derivative thereof) from * DECLARE and IMPLEMENT macros if the functions are strictly internal.
* the apps directory (application code) you must include an acknowledgement: */
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
* /* First: "hash" functions */
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND # define DECLARE_LHASH_HASH_FN(name, o_type) \
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE unsigned long name##_LHASH_HASH(const void *);
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # define IMPLEMENT_LHASH_HASH_FN(name, o_type) \
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE unsigned long name##_LHASH_HASH(const void *arg) { \
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL const o_type *a = arg; \
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS return name##_hash(a); }
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) # define LHASH_HASH_FN(name) name##_LHASH_HASH
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY /* Second: "compare" functions */
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # define DECLARE_LHASH_COMP_FN(name, o_type) \
* SUCH DAMAGE. int name##_LHASH_COMP(const void *, const void *);
* # define IMPLEMENT_LHASH_COMP_FN(name, o_type) \
* The licence and distribution terms for any publically available version or int name##_LHASH_COMP(const void *arg1, const void *arg2) { \
* derivative of this code cannot be changed. i.e. this code cannot simply be const o_type *a = arg1; \
* copied and put under another distribution licence const o_type *b = arg2; \
* [including the GNU Public Licence.] return name##_cmp(a,b); }
*/ # define LHASH_COMP_FN(name) name##_LHASH_COMP
/* /* Fourth: "doall_arg" functions */
* Header for dynamic hash table routines Author - Eric Young # define DECLARE_LHASH_DOALL_ARG_FN(name, o_type, a_type) \
*/ void name##_LHASH_DOALL_ARG(void *, void *);
# define IMPLEMENT_LHASH_DOALL_ARG_FN(name, o_type, a_type) \
#ifndef HEADER_LHASH_H void name##_LHASH_DOALL_ARG(void *arg1, void *arg2) { \
# define HEADER_LHASH_H o_type *a = arg1; \
a_type *b = arg2; \
# include <openssl/e_os2.h> name##_doall_arg(a, b); }
# ifndef OPENSSL_NO_FP_API # define LHASH_DOALL_ARG_FN(name) name##_LHASH_DOALL_ARG
# include <stdio.h>
# endif
# define LH_LOAD_MULT 256
# ifndef OPENSSL_NO_BIO
# include <openssl/bio.h> int OPENSSL_LH_error(OPENSSL_LHASH *lh);
# endif OPENSSL_LHASH *OPENSSL_LH_new(OPENSSL_LH_HASHFUNC h, OPENSSL_LH_COMPFUNC c);
void OPENSSL_LH_free(OPENSSL_LHASH *lh);
#ifdef __cplusplus void *OPENSSL_LH_insert(OPENSSL_LHASH *lh, void *data);
extern "C" { void *OPENSSL_LH_delete(OPENSSL_LHASH *lh, const void *data);
#endif void *OPENSSL_LH_retrieve(OPENSSL_LHASH *lh, const void *data);
void OPENSSL_LH_doall(OPENSSL_LHASH *lh, OPENSSL_LH_DOALL_FUNC func);
typedef struct lhash_node_st { void OPENSSL_LH_doall_arg(OPENSSL_LHASH *lh, OPENSSL_LH_DOALL_FUNCARG func, void *arg);
void *data; unsigned long OPENSSL_LH_strhash(const char *c);
struct lhash_node_st *next; unsigned long OPENSSL_LH_num_items(const OPENSSL_LHASH *lh);
# ifndef OPENSSL_NO_HASH_COMP unsigned long OPENSSL_LH_get_down_load(const OPENSSL_LHASH *lh);
unsigned long hash; void OPENSSL_LH_set_down_load(OPENSSL_LHASH *lh, unsigned long down_load);
# endif
} LHASH_NODE; # ifndef OPENSSL_NO_STDIO
void OPENSSL_LH_stats(const OPENSSL_LHASH *lh, FILE *fp);
typedef int (*LHASH_COMP_FN_TYPE) (const void *, const void *); void OPENSSL_LH_node_stats(const OPENSSL_LHASH *lh, FILE *fp);
typedef unsigned long (*LHASH_HASH_FN_TYPE) (const void *); void OPENSSL_LH_node_usage_stats(const OPENSSL_LHASH *lh, FILE *fp);
typedef void (*LHASH_DOALL_FN_TYPE) (void *); # endif
typedef void (*LHASH_DOALL_ARG_FN_TYPE) (void *, void *); void OPENSSL_LH_stats_bio(const OPENSSL_LHASH *lh, BIO *out);
void OPENSSL_LH_node_stats_bio(const OPENSSL_LHASH *lh, BIO *out);
/* void OPENSSL_LH_node_usage_stats_bio(const OPENSSL_LHASH *lh, BIO *out);
* Macros for declaring and implementing type-safe wrappers for LHASH
* callbacks. This way, callbacks can be provided to LHASH structures without # if OPENSSL_API_COMPAT < 0x10100000L
* function pointer casting and the macro-defined callbacks provide # define _LHASH OPENSSL_LHASH
* per-variable casting before deferring to the underlying type-specific # define LHASH_NODE OPENSSL_LH_NODE
* callbacks. NB: It is possible to place a "static" in front of both the # define lh_error OPENSSL_LH_error
* DECLARE and IMPLEMENT macros if the functions are strictly internal. # define lh_new OPENSSL_LH_new
*/ # define lh_free OPENSSL_LH_free
# define lh_insert OPENSSL_LH_insert
/* First: "hash" functions */ # define lh_delete OPENSSL_LH_delete
# define DECLARE_LHASH_HASH_FN(name, o_type) \ # define lh_retrieve OPENSSL_LH_retrieve
unsigned long name##_LHASH_HASH(const void *); # define lh_doall OPENSSL_LH_doall
# define IMPLEMENT_LHASH_HASH_FN(name, o_type) \ # define lh_doall_arg OPENSSL_LH_doall_arg
unsigned long name##_LHASH_HASH(const void *arg) { \ # define lh_strhash OPENSSL_LH_strhash
const o_type *a = arg; \ # define lh_num_items OPENSSL_LH_num_items
return name##_hash(a); } # ifndef OPENSSL_NO_STDIO
# define LHASH_HASH_FN(name) name##_LHASH_HASH # define lh_stats OPENSSL_LH_stats
# define lh_node_stats OPENSSL_LH_node_stats
/* Second: "compare" functions */ # define lh_node_usage_stats OPENSSL_LH_node_usage_stats
# define DECLARE_LHASH_COMP_FN(name, o_type) \ # endif
int name##_LHASH_COMP(const void *, const void *); # define lh_stats_bio OPENSSL_LH_stats_bio
# define IMPLEMENT_LHASH_COMP_FN(name, o_type) \ # define lh_node_stats_bio OPENSSL_LH_node_stats_bio
int name##_LHASH_COMP(const void *arg1, const void *arg2) { \ # define lh_node_usage_stats_bio OPENSSL_LH_node_usage_stats_bio
const o_type *a = arg1; \ # endif
const o_type *b = arg2; \
return name##_cmp(a,b); } /* Type checking... */
# define LHASH_COMP_FN(name) name##_LHASH_COMP
# define LHASH_OF(type) struct lhash_st_##type
/* Third: "doall" functions */
# define DECLARE_LHASH_DOALL_FN(name, o_type) \ # define DEFINE_LHASH_OF(type) \
void name##_LHASH_DOALL(void *); LHASH_OF(type) { union lh_##type##_dummy { void* d1; unsigned long d2; int d3; } dummy; }; \
# define IMPLEMENT_LHASH_DOALL_FN(name, o_type) \ static ossl_inline LHASH_OF(type) * \
void name##_LHASH_DOALL(void *arg) { \ lh_##type##_new(unsigned long (*hfn)(const type *), \
o_type *a = arg; \ int (*cfn)(const type *, const type *)) \
name##_doall(a); } { \
# define LHASH_DOALL_FN(name) name##_LHASH_DOALL return (LHASH_OF(type) *) \
OPENSSL_LH_new((OPENSSL_LH_HASHFUNC)hfn, (OPENSSL_LH_COMPFUNC)cfn); \
/* Fourth: "doall_arg" functions */ } \
# define DECLARE_LHASH_DOALL_ARG_FN(name, o_type, a_type) \ static ossl_inline void lh_##type##_free(LHASH_OF(type) *lh) \
void name##_LHASH_DOALL_ARG(void *, void *); { \
# define IMPLEMENT_LHASH_DOALL_ARG_FN(name, o_type, a_type) \ OPENSSL_LH_free((OPENSSL_LHASH *)lh); \
void name##_LHASH_DOALL_ARG(void *arg1, void *arg2) { \ } \
o_type *a = arg1; \ static ossl_inline type *lh_##type##_insert(LHASH_OF(type) *lh, type *d) \
a_type *b = arg2; \ { \
name##_doall_arg(a, b); } return (type *)OPENSSL_LH_insert((OPENSSL_LHASH *)lh, d); \
# define LHASH_DOALL_ARG_FN(name) name##_LHASH_DOALL_ARG } \
static ossl_inline type *lh_##type##_delete(LHASH_OF(type) *lh, const type *d) \
typedef struct lhash_st { { \
LHASH_NODE **b; return (type *)OPENSSL_LH_delete((OPENSSL_LHASH *)lh, d); \
LHASH_COMP_FN_TYPE comp; } \
LHASH_HASH_FN_TYPE hash; static ossl_inline type *lh_##type##_retrieve(LHASH_OF(type) *lh, const type *d) \
unsigned int num_nodes; { \
unsigned int num_alloc_nodes; return (type *)OPENSSL_LH_retrieve((OPENSSL_LHASH *)lh, d); \
unsigned int p; } \
unsigned int pmax; static ossl_inline int lh_##type##_error(LHASH_OF(type) *lh) \
unsigned long up_load; /* load times 256 */ { \
unsigned long down_load; /* load times 256 */ return OPENSSL_LH_error((OPENSSL_LHASH *)lh); \
unsigned long num_items; } \
unsigned long num_expands; static ossl_inline unsigned long lh_##type##_num_items(LHASH_OF(type) *lh) \
unsigned long num_expand_reallocs; { \
unsigned long num_contracts; return OPENSSL_LH_num_items((OPENSSL_LHASH *)lh); \
unsigned long num_contract_reallocs; } \
unsigned long num_hash_calls; static ossl_inline void lh_##type##_node_stats_bio(const LHASH_OF(type) *lh, BIO *out) \
unsigned long num_comp_calls; { \
unsigned long num_insert; OPENSSL_LH_node_stats_bio((const OPENSSL_LHASH *)lh, out); \
unsigned long num_replace; } \
unsigned long num_delete; static ossl_inline void lh_##type##_node_usage_stats_bio(const LHASH_OF(type) *lh, BIO *out) \
unsigned long num_no_delete; { \
unsigned long num_retrieve; OPENSSL_LH_node_usage_stats_bio((const OPENSSL_LHASH *)lh, out); \
unsigned long num_retrieve_miss; } \
unsigned long num_hash_comps; static ossl_inline void lh_##type##_stats_bio(const LHASH_OF(type) *lh, BIO *out) \
int error; { \
} _LHASH; /* Do not use _LHASH directly, use LHASH_OF OPENSSL_LH_stats_bio((const OPENSSL_LHASH *)lh, out); \
* and friends */ } \
static ossl_inline unsigned long lh_##type##_get_down_load(LHASH_OF(type) *lh) \
# define LH_LOAD_MULT 256 { \
return OPENSSL_LH_get_down_load((OPENSSL_LHASH *)lh); \
/* } \
* Indicates a malloc() error in the last call, this is only bad in static ossl_inline void lh_##type##_set_down_load(LHASH_OF(type) *lh, unsigned long dl) \
* lh_insert(). { \
*/ OPENSSL_LH_set_down_load((OPENSSL_LHASH *)lh, dl); \
# define lh_error(lh) ((lh)->error) } \
static ossl_inline void lh_##type##_doall(LHASH_OF(type) *lh, \
_LHASH *lh_new(LHASH_HASH_FN_TYPE h, LHASH_COMP_FN_TYPE c); void (*doall)(type *)) \
void lh_free(_LHASH *lh); { \
void *lh_insert(_LHASH *lh, void *data); OPENSSL_LH_doall((OPENSSL_LHASH *)lh, (OPENSSL_LH_DOALL_FUNC)doall); \
void *lh_delete(_LHASH *lh, const void *data); } \
void *lh_retrieve(_LHASH *lh, const void *data); LHASH_OF(type)
void lh_doall(_LHASH *lh, LHASH_DOALL_FN_TYPE func);
void lh_doall_arg(_LHASH *lh, LHASH_DOALL_ARG_FN_TYPE func, void *arg); #define IMPLEMENT_LHASH_DOALL_ARG_CONST(type, argtype) \
unsigned long lh_strhash(const char *c); int_implement_lhash_doall(type, argtype, const type)
unsigned long lh_num_items(const _LHASH *lh);
#define IMPLEMENT_LHASH_DOALL_ARG(type, argtype) \
# ifndef OPENSSL_NO_FP_API int_implement_lhash_doall(type, argtype, type)
void lh_stats(const _LHASH *lh, FILE *out);
void lh_node_stats(const _LHASH *lh, FILE *out); #define int_implement_lhash_doall(type, argtype, cbargtype) \
void lh_node_usage_stats(const _LHASH *lh, FILE *out); static ossl_inline void \
# endif lh_##type##_doall_##argtype(LHASH_OF(type) *lh, \
void (*fn)(cbargtype *, argtype *), \
# ifndef OPENSSL_NO_BIO argtype *arg) \
void lh_stats_bio(const _LHASH *lh, BIO *out); { \
void lh_node_stats_bio(const _LHASH *lh, BIO *out); OPENSSL_LH_doall_arg((OPENSSL_LHASH *)lh, (OPENSSL_LH_DOALL_FUNCARG)fn, (void *)arg); \
void lh_node_usage_stats_bio(const _LHASH *lh, BIO *out); } \
# endif LHASH_OF(type)
/* Type checking... */ DEFINE_LHASH_OF(OPENSSL_STRING);
# ifdef _MSC_VER
# define LHASH_OF(type) struct lhash_st_##type /*
* push and pop this warning:
# define DECLARE_LHASH_OF(type) LHASH_OF(type) { int dummy; } * warning C4090: 'function': different 'const' qualifiers
*/
# define CHECKED_LHASH_OF(type,lh) \ # pragma warning (push)
((_LHASH *)CHECKED_PTR_OF(LHASH_OF(type),lh)) # pragma warning (disable: 4090)
# endif
/* Define wrapper functions. */
# define LHM_lh_new(type, name) \ DEFINE_LHASH_OF(OPENSSL_CSTRING);
((LHASH_OF(type) *)lh_new(LHASH_HASH_FN(name), LHASH_COMP_FN(name)))
# define LHM_lh_error(type, lh) \ # ifdef _MSC_VER
lh_error(CHECKED_LHASH_OF(type,lh)) # pragma warning (pop)
# define LHM_lh_insert(type, lh, inst) \ # endif
((type *)lh_insert(CHECKED_LHASH_OF(type, lh), \
CHECKED_PTR_OF(type, inst))) #ifdef __cplusplus
# define LHM_lh_retrieve(type, lh, inst) \ }
((type *)lh_retrieve(CHECKED_LHASH_OF(type, lh), \ #endif
CHECKED_PTR_OF(type, inst)))
# define LHM_lh_delete(type, lh, inst) \ #endif
((type *)lh_delete(CHECKED_LHASH_OF(type, lh), \
CHECKED_PTR_OF(type, inst)))
# define LHM_lh_doall(type, lh,fn) lh_doall(CHECKED_LHASH_OF(type, lh), fn)
# define LHM_lh_doall_arg(type, lh, fn, arg_type, arg) \
lh_doall_arg(CHECKED_LHASH_OF(type, lh), fn, CHECKED_PTR_OF(arg_type, arg))
# define LHM_lh_num_items(type, lh) lh_num_items(CHECKED_LHASH_OF(type, lh))
# define LHM_lh_down_load(type, lh) (CHECKED_LHASH_OF(type, lh)->down_load)
# define LHM_lh_node_stats_bio(type, lh, out) \
lh_node_stats_bio(CHECKED_LHASH_OF(type, lh), out)
# define LHM_lh_node_usage_stats_bio(type, lh, out) \
lh_node_usage_stats_bio(CHECKED_LHASH_OF(type, lh), out)
# define LHM_lh_stats_bio(type, lh, out) \
lh_stats_bio(CHECKED_LHASH_OF(type, lh), out)
# define LHM_lh_free(type, lh) lh_free(CHECKED_LHASH_OF(type, lh))
DECLARE_LHASH_OF(OPENSSL_STRING);
DECLARE_LHASH_OF(OPENSSL_CSTRING);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,44 @@
/*
* Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/license.html
*/
#ifndef HEADER_MD2_H
# define HEADER_MD2_H
# include <openssl/opensslconf.h>
# ifndef OPENSSL_NO_MD2
# include <stddef.h>
# ifdef __cplusplus
extern "C" {
# endif
typedef unsigned char MD2_INT;
# define MD2_DIGEST_LENGTH 16
# define MD2_BLOCK 16
typedef struct MD2state_st {
unsigned int num;
unsigned char data[MD2_BLOCK];
MD2_INT cksm[MD2_BLOCK];
MD2_INT state[MD2_BLOCK];
} MD2_CTX;
const char *MD2_options(void);
int MD2_Init(MD2_CTX *c);
int MD2_Update(MD2_CTX *c, const unsigned char *data, size_t len);
int MD2_Final(unsigned char *md, MD2_CTX *c);
unsigned char *MD2(const unsigned char *d, size_t n, unsigned char *md);
# ifdef __cplusplus
}
# endif
# endif
#endif

View File

@ -1,119 +1,51 @@
/* crypto/md4/md4.h */ /*
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
* All rights reserved. *
* * Licensed under the OpenSSL license (the "License"). You may not use
* This package is an SSL implementation written * this file except in compliance with the License. You can obtain a copy
* by Eric Young (eay@cryptsoft.com). * in the file LICENSE in the source distribution or at
* The implementation was written so as to conform with Netscapes SSL. * https://www.openssl.org/source/license.html
* */
* This library is free for commercial and non-commercial use as long as
* the following conditions are aheared to. The following conditions #ifndef HEADER_MD4_H
* apply to all code found in this distribution, be it the RC4, RSA, # define HEADER_MD4_H
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
* included with this distribution is covered by the same copyright terms # include <openssl/opensslconf.h>
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
* # ifndef OPENSSL_NO_MD4
* Copyright remains Eric Young's, and as such any Copyright notices in # include <openssl/e_os2.h>
* the code are not to be removed. # include <stddef.h>
* If this package is used in a product, Eric Young should be given attribution # ifdef __cplusplus
* as the author of the parts of the library used. extern "C" {
* This can be in the form of a textual message at program startup or # endif
* 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 * ! MD4_LONG has to be at least 32 bits wide. !
* are met: * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* 1. Redistributions of source code must retain the copyright */
* notice, this list of conditions and the following disclaimer. # define MD4_LONG unsigned int
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the # define MD4_CBLOCK 64
* documentation and/or other materials provided with the distribution. # define MD4_LBLOCK (MD4_CBLOCK/4)
* 3. All advertising materials mentioning features or use of this software # define MD4_DIGEST_LENGTH 16
* must display the following acknowledgement:
* "This product includes cryptographic software written by typedef struct MD4state_st {
* Eric Young (eay@cryptsoft.com)" MD4_LONG A, B, C, D;
* The word 'cryptographic' can be left out if the rouines from the library MD4_LONG Nl, Nh;
* being used are not cryptographic related :-). MD4_LONG data[MD4_LBLOCK];
* 4. If you include any Windows specific code (or a derivative thereof) from unsigned int num;
* the apps directory (application code) you must include an acknowledgement: } MD4_CTX;
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
* int MD4_Init(MD4_CTX *c);
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND int MD4_Update(MD4_CTX *c, const void *data, size_t len);
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE int MD4_Final(unsigned char *md, MD4_CTX *c);
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE unsigned char *MD4(const unsigned char *d, size_t n, unsigned char *md);
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE void MD4_Transform(MD4_CTX *c, const unsigned char *b);
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS # ifdef __cplusplus
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) }
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT # endif
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY # endif
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. #endif
*
* 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_MD4_H
# define HEADER_MD4_H
# include <openssl/e_os2.h>
# include <stddef.h>
#ifdef __cplusplus
extern "C" {
#endif
# ifdef OPENSSL_NO_MD4
# error MD4 is disabled.
# endif
/*-
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* ! MD4_LONG has to be at least 32 bits wide. If it's wider, then !
* ! MD4_LONG_LOG2 has to be defined along. !
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
*/
# if defined(__LP32__)
# define MD4_LONG unsigned long
# elif defined(OPENSSL_SYS_CRAY) || defined(__ILP64__)
# define MD4_LONG unsigned long
# define MD4_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 MD4_LONG unsigned int
# endif
# define MD4_CBLOCK 64
# define MD4_LBLOCK (MD4_CBLOCK/4)
# define MD4_DIGEST_LENGTH 16
typedef struct MD4state_st {
MD4_LONG A, B, C, D;
MD4_LONG Nl, Nh;
MD4_LONG data[MD4_LBLOCK];
unsigned int num;
} MD4_CTX;
# ifdef OPENSSL_FIPS
int private_MD4_Init(MD4_CTX *c);
# endif
int MD4_Init(MD4_CTX *c);
int MD4_Update(MD4_CTX *c, const void *data, size_t len);
int MD4_Final(unsigned char *md, MD4_CTX *c);
unsigned char *MD4(const unsigned char *d, size_t n, unsigned char *md);
void MD4_Transform(MD4_CTX *c, const unsigned char *b);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -1,119 +1,50 @@
/* crypto/md5/md5.h */ /*
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
* All rights reserved. *
* * Licensed under the OpenSSL license (the "License"). You may not use
* This package is an SSL implementation written * this file except in compliance with the License. You can obtain a copy
* by Eric Young (eay@cryptsoft.com). * in the file LICENSE in the source distribution or at
* The implementation was written so as to conform with Netscapes SSL. * https://www.openssl.org/source/license.html
* */
* This library is free for commercial and non-commercial use as long as
* the following conditions are aheared to. The following conditions #ifndef HEADER_MD5_H
* apply to all code found in this distribution, be it the RC4, RSA, # define HEADER_MD5_H
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
* included with this distribution is covered by the same copyright terms # include <openssl/opensslconf.h>
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
* # ifndef OPENSSL_NO_MD5
* Copyright remains Eric Young's, and as such any Copyright notices in # include <openssl/e_os2.h>
* the code are not to be removed. # include <stddef.h>
* If this package is used in a product, Eric Young should be given attribution # ifdef __cplusplus
* as the author of the parts of the library used. extern "C" {
* This can be in the form of a textual message at program startup or # endif
* 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 * ! MD5_LONG has to be at least 32 bits wide. !
* are met: * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* 1. Redistributions of source code must retain the copyright */
* notice, this list of conditions and the following disclaimer. # define MD5_LONG unsigned int
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the # define MD5_CBLOCK 64
* documentation and/or other materials provided with the distribution. # define MD5_LBLOCK (MD5_CBLOCK/4)
* 3. All advertising materials mentioning features or use of this software # define MD5_DIGEST_LENGTH 16
* must display the following acknowledgement:
* "This product includes cryptographic software written by typedef struct MD5state_st {
* Eric Young (eay@cryptsoft.com)" MD5_LONG A, B, C, D;
* The word 'cryptographic' can be left out if the rouines from the library MD5_LONG Nl, Nh;
* being used are not cryptographic related :-). MD5_LONG data[MD5_LBLOCK];
* 4. If you include any Windows specific code (or a derivative thereof) from unsigned int num;
* the apps directory (application code) you must include an acknowledgement: } MD5_CTX;
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
* int MD5_Init(MD5_CTX *c);
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND int MD5_Update(MD5_CTX *c, const void *data, size_t len);
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE int MD5_Final(unsigned char *md, MD5_CTX *c);
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE unsigned char *MD5(const unsigned char *d, size_t n, unsigned char *md);
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE void MD5_Transform(MD5_CTX *c, const unsigned char *b);
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL # ifdef __cplusplus
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS }
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) # endif
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT # endif
* 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 #endif
* 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_MD5_H
# define HEADER_MD5_H
# include <openssl/e_os2.h>
# include <stddef.h>
#ifdef __cplusplus
extern "C" {
#endif
# ifdef OPENSSL_NO_MD5
# error MD5 is disabled.
# endif
/*
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* ! MD5_LONG has to be at least 32 bits wide. If it's wider, then !
* ! MD5_LONG_LOG2 has to be defined along. !
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
*/
# if defined(__LP32__)
# define MD5_LONG unsigned long
# elif defined(OPENSSL_SYS_CRAY) || defined(__ILP64__)
# define MD5_LONG unsigned long
# define MD5_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 MD5_LONG unsigned int
# endif
# define MD5_CBLOCK 64
# define MD5_LBLOCK (MD5_CBLOCK/4)
# define MD5_DIGEST_LENGTH 16
typedef struct MD5state_st {
MD5_LONG A, B, C, D;
MD5_LONG Nl, Nh;
MD5_LONG data[MD5_LBLOCK];
unsigned int num;
} MD5_CTX;
# ifdef OPENSSL_FIPS
int private_MD5_Init(MD5_CTX *c);
# endif
int MD5_Init(MD5_CTX *c);
int MD5_Update(MD5_CTX *c, const void *data, size_t len);
int MD5_Final(unsigned char *md, MD5_CTX *c);
unsigned char *MD5(const unsigned char *d, size_t n, unsigned char *md);
void MD5_Transform(MD5_CTX *c, const unsigned char *b);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -1,94 +1,42 @@
/* crypto/mdc2/mdc2.h */ /*
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
* All rights reserved. *
* * Licensed under the OpenSSL license (the "License"). You may not use
* This package is an SSL implementation written * this file except in compliance with the License. You can obtain a copy
* by Eric Young (eay@cryptsoft.com). * in the file LICENSE in the source distribution or at
* The implementation was written so as to conform with Netscapes SSL. * https://www.openssl.org/source/license.html
* */
* This library is free for commercial and non-commercial use as long as
* the following conditions are aheared to. The following conditions #ifndef HEADER_MDC2_H
* apply to all code found in this distribution, be it the RC4, RSA, # define HEADER_MDC2_H
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
* included with this distribution is covered by the same copyright terms # include <openssl/opensslconf.h>
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
* #ifndef OPENSSL_NO_MDC2
* Copyright remains Eric Young's, and as such any Copyright notices in # include <stdlib.h>
* the code are not to be removed. # include <openssl/des.h>
* If this package is used in a product, Eric Young should be given attribution # ifdef __cplusplus
* as the author of the parts of the library used. extern "C" {
* This can be in the form of a textual message at program startup or # endif
* in documentation (online or textual) provided with the package.
* # define MDC2_BLOCK 8
* Redistribution and use in source and binary forms, with or without # define MDC2_DIGEST_LENGTH 16
* modification, are permitted provided that the following conditions
* are met: typedef struct mdc2_ctx_st {
* 1. Redistributions of source code must retain the copyright unsigned int num;
* notice, this list of conditions and the following disclaimer. unsigned char data[MDC2_BLOCK];
* 2. Redistributions in binary form must reproduce the above copyright DES_cblock h, hh;
* notice, this list of conditions and the following disclaimer in the int pad_type; /* either 1 or 2, default 1 */
* documentation and/or other materials provided with the distribution. } MDC2_CTX;
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement: int MDC2_Init(MDC2_CTX *c);
* "This product includes cryptographic software written by int MDC2_Update(MDC2_CTX *c, const unsigned char *data, size_t len);
* Eric Young (eay@cryptsoft.com)" int MDC2_Final(unsigned char *md, MDC2_CTX *c);
* The word 'cryptographic' can be left out if the rouines from the library unsigned char *MDC2(const unsigned char *d, size_t n, unsigned char *md);
* being used are not cryptographic related :-).
* 4. If you include any Windows specific code (or a derivative thereof) from # ifdef __cplusplus
* the apps directory (application code) you must include an acknowledgement: }
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" # endif
* # endif
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE #endif
* 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_MDC2_H
# define HEADER_MDC2_H
# include <openssl/des.h>
#ifdef __cplusplus
extern "C" {
#endif
# ifdef OPENSSL_NO_MDC2
# error MDC2 is disabled.
# endif
# define MDC2_BLOCK 8
# define MDC2_DIGEST_LENGTH 16
typedef struct mdc2_ctx_st {
unsigned int num;
unsigned char data[MDC2_BLOCK];
DES_cblock h, hh;
int pad_type; /* either 1 or 2, default 1 */
} MDC2_CTX;
# ifdef OPENSSL_FIPS
int private_MDC2_Init(MDC2_CTX *c);
# endif
int MDC2_Init(MDC2_CTX *c);
int MDC2_Update(MDC2_CTX *c, const unsigned char *data, size_t len);
int MDC2_Final(unsigned char *md, MDC2_CTX *c);
unsigned char *MDC2(const unsigned char *d, size_t n, unsigned char *md);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -1,163 +1,208 @@
/* ==================================================================== /*
* Copyright (c) 2008 The OpenSSL Project. All rights reserved. * Copyright 2008-2016 The OpenSSL Project Authors. All Rights Reserved.
* *
* Rights for redistribution and usage in source and binary * Licensed under the OpenSSL license (the "License"). You may not use
* forms are granted according to the OpenSSL license. * this file except in compliance with the License. You can obtain a copy
*/ * in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/license.html
#include <stddef.h> */
#ifdef __cplusplus #ifndef HEADER_MODES_H
extern "C" { # define HEADER_MODES_H
#endif
typedef void (*block128_f) (const unsigned char in[16], # include <stddef.h>
unsigned char out[16], const void *key);
# ifdef __cplusplus
typedef void (*cbc128_f) (const unsigned char *in, unsigned char *out, extern "C" {
size_t len, const void *key, # endif
unsigned char ivec[16], int enc); typedef void (*block128_f) (const unsigned char in[16],
unsigned char out[16], const void *key);
typedef void (*ctr128_f) (const unsigned char *in, unsigned char *out,
size_t blocks, const void *key, typedef void (*cbc128_f) (const unsigned char *in, unsigned char *out,
const unsigned char ivec[16]); size_t len, const void *key,
unsigned char ivec[16], int enc);
typedef void (*ccm128_f) (const unsigned char *in, unsigned char *out,
size_t blocks, const void *key, typedef void (*ctr128_f) (const unsigned char *in, unsigned char *out,
const unsigned char ivec[16], size_t blocks, const void *key,
unsigned char cmac[16]); const unsigned char ivec[16]);
void CRYPTO_cbc128_encrypt(const unsigned char *in, unsigned char *out, typedef void (*ccm128_f) (const unsigned char *in, unsigned char *out,
size_t len, const void *key, size_t blocks, const void *key,
unsigned char ivec[16], block128_f block); const unsigned char ivec[16],
void CRYPTO_cbc128_decrypt(const unsigned char *in, unsigned char *out, unsigned char cmac[16]);
size_t len, const void *key,
unsigned char ivec[16], block128_f block); void CRYPTO_cbc128_encrypt(const unsigned char *in, unsigned char *out,
size_t len, const void *key,
void CRYPTO_ctr128_encrypt(const unsigned char *in, unsigned char *out, unsigned char ivec[16], block128_f block);
size_t len, const void *key, void CRYPTO_cbc128_decrypt(const unsigned char *in, unsigned char *out,
unsigned char ivec[16], size_t len, const void *key,
unsigned char ecount_buf[16], unsigned int *num, unsigned char ivec[16], block128_f block);
block128_f block);
void CRYPTO_ctr128_encrypt(const unsigned char *in, unsigned char *out,
void CRYPTO_ctr128_encrypt_ctr32(const unsigned char *in, unsigned char *out, size_t len, const void *key,
size_t len, const void *key, unsigned char ivec[16],
unsigned char ivec[16], unsigned char ecount_buf[16], unsigned int *num,
unsigned char ecount_buf[16], block128_f block);
unsigned int *num, ctr128_f ctr);
void CRYPTO_ctr128_encrypt_ctr32(const unsigned char *in, unsigned char *out,
void CRYPTO_ofb128_encrypt(const unsigned char *in, unsigned char *out, size_t len, const void *key,
size_t len, const void *key, unsigned char ivec[16],
unsigned char ivec[16], int *num, unsigned char ecount_buf[16],
block128_f block); unsigned int *num, ctr128_f ctr);
void CRYPTO_cfb128_encrypt(const unsigned char *in, unsigned char *out, void CRYPTO_ofb128_encrypt(const unsigned char *in, unsigned char *out,
size_t len, const void *key, size_t len, const void *key,
unsigned char ivec[16], int *num, unsigned char ivec[16], int *num,
int enc, block128_f block); block128_f block);
void CRYPTO_cfb128_8_encrypt(const unsigned char *in, unsigned char *out,
size_t length, const void *key, void CRYPTO_cfb128_encrypt(const unsigned char *in, unsigned char *out,
unsigned char ivec[16], int *num, size_t len, const void *key,
int enc, block128_f block); unsigned char ivec[16], int *num,
void CRYPTO_cfb128_1_encrypt(const unsigned char *in, unsigned char *out, int enc, block128_f block);
size_t bits, const void *key, void CRYPTO_cfb128_8_encrypt(const unsigned char *in, unsigned char *out,
unsigned char ivec[16], int *num, size_t length, const void *key,
int enc, block128_f block); unsigned char ivec[16], int *num,
int enc, block128_f block);
size_t CRYPTO_cts128_encrypt_block(const unsigned char *in, void CRYPTO_cfb128_1_encrypt(const unsigned char *in, unsigned char *out,
unsigned char *out, size_t len, size_t bits, const void *key,
const void *key, unsigned char ivec[16], unsigned char ivec[16], int *num,
block128_f block); int enc, block128_f block);
size_t CRYPTO_cts128_encrypt(const unsigned char *in, unsigned char *out,
size_t len, const void *key, size_t CRYPTO_cts128_encrypt_block(const unsigned char *in,
unsigned char ivec[16], cbc128_f cbc); unsigned char *out, size_t len,
size_t CRYPTO_cts128_decrypt_block(const unsigned char *in, const void *key, unsigned char ivec[16],
unsigned char *out, size_t len, block128_f block);
const void *key, unsigned char ivec[16], size_t CRYPTO_cts128_encrypt(const unsigned char *in, unsigned char *out,
block128_f block); size_t len, const void *key,
size_t CRYPTO_cts128_decrypt(const unsigned char *in, unsigned char *out, unsigned char ivec[16], cbc128_f cbc);
size_t len, const void *key, size_t CRYPTO_cts128_decrypt_block(const unsigned char *in,
unsigned char ivec[16], cbc128_f cbc); unsigned char *out, size_t len,
const void *key, unsigned char ivec[16],
size_t CRYPTO_nistcts128_encrypt_block(const unsigned char *in, block128_f block);
unsigned char *out, size_t len, size_t CRYPTO_cts128_decrypt(const unsigned char *in, unsigned char *out,
const void *key, size_t len, const void *key,
unsigned char ivec[16], unsigned char ivec[16], cbc128_f cbc);
block128_f block);
size_t CRYPTO_nistcts128_encrypt(const unsigned char *in, unsigned char *out, size_t CRYPTO_nistcts128_encrypt_block(const unsigned char *in,
size_t len, const void *key, unsigned char *out, size_t len,
unsigned char ivec[16], cbc128_f cbc); const void *key,
size_t CRYPTO_nistcts128_decrypt_block(const unsigned char *in, unsigned char ivec[16],
unsigned char *out, size_t len, block128_f block);
const void *key, size_t CRYPTO_nistcts128_encrypt(const unsigned char *in, unsigned char *out,
unsigned char ivec[16], size_t len, const void *key,
block128_f block); unsigned char ivec[16], cbc128_f cbc);
size_t CRYPTO_nistcts128_decrypt(const unsigned char *in, unsigned char *out, size_t CRYPTO_nistcts128_decrypt_block(const unsigned char *in,
size_t len, const void *key, unsigned char *out, size_t len,
unsigned char ivec[16], cbc128_f cbc); const void *key,
unsigned char ivec[16],
typedef struct gcm128_context GCM128_CONTEXT; block128_f block);
size_t CRYPTO_nistcts128_decrypt(const unsigned char *in, unsigned char *out,
GCM128_CONTEXT *CRYPTO_gcm128_new(void *key, block128_f block); size_t len, const void *key,
void CRYPTO_gcm128_init(GCM128_CONTEXT *ctx, void *key, block128_f block); unsigned char ivec[16], cbc128_f cbc);
void CRYPTO_gcm128_setiv(GCM128_CONTEXT *ctx, const unsigned char *iv,
size_t len); typedef struct gcm128_context GCM128_CONTEXT;
int CRYPTO_gcm128_aad(GCM128_CONTEXT *ctx, const unsigned char *aad,
size_t len); GCM128_CONTEXT *CRYPTO_gcm128_new(void *key, block128_f block);
int CRYPTO_gcm128_encrypt(GCM128_CONTEXT *ctx, void CRYPTO_gcm128_init(GCM128_CONTEXT *ctx, void *key, block128_f block);
const unsigned char *in, unsigned char *out, void CRYPTO_gcm128_setiv(GCM128_CONTEXT *ctx, const unsigned char *iv,
size_t len); size_t len);
int CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx, int CRYPTO_gcm128_aad(GCM128_CONTEXT *ctx, const unsigned char *aad,
const unsigned char *in, unsigned char *out, size_t len);
size_t len); int CRYPTO_gcm128_encrypt(GCM128_CONTEXT *ctx,
int CRYPTO_gcm128_encrypt_ctr32(GCM128_CONTEXT *ctx, const unsigned char *in, unsigned char *out,
const unsigned char *in, unsigned char *out, size_t len);
size_t len, ctr128_f stream); int CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx,
int CRYPTO_gcm128_decrypt_ctr32(GCM128_CONTEXT *ctx, const unsigned char *in, unsigned char *out,
const unsigned char *in, unsigned char *out, size_t len);
size_t len, ctr128_f stream); int CRYPTO_gcm128_encrypt_ctr32(GCM128_CONTEXT *ctx,
int CRYPTO_gcm128_finish(GCM128_CONTEXT *ctx, const unsigned char *tag, const unsigned char *in, unsigned char *out,
size_t len); size_t len, ctr128_f stream);
void CRYPTO_gcm128_tag(GCM128_CONTEXT *ctx, unsigned char *tag, size_t len); int CRYPTO_gcm128_decrypt_ctr32(GCM128_CONTEXT *ctx,
void CRYPTO_gcm128_release(GCM128_CONTEXT *ctx); const unsigned char *in, unsigned char *out,
size_t len, ctr128_f stream);
typedef struct ccm128_context CCM128_CONTEXT; int CRYPTO_gcm128_finish(GCM128_CONTEXT *ctx, const unsigned char *tag,
size_t len);
void CRYPTO_ccm128_init(CCM128_CONTEXT *ctx, void CRYPTO_gcm128_tag(GCM128_CONTEXT *ctx, unsigned char *tag, size_t len);
unsigned int M, unsigned int L, void *key, void CRYPTO_gcm128_release(GCM128_CONTEXT *ctx);
block128_f block);
int CRYPTO_ccm128_setiv(CCM128_CONTEXT *ctx, const unsigned char *nonce, typedef struct ccm128_context CCM128_CONTEXT;
size_t nlen, size_t mlen);
void CRYPTO_ccm128_aad(CCM128_CONTEXT *ctx, const unsigned char *aad, void CRYPTO_ccm128_init(CCM128_CONTEXT *ctx,
size_t alen); unsigned int M, unsigned int L, void *key,
int CRYPTO_ccm128_encrypt(CCM128_CONTEXT *ctx, const unsigned char *inp, block128_f block);
unsigned char *out, size_t len); int CRYPTO_ccm128_setiv(CCM128_CONTEXT *ctx, const unsigned char *nonce,
int CRYPTO_ccm128_decrypt(CCM128_CONTEXT *ctx, const unsigned char *inp, size_t nlen, size_t mlen);
unsigned char *out, size_t len); void CRYPTO_ccm128_aad(CCM128_CONTEXT *ctx, const unsigned char *aad,
int CRYPTO_ccm128_encrypt_ccm64(CCM128_CONTEXT *ctx, const unsigned char *inp, size_t alen);
unsigned char *out, size_t len, int CRYPTO_ccm128_encrypt(CCM128_CONTEXT *ctx, const unsigned char *inp,
ccm128_f stream); unsigned char *out, size_t len);
int CRYPTO_ccm128_decrypt_ccm64(CCM128_CONTEXT *ctx, const unsigned char *inp, int CRYPTO_ccm128_decrypt(CCM128_CONTEXT *ctx, const unsigned char *inp,
unsigned char *out, size_t len, unsigned char *out, size_t len);
ccm128_f stream); int CRYPTO_ccm128_encrypt_ccm64(CCM128_CONTEXT *ctx, const unsigned char *inp,
size_t CRYPTO_ccm128_tag(CCM128_CONTEXT *ctx, unsigned char *tag, size_t len); unsigned char *out, size_t len,
ccm128_f stream);
typedef struct xts128_context XTS128_CONTEXT; int CRYPTO_ccm128_decrypt_ccm64(CCM128_CONTEXT *ctx, const unsigned char *inp,
unsigned char *out, size_t len,
int CRYPTO_xts128_encrypt(const XTS128_CONTEXT *ctx, ccm128_f stream);
const unsigned char iv[16], size_t CRYPTO_ccm128_tag(CCM128_CONTEXT *ctx, unsigned char *tag, size_t len);
const unsigned char *inp, unsigned char *out,
size_t len, int enc); typedef struct xts128_context XTS128_CONTEXT;
size_t CRYPTO_128_wrap(void *key, const unsigned char *iv, int CRYPTO_xts128_encrypt(const XTS128_CONTEXT *ctx,
unsigned char *out, const unsigned char iv[16],
const unsigned char *in, size_t inlen, const unsigned char *inp, unsigned char *out,
block128_f block); size_t len, int enc);
size_t CRYPTO_128_unwrap(void *key, const unsigned char *iv, size_t CRYPTO_128_wrap(void *key, const unsigned char *iv,
unsigned char *out, unsigned char *out,
const unsigned char *in, size_t inlen, const unsigned char *in, size_t inlen,
block128_f block); block128_f block);
#ifdef __cplusplus size_t CRYPTO_128_unwrap(void *key, const unsigned char *iv,
} unsigned char *out,
#endif const unsigned char *in, size_t inlen,
block128_f block);
size_t CRYPTO_128_wrap_pad(void *key, const unsigned char *icv,
unsigned char *out, const unsigned char *in,
size_t inlen, block128_f block);
size_t CRYPTO_128_unwrap_pad(void *key, const unsigned char *icv,
unsigned char *out, const unsigned char *in,
size_t inlen, block128_f block);
# ifndef OPENSSL_NO_OCB
typedef struct ocb128_context OCB128_CONTEXT;
typedef void (*ocb128_f) (const unsigned char *in, unsigned char *out,
size_t blocks, const void *key,
size_t start_block_num,
unsigned char offset_i[16],
const unsigned char L_[][16],
unsigned char checksum[16]);
OCB128_CONTEXT *CRYPTO_ocb128_new(void *keyenc, void *keydec,
block128_f encrypt, block128_f decrypt,
ocb128_f stream);
int CRYPTO_ocb128_init(OCB128_CONTEXT *ctx, void *keyenc, void *keydec,
block128_f encrypt, block128_f decrypt,
ocb128_f stream);
int CRYPTO_ocb128_copy_ctx(OCB128_CONTEXT *dest, OCB128_CONTEXT *src,
void *keyenc, void *keydec);
int CRYPTO_ocb128_setiv(OCB128_CONTEXT *ctx, const unsigned char *iv,
size_t len, size_t taglen);
int CRYPTO_ocb128_aad(OCB128_CONTEXT *ctx, const unsigned char *aad,
size_t len);
int CRYPTO_ocb128_encrypt(OCB128_CONTEXT *ctx, const unsigned char *in,
unsigned char *out, size_t len);
int CRYPTO_ocb128_decrypt(OCB128_CONTEXT *ctx, const unsigned char *in,
unsigned char *out, size_t len);
int CRYPTO_ocb128_finish(OCB128_CONTEXT *ctx, const unsigned char *tag,
size_t len);
int CRYPTO_ocb128_tag(OCB128_CONTEXT *ctx, unsigned char *tag, size_t len);
void CRYPTO_ocb128_cleanup(OCB128_CONTEXT *ctx);
# endif /* OPENSSL_NO_OCB */
# ifdef __cplusplus
}
# endif
#endif

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,38 @@
/*
* Generated by util/mkerr.pl DO NOT EDIT
* Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/license.html
*/
#ifndef HEADER_OBJERR_H
# define HEADER_OBJERR_H
# ifdef __cplusplus
extern "C"
# endif
int ERR_load_OBJ_strings(void);
/*
* OBJ function codes.
*/
# define OBJ_F_OBJ_ADD_OBJECT 105
# define OBJ_F_OBJ_ADD_SIGID 107
# define OBJ_F_OBJ_CREATE 100
# define OBJ_F_OBJ_DUP 101
# define OBJ_F_OBJ_NAME_NEW_INDEX 106
# define OBJ_F_OBJ_NID2LN 102
# define OBJ_F_OBJ_NID2OBJ 103
# define OBJ_F_OBJ_NID2SN 104
# define OBJ_F_OBJ_TXT2OBJ 108
/*
* OBJ reason codes.
*/
# define OBJ_R_OID_EXISTS 102
# define OBJ_R_UNKNOWN_NID 101
#endif

View File

@ -1,637 +1,355 @@
/* ocsp.h */ /*
/* * Copyright 2000-2018 The OpenSSL Project Authors. All Rights Reserved.
* Written by Tom Titchener <Tom_Titchener@groove.net> for the OpenSSL *
* project. * Licensed under the OpenSSL license (the "License"). You may not use
*/ * this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at
/* * https://www.openssl.org/source/license.html
* History: This file was transfered to Richard Levitte from CertCo by Kathy */
* Weinhold in mid-spring 2000 to be included in OpenSSL or released as a
* patch kit. #ifndef HEADER_OCSP_H
*/ # define HEADER_OCSP_H
/* ==================================================================== #include <openssl/opensslconf.h>
* Copyright (c) 1998-2000 The OpenSSL Project. All rights reserved.
* /*
* Redistribution and use in source and binary forms, with or without * These definitions are outside the OPENSSL_NO_OCSP guard because although for
* modification, are permitted provided that the following conditions * historical reasons they have OCSP_* names, they can actually be used
* are met: * independently of OCSP. E.g. see RFC5280
* */
* 1. Redistributions of source code must retain the above copyright /*-
* notice, this list of conditions and the following disclaimer. * CRLReason ::= ENUMERATED {
* * unspecified (0),
* 2. Redistributions in binary form must reproduce the above copyright * keyCompromise (1),
* notice, this list of conditions and the following disclaimer in * cACompromise (2),
* the documentation and/or other materials provided with the * affiliationChanged (3),
* distribution. * superseded (4),
* * cessationOfOperation (5),
* 3. All advertising materials mentioning features or use of this * certificateHold (6),
* software must display the following acknowledgment: * removeFromCRL (8) }
* "This product includes software developed by the OpenSSL Project */
* for use in the OpenSSL Toolkit. (http://www.openssl.org/)" # define OCSP_REVOKED_STATUS_NOSTATUS -1
* # define OCSP_REVOKED_STATUS_UNSPECIFIED 0
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to # define OCSP_REVOKED_STATUS_KEYCOMPROMISE 1
* endorse or promote products derived from this software without # define OCSP_REVOKED_STATUS_CACOMPROMISE 2
* prior written permission. For written permission, please contact # define OCSP_REVOKED_STATUS_AFFILIATIONCHANGED 3
* openssl-core@openssl.org. # define OCSP_REVOKED_STATUS_SUPERSEDED 4
* # define OCSP_REVOKED_STATUS_CESSATIONOFOPERATION 5
* 5. Products derived from this software may not be called "OpenSSL" # define OCSP_REVOKED_STATUS_CERTIFICATEHOLD 6
* nor may "OpenSSL" appear in their names without prior written # define OCSP_REVOKED_STATUS_REMOVEFROMCRL 8
* permission of the OpenSSL Project.
*
* 6. Redistributions of any form whatsoever must retain the following # ifndef OPENSSL_NO_OCSP
* acknowledgment:
* "This product includes software developed by the OpenSSL Project # include <openssl/ossl_typ.h>
* for use in the OpenSSL Toolkit (http://www.openssl.org/)" # include <openssl/x509.h>
* # include <openssl/x509v3.h>
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY # include <openssl/safestack.h>
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # include <openssl/ocsperr.h>
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR #ifdef __cplusplus
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, extern "C" {
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT #endif
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) /* Various flags and values */
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) # define OCSP_DEFAULT_NONCE_LENGTH 16
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE. # define OCSP_NOCERTS 0x1
* ==================================================================== # define OCSP_NOINTERN 0x2
* # define OCSP_NOSIGS 0x4
* This product includes cryptographic software written by Eric Young # define OCSP_NOCHAIN 0x8
* (eay@cryptsoft.com). This product includes software written by Tim # define OCSP_NOVERIFY 0x10
* Hudson (tjh@cryptsoft.com). # define OCSP_NOEXPLICIT 0x20
* # define OCSP_NOCASIGN 0x40
*/ # define OCSP_NODELEGATED 0x80
# define OCSP_NOCHECKS 0x100
#ifndef HEADER_OCSP_H # define OCSP_TRUSTOTHER 0x200
# define HEADER_OCSP_H # define OCSP_RESPID_KEY 0x400
# define OCSP_NOTIME 0x800
# include <openssl/ossl_typ.h>
# include <openssl/x509.h> typedef struct ocsp_cert_id_st OCSP_CERTID;
# include <openssl/x509v3.h>
# include <openssl/safestack.h> DEFINE_STACK_OF(OCSP_CERTID)
#ifdef __cplusplus typedef struct ocsp_one_request_st OCSP_ONEREQ;
extern "C" {
#endif DEFINE_STACK_OF(OCSP_ONEREQ)
/* Various flags and values */ typedef struct ocsp_req_info_st OCSP_REQINFO;
typedef struct ocsp_signature_st OCSP_SIGNATURE;
# define OCSP_DEFAULT_NONCE_LENGTH 16 typedef struct ocsp_request_st OCSP_REQUEST;
# define OCSP_NOCERTS 0x1 # define OCSP_RESPONSE_STATUS_SUCCESSFUL 0
# define OCSP_NOINTERN 0x2 # define OCSP_RESPONSE_STATUS_MALFORMEDREQUEST 1
# define OCSP_NOSIGS 0x4 # define OCSP_RESPONSE_STATUS_INTERNALERROR 2
# define OCSP_NOCHAIN 0x8 # define OCSP_RESPONSE_STATUS_TRYLATER 3
# define OCSP_NOVERIFY 0x10 # define OCSP_RESPONSE_STATUS_SIGREQUIRED 5
# define OCSP_NOEXPLICIT 0x20 # define OCSP_RESPONSE_STATUS_UNAUTHORIZED 6
# define OCSP_NOCASIGN 0x40
# define OCSP_NODELEGATED 0x80 typedef struct ocsp_resp_bytes_st OCSP_RESPBYTES;
# define OCSP_NOCHECKS 0x100
# define OCSP_TRUSTOTHER 0x200 # define V_OCSP_RESPID_NAME 0
# define OCSP_RESPID_KEY 0x400 # define V_OCSP_RESPID_KEY 1
# define OCSP_NOTIME 0x800
DEFINE_STACK_OF(OCSP_RESPID)
/*- CertID ::= SEQUENCE { DECLARE_ASN1_FUNCTIONS(OCSP_RESPID)
* hashAlgorithm AlgorithmIdentifier,
* issuerNameHash OCTET STRING, -- Hash of Issuer's DN typedef struct ocsp_revoked_info_st OCSP_REVOKEDINFO;
* issuerKeyHash OCTET STRING, -- Hash of Issuers public key (excluding the tag & length fields)
* serialNumber CertificateSerialNumber } # define V_OCSP_CERTSTATUS_GOOD 0
*/ # define V_OCSP_CERTSTATUS_REVOKED 1
typedef struct ocsp_cert_id_st { # define V_OCSP_CERTSTATUS_UNKNOWN 2
X509_ALGOR *hashAlgorithm;
ASN1_OCTET_STRING *issuerNameHash; typedef struct ocsp_cert_status_st OCSP_CERTSTATUS;
ASN1_OCTET_STRING *issuerKeyHash; typedef struct ocsp_single_response_st OCSP_SINGLERESP;
ASN1_INTEGER *serialNumber;
} OCSP_CERTID; DEFINE_STACK_OF(OCSP_SINGLERESP)
DECLARE_STACK_OF(OCSP_CERTID) typedef struct ocsp_response_data_st OCSP_RESPDATA;
/*- Request ::= SEQUENCE { typedef struct ocsp_basic_response_st OCSP_BASICRESP;
* reqCert CertID,
* singleRequestExtensions [0] EXPLICIT Extensions OPTIONAL } typedef struct ocsp_crl_id_st OCSP_CRLID;
*/ typedef struct ocsp_service_locator_st OCSP_SERVICELOC;
typedef struct ocsp_one_request_st {
OCSP_CERTID *reqCert; # define PEM_STRING_OCSP_REQUEST "OCSP REQUEST"
STACK_OF(X509_EXTENSION) *singleRequestExtensions; # define PEM_STRING_OCSP_RESPONSE "OCSP RESPONSE"
} OCSP_ONEREQ;
# define d2i_OCSP_REQUEST_bio(bp,p) ASN1_d2i_bio_of(OCSP_REQUEST,OCSP_REQUEST_new,d2i_OCSP_REQUEST,bp,p)
DECLARE_STACK_OF(OCSP_ONEREQ)
DECLARE_ASN1_SET_OF(OCSP_ONEREQ) # define d2i_OCSP_RESPONSE_bio(bp,p) ASN1_d2i_bio_of(OCSP_RESPONSE,OCSP_RESPONSE_new,d2i_OCSP_RESPONSE,bp,p)
/*- TBSRequest ::= SEQUENCE { # define PEM_read_bio_OCSP_REQUEST(bp,x,cb) (OCSP_REQUEST *)PEM_ASN1_read_bio( \
* version [0] EXPLICIT Version DEFAULT v1, (char *(*)())d2i_OCSP_REQUEST,PEM_STRING_OCSP_REQUEST, \
* requestorName [1] EXPLICIT GeneralName OPTIONAL, bp,(char **)(x),cb,NULL)
* requestList SEQUENCE OF Request,
* requestExtensions [2] EXPLICIT Extensions OPTIONAL } # define PEM_read_bio_OCSP_RESPONSE(bp,x,cb)(OCSP_RESPONSE *)PEM_ASN1_read_bio(\
*/ (char *(*)())d2i_OCSP_RESPONSE,PEM_STRING_OCSP_RESPONSE, \
typedef struct ocsp_req_info_st { bp,(char **)(x),cb,NULL)
ASN1_INTEGER *version;
GENERAL_NAME *requestorName; # define PEM_write_bio_OCSP_REQUEST(bp,o) \
STACK_OF(OCSP_ONEREQ) *requestList; PEM_ASN1_write_bio((int (*)())i2d_OCSP_REQUEST,PEM_STRING_OCSP_REQUEST,\
STACK_OF(X509_EXTENSION) *requestExtensions; bp,(char *)(o), NULL,NULL,0,NULL,NULL)
} OCSP_REQINFO;
# define PEM_write_bio_OCSP_RESPONSE(bp,o) \
/*- Signature ::= SEQUENCE { PEM_ASN1_write_bio((int (*)())i2d_OCSP_RESPONSE,PEM_STRING_OCSP_RESPONSE,\
* signatureAlgorithm AlgorithmIdentifier, bp,(char *)(o), NULL,NULL,0,NULL,NULL)
* signature BIT STRING,
* certs [0] EXPLICIT SEQUENCE OF Certificate OPTIONAL } # define i2d_OCSP_RESPONSE_bio(bp,o) ASN1_i2d_bio_of(OCSP_RESPONSE,i2d_OCSP_RESPONSE,bp,o)
*/
typedef struct ocsp_signature_st { # define i2d_OCSP_REQUEST_bio(bp,o) ASN1_i2d_bio_of(OCSP_REQUEST,i2d_OCSP_REQUEST,bp,o)
X509_ALGOR *signatureAlgorithm;
ASN1_BIT_STRING *signature; # define ASN1_BIT_STRING_digest(data,type,md,len) \
STACK_OF(X509) *certs; ASN1_item_digest(ASN1_ITEM_rptr(ASN1_BIT_STRING),type,data,md,len)
} OCSP_SIGNATURE;
# define OCSP_CERTSTATUS_dup(cs)\
/*- OCSPRequest ::= SEQUENCE { (OCSP_CERTSTATUS*)ASN1_dup((int(*)())i2d_OCSP_CERTSTATUS,\
* tbsRequest TBSRequest, (char *(*)())d2i_OCSP_CERTSTATUS,(char *)(cs))
* optionalSignature [0] EXPLICIT Signature OPTIONAL }
*/ OCSP_CERTID *OCSP_CERTID_dup(OCSP_CERTID *id);
typedef struct ocsp_request_st {
OCSP_REQINFO *tbsRequest; OCSP_RESPONSE *OCSP_sendreq_bio(BIO *b, const char *path, OCSP_REQUEST *req);
OCSP_SIGNATURE *optionalSignature; /* OPTIONAL */ OCSP_REQ_CTX *OCSP_sendreq_new(BIO *io, const char *path, OCSP_REQUEST *req,
} OCSP_REQUEST; int maxline);
int OCSP_REQ_CTX_nbio(OCSP_REQ_CTX *rctx);
/*- OCSPResponseStatus ::= ENUMERATED { int OCSP_sendreq_nbio(OCSP_RESPONSE **presp, OCSP_REQ_CTX *rctx);
* successful (0), --Response has valid confirmations OCSP_REQ_CTX *OCSP_REQ_CTX_new(BIO *io, int maxline);
* malformedRequest (1), --Illegal confirmation request void OCSP_REQ_CTX_free(OCSP_REQ_CTX *rctx);
* internalError (2), --Internal error in issuer void OCSP_set_max_response_length(OCSP_REQ_CTX *rctx, unsigned long len);
* tryLater (3), --Try again later int OCSP_REQ_CTX_i2d(OCSP_REQ_CTX *rctx, const ASN1_ITEM *it,
* --(4) is not used ASN1_VALUE *val);
* sigRequired (5), --Must sign the request int OCSP_REQ_CTX_nbio_d2i(OCSP_REQ_CTX *rctx, ASN1_VALUE **pval,
* unauthorized (6) --Request unauthorized const ASN1_ITEM *it);
* } BIO *OCSP_REQ_CTX_get0_mem_bio(OCSP_REQ_CTX *rctx);
*/ int OCSP_REQ_CTX_i2d(OCSP_REQ_CTX *rctx, const ASN1_ITEM *it,
# define OCSP_RESPONSE_STATUS_SUCCESSFUL 0 ASN1_VALUE *val);
# define OCSP_RESPONSE_STATUS_MALFORMEDREQUEST 1 int OCSP_REQ_CTX_http(OCSP_REQ_CTX *rctx, const char *op, const char *path);
# define OCSP_RESPONSE_STATUS_INTERNALERROR 2 int OCSP_REQ_CTX_set1_req(OCSP_REQ_CTX *rctx, OCSP_REQUEST *req);
# define OCSP_RESPONSE_STATUS_TRYLATER 3 int OCSP_REQ_CTX_add1_header(OCSP_REQ_CTX *rctx,
# define OCSP_RESPONSE_STATUS_SIGREQUIRED 5 const char *name, const char *value);
# define OCSP_RESPONSE_STATUS_UNAUTHORIZED 6
OCSP_CERTID *OCSP_cert_to_id(const EVP_MD *dgst, const X509 *subject,
/*- ResponseBytes ::= SEQUENCE { const X509 *issuer);
* responseType OBJECT IDENTIFIER,
* response OCTET STRING } OCSP_CERTID *OCSP_cert_id_new(const EVP_MD *dgst,
*/ const X509_NAME *issuerName,
typedef struct ocsp_resp_bytes_st { const ASN1_BIT_STRING *issuerKey,
ASN1_OBJECT *responseType; const ASN1_INTEGER *serialNumber);
ASN1_OCTET_STRING *response;
} OCSP_RESPBYTES; OCSP_ONEREQ *OCSP_request_add0_id(OCSP_REQUEST *req, OCSP_CERTID *cid);
/*- OCSPResponse ::= SEQUENCE { int OCSP_request_add1_nonce(OCSP_REQUEST *req, unsigned char *val, int len);
* responseStatus OCSPResponseStatus, int OCSP_basic_add1_nonce(OCSP_BASICRESP *resp, unsigned char *val, int len);
* responseBytes [0] EXPLICIT ResponseBytes OPTIONAL } int OCSP_check_nonce(OCSP_REQUEST *req, OCSP_BASICRESP *bs);
*/ int OCSP_copy_nonce(OCSP_BASICRESP *resp, OCSP_REQUEST *req);
struct ocsp_response_st {
ASN1_ENUMERATED *responseStatus; int OCSP_request_set1_name(OCSP_REQUEST *req, X509_NAME *nm);
OCSP_RESPBYTES *responseBytes; int OCSP_request_add1_cert(OCSP_REQUEST *req, X509 *cert);
};
int OCSP_request_sign(OCSP_REQUEST *req,
/*- ResponderID ::= CHOICE { X509 *signer,
* byName [1] Name, EVP_PKEY *key,
* byKey [2] KeyHash } const EVP_MD *dgst,
*/ STACK_OF(X509) *certs, unsigned long flags);
# define V_OCSP_RESPID_NAME 0
# define V_OCSP_RESPID_KEY 1 int OCSP_response_status(OCSP_RESPONSE *resp);
struct ocsp_responder_id_st { OCSP_BASICRESP *OCSP_response_get1_basic(OCSP_RESPONSE *resp);
int type;
union { const ASN1_OCTET_STRING *OCSP_resp_get0_signature(const OCSP_BASICRESP *bs);
X509_NAME *byName; const X509_ALGOR *OCSP_resp_get0_tbs_sigalg(const OCSP_BASICRESP *bs);
ASN1_OCTET_STRING *byKey; const OCSP_RESPDATA *OCSP_resp_get0_respdata(const OCSP_BASICRESP *bs);
} value; int OCSP_resp_get0_signer(OCSP_BASICRESP *bs, X509 **signer,
}; STACK_OF(X509) *extra_certs);
DECLARE_STACK_OF(OCSP_RESPID) int OCSP_resp_count(OCSP_BASICRESP *bs);
DECLARE_ASN1_FUNCTIONS(OCSP_RESPID) OCSP_SINGLERESP *OCSP_resp_get0(OCSP_BASICRESP *bs, int idx);
const ASN1_GENERALIZEDTIME *OCSP_resp_get0_produced_at(const OCSP_BASICRESP* bs);
/*- KeyHash ::= OCTET STRING --SHA-1 hash of responder's public key const STACK_OF(X509) *OCSP_resp_get0_certs(const OCSP_BASICRESP *bs);
* --(excluding the tag and length fields) int OCSP_resp_get0_id(const OCSP_BASICRESP *bs,
*/ const ASN1_OCTET_STRING **pid,
const X509_NAME **pname);
/*- RevokedInfo ::= SEQUENCE { int OCSP_resp_get1_id(const OCSP_BASICRESP *bs,
* revocationTime GeneralizedTime, ASN1_OCTET_STRING **pid,
* revocationReason [0] EXPLICIT CRLReason OPTIONAL } X509_NAME **pname);
*/
typedef struct ocsp_revoked_info_st { int OCSP_resp_find(OCSP_BASICRESP *bs, OCSP_CERTID *id, int last);
ASN1_GENERALIZEDTIME *revocationTime; int OCSP_single_get0_status(OCSP_SINGLERESP *single, int *reason,
ASN1_ENUMERATED *revocationReason; ASN1_GENERALIZEDTIME **revtime,
} OCSP_REVOKEDINFO; ASN1_GENERALIZEDTIME **thisupd,
ASN1_GENERALIZEDTIME **nextupd);
/*- CertStatus ::= CHOICE { int OCSP_resp_find_status(OCSP_BASICRESP *bs, OCSP_CERTID *id, int *status,
* good [0] IMPLICIT NULL, int *reason,
* revoked [1] IMPLICIT RevokedInfo, ASN1_GENERALIZEDTIME **revtime,
* unknown [2] IMPLICIT UnknownInfo } ASN1_GENERALIZEDTIME **thisupd,
*/ ASN1_GENERALIZEDTIME **nextupd);
# define V_OCSP_CERTSTATUS_GOOD 0 int OCSP_check_validity(ASN1_GENERALIZEDTIME *thisupd,
# define V_OCSP_CERTSTATUS_REVOKED 1 ASN1_GENERALIZEDTIME *nextupd, long sec, long maxsec);
# define V_OCSP_CERTSTATUS_UNKNOWN 2
typedef struct ocsp_cert_status_st { int OCSP_request_verify(OCSP_REQUEST *req, STACK_OF(X509) *certs,
int type; X509_STORE *store, unsigned long flags);
union {
ASN1_NULL *good; int OCSP_parse_url(const char *url, char **phost, char **pport, char **ppath,
OCSP_REVOKEDINFO *revoked; int *pssl);
ASN1_NULL *unknown;
} value; int OCSP_id_issuer_cmp(OCSP_CERTID *a, OCSP_CERTID *b);
} OCSP_CERTSTATUS; int OCSP_id_cmp(OCSP_CERTID *a, OCSP_CERTID *b);
/*- SingleResponse ::= SEQUENCE { int OCSP_request_onereq_count(OCSP_REQUEST *req);
* certID CertID, OCSP_ONEREQ *OCSP_request_onereq_get0(OCSP_REQUEST *req, int i);
* certStatus CertStatus, OCSP_CERTID *OCSP_onereq_get0_id(OCSP_ONEREQ *one);
* thisUpdate GeneralizedTime, int OCSP_id_get0_info(ASN1_OCTET_STRING **piNameHash, ASN1_OBJECT **pmd,
* nextUpdate [0] EXPLICIT GeneralizedTime OPTIONAL, ASN1_OCTET_STRING **pikeyHash,
* singleExtensions [1] EXPLICIT Extensions OPTIONAL } ASN1_INTEGER **pserial, OCSP_CERTID *cid);
*/ int OCSP_request_is_signed(OCSP_REQUEST *req);
typedef struct ocsp_single_response_st { OCSP_RESPONSE *OCSP_response_create(int status, OCSP_BASICRESP *bs);
OCSP_CERTID *certId; OCSP_SINGLERESP *OCSP_basic_add1_status(OCSP_BASICRESP *rsp,
OCSP_CERTSTATUS *certStatus; OCSP_CERTID *cid,
ASN1_GENERALIZEDTIME *thisUpdate; int status, int reason,
ASN1_GENERALIZEDTIME *nextUpdate; ASN1_TIME *revtime,
STACK_OF(X509_EXTENSION) *singleExtensions; ASN1_TIME *thisupd,
} OCSP_SINGLERESP; ASN1_TIME *nextupd);
int OCSP_basic_add1_cert(OCSP_BASICRESP *resp, X509 *cert);
DECLARE_STACK_OF(OCSP_SINGLERESP) int OCSP_basic_sign(OCSP_BASICRESP *brsp,
DECLARE_ASN1_SET_OF(OCSP_SINGLERESP) X509 *signer, EVP_PKEY *key, const EVP_MD *dgst,
STACK_OF(X509) *certs, unsigned long flags);
/*- ResponseData ::= SEQUENCE { int OCSP_basic_sign_ctx(OCSP_BASICRESP *brsp,
* version [0] EXPLICIT Version DEFAULT v1, X509 *signer, EVP_MD_CTX *ctx,
* responderID ResponderID, STACK_OF(X509) *certs, unsigned long flags);
* producedAt GeneralizedTime, int OCSP_RESPID_set_by_name(OCSP_RESPID *respid, X509 *cert);
* responses SEQUENCE OF SingleResponse, int OCSP_RESPID_set_by_key(OCSP_RESPID *respid, X509 *cert);
* responseExtensions [1] EXPLICIT Extensions OPTIONAL } int OCSP_RESPID_match(OCSP_RESPID *respid, X509 *cert);
*/
typedef struct ocsp_response_data_st { X509_EXTENSION *OCSP_crlID_new(const char *url, long *n, char *tim);
ASN1_INTEGER *version;
OCSP_RESPID *responderId; X509_EXTENSION *OCSP_accept_responses_new(char **oids);
ASN1_GENERALIZEDTIME *producedAt;
STACK_OF(OCSP_SINGLERESP) *responses; X509_EXTENSION *OCSP_archive_cutoff_new(char *tim);
STACK_OF(X509_EXTENSION) *responseExtensions;
} OCSP_RESPDATA; X509_EXTENSION *OCSP_url_svcloc_new(X509_NAME *issuer, const char **urls);
/*- BasicOCSPResponse ::= SEQUENCE { int OCSP_REQUEST_get_ext_count(OCSP_REQUEST *x);
* tbsResponseData ResponseData, int OCSP_REQUEST_get_ext_by_NID(OCSP_REQUEST *x, int nid, int lastpos);
* signatureAlgorithm AlgorithmIdentifier, int OCSP_REQUEST_get_ext_by_OBJ(OCSP_REQUEST *x, const ASN1_OBJECT *obj,
* signature BIT STRING, int lastpos);
* certs [0] EXPLICIT SEQUENCE OF Certificate OPTIONAL } int OCSP_REQUEST_get_ext_by_critical(OCSP_REQUEST *x, int crit, int lastpos);
*/ X509_EXTENSION *OCSP_REQUEST_get_ext(OCSP_REQUEST *x, int loc);
/* X509_EXTENSION *OCSP_REQUEST_delete_ext(OCSP_REQUEST *x, int loc);
* Note 1: The value for "signature" is specified in the OCSP rfc2560 as void *OCSP_REQUEST_get1_ext_d2i(OCSP_REQUEST *x, int nid, int *crit,
* follows: "The value for the signature SHALL be computed on the hash of int *idx);
* the DER encoding ResponseData." This means that you must hash the int OCSP_REQUEST_add1_ext_i2d(OCSP_REQUEST *x, int nid, void *value, int crit,
* DER-encoded tbsResponseData, and then run it through a crypto-signing unsigned long flags);
* function, which will (at least w/RSA) do a hash-'n'-private-encrypt int OCSP_REQUEST_add_ext(OCSP_REQUEST *x, X509_EXTENSION *ex, int loc);
* operation. This seems a bit odd, but that's the spec. Also note that
* the data structures do not leave anywhere to independently specify the int OCSP_ONEREQ_get_ext_count(OCSP_ONEREQ *x);
* algorithm used for the initial hash. So, we look at the int OCSP_ONEREQ_get_ext_by_NID(OCSP_ONEREQ *x, int nid, int lastpos);
* signature-specification algorithm, and try to do something intelligent. int OCSP_ONEREQ_get_ext_by_OBJ(OCSP_ONEREQ *x, const ASN1_OBJECT *obj, int lastpos);
* -- Kathy Weinhold, CertCo int OCSP_ONEREQ_get_ext_by_critical(OCSP_ONEREQ *x, int crit, int lastpos);
*/ X509_EXTENSION *OCSP_ONEREQ_get_ext(OCSP_ONEREQ *x, int loc);
/* X509_EXTENSION *OCSP_ONEREQ_delete_ext(OCSP_ONEREQ *x, int loc);
* Note 2: It seems that the mentioned passage from RFC 2560 (section void *OCSP_ONEREQ_get1_ext_d2i(OCSP_ONEREQ *x, int nid, int *crit, int *idx);
* 4.2.1) is open for interpretation. I've done tests against another int OCSP_ONEREQ_add1_ext_i2d(OCSP_ONEREQ *x, int nid, void *value, int crit,
* responder, and found that it doesn't do the double hashing that the RFC unsigned long flags);
* seems to say one should. Therefore, all relevant functions take a flag int OCSP_ONEREQ_add_ext(OCSP_ONEREQ *x, X509_EXTENSION *ex, int loc);
* saying which variant should be used. -- Richard Levitte, OpenSSL team
* and CeloCom int OCSP_BASICRESP_get_ext_count(OCSP_BASICRESP *x);
*/ int OCSP_BASICRESP_get_ext_by_NID(OCSP_BASICRESP *x, int nid, int lastpos);
typedef struct ocsp_basic_response_st { int OCSP_BASICRESP_get_ext_by_OBJ(OCSP_BASICRESP *x, const ASN1_OBJECT *obj,
OCSP_RESPDATA *tbsResponseData; int lastpos);
X509_ALGOR *signatureAlgorithm; int OCSP_BASICRESP_get_ext_by_critical(OCSP_BASICRESP *x, int crit,
ASN1_BIT_STRING *signature; int lastpos);
STACK_OF(X509) *certs; X509_EXTENSION *OCSP_BASICRESP_get_ext(OCSP_BASICRESP *x, int loc);
} OCSP_BASICRESP; X509_EXTENSION *OCSP_BASICRESP_delete_ext(OCSP_BASICRESP *x, int loc);
void *OCSP_BASICRESP_get1_ext_d2i(OCSP_BASICRESP *x, int nid, int *crit,
/*- int *idx);
* CRLReason ::= ENUMERATED { int OCSP_BASICRESP_add1_ext_i2d(OCSP_BASICRESP *x, int nid, void *value,
* unspecified (0), int crit, unsigned long flags);
* keyCompromise (1), int OCSP_BASICRESP_add_ext(OCSP_BASICRESP *x, X509_EXTENSION *ex, int loc);
* cACompromise (2),
* affiliationChanged (3), int OCSP_SINGLERESP_get_ext_count(OCSP_SINGLERESP *x);
* superseded (4), int OCSP_SINGLERESP_get_ext_by_NID(OCSP_SINGLERESP *x, int nid, int lastpos);
* cessationOfOperation (5), int OCSP_SINGLERESP_get_ext_by_OBJ(OCSP_SINGLERESP *x, const ASN1_OBJECT *obj,
* certificateHold (6), int lastpos);
* removeFromCRL (8) } int OCSP_SINGLERESP_get_ext_by_critical(OCSP_SINGLERESP *x, int crit,
*/ int lastpos);
# define OCSP_REVOKED_STATUS_NOSTATUS -1 X509_EXTENSION *OCSP_SINGLERESP_get_ext(OCSP_SINGLERESP *x, int loc);
# define OCSP_REVOKED_STATUS_UNSPECIFIED 0 X509_EXTENSION *OCSP_SINGLERESP_delete_ext(OCSP_SINGLERESP *x, int loc);
# define OCSP_REVOKED_STATUS_KEYCOMPROMISE 1 void *OCSP_SINGLERESP_get1_ext_d2i(OCSP_SINGLERESP *x, int nid, int *crit,
# define OCSP_REVOKED_STATUS_CACOMPROMISE 2 int *idx);
# define OCSP_REVOKED_STATUS_AFFILIATIONCHANGED 3 int OCSP_SINGLERESP_add1_ext_i2d(OCSP_SINGLERESP *x, int nid, void *value,
# define OCSP_REVOKED_STATUS_SUPERSEDED 4 int crit, unsigned long flags);
# define OCSP_REVOKED_STATUS_CESSATIONOFOPERATION 5 int OCSP_SINGLERESP_add_ext(OCSP_SINGLERESP *x, X509_EXTENSION *ex, int loc);
# define OCSP_REVOKED_STATUS_CERTIFICATEHOLD 6 const OCSP_CERTID *OCSP_SINGLERESP_get0_id(const OCSP_SINGLERESP *x);
# define OCSP_REVOKED_STATUS_REMOVEFROMCRL 8
DECLARE_ASN1_FUNCTIONS(OCSP_SINGLERESP)
/*- DECLARE_ASN1_FUNCTIONS(OCSP_CERTSTATUS)
* CrlID ::= SEQUENCE { DECLARE_ASN1_FUNCTIONS(OCSP_REVOKEDINFO)
* crlUrl [0] EXPLICIT IA5String OPTIONAL, DECLARE_ASN1_FUNCTIONS(OCSP_BASICRESP)
* crlNum [1] EXPLICIT INTEGER OPTIONAL, DECLARE_ASN1_FUNCTIONS(OCSP_RESPDATA)
* crlTime [2] EXPLICIT GeneralizedTime OPTIONAL } DECLARE_ASN1_FUNCTIONS(OCSP_RESPID)
*/ DECLARE_ASN1_FUNCTIONS(OCSP_RESPONSE)
typedef struct ocsp_crl_id_st { DECLARE_ASN1_FUNCTIONS(OCSP_RESPBYTES)
ASN1_IA5STRING *crlUrl; DECLARE_ASN1_FUNCTIONS(OCSP_ONEREQ)
ASN1_INTEGER *crlNum; DECLARE_ASN1_FUNCTIONS(OCSP_CERTID)
ASN1_GENERALIZEDTIME *crlTime; DECLARE_ASN1_FUNCTIONS(OCSP_REQUEST)
} OCSP_CRLID; DECLARE_ASN1_FUNCTIONS(OCSP_SIGNATURE)
DECLARE_ASN1_FUNCTIONS(OCSP_REQINFO)
/*- DECLARE_ASN1_FUNCTIONS(OCSP_CRLID)
* ServiceLocator ::= SEQUENCE { DECLARE_ASN1_FUNCTIONS(OCSP_SERVICELOC)
* issuer Name,
* locator AuthorityInfoAccessSyntax OPTIONAL } const char *OCSP_response_status_str(long s);
*/ const char *OCSP_cert_status_str(long s);
typedef struct ocsp_service_locator_st { const char *OCSP_crl_reason_str(long s);
X509_NAME *issuer;
STACK_OF(ACCESS_DESCRIPTION) *locator; int OCSP_REQUEST_print(BIO *bp, OCSP_REQUEST *a, unsigned long flags);
} OCSP_SERVICELOC; int OCSP_RESPONSE_print(BIO *bp, OCSP_RESPONSE *o, unsigned long flags);
# define PEM_STRING_OCSP_REQUEST "OCSP REQUEST" int OCSP_basic_verify(OCSP_BASICRESP *bs, STACK_OF(X509) *certs,
# define PEM_STRING_OCSP_RESPONSE "OCSP RESPONSE" X509_STORE *st, unsigned long flags);
# define d2i_OCSP_REQUEST_bio(bp,p) ASN1_d2i_bio_of(OCSP_REQUEST,OCSP_REQUEST_new,d2i_OCSP_REQUEST,bp,p)
# ifdef __cplusplus
# define d2i_OCSP_RESPONSE_bio(bp,p) ASN1_d2i_bio_of(OCSP_RESPONSE,OCSP_RESPONSE_new,d2i_OCSP_RESPONSE,bp,p) }
# endif
# define PEM_read_bio_OCSP_REQUEST(bp,x,cb) (OCSP_REQUEST *)PEM_ASN1_read_bio( \ # endif
(char *(*)())d2i_OCSP_REQUEST,PEM_STRING_OCSP_REQUEST,bp,(char **)x,cb,NULL) #endif
# define PEM_read_bio_OCSP_RESPONSE(bp,x,cb)(OCSP_RESPONSE *)PEM_ASN1_read_bio(\
(char *(*)())d2i_OCSP_RESPONSE,PEM_STRING_OCSP_RESPONSE,bp,(char **)x,cb,NULL)
# define PEM_write_bio_OCSP_REQUEST(bp,o) \
PEM_ASN1_write_bio((int (*)())i2d_OCSP_REQUEST,PEM_STRING_OCSP_REQUEST,\
bp,(char *)o, NULL,NULL,0,NULL,NULL)
# define PEM_write_bio_OCSP_RESPONSE(bp,o) \
PEM_ASN1_write_bio((int (*)())i2d_OCSP_RESPONSE,PEM_STRING_OCSP_RESPONSE,\
bp,(char *)o, NULL,NULL,0,NULL,NULL)
# define i2d_OCSP_RESPONSE_bio(bp,o) ASN1_i2d_bio_of(OCSP_RESPONSE,i2d_OCSP_RESPONSE,bp,o)
# define i2d_OCSP_REQUEST_bio(bp,o) ASN1_i2d_bio_of(OCSP_REQUEST,i2d_OCSP_REQUEST,bp,o)
# define OCSP_REQUEST_sign(o,pkey,md) \
ASN1_item_sign(ASN1_ITEM_rptr(OCSP_REQINFO),\
o->optionalSignature->signatureAlgorithm,NULL,\
o->optionalSignature->signature,o->tbsRequest,pkey,md)
# define OCSP_BASICRESP_sign(o,pkey,md,d) \
ASN1_item_sign(ASN1_ITEM_rptr(OCSP_RESPDATA),o->signatureAlgorithm,NULL,\
o->signature,o->tbsResponseData,pkey,md)
# define OCSP_REQUEST_verify(a,r) ASN1_item_verify(ASN1_ITEM_rptr(OCSP_REQINFO),\
a->optionalSignature->signatureAlgorithm,\
a->optionalSignature->signature,a->tbsRequest,r)
# define OCSP_BASICRESP_verify(a,r,d) ASN1_item_verify(ASN1_ITEM_rptr(OCSP_RESPDATA),\
a->signatureAlgorithm,a->signature,a->tbsResponseData,r)
# define ASN1_BIT_STRING_digest(data,type,md,len) \
ASN1_item_digest(ASN1_ITEM_rptr(ASN1_BIT_STRING),type,data,md,len)
# define OCSP_CERTSTATUS_dup(cs)\
(OCSP_CERTSTATUS*)ASN1_dup((int(*)())i2d_OCSP_CERTSTATUS,\
(char *(*)())d2i_OCSP_CERTSTATUS,(char *)(cs))
OCSP_CERTID *OCSP_CERTID_dup(OCSP_CERTID *id);
OCSP_RESPONSE *OCSP_sendreq_bio(BIO *b, const char *path, OCSP_REQUEST *req);
OCSP_REQ_CTX *OCSP_sendreq_new(BIO *io, const char *path, OCSP_REQUEST *req,
int maxline);
int OCSP_REQ_CTX_nbio(OCSP_REQ_CTX *rctx);
int OCSP_sendreq_nbio(OCSP_RESPONSE **presp, OCSP_REQ_CTX *rctx);
OCSP_REQ_CTX *OCSP_REQ_CTX_new(BIO *io, int maxline);
void OCSP_REQ_CTX_free(OCSP_REQ_CTX *rctx);
void OCSP_set_max_response_length(OCSP_REQ_CTX *rctx, unsigned long len);
int OCSP_REQ_CTX_i2d(OCSP_REQ_CTX *rctx, const ASN1_ITEM *it,
ASN1_VALUE *val);
int OCSP_REQ_CTX_nbio_d2i(OCSP_REQ_CTX *rctx, ASN1_VALUE **pval,
const ASN1_ITEM *it);
BIO *OCSP_REQ_CTX_get0_mem_bio(OCSP_REQ_CTX *rctx);
int OCSP_REQ_CTX_i2d(OCSP_REQ_CTX *rctx, const ASN1_ITEM *it,
ASN1_VALUE *val);
int OCSP_REQ_CTX_http(OCSP_REQ_CTX *rctx, const char *op, const char *path);
int OCSP_REQ_CTX_set1_req(OCSP_REQ_CTX *rctx, OCSP_REQUEST *req);
int OCSP_REQ_CTX_add1_header(OCSP_REQ_CTX *rctx,
const char *name, const char *value);
OCSP_CERTID *OCSP_cert_to_id(const EVP_MD *dgst, X509 *subject, X509 *issuer);
OCSP_CERTID *OCSP_cert_id_new(const EVP_MD *dgst,
X509_NAME *issuerName,
ASN1_BIT_STRING *issuerKey,
ASN1_INTEGER *serialNumber);
OCSP_ONEREQ *OCSP_request_add0_id(OCSP_REQUEST *req, OCSP_CERTID *cid);
int OCSP_request_add1_nonce(OCSP_REQUEST *req, unsigned char *val, int len);
int OCSP_basic_add1_nonce(OCSP_BASICRESP *resp, unsigned char *val, int len);
int OCSP_check_nonce(OCSP_REQUEST *req, OCSP_BASICRESP *bs);
int OCSP_copy_nonce(OCSP_BASICRESP *resp, OCSP_REQUEST *req);
int OCSP_request_set1_name(OCSP_REQUEST *req, X509_NAME *nm);
int OCSP_request_add1_cert(OCSP_REQUEST *req, X509 *cert);
int OCSP_request_sign(OCSP_REQUEST *req,
X509 *signer,
EVP_PKEY *key,
const EVP_MD *dgst,
STACK_OF(X509) *certs, unsigned long flags);
int OCSP_response_status(OCSP_RESPONSE *resp);
OCSP_BASICRESP *OCSP_response_get1_basic(OCSP_RESPONSE *resp);
int OCSP_resp_count(OCSP_BASICRESP *bs);
OCSP_SINGLERESP *OCSP_resp_get0(OCSP_BASICRESP *bs, int idx);
int OCSP_resp_find(OCSP_BASICRESP *bs, OCSP_CERTID *id, int last);
int OCSP_single_get0_status(OCSP_SINGLERESP *single, int *reason,
ASN1_GENERALIZEDTIME **revtime,
ASN1_GENERALIZEDTIME **thisupd,
ASN1_GENERALIZEDTIME **nextupd);
int OCSP_resp_find_status(OCSP_BASICRESP *bs, OCSP_CERTID *id, int *status,
int *reason,
ASN1_GENERALIZEDTIME **revtime,
ASN1_GENERALIZEDTIME **thisupd,
ASN1_GENERALIZEDTIME **nextupd);
int OCSP_check_validity(ASN1_GENERALIZEDTIME *thisupd,
ASN1_GENERALIZEDTIME *nextupd, long sec, long maxsec);
int OCSP_request_verify(OCSP_REQUEST *req, STACK_OF(X509) *certs,
X509_STORE *store, unsigned long flags);
int OCSP_parse_url(const char *url, char **phost, char **pport, char **ppath,
int *pssl);
int OCSP_id_issuer_cmp(OCSP_CERTID *a, OCSP_CERTID *b);
int OCSP_id_cmp(OCSP_CERTID *a, OCSP_CERTID *b);
int OCSP_request_onereq_count(OCSP_REQUEST *req);
OCSP_ONEREQ *OCSP_request_onereq_get0(OCSP_REQUEST *req, int i);
OCSP_CERTID *OCSP_onereq_get0_id(OCSP_ONEREQ *one);
int OCSP_id_get0_info(ASN1_OCTET_STRING **piNameHash, ASN1_OBJECT **pmd,
ASN1_OCTET_STRING **pikeyHash,
ASN1_INTEGER **pserial, OCSP_CERTID *cid);
int OCSP_request_is_signed(OCSP_REQUEST *req);
OCSP_RESPONSE *OCSP_response_create(int status, OCSP_BASICRESP *bs);
OCSP_SINGLERESP *OCSP_basic_add1_status(OCSP_BASICRESP *rsp,
OCSP_CERTID *cid,
int status, int reason,
ASN1_TIME *revtime,
ASN1_TIME *thisupd,
ASN1_TIME *nextupd);
int OCSP_basic_add1_cert(OCSP_BASICRESP *resp, X509 *cert);
int OCSP_basic_sign(OCSP_BASICRESP *brsp,
X509 *signer, EVP_PKEY *key, const EVP_MD *dgst,
STACK_OF(X509) *certs, unsigned long flags);
X509_EXTENSION *OCSP_crlID_new(char *url, long *n, char *tim);
X509_EXTENSION *OCSP_accept_responses_new(char **oids);
X509_EXTENSION *OCSP_archive_cutoff_new(char *tim);
X509_EXTENSION *OCSP_url_svcloc_new(X509_NAME *issuer, char **urls);
int OCSP_REQUEST_get_ext_count(OCSP_REQUEST *x);
int OCSP_REQUEST_get_ext_by_NID(OCSP_REQUEST *x, int nid, int lastpos);
int OCSP_REQUEST_get_ext_by_OBJ(OCSP_REQUEST *x, ASN1_OBJECT *obj,
int lastpos);
int OCSP_REQUEST_get_ext_by_critical(OCSP_REQUEST *x, int crit, int lastpos);
X509_EXTENSION *OCSP_REQUEST_get_ext(OCSP_REQUEST *x, int loc);
X509_EXTENSION *OCSP_REQUEST_delete_ext(OCSP_REQUEST *x, int loc);
void *OCSP_REQUEST_get1_ext_d2i(OCSP_REQUEST *x, int nid, int *crit,
int *idx);
int OCSP_REQUEST_add1_ext_i2d(OCSP_REQUEST *x, int nid, void *value, int crit,
unsigned long flags);
int OCSP_REQUEST_add_ext(OCSP_REQUEST *x, X509_EXTENSION *ex, int loc);
int OCSP_ONEREQ_get_ext_count(OCSP_ONEREQ *x);
int OCSP_ONEREQ_get_ext_by_NID(OCSP_ONEREQ *x, int nid, int lastpos);
int OCSP_ONEREQ_get_ext_by_OBJ(OCSP_ONEREQ *x, ASN1_OBJECT *obj, int lastpos);
int OCSP_ONEREQ_get_ext_by_critical(OCSP_ONEREQ *x, int crit, int lastpos);
X509_EXTENSION *OCSP_ONEREQ_get_ext(OCSP_ONEREQ *x, int loc);
X509_EXTENSION *OCSP_ONEREQ_delete_ext(OCSP_ONEREQ *x, int loc);
void *OCSP_ONEREQ_get1_ext_d2i(OCSP_ONEREQ *x, int nid, int *crit, int *idx);
int OCSP_ONEREQ_add1_ext_i2d(OCSP_ONEREQ *x, int nid, void *value, int crit,
unsigned long flags);
int OCSP_ONEREQ_add_ext(OCSP_ONEREQ *x, X509_EXTENSION *ex, int loc);
int OCSP_BASICRESP_get_ext_count(OCSP_BASICRESP *x);
int OCSP_BASICRESP_get_ext_by_NID(OCSP_BASICRESP *x, int nid, int lastpos);
int OCSP_BASICRESP_get_ext_by_OBJ(OCSP_BASICRESP *x, ASN1_OBJECT *obj,
int lastpos);
int OCSP_BASICRESP_get_ext_by_critical(OCSP_BASICRESP *x, int crit,
int lastpos);
X509_EXTENSION *OCSP_BASICRESP_get_ext(OCSP_BASICRESP *x, int loc);
X509_EXTENSION *OCSP_BASICRESP_delete_ext(OCSP_BASICRESP *x, int loc);
void *OCSP_BASICRESP_get1_ext_d2i(OCSP_BASICRESP *x, int nid, int *crit,
int *idx);
int OCSP_BASICRESP_add1_ext_i2d(OCSP_BASICRESP *x, int nid, void *value,
int crit, unsigned long flags);
int OCSP_BASICRESP_add_ext(OCSP_BASICRESP *x, X509_EXTENSION *ex, int loc);
int OCSP_SINGLERESP_get_ext_count(OCSP_SINGLERESP *x);
int OCSP_SINGLERESP_get_ext_by_NID(OCSP_SINGLERESP *x, int nid, int lastpos);
int OCSP_SINGLERESP_get_ext_by_OBJ(OCSP_SINGLERESP *x, ASN1_OBJECT *obj,
int lastpos);
int OCSP_SINGLERESP_get_ext_by_critical(OCSP_SINGLERESP *x, int crit,
int lastpos);
X509_EXTENSION *OCSP_SINGLERESP_get_ext(OCSP_SINGLERESP *x, int loc);
X509_EXTENSION *OCSP_SINGLERESP_delete_ext(OCSP_SINGLERESP *x, int loc);
void *OCSP_SINGLERESP_get1_ext_d2i(OCSP_SINGLERESP *x, int nid, int *crit,
int *idx);
int OCSP_SINGLERESP_add1_ext_i2d(OCSP_SINGLERESP *x, int nid, void *value,
int crit, unsigned long flags);
int OCSP_SINGLERESP_add_ext(OCSP_SINGLERESP *x, X509_EXTENSION *ex, int loc);
DECLARE_ASN1_FUNCTIONS(OCSP_SINGLERESP)
DECLARE_ASN1_FUNCTIONS(OCSP_CERTSTATUS)
DECLARE_ASN1_FUNCTIONS(OCSP_REVOKEDINFO)
DECLARE_ASN1_FUNCTIONS(OCSP_BASICRESP)
DECLARE_ASN1_FUNCTIONS(OCSP_RESPDATA)
DECLARE_ASN1_FUNCTIONS(OCSP_RESPID)
DECLARE_ASN1_FUNCTIONS(OCSP_RESPONSE)
DECLARE_ASN1_FUNCTIONS(OCSP_RESPBYTES)
DECLARE_ASN1_FUNCTIONS(OCSP_ONEREQ)
DECLARE_ASN1_FUNCTIONS(OCSP_CERTID)
DECLARE_ASN1_FUNCTIONS(OCSP_REQUEST)
DECLARE_ASN1_FUNCTIONS(OCSP_SIGNATURE)
DECLARE_ASN1_FUNCTIONS(OCSP_REQINFO)
DECLARE_ASN1_FUNCTIONS(OCSP_CRLID)
DECLARE_ASN1_FUNCTIONS(OCSP_SERVICELOC)
const char *OCSP_response_status_str(long s);
const char *OCSP_cert_status_str(long s);
const char *OCSP_crl_reason_str(long s);
int OCSP_REQUEST_print(BIO *bp, OCSP_REQUEST *a, unsigned long flags);
int OCSP_RESPONSE_print(BIO *bp, OCSP_RESPONSE *o, unsigned long flags);
int OCSP_basic_verify(OCSP_BASICRESP *bs, STACK_OF(X509) *certs,
X509_STORE *st, unsigned long flags);
/* 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_OCSP_strings(void);
/* Error codes for the OCSP functions. */
/* Function codes. */
# define OCSP_F_ASN1_STRING_ENCODE 100
# define OCSP_F_D2I_OCSP_NONCE 102
# define OCSP_F_OCSP_BASIC_ADD1_STATUS 103
# define OCSP_F_OCSP_BASIC_SIGN 104
# define OCSP_F_OCSP_BASIC_VERIFY 105
# define OCSP_F_OCSP_CERT_ID_NEW 101
# define OCSP_F_OCSP_CHECK_DELEGATED 106
# define OCSP_F_OCSP_CHECK_IDS 107
# define OCSP_F_OCSP_CHECK_ISSUER 108
# define OCSP_F_OCSP_CHECK_VALIDITY 115
# define OCSP_F_OCSP_MATCH_ISSUERID 109
# define OCSP_F_OCSP_PARSE_URL 114
# define OCSP_F_OCSP_REQUEST_SIGN 110
# define OCSP_F_OCSP_REQUEST_VERIFY 116
# define OCSP_F_OCSP_RESPONSE_GET1_BASIC 111
# define OCSP_F_OCSP_SENDREQ_BIO 112
# define OCSP_F_OCSP_SENDREQ_NBIO 117
# define OCSP_F_PARSE_HTTP_LINE1 118
# define OCSP_F_REQUEST_VERIFY 113
/* Reason codes. */
# define OCSP_R_BAD_DATA 100
# define OCSP_R_CERTIFICATE_VERIFY_ERROR 101
# define OCSP_R_DIGEST_ERR 102
# define OCSP_R_ERROR_IN_NEXTUPDATE_FIELD 122
# define OCSP_R_ERROR_IN_THISUPDATE_FIELD 123
# define OCSP_R_ERROR_PARSING_URL 121
# define OCSP_R_MISSING_OCSPSIGNING_USAGE 103
# define OCSP_R_NEXTUPDATE_BEFORE_THISUPDATE 124
# define OCSP_R_NOT_BASIC_RESPONSE 104
# define OCSP_R_NO_CERTIFICATES_IN_CHAIN 105
# define OCSP_R_NO_CONTENT 106
# define OCSP_R_NO_PUBLIC_KEY 107
# define OCSP_R_NO_RESPONSE_DATA 108
# define OCSP_R_NO_REVOKED_TIME 109
# define OCSP_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE 110
# define OCSP_R_REQUEST_NOT_SIGNED 128
# define OCSP_R_RESPONSE_CONTAINS_NO_REVOCATION_DATA 111
# define OCSP_R_ROOT_CA_NOT_TRUSTED 112
# define OCSP_R_SERVER_READ_ERROR 113
# define OCSP_R_SERVER_RESPONSE_ERROR 114
# define OCSP_R_SERVER_RESPONSE_PARSE_ERROR 115
# define OCSP_R_SERVER_WRITE_ERROR 116
# define OCSP_R_SIGNATURE_FAILURE 117
# define OCSP_R_SIGNER_CERTIFICATE_NOT_FOUND 118
# define OCSP_R_STATUS_EXPIRED 125
# define OCSP_R_STATUS_NOT_YET_VALID 126
# define OCSP_R_STATUS_TOO_OLD 127
# define OCSP_R_UNKNOWN_MESSAGE_DIGEST 119
# define OCSP_R_UNKNOWN_NID 120
# define OCSP_R_UNSUPPORTED_REQUESTORNAME_TYPE 129
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,74 @@
/*
* Generated by util/mkerr.pl DO NOT EDIT
* Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/license.html
*/
#ifndef HEADER_OCSPERR_H
# define HEADER_OCSPERR_H
# include <openssl/opensslconf.h>
# ifndef OPENSSL_NO_OCSP
# ifdef __cplusplus
extern "C"
# endif
int ERR_load_OCSP_strings(void);
/*
* OCSP function codes.
*/
# define OCSP_F_D2I_OCSP_NONCE 102
# define OCSP_F_OCSP_BASIC_ADD1_STATUS 103
# define OCSP_F_OCSP_BASIC_SIGN 104
# define OCSP_F_OCSP_BASIC_SIGN_CTX 119
# define OCSP_F_OCSP_BASIC_VERIFY 105
# define OCSP_F_OCSP_CERT_ID_NEW 101
# define OCSP_F_OCSP_CHECK_DELEGATED 106
# define OCSP_F_OCSP_CHECK_IDS 107
# define OCSP_F_OCSP_CHECK_ISSUER 108
# define OCSP_F_OCSP_CHECK_VALIDITY 115
# define OCSP_F_OCSP_MATCH_ISSUERID 109
# define OCSP_F_OCSP_PARSE_URL 114
# define OCSP_F_OCSP_REQUEST_SIGN 110
# define OCSP_F_OCSP_REQUEST_VERIFY 116
# define OCSP_F_OCSP_RESPONSE_GET1_BASIC 111
# define OCSP_F_PARSE_HTTP_LINE1 118
/*
* OCSP reason codes.
*/
# define OCSP_R_CERTIFICATE_VERIFY_ERROR 101
# define OCSP_R_DIGEST_ERR 102
# define OCSP_R_ERROR_IN_NEXTUPDATE_FIELD 122
# define OCSP_R_ERROR_IN_THISUPDATE_FIELD 123
# define OCSP_R_ERROR_PARSING_URL 121
# define OCSP_R_MISSING_OCSPSIGNING_USAGE 103
# define OCSP_R_NEXTUPDATE_BEFORE_THISUPDATE 124
# define OCSP_R_NOT_BASIC_RESPONSE 104
# define OCSP_R_NO_CERTIFICATES_IN_CHAIN 105
# define OCSP_R_NO_RESPONSE_DATA 108
# define OCSP_R_NO_REVOKED_TIME 109
# define OCSP_R_NO_SIGNER_KEY 130
# define OCSP_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE 110
# define OCSP_R_REQUEST_NOT_SIGNED 128
# define OCSP_R_RESPONSE_CONTAINS_NO_REVOCATION_DATA 111
# define OCSP_R_ROOT_CA_NOT_TRUSTED 112
# define OCSP_R_SERVER_RESPONSE_ERROR 114
# define OCSP_R_SERVER_RESPONSE_PARSE_ERROR 115
# define OCSP_R_SIGNATURE_FAILURE 117
# define OCSP_R_SIGNER_CERTIFICATE_NOT_FOUND 118
# define OCSP_R_STATUS_EXPIRED 125
# define OCSP_R_STATUS_NOT_YET_VALID 126
# define OCSP_R_STATUS_TOO_OLD 127
# define OCSP_R_UNKNOWN_MESSAGE_DIGEST 119
# define OCSP_R_UNKNOWN_NID 120
# define OCSP_R_UNSUPPORTED_REQUESTORNAME_TYPE 129
# endif
#endif

View File

@ -1,30 +1,31 @@
/* opensslconf.h */ /*
/* WARNING: Generated automatically from opensslconf.h.in by Configure. */ * WARNING: do not edit!
* Generated by makefile from include\openssl\opensslconf.h.in
*
* Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/license.html
*/
#include <openssl/opensslv.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/* OpenSSL was configured with the following options: */
#ifndef OPENSSL_SYSNAME_WIN32
# define OPENSSL_SYSNAME_WIN32
#endif
#ifndef OPENSSL_DOING_MAKEDEPEND
#ifdef OPENSSL_ALGORITHM_DEFINES
# error OPENSSL_ALGORITHM_DEFINES no longer supported
#endif
#ifndef OPENSSL_NO_EC_NISTP_64_GCC_128 /*
# define OPENSSL_NO_EC_NISTP_64_GCC_128 * OpenSSL was configured with the following options:
#endif */
#ifndef OPENSSL_NO_GMP
# define OPENSSL_NO_GMP #ifndef OPENSSL_SYS_WIN64A
#endif # define OPENSSL_SYS_WIN64A 1
#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 #endif
#ifndef OPENSSL_NO_MD2 #ifndef OPENSSL_NO_MD2
# define OPENSSL_NO_MD2 # define OPENSSL_NO_MD2
@ -32,8 +33,44 @@ extern "C" {
#ifndef OPENSSL_NO_RC5 #ifndef OPENSSL_NO_RC5
# define OPENSSL_NO_RC5 # define OPENSSL_NO_RC5
#endif #endif
#ifndef OPENSSL_NO_RFC3779 #ifndef OPENSSL_THREADS
# define OPENSSL_NO_RFC3779 # define OPENSSL_THREADS
#endif
#ifndef OPENSSL_RAND_SEED_OS
# define OPENSSL_RAND_SEED_OS
#endif
#ifndef OPENSSL_NO_ASAN
# define OPENSSL_NO_ASAN
#endif
#ifndef OPENSSL_NO_CRYPTO_MDEBUG
# define OPENSSL_NO_CRYPTO_MDEBUG
#endif
#ifndef OPENSSL_NO_CRYPTO_MDEBUG_BACKTRACE
# define OPENSSL_NO_CRYPTO_MDEBUG_BACKTRACE
#endif
#ifndef OPENSSL_NO_DEVCRYPTOENG
# define OPENSSL_NO_DEVCRYPTOENG
#endif
#ifndef OPENSSL_NO_EC_NISTP_64_GCC_128
# define OPENSSL_NO_EC_NISTP_64_GCC_128
#endif
#ifndef OPENSSL_NO_EGD
# define OPENSSL_NO_EGD
#endif
#ifndef OPENSSL_NO_EXTERNAL_TESTS
# define OPENSSL_NO_EXTERNAL_TESTS
#endif
#ifndef OPENSSL_NO_FUZZ_AFL
# define OPENSSL_NO_FUZZ_AFL
#endif
#ifndef OPENSSL_NO_FUZZ_LIBFUZZER
# define OPENSSL_NO_FUZZ_LIBFUZZER
#endif
#ifndef OPENSSL_NO_HEARTBEATS
# define OPENSSL_NO_HEARTBEATS
#endif
#ifndef OPENSSL_NO_MSAN
# define OPENSSL_NO_MSAN
#endif #endif
#ifndef OPENSSL_NO_SCTP #ifndef OPENSSL_NO_SCTP
# define OPENSSL_NO_SCTP # define OPENSSL_NO_SCTP
@ -41,231 +78,112 @@ extern "C" {
#ifndef OPENSSL_NO_SSL_TRACE #ifndef OPENSSL_NO_SSL_TRACE
# define OPENSSL_NO_SSL_TRACE # define OPENSSL_NO_SSL_TRACE
#endif #endif
#ifndef OPENSSL_NO_SSL2 #ifndef OPENSSL_NO_UBSAN
# define OPENSSL_NO_SSL2 # define OPENSSL_NO_UBSAN
#endif
#ifndef OPENSSL_NO_STORE
# define OPENSSL_NO_STORE
#endif #endif
#ifndef OPENSSL_NO_UNIT_TEST #ifndef OPENSSL_NO_UNIT_TEST
# define OPENSSL_NO_UNIT_TEST # define OPENSSL_NO_UNIT_TEST
#endif #endif
#ifndef OPENSSL_NO_WEAK_SSL_CIPHERS #ifndef OPENSSL_NO_DYNAMIC_ENGINE
# define OPENSSL_NO_WEAK_SSL_CIPHERS # define OPENSSL_NO_DYNAMIC_ENGINE
#endif
#ifndef OPENSSL_NO_AFALGENG
# define OPENSSL_NO_AFALGENG
#endif #endif
#endif /* OPENSSL_DOING_MAKEDEPEND */
#ifndef OPENSSL_THREADS /*
# define OPENSSL_THREADS * Sometimes OPENSSSL_NO_xxx ends up with an empty file and some compilers
#endif * don't like that. This will hopefully silence them.
*/
#define NON_EMPTY_TRANSLATION_UNIT static void *dummy = &dummy;
/* 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 * Applications should use -DOPENSSL_API_COMPAT=<version> to suppress the
who haven't had the time to do the appropriate changes in their * declarations of functions deprecated in or before <version>. Otherwise, they
applications. */ * still won't see them if the library has been built to disable deprecated
#ifdef OPENSSL_ALGORITHM_DEFINES * functions.
# if defined(OPENSSL_NO_EC_NISTP_64_GCC_128) && !defined(NO_EC_NISTP_64_GCC_128) */
# define NO_EC_NISTP_64_GCC_128 #ifndef DECLARE_DEPRECATED
# endif # define DECLARE_DEPRECATED(f) f;
# if defined(OPENSSL_NO_GMP) && !defined(NO_GMP) # ifdef __GNUC__
# define NO_GMP # if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0)
# endif # undef DECLARE_DEPRECATED
# if defined(OPENSSL_NO_JPAKE) && !defined(NO_JPAKE) # define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated));
# define NO_JPAKE # endif
# 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
#endif #endif
#define OPENSSL_CPUID_OBJ #ifndef OPENSSL_FILE
# ifdef OPENSSL_NO_FILENAMES
# define OPENSSL_FILE ""
# define OPENSSL_LINE 0
# else
# define OPENSSL_FILE __FILE__
# define OPENSSL_LINE __LINE__
# endif
#endif
/* crypto/opensslconf.h.in */ #ifndef OPENSSL_MIN_API
# define OPENSSL_MIN_API 0
#endif
#if !defined(OPENSSL_API_COMPAT) || OPENSSL_API_COMPAT < OPENSSL_MIN_API
# undef OPENSSL_API_COMPAT
# define OPENSSL_API_COMPAT OPENSSL_MIN_API
#endif
/*
* Do not deprecate things to be deprecated in version 1.2.0 before the
* OpenSSL version number matches.
*/
#if OPENSSL_VERSION_NUMBER < 0x10200000L
# define DEPRECATEDIN_1_2_0(f) f;
#elif OPENSSL_API_COMPAT < 0x10200000L
# define DEPRECATEDIN_1_2_0(f) DECLARE_DEPRECATED(f)
#else
# define DEPRECATEDIN_1_2_0(f)
#endif
#if OPENSSL_API_COMPAT < 0x10100000L
# define DEPRECATEDIN_1_1_0(f) DECLARE_DEPRECATED(f)
#else
# define DEPRECATEDIN_1_1_0(f)
#endif
#if OPENSSL_API_COMPAT < 0x10000000L
# define DEPRECATEDIN_1_0_0(f) DECLARE_DEPRECATED(f)
#else
# define DEPRECATEDIN_1_0_0(f)
#endif
#if OPENSSL_API_COMPAT < 0x00908000L
# define DEPRECATEDIN_0_9_8(f) DECLARE_DEPRECATED(f)
#else
# define DEPRECATEDIN_0_9_8(f)
#endif
/* Generate 80386 code? */ /* Generate 80386 code? */
#undef I386_ONLY #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 #undef OPENSSL_UNISTD
#define OPENSSL_UNISTD <unistd.h> #define OPENSSL_UNISTD <unistd.h>
#undef OPENSSL_EXPORT_VAR_AS_FUNCTION
#define OPENSSL_EXPORT_VAR_AS_FUNCTION #define 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: * The following are cipher-specific, but are part of the public API.
* - Intel P6 because partial register stalls are very expensive;
* - elder Alpha because it lacks byte load/store instructions;
*/ */
#define RC4_INT unsigned int #if !defined(OPENSSL_SYS_UEFI)
#endif # undef BN_LLONG
#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
#define BN_LLONG
/* Should we define BN_DIV2W here? */
/* Only one for the following should be defined */ /* Only one for the following should be defined */
#undef SIXTY_FOUR_BIT_LONG # undef SIXTY_FOUR_BIT_LONG
#undef SIXTY_FOUR_BIT # define SIXTY_FOUR_BIT
#define THIRTY_TWO_BIT # undef THIRTY_TWO_BIT
#endif #endif
#if defined(HEADER_RC4_LOCL_H) && !defined(CONFIG_HEADER_RC4_LOCL_H) #define RC4_INT unsigned int
#define CONFIG_HEADER_RC4_LOCL_H
/* if this is defined data[i] is used instead of *data, this is a %20
* speedup on x86 */
#define 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 #ifdef __cplusplus
} }
#endif #endif

View File

@ -1,97 +1,101 @@
#ifndef HEADER_OPENSSLV_H /*
# define HEADER_OPENSSLV_H * Copyright 1999-2018 The OpenSSL Project Authors. All Rights Reserved.
*
#ifdef __cplusplus * Licensed under the OpenSSL license (the "License"). You may not use
extern "C" { * this file except in compliance with the License. You can obtain a copy
#endif * in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/license.html
/*- */
* Numeric release version identifier:
* MNNFFPPS: major minor fix patch status #ifndef HEADER_OPENSSLV_H
* The status nibble has one of the values 0 for development, 1 to e for betas # define HEADER_OPENSSLV_H
* 1 to 14, and f for release. The patch level is exactly that.
* For example: #ifdef __cplusplus
* 0.9.3-dev 0x00903000 extern "C" {
* 0.9.3-beta1 0x00903001 #endif
* 0.9.3-beta2-dev 0x00903002
* 0.9.3-beta2 0x00903002 (same as ...beta2-dev) /*-
* 0.9.3 0x0090300f * Numeric release version identifier:
* 0.9.3a 0x0090301f * MNNFFPPS: major minor fix patch status
* 0.9.4 0x0090400f * The status nibble has one of the values 0 for development, 1 to e for betas
* 1.2.3z 0x102031af * 1 to 14, and f for release. The patch level is exactly that.
* * For example:
* For continuity reasons (because 0.9.5 is already out, and is coded * 0.9.3-dev 0x00903000
* 0x00905100), between 0.9.5 and 0.9.6 the coding of the patch level * 0.9.3-beta1 0x00903001
* part is slightly different, by setting the highest bit. This means * 0.9.3-beta2-dev 0x00903002
* that 0.9.5a looks like this: 0x0090581f. At 0.9.6, we can start * 0.9.3-beta2 0x00903002 (same as ...beta2-dev)
* with 0x0090600S... * 0.9.3 0x0090300f
* * 0.9.3a 0x0090301f
* (Prior to 0.9.3-dev a different scheme was used: 0.9.2b is 0x0922.) * 0.9.4 0x0090400f
* (Prior to 0.9.5a beta1, a different scheme was used: MMNNFFRBB for * 1.2.3z 0x102031af
* major minor fix final patch/beta) *
*/ * For continuity reasons (because 0.9.5 is already out, and is coded
# define OPENSSL_VERSION_NUMBER 0x100020afL * 0x00905100), between 0.9.5 and 0.9.6 the coding of the patch level
# ifdef OPENSSL_FIPS * part is slightly different, by setting the highest bit. This means
# define OPENSSL_VERSION_TEXT "OpenSSL 1.0.2j-fips 26 Sep 2016" * that 0.9.5a looks like this: 0x0090581f. At 0.9.6, we can start
# else * with 0x0090600S...
# define OPENSSL_VERSION_TEXT "OpenSSL 1.0.2j 26 Sep 2016" *
# endif * (Prior to 0.9.3-dev a different scheme was used: 0.9.2b is 0x0922.)
# define OPENSSL_VERSION_PTEXT " part of " OPENSSL_VERSION_TEXT * (Prior to 0.9.5a beta1, a different scheme was used: MMNNFFRBB for
* major minor fix final patch/beta)
/*- */
* The macros below are to be used for shared library (.so, .dll, ...) # define OPENSSL_VERSION_NUMBER 0x1010100fL
* versioning. That kind of versioning works a bit differently between # define OPENSSL_VERSION_TEXT "OpenSSL 1.1.1 11 Sep 2018"
* operating systems. The most usual scheme is to set a major and a minor
* number, and have the runtime loader check that the major number is equal /*-
* to what it was at application link time, while the minor number has to * The macros below are to be used for shared library (.so, .dll, ...)
* be greater or equal to what it was at application link time. With this * versioning. That kind of versioning works a bit differently between
* scheme, the version number is usually part of the file name, like this: * operating systems. The most usual scheme is to set a major and a minor
* * number, and have the runtime loader check that the major number is equal
* libcrypto.so.0.9 * to what it was at application link time, while the minor number has to
* * be greater or equal to what it was at application link time. With this
* Some unixen also make a softlink with the major verson number only: * scheme, the version number is usually part of the file name, like this:
* *
* libcrypto.so.0 * libcrypto.so.0.9
* *
* On Tru64 and IRIX 6.x it works a little bit differently. There, the * Some unixen also make a softlink with the major version number only:
* shared library version is stored in the file, and is actually a series *
* of versions, separated by colons. The rightmost version present in the * libcrypto.so.0
* library when linking an application is stored in the application to be *
* matched at run time. When the application is run, a check is done to * On Tru64 and IRIX 6.x it works a little bit differently. There, the
* see if the library version stored in the application matches any of the * shared library version is stored in the file, and is actually a series
* versions in the version string of the library itself. * of versions, separated by colons. The rightmost version present in the
* This version string can be constructed in any way, depending on what * library when linking an application is stored in the application to be
* kind of matching is desired. However, to implement the same scheme as * matched at run time. When the application is run, a check is done to
* the one used in the other unixen, all compatible versions, from lowest * see if the library version stored in the application matches any of the
* to highest, should be part of the string. Consecutive builds would * versions in the version string of the library itself.
* give the following versions strings: * This version string can be constructed in any way, depending on what
* * kind of matching is desired. However, to implement the same scheme as
* 3.0 * the one used in the other unixen, all compatible versions, from lowest
* 3.0:3.1 * to highest, should be part of the string. Consecutive builds would
* 3.0:3.1:3.2 * give the following versions strings:
* 4.0 *
* 4.0:4.1 * 3.0
* * 3.0:3.1
* Notice how version 4 is completely incompatible with version, and * 3.0:3.1:3.2
* therefore give the breach you can see. * 4.0
* * 4.0:4.1
* There may be other schemes as well that I haven't yet discovered. *
* * Notice how version 4 is completely incompatible with version, and
* So, here's the way it works here: first of all, the library version * therefore give the breach you can see.
* number doesn't need at all to match the overall OpenSSL version. *
* However, it's nice and more understandable if it actually does. * There may be other schemes as well that I haven't yet discovered.
* The current library version is stored in the macro SHLIB_VERSION_NUMBER, *
* which is just a piece of text in the format "M.m.e" (Major, minor, edit). * So, here's the way it works here: first of all, the library version
* For the sake of Tru64, IRIX, and any other OS that behaves in similar ways, * number doesn't need at all to match the overall OpenSSL version.
* we need to keep a history of version numbers, which is done in the * However, it's nice and more understandable if it actually does.
* macro SHLIB_VERSION_HISTORY. The numbers are separated by colons and * The current library version is stored in the macro SHLIB_VERSION_NUMBER,
* should only keep the versions that are binary compatible with the current. * which is just a piece of text in the format "M.m.e" (Major, minor, edit).
*/ * For the sake of Tru64, IRIX, and any other OS that behaves in similar ways,
# define SHLIB_VERSION_HISTORY "" * we need to keep a history of version numbers, which is done in the
# define SHLIB_VERSION_NUMBER "1.0.0" * macro SHLIB_VERSION_HISTORY. The numbers are separated by colons and
* should only keep the versions that are binary compatible with the current.
*/
#ifdef __cplusplus # define SHLIB_VERSION_HISTORY ""
} # define SHLIB_VERSION_NUMBER "1.1"
#endif
#endif /* HEADER_OPENSSLV_H */
#ifdef __cplusplus
}
#endif
#endif /* HEADER_OPENSSLV_H */

View File

@ -1,213 +1,196 @@
/* ==================================================================== /*
* Copyright (c) 1998-2001 The OpenSSL Project. All rights reserved. * Copyright 2001-2018 The OpenSSL Project Authors. All Rights Reserved.
* *
* Redistribution and use in source and binary forms, with or without * Licensed under the OpenSSL license (the "License"). You may not use
* modification, are permitted provided that the following conditions * this file except in compliance with the License. You can obtain a copy
* are met: * in the file LICENSE in the source distribution or at
* * https://www.openssl.org/source/license.html
* 1. Redistributions of source code must retain the above copyright */
* notice, this list of conditions and the following disclaimer.
* #ifndef HEADER_OPENSSL_TYPES_H
* 2. Redistributions in binary form must reproduce the above copyright # define HEADER_OPENSSL_TYPES_H
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the #include <limits.h>
* distribution.
* #ifdef __cplusplus
* 3. All advertising materials mentioning features or use of this extern "C" {
* software must display the following acknowledgment: #endif
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit. (http://www.openssl.org/)" # include <openssl/e_os2.h>
*
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to # ifdef NO_ASN1_TYPEDEFS
* endorse or promote products derived from this software without # define ASN1_INTEGER ASN1_STRING
* prior written permission. For written permission, please contact # define ASN1_ENUMERATED ASN1_STRING
* openssl-core@openssl.org. # define ASN1_BIT_STRING ASN1_STRING
* # define ASN1_OCTET_STRING ASN1_STRING
* 5. Products derived from this software may not be called "OpenSSL" # define ASN1_PRINTABLESTRING ASN1_STRING
* nor may "OpenSSL" appear in their names without prior written # define ASN1_T61STRING ASN1_STRING
* permission of the OpenSSL Project. # define ASN1_IA5STRING ASN1_STRING
* # define ASN1_UTCTIME ASN1_STRING
* 6. Redistributions of any form whatsoever must retain the following # define ASN1_GENERALIZEDTIME ASN1_STRING
* acknowledgment: # define ASN1_TIME ASN1_STRING
* "This product includes software developed by the OpenSSL Project # define ASN1_GENERALSTRING ASN1_STRING
* for use in the OpenSSL Toolkit (http://www.openssl.org/)" # define ASN1_UNIVERSALSTRING ASN1_STRING
* # define ASN1_BMPSTRING ASN1_STRING
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY # define ASN1_VISIBLESTRING ASN1_STRING
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # define ASN1_UTF8STRING ASN1_STRING
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR # define ASN1_BOOLEAN int
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR # define ASN1_NULL int
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, # else
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT typedef struct asn1_string_st ASN1_INTEGER;
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; typedef struct asn1_string_st ASN1_ENUMERATED;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) typedef struct asn1_string_st ASN1_BIT_STRING;
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, typedef struct asn1_string_st ASN1_OCTET_STRING;
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) typedef struct asn1_string_st ASN1_PRINTABLESTRING;
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED typedef struct asn1_string_st ASN1_T61STRING;
* OF THE POSSIBILITY OF SUCH DAMAGE. typedef struct asn1_string_st ASN1_IA5STRING;
* ==================================================================== typedef struct asn1_string_st ASN1_GENERALSTRING;
* typedef struct asn1_string_st ASN1_UNIVERSALSTRING;
* This product includes cryptographic software written by Eric Young typedef struct asn1_string_st ASN1_BMPSTRING;
* (eay@cryptsoft.com). This product includes software written by Tim typedef struct asn1_string_st ASN1_UTCTIME;
* Hudson (tjh@cryptsoft.com). typedef struct asn1_string_st ASN1_TIME;
* typedef struct asn1_string_st ASN1_GENERALIZEDTIME;
*/ typedef struct asn1_string_st ASN1_VISIBLESTRING;
typedef struct asn1_string_st ASN1_UTF8STRING;
#ifndef HEADER_OPENSSL_TYPES_H typedef struct asn1_string_st ASN1_STRING;
# define HEADER_OPENSSL_TYPES_H typedef int ASN1_BOOLEAN;
typedef int ASN1_NULL;
#ifdef __cplusplus # endif
extern "C" {
#endif typedef struct asn1_object_st ASN1_OBJECT;
# include <openssl/e_os2.h> typedef struct ASN1_ITEM_st ASN1_ITEM;
typedef struct asn1_pctx_st ASN1_PCTX;
# ifdef NO_ASN1_TYPEDEFS typedef struct asn1_sctx_st ASN1_SCTX;
# define ASN1_INTEGER ASN1_STRING
# define ASN1_ENUMERATED ASN1_STRING # ifdef _WIN32
# define ASN1_BIT_STRING ASN1_STRING # undef X509_NAME
# define ASN1_OCTET_STRING ASN1_STRING # undef X509_EXTENSIONS
# define ASN1_PRINTABLESTRING ASN1_STRING # undef PKCS7_ISSUER_AND_SERIAL
# define ASN1_T61STRING ASN1_STRING # undef PKCS7_SIGNER_INFO
# define ASN1_IA5STRING ASN1_STRING # undef OCSP_REQUEST
# define ASN1_UTCTIME ASN1_STRING # undef OCSP_RESPONSE
# define ASN1_GENERALIZEDTIME ASN1_STRING # endif
# define ASN1_TIME ASN1_STRING
# define ASN1_GENERALSTRING ASN1_STRING # ifdef BIGNUM
# define ASN1_UNIVERSALSTRING ASN1_STRING # undef BIGNUM
# define ASN1_BMPSTRING ASN1_STRING # endif
# define ASN1_VISIBLESTRING ASN1_STRING struct dane_st;
# define ASN1_UTF8STRING ASN1_STRING typedef struct bio_st BIO;
# define ASN1_BOOLEAN int typedef struct bignum_st BIGNUM;
# define ASN1_NULL int typedef struct bignum_ctx BN_CTX;
# else typedef struct bn_blinding_st BN_BLINDING;
typedef struct asn1_string_st ASN1_INTEGER; typedef struct bn_mont_ctx_st BN_MONT_CTX;
typedef struct asn1_string_st ASN1_ENUMERATED; typedef struct bn_recp_ctx_st BN_RECP_CTX;
typedef struct asn1_string_st ASN1_BIT_STRING; typedef struct bn_gencb_st BN_GENCB;
typedef struct asn1_string_st ASN1_OCTET_STRING;
typedef struct asn1_string_st ASN1_PRINTABLESTRING; typedef struct buf_mem_st BUF_MEM;
typedef struct asn1_string_st ASN1_T61STRING;
typedef struct asn1_string_st ASN1_IA5STRING; typedef struct evp_cipher_st EVP_CIPHER;
typedef struct asn1_string_st ASN1_GENERALSTRING; typedef struct evp_cipher_ctx_st EVP_CIPHER_CTX;
typedef struct asn1_string_st ASN1_UNIVERSALSTRING; typedef struct evp_md_st EVP_MD;
typedef struct asn1_string_st ASN1_BMPSTRING; typedef struct evp_md_ctx_st EVP_MD_CTX;
typedef struct asn1_string_st ASN1_UTCTIME; typedef struct evp_pkey_st EVP_PKEY;
typedef struct asn1_string_st ASN1_TIME;
typedef struct asn1_string_st ASN1_GENERALIZEDTIME; typedef struct evp_pkey_asn1_method_st EVP_PKEY_ASN1_METHOD;
typedef struct asn1_string_st ASN1_VISIBLESTRING;
typedef struct asn1_string_st ASN1_UTF8STRING; typedef struct evp_pkey_method_st EVP_PKEY_METHOD;
typedef struct asn1_string_st ASN1_STRING; typedef struct evp_pkey_ctx_st EVP_PKEY_CTX;
typedef int ASN1_BOOLEAN;
typedef int ASN1_NULL; typedef struct evp_Encode_Ctx_st EVP_ENCODE_CTX;
# endif
typedef struct hmac_ctx_st HMAC_CTX;
typedef struct asn1_object_st ASN1_OBJECT;
typedef struct dh_st DH;
typedef struct ASN1_ITEM_st ASN1_ITEM; typedef struct dh_method DH_METHOD;
typedef struct asn1_pctx_st ASN1_PCTX;
typedef struct dsa_st DSA;
# ifdef OPENSSL_SYS_WIN32 typedef struct dsa_method DSA_METHOD;
# undef X509_NAME
# undef X509_EXTENSIONS typedef struct rsa_st RSA;
# undef X509_CERT_PAIR typedef struct rsa_meth_st RSA_METHOD;
# undef PKCS7_ISSUER_AND_SERIAL
# undef OCSP_REQUEST typedef struct ec_key_st EC_KEY;
# undef OCSP_RESPONSE typedef struct ec_key_method_st EC_KEY_METHOD;
# endif
typedef struct rand_meth_st RAND_METHOD;
# ifdef BIGNUM typedef struct rand_drbg_st RAND_DRBG;
# undef BIGNUM
# endif typedef struct ssl_dane_st SSL_DANE;
typedef struct bignum_st BIGNUM; typedef struct x509_st X509;
typedef struct bignum_ctx BN_CTX; typedef struct X509_algor_st X509_ALGOR;
typedef struct bn_blinding_st BN_BLINDING; typedef struct X509_crl_st X509_CRL;
typedef struct bn_mont_ctx_st BN_MONT_CTX; typedef struct x509_crl_method_st X509_CRL_METHOD;
typedef struct bn_recp_ctx_st BN_RECP_CTX; typedef struct x509_revoked_st X509_REVOKED;
typedef struct bn_gencb_st BN_GENCB; typedef struct X509_name_st X509_NAME;
typedef struct X509_pubkey_st X509_PUBKEY;
typedef struct buf_mem_st BUF_MEM; typedef struct x509_store_st X509_STORE;
typedef struct x509_store_ctx_st X509_STORE_CTX;
typedef struct evp_cipher_st EVP_CIPHER;
typedef struct evp_cipher_ctx_st EVP_CIPHER_CTX; typedef struct x509_object_st X509_OBJECT;
typedef struct env_md_st EVP_MD; typedef struct x509_lookup_st X509_LOOKUP;
typedef struct env_md_ctx_st EVP_MD_CTX; typedef struct x509_lookup_method_st X509_LOOKUP_METHOD;
typedef struct evp_pkey_st EVP_PKEY; typedef struct X509_VERIFY_PARAM_st X509_VERIFY_PARAM;
typedef struct evp_pkey_asn1_method_st EVP_PKEY_ASN1_METHOD; typedef struct x509_sig_info_st X509_SIG_INFO;
typedef struct evp_pkey_method_st EVP_PKEY_METHOD; typedef struct pkcs8_priv_key_info_st PKCS8_PRIV_KEY_INFO;
typedef struct evp_pkey_ctx_st EVP_PKEY_CTX;
typedef struct v3_ext_ctx X509V3_CTX;
typedef struct dh_st DH; typedef struct conf_st CONF;
typedef struct dh_method DH_METHOD; typedef struct ossl_init_settings_st OPENSSL_INIT_SETTINGS;
typedef struct dsa_st DSA; typedef struct ui_st UI;
typedef struct dsa_method DSA_METHOD; typedef struct ui_method_st UI_METHOD;
typedef struct rsa_st RSA; typedef struct engine_st ENGINE;
typedef struct rsa_meth_st RSA_METHOD; typedef struct ssl_st SSL;
typedef struct ssl_ctx_st SSL_CTX;
typedef struct rand_meth_st RAND_METHOD;
typedef struct comp_ctx_st COMP_CTX;
typedef struct ecdh_method ECDH_METHOD; typedef struct comp_method_st COMP_METHOD;
typedef struct ecdsa_method ECDSA_METHOD;
typedef struct X509_POLICY_NODE_st X509_POLICY_NODE;
typedef struct x509_st X509; typedef struct X509_POLICY_LEVEL_st X509_POLICY_LEVEL;
typedef struct X509_algor_st X509_ALGOR; typedef struct X509_POLICY_TREE_st X509_POLICY_TREE;
typedef struct X509_crl_st X509_CRL; typedef struct X509_POLICY_CACHE_st X509_POLICY_CACHE;
typedef struct x509_crl_method_st X509_CRL_METHOD;
typedef struct x509_revoked_st X509_REVOKED; typedef struct AUTHORITY_KEYID_st AUTHORITY_KEYID;
typedef struct X509_name_st X509_NAME; typedef struct DIST_POINT_st DIST_POINT;
typedef struct X509_pubkey_st X509_PUBKEY; typedef struct ISSUING_DIST_POINT_st ISSUING_DIST_POINT;
typedef struct x509_store_st X509_STORE; typedef struct NAME_CONSTRAINTS_st NAME_CONSTRAINTS;
typedef struct x509_store_ctx_st X509_STORE_CTX;
typedef struct crypto_ex_data_st CRYPTO_EX_DATA;
typedef struct pkcs8_priv_key_info_st PKCS8_PRIV_KEY_INFO;
typedef struct ocsp_req_ctx_st OCSP_REQ_CTX;
typedef struct v3_ext_ctx X509V3_CTX; typedef struct ocsp_response_st OCSP_RESPONSE;
typedef struct conf_st CONF; typedef struct ocsp_responder_id_st OCSP_RESPID;
typedef struct store_st STORE; typedef struct sct_st SCT;
typedef struct store_method_st STORE_METHOD; typedef struct sct_ctx_st SCT_CTX;
typedef struct ctlog_st CTLOG;
typedef struct ui_st UI; typedef struct ctlog_store_st CTLOG_STORE;
typedef struct ui_method_st UI_METHOD; typedef struct ct_policy_eval_ctx_st CT_POLICY_EVAL_CTX;
typedef struct st_ERR_FNS ERR_FNS; typedef struct ossl_store_info_st OSSL_STORE_INFO;
typedef struct ossl_store_search_st OSSL_STORE_SEARCH;
typedef struct engine_st ENGINE;
typedef struct ssl_st SSL; #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L && \
typedef struct ssl_ctx_st SSL_CTX; defined(INTMAX_MAX) && defined(UINTMAX_MAX)
typedef intmax_t ossl_intmax_t;
typedef struct comp_method_st COMP_METHOD; typedef uintmax_t ossl_uintmax_t;
#else
typedef struct X509_POLICY_NODE_st X509_POLICY_NODE; /*
typedef struct X509_POLICY_LEVEL_st X509_POLICY_LEVEL; * Not long long, because the C-library can only be expected to provide
typedef struct X509_POLICY_TREE_st X509_POLICY_TREE; * strtoll(), strtoull() at the same time as intmax_t and strtoimax(),
typedef struct X509_POLICY_CACHE_st X509_POLICY_CACHE; * strtoumax(). Since we use these for parsing arguments, we need the
* conversion functions, not just the sizes.
typedef struct AUTHORITY_KEYID_st AUTHORITY_KEYID; */
typedef struct DIST_POINT_st DIST_POINT; typedef long ossl_intmax_t;
typedef struct ISSUING_DIST_POINT_st ISSUING_DIST_POINT; typedef unsigned long ossl_uintmax_t;
typedef struct NAME_CONSTRAINTS_st NAME_CONSTRAINTS; #endif
/* If placed in pkcs12.h, we end up with a circular depency with pkcs7.h */ #ifdef __cplusplus
# define DECLARE_PKCS12_STACK_OF(type)/* Nothing */ }
# define IMPLEMENT_PKCS12_STACK_OF(type)/* Nothing */ #endif
#endif /* def HEADER_OPENSSL_TYPES_H */
typedef struct crypto_ex_data_st CRYPTO_EX_DATA;
/* Callback types for crypto.h */
typedef int CRYPTO_EX_new (void *parent, void *ptr, CRYPTO_EX_DATA *ad,
int idx, long argl, void *argp);
typedef void CRYPTO_EX_free (void *parent, void *ptr, CRYPTO_EX_DATA *ad,
int idx, long argl, void *argp);
typedef int CRYPTO_EX_dup (CRYPTO_EX_DATA *to, CRYPTO_EX_DATA *from,
void *from_d, int idx, long argl, void *argp);
typedef struct ocsp_req_ctx_st OCSP_REQ_CTX;
typedef struct ocsp_response_st OCSP_RESPONSE;
typedef struct ocsp_responder_id_st OCSP_RESPID;
#ifdef __cplusplus
}
#endif
#endif /* def HEADER_OPENSSL_TYPES_H */

View File

@ -1,617 +1,378 @@
/* crypto/pem/pem.h */ /*
/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
* All rights reserved. *
* * Licensed under the OpenSSL license (the "License"). You may not use
* This package is an SSL implementation written * this file except in compliance with the License. You can obtain a copy
* by Eric Young (eay@cryptsoft.com). * in the file LICENSE in the source distribution or at
* The implementation was written so as to conform with Netscapes SSL. * https://www.openssl.org/source/license.html
* */
* This library is free for commercial and non-commercial use as long as
* the following conditions are aheared to. The following conditions #ifndef HEADER_PEM_H
* apply to all code found in this distribution, be it the RC4, RSA, # define HEADER_PEM_H
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
* included with this distribution is covered by the same copyright terms # include <openssl/e_os2.h>
* except that the holder is Tim Hudson (tjh@cryptsoft.com). # include <openssl/bio.h>
* # include <openssl/safestack.h>
* Copyright remains Eric Young's, and as such any Copyright notices in # include <openssl/evp.h>
* the code are not to be removed. # include <openssl/x509.h>
* If this package is used in a product, Eric Young should be given attribution # include <openssl/pemerr.h>
* as the author of the parts of the library used.
* This can be in the form of a textual message at program startup or #ifdef __cplusplus
* in documentation (online or textual) provided with the package. extern "C" {
* #endif
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions # define PEM_BUFSIZE 1024
* are met:
* 1. Redistributions of source code must retain the copyright # define PEM_STRING_X509_OLD "X509 CERTIFICATE"
* notice, this list of conditions and the following disclaimer. # define PEM_STRING_X509 "CERTIFICATE"
* 2. Redistributions in binary form must reproduce the above copyright # define PEM_STRING_X509_TRUSTED "TRUSTED CERTIFICATE"
* notice, this list of conditions and the following disclaimer in the # define PEM_STRING_X509_REQ_OLD "NEW CERTIFICATE REQUEST"
* documentation and/or other materials provided with the distribution. # define PEM_STRING_X509_REQ "CERTIFICATE REQUEST"
* 3. All advertising materials mentioning features or use of this software # define PEM_STRING_X509_CRL "X509 CRL"
* must display the following acknowledgement: # define PEM_STRING_EVP_PKEY "ANY PRIVATE KEY"
* "This product includes cryptographic software written by # define PEM_STRING_PUBLIC "PUBLIC KEY"
* Eric Young (eay@cryptsoft.com)" # define PEM_STRING_RSA "RSA PRIVATE KEY"
* The word 'cryptographic' can be left out if the rouines from the library # define PEM_STRING_RSA_PUBLIC "RSA PUBLIC KEY"
* being used are not cryptographic related :-). # define PEM_STRING_DSA "DSA PRIVATE KEY"
* 4. If you include any Windows specific code (or a derivative thereof) from # define PEM_STRING_DSA_PUBLIC "DSA PUBLIC KEY"
* the apps directory (application code) you must include an acknowledgement: # define PEM_STRING_PKCS7 "PKCS7"
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" # define PEM_STRING_PKCS7_SIGNED "PKCS #7 SIGNED DATA"
* # define PEM_STRING_PKCS8 "ENCRYPTED PRIVATE KEY"
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND # define PEM_STRING_PKCS8INF "PRIVATE KEY"
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # define PEM_STRING_DHPARAMS "DH PARAMETERS"
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # define PEM_STRING_DHXPARAMS "X9.42 DH PARAMETERS"
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE # define PEM_STRING_SSL_SESSION "SSL SESSION PARAMETERS"
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL # define PEM_STRING_DSAPARAMS "DSA PARAMETERS"
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS # define PEM_STRING_ECDSA_PUBLIC "ECDSA PUBLIC KEY"
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) # define PEM_STRING_ECPARAMETERS "EC PARAMETERS"
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT # define PEM_STRING_ECPRIVATEKEY "EC PRIVATE KEY"
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY # define PEM_STRING_PARAMETERS "PARAMETERS"
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # define PEM_STRING_CMS "CMS"
* SUCH DAMAGE.
* # define PEM_TYPE_ENCRYPTED 10
* The licence and distribution terms for any publically available version or # define PEM_TYPE_MIC_ONLY 20
* derivative of this code cannot be changed. i.e. this code cannot simply be # define PEM_TYPE_MIC_CLEAR 30
* copied and put under another distribution licence # define PEM_TYPE_CLEAR 40
* [including the GNU Public Licence.]
*/ /*
* These macros make the PEM_read/PEM_write functions easier to maintain and
#ifndef HEADER_PEM_H * write. Now they are all implemented with either: IMPLEMENT_PEM_rw(...) or
# define HEADER_PEM_H * IMPLEMENT_PEM_rw_cb(...)
*/
# include <openssl/e_os2.h>
# ifndef OPENSSL_NO_BIO # ifdef OPENSSL_NO_STDIO
# include <openssl/bio.h>
# endif # define IMPLEMENT_PEM_read_fp(name, type, str, asn1) /**/
# ifndef OPENSSL_NO_STACK # define IMPLEMENT_PEM_write_fp(name, type, str, asn1) /**/
# include <openssl/stack.h> # define IMPLEMENT_PEM_write_fp_const(name, type, str, asn1) /**/
# endif # define IMPLEMENT_PEM_write_cb_fp(name, type, str, asn1) /**/
# include <openssl/evp.h> # define IMPLEMENT_PEM_write_cb_fp_const(name, type, str, asn1) /**/
# include <openssl/x509.h> # else
# include <openssl/pem2.h>
# define IMPLEMENT_PEM_read_fp(name, type, str, asn1) \
#ifdef __cplusplus type *PEM_read_##name(FILE *fp, type **x, pem_password_cb *cb, void *u)\
extern "C" { { \
#endif return PEM_ASN1_read((d2i_of_void *)d2i_##asn1, str,fp,(void **)x,cb,u); \
}
# define PEM_BUFSIZE 1024
# define IMPLEMENT_PEM_write_fp(name, type, str, asn1) \
# define PEM_OBJ_UNDEF 0 int PEM_write_##name(FILE *fp, type *x) \
# define PEM_OBJ_X509 1 { \
# define PEM_OBJ_X509_REQ 2 return PEM_ASN1_write((i2d_of_void *)i2d_##asn1,str,fp,x,NULL,NULL,0,NULL,NULL); \
# define PEM_OBJ_CRL 3 }
# define PEM_OBJ_SSL_SESSION 4
# define PEM_OBJ_PRIV_KEY 10 # define IMPLEMENT_PEM_write_fp_const(name, type, str, asn1) \
# define PEM_OBJ_PRIV_RSA 11 int PEM_write_##name(FILE *fp, const type *x) \
# define PEM_OBJ_PRIV_DSA 12 { \
# define PEM_OBJ_PRIV_DH 13 return PEM_ASN1_write((i2d_of_void *)i2d_##asn1,str,fp,(void *)x,NULL,NULL,0,NULL,NULL); \
# define PEM_OBJ_PUB_RSA 14 }
# define PEM_OBJ_PUB_DSA 15
# define PEM_OBJ_PUB_DH 16 # define IMPLEMENT_PEM_write_cb_fp(name, type, str, asn1) \
# define PEM_OBJ_DHPARAMS 17 int PEM_write_##name(FILE *fp, type *x, const EVP_CIPHER *enc, \
# define PEM_OBJ_DSAPARAMS 18 unsigned char *kstr, int klen, pem_password_cb *cb, \
# define PEM_OBJ_PRIV_RSA_PUBLIC 19 void *u) \
# define PEM_OBJ_PRIV_ECDSA 20 { \
# define PEM_OBJ_PUB_ECDSA 21 return PEM_ASN1_write((i2d_of_void *)i2d_##asn1,str,fp,x,enc,kstr,klen,cb,u); \
# define PEM_OBJ_ECPARAMETERS 22 }
# define PEM_ERROR 30 # define IMPLEMENT_PEM_write_cb_fp_const(name, type, str, asn1) \
# define PEM_DEK_DES_CBC 40 int PEM_write_##name(FILE *fp, type *x, const EVP_CIPHER *enc, \
# define PEM_DEK_IDEA_CBC 45 unsigned char *kstr, int klen, pem_password_cb *cb, \
# define PEM_DEK_DES_EDE 50 void *u) \
# define PEM_DEK_DES_ECB 60 { \
# define PEM_DEK_RSA 70 return PEM_ASN1_write((i2d_of_void *)i2d_##asn1,str,fp,x,enc,kstr,klen,cb,u); \
# define PEM_DEK_RSA_MD2 80 }
# define PEM_DEK_RSA_MD5 90
# endif
# define PEM_MD_MD2 NID_md2
# define PEM_MD_MD5 NID_md5 # define IMPLEMENT_PEM_read_bio(name, type, str, asn1) \
# define PEM_MD_SHA NID_sha type *PEM_read_bio_##name(BIO *bp, type **x, pem_password_cb *cb, void *u)\
# define PEM_MD_MD2_RSA NID_md2WithRSAEncryption { \
# define PEM_MD_MD5_RSA NID_md5WithRSAEncryption return PEM_ASN1_read_bio((d2i_of_void *)d2i_##asn1, str,bp,(void **)x,cb,u); \
# define PEM_MD_SHA_RSA NID_sha1WithRSAEncryption }
# define PEM_STRING_X509_OLD "X509 CERTIFICATE" # define IMPLEMENT_PEM_write_bio(name, type, str, asn1) \
# define PEM_STRING_X509 "CERTIFICATE" int PEM_write_bio_##name(BIO *bp, type *x) \
# define PEM_STRING_X509_PAIR "CERTIFICATE PAIR" { \
# define PEM_STRING_X509_TRUSTED "TRUSTED CERTIFICATE" return PEM_ASN1_write_bio((i2d_of_void *)i2d_##asn1,str,bp,x,NULL,NULL,0,NULL,NULL); \
# define PEM_STRING_X509_REQ_OLD "NEW CERTIFICATE REQUEST" }
# define PEM_STRING_X509_REQ "CERTIFICATE REQUEST"
# define PEM_STRING_X509_CRL "X509 CRL" # define IMPLEMENT_PEM_write_bio_const(name, type, str, asn1) \
# define PEM_STRING_EVP_PKEY "ANY PRIVATE KEY" int PEM_write_bio_##name(BIO *bp, const type *x) \
# define PEM_STRING_PUBLIC "PUBLIC KEY" { \
# define PEM_STRING_RSA "RSA PRIVATE KEY" return PEM_ASN1_write_bio((i2d_of_void *)i2d_##asn1,str,bp,(void *)x,NULL,NULL,0,NULL,NULL); \
# define PEM_STRING_RSA_PUBLIC "RSA PUBLIC KEY" }
# define PEM_STRING_DSA "DSA PRIVATE KEY"
# define PEM_STRING_DSA_PUBLIC "DSA PUBLIC KEY" # define IMPLEMENT_PEM_write_cb_bio(name, type, str, asn1) \
# define PEM_STRING_PKCS7 "PKCS7" int PEM_write_bio_##name(BIO *bp, type *x, const EVP_CIPHER *enc, \
# define PEM_STRING_PKCS7_SIGNED "PKCS #7 SIGNED DATA" unsigned char *kstr, int klen, pem_password_cb *cb, void *u) \
# define PEM_STRING_PKCS8 "ENCRYPTED PRIVATE KEY" { \
# define PEM_STRING_PKCS8INF "PRIVATE KEY" return PEM_ASN1_write_bio((i2d_of_void *)i2d_##asn1,str,bp,x,enc,kstr,klen,cb,u); \
# define PEM_STRING_DHPARAMS "DH PARAMETERS" }
# define PEM_STRING_DHXPARAMS "X9.42 DH PARAMETERS"
# define PEM_STRING_SSL_SESSION "SSL SESSION PARAMETERS" # define IMPLEMENT_PEM_write_cb_bio_const(name, type, str, asn1) \
# define PEM_STRING_DSAPARAMS "DSA PARAMETERS" int PEM_write_bio_##name(BIO *bp, type *x, const EVP_CIPHER *enc, \
# define PEM_STRING_ECDSA_PUBLIC "ECDSA PUBLIC KEY" unsigned char *kstr, int klen, pem_password_cb *cb, void *u) \
# define PEM_STRING_ECPARAMETERS "EC PARAMETERS" { \
# define PEM_STRING_ECPRIVATEKEY "EC PRIVATE KEY" return PEM_ASN1_write_bio((i2d_of_void *)i2d_##asn1,str,bp,(void *)x,enc,kstr,klen,cb,u); \
# define PEM_STRING_PARAMETERS "PARAMETERS" }
# define PEM_STRING_CMS "CMS"
# define IMPLEMENT_PEM_write(name, type, str, asn1) \
/* IMPLEMENT_PEM_write_bio(name, type, str, asn1) \
* Note that this structure is initialised by PEM_SealInit and cleaned up IMPLEMENT_PEM_write_fp(name, type, str, asn1)
* by PEM_SealFinal (at least for now)
*/ # define IMPLEMENT_PEM_write_const(name, type, str, asn1) \
typedef struct PEM_Encode_Seal_st { IMPLEMENT_PEM_write_bio_const(name, type, str, asn1) \
EVP_ENCODE_CTX encode; IMPLEMENT_PEM_write_fp_const(name, type, str, asn1)
EVP_MD_CTX md;
EVP_CIPHER_CTX cipher; # define IMPLEMENT_PEM_write_cb(name, type, str, asn1) \
} PEM_ENCODE_SEAL_CTX; IMPLEMENT_PEM_write_cb_bio(name, type, str, asn1) \
IMPLEMENT_PEM_write_cb_fp(name, type, str, asn1)
/* enc_type is one off */
# define PEM_TYPE_ENCRYPTED 10 # define IMPLEMENT_PEM_write_cb_const(name, type, str, asn1) \
# define PEM_TYPE_MIC_ONLY 20 IMPLEMENT_PEM_write_cb_bio_const(name, type, str, asn1) \
# define PEM_TYPE_MIC_CLEAR 30 IMPLEMENT_PEM_write_cb_fp_const(name, type, str, asn1)
# define PEM_TYPE_CLEAR 40
# define IMPLEMENT_PEM_read(name, type, str, asn1) \
typedef struct pem_recip_st { IMPLEMENT_PEM_read_bio(name, type, str, asn1) \
char *name; IMPLEMENT_PEM_read_fp(name, type, str, asn1)
X509_NAME *dn;
int cipher; # define IMPLEMENT_PEM_rw(name, type, str, asn1) \
int key_enc; IMPLEMENT_PEM_read(name, type, str, asn1) \
/* char iv[8]; unused and wrong size */ IMPLEMENT_PEM_write(name, type, str, asn1)
} PEM_USER;
# define IMPLEMENT_PEM_rw_const(name, type, str, asn1) \
typedef struct pem_ctx_st { IMPLEMENT_PEM_read(name, type, str, asn1) \
int type; /* what type of object */ IMPLEMENT_PEM_write_const(name, type, str, asn1)
struct {
int version; # define IMPLEMENT_PEM_rw_cb(name, type, str, asn1) \
int mode; IMPLEMENT_PEM_read(name, type, str, asn1) \
} proc_type; IMPLEMENT_PEM_write_cb(name, type, str, asn1)
char *domain; /* These are the same except they are for the declarations */
struct { # if defined(OPENSSL_NO_STDIO)
int cipher;
/*- # define DECLARE_PEM_read_fp(name, type) /**/
unused, and wrong size # define DECLARE_PEM_write_fp(name, type) /**/
unsigned char iv[8]; */ # define DECLARE_PEM_write_fp_const(name, type) /**/
} DEK_info; # define DECLARE_PEM_write_cb_fp(name, type) /**/
# else
PEM_USER *originator;
# define DECLARE_PEM_read_fp(name, type) \
int num_recipient; type *PEM_read_##name(FILE *fp, type **x, pem_password_cb *cb, void *u);
PEM_USER **recipient;
/*- # define DECLARE_PEM_write_fp(name, type) \
XXX(ben): don#t think this is used! int PEM_write_##name(FILE *fp, type *x);
STACK *x509_chain; / * certificate chain */
EVP_MD *md; /* signature type */ # define DECLARE_PEM_write_fp_const(name, type) \
int PEM_write_##name(FILE *fp, const type *x);
int md_enc; /* is the md encrypted or not? */
int md_len; /* length of md_data */ # define DECLARE_PEM_write_cb_fp(name, type) \
char *md_data; /* message digest, could be pkey encrypted */ int PEM_write_##name(FILE *fp, type *x, const EVP_CIPHER *enc, \
unsigned char *kstr, int klen, pem_password_cb *cb, void *u);
EVP_CIPHER *dec; /* date encryption cipher */
int key_len; /* key length */ # endif
unsigned char *key; /* key */
/*- # define DECLARE_PEM_read_bio(name, type) \
unused, and wrong size type *PEM_read_bio_##name(BIO *bp, type **x, pem_password_cb *cb, void *u);
unsigned char iv[8]; */
# define DECLARE_PEM_write_bio(name, type) \
int data_enc; /* is the data encrypted */ int PEM_write_bio_##name(BIO *bp, type *x);
int data_len;
unsigned char *data; # define DECLARE_PEM_write_bio_const(name, type) \
} PEM_CTX; int PEM_write_bio_##name(BIO *bp, const type *x);
/* # define DECLARE_PEM_write_cb_bio(name, type) \
* These macros make the PEM_read/PEM_write functions easier to maintain and int PEM_write_bio_##name(BIO *bp, type *x, const EVP_CIPHER *enc, \
* write. Now they are all implemented with either: IMPLEMENT_PEM_rw(...) or unsigned char *kstr, int klen, pem_password_cb *cb, void *u);
* IMPLEMENT_PEM_rw_cb(...)
*/ # define DECLARE_PEM_write(name, type) \
DECLARE_PEM_write_bio(name, type) \
# ifdef OPENSSL_NO_FP_API DECLARE_PEM_write_fp(name, type)
# define DECLARE_PEM_write_const(name, type) \
# define IMPLEMENT_PEM_read_fp(name, type, str, asn1) /**/ DECLARE_PEM_write_bio_const(name, type) \
# define IMPLEMENT_PEM_write_fp(name, type, str, asn1) /**/ DECLARE_PEM_write_fp_const(name, type)
# define IMPLEMENT_PEM_write_fp_const(name, type, str, asn1) /**/ # define DECLARE_PEM_write_cb(name, type) \
# define IMPLEMENT_PEM_write_cb_fp(name, type, str, asn1) /**/ DECLARE_PEM_write_cb_bio(name, type) \
# define IMPLEMENT_PEM_write_cb_fp_const(name, type, str, asn1) /**/ DECLARE_PEM_write_cb_fp(name, type)
# else # define DECLARE_PEM_read(name, type) \
DECLARE_PEM_read_bio(name, type) \
# define IMPLEMENT_PEM_read_fp(name, type, str, asn1) \ DECLARE_PEM_read_fp(name, type)
type *PEM_read_##name(FILE *fp, type **x, pem_password_cb *cb, void *u)\ # define DECLARE_PEM_rw(name, type) \
{ \ DECLARE_PEM_read(name, type) \
return PEM_ASN1_read((d2i_of_void *)d2i_##asn1, str,fp,(void **)x,cb,u); \ DECLARE_PEM_write(name, type)
} # define DECLARE_PEM_rw_const(name, type) \
DECLARE_PEM_read(name, type) \
# define IMPLEMENT_PEM_write_fp(name, type, str, asn1) \ DECLARE_PEM_write_const(name, type)
int PEM_write_##name(FILE *fp, type *x) \ # define DECLARE_PEM_rw_cb(name, type) \
{ \ DECLARE_PEM_read(name, type) \
return PEM_ASN1_write((i2d_of_void *)i2d_##asn1,str,fp,x,NULL,NULL,0,NULL,NULL); \ DECLARE_PEM_write_cb(name, type)
} typedef int pem_password_cb (char *buf, int size, int rwflag, void *userdata);
# define IMPLEMENT_PEM_write_fp_const(name, type, str, asn1) \ int PEM_get_EVP_CIPHER_INFO(char *header, EVP_CIPHER_INFO *cipher);
int PEM_write_##name(FILE *fp, const type *x) \ int PEM_do_header(EVP_CIPHER_INFO *cipher, unsigned char *data, long *len,
{ \ pem_password_cb *callback, void *u);
return PEM_ASN1_write((i2d_of_void *)i2d_##asn1,str,fp,(void *)x,NULL,NULL,0,NULL,NULL); \
} int PEM_read_bio(BIO *bp, char **name, char **header,
unsigned char **data, long *len);
# define IMPLEMENT_PEM_write_cb_fp(name, type, str, asn1) \ # define PEM_FLAG_SECURE 0x1
int PEM_write_##name(FILE *fp, type *x, const EVP_CIPHER *enc, \ # define PEM_FLAG_EAY_COMPATIBLE 0x2
unsigned char *kstr, int klen, pem_password_cb *cb, \ # define PEM_FLAG_ONLY_B64 0x4
void *u) \ int PEM_read_bio_ex(BIO *bp, char **name, char **header,
{ \ unsigned char **data, long *len, unsigned int flags);
return PEM_ASN1_write((i2d_of_void *)i2d_##asn1,str,fp,x,enc,kstr,klen,cb,u); \ int PEM_bytes_read_bio_secmem(unsigned char **pdata, long *plen, char **pnm,
} const char *name, BIO *bp, pem_password_cb *cb,
void *u);
# define IMPLEMENT_PEM_write_cb_fp_const(name, type, str, asn1) \ int PEM_write_bio(BIO *bp, const char *name, const char *hdr,
int PEM_write_##name(FILE *fp, type *x, const EVP_CIPHER *enc, \ const unsigned char *data, long len);
unsigned char *kstr, int klen, pem_password_cb *cb, \ int PEM_bytes_read_bio(unsigned char **pdata, long *plen, char **pnm,
void *u) \ const char *name, BIO *bp, pem_password_cb *cb,
{ \ void *u);
return PEM_ASN1_write((i2d_of_void *)i2d_##asn1,str,fp,x,enc,kstr,klen,cb,u); \ void *PEM_ASN1_read_bio(d2i_of_void *d2i, const char *name, BIO *bp, void **x,
} pem_password_cb *cb, void *u);
int PEM_ASN1_write_bio(i2d_of_void *i2d, const char *name, BIO *bp, void *x,
# endif const EVP_CIPHER *enc, unsigned char *kstr, int klen,
pem_password_cb *cb, void *u);
# define IMPLEMENT_PEM_read_bio(name, type, str, asn1) \
type *PEM_read_bio_##name(BIO *bp, type **x, pem_password_cb *cb, void *u)\ STACK_OF(X509_INFO) *PEM_X509_INFO_read_bio(BIO *bp, STACK_OF(X509_INFO) *sk,
{ \ pem_password_cb *cb, void *u);
return PEM_ASN1_read_bio((d2i_of_void *)d2i_##asn1, str,bp,(void **)x,cb,u); \ int PEM_X509_INFO_write_bio(BIO *bp, X509_INFO *xi, EVP_CIPHER *enc,
} unsigned char *kstr, int klen,
pem_password_cb *cd, void *u);
# define IMPLEMENT_PEM_write_bio(name, type, str, asn1) \
int PEM_write_bio_##name(BIO *bp, type *x) \ #ifndef OPENSSL_NO_STDIO
{ \ int PEM_read(FILE *fp, char **name, char **header,
return PEM_ASN1_write_bio((i2d_of_void *)i2d_##asn1,str,bp,x,NULL,NULL,0,NULL,NULL); \ unsigned char **data, long *len);
} int PEM_write(FILE *fp, const char *name, const char *hdr,
const unsigned char *data, long len);
# define IMPLEMENT_PEM_write_bio_const(name, type, str, asn1) \ void *PEM_ASN1_read(d2i_of_void *d2i, const char *name, FILE *fp, void **x,
int PEM_write_bio_##name(BIO *bp, const type *x) \ pem_password_cb *cb, void *u);
{ \ int PEM_ASN1_write(i2d_of_void *i2d, const char *name, FILE *fp,
return PEM_ASN1_write_bio((i2d_of_void *)i2d_##asn1,str,bp,(void *)x,NULL,NULL,0,NULL,NULL); \ void *x, const EVP_CIPHER *enc, unsigned char *kstr,
} int klen, pem_password_cb *callback, void *u);
STACK_OF(X509_INFO) *PEM_X509_INFO_read(FILE *fp, STACK_OF(X509_INFO) *sk,
# define IMPLEMENT_PEM_write_cb_bio(name, type, str, asn1) \ pem_password_cb *cb, void *u);
int PEM_write_bio_##name(BIO *bp, type *x, const EVP_CIPHER *enc, \ #endif
unsigned char *kstr, int klen, pem_password_cb *cb, void *u) \
{ \ int PEM_SignInit(EVP_MD_CTX *ctx, EVP_MD *type);
return PEM_ASN1_write_bio((i2d_of_void *)i2d_##asn1,str,bp,x,enc,kstr,klen,cb,u); \ int PEM_SignUpdate(EVP_MD_CTX *ctx, unsigned char *d, unsigned int cnt);
} int PEM_SignFinal(EVP_MD_CTX *ctx, unsigned char *sigret,
unsigned int *siglen, EVP_PKEY *pkey);
# define IMPLEMENT_PEM_write_cb_bio_const(name, type, str, asn1) \
int PEM_write_bio_##name(BIO *bp, type *x, const EVP_CIPHER *enc, \ /* The default pem_password_cb that's used internally */
unsigned char *kstr, int klen, pem_password_cb *cb, void *u) \ int PEM_def_callback(char *buf, int num, int rwflag, void *userdata);
{ \ void PEM_proc_type(char *buf, int type);
return PEM_ASN1_write_bio((i2d_of_void *)i2d_##asn1,str,bp,(void *)x,enc,kstr,klen,cb,u); \ void PEM_dek_info(char *buf, const char *type, int len, char *str);
}
# include <openssl/symhacks.h>
# define IMPLEMENT_PEM_write(name, type, str, asn1) \
IMPLEMENT_PEM_write_bio(name, type, str, asn1) \ DECLARE_PEM_rw(X509, X509)
IMPLEMENT_PEM_write_fp(name, type, str, asn1) DECLARE_PEM_rw(X509_AUX, X509)
DECLARE_PEM_rw(X509_REQ, X509_REQ)
# define IMPLEMENT_PEM_write_const(name, type, str, asn1) \ DECLARE_PEM_write(X509_REQ_NEW, X509_REQ)
IMPLEMENT_PEM_write_bio_const(name, type, str, asn1) \ DECLARE_PEM_rw(X509_CRL, X509_CRL)
IMPLEMENT_PEM_write_fp_const(name, type, str, asn1) DECLARE_PEM_rw(PKCS7, PKCS7)
DECLARE_PEM_rw(NETSCAPE_CERT_SEQUENCE, NETSCAPE_CERT_SEQUENCE)
# define IMPLEMENT_PEM_write_cb(name, type, str, asn1) \ DECLARE_PEM_rw(PKCS8, X509_SIG)
IMPLEMENT_PEM_write_cb_bio(name, type, str, asn1) \ DECLARE_PEM_rw(PKCS8_PRIV_KEY_INFO, PKCS8_PRIV_KEY_INFO)
IMPLEMENT_PEM_write_cb_fp(name, type, str, asn1) # ifndef OPENSSL_NO_RSA
DECLARE_PEM_rw_cb(RSAPrivateKey, RSA)
# define IMPLEMENT_PEM_write_cb_const(name, type, str, asn1) \ DECLARE_PEM_rw_const(RSAPublicKey, RSA)
IMPLEMENT_PEM_write_cb_bio_const(name, type, str, asn1) \ DECLARE_PEM_rw(RSA_PUBKEY, RSA)
IMPLEMENT_PEM_write_cb_fp_const(name, type, str, asn1) # endif
# ifndef OPENSSL_NO_DSA
# define IMPLEMENT_PEM_read(name, type, str, asn1) \ DECLARE_PEM_rw_cb(DSAPrivateKey, DSA)
IMPLEMENT_PEM_read_bio(name, type, str, asn1) \ DECLARE_PEM_rw(DSA_PUBKEY, DSA)
IMPLEMENT_PEM_read_fp(name, type, str, asn1) DECLARE_PEM_rw_const(DSAparams, DSA)
# endif
# define IMPLEMENT_PEM_rw(name, type, str, asn1) \ # ifndef OPENSSL_NO_EC
IMPLEMENT_PEM_read(name, type, str, asn1) \ DECLARE_PEM_rw_const(ECPKParameters, EC_GROUP)
IMPLEMENT_PEM_write(name, type, str, asn1) DECLARE_PEM_rw_cb(ECPrivateKey, EC_KEY)
DECLARE_PEM_rw(EC_PUBKEY, EC_KEY)
# define IMPLEMENT_PEM_rw_const(name, type, str, asn1) \ # endif
IMPLEMENT_PEM_read(name, type, str, asn1) \ # ifndef OPENSSL_NO_DH
IMPLEMENT_PEM_write_const(name, type, str, asn1) DECLARE_PEM_rw_const(DHparams, DH)
DECLARE_PEM_write_const(DHxparams, DH)
# define IMPLEMENT_PEM_rw_cb(name, type, str, asn1) \ # endif
IMPLEMENT_PEM_read(name, type, str, asn1) \ DECLARE_PEM_rw_cb(PrivateKey, EVP_PKEY)
IMPLEMENT_PEM_write_cb(name, type, str, asn1) DECLARE_PEM_rw(PUBKEY, EVP_PKEY)
/* These are the same except they are for the declarations */ int PEM_write_bio_PrivateKey_traditional(BIO *bp, EVP_PKEY *x,
const EVP_CIPHER *enc,
# if defined(OPENSSL_NO_FP_API) unsigned char *kstr, int klen,
pem_password_cb *cb, void *u);
# define DECLARE_PEM_read_fp(name, type) /**/
# define DECLARE_PEM_write_fp(name, type) /**/ int PEM_write_bio_PKCS8PrivateKey_nid(BIO *bp, EVP_PKEY *x, int nid,
# define DECLARE_PEM_write_cb_fp(name, type) /**/ char *kstr, int klen,
# else pem_password_cb *cb, void *u);
int PEM_write_bio_PKCS8PrivateKey(BIO *, EVP_PKEY *, const EVP_CIPHER *,
# define DECLARE_PEM_read_fp(name, type) \ char *, int, pem_password_cb *, void *);
type *PEM_read_##name(FILE *fp, type **x, pem_password_cb *cb, void *u); int i2d_PKCS8PrivateKey_bio(BIO *bp, EVP_PKEY *x, const EVP_CIPHER *enc,
char *kstr, int klen,
# define DECLARE_PEM_write_fp(name, type) \ pem_password_cb *cb, void *u);
int PEM_write_##name(FILE *fp, type *x); int i2d_PKCS8PrivateKey_nid_bio(BIO *bp, EVP_PKEY *x, int nid,
char *kstr, int klen,
# define DECLARE_PEM_write_fp_const(name, type) \ pem_password_cb *cb, void *u);
int PEM_write_##name(FILE *fp, const type *x); EVP_PKEY *d2i_PKCS8PrivateKey_bio(BIO *bp, EVP_PKEY **x, pem_password_cb *cb,
void *u);
# define DECLARE_PEM_write_cb_fp(name, type) \
int PEM_write_##name(FILE *fp, type *x, const EVP_CIPHER *enc, \ # ifndef OPENSSL_NO_STDIO
unsigned char *kstr, int klen, pem_password_cb *cb, void *u); int i2d_PKCS8PrivateKey_fp(FILE *fp, EVP_PKEY *x, const EVP_CIPHER *enc,
char *kstr, int klen,
# endif pem_password_cb *cb, void *u);
int i2d_PKCS8PrivateKey_nid_fp(FILE *fp, EVP_PKEY *x, int nid,
# ifndef OPENSSL_NO_BIO char *kstr, int klen,
# define DECLARE_PEM_read_bio(name, type) \ pem_password_cb *cb, void *u);
type *PEM_read_bio_##name(BIO *bp, type **x, pem_password_cb *cb, void *u); int PEM_write_PKCS8PrivateKey_nid(FILE *fp, EVP_PKEY *x, int nid,
char *kstr, int klen,
# define DECLARE_PEM_write_bio(name, type) \ pem_password_cb *cb, void *u);
int PEM_write_bio_##name(BIO *bp, type *x);
EVP_PKEY *d2i_PKCS8PrivateKey_fp(FILE *fp, EVP_PKEY **x, pem_password_cb *cb,
# define DECLARE_PEM_write_bio_const(name, type) \ void *u);
int PEM_write_bio_##name(BIO *bp, const type *x);
int PEM_write_PKCS8PrivateKey(FILE *fp, EVP_PKEY *x, const EVP_CIPHER *enc,
# define DECLARE_PEM_write_cb_bio(name, type) \ char *kstr, int klen, pem_password_cb *cd,
int PEM_write_bio_##name(BIO *bp, type *x, const EVP_CIPHER *enc, \ void *u);
unsigned char *kstr, int klen, pem_password_cb *cb, void *u); # endif
EVP_PKEY *PEM_read_bio_Parameters(BIO *bp, EVP_PKEY **x);
# else int PEM_write_bio_Parameters(BIO *bp, EVP_PKEY *x);
# define DECLARE_PEM_read_bio(name, type) /**/ # ifndef OPENSSL_NO_DSA
# define DECLARE_PEM_write_bio(name, type) /**/ EVP_PKEY *b2i_PrivateKey(const unsigned char **in, long length);
# define DECLARE_PEM_write_bio_const(name, type) /**/ EVP_PKEY *b2i_PublicKey(const unsigned char **in, long length);
# define DECLARE_PEM_write_cb_bio(name, type) /**/ EVP_PKEY *b2i_PrivateKey_bio(BIO *in);
# endif EVP_PKEY *b2i_PublicKey_bio(BIO *in);
# define DECLARE_PEM_write(name, type) \ int i2b_PrivateKey_bio(BIO *out, EVP_PKEY *pk);
DECLARE_PEM_write_bio(name, type) \ int i2b_PublicKey_bio(BIO *out, EVP_PKEY *pk);
DECLARE_PEM_write_fp(name, type) # ifndef OPENSSL_NO_RC4
# define DECLARE_PEM_write_const(name, type) \ EVP_PKEY *b2i_PVK_bio(BIO *in, pem_password_cb *cb, void *u);
DECLARE_PEM_write_bio_const(name, type) \ int i2b_PVK_bio(BIO *out, EVP_PKEY *pk, int enclevel,
DECLARE_PEM_write_fp_const(name, type) pem_password_cb *cb, void *u);
# define DECLARE_PEM_write_cb(name, type) \ # endif
DECLARE_PEM_write_cb_bio(name, type) \ # endif
DECLARE_PEM_write_cb_fp(name, type)
# define DECLARE_PEM_read(name, type) \ # ifdef __cplusplus
DECLARE_PEM_read_bio(name, type) \ }
DECLARE_PEM_read_fp(name, type) # endif
# define DECLARE_PEM_rw(name, type) \ #endif
DECLARE_PEM_read(name, type) \
DECLARE_PEM_write(name, type)
# define DECLARE_PEM_rw_const(name, type) \
DECLARE_PEM_read(name, type) \
DECLARE_PEM_write_const(name, type)
# define DECLARE_PEM_rw_cb(name, type) \
DECLARE_PEM_read(name, type) \
DECLARE_PEM_write_cb(name, type)
# if 1
/* "userdata": new with OpenSSL 0.9.4 */
typedef int pem_password_cb (char *buf, int size, int rwflag, void *userdata);
# else
/* OpenSSL 0.9.3, 0.9.3a */
typedef int pem_password_cb (char *buf, int size, int rwflag);
# endif
int PEM_get_EVP_CIPHER_INFO(char *header, EVP_CIPHER_INFO *cipher);
int PEM_do_header(EVP_CIPHER_INFO *cipher, unsigned char *data, long *len,
pem_password_cb *callback, void *u);
# ifndef OPENSSL_NO_BIO
int PEM_read_bio(BIO *bp, char **name, char **header,
unsigned char **data, long *len);
int PEM_write_bio(BIO *bp, const char *name, const char *hdr,
const unsigned char *data, long len);
int PEM_bytes_read_bio(unsigned char **pdata, long *plen, char **pnm,
const char *name, BIO *bp, pem_password_cb *cb,
void *u);
void *PEM_ASN1_read_bio(d2i_of_void *d2i, const char *name, BIO *bp, void **x,
pem_password_cb *cb, void *u);
int PEM_ASN1_write_bio(i2d_of_void *i2d, const char *name, BIO *bp, void *x,
const EVP_CIPHER *enc, unsigned char *kstr, int klen,
pem_password_cb *cb, void *u);
STACK_OF(X509_INFO) *PEM_X509_INFO_read_bio(BIO *bp, STACK_OF(X509_INFO) *sk,
pem_password_cb *cb, void *u);
int PEM_X509_INFO_write_bio(BIO *bp, X509_INFO *xi, EVP_CIPHER *enc,
unsigned char *kstr, int klen,
pem_password_cb *cd, void *u);
# endif
int PEM_read(FILE *fp, char **name, char **header,
unsigned char **data, long *len);
int PEM_write(FILE *fp, const char *name, const char *hdr,
const unsigned char *data, long len);
void *PEM_ASN1_read(d2i_of_void *d2i, const char *name, FILE *fp, void **x,
pem_password_cb *cb, void *u);
int PEM_ASN1_write(i2d_of_void *i2d, const char *name, FILE *fp,
void *x, const EVP_CIPHER *enc, unsigned char *kstr,
int klen, pem_password_cb *callback, void *u);
STACK_OF(X509_INFO) *PEM_X509_INFO_read(FILE *fp, STACK_OF(X509_INFO) *sk,
pem_password_cb *cb, void *u);
int PEM_SealInit(PEM_ENCODE_SEAL_CTX *ctx, EVP_CIPHER *type,
EVP_MD *md_type, unsigned char **ek, int *ekl,
unsigned char *iv, EVP_PKEY **pubk, int npubk);
void PEM_SealUpdate(PEM_ENCODE_SEAL_CTX *ctx, unsigned char *out, int *outl,
unsigned char *in, int inl);
int PEM_SealFinal(PEM_ENCODE_SEAL_CTX *ctx, unsigned char *sig, int *sigl,
unsigned char *out, int *outl, EVP_PKEY *priv);
void PEM_SignInit(EVP_MD_CTX *ctx, EVP_MD *type);
void PEM_SignUpdate(EVP_MD_CTX *ctx, unsigned char *d, unsigned int cnt);
int PEM_SignFinal(EVP_MD_CTX *ctx, unsigned char *sigret,
unsigned int *siglen, EVP_PKEY *pkey);
int PEM_def_callback(char *buf, int num, int w, void *key);
void PEM_proc_type(char *buf, int type);
void PEM_dek_info(char *buf, const char *type, int len, char *str);
# include <openssl/symhacks.h>
DECLARE_PEM_rw(X509, X509)
DECLARE_PEM_rw(X509_AUX, X509)
DECLARE_PEM_rw(X509_CERT_PAIR, X509_CERT_PAIR)
DECLARE_PEM_rw(X509_REQ, X509_REQ)
DECLARE_PEM_write(X509_REQ_NEW, X509_REQ)
DECLARE_PEM_rw(X509_CRL, X509_CRL)
DECLARE_PEM_rw(PKCS7, PKCS7)
DECLARE_PEM_rw(NETSCAPE_CERT_SEQUENCE, NETSCAPE_CERT_SEQUENCE)
DECLARE_PEM_rw(PKCS8, X509_SIG)
DECLARE_PEM_rw(PKCS8_PRIV_KEY_INFO, PKCS8_PRIV_KEY_INFO)
# ifndef OPENSSL_NO_RSA
DECLARE_PEM_rw_cb(RSAPrivateKey, RSA)
DECLARE_PEM_rw_const(RSAPublicKey, RSA)
DECLARE_PEM_rw(RSA_PUBKEY, RSA)
# endif
# ifndef OPENSSL_NO_DSA
DECLARE_PEM_rw_cb(DSAPrivateKey, DSA)
DECLARE_PEM_rw(DSA_PUBKEY, DSA)
DECLARE_PEM_rw_const(DSAparams, DSA)
# endif
# ifndef OPENSSL_NO_EC
DECLARE_PEM_rw_const(ECPKParameters, EC_GROUP)
DECLARE_PEM_rw_cb(ECPrivateKey, EC_KEY)
DECLARE_PEM_rw(EC_PUBKEY, EC_KEY)
# endif
# ifndef OPENSSL_NO_DH
DECLARE_PEM_rw_const(DHparams, DH)
DECLARE_PEM_write_const(DHxparams, DH)
# endif
DECLARE_PEM_rw_cb(PrivateKey, EVP_PKEY)
DECLARE_PEM_rw(PUBKEY, EVP_PKEY)
int PEM_write_bio_PKCS8PrivateKey_nid(BIO *bp, EVP_PKEY *x, int nid,
char *kstr, int klen,
pem_password_cb *cb, void *u);
int PEM_write_bio_PKCS8PrivateKey(BIO *, EVP_PKEY *, const EVP_CIPHER *,
char *, int, pem_password_cb *, void *);
int i2d_PKCS8PrivateKey_bio(BIO *bp, EVP_PKEY *x, const EVP_CIPHER *enc,
char *kstr, int klen,
pem_password_cb *cb, void *u);
int i2d_PKCS8PrivateKey_nid_bio(BIO *bp, EVP_PKEY *x, int nid,
char *kstr, int klen,
pem_password_cb *cb, void *u);
EVP_PKEY *d2i_PKCS8PrivateKey_bio(BIO *bp, EVP_PKEY **x, pem_password_cb *cb,
void *u);
int i2d_PKCS8PrivateKey_fp(FILE *fp, EVP_PKEY *x, const EVP_CIPHER *enc,
char *kstr, int klen,
pem_password_cb *cb, void *u);
int i2d_PKCS8PrivateKey_nid_fp(FILE *fp, EVP_PKEY *x, int nid,
char *kstr, int klen,
pem_password_cb *cb, void *u);
int PEM_write_PKCS8PrivateKey_nid(FILE *fp, EVP_PKEY *x, int nid,
char *kstr, int klen,
pem_password_cb *cb, void *u);
EVP_PKEY *d2i_PKCS8PrivateKey_fp(FILE *fp, EVP_PKEY **x, pem_password_cb *cb,
void *u);
int PEM_write_PKCS8PrivateKey(FILE *fp, EVP_PKEY *x, const EVP_CIPHER *enc,
char *kstr, int klen, pem_password_cb *cd,
void *u);
EVP_PKEY *PEM_read_bio_Parameters(BIO *bp, EVP_PKEY **x);
int PEM_write_bio_Parameters(BIO *bp, EVP_PKEY *x);
EVP_PKEY *b2i_PrivateKey(const unsigned char **in, long length);
EVP_PKEY *b2i_PublicKey(const unsigned char **in, long length);
EVP_PKEY *b2i_PrivateKey_bio(BIO *in);
EVP_PKEY *b2i_PublicKey_bio(BIO *in);
int i2b_PrivateKey_bio(BIO *out, EVP_PKEY *pk);
int i2b_PublicKey_bio(BIO *out, EVP_PKEY *pk);
# ifndef OPENSSL_NO_RC4
EVP_PKEY *b2i_PVK_bio(BIO *in, pem_password_cb *cb, void *u);
int i2b_PVK_bio(BIO *out, EVP_PKEY *pk, int enclevel,
pem_password_cb *cb, void *u);
# 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_PEM_strings(void);
/* Error codes for the PEM functions. */
/* Function codes. */
# define PEM_F_B2I_DSS 127
# define PEM_F_B2I_PVK_BIO 128
# define PEM_F_B2I_RSA 129
# define PEM_F_CHECK_BITLEN_DSA 130
# define PEM_F_CHECK_BITLEN_RSA 131
# define PEM_F_D2I_PKCS8PRIVATEKEY_BIO 120
# define PEM_F_D2I_PKCS8PRIVATEKEY_FP 121
# define PEM_F_DO_B2I 132
# define PEM_F_DO_B2I_BIO 133
# define PEM_F_DO_BLOB_HEADER 134
# define PEM_F_DO_PK8PKEY 126
# define PEM_F_DO_PK8PKEY_FP 125
# define PEM_F_DO_PVK_BODY 135
# define PEM_F_DO_PVK_HEADER 136
# define PEM_F_I2B_PVK 137
# define PEM_F_I2B_PVK_BIO 138
# define PEM_F_LOAD_IV 101
# define PEM_F_PEM_ASN1_READ 102
# define PEM_F_PEM_ASN1_READ_BIO 103
# define PEM_F_PEM_ASN1_WRITE 104
# define PEM_F_PEM_ASN1_WRITE_BIO 105
# define PEM_F_PEM_DEF_CALLBACK 100
# define PEM_F_PEM_DO_HEADER 106
# define PEM_F_PEM_F_PEM_WRITE_PKCS8PRIVATEKEY 118
# define PEM_F_PEM_GET_EVP_CIPHER_INFO 107
# define PEM_F_PEM_PK8PKEY 119
# define PEM_F_PEM_READ 108
# define PEM_F_PEM_READ_BIO 109
# define PEM_F_PEM_READ_BIO_DHPARAMS 141
# define PEM_F_PEM_READ_BIO_PARAMETERS 140
# define PEM_F_PEM_READ_BIO_PRIVATEKEY 123
# define PEM_F_PEM_READ_DHPARAMS 142
# define PEM_F_PEM_READ_PRIVATEKEY 124
# define PEM_F_PEM_SEALFINAL 110
# define PEM_F_PEM_SEALINIT 111
# define PEM_F_PEM_SIGNFINAL 112
# define PEM_F_PEM_WRITE 113
# define PEM_F_PEM_WRITE_BIO 114
# define PEM_F_PEM_WRITE_PRIVATEKEY 139
# define PEM_F_PEM_X509_INFO_READ 115
# define PEM_F_PEM_X509_INFO_READ_BIO 116
# define PEM_F_PEM_X509_INFO_WRITE_BIO 117
/* Reason codes. */
# define PEM_R_BAD_BASE64_DECODE 100
# define PEM_R_BAD_DECRYPT 101
# define PEM_R_BAD_END_LINE 102
# define PEM_R_BAD_IV_CHARS 103
# define PEM_R_BAD_MAGIC_NUMBER 116
# define PEM_R_BAD_PASSWORD_READ 104
# define PEM_R_BAD_VERSION_NUMBER 117
# define PEM_R_BIO_WRITE_FAILURE 118
# define PEM_R_CIPHER_IS_NULL 127
# define PEM_R_ERROR_CONVERTING_PRIVATE_KEY 115
# define PEM_R_EXPECTING_PRIVATE_KEY_BLOB 119
# define PEM_R_EXPECTING_PUBLIC_KEY_BLOB 120
# define PEM_R_HEADER_TOO_LONG 128
# define PEM_R_INCONSISTENT_HEADER 121
# define PEM_R_KEYBLOB_HEADER_PARSE_ERROR 122
# define PEM_R_KEYBLOB_TOO_SHORT 123
# define PEM_R_NOT_DEK_INFO 105
# define PEM_R_NOT_ENCRYPTED 106
# define PEM_R_NOT_PROC_TYPE 107
# define PEM_R_NO_START_LINE 108
# define PEM_R_PROBLEMS_GETTING_PASSWORD 109
# define PEM_R_PUBLIC_KEY_NO_RSA 110
# define PEM_R_PVK_DATA_TOO_SHORT 124
# define PEM_R_PVK_TOO_SHORT 125
# define PEM_R_READ_KEY 111
# define PEM_R_SHORT_HEADER 112
# define PEM_R_UNSUPPORTED_CIPHER 113
# define PEM_R_UNSUPPORTED_ENCRYPTION 114
# define PEM_R_UNSUPPORTED_KEY_COMPONENTS 126
# ifdef __cplusplus
}
# endif
#endif

View File

@ -1,70 +1,13 @@
/* ==================================================================== /*
* Copyright (c) 1999 The OpenSSL Project. All rights reserved. * Copyright 1999-2018 The OpenSSL Project Authors. All Rights Reserved.
* *
* Redistribution and use in source and binary forms, with or without * Licensed under the OpenSSL license (the "License"). You may not use
* modification, are permitted provided that the following conditions * this file except in compliance with the License. You can obtain a copy
* are met: * in the file LICENSE in the source distribution or at
* * https://www.openssl.org/source/license.html
* 1. Redistributions of source code must retain the above copyright */
* notice, this list of conditions and the following disclaimer.
* #ifndef HEADER_PEM2_H
* 2. Redistributions in binary form must reproduce the above copyright # define HEADER_PEM2_H
* notice, this list of conditions and the following disclaimer in # include <openssl/pemerr.h>
* the documentation and/or other materials provided with the #endif
* 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.
* ====================================================================
*
* This product includes cryptographic software written by Eric Young
* (eay@cryptsoft.com). This product includes software written by Tim
* Hudson (tjh@cryptsoft.com).
*
*/
/*
* This header only exists to break a circular dependency between pem and err
* Ben 30 Jan 1999.
*/
#ifdef __cplusplus
extern "C" {
#endif
#ifndef HEADER_PEM_H
void ERR_load_PEM_strings(void);
#endif
#ifdef __cplusplus
}
#endif

View File

@ -0,0 +1,99 @@
/*
* Generated by util/mkerr.pl DO NOT EDIT
* Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/license.html
*/
#ifndef HEADER_PEMERR_H
# define HEADER_PEMERR_H
# ifdef __cplusplus
extern "C"
# endif
int ERR_load_PEM_strings(void);
/*
* PEM function codes.
*/
# define PEM_F_B2I_DSS 127
# define PEM_F_B2I_PVK_BIO 128
# define PEM_F_B2I_RSA 129
# define PEM_F_CHECK_BITLEN_DSA 130
# define PEM_F_CHECK_BITLEN_RSA 131
# define PEM_F_D2I_PKCS8PRIVATEKEY_BIO 120
# define PEM_F_D2I_PKCS8PRIVATEKEY_FP 121
# define PEM_F_DO_B2I 132
# define PEM_F_DO_B2I_BIO 133
# define PEM_F_DO_BLOB_HEADER 134
# define PEM_F_DO_I2B 146
# define PEM_F_DO_PK8PKEY 126
# define PEM_F_DO_PK8PKEY_FP 125
# define PEM_F_DO_PVK_BODY 135
# define PEM_F_DO_PVK_HEADER 136
# define PEM_F_GET_HEADER_AND_DATA 143
# define PEM_F_GET_NAME 144
# define PEM_F_I2B_PVK 137
# define PEM_F_I2B_PVK_BIO 138
# define PEM_F_LOAD_IV 101
# define PEM_F_PEM_ASN1_READ 102
# define PEM_F_PEM_ASN1_READ_BIO 103
# define PEM_F_PEM_ASN1_WRITE 104
# define PEM_F_PEM_ASN1_WRITE_BIO 105
# define PEM_F_PEM_DEF_CALLBACK 100
# define PEM_F_PEM_DO_HEADER 106
# define PEM_F_PEM_GET_EVP_CIPHER_INFO 107
# define PEM_F_PEM_READ 108
# define PEM_F_PEM_READ_BIO 109
# define PEM_F_PEM_READ_BIO_DHPARAMS 141
# define PEM_F_PEM_READ_BIO_EX 145
# define PEM_F_PEM_READ_BIO_PARAMETERS 140
# define PEM_F_PEM_READ_BIO_PRIVATEKEY 123
# define PEM_F_PEM_READ_DHPARAMS 142
# define PEM_F_PEM_READ_PRIVATEKEY 124
# define PEM_F_PEM_SIGNFINAL 112
# define PEM_F_PEM_WRITE 113
# define PEM_F_PEM_WRITE_BIO 114
# define PEM_F_PEM_WRITE_PRIVATEKEY 139
# define PEM_F_PEM_X509_INFO_READ 115
# define PEM_F_PEM_X509_INFO_READ_BIO 116
# define PEM_F_PEM_X509_INFO_WRITE_BIO 117
/*
* PEM reason codes.
*/
# define PEM_R_BAD_BASE64_DECODE 100
# define PEM_R_BAD_DECRYPT 101
# define PEM_R_BAD_END_LINE 102
# define PEM_R_BAD_IV_CHARS 103
# define PEM_R_BAD_MAGIC_NUMBER 116
# define PEM_R_BAD_PASSWORD_READ 104
# define PEM_R_BAD_VERSION_NUMBER 117
# define PEM_R_BIO_WRITE_FAILURE 118
# define PEM_R_CIPHER_IS_NULL 127
# define PEM_R_ERROR_CONVERTING_PRIVATE_KEY 115
# define PEM_R_EXPECTING_PRIVATE_KEY_BLOB 119
# define PEM_R_EXPECTING_PUBLIC_KEY_BLOB 120
# define PEM_R_HEADER_TOO_LONG 128
# define PEM_R_INCONSISTENT_HEADER 121
# define PEM_R_KEYBLOB_HEADER_PARSE_ERROR 122
# define PEM_R_KEYBLOB_TOO_SHORT 123
# define PEM_R_MISSING_DEK_IV 129
# define PEM_R_NOT_DEK_INFO 105
# define PEM_R_NOT_ENCRYPTED 106
# define PEM_R_NOT_PROC_TYPE 107
# define PEM_R_NO_START_LINE 108
# define PEM_R_PROBLEMS_GETTING_PASSWORD 109
# define PEM_R_PVK_DATA_TOO_SHORT 124
# define PEM_R_PVK_TOO_SHORT 125
# define PEM_R_READ_KEY 111
# define PEM_R_SHORT_HEADER 112
# define PEM_R_UNEXPECTED_DEK_IV 130
# define PEM_R_UNSUPPORTED_CIPHER 113
# define PEM_R_UNSUPPORTED_ENCRYPTION 114
# define PEM_R_UNSUPPORTED_KEY_COMPONENTS 126
#endif

View File

@ -1,342 +1,223 @@
/* pkcs12.h */ /*
/* * Copyright 1999-2016 The OpenSSL Project Authors. All Rights Reserved.
* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL project *
* 1999. * Licensed under the OpenSSL license (the "License"). You may not use
*/ * this file except in compliance with the License. You can obtain a copy
/* ==================================================================== * in the file LICENSE in the source distribution or at
* Copyright (c) 1999 The OpenSSL Project. All rights reserved. * https://www.openssl.org/source/license.html
* */
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions #ifndef HEADER_PKCS12_H
* are met: # define HEADER_PKCS12_H
*
* 1. Redistributions of source code must retain the above copyright # include <openssl/bio.h>
* notice, this list of conditions and the following disclaimer. # include <openssl/x509.h>
* # include <openssl/pkcs12err.h>
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in #ifdef __cplusplus
* the documentation and/or other materials provided with the extern "C" {
* distribution. #endif
*
* 3. All advertising materials mentioning features or use of this # define PKCS12_KEY_ID 1
* software must display the following acknowledgment: # define PKCS12_IV_ID 2
* "This product includes software developed by the OpenSSL Project # define PKCS12_MAC_ID 3
* for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
* /* Default iteration count */
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to # ifndef PKCS12_DEFAULT_ITER
* endorse or promote products derived from this software without # define PKCS12_DEFAULT_ITER PKCS5_DEFAULT_ITER
* prior written permission. For written permission, please contact # endif
* licensing@OpenSSL.org.
* # define PKCS12_MAC_KEY_LENGTH 20
* 5. Products derived from this software may not be called "OpenSSL"
* nor may "OpenSSL" appear in their names without prior written # define PKCS12_SALT_LEN 8
* permission of the OpenSSL Project.
* /* It's not clear if these are actually needed... */
* 6. Redistributions of any form whatsoever must retain the following # define PKCS12_key_gen PKCS12_key_gen_utf8
* acknowledgment: # define PKCS12_add_friendlyname PKCS12_add_friendlyname_utf8
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" /* MS key usage constants */
*
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY # define KEY_EX 0x10
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # define KEY_SIG 0x80
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR typedef struct PKCS12_MAC_DATA_st PKCS12_MAC_DATA;
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT typedef struct PKCS12_st PKCS12;
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) typedef struct PKCS12_SAFEBAG_st PKCS12_SAFEBAG;
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) DEFINE_STACK_OF(PKCS12_SAFEBAG)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE. typedef struct pkcs12_bag_st PKCS12_BAGS;
* ====================================================================
* # define PKCS12_ERROR 0
* This product includes cryptographic software written by Eric Young # define PKCS12_OK 1
* (eay@cryptsoft.com). This product includes software written by Tim
* Hudson (tjh@cryptsoft.com). /* Compatibility macros */
*
*/ #if OPENSSL_API_COMPAT < 0x10100000L
#ifndef HEADER_PKCS12_H # define M_PKCS12_bag_type PKCS12_bag_type
# define HEADER_PKCS12_H # define M_PKCS12_cert_bag_type PKCS12_cert_bag_type
# define M_PKCS12_crl_bag_type PKCS12_cert_bag_type
# include <openssl/bio.h>
# include <openssl/x509.h> # define PKCS12_certbag2x509 PKCS12_SAFEBAG_get1_cert
# define PKCS12_certbag2scrl PKCS12_SAFEBAG_get1_crl
#ifdef __cplusplus # define PKCS12_bag_type PKCS12_SAFEBAG_get_nid
extern "C" { # define PKCS12_cert_bag_type PKCS12_SAFEBAG_get_bag_nid
#endif # define PKCS12_x5092certbag PKCS12_SAFEBAG_create_cert
# define PKCS12_x509crl2certbag PKCS12_SAFEBAG_create_crl
# define PKCS12_KEY_ID 1 # define PKCS12_MAKE_KEYBAG PKCS12_SAFEBAG_create0_p8inf
# define PKCS12_IV_ID 2 # define PKCS12_MAKE_SHKEYBAG PKCS12_SAFEBAG_create_pkcs8_encrypt
# define PKCS12_MAC_ID 3
#endif
/* Default iteration count */
# ifndef PKCS12_DEFAULT_ITER DEPRECATEDIN_1_1_0(ASN1_TYPE *PKCS12_get_attr(const PKCS12_SAFEBAG *bag, int attr_nid))
# define PKCS12_DEFAULT_ITER PKCS5_DEFAULT_ITER
# endif ASN1_TYPE *PKCS8_get_attr(PKCS8_PRIV_KEY_INFO *p8, int attr_nid);
int PKCS12_mac_present(const PKCS12 *p12);
# define PKCS12_MAC_KEY_LENGTH 20 void PKCS12_get0_mac(const ASN1_OCTET_STRING **pmac,
const X509_ALGOR **pmacalg,
# define PKCS12_SALT_LEN 8 const ASN1_OCTET_STRING **psalt,
const ASN1_INTEGER **piter,
/* Uncomment out next line for unicode password and names, otherwise ASCII */ const PKCS12 *p12);
/* const ASN1_TYPE *PKCS12_SAFEBAG_get0_attr(const PKCS12_SAFEBAG *bag,
* #define PBE_UNICODE int attr_nid);
*/ const ASN1_OBJECT *PKCS12_SAFEBAG_get0_type(const PKCS12_SAFEBAG *bag);
int PKCS12_SAFEBAG_get_nid(const PKCS12_SAFEBAG *bag);
# ifdef PBE_UNICODE int PKCS12_SAFEBAG_get_bag_nid(const PKCS12_SAFEBAG *bag);
# define PKCS12_key_gen PKCS12_key_gen_uni
# define PKCS12_add_friendlyname PKCS12_add_friendlyname_uni X509 *PKCS12_SAFEBAG_get1_cert(const PKCS12_SAFEBAG *bag);
# else X509_CRL *PKCS12_SAFEBAG_get1_crl(const PKCS12_SAFEBAG *bag);
# define PKCS12_key_gen PKCS12_key_gen_asc const STACK_OF(PKCS12_SAFEBAG) *
# define PKCS12_add_friendlyname PKCS12_add_friendlyname_asc PKCS12_SAFEBAG_get0_safes(const PKCS12_SAFEBAG *bag);
# endif const PKCS8_PRIV_KEY_INFO *PKCS12_SAFEBAG_get0_p8inf(const PKCS12_SAFEBAG *bag);
const X509_SIG *PKCS12_SAFEBAG_get0_pkcs8(const PKCS12_SAFEBAG *bag);
/* MS key usage constants */
PKCS12_SAFEBAG *PKCS12_SAFEBAG_create_cert(X509 *x509);
# define KEY_EX 0x10 PKCS12_SAFEBAG *PKCS12_SAFEBAG_create_crl(X509_CRL *crl);
# define KEY_SIG 0x80 PKCS12_SAFEBAG *PKCS12_SAFEBAG_create0_p8inf(PKCS8_PRIV_KEY_INFO *p8);
PKCS12_SAFEBAG *PKCS12_SAFEBAG_create0_pkcs8(X509_SIG *p8);
typedef struct { PKCS12_SAFEBAG *PKCS12_SAFEBAG_create_pkcs8_encrypt(int pbe_nid,
X509_SIG *dinfo; const char *pass,
ASN1_OCTET_STRING *salt; int passlen,
ASN1_INTEGER *iter; /* defaults to 1 */ unsigned char *salt,
} PKCS12_MAC_DATA; int saltlen, int iter,
PKCS8_PRIV_KEY_INFO *p8inf);
typedef struct {
ASN1_INTEGER *version; PKCS12_SAFEBAG *PKCS12_item_pack_safebag(void *obj, const ASN1_ITEM *it,
PKCS12_MAC_DATA *mac; int nid1, int nid2);
PKCS7 *authsafes; PKCS8_PRIV_KEY_INFO *PKCS8_decrypt(const X509_SIG *p8, const char *pass,
} PKCS12; int passlen);
PKCS8_PRIV_KEY_INFO *PKCS12_decrypt_skey(const PKCS12_SAFEBAG *bag,
typedef struct { const char *pass, int passlen);
ASN1_OBJECT *type; X509_SIG *PKCS8_encrypt(int pbe_nid, const EVP_CIPHER *cipher,
union { const char *pass, int passlen, unsigned char *salt,
struct pkcs12_bag_st *bag; /* secret, crl and certbag */ int saltlen, int iter, PKCS8_PRIV_KEY_INFO *p8);
struct pkcs8_priv_key_info_st *keybag; /* keybag */ X509_SIG *PKCS8_set0_pbe(const char *pass, int passlen,
X509_SIG *shkeybag; /* shrouded key bag */ PKCS8_PRIV_KEY_INFO *p8inf, X509_ALGOR *pbe);
STACK_OF(PKCS12_SAFEBAG) *safes; PKCS7 *PKCS12_pack_p7data(STACK_OF(PKCS12_SAFEBAG) *sk);
ASN1_TYPE *other; STACK_OF(PKCS12_SAFEBAG) *PKCS12_unpack_p7data(PKCS7 *p7);
} value; PKCS7 *PKCS12_pack_p7encdata(int pbe_nid, const char *pass, int passlen,
STACK_OF(X509_ATTRIBUTE) *attrib; unsigned char *salt, int saltlen, int iter,
} PKCS12_SAFEBAG; STACK_OF(PKCS12_SAFEBAG) *bags);
STACK_OF(PKCS12_SAFEBAG) *PKCS12_unpack_p7encdata(PKCS7 *p7, const char *pass,
DECLARE_STACK_OF(PKCS12_SAFEBAG) int passlen);
DECLARE_ASN1_SET_OF(PKCS12_SAFEBAG)
DECLARE_PKCS12_STACK_OF(PKCS12_SAFEBAG) int PKCS12_pack_authsafes(PKCS12 *p12, STACK_OF(PKCS7) *safes);
STACK_OF(PKCS7) *PKCS12_unpack_authsafes(const PKCS12 *p12);
typedef struct pkcs12_bag_st {
ASN1_OBJECT *type; int PKCS12_add_localkeyid(PKCS12_SAFEBAG *bag, unsigned char *name,
union { int namelen);
ASN1_OCTET_STRING *x509cert; int PKCS12_add_friendlyname_asc(PKCS12_SAFEBAG *bag, const char *name,
ASN1_OCTET_STRING *x509crl; int namelen);
ASN1_OCTET_STRING *octet; int PKCS12_add_friendlyname_utf8(PKCS12_SAFEBAG *bag, const char *name,
ASN1_IA5STRING *sdsicert; int namelen);
ASN1_TYPE *other; /* Secret or other bag */ int PKCS12_add_CSPName_asc(PKCS12_SAFEBAG *bag, const char *name,
} value; int namelen);
} PKCS12_BAGS; int PKCS12_add_friendlyname_uni(PKCS12_SAFEBAG *bag,
const unsigned char *name, int namelen);
# define PKCS12_ERROR 0 int PKCS8_add_keyusage(PKCS8_PRIV_KEY_INFO *p8, int usage);
# define PKCS12_OK 1 ASN1_TYPE *PKCS12_get_attr_gen(const STACK_OF(X509_ATTRIBUTE) *attrs,
int attr_nid);
/* Compatibility macros */ char *PKCS12_get_friendlyname(PKCS12_SAFEBAG *bag);
const STACK_OF(X509_ATTRIBUTE) *
# define M_PKCS12_x5092certbag PKCS12_x5092certbag PKCS12_SAFEBAG_get0_attrs(const PKCS12_SAFEBAG *bag);
# define M_PKCS12_x509crl2certbag PKCS12_x509crl2certbag unsigned char *PKCS12_pbe_crypt(const X509_ALGOR *algor,
const char *pass, int passlen,
# define M_PKCS12_certbag2x509 PKCS12_certbag2x509 const unsigned char *in, int inlen,
# define M_PKCS12_certbag2x509crl PKCS12_certbag2x509crl unsigned char **data, int *datalen,
int en_de);
# define M_PKCS12_unpack_p7data PKCS12_unpack_p7data void *PKCS12_item_decrypt_d2i(const X509_ALGOR *algor, const ASN1_ITEM *it,
# define M_PKCS12_pack_authsafes PKCS12_pack_authsafes const char *pass, int passlen,
# define M_PKCS12_unpack_authsafes PKCS12_unpack_authsafes const ASN1_OCTET_STRING *oct, int zbuf);
# define M_PKCS12_unpack_p7encdata PKCS12_unpack_p7encdata ASN1_OCTET_STRING *PKCS12_item_i2d_encrypt(X509_ALGOR *algor,
const ASN1_ITEM *it,
# define M_PKCS12_decrypt_skey PKCS12_decrypt_skey const char *pass, int passlen,
# define M_PKCS8_decrypt PKCS8_decrypt void *obj, int zbuf);
PKCS12 *PKCS12_init(int mode);
# define M_PKCS12_bag_type(bg) OBJ_obj2nid((bg)->type) int PKCS12_key_gen_asc(const char *pass, int passlen, unsigned char *salt,
# define M_PKCS12_cert_bag_type(bg) OBJ_obj2nid((bg)->value.bag->type) int saltlen, int id, int iter, int n,
# define M_PKCS12_crl_bag_type M_PKCS12_cert_bag_type unsigned char *out, const EVP_MD *md_type);
int PKCS12_key_gen_uni(unsigned char *pass, int passlen, unsigned char *salt,
# define PKCS12_get_attr(bag, attr_nid) \ int saltlen, int id, int iter, int n,
PKCS12_get_attr_gen(bag->attrib, attr_nid) unsigned char *out, const EVP_MD *md_type);
int PKCS12_key_gen_utf8(const char *pass, int passlen, unsigned char *salt,
# define PKCS8_get_attr(p8, attr_nid) \ int saltlen, int id, int iter, int n,
PKCS12_get_attr_gen(p8->attributes, attr_nid) unsigned char *out, const EVP_MD *md_type);
int PKCS12_PBE_keyivgen(EVP_CIPHER_CTX *ctx, const char *pass, int passlen,
# define PKCS12_mac_present(p12) ((p12)->mac ? 1 : 0) ASN1_TYPE *param, const EVP_CIPHER *cipher,
const EVP_MD *md_type, int en_de);
PKCS12_SAFEBAG *PKCS12_x5092certbag(X509 *x509); int PKCS12_gen_mac(PKCS12 *p12, const char *pass, int passlen,
PKCS12_SAFEBAG *PKCS12_x509crl2certbag(X509_CRL *crl); unsigned char *mac, unsigned int *maclen);
X509 *PKCS12_certbag2x509(PKCS12_SAFEBAG *bag); int PKCS12_verify_mac(PKCS12 *p12, const char *pass, int passlen);
X509_CRL *PKCS12_certbag2x509crl(PKCS12_SAFEBAG *bag); int PKCS12_set_mac(PKCS12 *p12, const char *pass, int passlen,
unsigned char *salt, int saltlen, int iter,
PKCS12_SAFEBAG *PKCS12_item_pack_safebag(void *obj, const ASN1_ITEM *it, const EVP_MD *md_type);
int nid1, int nid2); int PKCS12_setup_mac(PKCS12 *p12, int iter, unsigned char *salt,
PKCS12_SAFEBAG *PKCS12_MAKE_KEYBAG(PKCS8_PRIV_KEY_INFO *p8); int saltlen, const EVP_MD *md_type);
PKCS8_PRIV_KEY_INFO *PKCS8_decrypt(X509_SIG *p8, const char *pass, unsigned char *OPENSSL_asc2uni(const char *asc, int asclen,
int passlen); unsigned char **uni, int *unilen);
PKCS8_PRIV_KEY_INFO *PKCS12_decrypt_skey(PKCS12_SAFEBAG *bag, char *OPENSSL_uni2asc(const unsigned char *uni, int unilen);
const char *pass, int passlen); unsigned char *OPENSSL_utf82uni(const char *asc, int asclen,
X509_SIG *PKCS8_encrypt(int pbe_nid, const EVP_CIPHER *cipher, unsigned char **uni, int *unilen);
const char *pass, int passlen, unsigned char *salt, char *OPENSSL_uni2utf8(const unsigned char *uni, int unilen);
int saltlen, int iter, PKCS8_PRIV_KEY_INFO *p8);
PKCS12_SAFEBAG *PKCS12_MAKE_SHKEYBAG(int pbe_nid, const char *pass, DECLARE_ASN1_FUNCTIONS(PKCS12)
int passlen, unsigned char *salt, DECLARE_ASN1_FUNCTIONS(PKCS12_MAC_DATA)
int saltlen, int iter, DECLARE_ASN1_FUNCTIONS(PKCS12_SAFEBAG)
PKCS8_PRIV_KEY_INFO *p8); DECLARE_ASN1_FUNCTIONS(PKCS12_BAGS)
PKCS7 *PKCS12_pack_p7data(STACK_OF(PKCS12_SAFEBAG) *sk);
STACK_OF(PKCS12_SAFEBAG) *PKCS12_unpack_p7data(PKCS7 *p7); DECLARE_ASN1_ITEM(PKCS12_SAFEBAGS)
PKCS7 *PKCS12_pack_p7encdata(int pbe_nid, const char *pass, int passlen, DECLARE_ASN1_ITEM(PKCS12_AUTHSAFES)
unsigned char *salt, int saltlen, int iter,
STACK_OF(PKCS12_SAFEBAG) *bags); void PKCS12_PBE_add(void);
STACK_OF(PKCS12_SAFEBAG) *PKCS12_unpack_p7encdata(PKCS7 *p7, const char *pass, int PKCS12_parse(PKCS12 *p12, const char *pass, EVP_PKEY **pkey, X509 **cert,
int passlen); STACK_OF(X509) **ca);
PKCS12 *PKCS12_create(const char *pass, const char *name, EVP_PKEY *pkey,
int PKCS12_pack_authsafes(PKCS12 *p12, STACK_OF(PKCS7) *safes); X509 *cert, STACK_OF(X509) *ca, int nid_key, int nid_cert,
STACK_OF(PKCS7) *PKCS12_unpack_authsafes(PKCS12 *p12); int iter, int mac_iter, int keytype);
int PKCS12_add_localkeyid(PKCS12_SAFEBAG *bag, unsigned char *name, PKCS12_SAFEBAG *PKCS12_add_cert(STACK_OF(PKCS12_SAFEBAG) **pbags, X509 *cert);
int namelen); PKCS12_SAFEBAG *PKCS12_add_key(STACK_OF(PKCS12_SAFEBAG) **pbags,
int PKCS12_add_friendlyname_asc(PKCS12_SAFEBAG *bag, const char *name, EVP_PKEY *key, int key_usage, int iter,
int namelen); int key_nid, const char *pass);
int PKCS12_add_CSPName_asc(PKCS12_SAFEBAG *bag, const char *name, int PKCS12_add_safe(STACK_OF(PKCS7) **psafes, STACK_OF(PKCS12_SAFEBAG) *bags,
int namelen); int safe_nid, int iter, const char *pass);
int PKCS12_add_friendlyname_uni(PKCS12_SAFEBAG *bag, PKCS12 *PKCS12_add_safes(STACK_OF(PKCS7) *safes, int p7_nid);
const unsigned char *name, int namelen);
int PKCS8_add_keyusage(PKCS8_PRIV_KEY_INFO *p8, int usage); int i2d_PKCS12_bio(BIO *bp, PKCS12 *p12);
ASN1_TYPE *PKCS12_get_attr_gen(STACK_OF(X509_ATTRIBUTE) *attrs, int attr_nid); # ifndef OPENSSL_NO_STDIO
char *PKCS12_get_friendlyname(PKCS12_SAFEBAG *bag); int i2d_PKCS12_fp(FILE *fp, PKCS12 *p12);
unsigned char *PKCS12_pbe_crypt(X509_ALGOR *algor, const char *pass, # endif
int passlen, unsigned char *in, int inlen, PKCS12 *d2i_PKCS12_bio(BIO *bp, PKCS12 **p12);
unsigned char **data, int *datalen, # ifndef OPENSSL_NO_STDIO
int en_de); PKCS12 *d2i_PKCS12_fp(FILE *fp, PKCS12 **p12);
void *PKCS12_item_decrypt_d2i(X509_ALGOR *algor, const ASN1_ITEM *it, # endif
const char *pass, int passlen, int PKCS12_newpass(PKCS12 *p12, const char *oldpass, const char *newpass);
ASN1_OCTET_STRING *oct, int zbuf);
ASN1_OCTET_STRING *PKCS12_item_i2d_encrypt(X509_ALGOR *algor, # ifdef __cplusplus
const ASN1_ITEM *it, }
const char *pass, int passlen, # endif
void *obj, int zbuf); #endif
PKCS12 *PKCS12_init(int mode);
int PKCS12_key_gen_asc(const char *pass, int passlen, unsigned char *salt,
int saltlen, int id, int iter, int n,
unsigned char *out, const EVP_MD *md_type);
int PKCS12_key_gen_uni(unsigned char *pass, int passlen, unsigned char *salt,
int saltlen, int id, int iter, int n,
unsigned char *out, const EVP_MD *md_type);
int PKCS12_PBE_keyivgen(EVP_CIPHER_CTX *ctx, const char *pass, int passlen,
ASN1_TYPE *param, const EVP_CIPHER *cipher,
const EVP_MD *md_type, int en_de);
int PKCS12_gen_mac(PKCS12 *p12, const char *pass, int passlen,
unsigned char *mac, unsigned int *maclen);
int PKCS12_verify_mac(PKCS12 *p12, const char *pass, int passlen);
int PKCS12_set_mac(PKCS12 *p12, const char *pass, int passlen,
unsigned char *salt, int saltlen, int iter,
const EVP_MD *md_type);
int PKCS12_setup_mac(PKCS12 *p12, int iter, unsigned char *salt,
int saltlen, const EVP_MD *md_type);
unsigned char *OPENSSL_asc2uni(const char *asc, int asclen,
unsigned char **uni, int *unilen);
char *OPENSSL_uni2asc(unsigned char *uni, int unilen);
DECLARE_ASN1_FUNCTIONS(PKCS12)
DECLARE_ASN1_FUNCTIONS(PKCS12_MAC_DATA)
DECLARE_ASN1_FUNCTIONS(PKCS12_SAFEBAG)
DECLARE_ASN1_FUNCTIONS(PKCS12_BAGS)
DECLARE_ASN1_ITEM(PKCS12_SAFEBAGS)
DECLARE_ASN1_ITEM(PKCS12_AUTHSAFES)
void PKCS12_PBE_add(void);
int PKCS12_parse(PKCS12 *p12, const char *pass, EVP_PKEY **pkey, X509 **cert,
STACK_OF(X509) **ca);
PKCS12 *PKCS12_create(char *pass, char *name, EVP_PKEY *pkey, X509 *cert,
STACK_OF(X509) *ca, int nid_key, int nid_cert, int iter,
int mac_iter, int keytype);
PKCS12_SAFEBAG *PKCS12_add_cert(STACK_OF(PKCS12_SAFEBAG) **pbags, X509 *cert);
PKCS12_SAFEBAG *PKCS12_add_key(STACK_OF(PKCS12_SAFEBAG) **pbags,
EVP_PKEY *key, int key_usage, int iter,
int key_nid, char *pass);
int PKCS12_add_safe(STACK_OF(PKCS7) **psafes, STACK_OF(PKCS12_SAFEBAG) *bags,
int safe_nid, int iter, char *pass);
PKCS12 *PKCS12_add_safes(STACK_OF(PKCS7) *safes, int p7_nid);
int i2d_PKCS12_bio(BIO *bp, PKCS12 *p12);
int i2d_PKCS12_fp(FILE *fp, PKCS12 *p12);
PKCS12 *d2i_PKCS12_bio(BIO *bp, PKCS12 **p12);
PKCS12 *d2i_PKCS12_fp(FILE *fp, PKCS12 **p12);
int PKCS12_newpass(PKCS12 *p12, const char *oldpass, const char *newpass);
/* 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_PKCS12_strings(void);
/* Error codes for the PKCS12 functions. */
/* Function codes. */
# define PKCS12_F_PARSE_BAG 129
# define PKCS12_F_PARSE_BAGS 103
# define PKCS12_F_PKCS12_ADD_FRIENDLYNAME 100
# define PKCS12_F_PKCS12_ADD_FRIENDLYNAME_ASC 127
# define PKCS12_F_PKCS12_ADD_FRIENDLYNAME_UNI 102
# define PKCS12_F_PKCS12_ADD_LOCALKEYID 104
# define PKCS12_F_PKCS12_CREATE 105
# define PKCS12_F_PKCS12_GEN_MAC 107
# define PKCS12_F_PKCS12_INIT 109
# define PKCS12_F_PKCS12_ITEM_DECRYPT_D2I 106
# define PKCS12_F_PKCS12_ITEM_I2D_ENCRYPT 108
# define PKCS12_F_PKCS12_ITEM_PACK_SAFEBAG 117
# define PKCS12_F_PKCS12_KEY_GEN_ASC 110
# define PKCS12_F_PKCS12_KEY_GEN_UNI 111
# define PKCS12_F_PKCS12_MAKE_KEYBAG 112
# define PKCS12_F_PKCS12_MAKE_SHKEYBAG 113
# define PKCS12_F_PKCS12_NEWPASS 128
# define PKCS12_F_PKCS12_PACK_P7DATA 114
# define PKCS12_F_PKCS12_PACK_P7ENCDATA 115
# define PKCS12_F_PKCS12_PARSE 118
# define PKCS12_F_PKCS12_PBE_CRYPT 119
# define PKCS12_F_PKCS12_PBE_KEYIVGEN 120
# define PKCS12_F_PKCS12_SETUP_MAC 122
# define PKCS12_F_PKCS12_SET_MAC 123
# define PKCS12_F_PKCS12_UNPACK_AUTHSAFES 130
# define PKCS12_F_PKCS12_UNPACK_P7DATA 131
# define PKCS12_F_PKCS12_VERIFY_MAC 126
# define PKCS12_F_PKCS8_ADD_KEYUSAGE 124
# define PKCS12_F_PKCS8_ENCRYPT 125
/* Reason codes. */
# define PKCS12_R_CANT_PACK_STRUCTURE 100
# define PKCS12_R_CONTENT_TYPE_NOT_DATA 121
# define PKCS12_R_DECODE_ERROR 101
# define PKCS12_R_ENCODE_ERROR 102
# define PKCS12_R_ENCRYPT_ERROR 103
# define PKCS12_R_ERROR_SETTING_ENCRYPTED_DATA_TYPE 120
# define PKCS12_R_INVALID_NULL_ARGUMENT 104
# define PKCS12_R_INVALID_NULL_PKCS12_POINTER 105
# define PKCS12_R_IV_GEN_ERROR 106
# define PKCS12_R_KEY_GEN_ERROR 107
# define PKCS12_R_MAC_ABSENT 108
# define PKCS12_R_MAC_GENERATION_ERROR 109
# define PKCS12_R_MAC_SETUP_ERROR 110
# define PKCS12_R_MAC_STRING_SET_ERROR 111
# define PKCS12_R_MAC_VERIFY_ERROR 112
# define PKCS12_R_MAC_VERIFY_FAILURE 113
# define PKCS12_R_PARSE_ERROR 114
# define PKCS12_R_PKCS12_ALGOR_CIPHERINIT_ERROR 115
# define PKCS12_R_PKCS12_CIPHERFINAL_ERROR 116
# define PKCS12_R_PKCS12_PBE_CRYPT_ERROR 117
# define PKCS12_R_UNKNOWN_DIGEST_ALGORITHM 118
# define PKCS12_R_UNSUPPORTED_PKCS12_MODE 119
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,77 @@
/*
* Generated by util/mkerr.pl DO NOT EDIT
* Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/license.html
*/
#ifndef HEADER_PKCS12ERR_H
# define HEADER_PKCS12ERR_H
# ifdef __cplusplus
extern "C"
# endif
int ERR_load_PKCS12_strings(void);
/*
* PKCS12 function codes.
*/
# define PKCS12_F_OPENSSL_ASC2UNI 121
# define PKCS12_F_OPENSSL_UNI2ASC 124
# define PKCS12_F_OPENSSL_UNI2UTF8 127
# define PKCS12_F_OPENSSL_UTF82UNI 129
# define PKCS12_F_PKCS12_CREATE 105
# define PKCS12_F_PKCS12_GEN_MAC 107
# define PKCS12_F_PKCS12_INIT 109
# define PKCS12_F_PKCS12_ITEM_DECRYPT_D2I 106
# define PKCS12_F_PKCS12_ITEM_I2D_ENCRYPT 108
# define PKCS12_F_PKCS12_ITEM_PACK_SAFEBAG 117
# define PKCS12_F_PKCS12_KEY_GEN_ASC 110
# define PKCS12_F_PKCS12_KEY_GEN_UNI 111
# define PKCS12_F_PKCS12_KEY_GEN_UTF8 116
# define PKCS12_F_PKCS12_NEWPASS 128
# define PKCS12_F_PKCS12_PACK_P7DATA 114
# define PKCS12_F_PKCS12_PACK_P7ENCDATA 115
# define PKCS12_F_PKCS12_PARSE 118
# define PKCS12_F_PKCS12_PBE_CRYPT 119
# define PKCS12_F_PKCS12_PBE_KEYIVGEN 120
# define PKCS12_F_PKCS12_SAFEBAG_CREATE0_P8INF 112
# define PKCS12_F_PKCS12_SAFEBAG_CREATE0_PKCS8 113
# define PKCS12_F_PKCS12_SAFEBAG_CREATE_PKCS8_ENCRYPT 133
# define PKCS12_F_PKCS12_SETUP_MAC 122
# define PKCS12_F_PKCS12_SET_MAC 123
# define PKCS12_F_PKCS12_UNPACK_AUTHSAFES 130
# define PKCS12_F_PKCS12_UNPACK_P7DATA 131
# define PKCS12_F_PKCS12_VERIFY_MAC 126
# define PKCS12_F_PKCS8_ENCRYPT 125
# define PKCS12_F_PKCS8_SET0_PBE 132
/*
* PKCS12 reason codes.
*/
# define PKCS12_R_CANT_PACK_STRUCTURE 100
# define PKCS12_R_CONTENT_TYPE_NOT_DATA 121
# define PKCS12_R_DECODE_ERROR 101
# define PKCS12_R_ENCODE_ERROR 102
# define PKCS12_R_ENCRYPT_ERROR 103
# define PKCS12_R_ERROR_SETTING_ENCRYPTED_DATA_TYPE 120
# define PKCS12_R_INVALID_NULL_ARGUMENT 104
# define PKCS12_R_INVALID_NULL_PKCS12_POINTER 105
# define PKCS12_R_IV_GEN_ERROR 106
# define PKCS12_R_KEY_GEN_ERROR 107
# define PKCS12_R_MAC_ABSENT 108
# define PKCS12_R_MAC_GENERATION_ERROR 109
# define PKCS12_R_MAC_SETUP_ERROR 110
# define PKCS12_R_MAC_STRING_SET_ERROR 111
# define PKCS12_R_MAC_VERIFY_FAILURE 113
# define PKCS12_R_PARSE_ERROR 114
# define PKCS12_R_PKCS12_ALGOR_CIPHERINIT_ERROR 115
# define PKCS12_R_PKCS12_CIPHERFINAL_ERROR 116
# define PKCS12_R_PKCS12_PBE_CRYPT_ERROR 117
# define PKCS12_R_UNKNOWN_DIGEST_ALGORITHM 118
# define PKCS12_R_UNSUPPORTED_PKCS12_MODE 119
#endif

View File

@ -1,481 +1,319 @@
/* crypto/pkcs7/pkcs7.h */ /*
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
* All rights reserved. *
* * Licensed under the OpenSSL license (the "License"). You may not use
* This package is an SSL implementation written * this file except in compliance with the License. You can obtain a copy
* by Eric Young (eay@cryptsoft.com). * in the file LICENSE in the source distribution or at
* The implementation was written so as to conform with Netscapes SSL. * https://www.openssl.org/source/license.html
* */
* This library is free for commercial and non-commercial use as long as
* the following conditions are aheared to. The following conditions #ifndef HEADER_PKCS7_H
* apply to all code found in this distribution, be it the RC4, RSA, # define HEADER_PKCS7_H
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
* included with this distribution is covered by the same copyright terms # include <openssl/asn1.h>
* except that the holder is Tim Hudson (tjh@cryptsoft.com). # include <openssl/bio.h>
* # include <openssl/e_os2.h>
* Copyright remains Eric Young's, and as such any Copyright notices in
* the code are not to be removed. # include <openssl/symhacks.h>
* If this package is used in a product, Eric Young should be given attribution # include <openssl/ossl_typ.h>
* as the author of the parts of the library used. # include <openssl/pkcs7err.h>
* This can be in the form of a textual message at program startup or
* in documentation (online or textual) provided with the package. #ifdef __cplusplus
* extern "C" {
* Redistribution and use in source and binary forms, with or without #endif
* modification, are permitted provided that the following conditions
* are met: /*-
* 1. Redistributions of source code must retain the copyright Encryption_ID DES-CBC
* notice, this list of conditions and the following disclaimer. Digest_ID MD5
* 2. Redistributions in binary form must reproduce the above copyright Digest_Encryption_ID rsaEncryption
* notice, this list of conditions and the following disclaimer in the Key_Encryption_ID rsaEncryption
* 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: typedef struct pkcs7_issuer_and_serial_st {
* "This product includes cryptographic software written by X509_NAME *issuer;
* Eric Young (eay@cryptsoft.com)" ASN1_INTEGER *serial;
* The word 'cryptographic' can be left out if the rouines from the library } PKCS7_ISSUER_AND_SERIAL;
* being used are not cryptographic related :-).
* 4. If you include any Windows specific code (or a derivative thereof) from typedef struct pkcs7_signer_info_st {
* the apps directory (application code) you must include an acknowledgement: ASN1_INTEGER *version; /* version 1 */
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" PKCS7_ISSUER_AND_SERIAL *issuer_and_serial;
* X509_ALGOR *digest_alg;
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND STACK_OF(X509_ATTRIBUTE) *auth_attr; /* [ 0 ] */
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE X509_ALGOR *digest_enc_alg;
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ASN1_OCTET_STRING *enc_digest;
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE STACK_OF(X509_ATTRIBUTE) *unauth_attr; /* [ 1 ] */
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL /* The private key to sign with */
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS EVP_PKEY *pkey;
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) } PKCS7_SIGNER_INFO;
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY DEFINE_STACK_OF(PKCS7_SIGNER_INFO)
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. typedef struct pkcs7_recip_info_st {
* ASN1_INTEGER *version; /* version 0 */
* The licence and distribution terms for any publically available version or PKCS7_ISSUER_AND_SERIAL *issuer_and_serial;
* derivative of this code cannot be changed. i.e. this code cannot simply be X509_ALGOR *key_enc_algor;
* copied and put under another distribution licence ASN1_OCTET_STRING *enc_key;
* [including the GNU Public Licence.] X509 *cert; /* get the pub-key from this */
*/ } PKCS7_RECIP_INFO;
#ifndef HEADER_PKCS7_H DEFINE_STACK_OF(PKCS7_RECIP_INFO)
# define HEADER_PKCS7_H
typedef struct pkcs7_signed_st {
# include <openssl/asn1.h> ASN1_INTEGER *version; /* version 1 */
# include <openssl/bio.h> STACK_OF(X509_ALGOR) *md_algs; /* md used */
# include <openssl/e_os2.h> STACK_OF(X509) *cert; /* [ 0 ] */
STACK_OF(X509_CRL) *crl; /* [ 1 ] */
# include <openssl/symhacks.h> STACK_OF(PKCS7_SIGNER_INFO) *signer_info;
# include <openssl/ossl_typ.h> struct pkcs7_st *contents;
} PKCS7_SIGNED;
#ifdef __cplusplus /*
extern "C" { * The above structure is very very similar to PKCS7_SIGN_ENVELOPE. How about
#endif * merging the two
*/
# ifdef OPENSSL_SYS_WIN32
/* Under Win32 thes are defined in wincrypt.h */ typedef struct pkcs7_enc_content_st {
# undef PKCS7_ISSUER_AND_SERIAL ASN1_OBJECT *content_type;
# undef PKCS7_SIGNER_INFO X509_ALGOR *algorithm;
# endif ASN1_OCTET_STRING *enc_data; /* [ 0 ] */
const EVP_CIPHER *cipher;
/*- } PKCS7_ENC_CONTENT;
Encryption_ID DES-CBC
Digest_ID MD5 typedef struct pkcs7_enveloped_st {
Digest_Encryption_ID rsaEncryption ASN1_INTEGER *version; /* version 0 */
Key_Encryption_ID rsaEncryption STACK_OF(PKCS7_RECIP_INFO) *recipientinfo;
*/ PKCS7_ENC_CONTENT *enc_data;
} PKCS7_ENVELOPE;
typedef struct pkcs7_issuer_and_serial_st {
X509_NAME *issuer; typedef struct pkcs7_signedandenveloped_st {
ASN1_INTEGER *serial; ASN1_INTEGER *version; /* version 1 */
} PKCS7_ISSUER_AND_SERIAL; STACK_OF(X509_ALGOR) *md_algs; /* md used */
STACK_OF(X509) *cert; /* [ 0 ] */
typedef struct pkcs7_signer_info_st { STACK_OF(X509_CRL) *crl; /* [ 1 ] */
ASN1_INTEGER *version; /* version 1 */ STACK_OF(PKCS7_SIGNER_INFO) *signer_info;
PKCS7_ISSUER_AND_SERIAL *issuer_and_serial; PKCS7_ENC_CONTENT *enc_data;
X509_ALGOR *digest_alg; STACK_OF(PKCS7_RECIP_INFO) *recipientinfo;
STACK_OF(X509_ATTRIBUTE) *auth_attr; /* [ 0 ] */ } PKCS7_SIGN_ENVELOPE;
X509_ALGOR *digest_enc_alg;
ASN1_OCTET_STRING *enc_digest; typedef struct pkcs7_digest_st {
STACK_OF(X509_ATTRIBUTE) *unauth_attr; /* [ 1 ] */ ASN1_INTEGER *version; /* version 0 */
/* The private key to sign with */ X509_ALGOR *md; /* md used */
EVP_PKEY *pkey; struct pkcs7_st *contents;
} PKCS7_SIGNER_INFO; ASN1_OCTET_STRING *digest;
} PKCS7_DIGEST;
DECLARE_STACK_OF(PKCS7_SIGNER_INFO)
DECLARE_ASN1_SET_OF(PKCS7_SIGNER_INFO) typedef struct pkcs7_encrypted_st {
ASN1_INTEGER *version; /* version 0 */
typedef struct pkcs7_recip_info_st { PKCS7_ENC_CONTENT *enc_data;
ASN1_INTEGER *version; /* version 0 */ } PKCS7_ENCRYPT;
PKCS7_ISSUER_AND_SERIAL *issuer_and_serial;
X509_ALGOR *key_enc_algor; typedef struct pkcs7_st {
ASN1_OCTET_STRING *enc_key; /*
X509 *cert; /* get the pub-key from this */ * The following is non NULL if it contains ASN1 encoding of this
} PKCS7_RECIP_INFO; * structure
*/
DECLARE_STACK_OF(PKCS7_RECIP_INFO) unsigned char *asn1;
DECLARE_ASN1_SET_OF(PKCS7_RECIP_INFO) long length;
# define PKCS7_S_HEADER 0
typedef struct pkcs7_signed_st { # define PKCS7_S_BODY 1
ASN1_INTEGER *version; /* version 1 */ # define PKCS7_S_TAIL 2
STACK_OF(X509_ALGOR) *md_algs; /* md used */ int state; /* used during processing */
STACK_OF(X509) *cert; /* [ 0 ] */ int detached;
STACK_OF(X509_CRL) *crl; /* [ 1 ] */ ASN1_OBJECT *type;
STACK_OF(PKCS7_SIGNER_INFO) *signer_info; /* content as defined by the type */
struct pkcs7_st *contents; /*
} PKCS7_SIGNED; * all encryption/message digests are applied to the 'contents', leaving
/* * out the 'type' field.
* The above structure is very very similar to PKCS7_SIGN_ENVELOPE. How about */
* merging the two union {
*/ char *ptr;
/* NID_pkcs7_data */
typedef struct pkcs7_enc_content_st { ASN1_OCTET_STRING *data;
ASN1_OBJECT *content_type; /* NID_pkcs7_signed */
X509_ALGOR *algorithm; PKCS7_SIGNED *sign;
ASN1_OCTET_STRING *enc_data; /* [ 0 ] */ /* NID_pkcs7_enveloped */
const EVP_CIPHER *cipher; PKCS7_ENVELOPE *enveloped;
} PKCS7_ENC_CONTENT; /* NID_pkcs7_signedAndEnveloped */
PKCS7_SIGN_ENVELOPE *signed_and_enveloped;
typedef struct pkcs7_enveloped_st { /* NID_pkcs7_digest */
ASN1_INTEGER *version; /* version 0 */ PKCS7_DIGEST *digest;
STACK_OF(PKCS7_RECIP_INFO) *recipientinfo; /* NID_pkcs7_encrypted */
PKCS7_ENC_CONTENT *enc_data; PKCS7_ENCRYPT *encrypted;
} PKCS7_ENVELOPE; /* Anything else */
ASN1_TYPE *other;
typedef struct pkcs7_signedandenveloped_st { } d;
ASN1_INTEGER *version; /* version 1 */ } PKCS7;
STACK_OF(X509_ALGOR) *md_algs; /* md used */
STACK_OF(X509) *cert; /* [ 0 ] */ DEFINE_STACK_OF(PKCS7)
STACK_OF(X509_CRL) *crl; /* [ 1 ] */
STACK_OF(PKCS7_SIGNER_INFO) *signer_info; # define PKCS7_OP_SET_DETACHED_SIGNATURE 1
PKCS7_ENC_CONTENT *enc_data; # define PKCS7_OP_GET_DETACHED_SIGNATURE 2
STACK_OF(PKCS7_RECIP_INFO) *recipientinfo;
} PKCS7_SIGN_ENVELOPE; # define PKCS7_get_signed_attributes(si) ((si)->auth_attr)
# define PKCS7_get_attributes(si) ((si)->unauth_attr)
typedef struct pkcs7_digest_st {
ASN1_INTEGER *version; /* version 0 */ # define PKCS7_type_is_signed(a) (OBJ_obj2nid((a)->type) == NID_pkcs7_signed)
X509_ALGOR *md; /* md used */ # define PKCS7_type_is_encrypted(a) (OBJ_obj2nid((a)->type) == NID_pkcs7_encrypted)
struct pkcs7_st *contents; # define PKCS7_type_is_enveloped(a) (OBJ_obj2nid((a)->type) == NID_pkcs7_enveloped)
ASN1_OCTET_STRING *digest; # define PKCS7_type_is_signedAndEnveloped(a) \
} PKCS7_DIGEST; (OBJ_obj2nid((a)->type) == NID_pkcs7_signedAndEnveloped)
# define PKCS7_type_is_data(a) (OBJ_obj2nid((a)->type) == NID_pkcs7_data)
typedef struct pkcs7_encrypted_st { # define PKCS7_type_is_digest(a) (OBJ_obj2nid((a)->type) == NID_pkcs7_digest)
ASN1_INTEGER *version; /* version 0 */
PKCS7_ENC_CONTENT *enc_data; # define PKCS7_set_detached(p,v) \
} PKCS7_ENCRYPT; PKCS7_ctrl(p,PKCS7_OP_SET_DETACHED_SIGNATURE,v,NULL)
# define PKCS7_get_detached(p) \
typedef struct pkcs7_st { PKCS7_ctrl(p,PKCS7_OP_GET_DETACHED_SIGNATURE,0,NULL)
/*
* The following is non NULL if it contains ASN1 encoding of this # define PKCS7_is_detached(p7) (PKCS7_type_is_signed(p7) && PKCS7_get_detached(p7))
* structure
*/ /* S/MIME related flags */
unsigned char *asn1;
long length; # define PKCS7_TEXT 0x1
# define PKCS7_S_HEADER 0 # define PKCS7_NOCERTS 0x2
# define PKCS7_S_BODY 1 # define PKCS7_NOSIGS 0x4
# define PKCS7_S_TAIL 2 # define PKCS7_NOCHAIN 0x8
int state; /* used during processing */ # define PKCS7_NOINTERN 0x10
int detached; # define PKCS7_NOVERIFY 0x20
ASN1_OBJECT *type; # define PKCS7_DETACHED 0x40
/* content as defined by the type */ # define PKCS7_BINARY 0x80
/* # define PKCS7_NOATTR 0x100
* all encryption/message digests are applied to the 'contents', leaving # define PKCS7_NOSMIMECAP 0x200
* out the 'type' field. # define PKCS7_NOOLDMIMETYPE 0x400
*/ # define PKCS7_CRLFEOL 0x800
union { # define PKCS7_STREAM 0x1000
char *ptr; # define PKCS7_NOCRL 0x2000
/* NID_pkcs7_data */ # define PKCS7_PARTIAL 0x4000
ASN1_OCTET_STRING *data; # define PKCS7_REUSE_DIGEST 0x8000
/* NID_pkcs7_signed */ # define PKCS7_NO_DUAL_CONTENT 0x10000
PKCS7_SIGNED *sign;
/* NID_pkcs7_enveloped */ /* Flags: for compatibility with older code */
PKCS7_ENVELOPE *enveloped;
/* NID_pkcs7_signedAndEnveloped */ # define SMIME_TEXT PKCS7_TEXT
PKCS7_SIGN_ENVELOPE *signed_and_enveloped; # define SMIME_NOCERTS PKCS7_NOCERTS
/* NID_pkcs7_digest */ # define SMIME_NOSIGS PKCS7_NOSIGS
PKCS7_DIGEST *digest; # define SMIME_NOCHAIN PKCS7_NOCHAIN
/* NID_pkcs7_encrypted */ # define SMIME_NOINTERN PKCS7_NOINTERN
PKCS7_ENCRYPT *encrypted; # define SMIME_NOVERIFY PKCS7_NOVERIFY
/* Anything else */ # define SMIME_DETACHED PKCS7_DETACHED
ASN1_TYPE *other; # define SMIME_BINARY PKCS7_BINARY
} d; # define SMIME_NOATTR PKCS7_NOATTR
} PKCS7;
/* CRLF ASCII canonicalisation */
DECLARE_STACK_OF(PKCS7) # define SMIME_ASCIICRLF 0x80000
DECLARE_ASN1_SET_OF(PKCS7)
DECLARE_PKCS12_STACK_OF(PKCS7) DECLARE_ASN1_FUNCTIONS(PKCS7_ISSUER_AND_SERIAL)
# define PKCS7_OP_SET_DETACHED_SIGNATURE 1 int PKCS7_ISSUER_AND_SERIAL_digest(PKCS7_ISSUER_AND_SERIAL *data,
# define PKCS7_OP_GET_DETACHED_SIGNATURE 2 const EVP_MD *type, unsigned char *md,
unsigned int *len);
# define PKCS7_get_signed_attributes(si) ((si)->auth_attr) # ifndef OPENSSL_NO_STDIO
# define PKCS7_get_attributes(si) ((si)->unauth_attr) PKCS7 *d2i_PKCS7_fp(FILE *fp, PKCS7 **p7);
int i2d_PKCS7_fp(FILE *fp, PKCS7 *p7);
# define PKCS7_type_is_signed(a) (OBJ_obj2nid((a)->type) == NID_pkcs7_signed) # endif
# define PKCS7_type_is_encrypted(a) (OBJ_obj2nid((a)->type) == NID_pkcs7_encrypted) PKCS7 *PKCS7_dup(PKCS7 *p7);
# define PKCS7_type_is_enveloped(a) (OBJ_obj2nid((a)->type) == NID_pkcs7_enveloped) PKCS7 *d2i_PKCS7_bio(BIO *bp, PKCS7 **p7);
# define PKCS7_type_is_signedAndEnveloped(a) \ int i2d_PKCS7_bio(BIO *bp, PKCS7 *p7);
(OBJ_obj2nid((a)->type) == NID_pkcs7_signedAndEnveloped) int i2d_PKCS7_bio_stream(BIO *out, PKCS7 *p7, BIO *in, int flags);
# define PKCS7_type_is_data(a) (OBJ_obj2nid((a)->type) == NID_pkcs7_data) int PEM_write_bio_PKCS7_stream(BIO *out, PKCS7 *p7, BIO *in, int flags);
# define PKCS7_type_is_digest(a) (OBJ_obj2nid((a)->type) == NID_pkcs7_digest)
DECLARE_ASN1_FUNCTIONS(PKCS7_SIGNER_INFO)
# define PKCS7_set_detached(p,v) \ DECLARE_ASN1_FUNCTIONS(PKCS7_RECIP_INFO)
PKCS7_ctrl(p,PKCS7_OP_SET_DETACHED_SIGNATURE,v,NULL) DECLARE_ASN1_FUNCTIONS(PKCS7_SIGNED)
# define PKCS7_get_detached(p) \ DECLARE_ASN1_FUNCTIONS(PKCS7_ENC_CONTENT)
PKCS7_ctrl(p,PKCS7_OP_GET_DETACHED_SIGNATURE,0,NULL) DECLARE_ASN1_FUNCTIONS(PKCS7_ENVELOPE)
DECLARE_ASN1_FUNCTIONS(PKCS7_SIGN_ENVELOPE)
# define PKCS7_is_detached(p7) (PKCS7_type_is_signed(p7) && PKCS7_get_detached(p7)) DECLARE_ASN1_FUNCTIONS(PKCS7_DIGEST)
DECLARE_ASN1_FUNCTIONS(PKCS7_ENCRYPT)
/* S/MIME related flags */ DECLARE_ASN1_FUNCTIONS(PKCS7)
# define PKCS7_TEXT 0x1 DECLARE_ASN1_ITEM(PKCS7_ATTR_SIGN)
# define PKCS7_NOCERTS 0x2 DECLARE_ASN1_ITEM(PKCS7_ATTR_VERIFY)
# define PKCS7_NOSIGS 0x4
# define PKCS7_NOCHAIN 0x8 DECLARE_ASN1_NDEF_FUNCTION(PKCS7)
# define PKCS7_NOINTERN 0x10 DECLARE_ASN1_PRINT_FUNCTION(PKCS7)
# define PKCS7_NOVERIFY 0x20
# define PKCS7_DETACHED 0x40 long PKCS7_ctrl(PKCS7 *p7, int cmd, long larg, char *parg);
# define PKCS7_BINARY 0x80
# define PKCS7_NOATTR 0x100 int PKCS7_set_type(PKCS7 *p7, int type);
# define PKCS7_NOSMIMECAP 0x200 int PKCS7_set0_type_other(PKCS7 *p7, int type, ASN1_TYPE *other);
# define PKCS7_NOOLDMIMETYPE 0x400 int PKCS7_set_content(PKCS7 *p7, PKCS7 *p7_data);
# define PKCS7_CRLFEOL 0x800 int PKCS7_SIGNER_INFO_set(PKCS7_SIGNER_INFO *p7i, X509 *x509, EVP_PKEY *pkey,
# define PKCS7_STREAM 0x1000 const EVP_MD *dgst);
# define PKCS7_NOCRL 0x2000 int PKCS7_SIGNER_INFO_sign(PKCS7_SIGNER_INFO *si);
# define PKCS7_PARTIAL 0x4000 int PKCS7_add_signer(PKCS7 *p7, PKCS7_SIGNER_INFO *p7i);
# define PKCS7_REUSE_DIGEST 0x8000 int PKCS7_add_certificate(PKCS7 *p7, X509 *x509);
int PKCS7_add_crl(PKCS7 *p7, X509_CRL *x509);
/* Flags: for compatibility with older code */ int PKCS7_content_new(PKCS7 *p7, int nid);
int PKCS7_dataVerify(X509_STORE *cert_store, X509_STORE_CTX *ctx,
# define SMIME_TEXT PKCS7_TEXT BIO *bio, PKCS7 *p7, PKCS7_SIGNER_INFO *si);
# define SMIME_NOCERTS PKCS7_NOCERTS int PKCS7_signatureVerify(BIO *bio, PKCS7 *p7, PKCS7_SIGNER_INFO *si,
# define SMIME_NOSIGS PKCS7_NOSIGS X509 *x509);
# define SMIME_NOCHAIN PKCS7_NOCHAIN
# define SMIME_NOINTERN PKCS7_NOINTERN BIO *PKCS7_dataInit(PKCS7 *p7, BIO *bio);
# define SMIME_NOVERIFY PKCS7_NOVERIFY int PKCS7_dataFinal(PKCS7 *p7, BIO *bio);
# define SMIME_DETACHED PKCS7_DETACHED BIO *PKCS7_dataDecode(PKCS7 *p7, EVP_PKEY *pkey, BIO *in_bio, X509 *pcert);
# define SMIME_BINARY PKCS7_BINARY
# define SMIME_NOATTR PKCS7_NOATTR PKCS7_SIGNER_INFO *PKCS7_add_signature(PKCS7 *p7, X509 *x509,
EVP_PKEY *pkey, const EVP_MD *dgst);
DECLARE_ASN1_FUNCTIONS(PKCS7_ISSUER_AND_SERIAL) X509 *PKCS7_cert_from_signer_info(PKCS7 *p7, PKCS7_SIGNER_INFO *si);
int PKCS7_set_digest(PKCS7 *p7, const EVP_MD *md);
int PKCS7_ISSUER_AND_SERIAL_digest(PKCS7_ISSUER_AND_SERIAL *data, STACK_OF(PKCS7_SIGNER_INFO) *PKCS7_get_signer_info(PKCS7 *p7);
const EVP_MD *type, unsigned char *md,
unsigned int *len); PKCS7_RECIP_INFO *PKCS7_add_recipient(PKCS7 *p7, X509 *x509);
# ifndef OPENSSL_NO_FP_API void PKCS7_SIGNER_INFO_get0_algs(PKCS7_SIGNER_INFO *si, EVP_PKEY **pk,
PKCS7 *d2i_PKCS7_fp(FILE *fp, PKCS7 **p7); X509_ALGOR **pdig, X509_ALGOR **psig);
int i2d_PKCS7_fp(FILE *fp, PKCS7 *p7); void PKCS7_RECIP_INFO_get0_alg(PKCS7_RECIP_INFO *ri, X509_ALGOR **penc);
# endif int PKCS7_add_recipient_info(PKCS7 *p7, PKCS7_RECIP_INFO *ri);
PKCS7 *PKCS7_dup(PKCS7 *p7); int PKCS7_RECIP_INFO_set(PKCS7_RECIP_INFO *p7i, X509 *x509);
PKCS7 *d2i_PKCS7_bio(BIO *bp, PKCS7 **p7); int PKCS7_set_cipher(PKCS7 *p7, const EVP_CIPHER *cipher);
int i2d_PKCS7_bio(BIO *bp, PKCS7 *p7); int PKCS7_stream(unsigned char ***boundary, PKCS7 *p7);
int i2d_PKCS7_bio_stream(BIO *out, PKCS7 *p7, BIO *in, int flags);
int PEM_write_bio_PKCS7_stream(BIO *out, PKCS7 *p7, BIO *in, int flags); PKCS7_ISSUER_AND_SERIAL *PKCS7_get_issuer_and_serial(PKCS7 *p7, int idx);
ASN1_OCTET_STRING *PKCS7_digest_from_attributes(STACK_OF(X509_ATTRIBUTE) *sk);
DECLARE_ASN1_FUNCTIONS(PKCS7_SIGNER_INFO) int PKCS7_add_signed_attribute(PKCS7_SIGNER_INFO *p7si, int nid, int type,
DECLARE_ASN1_FUNCTIONS(PKCS7_RECIP_INFO) void *data);
DECLARE_ASN1_FUNCTIONS(PKCS7_SIGNED) int PKCS7_add_attribute(PKCS7_SIGNER_INFO *p7si, int nid, int atrtype,
DECLARE_ASN1_FUNCTIONS(PKCS7_ENC_CONTENT) void *value);
DECLARE_ASN1_FUNCTIONS(PKCS7_ENVELOPE) ASN1_TYPE *PKCS7_get_attribute(PKCS7_SIGNER_INFO *si, int nid);
DECLARE_ASN1_FUNCTIONS(PKCS7_SIGN_ENVELOPE) ASN1_TYPE *PKCS7_get_signed_attribute(PKCS7_SIGNER_INFO *si, int nid);
DECLARE_ASN1_FUNCTIONS(PKCS7_DIGEST) int PKCS7_set_signed_attributes(PKCS7_SIGNER_INFO *p7si,
DECLARE_ASN1_FUNCTIONS(PKCS7_ENCRYPT) STACK_OF(X509_ATTRIBUTE) *sk);
DECLARE_ASN1_FUNCTIONS(PKCS7) int PKCS7_set_attributes(PKCS7_SIGNER_INFO *p7si,
STACK_OF(X509_ATTRIBUTE) *sk);
DECLARE_ASN1_ITEM(PKCS7_ATTR_SIGN)
DECLARE_ASN1_ITEM(PKCS7_ATTR_VERIFY) PKCS7 *PKCS7_sign(X509 *signcert, EVP_PKEY *pkey, STACK_OF(X509) *certs,
BIO *data, int flags);
DECLARE_ASN1_NDEF_FUNCTION(PKCS7)
DECLARE_ASN1_PRINT_FUNCTION(PKCS7) PKCS7_SIGNER_INFO *PKCS7_sign_add_signer(PKCS7 *p7,
X509 *signcert, EVP_PKEY *pkey,
long PKCS7_ctrl(PKCS7 *p7, int cmd, long larg, char *parg); const EVP_MD *md, int flags);
int PKCS7_set_type(PKCS7 *p7, int type); int PKCS7_final(PKCS7 *p7, BIO *data, int flags);
int PKCS7_set0_type_other(PKCS7 *p7, int type, ASN1_TYPE *other); int PKCS7_verify(PKCS7 *p7, STACK_OF(X509) *certs, X509_STORE *store,
int PKCS7_set_content(PKCS7 *p7, PKCS7 *p7_data); BIO *indata, BIO *out, int flags);
int PKCS7_SIGNER_INFO_set(PKCS7_SIGNER_INFO *p7i, X509 *x509, EVP_PKEY *pkey, STACK_OF(X509) *PKCS7_get0_signers(PKCS7 *p7, STACK_OF(X509) *certs,
const EVP_MD *dgst); int flags);
int PKCS7_SIGNER_INFO_sign(PKCS7_SIGNER_INFO *si); PKCS7 *PKCS7_encrypt(STACK_OF(X509) *certs, BIO *in, const EVP_CIPHER *cipher,
int PKCS7_add_signer(PKCS7 *p7, PKCS7_SIGNER_INFO *p7i); int flags);
int PKCS7_add_certificate(PKCS7 *p7, X509 *x509); int PKCS7_decrypt(PKCS7 *p7, EVP_PKEY *pkey, X509 *cert, BIO *data,
int PKCS7_add_crl(PKCS7 *p7, X509_CRL *x509); int flags);
int PKCS7_content_new(PKCS7 *p7, int nid);
int PKCS7_dataVerify(X509_STORE *cert_store, X509_STORE_CTX *ctx, int PKCS7_add_attrib_smimecap(PKCS7_SIGNER_INFO *si,
BIO *bio, PKCS7 *p7, PKCS7_SIGNER_INFO *si); STACK_OF(X509_ALGOR) *cap);
int PKCS7_signatureVerify(BIO *bio, PKCS7 *p7, PKCS7_SIGNER_INFO *si, STACK_OF(X509_ALGOR) *PKCS7_get_smimecap(PKCS7_SIGNER_INFO *si);
X509 *x509); int PKCS7_simple_smimecap(STACK_OF(X509_ALGOR) *sk, int nid, int arg);
BIO *PKCS7_dataInit(PKCS7 *p7, BIO *bio); int PKCS7_add_attrib_content_type(PKCS7_SIGNER_INFO *si, ASN1_OBJECT *coid);
int PKCS7_dataFinal(PKCS7 *p7, BIO *bio); int PKCS7_add0_attrib_signing_time(PKCS7_SIGNER_INFO *si, ASN1_TIME *t);
BIO *PKCS7_dataDecode(PKCS7 *p7, EVP_PKEY *pkey, BIO *in_bio, X509 *pcert); int PKCS7_add1_attrib_digest(PKCS7_SIGNER_INFO *si,
const unsigned char *md, int mdlen);
PKCS7_SIGNER_INFO *PKCS7_add_signature(PKCS7 *p7, X509 *x509,
EVP_PKEY *pkey, const EVP_MD *dgst); int SMIME_write_PKCS7(BIO *bio, PKCS7 *p7, BIO *data, int flags);
X509 *PKCS7_cert_from_signer_info(PKCS7 *p7, PKCS7_SIGNER_INFO *si); PKCS7 *SMIME_read_PKCS7(BIO *bio, BIO **bcont);
int PKCS7_set_digest(PKCS7 *p7, const EVP_MD *md);
STACK_OF(PKCS7_SIGNER_INFO) *PKCS7_get_signer_info(PKCS7 *p7); BIO *BIO_new_PKCS7(BIO *out, PKCS7 *p7);
PKCS7_RECIP_INFO *PKCS7_add_recipient(PKCS7 *p7, X509 *x509); # ifdef __cplusplus
void PKCS7_SIGNER_INFO_get0_algs(PKCS7_SIGNER_INFO *si, EVP_PKEY **pk, }
X509_ALGOR **pdig, X509_ALGOR **psig); # endif
void PKCS7_RECIP_INFO_get0_alg(PKCS7_RECIP_INFO *ri, X509_ALGOR **penc); #endif
int PKCS7_add_recipient_info(PKCS7 *p7, PKCS7_RECIP_INFO *ri);
int PKCS7_RECIP_INFO_set(PKCS7_RECIP_INFO *p7i, X509 *x509);
int PKCS7_set_cipher(PKCS7 *p7, const EVP_CIPHER *cipher);
int PKCS7_stream(unsigned char ***boundary, PKCS7 *p7);
PKCS7_ISSUER_AND_SERIAL *PKCS7_get_issuer_and_serial(PKCS7 *p7, int idx);
ASN1_OCTET_STRING *PKCS7_digest_from_attributes(STACK_OF(X509_ATTRIBUTE) *sk);
int PKCS7_add_signed_attribute(PKCS7_SIGNER_INFO *p7si, int nid, int type,
void *data);
int PKCS7_add_attribute(PKCS7_SIGNER_INFO *p7si, int nid, int atrtype,
void *value);
ASN1_TYPE *PKCS7_get_attribute(PKCS7_SIGNER_INFO *si, int nid);
ASN1_TYPE *PKCS7_get_signed_attribute(PKCS7_SIGNER_INFO *si, int nid);
int PKCS7_set_signed_attributes(PKCS7_SIGNER_INFO *p7si,
STACK_OF(X509_ATTRIBUTE) *sk);
int PKCS7_set_attributes(PKCS7_SIGNER_INFO *p7si,
STACK_OF(X509_ATTRIBUTE) *sk);
PKCS7 *PKCS7_sign(X509 *signcert, EVP_PKEY *pkey, STACK_OF(X509) *certs,
BIO *data, int flags);
PKCS7_SIGNER_INFO *PKCS7_sign_add_signer(PKCS7 *p7,
X509 *signcert, EVP_PKEY *pkey,
const EVP_MD *md, int flags);
int PKCS7_final(PKCS7 *p7, BIO *data, int flags);
int PKCS7_verify(PKCS7 *p7, STACK_OF(X509) *certs, X509_STORE *store,
BIO *indata, BIO *out, int flags);
STACK_OF(X509) *PKCS7_get0_signers(PKCS7 *p7, STACK_OF(X509) *certs,
int flags);
PKCS7 *PKCS7_encrypt(STACK_OF(X509) *certs, BIO *in, const EVP_CIPHER *cipher,
int flags);
int PKCS7_decrypt(PKCS7 *p7, EVP_PKEY *pkey, X509 *cert, BIO *data,
int flags);
int PKCS7_add_attrib_smimecap(PKCS7_SIGNER_INFO *si,
STACK_OF(X509_ALGOR) *cap);
STACK_OF(X509_ALGOR) *PKCS7_get_smimecap(PKCS7_SIGNER_INFO *si);
int PKCS7_simple_smimecap(STACK_OF(X509_ALGOR) *sk, int nid, int arg);
int PKCS7_add_attrib_content_type(PKCS7_SIGNER_INFO *si, ASN1_OBJECT *coid);
int PKCS7_add0_attrib_signing_time(PKCS7_SIGNER_INFO *si, ASN1_TIME *t);
int PKCS7_add1_attrib_digest(PKCS7_SIGNER_INFO *si,
const unsigned char *md, int mdlen);
int SMIME_write_PKCS7(BIO *bio, PKCS7 *p7, BIO *data, int flags);
PKCS7 *SMIME_read_PKCS7(BIO *bio, BIO **bcont);
BIO *BIO_new_PKCS7(BIO *out, PKCS7 *p7);
/* 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_PKCS7_strings(void);
/* Error codes for the PKCS7 functions. */
/* Function codes. */
# define PKCS7_F_B64_READ_PKCS7 120
# define PKCS7_F_B64_WRITE_PKCS7 121
# define PKCS7_F_DO_PKCS7_SIGNED_ATTRIB 136
# define PKCS7_F_I2D_PKCS7_BIO_STREAM 140
# define PKCS7_F_PKCS7_ADD0_ATTRIB_SIGNING_TIME 135
# define PKCS7_F_PKCS7_ADD_ATTRIB_SMIMECAP 118
# define PKCS7_F_PKCS7_ADD_CERTIFICATE 100
# define PKCS7_F_PKCS7_ADD_CRL 101
# define PKCS7_F_PKCS7_ADD_RECIPIENT_INFO 102
# define PKCS7_F_PKCS7_ADD_SIGNATURE 131
# define PKCS7_F_PKCS7_ADD_SIGNER 103
# define PKCS7_F_PKCS7_BIO_ADD_DIGEST 125
# define PKCS7_F_PKCS7_COPY_EXISTING_DIGEST 138
# define PKCS7_F_PKCS7_CTRL 104
# define PKCS7_F_PKCS7_DATADECODE 112
# define PKCS7_F_PKCS7_DATAFINAL 128
# define PKCS7_F_PKCS7_DATAINIT 105
# define PKCS7_F_PKCS7_DATASIGN 106
# define PKCS7_F_PKCS7_DATAVERIFY 107
# define PKCS7_F_PKCS7_DECRYPT 114
# define PKCS7_F_PKCS7_DECRYPT_RINFO 133
# define PKCS7_F_PKCS7_ENCODE_RINFO 132
# define PKCS7_F_PKCS7_ENCRYPT 115
# define PKCS7_F_PKCS7_FINAL 134
# define PKCS7_F_PKCS7_FIND_DIGEST 127
# define PKCS7_F_PKCS7_GET0_SIGNERS 124
# define PKCS7_F_PKCS7_RECIP_INFO_SET 130
# define PKCS7_F_PKCS7_SET_CIPHER 108
# define PKCS7_F_PKCS7_SET_CONTENT 109
# define PKCS7_F_PKCS7_SET_DIGEST 126
# define PKCS7_F_PKCS7_SET_TYPE 110
# define PKCS7_F_PKCS7_SIGN 116
# define PKCS7_F_PKCS7_SIGNATUREVERIFY 113
# define PKCS7_F_PKCS7_SIGNER_INFO_SET 129
# define PKCS7_F_PKCS7_SIGNER_INFO_SIGN 139
# define PKCS7_F_PKCS7_SIGN_ADD_SIGNER 137
# define PKCS7_F_PKCS7_SIMPLE_SMIMECAP 119
# define PKCS7_F_PKCS7_VERIFY 117
# define PKCS7_F_SMIME_READ_PKCS7 122
# define PKCS7_F_SMIME_TEXT 123
/* Reason codes. */
# define PKCS7_R_CERTIFICATE_VERIFY_ERROR 117
# define PKCS7_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER 144
# define PKCS7_R_CIPHER_NOT_INITIALIZED 116
# define PKCS7_R_CONTENT_AND_DATA_PRESENT 118
# define PKCS7_R_CTRL_ERROR 152
# define PKCS7_R_DECODE_ERROR 130
# define PKCS7_R_DECRYPTED_KEY_IS_WRONG_LENGTH 100
# define PKCS7_R_DECRYPT_ERROR 119
# define PKCS7_R_DIGEST_FAILURE 101
# define PKCS7_R_ENCRYPTION_CTRL_FAILURE 149
# define PKCS7_R_ENCRYPTION_NOT_SUPPORTED_FOR_THIS_KEY_TYPE 150
# define PKCS7_R_ERROR_ADDING_RECIPIENT 120
# define PKCS7_R_ERROR_SETTING_CIPHER 121
# define PKCS7_R_INVALID_MIME_TYPE 131
# define PKCS7_R_INVALID_NULL_POINTER 143
# define PKCS7_R_INVALID_SIGNED_DATA_TYPE 155
# define PKCS7_R_MIME_NO_CONTENT_TYPE 132
# define PKCS7_R_MIME_PARSE_ERROR 133
# define PKCS7_R_MIME_SIG_PARSE_ERROR 134
# define PKCS7_R_MISSING_CERIPEND_INFO 103
# define PKCS7_R_NO_CONTENT 122
# define PKCS7_R_NO_CONTENT_TYPE 135
# define PKCS7_R_NO_DEFAULT_DIGEST 151
# define PKCS7_R_NO_MATCHING_DIGEST_TYPE_FOUND 154
# define PKCS7_R_NO_MULTIPART_BODY_FAILURE 136
# define PKCS7_R_NO_MULTIPART_BOUNDARY 137
# define PKCS7_R_NO_RECIPIENT_MATCHES_CERTIFICATE 115
# define PKCS7_R_NO_RECIPIENT_MATCHES_KEY 146
# define PKCS7_R_NO_SIGNATURES_ON_DATA 123
# define PKCS7_R_NO_SIGNERS 142
# define PKCS7_R_NO_SIG_CONTENT_TYPE 138
# define PKCS7_R_OPERATION_NOT_SUPPORTED_ON_THIS_TYPE 104
# define PKCS7_R_PKCS7_ADD_SIGNATURE_ERROR 124
# define PKCS7_R_PKCS7_ADD_SIGNER_ERROR 153
# define PKCS7_R_PKCS7_DATAFINAL 126
# define PKCS7_R_PKCS7_DATAFINAL_ERROR 125
# define PKCS7_R_PKCS7_DATASIGN 145
# define PKCS7_R_PKCS7_PARSE_ERROR 139
# define PKCS7_R_PKCS7_SIG_PARSE_ERROR 140
# define PKCS7_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE 127
# define PKCS7_R_SIGNATURE_FAILURE 105
# define PKCS7_R_SIGNER_CERTIFICATE_NOT_FOUND 128
# define PKCS7_R_SIGNING_CTRL_FAILURE 147
# define PKCS7_R_SIGNING_NOT_SUPPORTED_FOR_THIS_KEY_TYPE 148
# define PKCS7_R_SIG_INVALID_MIME_TYPE 141
# define PKCS7_R_SMIME_TEXT_ERROR 129
# define PKCS7_R_UNABLE_TO_FIND_CERTIFICATE 106
# define PKCS7_R_UNABLE_TO_FIND_MEM_BIO 107
# define PKCS7_R_UNABLE_TO_FIND_MESSAGE_DIGEST 108
# define PKCS7_R_UNKNOWN_DIGEST_TYPE 109
# define PKCS7_R_UNKNOWN_OPERATION 110
# define PKCS7_R_UNSUPPORTED_CIPHER_TYPE 111
# define PKCS7_R_UNSUPPORTED_CONTENT_TYPE 112
# define PKCS7_R_WRONG_CONTENT_TYPE 113
# define PKCS7_R_WRONG_PKCS7_TYPE 114
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,99 @@
/*
* Generated by util/mkerr.pl DO NOT EDIT
* Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/license.html
*/
#ifndef HEADER_PKCS7ERR_H
# define HEADER_PKCS7ERR_H
# ifdef __cplusplus
extern "C"
# endif
int ERR_load_PKCS7_strings(void);
/*
* PKCS7 function codes.
*/
# define PKCS7_F_DO_PKCS7_SIGNED_ATTRIB 136
# define PKCS7_F_PKCS7_ADD0_ATTRIB_SIGNING_TIME 135
# define PKCS7_F_PKCS7_ADD_ATTRIB_SMIMECAP 118
# define PKCS7_F_PKCS7_ADD_CERTIFICATE 100
# define PKCS7_F_PKCS7_ADD_CRL 101
# define PKCS7_F_PKCS7_ADD_RECIPIENT_INFO 102
# define PKCS7_F_PKCS7_ADD_SIGNATURE 131
# define PKCS7_F_PKCS7_ADD_SIGNER 103
# define PKCS7_F_PKCS7_BIO_ADD_DIGEST 125
# define PKCS7_F_PKCS7_COPY_EXISTING_DIGEST 138
# define PKCS7_F_PKCS7_CTRL 104
# define PKCS7_F_PKCS7_DATADECODE 112
# define PKCS7_F_PKCS7_DATAFINAL 128
# define PKCS7_F_PKCS7_DATAINIT 105
# define PKCS7_F_PKCS7_DATAVERIFY 107
# define PKCS7_F_PKCS7_DECRYPT 114
# define PKCS7_F_PKCS7_DECRYPT_RINFO 133
# define PKCS7_F_PKCS7_ENCODE_RINFO 132
# define PKCS7_F_PKCS7_ENCRYPT 115
# define PKCS7_F_PKCS7_FINAL 134
# define PKCS7_F_PKCS7_FIND_DIGEST 127
# define PKCS7_F_PKCS7_GET0_SIGNERS 124
# define PKCS7_F_PKCS7_RECIP_INFO_SET 130
# define PKCS7_F_PKCS7_SET_CIPHER 108
# define PKCS7_F_PKCS7_SET_CONTENT 109
# define PKCS7_F_PKCS7_SET_DIGEST 126
# define PKCS7_F_PKCS7_SET_TYPE 110
# define PKCS7_F_PKCS7_SIGN 116
# define PKCS7_F_PKCS7_SIGNATUREVERIFY 113
# define PKCS7_F_PKCS7_SIGNER_INFO_SET 129
# define PKCS7_F_PKCS7_SIGNER_INFO_SIGN 139
# define PKCS7_F_PKCS7_SIGN_ADD_SIGNER 137
# define PKCS7_F_PKCS7_SIMPLE_SMIMECAP 119
# define PKCS7_F_PKCS7_VERIFY 117
/*
* PKCS7 reason codes.
*/
# define PKCS7_R_CERTIFICATE_VERIFY_ERROR 117
# define PKCS7_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER 144
# define PKCS7_R_CIPHER_NOT_INITIALIZED 116
# define PKCS7_R_CONTENT_AND_DATA_PRESENT 118
# define PKCS7_R_CTRL_ERROR 152
# define PKCS7_R_DECRYPT_ERROR 119
# define PKCS7_R_DIGEST_FAILURE 101
# define PKCS7_R_ENCRYPTION_CTRL_FAILURE 149
# define PKCS7_R_ENCRYPTION_NOT_SUPPORTED_FOR_THIS_KEY_TYPE 150
# define PKCS7_R_ERROR_ADDING_RECIPIENT 120
# define PKCS7_R_ERROR_SETTING_CIPHER 121
# define PKCS7_R_INVALID_NULL_POINTER 143
# define PKCS7_R_INVALID_SIGNED_DATA_TYPE 155
# define PKCS7_R_NO_CONTENT 122
# define PKCS7_R_NO_DEFAULT_DIGEST 151
# define PKCS7_R_NO_MATCHING_DIGEST_TYPE_FOUND 154
# define PKCS7_R_NO_RECIPIENT_MATCHES_CERTIFICATE 115
# define PKCS7_R_NO_SIGNATURES_ON_DATA 123
# define PKCS7_R_NO_SIGNERS 142
# define PKCS7_R_OPERATION_NOT_SUPPORTED_ON_THIS_TYPE 104
# define PKCS7_R_PKCS7_ADD_SIGNATURE_ERROR 124
# define PKCS7_R_PKCS7_ADD_SIGNER_ERROR 153
# define PKCS7_R_PKCS7_DATASIGN 145
# define PKCS7_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE 127
# define PKCS7_R_SIGNATURE_FAILURE 105
# define PKCS7_R_SIGNER_CERTIFICATE_NOT_FOUND 128
# define PKCS7_R_SIGNING_CTRL_FAILURE 147
# define PKCS7_R_SIGNING_NOT_SUPPORTED_FOR_THIS_KEY_TYPE 148
# define PKCS7_R_SMIME_TEXT_ERROR 129
# define PKCS7_R_UNABLE_TO_FIND_CERTIFICATE 106
# define PKCS7_R_UNABLE_TO_FIND_MEM_BIO 107
# define PKCS7_R_UNABLE_TO_FIND_MESSAGE_DIGEST 108
# define PKCS7_R_UNKNOWN_DIGEST_TYPE 109
# define PKCS7_R_UNKNOWN_OPERATION 110
# define PKCS7_R_UNSUPPORTED_CIPHER_TYPE 111
# define PKCS7_R_UNSUPPORTED_CONTENT_TYPE 112
# define PKCS7_R_WRONG_CONTENT_TYPE 113
# define PKCS7_R_WRONG_PKCS7_TYPE 114
#endif

View File

@ -1,99 +0,0 @@
/* crypto/pqueue/pqueue.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_PQUEUE_H
# define HEADER_PQUEUE_H
# include <stdio.h>
# include <stdlib.h>
# include <string.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef struct _pqueue *pqueue;
typedef struct _pitem {
unsigned char priority[8]; /* 64-bit value in big-endian encoding */
void *data;
struct _pitem *next;
} pitem;
typedef struct _pitem *piterator;
pitem *pitem_new(unsigned char *prio64be, void *data);
void pitem_free(pitem *item);
pqueue pqueue_new(void);
void pqueue_free(pqueue pq);
pitem *pqueue_insert(pqueue pq, pitem *item);
pitem *pqueue_peek(pqueue pq);
pitem *pqueue_pop(pqueue pq);
pitem *pqueue_find(pqueue pq, unsigned char *prio64be);
pitem *pqueue_iterator(pqueue pq);
pitem *pqueue_next(piterator *iter);
void pqueue_print(pqueue pq);
int pqueue_size(pqueue pq);
#ifdef __cplusplus
}
#endif
#endif /* ! HEADER_PQUEUE_H */

View File

@ -1,150 +1,77 @@
/* crypto/rand/rand.h */ /*
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
* All rights reserved. *
* * Licensed under the OpenSSL license (the "License"). You may not use
* This package is an SSL implementation written * this file except in compliance with the License. You can obtain a copy
* by Eric Young (eay@cryptsoft.com). * in the file LICENSE in the source distribution or at
* The implementation was written so as to conform with Netscapes SSL. * https://www.openssl.org/source/license.html
* */
* This library is free for commercial and non-commercial use as long as
* the following conditions are aheared to. The following conditions #ifndef HEADER_RAND_H
* apply to all code found in this distribution, be it the RC4, RSA, # define HEADER_RAND_H
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
* included with this distribution is covered by the same copyright terms # include <stdlib.h>
* except that the holder is Tim Hudson (tjh@cryptsoft.com). # include <openssl/ossl_typ.h>
* # include <openssl/e_os2.h>
* Copyright remains Eric Young's, and as such any Copyright notices in # include <openssl/randerr.h>
* the code are not to be removed.
* If this package is used in a product, Eric Young should be given attribution #ifdef __cplusplus
* as the author of the parts of the library used. extern "C" {
* This can be in the form of a textual message at program startup or #endif
* in documentation (online or textual) provided with the package.
* struct rand_meth_st {
* Redistribution and use in source and binary forms, with or without int (*seed) (const void *buf, int num);
* modification, are permitted provided that the following conditions int (*bytes) (unsigned char *buf, int num);
* are met: void (*cleanup) (void);
* 1. Redistributions of source code must retain the copyright int (*add) (const void *buf, int num, double randomness);
* notice, this list of conditions and the following disclaimer. int (*pseudorand) (unsigned char *buf, int num);
* 2. Redistributions in binary form must reproduce the above copyright int (*status) (void);
* 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 int RAND_set_rand_method(const RAND_METHOD *meth);
* must display the following acknowledgement: const RAND_METHOD *RAND_get_rand_method(void);
* "This product includes cryptographic software written by # ifndef OPENSSL_NO_ENGINE
* Eric Young (eay@cryptsoft.com)" int RAND_set_rand_engine(ENGINE *engine);
* The word 'cryptographic' can be left out if the rouines from the library # endif
* being used are not cryptographic related :-).
* 4. If you include any Windows specific code (or a derivative thereof) from RAND_METHOD *RAND_OpenSSL(void);
* the apps directory (application code) you must include an acknowledgement:
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" # if OPENSSL_API_COMPAT < 0x10100000L
* # define RAND_cleanup() while(0) continue
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND # endif
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE int RAND_bytes(unsigned char *buf, int num);
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE int RAND_priv_bytes(unsigned char *buf, int num);
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE DEPRECATEDIN_1_1_0(int RAND_pseudo_bytes(unsigned char *buf, int num))
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS void RAND_seed(const void *buf, int num);
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) void RAND_keep_random_devices_open(int keep);
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY # if defined(__ANDROID__) && defined(__NDK_FPABI__)
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF __NDK_FPABI__ /* __attribute__((pcs("aapcs"))) on ARM */
* SUCH DAMAGE. # endif
* void RAND_add(const void *buf, int num, double randomness);
* The licence and distribution terms for any publically available version or int RAND_load_file(const char *file, long max_bytes);
* derivative of this code cannot be changed. i.e. this code cannot simply be int RAND_write_file(const char *file);
* copied and put under another distribution licence const char *RAND_file_name(char *file, size_t num);
* [including the GNU Public Licence.] int RAND_status(void);
*/
# ifndef OPENSSL_NO_EGD
#ifndef HEADER_RAND_H int RAND_query_egd_bytes(const char *path, unsigned char *buf, int bytes);
# define HEADER_RAND_H int RAND_egd(const char *path);
int RAND_egd_bytes(const char *path, int bytes);
# include <stdlib.h> # endif
# include <openssl/ossl_typ.h>
# include <openssl/e_os2.h> int RAND_poll(void);
# if defined(OPENSSL_SYS_WINDOWS) # if defined(_WIN32) && (defined(BASETYPES) || defined(_WINDEF_H))
# include <windows.h> /* application has to include <windows.h> in order to use these */
# endif DEPRECATEDIN_1_1_0(void RAND_screen(void))
DEPRECATEDIN_1_1_0(int RAND_event(UINT, WPARAM, LPARAM))
#ifdef __cplusplus # endif
extern "C" {
#endif
#ifdef __cplusplus
# if defined(OPENSSL_FIPS) }
# define FIPS_RAND_SIZE_T size_t #endif
# endif
#endif
/* Already defined in ossl_typ.h */
/* typedef struct rand_meth_st RAND_METHOD; */
struct rand_meth_st {
void (*seed) (const void *buf, int num);
int (*bytes) (unsigned char *buf, int num);
void (*cleanup) (void);
void (*add) (const void *buf, int num, double entropy);
int (*pseudorand) (unsigned char *buf, int num);
int (*status) (void);
};
# ifdef BN_DEBUG
extern int rand_predictable;
# endif
int RAND_set_rand_method(const RAND_METHOD *meth);
const RAND_METHOD *RAND_get_rand_method(void);
# ifndef OPENSSL_NO_ENGINE
int RAND_set_rand_engine(ENGINE *engine);
# endif
RAND_METHOD *RAND_SSLeay(void);
void RAND_cleanup(void);
int RAND_bytes(unsigned char *buf, int num);
int RAND_pseudo_bytes(unsigned char *buf, int num);
void RAND_seed(const void *buf, int num);
void RAND_add(const void *buf, int num, double entropy);
int RAND_load_file(const char *file, long max_bytes);
int RAND_write_file(const char *file);
const char *RAND_file_name(char *file, size_t num);
int RAND_status(void);
int RAND_query_egd_bytes(const char *path, unsigned char *buf, int bytes);
int RAND_egd(const char *path);
int RAND_egd_bytes(const char *path, int bytes);
int RAND_poll(void);
# if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_WIN32)
void RAND_screen(void);
int RAND_event(UINT, WPARAM, LPARAM);
# endif
# ifdef OPENSSL_FIPS
void RAND_set_fips_drbg_type(int type, int flags);
int RAND_init_fips(void);
# 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_RAND_strings(void);
/* Error codes for the RAND functions. */
/* Function codes. */
# define RAND_F_RAND_GET_RAND_METHOD 101
# define RAND_F_RAND_INIT_FIPS 102
# define RAND_F_SSLEAY_RAND_BYTES 100
/* Reason codes. */
# define RAND_R_DUAL_EC_DRBG_DISABLED 104
# define RAND_R_ERROR_INITIALISING_DRBG 102
# define RAND_R_ERROR_INSTANTIATING_DRBG 103
# define RAND_R_NO_FIPS_RANDOM_METHOD_SET 101
# define RAND_R_PRNG_NOT_SEEDED 100
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,120 @@
/*
* Copyright 2017-2018 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/license.html
*/
#ifndef HEADER_DRBG_RAND_H
# define HEADER_DRBG_RAND_H
# include <time.h>
# include <openssl/ossl_typ.h>
/* In CTR mode, disable derivation function ctr_df */
# define RAND_DRBG_FLAG_CTR_NO_DF 0x1
/* A logical OR of all used flag bits (currently there is only one) */
# define RAND_DRBG_USED_FLAGS ( \
RAND_DRBG_FLAG_CTR_NO_DF \
)
/*
* Default security strength (in the sense of [NIST SP 800-90Ar1])
*
* NIST SP 800-90Ar1 supports the strength of the DRBG being smaller than that
* of the cipher by collecting less entropy. The current DRBG implemantion does
* not take RAND_DRBG_STRENGTH into account and sets the strength of the DRBG
* to that of the cipher.
*
* RAND_DRBG_STRENGTH is currently only used for the legacy RAND
* implementation.
*
* Currently supported ciphers are: NID_aes_128_ctr, NID_aes_192_ctr and
* NID_aes_256_ctr
*/
# define RAND_DRBG_STRENGTH 256
# define RAND_DRBG_TYPE NID_aes_256_ctr
# define RAND_DRBG_FLAGS 0
# ifdef __cplusplus
extern "C" {
# endif
/*
* Object lifetime functions.
*/
RAND_DRBG *RAND_DRBG_new(int type, unsigned int flags, RAND_DRBG *parent);
RAND_DRBG *RAND_DRBG_secure_new(int type, unsigned int flags, RAND_DRBG *parent);
int RAND_DRBG_set(RAND_DRBG *drbg, int type, unsigned int flags);
int RAND_DRBG_set_defaults(int type, unsigned int flags);
int RAND_DRBG_instantiate(RAND_DRBG *drbg,
const unsigned char *pers, size_t perslen);
int RAND_DRBG_uninstantiate(RAND_DRBG *drbg);
void RAND_DRBG_free(RAND_DRBG *drbg);
/*
* Object "use" functions.
*/
int RAND_DRBG_reseed(RAND_DRBG *drbg,
const unsigned char *adin, size_t adinlen,
int prediction_resistance);
int RAND_DRBG_generate(RAND_DRBG *drbg, unsigned char *out, size_t outlen,
int prediction_resistance,
const unsigned char *adin, size_t adinlen);
int RAND_DRBG_bytes(RAND_DRBG *drbg, unsigned char *out, size_t outlen);
int RAND_DRBG_set_reseed_interval(RAND_DRBG *drbg, unsigned int interval);
int RAND_DRBG_set_reseed_time_interval(RAND_DRBG *drbg, time_t interval);
int RAND_DRBG_set_reseed_defaults(
unsigned int master_reseed_interval,
unsigned int slave_reseed_interval,
time_t master_reseed_time_interval,
time_t slave_reseed_time_interval
);
RAND_DRBG *RAND_DRBG_get0_master(void);
RAND_DRBG *RAND_DRBG_get0_public(void);
RAND_DRBG *RAND_DRBG_get0_private(void);
/*
* EXDATA
*/
# define RAND_DRBG_get_ex_new_index(l, p, newf, dupf, freef) \
CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_DRBG, l, p, newf, dupf, freef)
int RAND_DRBG_set_ex_data(RAND_DRBG *drbg, int idx, void *arg);
void *RAND_DRBG_get_ex_data(const RAND_DRBG *drbg, int idx);
/*
* Callback function typedefs
*/
typedef size_t (*RAND_DRBG_get_entropy_fn)(RAND_DRBG *drbg,
unsigned char **pout,
int entropy, size_t min_len,
size_t max_len,
int prediction_resistance);
typedef void (*RAND_DRBG_cleanup_entropy_fn)(RAND_DRBG *ctx,
unsigned char *out, size_t outlen);
typedef size_t (*RAND_DRBG_get_nonce_fn)(RAND_DRBG *drbg, unsigned char **pout,
int entropy, size_t min_len,
size_t max_len);
typedef void (*RAND_DRBG_cleanup_nonce_fn)(RAND_DRBG *drbg,
unsigned char *out, size_t outlen);
int RAND_DRBG_set_callbacks(RAND_DRBG *drbg,
RAND_DRBG_get_entropy_fn get_entropy,
RAND_DRBG_cleanup_entropy_fn cleanup_entropy,
RAND_DRBG_get_nonce_fn get_nonce,
RAND_DRBG_cleanup_nonce_fn cleanup_nonce);
# ifdef __cplusplus
}
# endif
#endif

View File

@ -0,0 +1,88 @@
/*
* Generated by util/mkerr.pl DO NOT EDIT
* Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/license.html
*/
#ifndef HEADER_RANDERR_H
# define HEADER_RANDERR_H
# ifdef __cplusplus
extern "C"
# endif
int ERR_load_RAND_strings(void);
/*
* RAND function codes.
*/
# define RAND_F_DRBG_BYTES 101
# define RAND_F_DRBG_GET_ENTROPY 105
# define RAND_F_DRBG_SETUP 117
# define RAND_F_GET_ENTROPY 106
# define RAND_F_RAND_BYTES 100
# define RAND_F_RAND_DRBG_ENABLE_LOCKING 119
# define RAND_F_RAND_DRBG_GENERATE 107
# define RAND_F_RAND_DRBG_GET_ENTROPY 120
# define RAND_F_RAND_DRBG_GET_NONCE 123
# define RAND_F_RAND_DRBG_INSTANTIATE 108
# define RAND_F_RAND_DRBG_NEW 109
# define RAND_F_RAND_DRBG_RESEED 110
# define RAND_F_RAND_DRBG_RESTART 102
# define RAND_F_RAND_DRBG_SET 104
# define RAND_F_RAND_DRBG_SET_DEFAULTS 121
# define RAND_F_RAND_DRBG_UNINSTANTIATE 118
# define RAND_F_RAND_LOAD_FILE 111
# define RAND_F_RAND_POOL_ACQUIRE_ENTROPY 122
# define RAND_F_RAND_POOL_ADD 103
# define RAND_F_RAND_POOL_ADD_BEGIN 113
# define RAND_F_RAND_POOL_ADD_END 114
# define RAND_F_RAND_POOL_BYTES_NEEDED 115
# define RAND_F_RAND_POOL_NEW 116
# define RAND_F_RAND_WRITE_FILE 112
/*
* RAND reason codes.
*/
# define RAND_R_ADDITIONAL_INPUT_TOO_LONG 102
# define RAND_R_ALREADY_INSTANTIATED 103
# define RAND_R_ARGUMENT_OUT_OF_RANGE 105
# define RAND_R_CANNOT_OPEN_FILE 121
# define RAND_R_DRBG_ALREADY_INITIALIZED 129
# define RAND_R_DRBG_NOT_INITIALISED 104
# define RAND_R_ENTROPY_INPUT_TOO_LONG 106
# define RAND_R_ENTROPY_OUT_OF_RANGE 124
# define RAND_R_ERROR_ENTROPY_POOL_WAS_IGNORED 127
# define RAND_R_ERROR_INITIALISING_DRBG 107
# define RAND_R_ERROR_INSTANTIATING_DRBG 108
# define RAND_R_ERROR_RETRIEVING_ADDITIONAL_INPUT 109
# define RAND_R_ERROR_RETRIEVING_ENTROPY 110
# define RAND_R_ERROR_RETRIEVING_NONCE 111
# define RAND_R_FAILED_TO_CREATE_LOCK 126
# define RAND_R_FUNC_NOT_IMPLEMENTED 101
# define RAND_R_FWRITE_ERROR 123
# define RAND_R_GENERATE_ERROR 112
# define RAND_R_INTERNAL_ERROR 113
# define RAND_R_IN_ERROR_STATE 114
# define RAND_R_NOT_A_REGULAR_FILE 122
# define RAND_R_NOT_INSTANTIATED 115
# define RAND_R_NO_DRBG_IMPLEMENTATION_SELECTED 128
# define RAND_R_PARENT_LOCKING_NOT_ENABLED 130
# define RAND_R_PARENT_STRENGTH_TOO_WEAK 131
# define RAND_R_PERSONALISATION_STRING_TOO_LONG 116
# define RAND_R_PREDICTION_RESISTANCE_NOT_SUPPORTED 133
# define RAND_R_PRNG_NOT_SEEDED 100
# define RAND_R_RANDOM_POOL_OVERFLOW 125
# define RAND_R_RANDOM_POOL_UNDERFLOW 134
# define RAND_R_REQUEST_TOO_LARGE_FOR_DRBG 117
# define RAND_R_RESEED_ERROR 118
# define RAND_R_SELFTEST_FAILURE 119
# define RAND_R_TOO_LITTLE_NONCE_REQUESTED 135
# define RAND_R_TOO_MUCH_NONCE_REQUESTED 136
# define RAND_R_UNSUPPORTED_DRBG_FLAGS 132
# define RAND_R_UNSUPPORTED_DRBG_TYPE 120
#endif

View File

@ -1,103 +1,51 @@
/* crypto/rc2/rc2.h */ /*
/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
* All rights reserved. *
* * Licensed under the OpenSSL license (the "License"). You may not use
* This package is an SSL implementation written * this file except in compliance with the License. You can obtain a copy
* by Eric Young (eay@cryptsoft.com). * in the file LICENSE in the source distribution or at
* The implementation was written so as to conform with Netscapes SSL. * https://www.openssl.org/source/license.html
* */
* This library is free for commercial and non-commercial use as long as
* the following conditions are aheared to. The following conditions #ifndef HEADER_RC2_H
* apply to all code found in this distribution, be it the RC4, RSA, # define HEADER_RC2_H
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
* included with this distribution is covered by the same copyright terms # include <openssl/opensslconf.h>
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
* # ifndef OPENSSL_NO_RC2
* Copyright remains Eric Young's, and as such any Copyright notices in # ifdef __cplusplus
* the code are not to be removed. extern "C" {
* If this package is used in a product, Eric Young should be given attribution # endif
* as the author of the parts of the library used.
* This can be in the form of a textual message at program startup or typedef unsigned int RC2_INT;
* in documentation (online or textual) provided with the package.
* # define RC2_ENCRYPT 1
* Redistribution and use in source and binary forms, with or without # define RC2_DECRYPT 0
* modification, are permitted provided that the following conditions
* are met: # define RC2_BLOCK 8
* 1. Redistributions of source code must retain the copyright # define RC2_KEY_LENGTH 16
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright typedef struct rc2_key_st {
* notice, this list of conditions and the following disclaimer in the RC2_INT data[64];
* documentation and/or other materials provided with the distribution. } RC2_KEY;
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement: void RC2_set_key(RC2_KEY *key, int len, const unsigned char *data, int bits);
* "This product includes cryptographic software written by void RC2_ecb_encrypt(const unsigned char *in, unsigned char *out,
* Eric Young (eay@cryptsoft.com)" RC2_KEY *key, int enc);
* The word 'cryptographic' can be left out if the rouines from the library void RC2_encrypt(unsigned long *data, RC2_KEY *key);
* being used are not cryptographic related :-). void RC2_decrypt(unsigned long *data, RC2_KEY *key);
* 4. If you include any Windows specific code (or a derivative thereof) from void RC2_cbc_encrypt(const unsigned char *in, unsigned char *out, long length,
* the apps directory (application code) you must include an acknowledgement: RC2_KEY *ks, unsigned char *iv, int enc);
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" void RC2_cfb64_encrypt(const unsigned char *in, unsigned char *out,
* long length, RC2_KEY *schedule, unsigned char *ivec,
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND int *num, int enc);
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE void RC2_ofb64_encrypt(const unsigned char *in, unsigned char *out,
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE long length, RC2_KEY *schedule, unsigned char *ivec,
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE int *num);
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS # ifdef __cplusplus
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) }
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT # endif
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY # endif
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. #endif
*
* 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_RC2_H
# define HEADER_RC2_H
# include <openssl/opensslconf.h>/* OPENSSL_NO_RC2, RC2_INT */
# ifdef OPENSSL_NO_RC2
# error RC2 is disabled.
# endif
# define RC2_ENCRYPT 1
# define RC2_DECRYPT 0
# define RC2_BLOCK 8
# define RC2_KEY_LENGTH 16
#ifdef __cplusplus
extern "C" {
#endif
typedef struct rc2_key_st {
RC2_INT data[64];
} RC2_KEY;
# ifdef OPENSSL_FIPS
void private_RC2_set_key(RC2_KEY *key, int len, const unsigned char *data,
int bits);
# endif
void RC2_set_key(RC2_KEY *key, int len, const unsigned char *data, int bits);
void RC2_ecb_encrypt(const unsigned char *in, unsigned char *out,
RC2_KEY *key, int enc);
void RC2_encrypt(unsigned long *data, RC2_KEY *key);
void RC2_decrypt(unsigned long *data, RC2_KEY *key);
void RC2_cbc_encrypt(const unsigned char *in, unsigned char *out, long length,
RC2_KEY *ks, unsigned char *iv, int enc);
void RC2_cfb64_encrypt(const unsigned char *in, unsigned char *out,
long length, RC2_KEY *schedule, unsigned char *ivec,
int *num, int enc);
void RC2_ofb64_encrypt(const unsigned char *in, unsigned char *out,
long length, RC2_KEY *schedule, unsigned char *ivec,
int *num);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -1,88 +1,36 @@
/* crypto/rc4/rc4.h */ /*
/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
* All rights reserved. *
* * Licensed under the OpenSSL license (the "License"). You may not use
* This package is an SSL implementation written * this file except in compliance with the License. You can obtain a copy
* by Eric Young (eay@cryptsoft.com). * in the file LICENSE in the source distribution or at
* The implementation was written so as to conform with Netscapes SSL. * https://www.openssl.org/source/license.html
* */
* This library is free for commercial and non-commercial use as long as
* the following conditions are aheared to. The following conditions #ifndef HEADER_RC4_H
* apply to all code found in this distribution, be it the RC4, RSA, # define HEADER_RC4_H
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
* included with this distribution is covered by the same copyright terms # include <openssl/opensslconf.h>
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
* # ifndef OPENSSL_NO_RC4
* Copyright remains Eric Young's, and as such any Copyright notices in # include <stddef.h>
* the code are not to be removed. #ifdef __cplusplus
* If this package is used in a product, Eric Young should be given attribution extern "C" {
* as the author of the parts of the library used. #endif
* This can be in the form of a textual message at program startup or
* in documentation (online or textual) provided with the package. typedef struct rc4_key_st {
* RC4_INT x, y;
* Redistribution and use in source and binary forms, with or without RC4_INT data[256];
* modification, are permitted provided that the following conditions } RC4_KEY;
* are met:
* 1. Redistributions of source code must retain the copyright const char *RC4_options(void);
* notice, this list of conditions and the following disclaimer. void RC4_set_key(RC4_KEY *key, int len, const unsigned char *data);
* 2. Redistributions in binary form must reproduce the above copyright void RC4(RC4_KEY *key, size_t len, const unsigned char *indata,
* notice, this list of conditions and the following disclaimer in the unsigned char *outdata);
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software # ifdef __cplusplus
* must display the following acknowledgement: }
* "This product includes cryptographic software written by # endif
* Eric Young (eay@cryptsoft.com)" # endif
* The word 'cryptographic' can be left out if the rouines from the library
* being used are not cryptographic related :-). #endif
* 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_RC4_H
# define HEADER_RC4_H
# include <openssl/opensslconf.h>/* OPENSSL_NO_RC4, RC4_INT */
# ifdef OPENSSL_NO_RC4
# error RC4 is disabled.
# endif
# include <stddef.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef struct rc4_key_st {
RC4_INT x, y;
RC4_INT data[256];
} RC4_KEY;
const char *RC4_options(void);
void RC4_set_key(RC4_KEY *key, int len, const unsigned char *data);
void private_RC4_set_key(RC4_KEY *key, int len, const unsigned char *data);
void RC4(RC4_KEY *key, size_t len, const unsigned char *indata,
unsigned char *outdata);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,63 @@
/*
* Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/license.html
*/
#ifndef HEADER_RC5_H
# define HEADER_RC5_H
# include <openssl/opensslconf.h>
# ifndef OPENSSL_NO_RC5
# ifdef __cplusplus
extern "C" {
# endif
# define RC5_ENCRYPT 1
# define RC5_DECRYPT 0
# define RC5_32_INT unsigned int
# define RC5_32_BLOCK 8
# define RC5_32_KEY_LENGTH 16/* This is a default, max is 255 */
/*
* This are the only values supported. Tweak the code if you want more The
* most supported modes will be RC5-32/12/16 RC5-32/16/8
*/
# define RC5_8_ROUNDS 8
# define RC5_12_ROUNDS 12
# define RC5_16_ROUNDS 16
typedef struct rc5_key_st {
/* Number of rounds */
int rounds;
RC5_32_INT data[2 * (RC5_16_ROUNDS + 1)];
} RC5_32_KEY;
void RC5_32_set_key(RC5_32_KEY *key, int len, const unsigned char *data,
int rounds);
void RC5_32_ecb_encrypt(const unsigned char *in, unsigned char *out,
RC5_32_KEY *key, int enc);
void RC5_32_encrypt(unsigned long *data, RC5_32_KEY *key);
void RC5_32_decrypt(unsigned long *data, RC5_32_KEY *key);
void RC5_32_cbc_encrypt(const unsigned char *in, unsigned char *out,
long length, RC5_32_KEY *ks, unsigned char *iv,
int enc);
void RC5_32_cfb64_encrypt(const unsigned char *in, unsigned char *out,
long length, RC5_32_KEY *schedule,
unsigned char *ivec, int *num, int enc);
void RC5_32_ofb64_encrypt(const unsigned char *in, unsigned char *out,
long length, RC5_32_KEY *schedule,
unsigned char *ivec, int *num);
# ifdef __cplusplus
}
# endif
# endif
#endif

View File

@ -1,105 +1,47 @@
/* crypto/ripemd/ripemd.h */ /*
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
* All rights reserved. *
* * Licensed under the OpenSSL license (the "License"). You may not use
* This package is an SSL implementation written * this file except in compliance with the License. You can obtain a copy
* by Eric Young (eay@cryptsoft.com). * in the file LICENSE in the source distribution or at
* The implementation was written so as to conform with Netscapes SSL. * https://www.openssl.org/source/license.html
* */
* This library is free for commercial and non-commercial use as long as
* the following conditions are aheared to. The following conditions #ifndef HEADER_RIPEMD_H
* apply to all code found in this distribution, be it the RC4, RSA, # define HEADER_RIPEMD_H
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
* included with this distribution is covered by the same copyright terms # include <openssl/opensslconf.h>
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
* #ifndef OPENSSL_NO_RMD160
* Copyright remains Eric Young's, and as such any Copyright notices in # include <openssl/e_os2.h>
* the code are not to be removed. # include <stddef.h>
* If this package is used in a product, Eric Young should be given attribution # ifdef __cplusplus
* as the author of the parts of the library used. extern "C" {
* This can be in the form of a textual message at program startup or # endif
* in documentation (online or textual) provided with the package.
* # define RIPEMD160_LONG unsigned int
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions # define RIPEMD160_CBLOCK 64
* are met: # define RIPEMD160_LBLOCK (RIPEMD160_CBLOCK/4)
* 1. Redistributions of source code must retain the copyright # define RIPEMD160_DIGEST_LENGTH 20
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright typedef struct RIPEMD160state_st {
* notice, this list of conditions and the following disclaimer in the RIPEMD160_LONG A, B, C, D, E;
* documentation and/or other materials provided with the distribution. RIPEMD160_LONG Nl, Nh;
* 3. All advertising materials mentioning features or use of this software RIPEMD160_LONG data[RIPEMD160_LBLOCK];
* must display the following acknowledgement: unsigned int num;
* "This product includes cryptographic software written by } RIPEMD160_CTX;
* Eric Young (eay@cryptsoft.com)"
* The word 'cryptographic' can be left out if the rouines from the library int RIPEMD160_Init(RIPEMD160_CTX *c);
* being used are not cryptographic related :-). int RIPEMD160_Update(RIPEMD160_CTX *c, const void *data, size_t len);
* 4. If you include any Windows specific code (or a derivative thereof) from int RIPEMD160_Final(unsigned char *md, RIPEMD160_CTX *c);
* the apps directory (application code) you must include an acknowledgement: unsigned char *RIPEMD160(const unsigned char *d, size_t n, unsigned char *md);
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" void RIPEMD160_Transform(RIPEMD160_CTX *c, const unsigned char *b);
*
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND # ifdef __cplusplus
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE }
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # endif
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE # endif
* 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) #endif
* 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_RIPEMD_H
# define HEADER_RIPEMD_H
# include <openssl/e_os2.h>
# include <stddef.h>
#ifdef __cplusplus
extern "C" {
#endif
# ifdef OPENSSL_NO_RIPEMD
# error RIPEMD is disabled.
# endif
# if defined(__LP32__)
# define RIPEMD160_LONG unsigned long
# elif defined(OPENSSL_SYS_CRAY) || defined(__ILP64__)
# define RIPEMD160_LONG unsigned long
# define RIPEMD160_LONG_LOG2 3
# else
# define RIPEMD160_LONG unsigned int
# endif
# define RIPEMD160_CBLOCK 64
# define RIPEMD160_LBLOCK (RIPEMD160_CBLOCK/4)
# define RIPEMD160_DIGEST_LENGTH 20
typedef struct RIPEMD160state_st {
RIPEMD160_LONG A, B, C, D, E;
RIPEMD160_LONG Nl, Nh;
RIPEMD160_LONG data[RIPEMD160_LBLOCK];
unsigned int num;
} RIPEMD160_CTX;
# ifdef OPENSSL_FIPS
int private_RIPEMD160_Init(RIPEMD160_CTX *c);
# endif
int RIPEMD160_Init(RIPEMD160_CTX *c);
int RIPEMD160_Update(RIPEMD160_CTX *c, const void *data, size_t len);
int RIPEMD160_Final(unsigned char *md, RIPEMD160_CTX *c);
unsigned char *RIPEMD160(const unsigned char *d, size_t n, unsigned char *md);
void RIPEMD160_Transform(RIPEMD160_CTX *c, const unsigned char *b);
#ifdef __cplusplus
}
#endif
#endif

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,162 @@
/*
* Generated by util/mkerr.pl DO NOT EDIT
* Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/license.html
*/
#ifndef HEADER_RSAERR_H
# define HEADER_RSAERR_H
# ifdef __cplusplus
extern "C"
# endif
int ERR_load_RSA_strings(void);
/*
* RSA function codes.
*/
# define RSA_F_CHECK_PADDING_MD 140
# define RSA_F_ENCODE_PKCS1 146
# define RSA_F_INT_RSA_VERIFY 145
# define RSA_F_OLD_RSA_PRIV_DECODE 147
# define RSA_F_PKEY_PSS_INIT 165
# define RSA_F_PKEY_RSA_CTRL 143
# define RSA_F_PKEY_RSA_CTRL_STR 144
# define RSA_F_PKEY_RSA_SIGN 142
# define RSA_F_PKEY_RSA_VERIFY 149
# define RSA_F_PKEY_RSA_VERIFYRECOVER 141
# define RSA_F_RSA_ALGOR_TO_MD 156
# define RSA_F_RSA_BUILTIN_KEYGEN 129
# define RSA_F_RSA_CHECK_KEY 123
# define RSA_F_RSA_CHECK_KEY_EX 160
# define RSA_F_RSA_CMS_DECRYPT 159
# define RSA_F_RSA_CMS_VERIFY 158
# define RSA_F_RSA_ITEM_VERIFY 148
# define RSA_F_RSA_METH_DUP 161
# define RSA_F_RSA_METH_NEW 162
# define RSA_F_RSA_METH_SET1_NAME 163
# define RSA_F_RSA_MGF1_TO_MD 157
# define RSA_F_RSA_MULTIP_INFO_NEW 166
# define RSA_F_RSA_NEW_METHOD 106
# define RSA_F_RSA_NULL 124
# define RSA_F_RSA_NULL_PRIVATE_DECRYPT 132
# define RSA_F_RSA_NULL_PRIVATE_ENCRYPT 133
# define RSA_F_RSA_NULL_PUBLIC_DECRYPT 134
# define RSA_F_RSA_NULL_PUBLIC_ENCRYPT 135
# define RSA_F_RSA_OSSL_PRIVATE_DECRYPT 101
# define RSA_F_RSA_OSSL_PRIVATE_ENCRYPT 102
# define RSA_F_RSA_OSSL_PUBLIC_DECRYPT 103
# define RSA_F_RSA_OSSL_PUBLIC_ENCRYPT 104
# define RSA_F_RSA_PADDING_ADD_NONE 107
# define RSA_F_RSA_PADDING_ADD_PKCS1_OAEP 121
# define RSA_F_RSA_PADDING_ADD_PKCS1_OAEP_MGF1 154
# define RSA_F_RSA_PADDING_ADD_PKCS1_PSS 125
# define RSA_F_RSA_PADDING_ADD_PKCS1_PSS_MGF1 152
# define RSA_F_RSA_PADDING_ADD_PKCS1_TYPE_1 108
# define RSA_F_RSA_PADDING_ADD_PKCS1_TYPE_2 109
# define RSA_F_RSA_PADDING_ADD_SSLV23 110
# define RSA_F_RSA_PADDING_ADD_X931 127
# define RSA_F_RSA_PADDING_CHECK_NONE 111
# define RSA_F_RSA_PADDING_CHECK_PKCS1_OAEP 122
# define RSA_F_RSA_PADDING_CHECK_PKCS1_OAEP_MGF1 153
# define RSA_F_RSA_PADDING_CHECK_PKCS1_TYPE_1 112
# define RSA_F_RSA_PADDING_CHECK_PKCS1_TYPE_2 113
# define RSA_F_RSA_PADDING_CHECK_SSLV23 114
# define RSA_F_RSA_PADDING_CHECK_X931 128
# define RSA_F_RSA_PARAM_DECODE 164
# define RSA_F_RSA_PRINT 115
# define RSA_F_RSA_PRINT_FP 116
# define RSA_F_RSA_PRIV_DECODE 150
# define RSA_F_RSA_PRIV_ENCODE 138
# define RSA_F_RSA_PSS_GET_PARAM 151
# define RSA_F_RSA_PSS_TO_CTX 155
# define RSA_F_RSA_PUB_DECODE 139
# define RSA_F_RSA_SETUP_BLINDING 136
# define RSA_F_RSA_SIGN 117
# define RSA_F_RSA_SIGN_ASN1_OCTET_STRING 118
# define RSA_F_RSA_VERIFY 119
# define RSA_F_RSA_VERIFY_ASN1_OCTET_STRING 120
# define RSA_F_RSA_VERIFY_PKCS1_PSS_MGF1 126
# define RSA_F_SETUP_TBUF 167
/*
* RSA reason codes.
*/
# define RSA_R_ALGORITHM_MISMATCH 100
# define RSA_R_BAD_E_VALUE 101
# define RSA_R_BAD_FIXED_HEADER_DECRYPT 102
# define RSA_R_BAD_PAD_BYTE_COUNT 103
# define RSA_R_BAD_SIGNATURE 104
# define RSA_R_BLOCK_TYPE_IS_NOT_01 106
# define RSA_R_BLOCK_TYPE_IS_NOT_02 107
# define RSA_R_DATA_GREATER_THAN_MOD_LEN 108
# define RSA_R_DATA_TOO_LARGE 109
# define RSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE 110
# define RSA_R_DATA_TOO_LARGE_FOR_MODULUS 132
# define RSA_R_DATA_TOO_SMALL 111
# define RSA_R_DATA_TOO_SMALL_FOR_KEY_SIZE 122
# define RSA_R_DIGEST_DOES_NOT_MATCH 158
# define RSA_R_DIGEST_NOT_ALLOWED 145
# define RSA_R_DIGEST_TOO_BIG_FOR_RSA_KEY 112
# define RSA_R_DMP1_NOT_CONGRUENT_TO_D 124
# define RSA_R_DMQ1_NOT_CONGRUENT_TO_D 125
# define RSA_R_D_E_NOT_CONGRUENT_TO_1 123
# define RSA_R_FIRST_OCTET_INVALID 133
# define RSA_R_ILLEGAL_OR_UNSUPPORTED_PADDING_MODE 144
# define RSA_R_INVALID_DIGEST 157
# define RSA_R_INVALID_DIGEST_LENGTH 143
# define RSA_R_INVALID_HEADER 137
# define RSA_R_INVALID_LABEL 160
# define RSA_R_INVALID_MESSAGE_LENGTH 131
# define RSA_R_INVALID_MGF1_MD 156
# define RSA_R_INVALID_MULTI_PRIME_KEY 167
# define RSA_R_INVALID_OAEP_PARAMETERS 161
# define RSA_R_INVALID_PADDING 138
# define RSA_R_INVALID_PADDING_MODE 141
# define RSA_R_INVALID_PSS_PARAMETERS 149
# define RSA_R_INVALID_PSS_SALTLEN 146
# define RSA_R_INVALID_SALT_LENGTH 150
# define RSA_R_INVALID_TRAILER 139
# define RSA_R_INVALID_X931_DIGEST 142
# define RSA_R_IQMP_NOT_INVERSE_OF_Q 126
# define RSA_R_KEY_PRIME_NUM_INVALID 165
# define RSA_R_KEY_SIZE_TOO_SMALL 120
# define RSA_R_LAST_OCTET_INVALID 134
# define RSA_R_MGF1_DIGEST_NOT_ALLOWED 152
# define RSA_R_MODULUS_TOO_LARGE 105
# define RSA_R_MP_COEFFICIENT_NOT_INVERSE_OF_R 168
# define RSA_R_MP_EXPONENT_NOT_CONGRUENT_TO_D 169
# define RSA_R_MP_R_NOT_PRIME 170
# define RSA_R_NO_PUBLIC_EXPONENT 140
# define RSA_R_NULL_BEFORE_BLOCK_MISSING 113
# define RSA_R_N_DOES_NOT_EQUAL_PRODUCT_OF_PRIMES 172
# define RSA_R_N_DOES_NOT_EQUAL_P_Q 127
# define RSA_R_OAEP_DECODING_ERROR 121
# define RSA_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE 148
# define RSA_R_PADDING_CHECK_FAILED 114
# define RSA_R_PKCS_DECODING_ERROR 159
# define RSA_R_PSS_SALTLEN_TOO_SMALL 164
# define RSA_R_P_NOT_PRIME 128
# define RSA_R_Q_NOT_PRIME 129
# define RSA_R_RSA_OPERATIONS_NOT_SUPPORTED 130
# define RSA_R_SLEN_CHECK_FAILED 136
# define RSA_R_SLEN_RECOVERY_FAILED 135
# define RSA_R_SSLV3_ROLLBACK_ATTACK 115
# define RSA_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD 116
# define RSA_R_UNKNOWN_ALGORITHM_TYPE 117
# define RSA_R_UNKNOWN_DIGEST 166
# define RSA_R_UNKNOWN_MASK_DIGEST 151
# define RSA_R_UNKNOWN_PADDING_TYPE 118
# define RSA_R_UNSUPPORTED_ENCRYPTION_TYPE 162
# define RSA_R_UNSUPPORTED_LABEL_SOURCE 163
# define RSA_R_UNSUPPORTED_MASK_ALGORITHM 153
# define RSA_R_UNSUPPORTED_MASK_PARAMETER 154
# define RSA_R_UNSUPPORTED_SIGNATURE_TYPE 155
# define RSA_R_VALUE_MISSING 147
# define RSA_R_WRONG_SIGNATURE_LENGTH 119
#endif

File diff suppressed because it is too large Load Diff

View File

@ -1,149 +1,96 @@
/* /*
* Copyright (c) 2007 KISA(Korea Information Security Agency). All rights reserved. * Copyright 2007-2016 The OpenSSL Project Authors. All Rights Reserved.
* *
* Redistribution and use in source and binary forms, with or without * Licensed under the OpenSSL license (the "License"). You may not use
* modification, are permitted provided that the following conditions * this file except in compliance with the License. You can obtain a copy
* are met: * in the file LICENSE in the source distribution or at
* 1. Redistributions of source code must retain the above copyright * https://www.openssl.org/source/license.html
* notice, this list of conditions and the following disclaimer. */
* 2. Neither the name of author nor the names of its contributors may
* be used to endorse or promote products derived from this software /*
* without specific prior written permission. * Copyright (c) 2007 KISA(Korea Information Security Agency). All rights reserved.
* *
* THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND * Redistribution and use in source and binary forms, with or without
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * modification, are permitted provided that the following conditions
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * are met:
* ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE * 1. Redistributions of source code must retain the above copyright
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * notice, this list of conditions and the following disclaimer.
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * 2. Neither the name of author nor the names of its contributors may
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * be used to endorse or promote products derived from this software
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * without specific prior written permission.
* 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 * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* SUCH DAMAGE. * 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 AUTHOR OR CONTRIBUTORS BE LIABLE
/* ==================================================================== * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* Copyright (c) 1998-2007 The OpenSSL Project. All rights reserved. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* Redistribution and use in source and binary forms, with or without * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* modification, are permitted provided that the following conditions * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* are met: * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* * SUCH DAMAGE.
* 1. Redistributions of source code must retain the above copyright */
* notice, this list of conditions and the following disclaimer.
* #ifndef HEADER_SEED_H
* 2. Redistributions in binary form must reproduce the above copyright # define HEADER_SEED_H
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the # include <openssl/opensslconf.h>
* distribution.
* # ifndef OPENSSL_NO_SEED
* 3. All advertising materials mentioning features or use of this # include <openssl/e_os2.h>
* software must display the following acknowledgment: # include <openssl/crypto.h>
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit. (http://www.openssl.org/)" #ifdef __cplusplus
* extern "C" {
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to #endif
* endorse or promote products derived from this software without
* prior written permission. For written permission, please contact /* look whether we need 'long' to get 32 bits */
* openssl-core@openssl.org. # ifdef AES_LONG
* # ifndef SEED_LONG
* 5. Products derived from this software may not be called "OpenSSL" # define SEED_LONG 1
* nor may "OpenSSL" appear in their names without prior written # endif
* permission of the OpenSSL Project. # endif
*
* 6. Redistributions of any form whatsoever must retain the following # include <sys/types.h>
* acknowledgment:
* "This product includes software developed by the OpenSSL Project # define SEED_BLOCK_SIZE 16
* for use in the OpenSSL Toolkit (http://www.openssl.org/)" # define SEED_KEY_LENGTH 16
*
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY typedef struct seed_key_st {
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # ifdef SEED_LONG
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR unsigned long data[32];
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR # else
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, unsigned int data[32];
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT # endif
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; } SEED_KEY_SCHEDULE;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, void SEED_set_key(const unsigned char rawkey[SEED_KEY_LENGTH],
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) SEED_KEY_SCHEDULE *ks);
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE. void SEED_encrypt(const unsigned char s[SEED_BLOCK_SIZE],
* ==================================================================== unsigned char d[SEED_BLOCK_SIZE],
* const SEED_KEY_SCHEDULE *ks);
* This product includes cryptographic software written by Eric Young void SEED_decrypt(const unsigned char s[SEED_BLOCK_SIZE],
* (eay@cryptsoft.com). This product includes software written by Tim unsigned char d[SEED_BLOCK_SIZE],
* Hudson (tjh@cryptsoft.com). const SEED_KEY_SCHEDULE *ks);
*
*/ void SEED_ecb_encrypt(const unsigned char *in, unsigned char *out,
const SEED_KEY_SCHEDULE *ks, int enc);
#ifndef HEADER_SEED_H void SEED_cbc_encrypt(const unsigned char *in, unsigned char *out, size_t len,
# define HEADER_SEED_H const SEED_KEY_SCHEDULE *ks,
unsigned char ivec[SEED_BLOCK_SIZE], int enc);
# include <openssl/opensslconf.h> void SEED_cfb128_encrypt(const unsigned char *in, unsigned char *out,
# include <openssl/e_os2.h> size_t len, const SEED_KEY_SCHEDULE *ks,
# include <openssl/crypto.h> unsigned char ivec[SEED_BLOCK_SIZE], int *num,
int enc);
# ifdef OPENSSL_NO_SEED void SEED_ofb128_encrypt(const unsigned char *in, unsigned char *out,
# error SEED is disabled. size_t len, const SEED_KEY_SCHEDULE *ks,
# endif unsigned char ivec[SEED_BLOCK_SIZE], int *num);
/* look whether we need 'long' to get 32 bits */ # ifdef __cplusplus
# ifdef AES_LONG }
# ifndef SEED_LONG # endif
# define SEED_LONG 1 # endif
# endif
# endif #endif
# if !defined(NO_SYS_TYPES_H)
# include <sys/types.h>
# endif
# define SEED_BLOCK_SIZE 16
# define SEED_KEY_LENGTH 16
#ifdef __cplusplus
extern "C" {
#endif
typedef struct seed_key_st {
# ifdef SEED_LONG
unsigned long data[32];
# else
unsigned int data[32];
# endif
} SEED_KEY_SCHEDULE;
# ifdef OPENSSL_FIPS
void private_SEED_set_key(const unsigned char rawkey[SEED_KEY_LENGTH],
SEED_KEY_SCHEDULE *ks);
# endif
void SEED_set_key(const unsigned char rawkey[SEED_KEY_LENGTH],
SEED_KEY_SCHEDULE *ks);
void SEED_encrypt(const unsigned char s[SEED_BLOCK_SIZE],
unsigned char d[SEED_BLOCK_SIZE],
const SEED_KEY_SCHEDULE *ks);
void SEED_decrypt(const unsigned char s[SEED_BLOCK_SIZE],
unsigned char d[SEED_BLOCK_SIZE],
const SEED_KEY_SCHEDULE *ks);
void SEED_ecb_encrypt(const unsigned char *in, unsigned char *out,
const SEED_KEY_SCHEDULE *ks, int enc);
void SEED_cbc_encrypt(const unsigned char *in, unsigned char *out, size_t len,
const SEED_KEY_SCHEDULE *ks,
unsigned char ivec[SEED_BLOCK_SIZE], int enc);
void SEED_cfb128_encrypt(const unsigned char *in, unsigned char *out,
size_t len, const SEED_KEY_SCHEDULE *ks,
unsigned char ivec[SEED_BLOCK_SIZE], int *num,
int enc);
void SEED_ofb128_encrypt(const unsigned char *in, unsigned char *out,
size_t len, const SEED_KEY_SCHEDULE *ks,
unsigned char ivec[SEED_BLOCK_SIZE], int *num);
#ifdef __cplusplus
}
#endif
#endif /* HEADER_SEED_H */

View File

@ -1,214 +1,119 @@
/* crypto/sha/sha.h */ /*
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
* All rights reserved. *
* * Licensed under the OpenSSL license (the "License"). You may not use
* This package is an SSL implementation written * this file except in compliance with the License. You can obtain a copy
* by Eric Young (eay@cryptsoft.com). * in the file LICENSE in the source distribution or at
* The implementation was written so as to conform with Netscapes SSL. * https://www.openssl.org/source/license.html
* */
* This library is free for commercial and non-commercial use as long as
* the following conditions are aheared to. The following conditions #ifndef HEADER_SHA_H
* apply to all code found in this distribution, be it the RC4, RSA, # define HEADER_SHA_H
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
* included with this distribution is covered by the same copyright terms # include <openssl/e_os2.h>
* except that the holder is Tim Hudson (tjh@cryptsoft.com). # include <stddef.h>
*
* Copyright remains Eric Young's, and as such any Copyright notices in #ifdef __cplusplus
* the code are not to be removed. extern "C" {
* If this package is used in a product, Eric Young should be given attribution #endif
* 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. * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* * ! SHA_LONG has to be at least 32 bits wide. !
* Redistribution and use in source and binary forms, with or without * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* modification, are permitted provided that the following conditions */
* are met: # define SHA_LONG unsigned int
* 1. Redistributions of source code must retain the copyright
* notice, this list of conditions and the following disclaimer. # define SHA_LBLOCK 16
* 2. Redistributions in binary form must reproduce the above copyright # define SHA_CBLOCK (SHA_LBLOCK*4)/* SHA treats input data as a
* notice, this list of conditions and the following disclaimer in the * contiguous array of 32 bit wide
* documentation and/or other materials provided with the distribution. * big-endian values. */
* 3. All advertising materials mentioning features or use of this software # define SHA_LAST_BLOCK (SHA_CBLOCK-8)
* must display the following acknowledgement: # define SHA_DIGEST_LENGTH 20
* "This product includes cryptographic software written by
* Eric Young (eay@cryptsoft.com)" typedef struct SHAstate_st {
* The word 'cryptographic' can be left out if the rouines from the library SHA_LONG h0, h1, h2, h3, h4;
* being used are not cryptographic related :-). SHA_LONG Nl, Nh;
* 4. If you include any Windows specific code (or a derivative thereof) from SHA_LONG data[SHA_LBLOCK];
* the apps directory (application code) you must include an acknowledgement: unsigned int num;
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" } SHA_CTX;
*
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND int SHA1_Init(SHA_CTX *c);
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE int SHA1_Update(SHA_CTX *c, const void *data, size_t len);
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE int SHA1_Final(unsigned char *md, SHA_CTX *c);
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE unsigned char *SHA1(const unsigned char *d, size_t n, unsigned char *md);
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL void SHA1_Transform(SHA_CTX *c, const unsigned char *data);
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) # define SHA256_CBLOCK (SHA_LBLOCK*4)/* SHA-256 treats input data as a
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * contiguous array of 32 bit wide
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * big-endian values. */
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. typedef struct SHA256state_st {
* SHA_LONG h[8];
* The licence and distribution terms for any publically available version or SHA_LONG Nl, Nh;
* derivative of this code cannot be changed. i.e. this code cannot simply be SHA_LONG data[SHA_LBLOCK];
* copied and put under another distribution licence unsigned int num, md_len;
* [including the GNU Public Licence.] } SHA256_CTX;
*/
int SHA224_Init(SHA256_CTX *c);
#ifndef HEADER_SHA_H int SHA224_Update(SHA256_CTX *c, const void *data, size_t len);
# define HEADER_SHA_H int SHA224_Final(unsigned char *md, SHA256_CTX *c);
unsigned char *SHA224(const unsigned char *d, size_t n, unsigned char *md);
# include <openssl/e_os2.h> int SHA256_Init(SHA256_CTX *c);
# include <stddef.h> int SHA256_Update(SHA256_CTX *c, const void *data, size_t len);
int SHA256_Final(unsigned char *md, SHA256_CTX *c);
#ifdef __cplusplus unsigned char *SHA256(const unsigned char *d, size_t n, unsigned char *md);
extern "C" { void SHA256_Transform(SHA256_CTX *c, const unsigned char *data);
#endif
# define SHA224_DIGEST_LENGTH 28
# if defined(OPENSSL_NO_SHA) || (defined(OPENSSL_NO_SHA0) && defined(OPENSSL_NO_SHA1)) # define SHA256_DIGEST_LENGTH 32
# error SHA is disabled. # define SHA384_DIGEST_LENGTH 48
# endif # define SHA512_DIGEST_LENGTH 64
# if defined(OPENSSL_FIPS) /*
# define FIPS_SHA_SIZE_T size_t * Unlike 32-bit digest algorithms, SHA-512 *relies* on SHA_LONG64
# endif * being exactly 64-bit wide. See Implementation Notes in sha512.c
* for further details.
/*- */
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! /*
* ! SHA_LONG has to be at least 32 bits wide. If it's wider, then ! * SHA-512 treats input data as a
* ! SHA_LONG_LOG2 has to be defined along. ! * contiguous array of 64 bit
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! * wide big-endian values.
*/ */
# define SHA512_CBLOCK (SHA_LBLOCK*8)
# if defined(__LP32__) # if (defined(_WIN32) || defined(_WIN64)) && !defined(__MINGW32__)
# define SHA_LONG unsigned long # define SHA_LONG64 unsigned __int64
# elif defined(OPENSSL_SYS_CRAY) || defined(__ILP64__) # define U64(C) C##UI64
# define SHA_LONG unsigned long # elif defined(__arch64__)
# define SHA_LONG_LOG2 3 # define SHA_LONG64 unsigned long
# else # define U64(C) C##UL
# define SHA_LONG unsigned int # else
# endif # define SHA_LONG64 unsigned long long
# define U64(C) C##ULL
# define SHA_LBLOCK 16 # endif
# define SHA_CBLOCK (SHA_LBLOCK*4)/* SHA treats input data as a
* contiguous array of 32 bit wide typedef struct SHA512state_st {
* big-endian values. */ SHA_LONG64 h[8];
# define SHA_LAST_BLOCK (SHA_CBLOCK-8) SHA_LONG64 Nl, Nh;
# define SHA_DIGEST_LENGTH 20 union {
SHA_LONG64 d[SHA_LBLOCK];
typedef struct SHAstate_st { unsigned char p[SHA512_CBLOCK];
SHA_LONG h0, h1, h2, h3, h4; } u;
SHA_LONG Nl, Nh; unsigned int num, md_len;
SHA_LONG data[SHA_LBLOCK]; } SHA512_CTX;
unsigned int num;
} SHA_CTX; int SHA384_Init(SHA512_CTX *c);
int SHA384_Update(SHA512_CTX *c, const void *data, size_t len);
# ifndef OPENSSL_NO_SHA0 int SHA384_Final(unsigned char *md, SHA512_CTX *c);
# ifdef OPENSSL_FIPS unsigned char *SHA384(const unsigned char *d, size_t n, unsigned char *md);
int private_SHA_Init(SHA_CTX *c); int SHA512_Init(SHA512_CTX *c);
# endif int SHA512_Update(SHA512_CTX *c, const void *data, size_t len);
int SHA_Init(SHA_CTX *c); int SHA512_Final(unsigned char *md, SHA512_CTX *c);
int SHA_Update(SHA_CTX *c, const void *data, size_t len); unsigned char *SHA512(const unsigned char *d, size_t n, unsigned char *md);
int SHA_Final(unsigned char *md, SHA_CTX *c); void SHA512_Transform(SHA512_CTX *c, const unsigned char *data);
unsigned char *SHA(const unsigned char *d, size_t n, unsigned char *md);
void SHA_Transform(SHA_CTX *c, const unsigned char *data); #ifdef __cplusplus
# endif }
# ifndef OPENSSL_NO_SHA1 #endif
# ifdef OPENSSL_FIPS
int private_SHA1_Init(SHA_CTX *c); #endif
# endif
int SHA1_Init(SHA_CTX *c);
int SHA1_Update(SHA_CTX *c, const void *data, size_t len);
int SHA1_Final(unsigned char *md, SHA_CTX *c);
unsigned char *SHA1(const unsigned char *d, size_t n, unsigned char *md);
void SHA1_Transform(SHA_CTX *c, const unsigned char *data);
# endif
# define SHA256_CBLOCK (SHA_LBLOCK*4)/* SHA-256 treats input data as a
* contiguous array of 32 bit wide
* big-endian values. */
# define SHA224_DIGEST_LENGTH 28
# define SHA256_DIGEST_LENGTH 32
typedef struct SHA256state_st {
SHA_LONG h[8];
SHA_LONG Nl, Nh;
SHA_LONG data[SHA_LBLOCK];
unsigned int num, md_len;
} SHA256_CTX;
# ifndef OPENSSL_NO_SHA256
# ifdef OPENSSL_FIPS
int private_SHA224_Init(SHA256_CTX *c);
int private_SHA256_Init(SHA256_CTX *c);
# endif
int SHA224_Init(SHA256_CTX *c);
int SHA224_Update(SHA256_CTX *c, const void *data, size_t len);
int SHA224_Final(unsigned char *md, SHA256_CTX *c);
unsigned char *SHA224(const unsigned char *d, size_t n, unsigned char *md);
int SHA256_Init(SHA256_CTX *c);
int SHA256_Update(SHA256_CTX *c, const void *data, size_t len);
int SHA256_Final(unsigned char *md, SHA256_CTX *c);
unsigned char *SHA256(const unsigned char *d, size_t n, unsigned char *md);
void SHA256_Transform(SHA256_CTX *c, const unsigned char *data);
# endif
# define SHA384_DIGEST_LENGTH 48
# define SHA512_DIGEST_LENGTH 64
# ifndef OPENSSL_NO_SHA512
/*
* Unlike 32-bit digest algorithms, SHA-512 *relies* on SHA_LONG64
* being exactly 64-bit wide. See Implementation Notes in sha512.c
* for further details.
*/
/*
* SHA-512 treats input data as a
* contiguous array of 64 bit
* wide big-endian values.
*/
# define SHA512_CBLOCK (SHA_LBLOCK*8)
# if (defined(_WIN32) || defined(_WIN64)) && !defined(__MINGW32__)
# define SHA_LONG64 unsigned __int64
# define U64(C) C##UI64
# elif defined(__arch64__)
# define SHA_LONG64 unsigned long
# define U64(C) C##UL
# else
# define SHA_LONG64 unsigned long long
# define U64(C) C##ULL
# endif
typedef struct SHA512state_st {
SHA_LONG64 h[8];
SHA_LONG64 Nl, Nh;
union {
SHA_LONG64 d[SHA_LBLOCK];
unsigned char p[SHA512_CBLOCK];
} u;
unsigned int num, md_len;
} SHA512_CTX;
# endif
# ifndef OPENSSL_NO_SHA512
# ifdef OPENSSL_FIPS
int private_SHA384_Init(SHA512_CTX *c);
int private_SHA512_Init(SHA512_CTX *c);
# endif
int SHA384_Init(SHA512_CTX *c);
int SHA384_Update(SHA512_CTX *c, const void *data, size_t len);
int SHA384_Final(unsigned char *md, SHA512_CTX *c);
unsigned char *SHA384(const unsigned char *d, size_t n, unsigned char *md);
int SHA512_Init(SHA512_CTX *c);
int SHA512_Update(SHA512_CTX *c, const void *data, size_t len);
int SHA512_Final(unsigned char *md, SHA512_CTX *c);
unsigned char *SHA512(const unsigned char *d, size_t n, unsigned char *md);
void SHA512_Transform(SHA512_CTX *c, const unsigned char *data);
# endif
#ifdef __cplusplus
}
#endif
#endif

View File

@ -1,179 +1,135 @@
/* crypto/srp/srp.h */ /*
/* * Copyright 2004-2018 The OpenSSL Project Authors. All Rights Reserved.
* Written by Christophe Renou (christophe.renou@edelweb.fr) with the * Copyright (c) 2004, EdelKey Project. All Rights Reserved.
* precious help of Peter Sylvester (peter.sylvester@edelweb.fr) for the *
* EdelKey project and contributed to the OpenSSL project 2004. * Licensed under the OpenSSL license (the "License"). You may not use
*/ * this file except in compliance with the License. You can obtain a copy
/* ==================================================================== * in the file LICENSE in the source distribution or at
* Copyright (c) 2004 The OpenSSL Project. All rights reserved. * https://www.openssl.org/source/license.html
* *
* Redistribution and use in source and binary forms, with or without * Originally written by Christophe Renou and Peter Sylvester,
* modification, are permitted provided that the following conditions * for the EdelKey project.
* are met: */
*
* 1. Redistributions of source code must retain the above copyright #ifndef HEADER_SRP_H
* notice, this list of conditions and the following disclaimer. # define HEADER_SRP_H
*
* 2. Redistributions in binary form must reproduce the above copyright #include <openssl/opensslconf.h>
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the #ifndef OPENSSL_NO_SRP
* distribution. # include <stdio.h>
* # include <string.h>
* 3. All advertising materials mentioning features or use of this # include <openssl/safestack.h>
* software must display the following acknowledgment: # include <openssl/bn.h>
* "This product includes software developed by the OpenSSL Project # include <openssl/crypto.h>
* for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
* # ifdef __cplusplus
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to extern "C" {
* endorse or promote products derived from this software without # endif
* prior written permission. For written permission, please contact
* licensing@OpenSSL.org. typedef struct SRP_gN_cache_st {
* char *b64_bn;
* 5. Products derived from this software may not be called "OpenSSL" BIGNUM *bn;
* nor may "OpenSSL" appear in their names without prior written } SRP_gN_cache;
* permission of the OpenSSL Project.
*
* 6. Redistributions of any form whatsoever must retain the following DEFINE_STACK_OF(SRP_gN_cache)
* acknowledgment:
* "This product includes software developed by the OpenSSL Project typedef struct SRP_user_pwd_st {
* for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" /* Owned by us. */
* char *id;
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY BIGNUM *s;
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE BIGNUM *v;
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR /* Not owned by us. */
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR const BIGNUM *g;
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, const BIGNUM *N;
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT /* Owned by us. */
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; char *info;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) } SRP_user_pwd;
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) void SRP_user_pwd_free(SRP_user_pwd *user_pwd);
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE. DEFINE_STACK_OF(SRP_user_pwd)
* ====================================================================
* typedef struct SRP_VBASE_st {
* This product includes cryptographic software written by Eric Young STACK_OF(SRP_user_pwd) *users_pwd;
* (eay@cryptsoft.com). This product includes software written by Tim STACK_OF(SRP_gN_cache) *gN_cache;
* Hudson (tjh@cryptsoft.com). /* to simulate a user */
* char *seed_key;
*/ const BIGNUM *default_g;
#ifndef __SRP_H__ const BIGNUM *default_N;
# define __SRP_H__ } SRP_VBASE;
# ifndef OPENSSL_NO_SRP /*
* Internal structure storing N and g pair
# include <stdio.h> */
# include <string.h> typedef struct SRP_gN_st {
char *id;
#ifdef __cplusplus const BIGNUM *g;
extern "C" { const BIGNUM *N;
#endif } SRP_gN;
# include <openssl/safestack.h> DEFINE_STACK_OF(SRP_gN)
# include <openssl/bn.h>
# include <openssl/crypto.h> SRP_VBASE *SRP_VBASE_new(char *seed_key);
void SRP_VBASE_free(SRP_VBASE *vb);
typedef struct SRP_gN_cache_st { int SRP_VBASE_init(SRP_VBASE *vb, char *verifier_file);
char *b64_bn;
BIGNUM *bn; /* This method ignores the configured seed and fails for an unknown user. */
} SRP_gN_cache; DEPRECATEDIN_1_1_0(SRP_user_pwd *SRP_VBASE_get_by_user(SRP_VBASE *vb, char *username))
/* NOTE: unlike in SRP_VBASE_get_by_user, caller owns the returned pointer.*/
SRP_user_pwd *SRP_VBASE_get1_by_user(SRP_VBASE *vb, char *username);
DECLARE_STACK_OF(SRP_gN_cache)
char *SRP_create_verifier(const char *user, const char *pass, char **salt,
typedef struct SRP_user_pwd_st { char **verifier, const char *N, const char *g);
/* Owned by us. */ int SRP_create_verifier_BN(const char *user, const char *pass, BIGNUM **salt,
char *id; BIGNUM **verifier, const BIGNUM *N,
BIGNUM *s; const BIGNUM *g);
BIGNUM *v;
/* Not owned by us. */ # define SRP_NO_ERROR 0
const BIGNUM *g; # define SRP_ERR_VBASE_INCOMPLETE_FILE 1
const BIGNUM *N; # define SRP_ERR_VBASE_BN_LIB 2
/* Owned by us. */ # define SRP_ERR_OPEN_FILE 3
char *info; # define SRP_ERR_MEMORY 4
} SRP_user_pwd;
# define DB_srptype 0
DECLARE_STACK_OF(SRP_user_pwd) # define DB_srpverifier 1
# define DB_srpsalt 2
void SRP_user_pwd_free(SRP_user_pwd *user_pwd); # define DB_srpid 3
# define DB_srpgN 4
typedef struct SRP_VBASE_st { # define DB_srpinfo 5
STACK_OF(SRP_user_pwd) *users_pwd; # undef DB_NUMBER
STACK_OF(SRP_gN_cache) *gN_cache; # define DB_NUMBER 6
/* to simulate a user */
char *seed_key; # define DB_SRP_INDEX 'I'
BIGNUM *default_g; # define DB_SRP_VALID 'V'
BIGNUM *default_N; # define DB_SRP_REVOKED 'R'
} SRP_VBASE; # define DB_SRP_MODIF 'v'
/* /* see srp.c */
* Structure interne pour retenir les couples N et g char *SRP_check_known_gN_param(const BIGNUM *g, const BIGNUM *N);
*/ SRP_gN *SRP_get_default_gN(const char *id);
typedef struct SRP_gN_st {
char *id; /* server side .... */
BIGNUM *g; BIGNUM *SRP_Calc_server_key(const BIGNUM *A, const BIGNUM *v, const BIGNUM *u,
BIGNUM *N; const BIGNUM *b, const BIGNUM *N);
} SRP_gN; BIGNUM *SRP_Calc_B(const BIGNUM *b, const BIGNUM *N, const BIGNUM *g,
const BIGNUM *v);
DECLARE_STACK_OF(SRP_gN) int SRP_Verify_A_mod_N(const BIGNUM *A, const BIGNUM *N);
BIGNUM *SRP_Calc_u(const BIGNUM *A, const BIGNUM *B, const BIGNUM *N);
SRP_VBASE *SRP_VBASE_new(char *seed_key);
int SRP_VBASE_free(SRP_VBASE *vb); /* client side .... */
int SRP_VBASE_init(SRP_VBASE *vb, char *verifier_file); BIGNUM *SRP_Calc_x(const BIGNUM *s, const char *user, const char *pass);
BIGNUM *SRP_Calc_A(const BIGNUM *a, const BIGNUM *N, const BIGNUM *g);
/* This method ignores the configured seed and fails for an unknown user. */ BIGNUM *SRP_Calc_client_key(const BIGNUM *N, const BIGNUM *B, const BIGNUM *g,
SRP_user_pwd *SRP_VBASE_get_by_user(SRP_VBASE *vb, char *username); const BIGNUM *x, const BIGNUM *a, const BIGNUM *u);
/* NOTE: unlike in SRP_VBASE_get_by_user, caller owns the returned pointer.*/ int SRP_Verify_B_mod_N(const BIGNUM *B, const BIGNUM *N);
SRP_user_pwd *SRP_VBASE_get1_by_user(SRP_VBASE *vb, char *username);
# define SRP_MINIMAL_N 1024
char *SRP_create_verifier(const char *user, const char *pass, char **salt,
char **verifier, const char *N, const char *g); # ifdef __cplusplus
int SRP_create_verifier_BN(const char *user, const char *pass, BIGNUM **salt, }
BIGNUM **verifier, BIGNUM *N, BIGNUM *g); # endif
# endif
# define SRP_NO_ERROR 0
# define SRP_ERR_VBASE_INCOMPLETE_FILE 1 #endif
# define SRP_ERR_VBASE_BN_LIB 2
# define SRP_ERR_OPEN_FILE 3
# define SRP_ERR_MEMORY 4
# define DB_srptype 0
# define DB_srpverifier 1
# define DB_srpsalt 2
# define DB_srpid 3
# define DB_srpgN 4
# define DB_srpinfo 5
# undef DB_NUMBER
# define DB_NUMBER 6
# define DB_SRP_INDEX 'I'
# define DB_SRP_VALID 'V'
# define DB_SRP_REVOKED 'R'
# define DB_SRP_MODIF 'v'
/* see srp.c */
char *SRP_check_known_gN_param(BIGNUM *g, BIGNUM *N);
SRP_gN *SRP_get_default_gN(const char *id);
/* server side .... */
BIGNUM *SRP_Calc_server_key(BIGNUM *A, BIGNUM *v, BIGNUM *u, BIGNUM *b,
BIGNUM *N);
BIGNUM *SRP_Calc_B(BIGNUM *b, BIGNUM *N, BIGNUM *g, BIGNUM *v);
int SRP_Verify_A_mod_N(BIGNUM *A, BIGNUM *N);
BIGNUM *SRP_Calc_u(BIGNUM *A, BIGNUM *B, BIGNUM *N);
/* client side .... */
BIGNUM *SRP_Calc_x(BIGNUM *s, const char *user, const char *pass);
BIGNUM *SRP_Calc_A(BIGNUM *a, BIGNUM *N, BIGNUM *g);
BIGNUM *SRP_Calc_client_key(BIGNUM *N, BIGNUM *B, BIGNUM *g, BIGNUM *x,
BIGNUM *a, BIGNUM *u);
int SRP_Verify_B_mod_N(BIGNUM *B, BIGNUM *N);
# define SRP_MINIMAL_N 1024
#ifdef __cplusplus
}
#endif
# endif
#endif

View File

@ -1,147 +1,50 @@
/* ssl/srtp.h */ /*
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * Copyright 2011-2016 The OpenSSL Project Authors. All Rights Reserved.
* All rights reserved. *
* * Licensed under the OpenSSL license (the "License"). You may not use
* This package is an SSL implementation written * this file except in compliance with the License. You can obtain a copy
* by Eric Young (eay@cryptsoft.com). * in the file LICENSE in the source distribution or at
* The implementation was written so as to conform with Netscapes SSL. * https://www.openssl.org/source/license.html
* */
* 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, * DTLS code by Eric Rescorla <ekr@rtfm.com>
* lhash, DES, etc., code; not just the SSL code. The SSL documentation *
* included with this distribution is covered by the same copyright terms * Copyright (C) 2006, Network Resonance, Inc. Copyright (C) 2011, RTFM, Inc.
* except that the holder is Tim Hudson (tjh@cryptsoft.com). */
*
* Copyright remains Eric Young's, and as such any Copyright notices in #ifndef HEADER_D1_SRTP_H
* the code are not to be removed. # define HEADER_D1_SRTP_H
* If this package is used in a product, Eric Young should be given attribution
* as the author of the parts of the library used. # include <openssl/ssl.h>
* This can be in the form of a textual message at program startup or
* in documentation (online or textual) provided with the package. #ifdef __cplusplus
* extern "C" {
* Redistribution and use in source and binary forms, with or without #endif
* modification, are permitted provided that the following conditions
* are met: # define SRTP_AES128_CM_SHA1_80 0x0001
* 1. Redistributions of source code must retain the copyright # define SRTP_AES128_CM_SHA1_32 0x0002
* notice, this list of conditions and the following disclaimer. # define SRTP_AES128_F8_SHA1_80 0x0003
* 2. Redistributions in binary form must reproduce the above copyright # define SRTP_AES128_F8_SHA1_32 0x0004
* notice, this list of conditions and the following disclaimer in the # define SRTP_NULL_SHA1_80 0x0005
* documentation and/or other materials provided with the distribution. # define SRTP_NULL_SHA1_32 0x0006
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement: /* AEAD SRTP protection profiles from RFC 7714 */
* "This product includes cryptographic software written by # define SRTP_AEAD_AES_128_GCM 0x0007
* Eric Young (eay@cryptsoft.com)" # define SRTP_AEAD_AES_256_GCM 0x0008
* The word 'cryptographic' can be left out if the rouines from the library
* being used are not cryptographic related :-). # ifndef OPENSSL_NO_SRTP
* 4. If you include any Windows specific code (or a derivative thereof) from
* the apps directory (application code) you must include an acknowledgement: __owur int SSL_CTX_set_tlsext_use_srtp(SSL_CTX *ctx, const char *profiles);
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" __owur int SSL_set_tlsext_use_srtp(SSL *ssl, const char *profiles);
*
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND __owur STACK_OF(SRTP_PROTECTION_PROFILE) *SSL_get_srtp_profiles(SSL *ssl);
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE __owur SRTP_PROTECTION_PROFILE *SSL_get_selected_srtp_profile(SSL *s);
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE # endif
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS #ifdef __cplusplus
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) }
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT #endif
* 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 #endif
* 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.]
*/
/* ====================================================================
* Copyright (c) 1998-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.
* ====================================================================
*
* This product includes cryptographic software written by Eric Young
* (eay@cryptsoft.com). This product includes software written by Tim
* Hudson (tjh@cryptsoft.com).
*
*/
/*
* DTLS code by Eric Rescorla <ekr@rtfm.com>
*
* Copyright (C) 2006, Network Resonance, Inc. Copyright (C) 2011, RTFM, Inc.
*/
#ifndef HEADER_D1_SRTP_H
# define HEADER_D1_SRTP_H
# include <openssl/ssl.h>
#ifdef __cplusplus
extern "C" {
#endif
# define SRTP_AES128_CM_SHA1_80 0x0001
# define SRTP_AES128_CM_SHA1_32 0x0002
# define SRTP_AES128_F8_SHA1_80 0x0003
# define SRTP_AES128_F8_SHA1_32 0x0004
# define SRTP_NULL_SHA1_80 0x0005
# define SRTP_NULL_SHA1_32 0x0006
# ifndef OPENSSL_NO_SRTP
int SSL_CTX_set_tlsext_use_srtp(SSL_CTX *ctx, const char *profiles);
int SSL_set_tlsext_use_srtp(SSL *ctx, const char *profiles);
STACK_OF(SRTP_PROTECTION_PROFILE) *SSL_get_srtp_profiles(SSL *ssl);
SRTP_PROTECTION_PROFILE *SSL_get_selected_srtp_profile(SSL *s);
# endif
#ifdef __cplusplus
}
#endif
#endif

File diff suppressed because it is too large Load Diff

View File

@ -1,265 +1,24 @@
/* ssl/ssl2.h */ /*
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
* All rights reserved. *
* * Licensed under the OpenSSL license (the "License"). You may not use
* This package is an SSL implementation written * this file except in compliance with the License. You can obtain a copy
* by Eric Young (eay@cryptsoft.com). * in the file LICENSE in the source distribution or at
* The implementation was written so as to conform with Netscapes SSL. * https://www.openssl.org/source/license.html
* */
* This library is free for commercial and non-commercial use as long as
* the following conditions are aheared to. The following conditions #ifndef HEADER_SSL2_H
* apply to all code found in this distribution, be it the RC4, RSA, # define HEADER_SSL2_H
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
* included with this distribution is covered by the same copyright terms #ifdef __cplusplus
* except that the holder is Tim Hudson (tjh@cryptsoft.com). extern "C" {
* #endif
* Copyright remains Eric Young's, and as such any Copyright notices in
* the code are not to be removed. # define SSL2_VERSION 0x0002
* If this package is used in a product, Eric Young should be given attribution
* as the author of the parts of the library used. # define SSL2_MT_CLIENT_HELLO 1
* This can be in the form of a textual message at program startup or
* in documentation (online or textual) provided with the package. #ifdef __cplusplus
* }
* Redistribution and use in source and binary forms, with or without #endif
* modification, are permitted provided that the following conditions #endif
* 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_SSL2_H
# define HEADER_SSL2_H
#ifdef __cplusplus
extern "C" {
#endif
/* Protocol Version Codes */
# define SSL2_VERSION 0x0002
# define SSL2_VERSION_MAJOR 0x00
# define SSL2_VERSION_MINOR 0x02
/* #define SSL2_CLIENT_VERSION 0x0002 */
/* #define SSL2_SERVER_VERSION 0x0002 */
/* Protocol Message Codes */
# define SSL2_MT_ERROR 0
# define SSL2_MT_CLIENT_HELLO 1
# define SSL2_MT_CLIENT_MASTER_KEY 2
# define SSL2_MT_CLIENT_FINISHED 3
# define SSL2_MT_SERVER_HELLO 4
# define SSL2_MT_SERVER_VERIFY 5
# define SSL2_MT_SERVER_FINISHED 6
# define SSL2_MT_REQUEST_CERTIFICATE 7
# define SSL2_MT_CLIENT_CERTIFICATE 8
/* Error Message Codes */
# define SSL2_PE_UNDEFINED_ERROR 0x0000
# define SSL2_PE_NO_CIPHER 0x0001
# define SSL2_PE_NO_CERTIFICATE 0x0002
# define SSL2_PE_BAD_CERTIFICATE 0x0004
# define SSL2_PE_UNSUPPORTED_CERTIFICATE_TYPE 0x0006
/* Cipher Kind Values */
# define SSL2_CK_NULL_WITH_MD5 0x02000000/* v3 */
# define SSL2_CK_RC4_128_WITH_MD5 0x02010080
# define SSL2_CK_RC4_128_EXPORT40_WITH_MD5 0x02020080
# define SSL2_CK_RC2_128_CBC_WITH_MD5 0x02030080
# define SSL2_CK_RC2_128_CBC_EXPORT40_WITH_MD5 0x02040080
# define SSL2_CK_IDEA_128_CBC_WITH_MD5 0x02050080
# define SSL2_CK_DES_64_CBC_WITH_MD5 0x02060040
# define SSL2_CK_DES_64_CBC_WITH_SHA 0x02060140/* v3 */
# define SSL2_CK_DES_192_EDE3_CBC_WITH_MD5 0x020700c0
# define SSL2_CK_DES_192_EDE3_CBC_WITH_SHA 0x020701c0/* v3 */
# define SSL2_CK_RC4_64_WITH_MD5 0x02080080/* MS hack */
# define SSL2_CK_DES_64_CFB64_WITH_MD5_1 0x02ff0800/* SSLeay */
# define SSL2_CK_NULL 0x02ff0810/* SSLeay */
# define SSL2_TXT_DES_64_CFB64_WITH_MD5_1 "DES-CFB-M1"
# define SSL2_TXT_NULL_WITH_MD5 "NULL-MD5"
# define SSL2_TXT_RC4_128_WITH_MD5 "RC4-MD5"
# define SSL2_TXT_RC4_128_EXPORT40_WITH_MD5 "EXP-RC4-MD5"
# define SSL2_TXT_RC2_128_CBC_WITH_MD5 "RC2-CBC-MD5"
# define SSL2_TXT_RC2_128_CBC_EXPORT40_WITH_MD5 "EXP-RC2-CBC-MD5"
# define SSL2_TXT_IDEA_128_CBC_WITH_MD5 "IDEA-CBC-MD5"
# define SSL2_TXT_DES_64_CBC_WITH_MD5 "DES-CBC-MD5"
# define SSL2_TXT_DES_64_CBC_WITH_SHA "DES-CBC-SHA"
# define SSL2_TXT_DES_192_EDE3_CBC_WITH_MD5 "DES-CBC3-MD5"
# define SSL2_TXT_DES_192_EDE3_CBC_WITH_SHA "DES-CBC3-SHA"
# define SSL2_TXT_RC4_64_WITH_MD5 "RC4-64-MD5"
# define SSL2_TXT_NULL "NULL"
/* Flags for the SSL_CIPHER.algorithm2 field */
# define SSL2_CF_5_BYTE_ENC 0x01
# define SSL2_CF_8_BYTE_ENC 0x02
/* Certificate Type Codes */
# define SSL2_CT_X509_CERTIFICATE 0x01
/* Authentication Type Code */
# define SSL2_AT_MD5_WITH_RSA_ENCRYPTION 0x01
# define SSL2_MAX_SSL_SESSION_ID_LENGTH 32
/* Upper/Lower Bounds */
# define SSL2_MAX_MASTER_KEY_LENGTH_IN_BITS 256
# ifdef OPENSSL_SYS_MPE
# define SSL2_MAX_RECORD_LENGTH_2_BYTE_HEADER 29998u
# else
# define SSL2_MAX_RECORD_LENGTH_2_BYTE_HEADER 32767u
/* 2^15-1 */
# endif
# define SSL2_MAX_RECORD_LENGTH_3_BYTE_HEADER 16383/* 2^14-1 */
# define SSL2_CHALLENGE_LENGTH 16
/*
* #define SSL2_CHALLENGE_LENGTH 32
*/
# define SSL2_MIN_CHALLENGE_LENGTH 16
# define SSL2_MAX_CHALLENGE_LENGTH 32
# define SSL2_CONNECTION_ID_LENGTH 16
# define SSL2_MAX_CONNECTION_ID_LENGTH 16
# define SSL2_SSL_SESSION_ID_LENGTH 16
# define SSL2_MAX_CERT_CHALLENGE_LENGTH 32
# define SSL2_MIN_CERT_CHALLENGE_LENGTH 16
# define SSL2_MAX_KEY_MATERIAL_LENGTH 24
# ifndef HEADER_SSL_LOCL_H
# define CERT char
# endif
# ifndef OPENSSL_NO_SSL_INTERN
typedef struct ssl2_state_st {
int three_byte_header;
int clear_text; /* clear text */
int escape; /* not used in SSLv2 */
int ssl2_rollback; /* used if SSLv23 rolled back to SSLv2 */
/*
* non-blocking io info, used to make sure the same args were passwd
*/
unsigned int wnum; /* number of bytes sent so far */
int wpend_tot;
const unsigned char *wpend_buf;
int wpend_off; /* offset to data to write */
int wpend_len; /* number of bytes passwd to write */
int wpend_ret; /* number of bytes to return to caller */
/* buffer raw data */
int rbuf_left;
int rbuf_offs;
unsigned char *rbuf;
unsigned char *wbuf;
unsigned char *write_ptr; /* used to point to the start due to 2/3 byte
* header. */
unsigned int padding;
unsigned int rlength; /* passed to ssl2_enc */
int ract_data_length; /* Set when things are encrypted. */
unsigned int wlength; /* passed to ssl2_enc */
int wact_data_length; /* Set when things are decrypted. */
unsigned char *ract_data;
unsigned char *wact_data;
unsigned char *mac_data;
unsigned char *read_key;
unsigned char *write_key;
/* Stuff specifically to do with this SSL session */
unsigned int challenge_length;
unsigned char challenge[SSL2_MAX_CHALLENGE_LENGTH];
unsigned int conn_id_length;
unsigned char conn_id[SSL2_MAX_CONNECTION_ID_LENGTH];
unsigned int key_material_length;
unsigned char key_material[SSL2_MAX_KEY_MATERIAL_LENGTH * 2];
unsigned long read_sequence;
unsigned long write_sequence;
struct {
unsigned int conn_id_length;
unsigned int cert_type;
unsigned int cert_length;
unsigned int csl;
unsigned int clear;
unsigned int enc;
unsigned char ccl[SSL2_MAX_CERT_CHALLENGE_LENGTH];
unsigned int cipher_spec_length;
unsigned int session_id_length;
unsigned int clen;
unsigned int rlen;
} tmp;
} SSL2_STATE;
# endif
/* SSLv2 */
/* client */
# define SSL2_ST_SEND_CLIENT_HELLO_A (0x10|SSL_ST_CONNECT)
# define SSL2_ST_SEND_CLIENT_HELLO_B (0x11|SSL_ST_CONNECT)
# define SSL2_ST_GET_SERVER_HELLO_A (0x20|SSL_ST_CONNECT)
# define SSL2_ST_GET_SERVER_HELLO_B (0x21|SSL_ST_CONNECT)
# define SSL2_ST_SEND_CLIENT_MASTER_KEY_A (0x30|SSL_ST_CONNECT)
# define SSL2_ST_SEND_CLIENT_MASTER_KEY_B (0x31|SSL_ST_CONNECT)
# define SSL2_ST_SEND_CLIENT_FINISHED_A (0x40|SSL_ST_CONNECT)
# define SSL2_ST_SEND_CLIENT_FINISHED_B (0x41|SSL_ST_CONNECT)
# define SSL2_ST_SEND_CLIENT_CERTIFICATE_A (0x50|SSL_ST_CONNECT)
# define SSL2_ST_SEND_CLIENT_CERTIFICATE_B (0x51|SSL_ST_CONNECT)
# define SSL2_ST_SEND_CLIENT_CERTIFICATE_C (0x52|SSL_ST_CONNECT)
# define SSL2_ST_SEND_CLIENT_CERTIFICATE_D (0x53|SSL_ST_CONNECT)
# define SSL2_ST_GET_SERVER_VERIFY_A (0x60|SSL_ST_CONNECT)
# define SSL2_ST_GET_SERVER_VERIFY_B (0x61|SSL_ST_CONNECT)
# define SSL2_ST_GET_SERVER_FINISHED_A (0x70|SSL_ST_CONNECT)
# define SSL2_ST_GET_SERVER_FINISHED_B (0x71|SSL_ST_CONNECT)
# define SSL2_ST_CLIENT_START_ENCRYPTION (0x80|SSL_ST_CONNECT)
# define SSL2_ST_X509_GET_CLIENT_CERTIFICATE (0x90|SSL_ST_CONNECT)
/* server */
# define SSL2_ST_GET_CLIENT_HELLO_A (0x10|SSL_ST_ACCEPT)
# define SSL2_ST_GET_CLIENT_HELLO_B (0x11|SSL_ST_ACCEPT)
# define SSL2_ST_GET_CLIENT_HELLO_C (0x12|SSL_ST_ACCEPT)
# define SSL2_ST_SEND_SERVER_HELLO_A (0x20|SSL_ST_ACCEPT)
# define SSL2_ST_SEND_SERVER_HELLO_B (0x21|SSL_ST_ACCEPT)
# define SSL2_ST_GET_CLIENT_MASTER_KEY_A (0x30|SSL_ST_ACCEPT)
# define SSL2_ST_GET_CLIENT_MASTER_KEY_B (0x31|SSL_ST_ACCEPT)
# define SSL2_ST_SEND_SERVER_VERIFY_A (0x40|SSL_ST_ACCEPT)
# define SSL2_ST_SEND_SERVER_VERIFY_B (0x41|SSL_ST_ACCEPT)
# define SSL2_ST_SEND_SERVER_VERIFY_C (0x42|SSL_ST_ACCEPT)
# define SSL2_ST_GET_CLIENT_FINISHED_A (0x50|SSL_ST_ACCEPT)
# define SSL2_ST_GET_CLIENT_FINISHED_B (0x51|SSL_ST_ACCEPT)
# define SSL2_ST_SEND_SERVER_FINISHED_A (0x60|SSL_ST_ACCEPT)
# define SSL2_ST_SEND_SERVER_FINISHED_B (0x61|SSL_ST_ACCEPT)
# define SSL2_ST_SEND_REQUEST_CERTIFICATE_A (0x70|SSL_ST_ACCEPT)
# define SSL2_ST_SEND_REQUEST_CERTIFICATE_B (0x71|SSL_ST_ACCEPT)
# define SSL2_ST_SEND_REQUEST_CERTIFICATE_C (0x72|SSL_ST_ACCEPT)
# define SSL2_ST_SEND_REQUEST_CERTIFICATE_D (0x73|SSL_ST_ACCEPT)
# define SSL2_ST_SERVER_START_ENCRYPTION (0x80|SSL_ST_ACCEPT)
# define SSL2_ST_X509_GET_SERVER_CERTIFICATE (0x90|SSL_ST_ACCEPT)
#ifdef __cplusplus
}
#endif
#endif

View File

@ -1,84 +0,0 @@
/* ssl/ssl23.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_SSL23_H
# define HEADER_SSL23_H
#ifdef __cplusplus
extern "C" {
#endif
/*
* client
*/
/* write to server */
# define SSL23_ST_CW_CLNT_HELLO_A (0x210|SSL_ST_CONNECT)
# define SSL23_ST_CW_CLNT_HELLO_B (0x211|SSL_ST_CONNECT)
/* read from server */
# define SSL23_ST_CR_SRVR_HELLO_A (0x220|SSL_ST_CONNECT)
# define SSL23_ST_CR_SRVR_HELLO_B (0x221|SSL_ST_CONNECT)
/* server */
/* read from client */
# define SSL23_ST_SR_CLNT_HELLO_A (0x210|SSL_ST_ACCEPT)
# define SSL23_ST_SR_CLNT_HELLO_B (0x211|SSL_ST_ACCEPT)
#ifdef __cplusplus
}
#endif
#endif

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,767 @@
/*
* Generated by util/mkerr.pl DO NOT EDIT
* Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/license.html
*/
#ifndef HEADER_SSLERR_H
# define HEADER_SSLERR_H
# ifdef __cplusplus
extern "C"
# endif
int ERR_load_SSL_strings(void);
/*
* SSL function codes.
*/
# define SSL_F_ADD_CLIENT_KEY_SHARE_EXT 438
# define SSL_F_ADD_KEY_SHARE 512
# define SSL_F_BYTES_TO_CIPHER_LIST 519
# define SSL_F_CHECK_SUITEB_CIPHER_LIST 331
# define SSL_F_CIPHERSUITE_CB 622
# define SSL_F_CONSTRUCT_CA_NAMES 552
# define SSL_F_CONSTRUCT_KEY_EXCHANGE_TBS 553
# define SSL_F_CONSTRUCT_STATEFUL_TICKET 636
# define SSL_F_CONSTRUCT_STATELESS_TICKET 637
# define SSL_F_CREATE_SYNTHETIC_MESSAGE_HASH 539
# define SSL_F_CREATE_TICKET_PREQUEL 638
# define SSL_F_CT_MOVE_SCTS 345
# define SSL_F_CT_STRICT 349
# define SSL_F_CUSTOM_EXT_ADD 554
# define SSL_F_CUSTOM_EXT_PARSE 555
# define SSL_F_D2I_SSL_SESSION 103
# define SSL_F_DANE_CTX_ENABLE 347
# define SSL_F_DANE_MTYPE_SET 393
# define SSL_F_DANE_TLSA_ADD 394
# define SSL_F_DERIVE_SECRET_KEY_AND_IV 514
# define SSL_F_DO_DTLS1_WRITE 245
# define SSL_F_DO_SSL3_WRITE 104
# define SSL_F_DTLS1_BUFFER_RECORD 247
# define SSL_F_DTLS1_CHECK_TIMEOUT_NUM 318
# define SSL_F_DTLS1_HEARTBEAT 305
# define SSL_F_DTLS1_HM_FRAGMENT_NEW 623
# define SSL_F_DTLS1_PREPROCESS_FRAGMENT 288
# define SSL_F_DTLS1_PROCESS_BUFFERED_RECORDS 424
# define SSL_F_DTLS1_PROCESS_RECORD 257
# define SSL_F_DTLS1_READ_BYTES 258
# define SSL_F_DTLS1_READ_FAILED 339
# define SSL_F_DTLS1_RETRANSMIT_MESSAGE 390
# define SSL_F_DTLS1_WRITE_APP_DATA_BYTES 268
# define SSL_F_DTLS1_WRITE_BYTES 545
# define SSL_F_DTLSV1_LISTEN 350
# define SSL_F_DTLS_CONSTRUCT_CHANGE_CIPHER_SPEC 371
# define SSL_F_DTLS_CONSTRUCT_HELLO_VERIFY_REQUEST 385
# define SSL_F_DTLS_GET_REASSEMBLED_MESSAGE 370
# define SSL_F_DTLS_PROCESS_HELLO_VERIFY 386
# define SSL_F_DTLS_RECORD_LAYER_NEW 635
# define SSL_F_DTLS_WAIT_FOR_DRY 592
# define SSL_F_EARLY_DATA_COUNT_OK 532
# define SSL_F_FINAL_EARLY_DATA 556
# define SSL_F_FINAL_EC_PT_FORMATS 485
# define SSL_F_FINAL_EMS 486
# define SSL_F_FINAL_KEY_SHARE 503
# define SSL_F_FINAL_MAXFRAGMENTLEN 557
# define SSL_F_FINAL_RENEGOTIATE 483
# define SSL_F_FINAL_SERVER_NAME 558
# define SSL_F_FINAL_SIG_ALGS 497
# define SSL_F_GET_CERT_VERIFY_TBS_DATA 588
# define SSL_F_NSS_KEYLOG_INT 500
# define SSL_F_OPENSSL_INIT_SSL 342
# define SSL_F_OSSL_STATEM_CLIENT13_READ_TRANSITION 436
# define SSL_F_OSSL_STATEM_CLIENT13_WRITE_TRANSITION 598
# define SSL_F_OSSL_STATEM_CLIENT_CONSTRUCT_MESSAGE 430
# define SSL_F_OSSL_STATEM_CLIENT_POST_PROCESS_MESSAGE 593
# define SSL_F_OSSL_STATEM_CLIENT_PROCESS_MESSAGE 594
# define SSL_F_OSSL_STATEM_CLIENT_READ_TRANSITION 417
# define SSL_F_OSSL_STATEM_CLIENT_WRITE_TRANSITION 599
# define SSL_F_OSSL_STATEM_SERVER13_READ_TRANSITION 437
# define SSL_F_OSSL_STATEM_SERVER13_WRITE_TRANSITION 600
# define SSL_F_OSSL_STATEM_SERVER_CONSTRUCT_MESSAGE 431
# define SSL_F_OSSL_STATEM_SERVER_POST_PROCESS_MESSAGE 601
# define SSL_F_OSSL_STATEM_SERVER_POST_WORK 602
# define SSL_F_OSSL_STATEM_SERVER_PROCESS_MESSAGE 603
# define SSL_F_OSSL_STATEM_SERVER_READ_TRANSITION 418
# define SSL_F_OSSL_STATEM_SERVER_WRITE_TRANSITION 604
# define SSL_F_PARSE_CA_NAMES 541
# define SSL_F_PITEM_NEW 624
# define SSL_F_PQUEUE_NEW 625
# define SSL_F_PROCESS_KEY_SHARE_EXT 439
# define SSL_F_READ_STATE_MACHINE 352
# define SSL_F_SET_CLIENT_CIPHERSUITE 540
# define SSL_F_SRP_GENERATE_CLIENT_MASTER_SECRET 595
# define SSL_F_SRP_GENERATE_SERVER_MASTER_SECRET 589
# define SSL_F_SRP_VERIFY_SERVER_PARAM 596
# define SSL_F_SSL3_CHANGE_CIPHER_STATE 129
# define SSL_F_SSL3_CHECK_CERT_AND_ALGORITHM 130
# define SSL_F_SSL3_CTRL 213
# define SSL_F_SSL3_CTX_CTRL 133
# define SSL_F_SSL3_DIGEST_CACHED_RECORDS 293
# define SSL_F_SSL3_DO_CHANGE_CIPHER_SPEC 292
# define SSL_F_SSL3_ENC 608
# define SSL_F_SSL3_FINAL_FINISH_MAC 285
# define SSL_F_SSL3_FINISH_MAC 587
# define SSL_F_SSL3_GENERATE_KEY_BLOCK 238
# define SSL_F_SSL3_GENERATE_MASTER_SECRET 388
# define SSL_F_SSL3_GET_RECORD 143
# define SSL_F_SSL3_INIT_FINISHED_MAC 397
# define SSL_F_SSL3_OUTPUT_CERT_CHAIN 147
# define SSL_F_SSL3_READ_BYTES 148
# define SSL_F_SSL3_READ_N 149
# define SSL_F_SSL3_SETUP_KEY_BLOCK 157
# define SSL_F_SSL3_SETUP_READ_BUFFER 156
# define SSL_F_SSL3_SETUP_WRITE_BUFFER 291
# define SSL_F_SSL3_WRITE_BYTES 158
# define SSL_F_SSL3_WRITE_PENDING 159
# define SSL_F_SSL_ADD_CERT_CHAIN 316
# define SSL_F_SSL_ADD_CERT_TO_BUF 319
# define SSL_F_SSL_ADD_CERT_TO_WPACKET 493
# define SSL_F_SSL_ADD_CLIENTHELLO_RENEGOTIATE_EXT 298
# define SSL_F_SSL_ADD_CLIENTHELLO_TLSEXT 277
# define SSL_F_SSL_ADD_CLIENTHELLO_USE_SRTP_EXT 307
# define SSL_F_SSL_ADD_DIR_CERT_SUBJECTS_TO_STACK 215
# define SSL_F_SSL_ADD_FILE_CERT_SUBJECTS_TO_STACK 216
# define SSL_F_SSL_ADD_SERVERHELLO_RENEGOTIATE_EXT 299
# define SSL_F_SSL_ADD_SERVERHELLO_TLSEXT 278
# define SSL_F_SSL_ADD_SERVERHELLO_USE_SRTP_EXT 308
# define SSL_F_SSL_BAD_METHOD 160
# define SSL_F_SSL_BUILD_CERT_CHAIN 332
# define SSL_F_SSL_BYTES_TO_CIPHER_LIST 161
# define SSL_F_SSL_CACHE_CIPHERLIST 520
# define SSL_F_SSL_CERT_ADD0_CHAIN_CERT 346
# define SSL_F_SSL_CERT_DUP 221
# define SSL_F_SSL_CERT_NEW 162
# define SSL_F_SSL_CERT_SET0_CHAIN 340
# define SSL_F_SSL_CHECK_PRIVATE_KEY 163
# define SSL_F_SSL_CHECK_SERVERHELLO_TLSEXT 280
# define SSL_F_SSL_CHECK_SRP_EXT_CLIENTHELLO 606
# define SSL_F_SSL_CHECK_SRVR_ECC_CERT_AND_ALG 279
# define SSL_F_SSL_CHOOSE_CLIENT_VERSION 607
# define SSL_F_SSL_CIPHER_DESCRIPTION 626
# define SSL_F_SSL_CIPHER_LIST_TO_BYTES 425
# define SSL_F_SSL_CIPHER_PROCESS_RULESTR 230
# define SSL_F_SSL_CIPHER_STRENGTH_SORT 231
# define SSL_F_SSL_CLEAR 164
# define SSL_F_SSL_CLIENT_HELLO_GET1_EXTENSIONS_PRESENT 627
# define SSL_F_SSL_COMP_ADD_COMPRESSION_METHOD 165
# define SSL_F_SSL_CONF_CMD 334
# define SSL_F_SSL_CREATE_CIPHER_LIST 166
# define SSL_F_SSL_CTRL 232
# define SSL_F_SSL_CTX_CHECK_PRIVATE_KEY 168
# define SSL_F_SSL_CTX_ENABLE_CT 398
# define SSL_F_SSL_CTX_MAKE_PROFILES 309
# define SSL_F_SSL_CTX_NEW 169
# define SSL_F_SSL_CTX_SET_ALPN_PROTOS 343
# define SSL_F_SSL_CTX_SET_CIPHER_LIST 269
# define SSL_F_SSL_CTX_SET_CLIENT_CERT_ENGINE 290
# define SSL_F_SSL_CTX_SET_CT_VALIDATION_CALLBACK 396
# define SSL_F_SSL_CTX_SET_SESSION_ID_CONTEXT 219
# define SSL_F_SSL_CTX_SET_SSL_VERSION 170
# define SSL_F_SSL_CTX_SET_TLSEXT_MAX_FRAGMENT_LENGTH 551
# define SSL_F_SSL_CTX_USE_CERTIFICATE 171
# define SSL_F_SSL_CTX_USE_CERTIFICATE_ASN1 172
# define SSL_F_SSL_CTX_USE_CERTIFICATE_FILE 173
# define SSL_F_SSL_CTX_USE_PRIVATEKEY 174
# define SSL_F_SSL_CTX_USE_PRIVATEKEY_ASN1 175
# define SSL_F_SSL_CTX_USE_PRIVATEKEY_FILE 176
# define SSL_F_SSL_CTX_USE_PSK_IDENTITY_HINT 272
# define SSL_F_SSL_CTX_USE_RSAPRIVATEKEY 177
# define SSL_F_SSL_CTX_USE_RSAPRIVATEKEY_ASN1 178
# define SSL_F_SSL_CTX_USE_RSAPRIVATEKEY_FILE 179
# define SSL_F_SSL_CTX_USE_SERVERINFO 336
# define SSL_F_SSL_CTX_USE_SERVERINFO_EX 543
# define SSL_F_SSL_CTX_USE_SERVERINFO_FILE 337
# define SSL_F_SSL_DANE_DUP 403
# define SSL_F_SSL_DANE_ENABLE 395
# define SSL_F_SSL_DERIVE 590
# define SSL_F_SSL_DO_CONFIG 391
# define SSL_F_SSL_DO_HANDSHAKE 180
# define SSL_F_SSL_DUP_CA_LIST 408
# define SSL_F_SSL_ENABLE_CT 402
# define SSL_F_SSL_GENERATE_PKEY_GROUP 559
# define SSL_F_SSL_GENERATE_SESSION_ID 547
# define SSL_F_SSL_GET_NEW_SESSION 181
# define SSL_F_SSL_GET_PREV_SESSION 217
# define SSL_F_SSL_GET_SERVER_CERT_INDEX 322
# define SSL_F_SSL_GET_SIGN_PKEY 183
# define SSL_F_SSL_HANDSHAKE_HASH 560
# define SSL_F_SSL_INIT_WBIO_BUFFER 184
# define SSL_F_SSL_KEY_UPDATE 515
# define SSL_F_SSL_LOAD_CLIENT_CA_FILE 185
# define SSL_F_SSL_LOG_MASTER_SECRET 498
# define SSL_F_SSL_LOG_RSA_CLIENT_KEY_EXCHANGE 499
# define SSL_F_SSL_MODULE_INIT 392
# define SSL_F_SSL_NEW 186
# define SSL_F_SSL_NEXT_PROTO_VALIDATE 565
# define SSL_F_SSL_PARSE_CLIENTHELLO_RENEGOTIATE_EXT 300
# define SSL_F_SSL_PARSE_CLIENTHELLO_TLSEXT 302
# define SSL_F_SSL_PARSE_CLIENTHELLO_USE_SRTP_EXT 310
# define SSL_F_SSL_PARSE_SERVERHELLO_RENEGOTIATE_EXT 301
# define SSL_F_SSL_PARSE_SERVERHELLO_TLSEXT 303
# define SSL_F_SSL_PARSE_SERVERHELLO_USE_SRTP_EXT 311
# define SSL_F_SSL_PEEK 270
# define SSL_F_SSL_PEEK_EX 432
# define SSL_F_SSL_PEEK_INTERNAL 522
# define SSL_F_SSL_READ 223
# define SSL_F_SSL_READ_EARLY_DATA 529
# define SSL_F_SSL_READ_EX 434
# define SSL_F_SSL_READ_INTERNAL 523
# define SSL_F_SSL_RENEGOTIATE 516
# define SSL_F_SSL_RENEGOTIATE_ABBREVIATED 546
# define SSL_F_SSL_SCAN_CLIENTHELLO_TLSEXT 320
# define SSL_F_SSL_SCAN_SERVERHELLO_TLSEXT 321
# define SSL_F_SSL_SESSION_DUP 348
# define SSL_F_SSL_SESSION_NEW 189
# define SSL_F_SSL_SESSION_PRINT_FP 190
# define SSL_F_SSL_SESSION_SET1_ID 423
# define SSL_F_SSL_SESSION_SET1_ID_CONTEXT 312
# define SSL_F_SSL_SET_ALPN_PROTOS 344
# define SSL_F_SSL_SET_CERT 191
# define SSL_F_SSL_SET_CERT_AND_KEY 621
# define SSL_F_SSL_SET_CIPHER_LIST 271
# define SSL_F_SSL_SET_CT_VALIDATION_CALLBACK 399
# define SSL_F_SSL_SET_FD 192
# define SSL_F_SSL_SET_PKEY 193
# define SSL_F_SSL_SET_RFD 194
# define SSL_F_SSL_SET_SESSION 195
# define SSL_F_SSL_SET_SESSION_ID_CONTEXT 218
# define SSL_F_SSL_SET_SESSION_TICKET_EXT 294
# define SSL_F_SSL_SET_TLSEXT_MAX_FRAGMENT_LENGTH 550
# define SSL_F_SSL_SET_WFD 196
# define SSL_F_SSL_SHUTDOWN 224
# define SSL_F_SSL_SRP_CTX_INIT 313
# define SSL_F_SSL_START_ASYNC_JOB 389
# define SSL_F_SSL_UNDEFINED_FUNCTION 197
# define SSL_F_SSL_UNDEFINED_VOID_FUNCTION 244
# define SSL_F_SSL_USE_CERTIFICATE 198
# define SSL_F_SSL_USE_CERTIFICATE_ASN1 199
# define SSL_F_SSL_USE_CERTIFICATE_FILE 200
# define SSL_F_SSL_USE_PRIVATEKEY 201
# define SSL_F_SSL_USE_PRIVATEKEY_ASN1 202
# define SSL_F_SSL_USE_PRIVATEKEY_FILE 203
# define SSL_F_SSL_USE_PSK_IDENTITY_HINT 273
# define SSL_F_SSL_USE_RSAPRIVATEKEY 204
# define SSL_F_SSL_USE_RSAPRIVATEKEY_ASN1 205
# define SSL_F_SSL_USE_RSAPRIVATEKEY_FILE 206
# define SSL_F_SSL_VALIDATE_CT 400
# define SSL_F_SSL_VERIFY_CERT_CHAIN 207
# define SSL_F_SSL_VERIFY_CLIENT_POST_HANDSHAKE 616
# define SSL_F_SSL_WRITE 208
# define SSL_F_SSL_WRITE_EARLY_DATA 526
# define SSL_F_SSL_WRITE_EARLY_FINISH 527
# define SSL_F_SSL_WRITE_EX 433
# define SSL_F_SSL_WRITE_INTERNAL 524
# define SSL_F_STATE_MACHINE 353
# define SSL_F_TLS12_CHECK_PEER_SIGALG 333
# define SSL_F_TLS12_COPY_SIGALGS 533
# define SSL_F_TLS13_CHANGE_CIPHER_STATE 440
# define SSL_F_TLS13_ENC 609
# define SSL_F_TLS13_FINAL_FINISH_MAC 605
# define SSL_F_TLS13_GENERATE_SECRET 591
# define SSL_F_TLS13_HKDF_EXPAND 561
# define SSL_F_TLS13_RESTORE_HANDSHAKE_DIGEST_FOR_PHA 617
# define SSL_F_TLS13_SAVE_HANDSHAKE_DIGEST_FOR_PHA 618
# define SSL_F_TLS13_SETUP_KEY_BLOCK 441
# define SSL_F_TLS1_CHANGE_CIPHER_STATE 209
# define SSL_F_TLS1_CHECK_DUPLICATE_EXTENSIONS 341
# define SSL_F_TLS1_ENC 401
# define SSL_F_TLS1_EXPORT_KEYING_MATERIAL 314
# define SSL_F_TLS1_GET_CURVELIST 338
# define SSL_F_TLS1_PRF 284
# define SSL_F_TLS1_SAVE_U16 628
# define SSL_F_TLS1_SETUP_KEY_BLOCK 211
# define SSL_F_TLS1_SET_GROUPS 629
# define SSL_F_TLS1_SET_RAW_SIGALGS 630
# define SSL_F_TLS1_SET_SERVER_SIGALGS 335
# define SSL_F_TLS1_SET_SHARED_SIGALGS 631
# define SSL_F_TLS1_SET_SIGALGS 632
# define SSL_F_TLS_CHOOSE_SIGALG 513
# define SSL_F_TLS_CLIENT_KEY_EXCHANGE_POST_WORK 354
# define SSL_F_TLS_COLLECT_EXTENSIONS 435
# define SSL_F_TLS_CONSTRUCT_CERTIFICATE_AUTHORITIES 542
# define SSL_F_TLS_CONSTRUCT_CERTIFICATE_REQUEST 372
# define SSL_F_TLS_CONSTRUCT_CERT_STATUS 429
# define SSL_F_TLS_CONSTRUCT_CERT_STATUS_BODY 494
# define SSL_F_TLS_CONSTRUCT_CERT_VERIFY 496
# define SSL_F_TLS_CONSTRUCT_CHANGE_CIPHER_SPEC 427
# define SSL_F_TLS_CONSTRUCT_CKE_DHE 404
# define SSL_F_TLS_CONSTRUCT_CKE_ECDHE 405
# define SSL_F_TLS_CONSTRUCT_CKE_GOST 406
# define SSL_F_TLS_CONSTRUCT_CKE_PSK_PREAMBLE 407
# define SSL_F_TLS_CONSTRUCT_CKE_RSA 409
# define SSL_F_TLS_CONSTRUCT_CKE_SRP 410
# define SSL_F_TLS_CONSTRUCT_CLIENT_CERTIFICATE 484
# define SSL_F_TLS_CONSTRUCT_CLIENT_HELLO 487
# define SSL_F_TLS_CONSTRUCT_CLIENT_KEY_EXCHANGE 488
# define SSL_F_TLS_CONSTRUCT_CLIENT_VERIFY 489
# define SSL_F_TLS_CONSTRUCT_CTOS_ALPN 466
# define SSL_F_TLS_CONSTRUCT_CTOS_CERTIFICATE 355
# define SSL_F_TLS_CONSTRUCT_CTOS_COOKIE 535
# define SSL_F_TLS_CONSTRUCT_CTOS_EARLY_DATA 530
# define SSL_F_TLS_CONSTRUCT_CTOS_EC_PT_FORMATS 467
# define SSL_F_TLS_CONSTRUCT_CTOS_EMS 468
# define SSL_F_TLS_CONSTRUCT_CTOS_ETM 469
# define SSL_F_TLS_CONSTRUCT_CTOS_HELLO 356
# define SSL_F_TLS_CONSTRUCT_CTOS_KEY_EXCHANGE 357
# define SSL_F_TLS_CONSTRUCT_CTOS_KEY_SHARE 470
# define SSL_F_TLS_CONSTRUCT_CTOS_MAXFRAGMENTLEN 549
# define SSL_F_TLS_CONSTRUCT_CTOS_NPN 471
# define SSL_F_TLS_CONSTRUCT_CTOS_PADDING 472
# define SSL_F_TLS_CONSTRUCT_CTOS_POST_HANDSHAKE_AUTH 619
# define SSL_F_TLS_CONSTRUCT_CTOS_PSK 501
# define SSL_F_TLS_CONSTRUCT_CTOS_PSK_KEX_MODES 509
# define SSL_F_TLS_CONSTRUCT_CTOS_RENEGOTIATE 473
# define SSL_F_TLS_CONSTRUCT_CTOS_SCT 474
# define SSL_F_TLS_CONSTRUCT_CTOS_SERVER_NAME 475
# define SSL_F_TLS_CONSTRUCT_CTOS_SESSION_TICKET 476
# define SSL_F_TLS_CONSTRUCT_CTOS_SIG_ALGS 477
# define SSL_F_TLS_CONSTRUCT_CTOS_SRP 478
# define SSL_F_TLS_CONSTRUCT_CTOS_STATUS_REQUEST 479
# define SSL_F_TLS_CONSTRUCT_CTOS_SUPPORTED_GROUPS 480
# define SSL_F_TLS_CONSTRUCT_CTOS_SUPPORTED_VERSIONS 481
# define SSL_F_TLS_CONSTRUCT_CTOS_USE_SRTP 482
# define SSL_F_TLS_CONSTRUCT_CTOS_VERIFY 358
# define SSL_F_TLS_CONSTRUCT_ENCRYPTED_EXTENSIONS 443
# define SSL_F_TLS_CONSTRUCT_END_OF_EARLY_DATA 536
# define SSL_F_TLS_CONSTRUCT_EXTENSIONS 447
# define SSL_F_TLS_CONSTRUCT_FINISHED 359
# define SSL_F_TLS_CONSTRUCT_HELLO_REQUEST 373
# define SSL_F_TLS_CONSTRUCT_HELLO_RETRY_REQUEST 510
# define SSL_F_TLS_CONSTRUCT_KEY_UPDATE 517
# define SSL_F_TLS_CONSTRUCT_NEW_SESSION_TICKET 428
# define SSL_F_TLS_CONSTRUCT_NEXT_PROTO 426
# define SSL_F_TLS_CONSTRUCT_SERVER_CERTIFICATE 490
# define SSL_F_TLS_CONSTRUCT_SERVER_HELLO 491
# define SSL_F_TLS_CONSTRUCT_SERVER_KEY_EXCHANGE 492
# define SSL_F_TLS_CONSTRUCT_STOC_ALPN 451
# define SSL_F_TLS_CONSTRUCT_STOC_CERTIFICATE 374
# define SSL_F_TLS_CONSTRUCT_STOC_COOKIE 613
# define SSL_F_TLS_CONSTRUCT_STOC_CRYPTOPRO_BUG 452
# define SSL_F_TLS_CONSTRUCT_STOC_DONE 375
# define SSL_F_TLS_CONSTRUCT_STOC_EARLY_DATA 531
# define SSL_F_TLS_CONSTRUCT_STOC_EARLY_DATA_INFO 525
# define SSL_F_TLS_CONSTRUCT_STOC_EC_PT_FORMATS 453
# define SSL_F_TLS_CONSTRUCT_STOC_EMS 454
# define SSL_F_TLS_CONSTRUCT_STOC_ETM 455
# define SSL_F_TLS_CONSTRUCT_STOC_HELLO 376
# define SSL_F_TLS_CONSTRUCT_STOC_KEY_EXCHANGE 377
# define SSL_F_TLS_CONSTRUCT_STOC_KEY_SHARE 456
# define SSL_F_TLS_CONSTRUCT_STOC_MAXFRAGMENTLEN 548
# define SSL_F_TLS_CONSTRUCT_STOC_NEXT_PROTO_NEG 457
# define SSL_F_TLS_CONSTRUCT_STOC_PSK 504
# define SSL_F_TLS_CONSTRUCT_STOC_RENEGOTIATE 458
# define SSL_F_TLS_CONSTRUCT_STOC_SERVER_NAME 459
# define SSL_F_TLS_CONSTRUCT_STOC_SESSION_TICKET 460
# define SSL_F_TLS_CONSTRUCT_STOC_STATUS_REQUEST 461
# define SSL_F_TLS_CONSTRUCT_STOC_SUPPORTED_GROUPS 544
# define SSL_F_TLS_CONSTRUCT_STOC_SUPPORTED_VERSIONS 611
# define SSL_F_TLS_CONSTRUCT_STOC_USE_SRTP 462
# define SSL_F_TLS_EARLY_POST_PROCESS_CLIENT_HELLO 521
# define SSL_F_TLS_FINISH_HANDSHAKE 597
# define SSL_F_TLS_GET_MESSAGE_BODY 351
# define SSL_F_TLS_GET_MESSAGE_HEADER 387
# define SSL_F_TLS_HANDLE_ALPN 562
# define SSL_F_TLS_HANDLE_STATUS_REQUEST 563
# define SSL_F_TLS_PARSE_CERTIFICATE_AUTHORITIES 566
# define SSL_F_TLS_PARSE_CLIENTHELLO_TLSEXT 449
# define SSL_F_TLS_PARSE_CTOS_ALPN 567
# define SSL_F_TLS_PARSE_CTOS_COOKIE 614
# define SSL_F_TLS_PARSE_CTOS_EARLY_DATA 568
# define SSL_F_TLS_PARSE_CTOS_EC_PT_FORMATS 569
# define SSL_F_TLS_PARSE_CTOS_EMS 570
# define SSL_F_TLS_PARSE_CTOS_KEY_SHARE 463
# define SSL_F_TLS_PARSE_CTOS_MAXFRAGMENTLEN 571
# define SSL_F_TLS_PARSE_CTOS_POST_HANDSHAKE_AUTH 620
# define SSL_F_TLS_PARSE_CTOS_PSK 505
# define SSL_F_TLS_PARSE_CTOS_PSK_KEX_MODES 572
# define SSL_F_TLS_PARSE_CTOS_RENEGOTIATE 464
# define SSL_F_TLS_PARSE_CTOS_SERVER_NAME 573
# define SSL_F_TLS_PARSE_CTOS_SESSION_TICKET 574
# define SSL_F_TLS_PARSE_CTOS_SIG_ALGS 575
# define SSL_F_TLS_PARSE_CTOS_SIG_ALGS_CERT 615
# define SSL_F_TLS_PARSE_CTOS_SRP 576
# define SSL_F_TLS_PARSE_CTOS_STATUS_REQUEST 577
# define SSL_F_TLS_PARSE_CTOS_SUPPORTED_GROUPS 578
# define SSL_F_TLS_PARSE_CTOS_USE_SRTP 465
# define SSL_F_TLS_PARSE_STOC_ALPN 579
# define SSL_F_TLS_PARSE_STOC_COOKIE 534
# define SSL_F_TLS_PARSE_STOC_EARLY_DATA 538
# define SSL_F_TLS_PARSE_STOC_EARLY_DATA_INFO 528
# define SSL_F_TLS_PARSE_STOC_EC_PT_FORMATS 580
# define SSL_F_TLS_PARSE_STOC_KEY_SHARE 445
# define SSL_F_TLS_PARSE_STOC_MAXFRAGMENTLEN 581
# define SSL_F_TLS_PARSE_STOC_NPN 582
# define SSL_F_TLS_PARSE_STOC_PSK 502
# define SSL_F_TLS_PARSE_STOC_RENEGOTIATE 448
# define SSL_F_TLS_PARSE_STOC_SCT 564
# define SSL_F_TLS_PARSE_STOC_SERVER_NAME 583
# define SSL_F_TLS_PARSE_STOC_SESSION_TICKET 584
# define SSL_F_TLS_PARSE_STOC_STATUS_REQUEST 585
# define SSL_F_TLS_PARSE_STOC_SUPPORTED_VERSIONS 612
# define SSL_F_TLS_PARSE_STOC_USE_SRTP 446
# define SSL_F_TLS_POST_PROCESS_CLIENT_HELLO 378
# define SSL_F_TLS_POST_PROCESS_CLIENT_KEY_EXCHANGE 384
# define SSL_F_TLS_PREPARE_CLIENT_CERTIFICATE 360
# define SSL_F_TLS_PROCESS_AS_HELLO_RETRY_REQUEST 610
# define SSL_F_TLS_PROCESS_CERTIFICATE_REQUEST 361
# define SSL_F_TLS_PROCESS_CERT_STATUS 362
# define SSL_F_TLS_PROCESS_CERT_STATUS_BODY 495
# define SSL_F_TLS_PROCESS_CERT_VERIFY 379
# define SSL_F_TLS_PROCESS_CHANGE_CIPHER_SPEC 363
# define SSL_F_TLS_PROCESS_CKE_DHE 411
# define SSL_F_TLS_PROCESS_CKE_ECDHE 412
# define SSL_F_TLS_PROCESS_CKE_GOST 413
# define SSL_F_TLS_PROCESS_CKE_PSK_PREAMBLE 414
# define SSL_F_TLS_PROCESS_CKE_RSA 415
# define SSL_F_TLS_PROCESS_CKE_SRP 416
# define SSL_F_TLS_PROCESS_CLIENT_CERTIFICATE 380
# define SSL_F_TLS_PROCESS_CLIENT_HELLO 381
# define SSL_F_TLS_PROCESS_CLIENT_KEY_EXCHANGE 382
# define SSL_F_TLS_PROCESS_ENCRYPTED_EXTENSIONS 444
# define SSL_F_TLS_PROCESS_END_OF_EARLY_DATA 537
# define SSL_F_TLS_PROCESS_FINISHED 364
# define SSL_F_TLS_PROCESS_HELLO_REQ 507
# define SSL_F_TLS_PROCESS_HELLO_RETRY_REQUEST 511
# define SSL_F_TLS_PROCESS_INITIAL_SERVER_FLIGHT 442
# define SSL_F_TLS_PROCESS_KEY_EXCHANGE 365
# define SSL_F_TLS_PROCESS_KEY_UPDATE 518
# define SSL_F_TLS_PROCESS_NEW_SESSION_TICKET 366
# define SSL_F_TLS_PROCESS_NEXT_PROTO 383
# define SSL_F_TLS_PROCESS_SERVER_CERTIFICATE 367
# define SSL_F_TLS_PROCESS_SERVER_DONE 368
# define SSL_F_TLS_PROCESS_SERVER_HELLO 369
# define SSL_F_TLS_PROCESS_SKE_DHE 419
# define SSL_F_TLS_PROCESS_SKE_ECDHE 420
# define SSL_F_TLS_PROCESS_SKE_PSK_PREAMBLE 421
# define SSL_F_TLS_PROCESS_SKE_SRP 422
# define SSL_F_TLS_PSK_DO_BINDER 506
# define SSL_F_TLS_SCAN_CLIENTHELLO_TLSEXT 450
# define SSL_F_TLS_SETUP_HANDSHAKE 508
# define SSL_F_USE_CERTIFICATE_CHAIN_FILE 220
# define SSL_F_WPACKET_INTERN_INIT_LEN 633
# define SSL_F_WPACKET_START_SUB_PACKET_LEN__ 634
# define SSL_F_WRITE_STATE_MACHINE 586
/*
* SSL reason codes.
*/
# define SSL_R_APPLICATION_DATA_AFTER_CLOSE_NOTIFY 291
# define SSL_R_APP_DATA_IN_HANDSHAKE 100
# define SSL_R_ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT 272
# define SSL_R_AT_LEAST_TLS_1_0_NEEDED_IN_FIPS_MODE 143
# define SSL_R_AT_LEAST_TLS_1_2_NEEDED_IN_SUITEB_MODE 158
# define SSL_R_BAD_CHANGE_CIPHER_SPEC 103
# define SSL_R_BAD_CIPHER 186
# define SSL_R_BAD_DATA 390
# define SSL_R_BAD_DATA_RETURNED_BY_CALLBACK 106
# define SSL_R_BAD_DECOMPRESSION 107
# define SSL_R_BAD_DH_VALUE 102
# define SSL_R_BAD_DIGEST_LENGTH 111
# define SSL_R_BAD_EARLY_DATA 233
# define SSL_R_BAD_ECC_CERT 304
# define SSL_R_BAD_ECPOINT 306
# define SSL_R_BAD_EXTENSION 110
# define SSL_R_BAD_HANDSHAKE_LENGTH 332
# define SSL_R_BAD_HANDSHAKE_STATE 236
# define SSL_R_BAD_HELLO_REQUEST 105
# define SSL_R_BAD_HRR_VERSION 263
# define SSL_R_BAD_KEY_SHARE 108
# define SSL_R_BAD_KEY_UPDATE 122
# define SSL_R_BAD_LEGACY_VERSION 292
# define SSL_R_BAD_LENGTH 271
# define SSL_R_BAD_PACKET 240
# define SSL_R_BAD_PACKET_LENGTH 115
# define SSL_R_BAD_PROTOCOL_VERSION_NUMBER 116
# define SSL_R_BAD_PSK 219
# define SSL_R_BAD_PSK_IDENTITY 114
# define SSL_R_BAD_RECORD_TYPE 443
# define SSL_R_BAD_RSA_ENCRYPT 119
# define SSL_R_BAD_SIGNATURE 123
# define SSL_R_BAD_SRP_A_LENGTH 347
# define SSL_R_BAD_SRP_PARAMETERS 371
# define SSL_R_BAD_SRTP_MKI_VALUE 352
# define SSL_R_BAD_SRTP_PROTECTION_PROFILE_LIST 353
# define SSL_R_BAD_SSL_FILETYPE 124
# define SSL_R_BAD_VALUE 384
# define SSL_R_BAD_WRITE_RETRY 127
# define SSL_R_BINDER_DOES_NOT_VERIFY 253
# define SSL_R_BIO_NOT_SET 128
# define SSL_R_BLOCK_CIPHER_PAD_IS_WRONG 129
# define SSL_R_BN_LIB 130
# define SSL_R_CALLBACK_FAILED 234
# define SSL_R_CANNOT_CHANGE_CIPHER 109
# define SSL_R_CA_DN_LENGTH_MISMATCH 131
# define SSL_R_CA_KEY_TOO_SMALL 397
# define SSL_R_CA_MD_TOO_WEAK 398
# define SSL_R_CCS_RECEIVED_EARLY 133
# define SSL_R_CERTIFICATE_VERIFY_FAILED 134
# define SSL_R_CERT_CB_ERROR 377
# define SSL_R_CERT_LENGTH_MISMATCH 135
# define SSL_R_CIPHERSUITE_DIGEST_HAS_CHANGED 218
# define SSL_R_CIPHER_CODE_WRONG_LENGTH 137
# define SSL_R_CIPHER_OR_HASH_UNAVAILABLE 138
# define SSL_R_CLIENTHELLO_TLSEXT 226
# define SSL_R_COMPRESSED_LENGTH_TOO_LONG 140
# define SSL_R_COMPRESSION_DISABLED 343
# define SSL_R_COMPRESSION_FAILURE 141
# define SSL_R_COMPRESSION_ID_NOT_WITHIN_PRIVATE_RANGE 307
# define SSL_R_COMPRESSION_LIBRARY_ERROR 142
# define SSL_R_CONNECTION_TYPE_NOT_SET 144
# define SSL_R_CONTEXT_NOT_DANE_ENABLED 167
# define SSL_R_COOKIE_GEN_CALLBACK_FAILURE 400
# define SSL_R_COOKIE_MISMATCH 308
# define SSL_R_CUSTOM_EXT_HANDLER_ALREADY_INSTALLED 206
# define SSL_R_DANE_ALREADY_ENABLED 172
# define SSL_R_DANE_CANNOT_OVERRIDE_MTYPE_FULL 173
# define SSL_R_DANE_NOT_ENABLED 175
# define SSL_R_DANE_TLSA_BAD_CERTIFICATE 180
# define SSL_R_DANE_TLSA_BAD_CERTIFICATE_USAGE 184
# define SSL_R_DANE_TLSA_BAD_DATA_LENGTH 189
# define SSL_R_DANE_TLSA_BAD_DIGEST_LENGTH 192
# define SSL_R_DANE_TLSA_BAD_MATCHING_TYPE 200
# define SSL_R_DANE_TLSA_BAD_PUBLIC_KEY 201
# define SSL_R_DANE_TLSA_BAD_SELECTOR 202
# define SSL_R_DANE_TLSA_NULL_DATA 203
# define SSL_R_DATA_BETWEEN_CCS_AND_FINISHED 145
# define SSL_R_DATA_LENGTH_TOO_LONG 146
# define SSL_R_DECRYPTION_FAILED 147
# define SSL_R_DECRYPTION_FAILED_OR_BAD_RECORD_MAC 281
# define SSL_R_DH_KEY_TOO_SMALL 394
# define SSL_R_DH_PUBLIC_VALUE_LENGTH_IS_WRONG 148
# define SSL_R_DIGEST_CHECK_FAILED 149
# define SSL_R_DTLS_MESSAGE_TOO_BIG 334
# define SSL_R_DUPLICATE_COMPRESSION_ID 309
# define SSL_R_ECC_CERT_NOT_FOR_SIGNING 318
# define SSL_R_ECDH_REQUIRED_FOR_SUITEB_MODE 374
# define SSL_R_EE_KEY_TOO_SMALL 399
# define SSL_R_EMPTY_SRTP_PROTECTION_PROFILE_LIST 354
# define SSL_R_ENCRYPTED_LENGTH_TOO_LONG 150
# define SSL_R_ERROR_IN_RECEIVED_CIPHER_LIST 151
# define SSL_R_ERROR_SETTING_TLSA_BASE_DOMAIN 204
# define SSL_R_EXCEEDS_MAX_FRAGMENT_SIZE 194
# define SSL_R_EXCESSIVE_MESSAGE_SIZE 152
# define SSL_R_EXTENSION_NOT_RECEIVED 279
# define SSL_R_EXTRA_DATA_IN_MESSAGE 153
# define SSL_R_EXT_LENGTH_MISMATCH 163
# define SSL_R_FAILED_TO_INIT_ASYNC 405
# define SSL_R_FRAGMENTED_CLIENT_HELLO 401
# define SSL_R_GOT_A_FIN_BEFORE_A_CCS 154
# define SSL_R_HTTPS_PROXY_REQUEST 155
# define SSL_R_HTTP_REQUEST 156
# define SSL_R_ILLEGAL_POINT_COMPRESSION 162
# define SSL_R_ILLEGAL_SUITEB_DIGEST 380
# define SSL_R_INAPPROPRIATE_FALLBACK 373
# define SSL_R_INCONSISTENT_COMPRESSION 340
# define SSL_R_INCONSISTENT_EARLY_DATA_ALPN 222
# define SSL_R_INCONSISTENT_EARLY_DATA_SNI 231
# define SSL_R_INCONSISTENT_EXTMS 104
# define SSL_R_INSUFFICIENT_SECURITY 241
# define SSL_R_INVALID_ALERT 205
# define SSL_R_INVALID_CCS_MESSAGE 260
# define SSL_R_INVALID_CERTIFICATE_OR_ALG 238
# define SSL_R_INVALID_COMMAND 280
# define SSL_R_INVALID_COMPRESSION_ALGORITHM 341
# define SSL_R_INVALID_CONFIG 283
# define SSL_R_INVALID_CONFIGURATION_NAME 113
# define SSL_R_INVALID_CONTEXT 282
# define SSL_R_INVALID_CT_VALIDATION_TYPE 212
# define SSL_R_INVALID_KEY_UPDATE_TYPE 120
# define SSL_R_INVALID_MAX_EARLY_DATA 174
# define SSL_R_INVALID_NULL_CMD_NAME 385
# define SSL_R_INVALID_SEQUENCE_NUMBER 402
# define SSL_R_INVALID_SERVERINFO_DATA 388
# define SSL_R_INVALID_SESSION_ID 999
# define SSL_R_INVALID_SRP_USERNAME 357
# define SSL_R_INVALID_STATUS_RESPONSE 328
# define SSL_R_INVALID_TICKET_KEYS_LENGTH 325
# define SSL_R_LENGTH_MISMATCH 159
# define SSL_R_LENGTH_TOO_LONG 404
# define SSL_R_LENGTH_TOO_SHORT 160
# define SSL_R_LIBRARY_BUG 274
# define SSL_R_LIBRARY_HAS_NO_CIPHERS 161
# define SSL_R_MISSING_DSA_SIGNING_CERT 165
# define SSL_R_MISSING_ECDSA_SIGNING_CERT 381
# define SSL_R_MISSING_FATAL 256
# define SSL_R_MISSING_PARAMETERS 290
# define SSL_R_MISSING_RSA_CERTIFICATE 168
# define SSL_R_MISSING_RSA_ENCRYPTING_CERT 169
# define SSL_R_MISSING_RSA_SIGNING_CERT 170
# define SSL_R_MISSING_SIGALGS_EXTENSION 112
# define SSL_R_MISSING_SIGNING_CERT 221
# define SSL_R_MISSING_SRP_PARAM 358
# define SSL_R_MISSING_SUPPORTED_GROUPS_EXTENSION 209
# define SSL_R_MISSING_TMP_DH_KEY 171
# define SSL_R_MISSING_TMP_ECDH_KEY 311
# define SSL_R_NOT_ON_RECORD_BOUNDARY 182
# define SSL_R_NOT_REPLACING_CERTIFICATE 289
# define SSL_R_NOT_SERVER 284
# define SSL_R_NO_APPLICATION_PROTOCOL 235
# define SSL_R_NO_CERTIFICATES_RETURNED 176
# define SSL_R_NO_CERTIFICATE_ASSIGNED 177
# define SSL_R_NO_CERTIFICATE_SET 179
# define SSL_R_NO_CHANGE_FOLLOWING_HRR 214
# define SSL_R_NO_CIPHERS_AVAILABLE 181
# define SSL_R_NO_CIPHERS_SPECIFIED 183
# define SSL_R_NO_CIPHER_MATCH 185
# define SSL_R_NO_CLIENT_CERT_METHOD 331
# define SSL_R_NO_COMPRESSION_SPECIFIED 187
# define SSL_R_NO_COOKIE_CALLBACK_SET 287
# define SSL_R_NO_GOST_CERTIFICATE_SENT_BY_PEER 330
# define SSL_R_NO_METHOD_SPECIFIED 188
# define SSL_R_NO_PEM_EXTENSIONS 389
# define SSL_R_NO_PRIVATE_KEY_ASSIGNED 190
# define SSL_R_NO_PROTOCOLS_AVAILABLE 191
# define SSL_R_NO_RENEGOTIATION 339
# define SSL_R_NO_REQUIRED_DIGEST 324
# define SSL_R_NO_SHARED_CIPHER 193
# define SSL_R_NO_SHARED_GROUPS 410
# define SSL_R_NO_SHARED_SIGNATURE_ALGORITHMS 376
# define SSL_R_NO_SRTP_PROFILES 359
# define SSL_R_NO_SUITABLE_KEY_SHARE 101
# define SSL_R_NO_SUITABLE_SIGNATURE_ALGORITHM 118
# define SSL_R_NO_VALID_SCTS 216
# define SSL_R_NO_VERIFY_COOKIE_CALLBACK 403
# define SSL_R_NULL_SSL_CTX 195
# define SSL_R_NULL_SSL_METHOD_PASSED 196
# define SSL_R_OLD_SESSION_CIPHER_NOT_RETURNED 197
# define SSL_R_OLD_SESSION_COMPRESSION_ALGORITHM_NOT_RETURNED 344
# define SSL_R_OVERFLOW_ERROR 237
# define SSL_R_PACKET_LENGTH_TOO_LONG 198
# define SSL_R_PARSE_TLSEXT 227
# define SSL_R_PATH_TOO_LONG 270
# define SSL_R_PEER_DID_NOT_RETURN_A_CERTIFICATE 199
# define SSL_R_PEM_NAME_BAD_PREFIX 391
# define SSL_R_PEM_NAME_TOO_SHORT 392
# define SSL_R_PIPELINE_FAILURE 406
# define SSL_R_POST_HANDSHAKE_AUTH_ENCODING_ERR 278
# define SSL_R_PRIVATE_KEY_MISMATCH 288
# define SSL_R_PROTOCOL_IS_SHUTDOWN 207
# define SSL_R_PSK_IDENTITY_NOT_FOUND 223
# define SSL_R_PSK_NO_CLIENT_CB 224
# define SSL_R_PSK_NO_SERVER_CB 225
# define SSL_R_READ_BIO_NOT_SET 211
# define SSL_R_READ_TIMEOUT_EXPIRED 312
# define SSL_R_RECORD_LENGTH_MISMATCH 213
# define SSL_R_RECORD_TOO_SMALL 298
# define SSL_R_RENEGOTIATE_EXT_TOO_LONG 335
# define SSL_R_RENEGOTIATION_ENCODING_ERR 336
# define SSL_R_RENEGOTIATION_MISMATCH 337
# define SSL_R_REQUEST_PENDING 285
# define SSL_R_REQUEST_SENT 286
# define SSL_R_REQUIRED_CIPHER_MISSING 215
# define SSL_R_REQUIRED_COMPRESSION_ALGORITHM_MISSING 342
# define SSL_R_SCSV_RECEIVED_WHEN_RENEGOTIATING 345
# define SSL_R_SCT_VERIFICATION_FAILED 208
# define SSL_R_SERVERHELLO_TLSEXT 275
# define SSL_R_SESSION_ID_CONTEXT_UNINITIALIZED 277
# define SSL_R_SHUTDOWN_WHILE_IN_INIT 407
# define SSL_R_SIGNATURE_ALGORITHMS_ERROR 360
# define SSL_R_SIGNATURE_FOR_NON_SIGNING_CERTIFICATE 220
# define SSL_R_SRP_A_CALC 361
# define SSL_R_SRTP_COULD_NOT_ALLOCATE_PROFILES 362
# define SSL_R_SRTP_PROTECTION_PROFILE_LIST_TOO_LONG 363
# define SSL_R_SRTP_UNKNOWN_PROTECTION_PROFILE 364
# define SSL_R_SSL3_EXT_INVALID_MAX_FRAGMENT_LENGTH 232
# define SSL_R_SSL3_EXT_INVALID_SERVERNAME 319
# define SSL_R_SSL3_EXT_INVALID_SERVERNAME_TYPE 320
# define SSL_R_SSL3_SESSION_ID_TOO_LONG 300
# define SSL_R_SSLV3_ALERT_BAD_CERTIFICATE 1042
# define SSL_R_SSLV3_ALERT_BAD_RECORD_MAC 1020
# define SSL_R_SSLV3_ALERT_CERTIFICATE_EXPIRED 1045
# define SSL_R_SSLV3_ALERT_CERTIFICATE_REVOKED 1044
# define SSL_R_SSLV3_ALERT_CERTIFICATE_UNKNOWN 1046
# define SSL_R_SSLV3_ALERT_DECOMPRESSION_FAILURE 1030
# define SSL_R_SSLV3_ALERT_HANDSHAKE_FAILURE 1040
# define SSL_R_SSLV3_ALERT_ILLEGAL_PARAMETER 1047
# define SSL_R_SSLV3_ALERT_NO_CERTIFICATE 1041
# define SSL_R_SSLV3_ALERT_UNEXPECTED_MESSAGE 1010
# define SSL_R_SSLV3_ALERT_UNSUPPORTED_CERTIFICATE 1043
# define SSL_R_SSL_COMMAND_SECTION_EMPTY 117
# define SSL_R_SSL_COMMAND_SECTION_NOT_FOUND 125
# define SSL_R_SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION 228
# define SSL_R_SSL_HANDSHAKE_FAILURE 229
# define SSL_R_SSL_LIBRARY_HAS_NO_CIPHERS 230
# define SSL_R_SSL_NEGATIVE_LENGTH 372
# define SSL_R_SSL_SECTION_EMPTY 126
# define SSL_R_SSL_SECTION_NOT_FOUND 136
# define SSL_R_SSL_SESSION_ID_CALLBACK_FAILED 301
# define SSL_R_SSL_SESSION_ID_CONFLICT 302
# define SSL_R_SSL_SESSION_ID_CONTEXT_TOO_LONG 273
# define SSL_R_SSL_SESSION_ID_HAS_BAD_LENGTH 303
# define SSL_R_SSL_SESSION_ID_TOO_LONG 408
# define SSL_R_SSL_SESSION_VERSION_MISMATCH 210
# define SSL_R_STILL_IN_INIT 121
# define SSL_R_TLSV13_ALERT_CERTIFICATE_REQUIRED 1116
# define SSL_R_TLSV13_ALERT_MISSING_EXTENSION 1109
# define SSL_R_TLSV1_ALERT_ACCESS_DENIED 1049
# define SSL_R_TLSV1_ALERT_DECODE_ERROR 1050
# define SSL_R_TLSV1_ALERT_DECRYPTION_FAILED 1021
# define SSL_R_TLSV1_ALERT_DECRYPT_ERROR 1051
# define SSL_R_TLSV1_ALERT_EXPORT_RESTRICTION 1060
# define SSL_R_TLSV1_ALERT_INAPPROPRIATE_FALLBACK 1086
# define SSL_R_TLSV1_ALERT_INSUFFICIENT_SECURITY 1071
# define SSL_R_TLSV1_ALERT_INTERNAL_ERROR 1080
# define SSL_R_TLSV1_ALERT_NO_RENEGOTIATION 1100
# define SSL_R_TLSV1_ALERT_PROTOCOL_VERSION 1070
# define SSL_R_TLSV1_ALERT_RECORD_OVERFLOW 1022
# define SSL_R_TLSV1_ALERT_UNKNOWN_CA 1048
# define SSL_R_TLSV1_ALERT_USER_CANCELLED 1090
# define SSL_R_TLSV1_BAD_CERTIFICATE_HASH_VALUE 1114
# define SSL_R_TLSV1_BAD_CERTIFICATE_STATUS_RESPONSE 1113
# define SSL_R_TLSV1_CERTIFICATE_UNOBTAINABLE 1111
# define SSL_R_TLSV1_UNRECOGNIZED_NAME 1112
# define SSL_R_TLSV1_UNSUPPORTED_EXTENSION 1110
# define SSL_R_TLS_HEARTBEAT_PEER_DOESNT_ACCEPT 365
# define SSL_R_TLS_HEARTBEAT_PENDING 366
# define SSL_R_TLS_ILLEGAL_EXPORTER_LABEL 367
# define SSL_R_TLS_INVALID_ECPOINTFORMAT_LIST 157
# define SSL_R_TOO_MANY_KEY_UPDATES 132
# define SSL_R_TOO_MANY_WARN_ALERTS 409
# define SSL_R_TOO_MUCH_EARLY_DATA 164
# define SSL_R_UNABLE_TO_FIND_ECDH_PARAMETERS 314
# define SSL_R_UNABLE_TO_FIND_PUBLIC_KEY_PARAMETERS 239
# define SSL_R_UNABLE_TO_LOAD_SSL3_MD5_ROUTINES 242
# define SSL_R_UNABLE_TO_LOAD_SSL3_SHA1_ROUTINES 243
# define SSL_R_UNEXPECTED_CCS_MESSAGE 262
# define SSL_R_UNEXPECTED_END_OF_EARLY_DATA 178
# define SSL_R_UNEXPECTED_MESSAGE 244
# define SSL_R_UNEXPECTED_RECORD 245
# define SSL_R_UNINITIALIZED 276
# define SSL_R_UNKNOWN_ALERT_TYPE 246
# define SSL_R_UNKNOWN_CERTIFICATE_TYPE 247
# define SSL_R_UNKNOWN_CIPHER_RETURNED 248
# define SSL_R_UNKNOWN_CIPHER_TYPE 249
# define SSL_R_UNKNOWN_CMD_NAME 386
# define SSL_R_UNKNOWN_COMMAND 139
# define SSL_R_UNKNOWN_DIGEST 368
# define SSL_R_UNKNOWN_KEY_EXCHANGE_TYPE 250
# define SSL_R_UNKNOWN_PKEY_TYPE 251
# define SSL_R_UNKNOWN_PROTOCOL 252
# define SSL_R_UNKNOWN_SSL_VERSION 254
# define SSL_R_UNKNOWN_STATE 255
# define SSL_R_UNSAFE_LEGACY_RENEGOTIATION_DISABLED 338
# define SSL_R_UNSOLICITED_EXTENSION 217
# define SSL_R_UNSUPPORTED_COMPRESSION_ALGORITHM 257
# define SSL_R_UNSUPPORTED_ELLIPTIC_CURVE 315
# define SSL_R_UNSUPPORTED_PROTOCOL 258
# define SSL_R_UNSUPPORTED_SSL_VERSION 259
# define SSL_R_UNSUPPORTED_STATUS_TYPE 329
# define SSL_R_USE_SRTP_NOT_NEGOTIATED 369
# define SSL_R_VERSION_TOO_HIGH 166
# define SSL_R_VERSION_TOO_LOW 396
# define SSL_R_WRONG_CERTIFICATE_TYPE 383
# define SSL_R_WRONG_CIPHER_RETURNED 261
# define SSL_R_WRONG_CURVE 378
# define SSL_R_WRONG_SIGNATURE_LENGTH 264
# define SSL_R_WRONG_SIGNATURE_SIZE 265
# define SSL_R_WRONG_SIGNATURE_TYPE 370
# define SSL_R_WRONG_SSL_VERSION 266
# define SSL_R_WRONG_VERSION_NUMBER 267
# define SSL_R_X509_LIB 268
# define SSL_R_X509_VERIFICATION_SETUP_PROBLEMS 269
#endif

View File

@ -1,107 +1,83 @@
/* crypto/stack/stack.h */ /*
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * Copyright 1995-2017 The OpenSSL Project Authors. All Rights Reserved.
* All rights reserved. *
* * Licensed under the OpenSSL license (the "License"). You may not use
* This package is an SSL implementation written * this file except in compliance with the License. You can obtain a copy
* by Eric Young (eay@cryptsoft.com). * in the file LICENSE in the source distribution or at
* The implementation was written so as to conform with Netscapes SSL. * https://www.openssl.org/source/license.html
* */
* This library is free for commercial and non-commercial use as long as
* the following conditions are aheared to. The following conditions #ifndef HEADER_STACK_H
* apply to all code found in this distribution, be it the RC4, RSA, # define HEADER_STACK_H
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
* included with this distribution is covered by the same copyright terms #ifdef __cplusplus
* except that the holder is Tim Hudson (tjh@cryptsoft.com). extern "C" {
* #endif
* Copyright remains Eric Young's, and as such any Copyright notices in
* the code are not to be removed. typedef struct stack_st OPENSSL_STACK; /* Use STACK_OF(...) instead */
* If this package is used in a product, Eric Young should be given attribution
* as the author of the parts of the library used. typedef int (*OPENSSL_sk_compfunc)(const void *, const void *);
* This can be in the form of a textual message at program startup or typedef void (*OPENSSL_sk_freefunc)(void *);
* in documentation (online or textual) provided with the package. typedef void *(*OPENSSL_sk_copyfunc)(const void *);
*
* Redistribution and use in source and binary forms, with or without int OPENSSL_sk_num(const OPENSSL_STACK *);
* modification, are permitted provided that the following conditions void *OPENSSL_sk_value(const OPENSSL_STACK *, int);
* are met:
* 1. Redistributions of source code must retain the copyright void *OPENSSL_sk_set(OPENSSL_STACK *st, int i, const void *data);
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright OPENSSL_STACK *OPENSSL_sk_new(OPENSSL_sk_compfunc cmp);
* notice, this list of conditions and the following disclaimer in the OPENSSL_STACK *OPENSSL_sk_new_null(void);
* documentation and/or other materials provided with the distribution. OPENSSL_STACK *OPENSSL_sk_new_reserve(OPENSSL_sk_compfunc c, int n);
* 3. All advertising materials mentioning features or use of this software int OPENSSL_sk_reserve(OPENSSL_STACK *st, int n);
* must display the following acknowledgement: void OPENSSL_sk_free(OPENSSL_STACK *);
* "This product includes cryptographic software written by void OPENSSL_sk_pop_free(OPENSSL_STACK *st, void (*func) (void *));
* Eric Young (eay@cryptsoft.com)" OPENSSL_STACK *OPENSSL_sk_deep_copy(const OPENSSL_STACK *,
* The word 'cryptographic' can be left out if the rouines from the library OPENSSL_sk_copyfunc c,
* being used are not cryptographic related :-). OPENSSL_sk_freefunc f);
* 4. If you include any Windows specific code (or a derivative thereof) from int OPENSSL_sk_insert(OPENSSL_STACK *sk, const void *data, int where);
* the apps directory (application code) you must include an acknowledgement: void *OPENSSL_sk_delete(OPENSSL_STACK *st, int loc);
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" void *OPENSSL_sk_delete_ptr(OPENSSL_STACK *st, const void *p);
* int OPENSSL_sk_find(OPENSSL_STACK *st, const void *data);
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND int OPENSSL_sk_find_ex(OPENSSL_STACK *st, const void *data);
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE int OPENSSL_sk_push(OPENSSL_STACK *st, const void *data);
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE int OPENSSL_sk_unshift(OPENSSL_STACK *st, const void *data);
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE void *OPENSSL_sk_shift(OPENSSL_STACK *st);
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL void *OPENSSL_sk_pop(OPENSSL_STACK *st);
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS void OPENSSL_sk_zero(OPENSSL_STACK *st);
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) OPENSSL_sk_compfunc OPENSSL_sk_set_cmp_func(OPENSSL_STACK *sk,
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT OPENSSL_sk_compfunc cmp);
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OPENSSL_STACK *OPENSSL_sk_dup(const OPENSSL_STACK *st);
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF void OPENSSL_sk_sort(OPENSSL_STACK *st);
* SUCH DAMAGE. int OPENSSL_sk_is_sorted(const OPENSSL_STACK *st);
*
* The licence and distribution terms for any publically available version or # if OPENSSL_API_COMPAT < 0x10100000L
* derivative of this code cannot be changed. i.e. this code cannot simply be # define _STACK OPENSSL_STACK
* copied and put under another distribution licence # define sk_num OPENSSL_sk_num
* [including the GNU Public Licence.] # define sk_value OPENSSL_sk_value
*/ # define sk_set OPENSSL_sk_set
# define sk_new OPENSSL_sk_new
#ifndef HEADER_STACK_H # define sk_new_null OPENSSL_sk_new_null
# define HEADER_STACK_H # define sk_free OPENSSL_sk_free
# define sk_pop_free OPENSSL_sk_pop_free
#ifdef __cplusplus # define sk_deep_copy OPENSSL_sk_deep_copy
extern "C" { # define sk_insert OPENSSL_sk_insert
#endif # define sk_delete OPENSSL_sk_delete
# define sk_delete_ptr OPENSSL_sk_delete_ptr
typedef struct stack_st { # define sk_find OPENSSL_sk_find
int num; # define sk_find_ex OPENSSL_sk_find_ex
char **data; # define sk_push OPENSSL_sk_push
int sorted; # define sk_unshift OPENSSL_sk_unshift
int num_alloc; # define sk_shift OPENSSL_sk_shift
int (*comp) (const void *, const void *); # define sk_pop OPENSSL_sk_pop
} _STACK; /* Use STACK_OF(...) instead */ # define sk_zero OPENSSL_sk_zero
# define sk_set_cmp_func OPENSSL_sk_set_cmp_func
# define M_sk_num(sk) ((sk) ? (sk)->num:-1) # define sk_dup OPENSSL_sk_dup
# define M_sk_value(sk,n) ((sk) ? (sk)->data[n] : NULL) # define sk_sort OPENSSL_sk_sort
# define sk_is_sorted OPENSSL_sk_is_sorted
int sk_num(const _STACK *); # endif
void *sk_value(const _STACK *, int);
#ifdef __cplusplus
void *sk_set(_STACK *, int, void *); }
#endif
_STACK *sk_new(int (*cmp) (const void *, const void *));
_STACK *sk_new_null(void); #endif
void sk_free(_STACK *);
void sk_pop_free(_STACK *st, void (*func) (void *));
_STACK *sk_deep_copy(_STACK *, void *(*)(void *), void (*)(void *));
int sk_insert(_STACK *sk, void *data, int where);
void *sk_delete(_STACK *st, int loc);
void *sk_delete_ptr(_STACK *st, void *p);
int sk_find(_STACK *st, void *data);
int sk_find_ex(_STACK *st, void *data);
int sk_push(_STACK *st, void *data);
int sk_unshift(_STACK *st, void *data);
void *sk_shift(_STACK *st);
void *sk_pop(_STACK *st);
void sk_zero(_STACK *st);
int (*sk_set_cmp_func(_STACK *sk, int (*c) (const void *, const void *)))
(const void *, const void *);
_STACK *sk_dup(_STACK *st);
void sk_sort(_STACK *st);
int sk_is_sorted(const _STACK *st);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,266 @@
/*
* Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/license.html
*/
#ifndef HEADER_OSSL_STORE_H
# define HEADER_OSSL_STORE_H
# include <stdarg.h>
# include <openssl/ossl_typ.h>
# include <openssl/pem.h>
# include <openssl/storeerr.h>
# ifdef __cplusplus
extern "C" {
# endif
/*-
* The main OSSL_STORE functions.
* ------------------------------
*
* These allow applications to open a channel to a resource with supported
* data (keys, certs, crls, ...), read the data a piece at a time and decide
* what to do with it, and finally close.
*/
typedef struct ossl_store_ctx_st OSSL_STORE_CTX;
/*
* Typedef for the OSSL_STORE_INFO post processing callback. This can be used
* to massage the given OSSL_STORE_INFO, or to drop it entirely (by returning
* NULL).
*/
typedef OSSL_STORE_INFO *(*OSSL_STORE_post_process_info_fn)(OSSL_STORE_INFO *,
void *);
/*
* Open a channel given a URI. The given UI method will be used any time the
* loader needs extra input, for example when a password or pin is needed, and
* will be passed the same user data every time it's needed in this context.
*
* Returns a context reference which represents the channel to communicate
* through.
*/
OSSL_STORE_CTX *OSSL_STORE_open(const char *uri, const UI_METHOD *ui_method,
void *ui_data,
OSSL_STORE_post_process_info_fn post_process,
void *post_process_data);
/*
* Control / fine tune the OSSL_STORE channel. |cmd| determines what is to be
* done, and depends on the underlying loader (use OSSL_STORE_get0_scheme to
* determine which loader is used), except for common commands (see below).
* Each command takes different arguments.
*/
int OSSL_STORE_ctrl(OSSL_STORE_CTX *ctx, int cmd, ... /* args */);
int OSSL_STORE_vctrl(OSSL_STORE_CTX *ctx, int cmd, va_list args);
/*
* Common ctrl commands that different loaders may choose to support.
*/
/* int on = 0 or 1; STORE_ctrl(ctx, STORE_C_USE_SECMEM, &on); */
# define OSSL_STORE_C_USE_SECMEM 1
/* Where custom commands start */
# define OSSL_STORE_C_CUSTOM_START 100
/*
* Read one data item (a key, a cert, a CRL) that is supported by the OSSL_STORE
* functionality, given a context.
* Returns a OSSL_STORE_INFO pointer, from which OpenSSL typed data can be
* extracted with OSSL_STORE_INFO_get0_PKEY(), OSSL_STORE_INFO_get0_CERT(), ...
* NULL is returned on error, which may include that the data found at the URI
* can't be figured out for certain or is ambiguous.
*/
OSSL_STORE_INFO *OSSL_STORE_load(OSSL_STORE_CTX *ctx);
/*
* Check if end of data (end of file) is reached
* Returns 1 on end, 0 otherwise.
*/
int OSSL_STORE_eof(OSSL_STORE_CTX *ctx);
/*
* Check if an error occured
* Returns 1 if it did, 0 otherwise.
*/
int OSSL_STORE_error(OSSL_STORE_CTX *ctx);
/*
* Close the channel
* Returns 1 on success, 0 on error.
*/
int OSSL_STORE_close(OSSL_STORE_CTX *ctx);
/*-
* Extracting OpenSSL types from and creating new OSSL_STORE_INFOs
* ---------------------------------------------------------------
*/
/*
* Types of data that can be ossl_stored in a OSSL_STORE_INFO.
* OSSL_STORE_INFO_NAME is typically found when getting a listing of
* available "files" / "tokens" / what have you.
*/
# define OSSL_STORE_INFO_NAME 1 /* char * */
# define OSSL_STORE_INFO_PARAMS 2 /* EVP_PKEY * */
# define OSSL_STORE_INFO_PKEY 3 /* EVP_PKEY * */
# define OSSL_STORE_INFO_CERT 4 /* X509 * */
# define OSSL_STORE_INFO_CRL 5 /* X509_CRL * */
/*
* Functions to generate OSSL_STORE_INFOs, one function for each type we
* support having in them, as well as a generic constructor.
*
* In all cases, ownership of the object is transfered to the OSSL_STORE_INFO
* and will therefore be freed when the OSSL_STORE_INFO is freed.
*/
OSSL_STORE_INFO *OSSL_STORE_INFO_new_NAME(char *name);
int OSSL_STORE_INFO_set0_NAME_description(OSSL_STORE_INFO *info, char *desc);
OSSL_STORE_INFO *OSSL_STORE_INFO_new_PARAMS(EVP_PKEY *params);
OSSL_STORE_INFO *OSSL_STORE_INFO_new_PKEY(EVP_PKEY *pkey);
OSSL_STORE_INFO *OSSL_STORE_INFO_new_CERT(X509 *x509);
OSSL_STORE_INFO *OSSL_STORE_INFO_new_CRL(X509_CRL *crl);
/*
* Functions to try to extract data from a OSSL_STORE_INFO.
*/
int OSSL_STORE_INFO_get_type(const OSSL_STORE_INFO *info);
const char *OSSL_STORE_INFO_get0_NAME(const OSSL_STORE_INFO *info);
char *OSSL_STORE_INFO_get1_NAME(const OSSL_STORE_INFO *info);
const char *OSSL_STORE_INFO_get0_NAME_description(const OSSL_STORE_INFO *info);
char *OSSL_STORE_INFO_get1_NAME_description(const OSSL_STORE_INFO *info);
EVP_PKEY *OSSL_STORE_INFO_get0_PARAMS(const OSSL_STORE_INFO *info);
EVP_PKEY *OSSL_STORE_INFO_get1_PARAMS(const OSSL_STORE_INFO *info);
EVP_PKEY *OSSL_STORE_INFO_get0_PKEY(const OSSL_STORE_INFO *info);
EVP_PKEY *OSSL_STORE_INFO_get1_PKEY(const OSSL_STORE_INFO *info);
X509 *OSSL_STORE_INFO_get0_CERT(const OSSL_STORE_INFO *info);
X509 *OSSL_STORE_INFO_get1_CERT(const OSSL_STORE_INFO *info);
X509_CRL *OSSL_STORE_INFO_get0_CRL(const OSSL_STORE_INFO *info);
X509_CRL *OSSL_STORE_INFO_get1_CRL(const OSSL_STORE_INFO *info);
const char *OSSL_STORE_INFO_type_string(int type);
/*
* Free the OSSL_STORE_INFO
*/
void OSSL_STORE_INFO_free(OSSL_STORE_INFO *info);
/*-
* Functions to construct a search URI from a base URI and search criteria
* -----------------------------------------------------------------------
*/
/* OSSL_STORE search types */
# define OSSL_STORE_SEARCH_BY_NAME 1 /* subject in certs, issuer in CRLs */
# define OSSL_STORE_SEARCH_BY_ISSUER_SERIAL 2
# define OSSL_STORE_SEARCH_BY_KEY_FINGERPRINT 3
# define OSSL_STORE_SEARCH_BY_ALIAS 4
/* To check what search types the scheme handler supports */
int OSSL_STORE_supports_search(OSSL_STORE_CTX *ctx, int search_type);
/* Search term constructors */
/*
* The input is considered to be owned by the caller, and must therefore
* remain present throughout the lifetime of the returned OSSL_STORE_SEARCH
*/
OSSL_STORE_SEARCH *OSSL_STORE_SEARCH_by_name(X509_NAME *name);
OSSL_STORE_SEARCH *OSSL_STORE_SEARCH_by_issuer_serial(X509_NAME *name,
const ASN1_INTEGER
*serial);
OSSL_STORE_SEARCH *OSSL_STORE_SEARCH_by_key_fingerprint(const EVP_MD *digest,
const unsigned char
*bytes, size_t len);
OSSL_STORE_SEARCH *OSSL_STORE_SEARCH_by_alias(const char *alias);
/* Search term destructor */
void OSSL_STORE_SEARCH_free(OSSL_STORE_SEARCH *search);
/* Search term accessors */
int OSSL_STORE_SEARCH_get_type(const OSSL_STORE_SEARCH *criterion);
X509_NAME *OSSL_STORE_SEARCH_get0_name(OSSL_STORE_SEARCH *criterion);
const ASN1_INTEGER *OSSL_STORE_SEARCH_get0_serial(const OSSL_STORE_SEARCH
*criterion);
const unsigned char *OSSL_STORE_SEARCH_get0_bytes(const OSSL_STORE_SEARCH
*criterion, size_t *length);
const char *OSSL_STORE_SEARCH_get0_string(const OSSL_STORE_SEARCH *criterion);
const EVP_MD *OSSL_STORE_SEARCH_get0_digest(const OSSL_STORE_SEARCH *criterion);
/*
* Add search criterion and expected return type (which can be unspecified)
* to the loading channel. This MUST happen before the first OSSL_STORE_load().
*/
int OSSL_STORE_expect(OSSL_STORE_CTX *ctx, int expected_type);
int OSSL_STORE_find(OSSL_STORE_CTX *ctx, OSSL_STORE_SEARCH *search);
/*-
* Function to register a loader for the given URI scheme.
* -------------------------------------------------------
*
* The loader receives all the main components of an URI except for the
* scheme.
*/
typedef struct ossl_store_loader_st OSSL_STORE_LOADER;
OSSL_STORE_LOADER *OSSL_STORE_LOADER_new(ENGINE *e, const char *scheme);
const ENGINE *OSSL_STORE_LOADER_get0_engine(const OSSL_STORE_LOADER *loader);
const char *OSSL_STORE_LOADER_get0_scheme(const OSSL_STORE_LOADER *loader);
/* struct ossl_store_loader_ctx_st is defined differently by each loader */
typedef struct ossl_store_loader_ctx_st OSSL_STORE_LOADER_CTX;
typedef OSSL_STORE_LOADER_CTX *(*OSSL_STORE_open_fn)(const OSSL_STORE_LOADER
*loader,
const char *uri,
const UI_METHOD *ui_method,
void *ui_data);
int OSSL_STORE_LOADER_set_open(OSSL_STORE_LOADER *loader,
OSSL_STORE_open_fn open_function);
typedef int (*OSSL_STORE_ctrl_fn)(OSSL_STORE_LOADER_CTX *ctx, int cmd,
va_list args);
int OSSL_STORE_LOADER_set_ctrl(OSSL_STORE_LOADER *loader,
OSSL_STORE_ctrl_fn ctrl_function);
typedef int (*OSSL_STORE_expect_fn)(OSSL_STORE_LOADER_CTX *ctx, int expected);
int OSSL_STORE_LOADER_set_expect(OSSL_STORE_LOADER *loader,
OSSL_STORE_expect_fn expect_function);
typedef int (*OSSL_STORE_find_fn)(OSSL_STORE_LOADER_CTX *ctx,
OSSL_STORE_SEARCH *criteria);
int OSSL_STORE_LOADER_set_find(OSSL_STORE_LOADER *loader,
OSSL_STORE_find_fn find_function);
typedef OSSL_STORE_INFO *(*OSSL_STORE_load_fn)(OSSL_STORE_LOADER_CTX *ctx,
const UI_METHOD *ui_method,
void *ui_data);
int OSSL_STORE_LOADER_set_load(OSSL_STORE_LOADER *loader,
OSSL_STORE_load_fn load_function);
typedef int (*OSSL_STORE_eof_fn)(OSSL_STORE_LOADER_CTX *ctx);
int OSSL_STORE_LOADER_set_eof(OSSL_STORE_LOADER *loader,
OSSL_STORE_eof_fn eof_function);
typedef int (*OSSL_STORE_error_fn)(OSSL_STORE_LOADER_CTX *ctx);
int OSSL_STORE_LOADER_set_error(OSSL_STORE_LOADER *loader,
OSSL_STORE_error_fn error_function);
typedef int (*OSSL_STORE_close_fn)(OSSL_STORE_LOADER_CTX *ctx);
int OSSL_STORE_LOADER_set_close(OSSL_STORE_LOADER *loader,
OSSL_STORE_close_fn close_function);
void OSSL_STORE_LOADER_free(OSSL_STORE_LOADER *loader);
int OSSL_STORE_register_loader(OSSL_STORE_LOADER *loader);
OSSL_STORE_LOADER *OSSL_STORE_unregister_loader(const char *scheme);
/*-
* Functions to list STORE loaders
* -------------------------------
*/
int OSSL_STORE_do_all_loaders(void (*do_function) (const OSSL_STORE_LOADER
*loader, void *do_arg),
void *do_arg);
# ifdef __cplusplus
}
# endif
#endif

View File

@ -0,0 +1,87 @@
/*
* Generated by util/mkerr.pl DO NOT EDIT
* Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/license.html
*/
#ifndef HEADER_OSSL_STOREERR_H
# define HEADER_OSSL_STOREERR_H
# ifdef __cplusplus
extern "C"
# endif
int ERR_load_OSSL_STORE_strings(void);
/*
* OSSL_STORE function codes.
*/
# define OSSL_STORE_F_FILE_CTRL 129
# define OSSL_STORE_F_FILE_FIND 138
# define OSSL_STORE_F_FILE_GET_PASS 118
# define OSSL_STORE_F_FILE_LOAD 119
# define OSSL_STORE_F_FILE_LOAD_TRY_DECODE 124
# define OSSL_STORE_F_FILE_NAME_TO_URI 126
# define OSSL_STORE_F_FILE_OPEN 120
# define OSSL_STORE_F_OSSL_STORE_ATTACH_PEM_BIO 127
# define OSSL_STORE_F_OSSL_STORE_EXPECT 130
# define OSSL_STORE_F_OSSL_STORE_FILE_ATTACH_PEM_BIO_INT 128
# define OSSL_STORE_F_OSSL_STORE_FIND 131
# define OSSL_STORE_F_OSSL_STORE_GET0_LOADER_INT 100
# define OSSL_STORE_F_OSSL_STORE_INFO_GET1_CERT 101
# define OSSL_STORE_F_OSSL_STORE_INFO_GET1_CRL 102
# define OSSL_STORE_F_OSSL_STORE_INFO_GET1_NAME 103
# define OSSL_STORE_F_OSSL_STORE_INFO_GET1_NAME_DESCRIPTION 135
# define OSSL_STORE_F_OSSL_STORE_INFO_GET1_PARAMS 104
# define OSSL_STORE_F_OSSL_STORE_INFO_GET1_PKEY 105
# define OSSL_STORE_F_OSSL_STORE_INFO_NEW_CERT 106
# define OSSL_STORE_F_OSSL_STORE_INFO_NEW_CRL 107
# define OSSL_STORE_F_OSSL_STORE_INFO_NEW_EMBEDDED 123
# define OSSL_STORE_F_OSSL_STORE_INFO_NEW_NAME 109
# define OSSL_STORE_F_OSSL_STORE_INFO_NEW_PARAMS 110
# define OSSL_STORE_F_OSSL_STORE_INFO_NEW_PKEY 111
# define OSSL_STORE_F_OSSL_STORE_INFO_SET0_NAME_DESCRIPTION 134
# define OSSL_STORE_F_OSSL_STORE_INIT_ONCE 112
# define OSSL_STORE_F_OSSL_STORE_LOADER_NEW 113
# define OSSL_STORE_F_OSSL_STORE_OPEN 114
# define OSSL_STORE_F_OSSL_STORE_OPEN_INT 115
# define OSSL_STORE_F_OSSL_STORE_REGISTER_LOADER_INT 117
# define OSSL_STORE_F_OSSL_STORE_SEARCH_BY_ALIAS 132
# define OSSL_STORE_F_OSSL_STORE_SEARCH_BY_ISSUER_SERIAL 133
# define OSSL_STORE_F_OSSL_STORE_SEARCH_BY_KEY_FINGERPRINT 136
# define OSSL_STORE_F_OSSL_STORE_SEARCH_BY_NAME 137
# define OSSL_STORE_F_OSSL_STORE_UNREGISTER_LOADER_INT 116
# define OSSL_STORE_F_TRY_DECODE_PARAMS 121
# define OSSL_STORE_F_TRY_DECODE_PKCS12 122
# define OSSL_STORE_F_TRY_DECODE_PKCS8ENCRYPTED 125
/*
* OSSL_STORE reason codes.
*/
# define OSSL_STORE_R_AMBIGUOUS_CONTENT_TYPE 107
# define OSSL_STORE_R_BAD_PASSWORD_READ 115
# define OSSL_STORE_R_ERROR_VERIFYING_PKCS12_MAC 113
# define OSSL_STORE_R_FINGERPRINT_SIZE_DOES_NOT_MATCH_DIGEST 121
# define OSSL_STORE_R_INVALID_SCHEME 106
# define OSSL_STORE_R_IS_NOT_A 112
# define OSSL_STORE_R_LOADER_INCOMPLETE 116
# define OSSL_STORE_R_LOADING_STARTED 117
# define OSSL_STORE_R_NOT_A_CERTIFICATE 100
# define OSSL_STORE_R_NOT_A_CRL 101
# define OSSL_STORE_R_NOT_A_KEY 102
# define OSSL_STORE_R_NOT_A_NAME 103
# define OSSL_STORE_R_NOT_PARAMETERS 104
# define OSSL_STORE_R_PASSPHRASE_CALLBACK_ERROR 114
# define OSSL_STORE_R_PATH_MUST_BE_ABSOLUTE 108
# define OSSL_STORE_R_SEARCH_ONLY_SUPPORTED_FOR_DIRECTORIES 119
# define OSSL_STORE_R_UI_PROCESS_INTERRUPTED_OR_CANCELLED 109
# define OSSL_STORE_R_UNREGISTERED_SCHEME 105
# define OSSL_STORE_R_UNSUPPORTED_CONTENT_TYPE 110
# define OSSL_STORE_R_UNSUPPORTED_OPERATION 118
# define OSSL_STORE_R_UNSUPPORTED_SEARCH_TYPE 120
# define OSSL_STORE_R_URI_AUTHORITY_UNSUPPORTED 111
#endif

View File

@ -1,516 +1,52 @@
/* ==================================================================== /*
* Copyright (c) 1999 The OpenSSL Project. All rights reserved. * Copyright 1999-2016 The OpenSSL Project Authors. All Rights Reserved.
* *
* Redistribution and use in source and binary forms, with or without * Licensed under the OpenSSL license (the "License"). You may not use
* modification, are permitted provided that the following conditions * this file except in compliance with the License. You can obtain a copy
* are met: * in the file LICENSE in the source distribution or at
* * https://www.openssl.org/source/license.html
* 1. Redistributions of source code must retain the above copyright */
* notice, this list of conditions and the following disclaimer.
* #ifndef HEADER_SYMHACKS_H
* 2. Redistributions in binary form must reproduce the above copyright # define HEADER_SYMHACKS_H
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the # include <openssl/e_os2.h>
* distribution.
* /* Case insensitive linking causes problems.... */
* 3. All advertising materials mentioning features or use of this # if defined(OPENSSL_SYS_VMS)
* software must display the following acknowledgment: # undef ERR_load_CRYPTO_strings
* "This product includes software developed by the OpenSSL Project # define ERR_load_CRYPTO_strings ERR_load_CRYPTOlib_strings
* for use in the OpenSSL Toolkit. (http://www.openssl.org/)" # undef OCSP_crlID_new
* # define OCSP_crlID_new OCSP_crlID2_new
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
* endorse or promote products derived from this software without # undef d2i_ECPARAMETERS
* prior written permission. For written permission, please contact # define d2i_ECPARAMETERS d2i_UC_ECPARAMETERS
* openssl-core@openssl.org. # undef i2d_ECPARAMETERS
* # define i2d_ECPARAMETERS i2d_UC_ECPARAMETERS
* 5. Products derived from this software may not be called "OpenSSL" # undef d2i_ECPKPARAMETERS
* nor may "OpenSSL" appear in their names without prior written # define d2i_ECPKPARAMETERS d2i_UC_ECPKPARAMETERS
* permission of the OpenSSL Project. # undef i2d_ECPKPARAMETERS
* # define i2d_ECPKPARAMETERS i2d_UC_ECPKPARAMETERS
* 6. Redistributions of any form whatsoever must retain the following
* acknowledgment: /*
* "This product includes software developed by the OpenSSL Project * These functions do not seem to exist! However, I'm paranoid... Original
* for use in the OpenSSL Toolkit (http://www.openssl.org/)" * command in x509v3.h: These functions are being redefined in another
* * directory, and clash when the linker is case-insensitive, so let's hide
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY * them a little, by giving them an extra 'o' at the beginning of the name...
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE */
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR # undef X509v3_cleanup_extensions
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR # define X509v3_cleanup_extensions oX509v3_cleanup_extensions
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, # undef X509v3_add_extension
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT # define X509v3_add_extension oX509v3_add_extension
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; # undef X509v3_add_netscape_extensions
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) # define X509v3_add_netscape_extensions oX509v3_add_netscape_extensions
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, # undef X509v3_add_standard_extensions
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) # define X509v3_add_standard_extensions oX509v3_add_standard_extensions
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE. /* This one clashes with CMS_data_create */
* ==================================================================== # undef cms_Data_create
* # define cms_Data_create priv_cms_Data_create
* This product includes cryptographic software written by Eric Young
* (eay@cryptsoft.com). This product includes software written by Tim # endif
* Hudson (tjh@cryptsoft.com).
* #endif /* ! defined HEADER_VMS_IDHACKS_H */
*/
#ifndef HEADER_SYMHACKS_H
# define HEADER_SYMHACKS_H
# include <openssl/e_os2.h>
/*
* Hacks to solve the problem with linkers incapable of handling very long
* symbol names. In the case of VMS, the limit is 31 characters on VMS for
* VAX.
*/
/*
* Note that this affects util/libeay.num and util/ssleay.num... you may
* change those manually, but that's not recommended, as those files are
* controlled centrally and updated on Unix, and the central definition may
* disagree with yours, which in turn may come with shareable library
* incompatibilities.
*/
# ifdef OPENSSL_SYS_VMS
/* Hack a long name in crypto/ex_data.c */
# undef CRYPTO_get_ex_data_implementation
# define CRYPTO_get_ex_data_implementation CRYPTO_get_ex_data_impl
# undef CRYPTO_set_ex_data_implementation
# define CRYPTO_set_ex_data_implementation CRYPTO_set_ex_data_impl
/* Hack a long name in crypto/asn1/a_mbstr.c */
# undef ASN1_STRING_set_default_mask_asc
# define ASN1_STRING_set_default_mask_asc ASN1_STRING_set_def_mask_asc
# if 0 /* No longer needed, since safestack macro
* magic does the job */
/* Hack the names created with DECLARE_ASN1_SET_OF(PKCS7_SIGNER_INFO) */
# undef i2d_ASN1_SET_OF_PKCS7_SIGNER_INFO
# define i2d_ASN1_SET_OF_PKCS7_SIGNER_INFO i2d_ASN1_SET_OF_PKCS7_SIGINF
# undef d2i_ASN1_SET_OF_PKCS7_SIGNER_INFO
# define d2i_ASN1_SET_OF_PKCS7_SIGNER_INFO d2i_ASN1_SET_OF_PKCS7_SIGINF
# endif
# if 0 /* No longer needed, since safestack macro
* magic does the job */
/* Hack the names created with DECLARE_ASN1_SET_OF(PKCS7_RECIP_INFO) */
# undef i2d_ASN1_SET_OF_PKCS7_RECIP_INFO
# define i2d_ASN1_SET_OF_PKCS7_RECIP_INFO i2d_ASN1_SET_OF_PKCS7_RECINF
# undef d2i_ASN1_SET_OF_PKCS7_RECIP_INFO
# define d2i_ASN1_SET_OF_PKCS7_RECIP_INFO d2i_ASN1_SET_OF_PKCS7_RECINF
# endif
# if 0 /* No longer needed, since safestack macro
* magic does the job */
/* Hack the names created with DECLARE_ASN1_SET_OF(ACCESS_DESCRIPTION) */
# undef i2d_ASN1_SET_OF_ACCESS_DESCRIPTION
# define i2d_ASN1_SET_OF_ACCESS_DESCRIPTION i2d_ASN1_SET_OF_ACC_DESC
# undef d2i_ASN1_SET_OF_ACCESS_DESCRIPTION
# define d2i_ASN1_SET_OF_ACCESS_DESCRIPTION d2i_ASN1_SET_OF_ACC_DESC
# endif
/* Hack the names created with DECLARE_PEM_rw(NETSCAPE_CERT_SEQUENCE) */
# undef PEM_read_NETSCAPE_CERT_SEQUENCE
# define PEM_read_NETSCAPE_CERT_SEQUENCE PEM_read_NS_CERT_SEQ
# undef PEM_write_NETSCAPE_CERT_SEQUENCE
# define PEM_write_NETSCAPE_CERT_SEQUENCE PEM_write_NS_CERT_SEQ
# undef PEM_read_bio_NETSCAPE_CERT_SEQUENCE
# define PEM_read_bio_NETSCAPE_CERT_SEQUENCE PEM_read_bio_NS_CERT_SEQ
# undef PEM_write_bio_NETSCAPE_CERT_SEQUENCE
# define PEM_write_bio_NETSCAPE_CERT_SEQUENCE PEM_write_bio_NS_CERT_SEQ
# undef PEM_write_cb_bio_NETSCAPE_CERT_SEQUENCE
# define PEM_write_cb_bio_NETSCAPE_CERT_SEQUENCE PEM_write_cb_bio_NS_CERT_SEQ
/* Hack the names created with DECLARE_PEM_rw(PKCS8_PRIV_KEY_INFO) */
# undef PEM_read_PKCS8_PRIV_KEY_INFO
# define PEM_read_PKCS8_PRIV_KEY_INFO PEM_read_P8_PRIV_KEY_INFO
# undef PEM_write_PKCS8_PRIV_KEY_INFO
# define PEM_write_PKCS8_PRIV_KEY_INFO PEM_write_P8_PRIV_KEY_INFO
# undef PEM_read_bio_PKCS8_PRIV_KEY_INFO
# define PEM_read_bio_PKCS8_PRIV_KEY_INFO PEM_read_bio_P8_PRIV_KEY_INFO
# undef PEM_write_bio_PKCS8_PRIV_KEY_INFO
# define PEM_write_bio_PKCS8_PRIV_KEY_INFO PEM_write_bio_P8_PRIV_KEY_INFO
# undef PEM_write_cb_bio_PKCS8_PRIV_KEY_INFO
# define PEM_write_cb_bio_PKCS8_PRIV_KEY_INFO PEM_wrt_cb_bio_P8_PRIV_KEY_INFO
/* Hack other PEM names */
# undef PEM_write_bio_PKCS8PrivateKey_nid
# define PEM_write_bio_PKCS8PrivateKey_nid PEM_write_bio_PKCS8PrivKey_nid
/* Hack some long X509 names */
# undef X509_REVOKED_get_ext_by_critical
# define X509_REVOKED_get_ext_by_critical X509_REVOKED_get_ext_by_critic
# undef X509_policy_tree_get0_user_policies
# define X509_policy_tree_get0_user_policies X509_pcy_tree_get0_usr_policies
# undef X509_policy_node_get0_qualifiers
# define X509_policy_node_get0_qualifiers X509_pcy_node_get0_qualifiers
# undef X509_STORE_CTX_get_explicit_policy
# define X509_STORE_CTX_get_explicit_policy X509_STORE_CTX_get_expl_policy
# undef X509_STORE_CTX_get0_current_issuer
# define X509_STORE_CTX_get0_current_issuer X509_STORE_CTX_get0_cur_issuer
/* Hack some long CRYPTO names */
# undef CRYPTO_set_dynlock_destroy_callback
# define CRYPTO_set_dynlock_destroy_callback CRYPTO_set_dynlock_destroy_cb
# undef CRYPTO_set_dynlock_create_callback
# define CRYPTO_set_dynlock_create_callback CRYPTO_set_dynlock_create_cb
# undef CRYPTO_set_dynlock_lock_callback
# define CRYPTO_set_dynlock_lock_callback CRYPTO_set_dynlock_lock_cb
# undef CRYPTO_get_dynlock_lock_callback
# define CRYPTO_get_dynlock_lock_callback CRYPTO_get_dynlock_lock_cb
# undef CRYPTO_get_dynlock_destroy_callback
# define CRYPTO_get_dynlock_destroy_callback CRYPTO_get_dynlock_destroy_cb
# undef CRYPTO_get_dynlock_create_callback
# define CRYPTO_get_dynlock_create_callback CRYPTO_get_dynlock_create_cb
# undef CRYPTO_set_locked_mem_ex_functions
# define CRYPTO_set_locked_mem_ex_functions CRYPTO_set_locked_mem_ex_funcs
# undef CRYPTO_get_locked_mem_ex_functions
# define CRYPTO_get_locked_mem_ex_functions CRYPTO_get_locked_mem_ex_funcs
/* Hack some long SSL/TLS names */
# undef SSL_CTX_set_default_verify_paths
# define SSL_CTX_set_default_verify_paths SSL_CTX_set_def_verify_paths
# undef SSL_get_ex_data_X509_STORE_CTX_idx
# define SSL_get_ex_data_X509_STORE_CTX_idx SSL_get_ex_d_X509_STORE_CTX_idx
# undef SSL_add_file_cert_subjects_to_stack
# define SSL_add_file_cert_subjects_to_stack SSL_add_file_cert_subjs_to_stk
# undef SSL_add_dir_cert_subjects_to_stack
# define SSL_add_dir_cert_subjects_to_stack SSL_add_dir_cert_subjs_to_stk
# undef SSL_CTX_use_certificate_chain_file
# define SSL_CTX_use_certificate_chain_file SSL_CTX_use_cert_chain_file
# undef SSL_CTX_set_cert_verify_callback
# define SSL_CTX_set_cert_verify_callback SSL_CTX_set_cert_verify_cb
# undef SSL_CTX_set_default_passwd_cb_userdata
# define SSL_CTX_set_default_passwd_cb_userdata SSL_CTX_set_def_passwd_cb_ud
# undef SSL_COMP_get_compression_methods
# define SSL_COMP_get_compression_methods SSL_COMP_get_compress_methods
# undef SSL_COMP_set0_compression_methods
# define SSL_COMP_set0_compression_methods SSL_COMP_set0_compress_methods
# undef SSL_COMP_free_compression_methods
# define SSL_COMP_free_compression_methods SSL_COMP_free_compress_methods
# undef ssl_add_clienthello_renegotiate_ext
# define ssl_add_clienthello_renegotiate_ext ssl_add_clienthello_reneg_ext
# undef ssl_add_serverhello_renegotiate_ext
# define ssl_add_serverhello_renegotiate_ext ssl_add_serverhello_reneg_ext
# undef ssl_parse_clienthello_renegotiate_ext
# define ssl_parse_clienthello_renegotiate_ext ssl_parse_clienthello_reneg_ext
# undef ssl_parse_serverhello_renegotiate_ext
# define ssl_parse_serverhello_renegotiate_ext ssl_parse_serverhello_reneg_ext
# undef SSL_srp_server_param_with_username
# define SSL_srp_server_param_with_username SSL_srp_server_param_with_un
# undef SSL_CTX_set_srp_client_pwd_callback
# define SSL_CTX_set_srp_client_pwd_callback SSL_CTX_set_srp_client_pwd_cb
# undef SSL_CTX_set_srp_verify_param_callback
# define SSL_CTX_set_srp_verify_param_callback SSL_CTX_set_srp_vfy_param_cb
# undef SSL_CTX_set_srp_username_callback
# define SSL_CTX_set_srp_username_callback SSL_CTX_set_srp_un_cb
# undef ssl_add_clienthello_use_srtp_ext
# define ssl_add_clienthello_use_srtp_ext ssl_add_clihello_use_srtp_ext
# undef ssl_add_serverhello_use_srtp_ext
# define ssl_add_serverhello_use_srtp_ext ssl_add_serhello_use_srtp_ext
# undef ssl_parse_clienthello_use_srtp_ext
# define ssl_parse_clienthello_use_srtp_ext ssl_parse_clihello_use_srtp_ext
# undef ssl_parse_serverhello_use_srtp_ext
# define ssl_parse_serverhello_use_srtp_ext ssl_parse_serhello_use_srtp_ext
# undef SSL_CTX_set_next_protos_advertised_cb
# define SSL_CTX_set_next_protos_advertised_cb SSL_CTX_set_next_protos_adv_cb
# undef SSL_CTX_set_next_proto_select_cb
# define SSL_CTX_set_next_proto_select_cb SSL_CTX_set_next_proto_sel_cb
# undef tls1_send_server_supplemental_data
# define tls1_send_server_supplemental_data tls1_send_server_suppl_data
# undef tls1_send_client_supplemental_data
# define tls1_send_client_supplemental_data tls1_send_client_suppl_data
# undef tls1_get_server_supplemental_data
# define tls1_get_server_supplemental_data tls1_get_server_suppl_data
# undef tls1_get_client_supplemental_data
# define tls1_get_client_supplemental_data tls1_get_client_suppl_data
# undef ssl3_cbc_record_digest_supported
# define ssl3_cbc_record_digest_supported ssl3_cbc_record_digest_support
# undef ssl_check_clienthello_tlsext_late
# define ssl_check_clienthello_tlsext_late ssl_check_clihello_tlsext_late
# undef ssl_check_clienthello_tlsext_early
# define ssl_check_clienthello_tlsext_early ssl_check_clihello_tlsext_early
/* Hack some RSA long names */
# undef RSA_padding_check_PKCS1_OAEP_mgf1
# define RSA_padding_check_PKCS1_OAEP_mgf1 RSA_pad_check_PKCS1_OAEP_mgf1
/* Hack some ENGINE long names */
# undef ENGINE_get_default_BN_mod_exp_crt
# define ENGINE_get_default_BN_mod_exp_crt ENGINE_get_def_BN_mod_exp_crt
# undef ENGINE_set_default_BN_mod_exp_crt
# define ENGINE_set_default_BN_mod_exp_crt ENGINE_set_def_BN_mod_exp_crt
# undef ENGINE_set_load_privkey_function
# define ENGINE_set_load_privkey_function ENGINE_set_load_privkey_fn
# undef ENGINE_get_load_privkey_function
# define ENGINE_get_load_privkey_function ENGINE_get_load_privkey_fn
# undef ENGINE_unregister_pkey_asn1_meths
# define ENGINE_unregister_pkey_asn1_meths ENGINE_unreg_pkey_asn1_meths
# undef ENGINE_register_all_pkey_asn1_meths
# define ENGINE_register_all_pkey_asn1_meths ENGINE_reg_all_pkey_asn1_meths
# undef ENGINE_set_default_pkey_asn1_meths
# define ENGINE_set_default_pkey_asn1_meths ENGINE_set_def_pkey_asn1_meths
# undef ENGINE_get_pkey_asn1_meth_engine
# define ENGINE_get_pkey_asn1_meth_engine ENGINE_get_pkey_asn1_meth_eng
# undef ENGINE_set_load_ssl_client_cert_function
# define ENGINE_set_load_ssl_client_cert_function \
ENGINE_set_ld_ssl_clnt_cert_fn
# undef ENGINE_get_ssl_client_cert_function
# define ENGINE_get_ssl_client_cert_function ENGINE_get_ssl_client_cert_fn
/* Hack some long OCSP names */
# undef OCSP_REQUEST_get_ext_by_critical
# define OCSP_REQUEST_get_ext_by_critical OCSP_REQUEST_get_ext_by_crit
# undef OCSP_BASICRESP_get_ext_by_critical
# define OCSP_BASICRESP_get_ext_by_critical OCSP_BASICRESP_get_ext_by_crit
# undef OCSP_SINGLERESP_get_ext_by_critical
# define OCSP_SINGLERESP_get_ext_by_critical OCSP_SINGLERESP_get_ext_by_crit
/* Hack some long DES names */
# undef _ossl_old_des_ede3_cfb64_encrypt
# define _ossl_old_des_ede3_cfb64_encrypt _ossl_odes_ede3_cfb64_encrypt
# undef _ossl_old_des_ede3_ofb64_encrypt
# define _ossl_old_des_ede3_ofb64_encrypt _ossl_odes_ede3_ofb64_encrypt
/* Hack some long EVP names */
# undef OPENSSL_add_all_algorithms_noconf
# define OPENSSL_add_all_algorithms_noconf OPENSSL_add_all_algo_noconf
# undef OPENSSL_add_all_algorithms_conf
# define OPENSSL_add_all_algorithms_conf OPENSSL_add_all_algo_conf
# undef EVP_PKEY_meth_set_verify_recover
# define EVP_PKEY_meth_set_verify_recover EVP_PKEY_meth_set_vrfy_recover
/* Hack some long EC names */
# undef EC_GROUP_set_point_conversion_form
# define EC_GROUP_set_point_conversion_form EC_GROUP_set_point_conv_form
# undef EC_GROUP_get_point_conversion_form
# define EC_GROUP_get_point_conversion_form EC_GROUP_get_point_conv_form
# undef EC_GROUP_clear_free_all_extra_data
# define EC_GROUP_clear_free_all_extra_data EC_GROUP_clr_free_all_xtra_data
# undef EC_KEY_set_public_key_affine_coordinates
# define EC_KEY_set_public_key_affine_coordinates \
EC_KEY_set_pub_key_aff_coords
# undef EC_POINT_set_Jprojective_coordinates_GFp
# define EC_POINT_set_Jprojective_coordinates_GFp \
EC_POINT_set_Jproj_coords_GFp
# undef EC_POINT_get_Jprojective_coordinates_GFp
# define EC_POINT_get_Jprojective_coordinates_GFp \
EC_POINT_get_Jproj_coords_GFp
# undef EC_POINT_set_affine_coordinates_GFp
# define EC_POINT_set_affine_coordinates_GFp EC_POINT_set_affine_coords_GFp
# undef EC_POINT_get_affine_coordinates_GFp
# define EC_POINT_get_affine_coordinates_GFp EC_POINT_get_affine_coords_GFp
# undef EC_POINT_set_compressed_coordinates_GFp
# define EC_POINT_set_compressed_coordinates_GFp EC_POINT_set_compr_coords_GFp
# undef EC_POINT_set_affine_coordinates_GF2m
# define EC_POINT_set_affine_coordinates_GF2m EC_POINT_set_affine_coords_GF2m
# undef EC_POINT_get_affine_coordinates_GF2m
# define EC_POINT_get_affine_coordinates_GF2m EC_POINT_get_affine_coords_GF2m
# undef EC_POINT_set_compressed_coordinates_GF2m
# define EC_POINT_set_compressed_coordinates_GF2m \
EC_POINT_set_compr_coords_GF2m
# undef ec_GF2m_simple_group_clear_finish
# define ec_GF2m_simple_group_clear_finish ec_GF2m_simple_grp_clr_finish
# undef ec_GF2m_simple_group_check_discriminant
# define ec_GF2m_simple_group_check_discriminant ec_GF2m_simple_grp_chk_discrim
# undef ec_GF2m_simple_point_clear_finish
# define ec_GF2m_simple_point_clear_finish ec_GF2m_simple_pt_clr_finish
# undef ec_GF2m_simple_point_set_to_infinity
# define ec_GF2m_simple_point_set_to_infinity ec_GF2m_simple_pt_set_to_inf
# undef ec_GF2m_simple_points_make_affine
# define ec_GF2m_simple_points_make_affine ec_GF2m_simple_pts_make_affine
# undef ec_GF2m_simple_point_set_affine_coordinates
# define ec_GF2m_simple_point_set_affine_coordinates \
ec_GF2m_smp_pt_set_af_coords
# undef ec_GF2m_simple_point_get_affine_coordinates
# define ec_GF2m_simple_point_get_affine_coordinates \
ec_GF2m_smp_pt_get_af_coords
# undef ec_GF2m_simple_set_compressed_coordinates
# define ec_GF2m_simple_set_compressed_coordinates \
ec_GF2m_smp_set_compr_coords
# undef ec_GFp_simple_group_set_curve_GFp
# define ec_GFp_simple_group_set_curve_GFp ec_GFp_simple_grp_set_curve_GFp
# undef ec_GFp_simple_group_get_curve_GFp
# define ec_GFp_simple_group_get_curve_GFp ec_GFp_simple_grp_get_curve_GFp
# undef ec_GFp_simple_group_clear_finish
# define ec_GFp_simple_group_clear_finish ec_GFp_simple_grp_clear_finish
# undef ec_GFp_simple_group_set_generator
# define ec_GFp_simple_group_set_generator ec_GFp_simple_grp_set_generator
# undef ec_GFp_simple_group_get0_generator
# define ec_GFp_simple_group_get0_generator ec_GFp_simple_grp_gt0_generator
# undef ec_GFp_simple_group_get_cofactor
# define ec_GFp_simple_group_get_cofactor ec_GFp_simple_grp_get_cofactor
# undef ec_GFp_simple_point_clear_finish
# define ec_GFp_simple_point_clear_finish ec_GFp_simple_pt_clear_finish
# undef ec_GFp_simple_point_set_to_infinity
# define ec_GFp_simple_point_set_to_infinity ec_GFp_simple_pt_set_to_inf
# undef ec_GFp_simple_points_make_affine
# define ec_GFp_simple_points_make_affine ec_GFp_simple_pts_make_affine
# undef ec_GFp_simple_set_Jprojective_coordinates_GFp
# define ec_GFp_simple_set_Jprojective_coordinates_GFp \
ec_GFp_smp_set_Jproj_coords_GFp
# undef ec_GFp_simple_get_Jprojective_coordinates_GFp
# define ec_GFp_simple_get_Jprojective_coordinates_GFp \
ec_GFp_smp_get_Jproj_coords_GFp
# undef ec_GFp_simple_point_set_affine_coordinates_GFp
# define ec_GFp_simple_point_set_affine_coordinates_GFp \
ec_GFp_smp_pt_set_af_coords_GFp
# undef ec_GFp_simple_point_get_affine_coordinates_GFp
# define ec_GFp_simple_point_get_affine_coordinates_GFp \
ec_GFp_smp_pt_get_af_coords_GFp
# undef ec_GFp_simple_set_compressed_coordinates_GFp
# define ec_GFp_simple_set_compressed_coordinates_GFp \
ec_GFp_smp_set_compr_coords_GFp
# undef ec_GFp_simple_point_set_affine_coordinates
# define ec_GFp_simple_point_set_affine_coordinates \
ec_GFp_smp_pt_set_af_coords
# undef ec_GFp_simple_point_get_affine_coordinates
# define ec_GFp_simple_point_get_affine_coordinates \
ec_GFp_smp_pt_get_af_coords
# undef ec_GFp_simple_set_compressed_coordinates
# define ec_GFp_simple_set_compressed_coordinates \
ec_GFp_smp_set_compr_coords
# undef ec_GFp_simple_group_check_discriminant
# define ec_GFp_simple_group_check_discriminant ec_GFp_simple_grp_chk_discrim
/* Hack som long STORE names */
# undef STORE_method_set_initialise_function
# define STORE_method_set_initialise_function STORE_meth_set_initialise_fn
# undef STORE_method_set_cleanup_function
# define STORE_method_set_cleanup_function STORE_meth_set_cleanup_fn
# undef STORE_method_set_generate_function
# define STORE_method_set_generate_function STORE_meth_set_generate_fn
# undef STORE_method_set_modify_function
# define STORE_method_set_modify_function STORE_meth_set_modify_fn
# undef STORE_method_set_revoke_function
# define STORE_method_set_revoke_function STORE_meth_set_revoke_fn
# undef STORE_method_set_delete_function
# define STORE_method_set_delete_function STORE_meth_set_delete_fn
# undef STORE_method_set_list_start_function
# define STORE_method_set_list_start_function STORE_meth_set_list_start_fn
# undef STORE_method_set_list_next_function
# define STORE_method_set_list_next_function STORE_meth_set_list_next_fn
# undef STORE_method_set_list_end_function
# define STORE_method_set_list_end_function STORE_meth_set_list_end_fn
# undef STORE_method_set_update_store_function
# define STORE_method_set_update_store_function STORE_meth_set_update_store_fn
# undef STORE_method_set_lock_store_function
# define STORE_method_set_lock_store_function STORE_meth_set_lock_store_fn
# undef STORE_method_set_unlock_store_function
# define STORE_method_set_unlock_store_function STORE_meth_set_unlock_store_fn
# undef STORE_method_get_initialise_function
# define STORE_method_get_initialise_function STORE_meth_get_initialise_fn
# undef STORE_method_get_cleanup_function
# define STORE_method_get_cleanup_function STORE_meth_get_cleanup_fn
# undef STORE_method_get_generate_function
# define STORE_method_get_generate_function STORE_meth_get_generate_fn
# undef STORE_method_get_modify_function
# define STORE_method_get_modify_function STORE_meth_get_modify_fn
# undef STORE_method_get_revoke_function
# define STORE_method_get_revoke_function STORE_meth_get_revoke_fn
# undef STORE_method_get_delete_function
# define STORE_method_get_delete_function STORE_meth_get_delete_fn
# undef STORE_method_get_list_start_function
# define STORE_method_get_list_start_function STORE_meth_get_list_start_fn
# undef STORE_method_get_list_next_function
# define STORE_method_get_list_next_function STORE_meth_get_list_next_fn
# undef STORE_method_get_list_end_function
# define STORE_method_get_list_end_function STORE_meth_get_list_end_fn
# undef STORE_method_get_update_store_function
# define STORE_method_get_update_store_function STORE_meth_get_update_store_fn
# undef STORE_method_get_lock_store_function
# define STORE_method_get_lock_store_function STORE_meth_get_lock_store_fn
# undef STORE_method_get_unlock_store_function
# define STORE_method_get_unlock_store_function STORE_meth_get_unlock_store_fn
/* Hack some long TS names */
# undef TS_RESP_CTX_set_status_info_cond
# define TS_RESP_CTX_set_status_info_cond TS_RESP_CTX_set_stat_info_cond
# undef TS_RESP_CTX_set_clock_precision_digits
# define TS_RESP_CTX_set_clock_precision_digits TS_RESP_CTX_set_clk_prec_digits
# undef TS_CONF_set_clock_precision_digits
# define TS_CONF_set_clock_precision_digits TS_CONF_set_clk_prec_digits
/* Hack some long CMS names */
# undef CMS_RecipientInfo_ktri_get0_algs
# define CMS_RecipientInfo_ktri_get0_algs CMS_RecipInfo_ktri_get0_algs
# undef CMS_RecipientInfo_ktri_get0_signer_id
# define CMS_RecipientInfo_ktri_get0_signer_id CMS_RecipInfo_ktri_get0_sigr_id
# undef CMS_OtherRevocationInfoFormat_it
# define CMS_OtherRevocationInfoFormat_it CMS_OtherRevocInfoFormat_it
# undef CMS_KeyAgreeRecipientIdentifier_it
# define CMS_KeyAgreeRecipientIdentifier_it CMS_KeyAgreeRecipIdentifier_it
# undef CMS_OriginatorIdentifierOrKey_it
# define CMS_OriginatorIdentifierOrKey_it CMS_OriginatorIdOrKey_it
# undef cms_SignerIdentifier_get0_signer_id
# define cms_SignerIdentifier_get0_signer_id cms_SignerId_get0_signer_id
# undef CMS_RecipientInfo_kari_get0_orig_id
# define CMS_RecipientInfo_kari_get0_orig_id CMS_RecipInfo_kari_get0_orig_id
# undef CMS_RecipientInfo_kari_get0_reks
# define CMS_RecipientInfo_kari_get0_reks CMS_RecipInfo_kari_get0_reks
# undef CMS_RecipientEncryptedKey_cert_cmp
# define CMS_RecipientEncryptedKey_cert_cmp CMS_RecipEncryptedKey_cert_cmp
# undef CMS_RecipientInfo_kari_set0_pkey
# define CMS_RecipientInfo_kari_set0_pkey CMS_RecipInfo_kari_set0_pkey
# undef CMS_RecipientEncryptedKey_get0_id
# define CMS_RecipientEncryptedKey_get0_id CMS_RecipEncryptedKey_get0_id
# undef CMS_RecipientInfo_kari_orig_id_cmp
# define CMS_RecipientInfo_kari_orig_id_cmp CMS_RecipInfo_kari_orig_id_cmp
/* Hack some long DTLS1 names */
# undef dtls1_retransmit_buffered_messages
# define dtls1_retransmit_buffered_messages dtls1_retransmit_buffered_msgs
/* Hack some long SRP names */
# undef SRP_generate_server_master_secret
# define SRP_generate_server_master_secret SRP_gen_server_master_secret
# undef SRP_generate_client_master_secret
# define SRP_generate_client_master_secret SRP_gen_client_master_secret
/* Hack some long UI names */
# undef UI_method_get_prompt_constructor
# define UI_method_get_prompt_constructor UI_method_get_prompt_constructr
# undef UI_method_set_prompt_constructor
# define UI_method_set_prompt_constructor UI_method_set_prompt_constructr
# endif /* defined OPENSSL_SYS_VMS */
/* Case insensitive linking causes problems.... */
# if defined(OPENSSL_SYS_VMS) || defined(OPENSSL_SYS_OS2)
# undef ERR_load_CRYPTO_strings
# define ERR_load_CRYPTO_strings ERR_load_CRYPTOlib_strings
# undef OCSP_crlID_new
# define OCSP_crlID_new OCSP_crlID2_new
# undef d2i_ECPARAMETERS
# define d2i_ECPARAMETERS d2i_UC_ECPARAMETERS
# undef i2d_ECPARAMETERS
# define i2d_ECPARAMETERS i2d_UC_ECPARAMETERS
# undef d2i_ECPKPARAMETERS
# define d2i_ECPKPARAMETERS d2i_UC_ECPKPARAMETERS
# undef i2d_ECPKPARAMETERS
# define i2d_ECPKPARAMETERS i2d_UC_ECPKPARAMETERS
/*
* These functions do not seem to exist! However, I'm paranoid... Original
* command in x509v3.h: These functions are being redefined in another
* directory, and clash when the linker is case-insensitive, so let's hide
* them a little, by giving them an extra 'o' at the beginning of the name...
*/
# undef X509v3_cleanup_extensions
# define X509v3_cleanup_extensions oX509v3_cleanup_extensions
# undef X509v3_add_extension
# define X509v3_add_extension oX509v3_add_extension
# undef X509v3_add_netscape_extensions
# define X509v3_add_netscape_extensions oX509v3_add_netscape_extensions
# undef X509v3_add_standard_extensions
# define X509v3_add_standard_extensions oX509v3_add_standard_extensions
/* This one clashes with CMS_data_create */
# undef cms_Data_create
# define cms_Data_create priv_cms_Data_create
# endif
#endif /* ! defined HEADER_VMS_IDHACKS_H */

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More