提交 82271cee 编写于 作者: R Richard Levitte

In Message-ID: <003201bfb332$14a07520$0801a8c0@janm.transactionsite.com>,

"Jan Mikkelsen" <janm@transactionsite.com> correctly states that the
OpenSSL header files have #include's and extern "C"'s in an incorrect
order.  Thusly fixed.
上级 22a41547
......@@ -59,10 +59,6 @@
#ifndef HEADER_ASN1_H
#define HEADER_ASN1_H
#ifdef __cplusplus
extern "C" {
#endif
#include <time.h>
#include <openssl/bn.h>
#include <openssl/stack.h>
......@@ -72,6 +68,10 @@ extern "C" {
#include <openssl/vms_idhacks.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
#define V_ASN1_UNIVERSAL 0x00
#define V_ASN1_APPLICATION 0x40
#define V_ASN1_CONTEXT_SPECIFIC 0x80
......
......@@ -59,12 +59,12 @@
#ifndef HEADER_ASN1_MAC_H
#define HEADER_ASN1_MAC_H
#include <openssl/asn1.h>
#ifdef __cplusplus
extern "C" {
#endif
#include <openssl/asn1.h>
#ifndef ASN1_MAC_ERR_LIB
#define ASN1_MAC_ERR_LIB ERR_LIB_ASN1
#endif
......
......@@ -59,14 +59,14 @@
#ifndef HEADER_BIO_H
#define HEADER_BIO_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdio.h>
#include <stdlib.h>
#include <openssl/crypto.h>
#ifdef __cplusplus
extern "C" {
#endif
/* These are the 'types' of BIOs */
#define BIO_TYPE_NONE 0
#define BIO_TYPE_MEM (1|0x0400)
......
......@@ -2,12 +2,12 @@
#ifndef HEADER_COMP_H
#define HEADER_COMP_H
#include <openssl/crypto.h>
#ifdef __cplusplus
extern "C" {
#endif
#include <openssl/crypto.h>
typedef struct comp_method_st
{
int type; /* NID for compression library */
......
......@@ -59,16 +59,16 @@
#ifndef HEADER_CONF_H
#define HEADER_CONF_H
#ifdef __cplusplus
extern "C" {
#endif
#include <openssl/bio.h>
#include <openssl/lhash.h>
#include <openssl/stack.h>
#include <openssl/safestack.h>
#include <openssl/e_os.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef struct
{
char *section;
......
......@@ -59,13 +59,13 @@
#ifndef HEADER_CONF_API_H
#define HEADER_CONF_API_H
#include <openssl/lhash.h>
#include <openssl/conf.h>
#ifdef __cplusplus
extern "C" {
#endif
#include <openssl/lhash.h>
#include <openssl/conf.h>
/* Up until OpenSSL 0.9.5a, this was new_section */
CONF_VALUE *_CONF_new_section(CONF *conf, char *section);
/* Up until OpenSSL 0.9.5a, this was get_section */
......
......@@ -59,10 +59,6 @@
#ifndef HEADER_DES_H
#define HEADER_DES_H
#ifdef __cplusplus
extern "C" {
#endif
#ifdef NO_DES
#error DES is disabled.
#endif
......@@ -75,6 +71,10 @@ extern "C" {
#include <openssl/opensslconf.h> /* DES_LONG */
#include <openssl/e_os2.h> /* OPENSSL_EXTERN */
#ifdef __cplusplus
extern "C" {
#endif
typedef unsigned char des_cblock[8];
typedef /* const */ unsigned char const_des_cblock[8];
/* With "const", gcc 2.8.1 on Solaris thinks that des_cblock *
......
......@@ -59,10 +59,6 @@
#ifndef HEADER_DH_H
#define HEADER_DH_H
#ifdef __cplusplus
extern "C" {
#endif
#ifdef NO_DH
#error DH is disabled.
#endif
......@@ -72,6 +68,10 @@ extern "C" {
#define DH_FLAG_CACHE_MONT_P 0x01
#ifdef __cplusplus
extern "C" {
#endif
typedef struct dh_st DH;
typedef struct dh_method {
......
......@@ -65,10 +65,6 @@
#ifndef HEADER_DSA_H
#define HEADER_DSA_H
#ifdef __cplusplus
extern "C" {
#endif
#ifdef NO_DSA
#error DSA is disabled.
#endif
......@@ -81,6 +77,10 @@ extern "C" {
#define DSA_FLAG_CACHE_MONT_P 0x01
#ifdef __cplusplus
extern "C" {
#endif
typedef struct dsa_st DSA;
typedef struct DSA_SIG_st
......
......@@ -59,14 +59,14 @@
#ifndef HEADER_ERR_H
#define HEADER_ERR_H
#ifdef __cplusplus
extern "C" {
#endif
#ifndef NO_FP_API
#include <stdio.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
/* The following is a bit of a trick to help the object files only contain
* the 'name of the file' string once. Since 'err.h' is protected by the
* HEADER_ERR_H stuff, this should be included only once per file. */
......
......@@ -59,10 +59,6 @@
#ifndef HEADER_ENVELOPE_H
#define HEADER_ENVELOPE_H
#ifdef __cplusplus
extern "C" {
#endif
#ifndef NO_MD2
#include <openssl/md2.h>
#endif
......@@ -147,6 +143,10 @@ extern "C" {
#define EVP_PKEY_DSA4 NID_dsaWithSHA1_2
#define EVP_PKEY_DH NID_dhKeyAgreement
#ifdef __cplusplus
extern "C" {
#endif
/* Type needs to be a bit field
* Sub-type needs to be for variations on the method, as in, can it do
* arbitrary encryption.... */
......
......@@ -58,10 +58,6 @@
#ifndef HEADER_HMAC_H
#define HEADER_HMAC_H
#ifdef __cplusplus
extern "C" {
#endif
#ifdef NO_HMAC
#error HMAC is disabled.
#endif
......@@ -70,6 +66,10 @@ extern "C" {
#define HMAC_MAX_MD_CBLOCK 64
#ifdef __cplusplus
extern "C" {
#endif
typedef struct hmac_ctx_st
{
const EVP_MD *md;
......
......@@ -59,10 +59,6 @@
#ifndef HEADER_IDEA_H
#define HEADER_IDEA_H
#ifdef __cplusplus
extern "C" {
#endif
#ifdef NO_IDEA
#error IDEA is disabled.
#endif
......@@ -74,6 +70,10 @@ extern "C" {
#define IDEA_BLOCK 8
#define IDEA_KEY_LENGTH 16
#ifdef __cplusplus
extern "C" {
#endif
typedef struct idea_key_st
{
IDEA_INT data[9][6];
......
......@@ -63,14 +63,14 @@
#ifndef HEADER_LHASH_H
#define HEADER_LHASH_H
#ifdef __cplusplus
extern "C" {
#endif
#ifndef NO_FP_API
#include <stdio.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
typedef struct lhash_node_st
{
void *data;
......
......@@ -59,10 +59,6 @@
#ifndef HEADER_MD2_H
#define HEADER_MD2_H
#ifdef __cplusplus
extern "C" {
#endif
#ifdef NO_MD2
#error MD2 is disabled.
#endif
......@@ -71,6 +67,10 @@ extern "C" {
#define MD2_BLOCK 16
#include <openssl/opensslconf.h> /* MD2_INT */
#ifdef __cplusplus
extern "C" {
#endif
typedef struct MD2state_st
{
int num;
......
......@@ -59,12 +59,12 @@
#ifndef HEADER_MDC2_H
#define HEADER_MDC2_H
#include <openssl/des.h>
#ifdef __cplusplus
extern "C" {
#endif
#include <openssl/des.h>
#ifdef NO_MDC2
#error MDC2 is disabled.
#endif
......
......@@ -59,10 +59,6 @@
#ifndef HEADER_OBJECTS_H
#define HEADER_OBJECTS_H
#ifdef __cplusplus
extern "C" {
#endif
#define SN_undef "UNDEF"
#define LN_undef "undefined"
#define NID_undef 0
......@@ -967,6 +963,10 @@ extern "C" {
#define OBJ_NAME_ALIAS 0x8000
#ifdef __cplusplus
extern "C" {
#endif
typedef struct obj_name_st
{
int type;
......
......@@ -59,14 +59,14 @@
#ifndef HEADER_PEM_H
#define HEADER_PEM_H
#ifdef __cplusplus
extern "C" {
#endif
#include <openssl/evp.h>
#include <openssl/x509.h>
#include <openssl/pem2.h>
#ifdef __cplusplus
extern "C" {
#endif
#define PEM_BUFSIZE 1024
#define PEM_OBJ_UNDEF 0
......
......@@ -57,4 +57,12 @@
* Ben 30 Jan 1999.
*/
#ifdef __cplusplus
extern "C" {
#endif
void ERR_load_PEM_strings(void);
#ifdef __cplusplus
}
#endif
......@@ -59,13 +59,13 @@
#ifndef HEADER_PKCS12_H
#define HEADER_PKCS12_H
#include <openssl/bio.h>
#include <openssl/x509.h>
#ifdef __cplusplus
extern "C" {
#endif
#include <openssl/bio.h>
#include <openssl/x509.h>
#define PKCS12_KEY_ID 1
#define PKCS12_IV_ID 2
#define PKCS12_MAC_ID 3
......
......@@ -59,10 +59,6 @@
#ifndef HEADER_PKCS7_H
#define HEADER_PKCS7_H
#ifdef __cplusplus
extern "C" {
#endif
#include <openssl/bio.h>
#include <openssl/x509.h>
......@@ -70,6 +66,10 @@ extern "C" {
#include <openssl/vms_idhacks.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
#ifdef WIN32
/* Under Win32 thes are defined in wincrypt.h */
#undef PKCS7_ISSUER_AND_SERIAL
......
......@@ -90,12 +90,26 @@ int RAND_write_file(const char *file);
const char *RAND_file_name(char *file,int num);
int RAND_status(void);
int RAND_egd(const char *path);
void ERR_load_RAND_strings(void);
#ifdef __cplusplus
}
#endif
#if defined(WINDOWS) || defined(WIN32)
#include <windows.h>
#ifdef __cplusplus
extern "C" {
#endif
void RAND_screen(void);
int RAND_event(UINT, WPARAM, LPARAM);
#ifdef __cplusplus
}
#endif
#endif
void ERR_load_RAND_strings(void);
/* BEGIN ERROR CODES */
/* The following lines are auto generated by the script mkerr.pl. Any changes
......@@ -110,8 +124,5 @@ void ERR_load_RAND_strings(void);
/* Reason codes. */
#define RAND_R_PRNG_NOT_SEEDED 100
#ifdef __cplusplus
}
#endif
#endif
......@@ -59,10 +59,6 @@
#ifndef HEADER_RC2_H
#define HEADER_RC2_H
#ifdef __cplusplus
extern "C" {
#endif
#ifdef NO_RC2
#error RC2 is disabled.
#endif
......@@ -74,6 +70,10 @@ extern "C" {
#define RC2_BLOCK 8
#define RC2_KEY_LENGTH 16
#ifdef __cplusplus
extern "C" {
#endif
typedef struct rc2_key_st
{
RC2_INT data[64];
......
......@@ -59,16 +59,16 @@
#ifndef HEADER_RC4_H
#define HEADER_RC4_H
#ifdef __cplusplus
extern "C" {
#endif
#ifdef NO_RC4
#error RC4 is disabled.
#endif
#include <openssl/opensslconf.h> /* RC4_INT */
#ifdef __cplusplus
extern "C" {
#endif
typedef struct rc4_key_st
{
RC4_INT x,y;
......
......@@ -59,10 +59,6 @@
#ifndef HEADER_RSA_H
#define HEADER_RSA_H
#ifdef __cplusplus
extern "C" {
#endif
#include <openssl/bn.h>
#include <openssl/crypto.h>
......@@ -70,6 +66,10 @@ extern "C" {
#error RSA is disabled.
#endif
#ifdef __cplusplus
extern "C" {
#endif
typedef struct rsa_st RSA;
typedef struct rsa_meth_st
......
......@@ -59,10 +59,6 @@
#ifndef HEADER_TXT_DB_H
#define HEADER_TXT_DB_H
#ifdef __cplusplus
extern "C" {
#endif
#include <openssl/stack.h>
#include <openssl/lhash.h>
......@@ -73,6 +69,10 @@ extern "C" {
#define DB_ERROR_NO_INDEX 4
#define DB_ERROR_INSERT_INDEX_CLASH 5
#ifdef __cplusplus
extern "C" {
#endif
typedef struct txt_db_st
{
int num_fields;
......
......@@ -59,10 +59,6 @@
#ifndef HEADER_X509_H
#define HEADER_X509_H
#ifdef __cplusplus
extern "C" {
#endif
#ifdef VMS
#undef X509_REVOKED_get_ext_by_critical
#define X509_REVOKED_get_ext_by_critical X509_REVOKED_get_ext_by_critic
......@@ -87,6 +83,10 @@ extern "C" {
#include <openssl/evp.h>
#ifdef __cplusplus
extern "C" {
#endif
#ifdef WIN32
/* Under Win32 this is defined in wincrypt.h */
#undef X509_NAME
......@@ -445,9 +445,17 @@ typedef struct pkcs8_priv_key_info_st
STACK_OF(X509_ATTRIBUTE) *attributes;
} PKCS8_PRIV_KEY_INFO;
#ifdef __cplusplus
}
#endif
#include <openssl/x509_vfy.h>
#include <openssl/pkcs7.h>
#ifdef __cplusplus
extern "C" {
#endif
#ifdef SSLEAY_MACROS
#define X509_verify(a,r) ASN1_verify((int (*)())i2d_X509_CINF,a->sig_alg,\
a->signature,(char *)a->cert_info,r)
......
......@@ -65,13 +65,13 @@
#ifndef HEADER_X509_VFY_H
#define HEADER_X509_VFY_H
#include <openssl/bio.h>
#include <openssl/crypto.h>
#ifdef __cplusplus
extern "C" {
#endif
#include <openssl/bio.h>
#include <openssl/crypto.h>
/* Outer object */
typedef struct x509_hash_dir_st
{
......
......@@ -58,14 +58,14 @@
#ifndef HEADER_X509V3_H
#define HEADER_X509V3_H
#ifdef __cplusplus
extern "C" {
#endif
#include <openssl/bio.h>
#include <openssl/x509.h>
#include <openssl/conf.h>
#ifdef __cplusplus
extern "C" {
#endif
/* Forward reference */
struct v3_ext_method;
struct v3_ext_ctx;
......
......@@ -3,12 +3,12 @@
#ifndef HEADER_E_OS2_H
#define HEADER_E_OS2_H
#include <openssl/opensslconf.h> /* OPENSSL_UNISTD */
#ifdef __cplusplus
extern "C" {
#endif
#include <openssl/opensslconf.h> /* OPENSSL_UNISTD */
#ifdef MSDOS
# define OPENSSL_UNISTD_IO <io.h>
# define OPENSSL_DECLARE_EXIT extern void exit(int);
......
......@@ -59,13 +59,13 @@
#ifndef HEADER_RSAREF_H
#define HEADER_RSAREF_H
#ifndef NO_RSA
#include <openssl/rsa.h>
#ifdef __cplusplus
extern "C" {
#endif
#ifndef NO_RSA
#include <openssl/rsa.h>
/* RSAeuro */
/*#define RSAref_MAX_BITS 2048*/
......@@ -133,6 +133,10 @@ int R_RandomFinal(RSARandomState *rnd);
void ERR_load_RSAREF_strings(void );
RSA_METHOD *RSA_PKCS1_RSAref(void );
#ifdef __cplusplus
}
#endif
#endif
/* BEGIN ERROR CODES */
......@@ -173,8 +177,4 @@ RSA_METHOD *RSA_PKCS1_RSAref(void );
#define RSAREF_R_SIGNATURE 0x040b
#define RSAREF_R_SIGNATURE_ENCODING 0x040c
#ifdef __cplusplus
}
#endif
#endif
......@@ -59,12 +59,12 @@
#ifndef HEADER_SSL_H
#define HEADER_SSL_H
#include <openssl/safestack.h>
#ifdef __cplusplus
extern "C" {
#endif
#include <openssl/safestack.h>
/* SSLeay version number for ASN.1 encoding of the session information */
/* Version 0 - initial version
* Version 1 - added the optional peer certificate
......@@ -140,6 +140,10 @@ extern "C" {
#define SSL_SENT_SHUTDOWN 1
#define SSL_RECEIVED_SHUTDOWN 2
#ifdef __cplusplus
}
#endif
#include <openssl/crypto.h>
#include <openssl/lhash.h>
#include <openssl/buffer.h>
......@@ -147,6 +151,10 @@ extern "C" {
#include <openssl/pem.h>
#include <openssl/x509.h>
#ifdef __cplusplus
extern "C" {
#endif
#if (defined(NO_RSA) || defined(NO_MD5)) && !defined(NO_SSL2)
#define NO_SSL2
#endif
......@@ -655,11 +663,19 @@ struct ssl_st
* SSLv3/TLS rollback check */
};
#ifdef __cplusplus
}
#endif
#include <openssl/ssl2.h>
#include <openssl/ssl3.h>
#include <openssl/tls1.h> /* This is mostly sslv3 with a few tweaks */
#include <openssl/ssl23.h>
#ifdef __cplusplus
extern "C" {
#endif
/* compatibility */
#define SSL_set_app_data(s,arg) (SSL_set_ex_data(s,0,(char *)arg))
#define SSL_get_app_data(s) (SSL_get_ex_data(s,0))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册