Various changes to make this stuff compile under Win32 and VC++ with and
without -debug option to mk1mf.pl. Change _export to is_export (_export is a reserved word under VC++). Add yucky function prototype function pointer casts. Sanitise the included files in crypto/x509v3. Also changed ssleay.exe target to openssl.exe
This commit is contained in:
parent
60e31c3a4b
commit
e527ba09a6
@ -1,7 +1,8 @@
|
|||||||
/* test vectors from p1ovect1.txt */
|
/* test vectors from p1ovect1.txt */
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <rsa.h>
|
#include "e_os.h"
|
||||||
|
#include "rsa.h"
|
||||||
|
|
||||||
#define SetKey \
|
#define SetKey \
|
||||||
key->n = BN_bin2bn(n, sizeof(n)-1, key->n); \
|
key->n = BN_bin2bn(n, sizeof(n)-1, key->n); \
|
||||||
|
@ -57,12 +57,10 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include "cryptlib.h"
|
||||||
#include <pem.h>
|
#include "conf.h"
|
||||||
#include <asn1_mac.h>
|
#include "asn1.h"
|
||||||
#include <err.h>
|
#include "asn1_mac.h"
|
||||||
#include <objects.h>
|
|
||||||
#include <conf.h>
|
|
||||||
#include "x509v3.h"
|
#include "x509v3.h"
|
||||||
|
|
||||||
#ifndef NOPROTO
|
#ifndef NOPROTO
|
||||||
|
@ -57,22 +57,18 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include "cryptlib.h"
|
||||||
#include <pem.h>
|
#include "conf.h"
|
||||||
#include <asn1_mac.h>
|
|
||||||
#include <err.h>
|
|
||||||
#include <objects.h>
|
|
||||||
#include <conf.h>
|
|
||||||
#include "x509v3.h"
|
#include "x509v3.h"
|
||||||
|
|
||||||
#ifndef NOPROTO
|
#ifndef NOPROTO
|
||||||
STACK *v2i_subject_alt(X509V3_EXT_METHOD *method, X509V3_CTX *ctx, STACK *nval);
|
static STACK *v2i_subject_alt(X509V3_EXT_METHOD *method, X509V3_CTX *ctx, STACK *nval);
|
||||||
STACK *v2i_issuer_alt(X509V3_EXT_METHOD *method, X509V3_CTX *ctx, STACK *nval);
|
static STACK *v2i_issuer_alt(X509V3_EXT_METHOD *method, X509V3_CTX *ctx, STACK *nval);
|
||||||
static int copy_email(X509V3_CTX *ctx, STACK *gens);
|
static int copy_email(X509V3_CTX *ctx, STACK *gens);
|
||||||
static int copy_issuer(X509V3_CTX *ctx, STACK *gens);
|
static int copy_issuer(X509V3_CTX *ctx, STACK *gens);
|
||||||
#else
|
#else
|
||||||
STACK *v2i_issuer_alt();
|
static STACK *v2i_issuer_alt();
|
||||||
STACK *v2i_subject_alt();
|
static STACK *v2i_subject_alt();
|
||||||
static int copy_email();
|
static int copy_email();
|
||||||
static int copy_issuer();
|
static int copy_issuer();
|
||||||
#endif
|
#endif
|
||||||
@ -170,7 +166,7 @@ STACK *ret;
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
STACK *v2i_issuer_alt(method, ctx, nval)
|
static STACK *v2i_issuer_alt(method, ctx, nval)
|
||||||
X509V3_EXT_METHOD *method;
|
X509V3_EXT_METHOD *method;
|
||||||
X509V3_CTX *ctx;
|
X509V3_CTX *ctx;
|
||||||
STACK *nval;
|
STACK *nval;
|
||||||
@ -239,7 +235,7 @@ STACK *gens;
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
STACK *v2i_subject_alt(method, ctx, nval)
|
static STACK *v2i_subject_alt(method, ctx, nval)
|
||||||
X509V3_EXT_METHOD *method;
|
X509V3_EXT_METHOD *method;
|
||||||
X509V3_CTX *ctx;
|
X509V3_CTX *ctx;
|
||||||
STACK *nval;
|
STACK *nval;
|
||||||
|
@ -56,13 +56,12 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include "cryptlib.h"
|
||||||
#include <pem.h>
|
#include "asn1.h"
|
||||||
#include <asn1_mac.h>
|
#include "asn1_mac.h"
|
||||||
#include <err.h>
|
#include "conf.h"
|
||||||
#include <objects.h>
|
|
||||||
#include <conf.h>
|
|
||||||
#include "x509v3.h"
|
#include "x509v3.h"
|
||||||
|
|
||||||
#ifndef NOPROTO
|
#ifndef NOPROTO
|
||||||
|
@ -57,12 +57,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include "cryptlib.h"
|
||||||
#include <pem.h>
|
#include "conf.h"
|
||||||
#include <asn1_mac.h>
|
|
||||||
#include <err.h>
|
|
||||||
#include <objects.h>
|
|
||||||
#include <conf.h>
|
|
||||||
#include "x509v3.h"
|
#include "x509v3.h"
|
||||||
|
|
||||||
#ifndef NOPROTO
|
#ifndef NOPROTO
|
||||||
|
@ -57,12 +57,13 @@
|
|||||||
*/
|
*/
|
||||||
/* extension creation utilities */
|
/* extension creation utilities */
|
||||||
|
|
||||||
#include <stdlib.h>
|
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <string.h>
|
#include "cryptlib.h"
|
||||||
#include <pem.h>
|
#include "conf.h"
|
||||||
#include <conf.h>
|
#include "x509.h"
|
||||||
#include <err.h>
|
|
||||||
#include "x509v3.h"
|
#include "x509v3.h"
|
||||||
|
|
||||||
#ifndef NOPROTO
|
#ifndef NOPROTO
|
||||||
|
@ -57,9 +57,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include "cryptlib.h"
|
||||||
#include <pem.h>
|
|
||||||
#include <err.h>
|
|
||||||
#include "x509v3.h"
|
#include "x509v3.h"
|
||||||
|
|
||||||
static ASN1_ENUMERATED *asn1_enumerated_new();
|
static ASN1_ENUMERATED *asn1_enumerated_new();
|
||||||
|
@ -56,13 +56,11 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include "cryptlib.h"
|
||||||
#include <pem.h>
|
#include "asn1.h"
|
||||||
#include <asn1_mac.h>
|
#include "conf.h"
|
||||||
#include <err.h>
|
|
||||||
#include <objects.h>
|
|
||||||
#include <conf.h>
|
|
||||||
#include "x509v3.h"
|
#include "x509v3.h"
|
||||||
|
|
||||||
#ifndef NOPROTO
|
#ifndef NOPROTO
|
||||||
|
@ -56,13 +56,12 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include "cryptlib.h"
|
||||||
#include <pem.h>
|
#include "asn1.h"
|
||||||
#include <asn1_mac.h>
|
#include "asn1_mac.h"
|
||||||
#include <err.h>
|
#include "conf.h"
|
||||||
#include <objects.h>
|
|
||||||
#include <conf.h>
|
|
||||||
#include "x509v3.h"
|
#include "x509v3.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -56,13 +56,11 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include "cryptlib.h"
|
||||||
#include <pem.h>
|
#include "asn1.h"
|
||||||
#include <asn1_mac.h>
|
#include "conf.h"
|
||||||
#include <err.h>
|
|
||||||
#include <objects.h>
|
|
||||||
#include <conf.h>
|
|
||||||
#include "x509v3.h"
|
#include "x509v3.h"
|
||||||
|
|
||||||
#ifndef NOPROTO
|
#ifndef NOPROTO
|
||||||
|
@ -57,9 +57,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include "cryptlib.h"
|
||||||
#include <pem.h>
|
|
||||||
#include <err.h>
|
|
||||||
#include "x509v3.h"
|
#include "x509v3.h"
|
||||||
|
|
||||||
static ASN1_INTEGER *asn1_integer_new();
|
static ASN1_INTEGER *asn1_integer_new();
|
||||||
|
@ -57,10 +57,9 @@
|
|||||||
*/
|
*/
|
||||||
/* X509 v3 extension utilities */
|
/* X509 v3 extension utilities */
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdio.h>
|
||||||
#include <pem.h>
|
#include "cryptlib.h"
|
||||||
#include <conf.h>
|
#include "conf.h"
|
||||||
#include <err.h>
|
|
||||||
#include "x509v3.h"
|
#include "x509v3.h"
|
||||||
|
|
||||||
static STACK *ext_list = NULL;
|
static STACK *ext_list = NULL;
|
||||||
|
@ -57,12 +57,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include "cryptlib.h"
|
||||||
#include <pem.h>
|
#include "asn1.h"
|
||||||
#include <asn1_mac.h>
|
#include "asn1_mac.h"
|
||||||
#include <err.h>
|
|
||||||
#include <objects.h>
|
|
||||||
#include <conf.h>
|
|
||||||
#include "x509v3.h"
|
#include "x509v3.h"
|
||||||
|
|
||||||
#ifndef NOPROTO
|
#ifndef NOPROTO
|
||||||
|
@ -57,10 +57,9 @@
|
|||||||
*/
|
*/
|
||||||
/* X509 v3 extension utilities */
|
/* X509 v3 extension utilities */
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdio.h>
|
||||||
#include <pem.h>
|
#include "cryptlib.h"
|
||||||
#include <conf.h>
|
#include "conf.h"
|
||||||
#include <err.h>
|
|
||||||
#include "x509v3.h"
|
#include "x509v3.h"
|
||||||
|
|
||||||
/* Extension printing routines */
|
/* Extension printing routines */
|
||||||
|
@ -56,14 +56,9 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include "cryptlib.h"
|
||||||
#include <ctype.h>
|
|
||||||
#include <pem.h>
|
|
||||||
#include <asn1_mac.h>
|
|
||||||
#include <err.h>
|
|
||||||
#include <objects.h>
|
|
||||||
#include <conf.h>
|
|
||||||
#include "x509v3.h"
|
#include "x509v3.h"
|
||||||
|
|
||||||
#ifndef NOPROTO
|
#ifndef NOPROTO
|
||||||
|
@ -57,12 +57,11 @@
|
|||||||
*/
|
*/
|
||||||
/* X509 v3 extension utilities */
|
/* X509 v3 extension utilities */
|
||||||
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <string.h>
|
#include <stdio.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <pem.h>
|
#include "cryptlib.h"
|
||||||
#include <conf.h>
|
#include "conf.h"
|
||||||
#include <err.h>
|
|
||||||
#include "x509v3.h"
|
#include "x509v3.h"
|
||||||
|
|
||||||
static char *strip_spaces(char *name);
|
static char *strip_spaces(char *name);
|
||||||
|
@ -55,11 +55,14 @@
|
|||||||
* Hudson (tjh@cryptsoft.com).
|
* Hudson (tjh@cryptsoft.com).
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <pem.h>
|
#include "cryptlib.h"
|
||||||
#include <objects.h>
|
#include "asn1.h"
|
||||||
#include <conf.h>
|
#include "asn1_mac.h"
|
||||||
#include <err.h>
|
#include "conf.h"
|
||||||
|
#include "x509.h"
|
||||||
#include "x509v3.h"
|
#include "x509v3.h"
|
||||||
|
|
||||||
/* Test application to add extensions from a config file */
|
/* Test application to add extensions from a config file */
|
||||||
|
@ -55,10 +55,15 @@
|
|||||||
* Hudson (tjh@cryptsoft.com).
|
* Hudson (tjh@cryptsoft.com).
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#include <pem.h>
|
|
||||||
#include <objects.h>
|
|
||||||
#include <conf.h>
|
|
||||||
#include <err.h>
|
#include <stdio.h>
|
||||||
|
#include "cryptlib.h"
|
||||||
|
#include "asn1.h"
|
||||||
|
#include "asn1_mac.h"
|
||||||
|
#include "conf.h"
|
||||||
|
#include "x509.h"
|
||||||
#include "x509v3.h"
|
#include "x509v3.h"
|
||||||
|
|
||||||
int main(argc, argv)
|
int main(argc, argv)
|
||||||
|
@ -334,7 +334,7 @@ X509V3_EXT_METHOD *X509V3_EXT_get();
|
|||||||
X509V3_EXT_METHOD *X509V3_EXT_get_nid();
|
X509V3_EXT_METHOD *X509V3_EXT_get_nid();
|
||||||
int X509V3_add_standard_extensions();
|
int X509V3_add_standard_extensions();
|
||||||
STACK *X509V3_parse_list();
|
STACK *X509V3_parse_list();
|
||||||
char *X509V3_EXT_get_d2i();
|
char *X509V3_EXT_d2i();
|
||||||
|
|
||||||
char *hex_to_string();
|
char *hex_to_string();
|
||||||
unsigned char *string_to_hex();
|
unsigned char *string_to_hex();
|
||||||
|
@ -623,7 +623,11 @@ char *parg;
|
|||||||
}
|
}
|
||||||
/* break; */
|
/* break; */
|
||||||
case SSL_CTRL_SET_TMP_RSA_CB:
|
case SSL_CTRL_SET_TMP_RSA_CB:
|
||||||
|
#ifndef NOPROTO
|
||||||
|
cert->rsa_tmp_cb=(RSA *(*)(SSL *, int, int))parg;
|
||||||
|
#else
|
||||||
cert->rsa_tmp_cb=(RSA *(*)())parg;
|
cert->rsa_tmp_cb=(RSA *(*)())parg;
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
#ifndef NO_DH
|
#ifndef NO_DH
|
||||||
@ -650,7 +654,11 @@ char *parg;
|
|||||||
}
|
}
|
||||||
/*break; */
|
/*break; */
|
||||||
case SSL_CTRL_SET_TMP_DH_CB:
|
case SSL_CTRL_SET_TMP_DH_CB:
|
||||||
|
#ifndef NOPROTO
|
||||||
|
cert->dh_tmp_cb=(DH *(*)(SSL *, int, int))parg;
|
||||||
|
#else
|
||||||
cert->dh_tmp_cb=(DH *(*)())parg;
|
cert->dh_tmp_cb=(DH *(*)())parg;
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
/* A Thawte special :-) */
|
/* A Thawte special :-) */
|
||||||
|
@ -616,7 +616,7 @@ SSL_CIPHER *cipher;
|
|||||||
char *buf;
|
char *buf;
|
||||||
int len;
|
int len;
|
||||||
{
|
{
|
||||||
int _export,pkl,kl;
|
int is_export,pkl,kl;
|
||||||
char *ver,*exp;
|
char *ver,*exp;
|
||||||
char *kx,*au,*enc,*mac;
|
char *kx,*au,*enc,*mac;
|
||||||
unsigned long alg,alg2;
|
unsigned long alg,alg2;
|
||||||
@ -625,10 +625,10 @@ int len;
|
|||||||
alg=cipher->algorithms;
|
alg=cipher->algorithms;
|
||||||
alg2=cipher->algorithm2;
|
alg2=cipher->algorithm2;
|
||||||
|
|
||||||
_export=SSL_IS_EXPORT(alg);
|
is_export=SSL_IS_EXPORT(alg);
|
||||||
pkl=SSL_EXPORT_PKEYLENGTH(alg);
|
pkl=SSL_EXPORT_PKEYLENGTH(alg);
|
||||||
kl=SSL_EXPORT_KEYLENGTH(alg);
|
kl=SSL_EXPORT_KEYLENGTH(alg);
|
||||||
exp=_export?" export":"";
|
exp=is_export?" export":"";
|
||||||
|
|
||||||
if (alg & SSL_SSLV2)
|
if (alg & SSL_SSLV2)
|
||||||
ver="SSLv2";
|
ver="SSLv2";
|
||||||
@ -640,7 +640,7 @@ int len;
|
|||||||
switch (alg&SSL_MKEY_MASK)
|
switch (alg&SSL_MKEY_MASK)
|
||||||
{
|
{
|
||||||
case SSL_kRSA:
|
case SSL_kRSA:
|
||||||
kx=_export?(pkl == 512 ? "RSA(512)" : "RSA(1024)"):"RSA";
|
kx=is_export?(pkl == 512 ? "RSA(512)" : "RSA(1024)"):"RSA";
|
||||||
break;
|
break;
|
||||||
case SSL_kDHr:
|
case SSL_kDHr:
|
||||||
kx="DH/RSA";
|
kx="DH/RSA";
|
||||||
@ -652,7 +652,7 @@ int len;
|
|||||||
kx="Fortezza";
|
kx="Fortezza";
|
||||||
break;
|
break;
|
||||||
case SSL_kEDH:
|
case SSL_kEDH:
|
||||||
kx=_export?(pkl == 512 ? "DH(512)" : "DH(1024)"):"DH";
|
kx=is_export?(pkl == 512 ? "DH(512)" : "DH(1024)"):"DH";
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
kx="unknown";
|
kx="unknown";
|
||||||
@ -681,17 +681,17 @@ int len;
|
|||||||
switch (alg&SSL_ENC_MASK)
|
switch (alg&SSL_ENC_MASK)
|
||||||
{
|
{
|
||||||
case SSL_DES:
|
case SSL_DES:
|
||||||
enc=(_export && kl == 5)?"DES(40)":"DES(56)";
|
enc=(is_export && kl == 5)?"DES(40)":"DES(56)";
|
||||||
break;
|
break;
|
||||||
case SSL_3DES:
|
case SSL_3DES:
|
||||||
enc="3DES(168)";
|
enc="3DES(168)";
|
||||||
break;
|
break;
|
||||||
case SSL_RC4:
|
case SSL_RC4:
|
||||||
enc=_export?(kl == 5 ? "RC4(40)" : "RC4(56)")
|
enc=is_export?(kl == 5 ? "RC4(40)" : "RC4(56)")
|
||||||
:((alg2&SSL2_CF_8_BYTE_ENC)?"RC4(64)":"RC4(128)");
|
:((alg2&SSL2_CF_8_BYTE_ENC)?"RC4(64)":"RC4(128)");
|
||||||
break;
|
break;
|
||||||
case SSL_RC2:
|
case SSL_RC2:
|
||||||
enc=_export?(kl == 5 ? "RC2(40)" : "RC2(56)"):"RC2(128)";
|
enc=is_export?(kl == 5 ? "RC2(40)" : "RC2(56)"):"RC2(128)";
|
||||||
break;
|
break;
|
||||||
case SSL_IDEA:
|
case SSL_IDEA:
|
||||||
enc="IDEA(128)";
|
enc="IDEA(128)";
|
||||||
|
@ -1209,7 +1209,7 @@ PKEY_USAGE_PERIOD_new 1234
|
|||||||
PKEY_USAGE_PERIOD_free 1235
|
PKEY_USAGE_PERIOD_free 1235
|
||||||
v2i_GENERAL_NAMES 1236
|
v2i_GENERAL_NAMES 1236
|
||||||
i2s_ASN1_INTEGER 1237
|
i2s_ASN1_INTEGER 1237
|
||||||
X509V3_EXT_get_d2i 1238
|
X509V3_EXT_d2i 1238
|
||||||
name_cmp 1239
|
name_cmp 1239
|
||||||
str_dup 1240
|
str_dup 1240
|
||||||
i2s_ASN1_ENUMERATED 1241
|
i2s_ASN1_ENUMERATED 1241
|
||||||
|
@ -249,8 +249,8 @@ $link="$bin_dir$link" if ($link !~ /^\$/);
|
|||||||
$INSTALLTOP =~ s|/|$o|g;
|
$INSTALLTOP =~ s|/|$o|g;
|
||||||
|
|
||||||
$defs= <<"EOF";
|
$defs= <<"EOF";
|
||||||
# This makefile has been automatically generated from the SSLeay distribution.
|
# This makefile has been automatically generated from the OpenSSL distribution.
|
||||||
# This single makefile will build the complete SSLeay distribution and
|
# This single makefile will build the complete OpenSSL distribution and
|
||||||
# by default leave the 'intertesting' output files in .${o}out and the stuff
|
# by default leave the 'intertesting' output files in .${o}out and the stuff
|
||||||
# that needs deleting in .${o}tmp.
|
# that needs deleting in .${o}tmp.
|
||||||
# The file was generated by running 'make makefile.one', which
|
# The file was generated by running 'make makefile.one', which
|
||||||
@ -277,7 +277,7 @@ SHLIB_EX_OBJ=$shlib_ex_obj
|
|||||||
# be added
|
# be added
|
||||||
EX_LIBS=$ex_libs
|
EX_LIBS=$ex_libs
|
||||||
|
|
||||||
# The SSLeay directory
|
# The OpenSSL directory
|
||||||
SRC_D=$src_dir
|
SRC_D=$src_dir
|
||||||
|
|
||||||
LINK=$link
|
LINK=$link
|
||||||
@ -321,7 +321,7 @@ ASM=$bin_dir$asm
|
|||||||
# You should not need to touch anything below this point
|
# You should not need to touch anything below this point
|
||||||
######################################################
|
######################################################
|
||||||
|
|
||||||
E_EXE=ssleay
|
E_EXE=openssl
|
||||||
SSL=$ssl
|
SSL=$ssl
|
||||||
CRYPTO=$crypto
|
CRYPTO=$crypto
|
||||||
RSAGLUE=$RSAglue
|
RSAGLUE=$RSAglue
|
||||||
|
Loading…
x
Reference in New Issue
Block a user