Commit 8e10f2b3 authored by Ulf Möller's avatar Ulf Möller
Browse files

Move all autogenerated header file parts to crypto/opensslconf.h.

parent cb145b99
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -5,6 +5,9 @@

 Changes between 0.9.2b and 0.9.3

  *) Move the autogenerated header file parts to crypto/opensslconf.h.
     [Ulf Möller]

  *) Fix new 56-bit DES export ciphersuites: they were using 7 bytes instead of
     8 of keying material. Merlin has also confirmed interop with this fix
     between OpenSSL and Baltimore C/SSL 2.0 and J/SSL 2.0.
+20 −203
Original line number Diff line number Diff line
@@ -91,17 +91,16 @@ my %table=(
"debug-ben",	"gcc:-DBN_DEBUG -DREF_CHECK -DCRYPTO_MDEBUG -O2 -Wall -Wshadow -Werror -pipe:::::",
"debug-ben-strict",	"gcc:-DBN_DEBUG -DREF_CHECK -DCRYPTO_MDEBUG -DCONST_STRICT -O2 -Wall -Wshadow -Werror -Wpointer-arith -Wcast-qual -Wwrite-strings -pipe:::::",
"debug-rse","cc:-DTERMIOS -DL_ENDIAN -pipe -O -g -ggdb3 -Wall::BN_LLONG $x86_gcc_des $x86_gcc_opts:$x86_elf_asm",
"debug-solaris-sparc-gcc","gcc:-O3 -g -mv8 -Wall -DB_ENDIAN:-lsocket -lnsl:BN_LLONG RC4_CHAR DES_UNROLL BF_PTR:::",
"dist",		"cc:-O:::::",

# Basic configs that should work on any box
"gcc",		"gcc:-O3::BN_LLONG:::",
"cc",		"cc:-O:::::",


# Solaris setups
"solaris-x86-gcc","gcc:-O3 -fomit-frame-pointer -m486 -Wall -DL_ENDIAN:-lsocket -lnsl:BN_LLONG $x86_gcc_des $x86_gcc_opts:$x86_sol_asm",
"solaris-sparc-gcc","gcc:-O3 -fomit-frame-pointer -mv8 -Wall -DB_ENDIAN:-lsocket -lnsl:BN_LLONG RC4_CHAR DES_UNROLL BF_PTR:asm/sparcv8.o::",
"debug-solaris-sparc-gcc","gcc:-O3 -g -mv8 -Wall -DB_ENDIAN:-lsocket -lnsl:BN_LLONG RC4_CHAR DES_UNROLL BF_PTR:::",

# DO NOT use /xO[34] on sparc with SC3.0. 
# It is broken, and will not pass the tests
@@ -223,11 +222,11 @@ my %table=(
"VC-WIN32","cl:::BN_LLONG RC4_INDEX ${x86_gcc_opts}:::",
"VC-WIN16","cl:::MD2_CHAR DES_UNROLL DES_PTR RC4_INDEX THIRTY_TWO_BIT:::",
"VC-W31-16","cl:::BN_LLONG MD2_CHAR DES_UNROLL DES_PTR RC4_INDEX SIXTEEN_BIT:::",
"VC-W31-32","cl:::MD2_CHAR DES_UNROLL DES_PTR RC4_INDEX THIRTY_TWO_BIT:::",
"VC-W31-32","cl:::BN_LLONG MD2_CHAR DES_UNROLL DES_PTR RC4_INDEX THIRTY_TWO_BIT:::",
"VC-MSDOS","cl:::BN_LLONG MD2_CHAR DES_UNROLL DES_PTR RC4_INDEX SIXTEEN_BIT:::",

# Borland C++ 4.5
"BC-32","bcc32:::DES_PTR RC4_INDEX:::",
"BC-32","bcc32:::BN_LLONG DES_PTR RC4_INDEX:::",
"BC-16","bcc:::BN_LLONG DES_PTR RC4_INDEX SIXTEEN_BIT:::",

# CygWin32
@@ -246,25 +245,10 @@ my %table=(

);

# Miscellaneous hacks: this is designed to allow environments where the "one
# makefile" option does not auto build all files.
## # The first six fields are the hard coded versions of the stuff generated by
## # ctx_size for pem.h: that is EVP_ENCODE_CTX_SIZE, EVP_MD_SIZE EVP_MD_CTX_SIZE,
## # EVP_CIPHER_SIZE, EVP_CIPHER_CTX_SIZE and EVP_MAX_MD_SIZE respectively.
# If the seventh field is 1 then auto generate
# crypto/date.h
# Need to add Win16 and others here.

my %misc_table = (
"VC-WIN32", 	"96:60:152:40:4212:20:1",
"VC-NT", 	"96:60:152:40:4212:20:1"
);

my @WinTargets=qw(VC-NT VC-WIN32 VC-WIN16 VC-W31-16 VC-W31-32 VC-MSDOS BC-32
	BC-16 CygWin32);

my $no_asm=0;
my $postfix="org";
my $Makefile="Makefile.ssl";
my $des_locl="crypto/des/des_locl.h";
my $des	="crypto/des/des.h";
@@ -481,10 +465,8 @@ foreach (sort split(/\s+/,$bn_ops))
	($b64l,$b64,$b32,$b16,$b8)=(0,0,0,0,1) if /EIGHT_BIT/;
	}

((my $in=$bn) =~ s/\.([^.]+)/.$postfix/);
my $n=&file_new($bn);
open(IN,"<".$in) || die "unable to read $bn:$!\n";
open(OUT,">$n") || die "unable to read $n:$!\n";
open(IN,'<crypto/opensslconf.h.in') || die "unable to read crypto/opensslconf.h.in:$!\n";
open(OUT,'>crypto/opensslconf.h') || die "unable to create crypto/opensslconf.h:$!\n";
while (<IN>)
	{
	if	(/^#((define)|(undef))\s+SIXTY_FOUR_BIT_LONG/)
@@ -499,38 +481,10 @@ while (<IN>)
		{ printf OUT "#%s EIGHT_BIT\n",($b8)?"define":"undef"; }
	elsif	(/^#((define)|(undef))\s+BN_LLONG\s*$/)
		{ printf OUT "#%s BN_LLONG\n",($bn_ll)?"define":"undef"; }
	else
		{ print OUT $_; }
	}
close(IN);
close(OUT);
&Rename($bn,&file_old($bn));
&Rename($n,$bn);

(($in=$des) =~ s/\.([^.]+)/.$postfix/);
$n=&file_new($des);
open(IN,"<".$in) || die "unable to read $des:$!\n";
open(OUT,">$n") || die "unable to read $n:$!\n";
while (<IN>)
	{
	if	(/^\#define\s+DES_LONG\s+.*/)
	elsif	(/^\#define\s+DES_LONG\s+.*/)
		{ printf OUT "#define DES_LONG unsigned %s\n",
			($des_int)?'int':'long'; }
	else
		{ print OUT $_; }
	}
close(IN);
close(OUT);
&Rename($des,&file_old($des));
&Rename($n,$des);

(($in=$des_locl) =~ s/\.([^.]+)/.$postfix/);
$n=&file_new($des_locl);
open(IN,"<".$in) || die "unable to read $des_locl:$!\n";
open(OUT,">$n") || die "unable to read $n:$!\n";
while (<IN>)
	{
	if	(/^\#(define|undef)\s+DES_PTR/)
	elsif	(/^\#(define|undef)\s+DES_PTR/)
		{ printf OUT "#%s DES_PTR\n",($des_ptr)?'define':'undef'; }
	elsif	(/^\#(define|undef)\s+DES_RISC1/)
		{ printf OUT "#%s DES_RISC1\n",($des_risc1)?'define':'undef'; }
@@ -538,101 +492,17 @@ while (<IN>)
		{ printf OUT "#%s DES_RISC2\n",($des_risc2)?'define':'undef'; }
	elsif	(/^\#(define|undef)\s+DES_UNROLL/)
		{ printf OUT "#%s DES_UNROLL\n",($des_unroll)?'define':'undef'; }
	else
		{ print OUT $_; }
	}
close(IN);
close(OUT);
&Rename($des_locl,&file_old($des_locl));
&Rename($n,$des_locl);

(($in=$rc4) =~ s/\.([^.]+)/.$postfix/);
$n=&file_new($rc4);
open(IN,"<".$in) || die "unable to read $rc4:$!\n";
open(OUT,">$n") || die "unable to read $n:$!\n";
while (<IN>)
	{
	if	(/^#define\s+RC4_INT\s/)
	elsif	(/^#define\s+RC4_INT\s/)
		{ printf OUT "#define RC4_INT unsigned %s\n",$type[$rc4_int]; }
	else
		{ print OUT $_; }
	}
close(IN);
close(OUT);
&Rename($rc4,&file_old($rc4));
&Rename($n,$rc4);

(($in=$rc4_locl) =~ s/\.([^.]+)/.$postfix/);
$n=&file_new($rc4_locl);
open(IN,"<".$in) || die "unable to read $rc4_locl:$!\n";
open(OUT,">$n") || die "unable to read $n:$!\n";
while (<IN>)
	{
	if	(/^#((define)|(undef))\s+RC4_INDEX/)
	elsif	(/^#((define)|(undef))\s+RC4_INDEX/)
		{ printf OUT "#%s RC4_INDEX\n",($rc4_idx)?"define":"undef"; }
	else
		{ print OUT $_; }
	}
close(IN);
close(OUT);
&Rename($rc4_locl,&file_old($rc4_locl));
&Rename($n,$rc4_locl);

(($in=$md2) =~ s/\.([^.]+)/.$postfix/);
$n=&file_new($md2);
open(IN,"<".$in) || die "unable to read $bn:$!\n";
open(OUT,">$n") || die "unable to read $n:$!\n";
while (<IN>)
	{
	if	(/^#define\s+MD2_INT\s/)
	elsif	(/^#define\s+MD2_INT\s/)
		{ printf OUT "#define MD2_INT unsigned %s\n",$type[$md2_int]; }
	else
		{ print OUT $_; }
	}
close(IN);
close(OUT);
&Rename($md2,&file_old($md2));
&Rename($n,$md2);

(($in=$idea) =~ s/\.([^.]+)/.$postfix/);
$n=&file_new($idea);
open(IN,"<".$in) || die "unable to read $idea:$!\n";
open(OUT,">$n") || die "unable to read $n:$!\n";
while (<IN>)
	{
	if	(/^#define\s+IDEA_INT\s/)
	elsif	(/^#define\s+IDEA_INT\s/)
		{printf OUT "#define IDEA_INT unsigned %s\n",$type[$idea_int];}
	else
		{ print OUT $_; }
	}
close(IN);
close(OUT);
&Rename($idea,&file_old($idea));
&Rename($n,$idea);

(($in=$rc2) =~ s/\.([^.]+)/.$postfix/);
$n=&file_new($rc2);
open(IN,"<".$in) || die "unable to read $rc2:$!\n";
open(OUT,">$n") || die "unable to read $n:$!\n";
while (<IN>)
	{
	if	(/^#define\s+RC2_INT\s/)
	elsif	(/^#define\s+RC2_INT\s/)
		{printf OUT "#define RC2_INT unsigned %s\n",$type[$rc2_int];}
	else
		{ print OUT $_; }
	}
close(IN);
close(OUT);
&Rename($rc2,&file_old($rc2));
&Rename($n,$rc2);

(($in=$bf) =~ s/\.([^.]+)/.$postfix/);
$n=&file_new($bf);
open(IN,"<".$in) || die "unable to read $bf:$!\n";
open(OUT,">$n") || die "unable to read $n:$!\n";
while (<IN>)
	{
	if (/^#(define|undef)\s+BF_PTR/)
	elsif (/^#(define|undef)\s+BF_PTR/)
		{
		printf OUT "#undef BF_PTR\n" if $bf_ptr == 0;
		printf OUT "#define BF_PTR\n" if $bf_ptr == 1;
@@ -641,55 +511,9 @@ while (<IN>)
	else
		{ print OUT $_; }
	}
close(IN);
close(OUT);
&Rename($bf,&file_old($bf));
&Rename($n,$bf);

# Now the miscellaneous fixups

if(defined $misc_table{$target}) {
	my ($enc_ctx, $md_size, $md_ctx_size, $cipher_size, $cipher_ctx_size,
		$max_md_size, $date_fix) = 
		split(/\s*:\s*/,$misc_table{$target} . ":", -1);

## #print "EVP_ENCODE_CTX_SIZE $enc_ctx\n";
## #print "EVP_MD_SIZE $md_size\n";
## #print "EVP_MD_CTX_SIZE $md_ctx_size\n";
## #print "EVP_CIPHER_SIZE $cipher_size\n";
## #print "EVP_CIPHER_CTX_SIZE $cipher_ctx_size\n";
## #print "EVP_MAX_MD_SIZE $max_md_size\n";
#printf "Date fix: %s\n", $date_fix ? "Yes" : "No";

# Fix the date

if($date_fix) {
	open (OUT,">crypto/date.h") || die "Can't open date.h";
	printf OUT "#define DATE \"%s\"\n", scalar gmtime();
	close(OUT);
}

## open (IN, "crypto/pem/pem.org") || die "Can't open crypto/pem/pem.org";
## open (OUT, ">crypto/pem/pem.h") || die "Can't create crypto/pem/pem.h";
## 
## # Now fix up pem.h
## while(<IN>) {
## 	chop;
## 	s/^(#define EVP_ENCODE_CTX_SIZE).*$/$1 $enc_ctx/;
## 	s/^(#define EVP_MD_SIZE).*$/$1 $md_size/;
## 	s/^(#define EVP_MD_CTX_SIZE).*$/$1 $md_ctx_size/;
## 	s/^(#define EVP_CIPHER_SIZE).*$/$1 $cipher_size/;
## 	s/^(#define EVP_CIPHER_CTX_SIZE).*$/$1 $cipher_ctx_size/;
## 	s/^(#define EVP_MAX_MD_SIZE).*$/$1 $max_md_size/;
## 	print OUT "$_\n";
## }
## 
## close (IN);
## close (OUT);


}

print "SIXTY_FOUR_BIT_LONG mode\n" if $b64l;
print "SIXTY_FOUR_BIT mode\n" if $b64;
print "THIRTY_TWO_BIT mode\n" if $b32;
@@ -709,6 +533,12 @@ print "RC2 uses u$type[$rc2_int]\n" if $rc2_int != $def_int;
print "BF_PTR used\n" if $bf_ptr == 1; 
print "BF_PTR2 used\n" if $bf_ptr == 2; 

if($IsWindows) {
	open (OUT,">crypto/date.h") || die "Can't open date.h";
	printf OUT "#define DATE \"%s\"\n", scalar gmtime();
	close(OUT);
}

system 'make -f Makefile.ssl links' if !$IsWindows;

exit(0);
@@ -727,19 +557,6 @@ sub bad_target
	print STDERR "\n";
	}

sub Rename
	{
	my($from,$to)=@_;
	unlink($to);
	if(!rename($from,$to))
	    {
	     -e $from && die "unable to rename $from to $to:$!\n";
	    }
	}

sub file_new { my($a)=@_; $a =~ s/(\.[^.]+$|$)/.new/; $a; }
sub file_old { my($a)=@_; $a =~ s/(\.[^.]+$|$)/.old/; $a; }

sub which
	{
	my($name)=@_;
+2 −16
Original line number Diff line number Diff line

  OpenSSL STATUS                           Last modified at
  ______________                           $Date: 1999/04/16 23:57:00 $
  ______________                           $Date: 1999/04/21 17:30:41 $

  DEVELOPMENT STATE

@@ -14,12 +14,8 @@

    o Compilation warnings: ctype-related int vs. char
    o Compilation error: "unsigned long*" and "int*" under AIX
    o Undefined BN symbols in assembler stuff on Solaris
      (see posting "openssl-SNAP-19990308-2130 on Solaris-2.6 SC4" in openssl-dev)
    o BN assembler code in r3000.s, mips*.s and pa-risc*.s is broken
    o BSD/OS: assembler functions must not have leading underscores
    o Niels Poppe reports that RSA fails with alpha.s
	o exptest fails with irix64-*
	o exptest and rsa_oaep_test fail with irix64-*
      (Don Badrak <dbadrak@geo.census.gov>: "Re: Problems to compile openssl
	  on IRIX 6.2", openssl-users)
    o BN_add test fails on Caldera OpenLinux 1.3
@@ -31,13 +27,10 @@
  AVAILABLE PATCHES

    o OCSP (titchenert@certco.com) 
    o unsigned vs. non-unsigned (levitte@stacken.kth.se)
    o Install prefix for packagers (dharris@drh.net)
    o getenv in ca.c and x509_def.c (jaltman@watsun.cc.columbia.edu)
    o linux dynamic libs (colin@field.medicine.adelaide.edu.au)
    o MingW support (niklas@canit.se)
    o SPARC v8 assembler implementations of bn_asm.c
      (appro@fy.chalmers.se)

  IN PROGRESS

@@ -99,13 +92,6 @@
                      itself. Then we can avoid a lot of those platform checks
                      which are currently in Configure.

       2. The xxx.org -> xxx.h generation:
          It's not obvious for which file xxx.org is the source.
          Suggestion: Rename xxx.org to xxx.h.in (Autoconf style), this way
                      one sees that xxx.h.in is the input for xxx.h

          Status: Mark +1

    o  The installation under "make install" produces a very
       installation layout: $prefix/certs and $prefix/private dirs.  That's
       not nice. Ralf suggests to move the two certs and private dirs either
+5 −29
Original line number Diff line number Diff line
@@ -56,27 +56,9 @@
 * [including the GNU Public Licence.]
 */

/* WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
 *
 * Always modify bf_locl.org since bf_locl.h is automatically generated from
 * it during SSLeay configuration.
 *
 * WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
 */

/* 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 )                    /* Newer Sparc's */
#  define BF_PTR
#elif defined( __ultrix )     /* Older MIPS */
#  define BF_PTR
#elif defined( __sgi )                /* Newer MIPS */
#  define BF_PTR
#endif /* Systems-specific speed defines */
#ifndef _HEADER_BF_LOCL_H
#define _HEADER_BF_LOCL_H
#include "opensslconf.h" /* BF_PTR, BF_PTR2 */

#undef c2l
#define c2l(c,l)	(l =((unsigned long)(*((c)++)))    , \
@@ -169,14 +151,6 @@
/* This is actually a big endian algorithm, the most significate byte
 * is used to lookup array 0 */

/* use BF_PTR2 for intel boxes,
 * BF_PTR for sparc and MIPS/SGI
 * use nothing for Alpha and HP.
 */
#if !defined(BF_PTR) && !defined(BF_PTR2)
#undef BF_PTR
#endif

#define BF_M	0x3fc
#define BF_0	22L
#define BF_1	14L
@@ -228,3 +202,5 @@
		S[0x0200+((int)(R>> 8L)&0xff)])+ \
		S[0x0300+((int)(R     )&0xff)])&0xffffffffL;
#endif

#endif
+3 −26
Original line number Diff line number Diff line
@@ -56,27 +56,15 @@
 * [including the GNU Public Licence.]
 */

/* WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING 
 *
 * Always modify bn.org since bn.h is automatically generated from
 * it during SSLeay configuration.
 *
 * WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
 */

#ifndef HEADER_BN_H
#define HEADER_BN_H

#include "opensslconf.h"

#ifdef  __cplusplus
extern "C" {
#endif

#undef BN_LLONG

#ifdef WIN32
#define BN_LLONG /* This comment stops Configure mutilating things */
#endif

#define BN_MUL_COMBA
#define BN_SQR_COMBA
#define BN_RECURSION
@@ -98,17 +86,6 @@ extern "C" {
#define BN_DIV2W
#endif

/* Only one for the following should be defined */
/* The prime number generation stuff may not work when
 * EIGHT_BIT but I don't care since I've only used this mode
 * for debuging the bignum libraries */
#undef SIXTY_FOUR_BIT_LONG
#undef SIXTY_FOUR_BIT
#define THIRTY_TWO_BIT
#undef SIXTEEN_BIT
#undef EIGHT_BIT


/* assuming long is 64bit - this is the DEC Alpha
 * unsigned long long is only 64 bits :-(, don't define
 * BN_LLONG for the DEC Alpha */
@@ -138,7 +115,7 @@ extern "C" {
 * assember code :-).  Do NOT define BN_ULLONG.
 */
#ifdef SIXTY_FOUR_BIT
#undef BN_LLONG
#define BN_LLONG
/* #define BN_ULLONG	unsigned long long */
#define BN_ULONG	unsigned long long
#define BN_LONG		long long
Loading