Commit e0d6132b authored by Bodo Möller's avatar Bodo Möller
Browse files

Fix warnings.

Also, use the common Configure mechanism for enabling/disabling the 64-bit ECC code.
parent e3fed9f4
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -235,11 +235,12 @@
  *) Add optional 64-bit optimized implementations of elliptic curves NIST-P224,
     NIST-P256, NIST-P521, with constant-time single point multiplication on
     typical inputs. Compiler support for the nonstandard type __uint128_t is
     required to use this. Code made available under Apache License version 2.0.
     required to use this (present in gcc 4.4 and later, for 64-bit builds).
     Code made available under Apache License version 2.0.

     To include this in your build of OpenSSL, use -DEC_NISTP_64_GCC_128 on
     the Configure (or config) command line, and run "make depend" (or "make
     update"). This enables the following EC_METHODs:
     Specify "enable-ec_nistp_64_gcc_128" on the Configure (or config) command
     line to include this in your build of OpenSSL, and run "make depend" (or
     "make update"). This enables the following EC_METHODs:

         EC_GFp_nistp224_method()
         EC_GFp_nistp256_method()
+3 −3
Original line number Diff line number Diff line
@@ -173,7 +173,7 @@ my %table=(
"debug-ben-no-opt",	"gcc: -Wall -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations -DDEBUG_SAFESTACK -DCRYPTO_MDEBUG -Werror -DL_ENDIAN -DTERMIOS -Wall -g3::(unknown)::::::",
"debug-ben-strict",	"gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DCONST_STRICT -O2 -Wall -Wshadow -Werror -Wpointer-arith -Wcast-qual -Wwrite-strings -pipe::(unknown)::::::",
"debug-rse","cc:-DTERMIOS -DL_ENDIAN -pipe -O -g -ggdb3 -Wall::(unknown):::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}",
"debug-bodo",	"gcc:-DL_ENDIAN -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBIO_PAIR_DEBUG -DPEDANTIC -g -march=i486 -pedantic -Wshadow -Wall -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wundef -Wconversion::-D_REENTRANT:::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}",
"debug-bodo",	"gcc:$gcc_devteam_warn -DBN_DEBUG -DBN_DEBUG_RAND -DCONF_DEBUG -DBIO_PAIR_DEBUG -m64 -DL_ENDIAN -DTERMIO -g -DMD32_REG_T=int::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64",
"debug-ulf", "gcc:-DTERMIOS -DL_ENDIAN -march=i486 -Wall -DBN_DEBUG -DBN_DEBUG_RAND -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DOPENSSL_NO_ASM -g -Wformat -Wshadow -Wmissing-prototypes -Wmissing-declarations:::CYGWIN32:::${no_asm}:win32:cygwin-shared:::.dll",
"debug-steve64", "gcc:$gcc_devteam_warn -m64 -DL_ENDIAN -DTERMIO -DCONF_DEBUG -DDEBUG_SAFESTACK -g::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"debug-steve32", "gcc:$gcc_devteam_warn -m32 -DL_ENDIAN -DCONF_DEBUG -DDEBUG_SAFESTACK -g -pipe::-D_REENTRANT::-rdynamic -ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC:-m32:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
@@ -701,7 +701,7 @@ my $fips=0;
# All of the following is disabled by default (RC5 was enabled before 0.9.8):

my %disabled = ( # "what"         => "comment" [or special keyword "experimental"]
		 "ec-nistp224-64-gcc-128" => "default",
      		 "ec_nistp_64_gcc_128" => "default",
		 "gmp"		  => "default",
                 "jpake"          => "experimental",
                 "md2"            => "default",
@@ -731,7 +731,7 @@ if (!-d "ssl")

# This is what $depflags will look like with the above defaults
# (we need this to see if we should advise the user to run "make depend"):
my $default_depflags = " -DOPENSSL_NO_EC_NISTP224_64_GCC_128 -DOPENSSL_NO_GMP -DOPENSSL_NO_JPAKE -DOPENSSL_NO_MD2 -DOPENSSL_NO_RC5 -DOPENSSL_NO_RFC3779 -DOPENSSL_NO_STORE";
my $default_depflags = " -DOPENSSL_NO_EC_NISTP_64_GCC_128 -DOPENSSL_NO_GMP -DOPENSSL_NO_JPAKE -DOPENSSL_NO_MD2 -DOPENSSL_NO_RC5 -DOPENSSL_NO_RFC3779 -DOPENSSL_NO_STORE";

# Explicit "no-..." options will be collected in %disabled along with the defaults.
# To remove something from %disabled, use "enable-foo" (unless it's experimental).
+90 −24
Original line number Diff line number Diff line
@@ -1883,36 +1883,36 @@ $multilib =

*** debug-bodo
$cc           = gcc
$cflags       = -DL_ENDIAN -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBIO_PAIR_DEBUG -DPEDANTIC -g -march=i486 -pedantic -Wshadow -Wall -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wundef -Wconversion
$cflags       = -Wall -pedantic -DPEDANTIC -Wno-long-long -Wsign-compare -Wmissing-prototypes -Wshadow -Wformat -Werror -DCRYPTO_MDEBUG_ALL -DCRYPTO_MDEBUG_ABORT -DREF_CHECK -DOPENSSL_NO_DEPRECATED -DBN_DEBUG -DBN_DEBUG_RAND -DCONF_DEBUG -DBIO_PAIR_DEBUG -m64 -DL_ENDIAN -DTERMIO -g -DMD32_REG_T=int
$unistd       = 
$thread_cflag = -D_REENTRANT
$sys_id       = 
$lflags       = 
$bn_ops       = BN_LLONG DES_PTR DES_RISC1 DES_UNROLL RC4_INDEX MD2_INT
$cpuid_obj    = x86cpuid.o
$bn_obj       = bn-586.o co-586.o x86-mont.o x86-gf2m.o
$des_obj      = des-586.o crypt586.o
$aes_obj      = aes-586.o vpaes-x86.o aesni-x86.o
$bf_obj       = bf-586.o
$md5_obj      = md5-586.o
$sha1_obj     = sha1-586.o sha256-586.o sha512-586.o
$cast_obj     = cast-586.o
$rc4_obj      = rc4-586.o
$rmd160_obj   = rmd-586.o
$rc5_obj      = rc5-586.o
$wp_obj       = wp_block.o wp-mmx.o
$cmll_obj     = cmll-x86.o
$modes_obj    = ghash-x86.o
$engines_obj  = e_padlock-x86.o
$lflags       = -ldl
$bn_ops       = SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL
$cpuid_obj    = x86_64cpuid.o
$bn_obj       = x86_64-gcc.o x86_64-mont.o x86_64-mont5.o x86_64-gf2m.o modexp512-x86_64.o
$des_obj      = 
$aes_obj      = aes-x86_64.o vpaes-x86_64.o bsaes-x86_64.o aesni-x86_64.o aesni-sha1-x86_64.o
$bf_obj       = 
$md5_obj      = md5-x86_64.o
$sha1_obj     = sha1-x86_64.o sha256-x86_64.o sha512-x86_64.o
$cast_obj     = 
$rc4_obj      = rc4-x86_64.o rc4-md5-x86_64.o
$rmd160_obj   = 
$rc5_obj      = 
$wp_obj       = wp-x86_64.o
$cmll_obj     = cmll-x86_64.o cmll_misc.o
$modes_obj    = ghash-x86_64.o
$engines_obj  = e_padlock-x86_64.o
$perlasm_scheme = elf
$dso_scheme   = 
$shared_target= 
$shared_cflag = 
$shared_ldflag = 
$shared_extension = 
$dso_scheme   = dlfcn
$shared_target= linux-shared
$shared_cflag = -fPIC
$shared_ldflag = -m64
$shared_extension = .so.$(SHLIB_MAJOR).$(SHLIB_MINOR)
$ranlib       = 
$arflags      = 
$multilib     = 
$multilib     = 64

*** debug-darwin-i386-cc
$cc           = cc
@@ -5841,6 +5841,39 @@ $ranlib =
$arflags      = 
$multilib     = 

*** vxworks-mips
$cc           = ccmips
$cflags       = -B$(WIND_BASE)/host/$(WIND_HOST_TYPE)/lib/gcc-lib/ -D_VSB_CONFIG_FILE="$(WIND_BASE)/target/lib/h/config/vsbConfig.h" -DB_ENDIAN -DCPU=MIPS32 -G 0 -mips2 -EB -Wl,-EB -msoft-float -mno-branch-likely -DTOOL_FAMILY=gnu -DTOOL=gnu -fno-builtin -fno-defer-pop -DNO_STRINGS_H -I$(WIND_BASE)/target/h -I$(WIND_BASE)/target/h/wrn/coreip
$unistd       = 
$thread_cflag = 
$sys_id       = VXWORKS
$lflags       = -r
$bn_ops       = 
$cpuid_obj    = 
$bn_obj       = 
$des_obj      = 
$aes_obj      = 
$bf_obj       = 
$md5_obj      = 
$sha1_obj     = 
$cast_obj     = 
$rc4_obj      = 
$rmd160_obj   = 
$rc5_obj      = 
$wp_obj       = 
$cmll_obj     = 
$modes_obj    = 
$engines_obj  = 
$perlasm_scheme = void
$dso_scheme   = 
$shared_target= 
$shared_cflag = 
$shared_ldflag = 
$shared_extension = 
$ranlib       = ranlibmips
$arflags      = 
$multilib     = 

*** vxworks-mipsle
$cc           = ccmips
$cflags       = -B$(WIND_BASE)/host/$(WIND_HOST_TYPE)/lib/gcc-lib/ -DL_ENDIAN -EL -Wl,-EL -mips2 -mno-branch-likely -G 0 -fno-builtin -msoft-float -DCPU=MIPS32 -DMIPSEL -DNO_STRINGS_H -I$(WIND_BASE)/target/h
@@ -6071,3 +6104,36 @@ $shared_extension =
$ranlib       = 
$arflags      = 
$multilib     = 

*** vxworks-simlinux
$cc           = ccpentium
$cflags       = -B$(WIND_BASE)/host/$(WIND_HOST_TYPE)/lib/gcc-lib/ -D_VSB_CONFIG_FILE="$(WIND_BASE)/target/lib/h/config/vsbConfig.h" -DL_ENDIAN -DCPU=SIMLINUX -DTOOL_FAMILY=gnu -DTOOL=gnu -fno-builtin -fno-defer-pop -DNO_STRINGS_H -I$(WIND_BASE)/target/h -I$(WIND_BASE)/target/h/wrn/coreip -DOPENSSL_NO_HW_PADLOCK
$unistd       = 
$thread_cflag = 
$sys_id       = VXWORKS
$lflags       = -r
$bn_ops       = 
$cpuid_obj    = 
$bn_obj       = 
$des_obj      = 
$aes_obj      = 
$bf_obj       = 
$md5_obj      = 
$sha1_obj     = 
$cast_obj     = 
$rc4_obj      = 
$rmd160_obj   = 
$rc5_obj      = 
$wp_obj       = 
$cmll_obj     = 
$modes_obj    = 
$engines_obj  = 
$perlasm_scheme = void
$dso_scheme   = 
$shared_target= 
$shared_cflag = 
$shared_ldflag = 
$shared_extension = 
$ranlib       = ranlibpentium
$arflags      = 
$multilib     = 
+1 −1
Original line number Diff line number Diff line
@@ -151,7 +151,7 @@ const EC_METHOD *EC_GFp_mont_method(void);
 */
const EC_METHOD *EC_GFp_nist_method(void);

#ifdef EC_NISTP_64_GCC_128
#ifndef OPENSSL_NO_EC_NISTP_64_GCC_128
#ifndef OPENSSL_SYS_WIN32
/** Returns 64-bit optimized methods for nistp224
 *  \return  EC_METHOD object
+4 −3
Original line number Diff line number Diff line
@@ -74,6 +74,7 @@
#include "ec_lcl.h"
#include <openssl/err.h>
#include <openssl/obj_mac.h>
#include <openssl/opensslconf.h>

typedef struct {
	int	field_type,	/* either NID_X9_62_prime_field or
@@ -1903,7 +1904,7 @@ static const ec_list_element curve_list[] = {
	/* SECG secp192r1 is the same as X9.62 prime192v1 and hence omitted */
	{ NID_secp192k1, &_EC_SECG_PRIME_192K1.h, 0, "SECG curve over a 192 bit prime field" },
	{ NID_secp224k1, &_EC_SECG_PRIME_224K1.h, 0, "SECG curve over a 224 bit prime field" },
#ifdef EC_NISTP_64_GCC_128
#ifndef OPENSSL_NO_EC_NISTP_64_GCC_128
	{ NID_secp224r1, &_EC_NIST_PRIME_224.h, EC_GFp_nistp224_method, "NIST/SECG curve over a 224 bit prime field" },
#else
	{ NID_secp224r1, &_EC_NIST_PRIME_224.h, 0, "NIST/SECG curve over a 224 bit prime field" },
@@ -1911,7 +1912,7 @@ static const ec_list_element curve_list[] = {
	{ NID_secp256k1, &_EC_SECG_PRIME_256K1.h, 0, "SECG curve over a 256 bit prime field" },
	/* SECG secp256r1 is the same as X9.62 prime256v1 and hence omitted */
	{ NID_secp384r1, &_EC_NIST_PRIME_384.h, 0, "NIST/SECG curve over a 384 bit prime field" },
#ifdef EC_NISTP_64_GCC_128
#ifndef OPENSSL_NO_EC_NISTP_64_GCC_128
	{ NID_secp521r1, &_EC_NIST_PRIME_521.h, EC_GFp_nistp521_method, "NIST/SECG curve over a 521 bit prime field" },
#else
	{ NID_secp521r1, &_EC_NIST_PRIME_521.h, 0, "NIST/SECG curve over a 521 bit prime field" },
@@ -1923,7 +1924,7 @@ static const ec_list_element curve_list[] = {
	{ NID_X9_62_prime239v1, &_EC_X9_62_PRIME_239V1.h, 0, "X9.62 curve over a 239 bit prime field" },
	{ NID_X9_62_prime239v2, &_EC_X9_62_PRIME_239V2.h, 0, "X9.62 curve over a 239 bit prime field" },
	{ NID_X9_62_prime239v3, &_EC_X9_62_PRIME_239V3.h, 0, "X9.62 curve over a 239 bit prime field" },
#ifdef EC_NISTP_64_GCC_128
#ifndef OPENSSL_NO_EC_NISTP_64_GCC_128
	{ NID_X9_62_prime256v1, &_EC_X9_62_PRIME_256V1.h, EC_GFp_nistp256_method, "X9.62/SECG curve over a 256 bit prime field" },
#else
	{ NID_X9_62_prime256v1, &_EC_X9_62_PRIME_256V1.h, 0, "X9.62/SECG curve over a 256 bit prime field" },
Loading