Compare commits
96 Commits
OpenSSL_0_
...
OpenSSL_0_
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
975a7a483f | ||
|
|
ffa0407233 | ||
|
|
6f414aef0e | ||
|
|
45e33ebeab | ||
|
|
0f562e2a2c | ||
|
|
ae2684851f | ||
|
|
feee55c65d | ||
|
|
81edd235b1 | ||
|
|
23c13189e9 | ||
|
|
bdd00f8c8a | ||
|
|
30c99d45b7 | ||
|
|
e4a901b0b3 | ||
|
|
e25a2423da | ||
|
|
094c6aa51d | ||
|
|
c098e8b6ca | ||
|
|
019a63f9c9 | ||
|
|
6651ac386e | ||
|
|
0be0592ec4 | ||
|
|
a6fb8a8203 | ||
|
|
d26d236162 | ||
|
|
3dcd6cf004 | ||
|
|
daaca57e55 | ||
|
|
309d74c8f0 | ||
|
|
234f2f67ac | ||
|
|
d4e81773cc | ||
|
|
d366bf7948 | ||
|
|
6c9cd652f7 | ||
|
|
dd4263d906 | ||
|
|
f4e43726a8 | ||
|
|
6fa6e3e2df | ||
|
|
fcdf1d3fc7 | ||
|
|
e0fe7abeec | ||
|
|
e8518f847e | ||
|
|
8299069b8e | ||
|
|
5dc96f40ce | ||
|
|
7775bf5564 | ||
|
|
a0a82def50 | ||
|
|
9a2c519d4b | ||
|
|
f3fc016c08 | ||
|
|
8d6e32a07c | ||
|
|
bf059c2efc | ||
|
|
417d5af7c7 | ||
|
|
33d3b6043a | ||
|
|
c7e1e48908 | ||
|
|
7f3a22803c | ||
|
|
386ec8fc15 | ||
|
|
8aecae520c | ||
|
|
571d90db24 | ||
|
|
4a54d594e1 | ||
|
|
bd6ae6579e | ||
|
|
85ca1d2c86 | ||
|
|
3c1ee6c147 | ||
|
|
a13e6553ad | ||
|
|
b1971b067a | ||
|
|
a5319427a2 | ||
|
|
e0a4dc3b66 | ||
|
|
0b51beff26 | ||
|
|
6a9f9aed30 | ||
|
|
3ae83be021 | ||
|
|
d2ab6fa4ae | ||
|
|
0a2466a08d | ||
|
|
172bb3734a | ||
|
|
b7508d8396 | ||
|
|
fd27364317 | ||
|
|
d37ca24da9 | ||
|
|
1ce2fb42de | ||
|
|
4ca47e6db9 | ||
|
|
fbe6969a0d | ||
|
|
7dfd94a088 | ||
|
|
f6bbb5b67d | ||
|
|
c9f4204ae8 | ||
|
|
29c18b0112 | ||
|
|
e2e28a6bb6 | ||
|
|
5a175fe228 | ||
|
|
15a6cf7d14 | ||
|
|
ed457c6e1c | ||
|
|
c1e67d9856 | ||
|
|
0c91b0eaff | ||
|
|
e886317f9b | ||
|
|
015d162d41 | ||
|
|
211ce24020 | ||
|
|
8750e911f1 | ||
|
|
d9ba7079b8 | ||
|
|
21a0819274 | ||
|
|
2d96867e30 | ||
|
|
4c80a153cb | ||
|
|
3dd5699238 | ||
|
|
bffe708e47 | ||
|
|
7606bb65ea | ||
|
|
2f4d5c6542 | ||
|
|
deab8d9392 | ||
|
|
c12ba74f1d | ||
|
|
9c6413521d | ||
|
|
c892524146 | ||
|
|
473a1324fc | ||
|
|
49a305e7ef |
83
CHANGES
83
CHANGES
@@ -2,13 +2,66 @@
|
||||
OpenSSL CHANGES
|
||||
_______________
|
||||
|
||||
Changes between 0.9.7j and 0.9.7k [05 Sep 2006]
|
||||
|
||||
*) Avoid PKCS #1 v1.5 signature attack discovered by Daniel Bleichenbacher
|
||||
(CVE-2006-4339) [Ben Laurie and Google Security Team]
|
||||
|
||||
*) Change the Unix randomness entropy gathering to use poll() when
|
||||
possible instead of select(), since the latter has some
|
||||
undesirable limitations.
|
||||
[Darryl Miles via Richard Levitte and Bodo Moeller]
|
||||
|
||||
*) Disable rogue ciphersuites:
|
||||
|
||||
- SSLv2 0x08 0x00 0x80 ("RC4-64-MD5")
|
||||
- SSLv3/TLSv1 0x00 0x61 ("EXP1024-RC2-CBC-MD5")
|
||||
- SSLv3/TLSv1 0x00 0x60 ("EXP1024-RC4-MD5")
|
||||
|
||||
The latter two were purportedly from
|
||||
draft-ietf-tls-56-bit-ciphersuites-0[01].txt, but do not really
|
||||
appear there.
|
||||
|
||||
Also deactive the remaining ciphersuites from
|
||||
draft-ietf-tls-56-bit-ciphersuites-01.txt. These are just as
|
||||
unofficial, and the ID has long expired.
|
||||
[Bodo Moeller]
|
||||
|
||||
*) Fix RSA blinding Heisenbug (problems sometimes occured on
|
||||
dual-core machines) and other potential thread-safety issues.
|
||||
[Bodo Moeller]
|
||||
|
||||
Changes between 0.9.7i and 0.9.7j [04 May 2006]
|
||||
|
||||
*) Adapt fipsld and the build system to link against the validated FIPS
|
||||
module in FIPS mode.
|
||||
[Steve Henson]
|
||||
|
||||
*) Fixes for VC++ 2005 build under Windows.
|
||||
[Steve Henson]
|
||||
|
||||
*) Add new Windows build target VC-32-GMAKE for VC++. This uses GNU make
|
||||
from a Windows bash shell such as MSYS. It is autodetected from the
|
||||
"config" script when run from a VC++ environment. Modify standard VC++
|
||||
build to use fipscanister.o from the GNU make build.
|
||||
[Steve Henson]
|
||||
|
||||
Changes between 0.9.7h and 0.9.7i [14 Oct 2005]
|
||||
|
||||
*) Wrapped the definition of EVP_MAX_MD_SIZE in a #ifdef OPENSSL_FIPS.
|
||||
The value now differs depending on if you build for FIPS or not.
|
||||
BEWARE! A program linked with a shared FIPSed libcrypto can't be
|
||||
safely run with a non-FIPSed libcrypto, as it may crash because of
|
||||
the difference induced by this change.
|
||||
[Andy Polyakov]
|
||||
|
||||
Changes between 0.9.7g and 0.9.7h [11 Oct 2005]
|
||||
|
||||
*) Remove the functionality of SSL_OP_MSIE_SSLV2_RSA_PADDING
|
||||
(part of SSL_OP_ALL). This option used to disable the
|
||||
countermeasure against man-in-the-middle protocol-version
|
||||
rollback in the SSL 2.0 server implementation, which is a bad
|
||||
idea. (CAN-2005-2969)
|
||||
idea. (CVE-2005-2969)
|
||||
|
||||
[Bodo Moeller; problem pointed out by Yutaka Oiwa (Research Center
|
||||
for Information Security, National Institute of Advanced Industrial
|
||||
@@ -173,11 +226,11 @@
|
||||
Changes between 0.9.7c and 0.9.7d [17 Mar 2004]
|
||||
|
||||
*) Fix null-pointer assignment in do_change_cipher_spec() revealed
|
||||
by using the Codenomicon TLS Test Tool (CAN-2004-0079)
|
||||
by using the Codenomicon TLS Test Tool (CVE-2004-0079)
|
||||
[Joe Orton, Steve Henson]
|
||||
|
||||
*) Fix flaw in SSL/TLS handshaking when using Kerberos ciphersuites
|
||||
(CAN-2004-0112)
|
||||
(CVE-2004-0112)
|
||||
[Joe Orton, Steve Henson]
|
||||
|
||||
*) Make it possible to have multiple active certificates with the same
|
||||
@@ -220,9 +273,9 @@
|
||||
*) Fix various bugs revealed by running the NISCC test suite:
|
||||
|
||||
Stop out of bounds reads in the ASN1 code when presented with
|
||||
invalid tags (CAN-2003-0543 and CAN-2003-0544).
|
||||
invalid tags (CVE-2003-0543 and CVE-2003-0544).
|
||||
|
||||
Free up ASN1_TYPE correctly if ANY type is invalid (CAN-2003-0545).
|
||||
Free up ASN1_TYPE correctly if ANY type is invalid (CVE-2003-0545).
|
||||
|
||||
If verify callback ignores invalid public key errors don't try to check
|
||||
certificate signature with the NULL public key.
|
||||
@@ -307,7 +360,7 @@
|
||||
via timing by performing a MAC computation even if incorrrect
|
||||
block cipher padding has been found. This is a countermeasure
|
||||
against active attacks where the attacker has to distinguish
|
||||
between bad padding and a MAC verification error. (CAN-2003-0078)
|
||||
between bad padding and a MAC verification error. (CVE-2003-0078)
|
||||
|
||||
[Bodo Moeller; problem pointed out by Brice Canvel (EPFL),
|
||||
Alain Hiltgen (UBS), Serge Vaudenay (EPFL), and
|
||||
@@ -524,7 +577,7 @@
|
||||
|
||||
Remote buffer overflow in SSL3 protocol - an attacker could
|
||||
supply an oversized master key in Kerberos-enabled versions.
|
||||
(CAN-2002-0657)
|
||||
(CVE-2002-0657)
|
||||
[Ben Laurie (CHATS)]
|
||||
|
||||
*) Change the SSL kerb5 codes to match RFC 2712.
|
||||
@@ -2208,7 +2261,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
|
||||
Changes between 0.9.6l and 0.9.6m [17 Mar 2004]
|
||||
|
||||
*) Fix null-pointer assignment in do_change_cipher_spec() revealed
|
||||
by using the Codenomicon TLS Test Tool (CAN-2004-0079)
|
||||
by using the Codenomicon TLS Test Tool (CVE-2004-0079)
|
||||
[Joe Orton, Steve Henson]
|
||||
|
||||
Changes between 0.9.6k and 0.9.6l [04 Nov 2003]
|
||||
@@ -2216,7 +2269,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
|
||||
*) Fix additional bug revealed by the NISCC test suite:
|
||||
|
||||
Stop bug triggering large recursion when presented with
|
||||
certain ASN.1 tags (CAN-2003-0851)
|
||||
certain ASN.1 tags (CVE-2003-0851)
|
||||
[Steve Henson]
|
||||
|
||||
Changes between 0.9.6j and 0.9.6k [30 Sep 2003]
|
||||
@@ -2224,7 +2277,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
|
||||
*) Fix various bugs revealed by running the NISCC test suite:
|
||||
|
||||
Stop out of bounds reads in the ASN1 code when presented with
|
||||
invalid tags (CAN-2003-0543 and CAN-2003-0544).
|
||||
invalid tags (CVE-2003-0543 and CVE-2003-0544).
|
||||
|
||||
If verify callback ignores invalid public key errors don't try to check
|
||||
certificate signature with the NULL public key.
|
||||
@@ -2276,7 +2329,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
|
||||
via timing by performing a MAC computation even if incorrrect
|
||||
block cipher padding has been found. This is a countermeasure
|
||||
against active attacks where the attacker has to distinguish
|
||||
between bad padding and a MAC verification error. (CAN-2003-0078)
|
||||
between bad padding and a MAC verification error. (CVE-2003-0078)
|
||||
|
||||
[Bodo Moeller; problem pointed out by Brice Canvel (EPFL),
|
||||
Alain Hiltgen (UBS), Serge Vaudenay (EPFL), and
|
||||
@@ -2409,7 +2462,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
|
||||
*) Add various sanity checks to asn1_get_length() to reject
|
||||
the ASN1 length bytes if they exceed sizeof(long), will appear
|
||||
negative or the content length exceeds the length of the
|
||||
supplied buffer. (CAN-2002-0659)
|
||||
supplied buffer. (CVE-2002-0659)
|
||||
[Steve Henson, Adi Stav <stav@mercury.co.il>, James Yonan <jim@ntlp.com>]
|
||||
|
||||
*) Assertions for various potential buffer overflows, not known to
|
||||
@@ -2417,15 +2470,15 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
|
||||
[Ben Laurie (CHATS)]
|
||||
|
||||
*) Various temporary buffers to hold ASCII versions of integers were
|
||||
too small for 64 bit platforms. (CAN-2002-0655)
|
||||
too small for 64 bit platforms. (CVE-2002-0655)
|
||||
[Matthew Byng-Maddick <mbm@aldigital.co.uk> and Ben Laurie (CHATS)>
|
||||
|
||||
*) Remote buffer overflow in SSL3 protocol - an attacker could
|
||||
supply an oversized session ID to a client. (CAN-2002-0656)
|
||||
supply an oversized session ID to a client. (CVE-2002-0656)
|
||||
[Ben Laurie (CHATS)]
|
||||
|
||||
*) Remote buffer overflow in SSL2 protocol - an attacker could
|
||||
supply an oversized client master key. (CAN-2002-0656)
|
||||
supply an oversized client master key. (CVE-2002-0656)
|
||||
[Ben Laurie (CHATS)]
|
||||
|
||||
Changes between 0.9.6c and 0.9.6d [9 May 2002]
|
||||
|
||||
46
Configure
46
Configure
@@ -205,7 +205,7 @@ my %table=(
|
||||
# SC4.2 is ok, better than gcc even on bn as long as you tell it -xarch=v8
|
||||
# SC5.0 note: Compiler common patch 107357-01 or later is required!
|
||||
"solaris-sparcv7-cc","cc:-xO5 -xstrconst -xdepend -Xa -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_RISC1 DES_UNROLL BF_PTR::::::::::dlfcn:solaris-shared:-KPIC:-G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"solaris-sparcv8-cc","cc:-xarch=v8 -xO5 -xstrconst -xdepend -Xa -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_RISC1 DES_UNROLL BF_PTR:asm/sparcv8.o:::::::::dlfcn:solaris-shared:-KPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"solaris-sparcv8-cc","cc:-xarch=v8 -xO5 -xstrconst -xdepend -Xa -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_RISC1 DES_UNROLL BF_PTR:asm/sparcv8.o:::::::::dlfcn:solaris-shared:-KPIC:-G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"solaris-sparcv9-cc","cc:-xtarget=ultra -xarch=v8plus -xO5 -xstrconst -xdepend -Xa -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK_LL DES_PTR DES_RISC1 DES_UNROLL BF_PTR:asm/sparcv8plus.o:::asm/md5-sparcv8plus.o::::::dlfcn:solaris-shared:-KPIC:-G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"solaris64-sparcv9-cc","cc:-xtarget=ultra -xarch=v9 -xO5 -xstrconst -xdepend -Xa -DB_ENDIAN::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL BF_PTR::::asm/md5-sparcv9.o::::::dlfcn:solaris-shared:-KPIC:-xarch=v9 -G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):/usr/ccs/bin/ar rs",
|
||||
####
|
||||
@@ -563,7 +563,7 @@ my %table=(
|
||||
##### MacOS X (a.k.a. Rhapsody or Darwin) setup
|
||||
"rhapsody-ppc-cc","cc:-O3 -DB_ENDIAN::(unknown):MACOSX_RHAPSODY::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:::",
|
||||
"darwin-ppc-cc","cc:-O3 -fomit-frame-pointer -DB_ENDIAN::-D_REENTRANT:MACOSX::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:asm/osx_ppc32.o:::::::::dlfcn:darwin-shared:-fPIC -fno-common::.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
|
||||
"darwin-i386-cc","cc:-O3 -fomit-frame-pointer -fno-common -DB_ENDIAN::-D_REENTRANT:MACOSX::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:::::::::::darwin-shared:-fPIC::.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
|
||||
"darwin-i386-cc","cc:-O3 -fomit-frame-pointer -fno-common::-D_REENTRANT:MACOSX::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:::::::::::darwin-shared:-fPIC::.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
|
||||
|
||||
##### A/UX
|
||||
"aux3-gcc","gcc:-O2 -DTERMIO::(unknown):AUX:-lbsd:RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:::",
|
||||
@@ -621,6 +621,8 @@ my $prefix="";
|
||||
my $openssldir="";
|
||||
my $exe_ext="";
|
||||
my $install_prefix="";
|
||||
my $fipslibdir="/usr/local/ssl/lib";
|
||||
my $baseaddr="0xFB00000";
|
||||
my $no_threads=0;
|
||||
my $no_shared=1;
|
||||
my $zlib=0;
|
||||
@@ -806,7 +808,7 @@ PROCESS_ARGS:
|
||||
{
|
||||
while (<IN>)
|
||||
{
|
||||
chop;
|
||||
chomp;
|
||||
if (/^CONFIGURE_ARGS=(.*)/)
|
||||
{
|
||||
$argvstring=$1;
|
||||
@@ -865,6 +867,22 @@ PROCESS_ARGS:
|
||||
{
|
||||
$withargs{"krb5-".$1}=$2;
|
||||
}
|
||||
elsif (/^--with-zlib-lib=(.*)$/)
|
||||
{
|
||||
$withargs{"zlib-lib"}=$1;
|
||||
}
|
||||
elsif (/^--with-fipslibdir=(.*)$/)
|
||||
{
|
||||
$fipslibdir="$1";
|
||||
}
|
||||
elsif (/^--with-baseaddr=(.*)$/)
|
||||
{
|
||||
$baseaddr="$1";
|
||||
}
|
||||
elsif (/^--with-zlib-include=(.*)$/)
|
||||
{
|
||||
$withargs{"zlib-include"}="-I$1";
|
||||
}
|
||||
else
|
||||
{
|
||||
print STDERR $usage;
|
||||
@@ -964,6 +982,21 @@ chop $prefix if $prefix =~ /\/$/;
|
||||
$openssldir=$prefix . "/ssl" if $openssldir eq "";
|
||||
$openssldir=$prefix . "/" . $openssldir if $openssldir !~ /(^\/|^[a-zA-Z]:[\\\/])/;
|
||||
|
||||
if ($fips && ! -f "$fipslibdir/fipscanister.o")
|
||||
{
|
||||
my $fipswinerr = "";
|
||||
$fipswinerr = <<EOF if $IsWindows;
|
||||
Ensure that the correct path to the FIPS module directory
|
||||
has been given to the --with-fipslibdir option.
|
||||
EOF
|
||||
print STDERR <<EOF;
|
||||
The file fipscanister.o could not be located. Please build and install the
|
||||
FIPS module using the instructions in the user guide before compiling OpenSSL
|
||||
in FIPS mode.$fipswinerr
|
||||
EOF
|
||||
exit 1;
|
||||
}
|
||||
|
||||
|
||||
print "IsWindows=$IsWindows\n";
|
||||
|
||||
@@ -1152,6 +1185,7 @@ if (!$no_shared)
|
||||
if ($shared_cflag ne "")
|
||||
{
|
||||
$cflags = "$shared_cflag -DOPENSSL_PIC $cflags";
|
||||
$shared_ldflag = "$shared_ldflag $shared_cflag" if($fips);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1261,7 +1295,7 @@ print OUT "### Generated automatically from Makefile.org by Configure.\n\n";
|
||||
my $sdirs=0;
|
||||
while (<IN>)
|
||||
{
|
||||
chop;
|
||||
chomp;
|
||||
$sdirs = 1 if /^SDIRS=/;
|
||||
if ($sdirs) {
|
||||
my $dir;
|
||||
@@ -1308,6 +1342,10 @@ while (<IN>)
|
||||
s/^PERL=.*/PERL= $perl/;
|
||||
s/^KRB5_INCLUDES=.*/KRB5_INCLUDES=$withargs{"krb5-include"}/;
|
||||
s/^LIBKRB5=.*/LIBKRB5=$withargs{"krb5-lib"}/;
|
||||
s/^LIBZLIB=.*/LIBZLIB=$withargs{"zlib-lib"}/;
|
||||
s/^FIPSLIBDIR=.*/FIPSLIBDIR=$fipslibdir/;
|
||||
s/^BASEADDR=.*/BASEADDR=$baseaddr/;
|
||||
s/^ZLIB_INCLUDE=.*/ZLIB_INCLUDE=$withargs{"zlib-include"}/;
|
||||
s/^SHLIB_TARGET=.*/SHLIB_TARGET=$shared_target/;
|
||||
s/^SHLIB_MARK=.*/SHLIB_MARK=$shared_mark/;
|
||||
s/^SHARED_LIBS=.*/SHARED_LIBS=\$(SHARED_CRYPTO) \$(SHARED_SSL)/ if (!$no_shared);
|
||||
|
||||
7
FAQ
7
FAQ
@@ -70,7 +70,7 @@ OpenSSL - Frequently Asked Questions
|
||||
* Which is the current version of OpenSSL?
|
||||
|
||||
The current version is available from <URL: http://www.openssl.org>.
|
||||
OpenSSL 0.9.7h was released on October 11, 2005.
|
||||
OpenSSL 0.9.7k was released on September 5, 2006.
|
||||
|
||||
In addition to the current stable release, you can also access daily
|
||||
snapshots of the OpenSSL development version at <URL:
|
||||
@@ -608,8 +608,9 @@ libraries. If your platform is not one of these, consult the INSTALL
|
||||
file.
|
||||
|
||||
Multi-threaded applications must provide two callback functions to
|
||||
OpenSSL. This is described in the threads(3) manpage.
|
||||
|
||||
OpenSSL by calling CRYPTO_set_locking_callback() and
|
||||
CRYPTO_set_id_callback(). This is described in the threads(3)
|
||||
manpage.
|
||||
|
||||
* I've compiled a program under Windows and it crashes: why?
|
||||
|
||||
|
||||
2
LICENSE
2
LICENSE
@@ -12,7 +12,7 @@
|
||||
---------------
|
||||
|
||||
/* ====================================================================
|
||||
* Copyright (c) 1998-2005 The OpenSSL Project. All rights reserved.
|
||||
* 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
|
||||
|
||||
80
Makefile.org
80
Makefile.org
@@ -172,11 +172,29 @@ RMD160_ASM_OBJ= asm/rm86-out.o
|
||||
KRB5_INCLUDES=
|
||||
LIBKRB5=
|
||||
|
||||
# Zlib stuff
|
||||
ZLIB_INCLUDE=
|
||||
LIBZLIB=
|
||||
|
||||
# This is the location of fipscanister.o and friends.
|
||||
# The FIPS module build will place it $(INSTALLTOP)/lib
|
||||
# but since $(INSTALLTOP) can only take the default value
|
||||
# when the module is built it will be in /usr/local/ssl/lib
|
||||
# $(INSTALLTOP) for this build make be different so hard
|
||||
# code the path.
|
||||
|
||||
FIPSLIBDIR=/usr/local/ssl/lib
|
||||
|
||||
# Shared library base address. Currently only used on Windows.
|
||||
#
|
||||
|
||||
BASEADDR=
|
||||
|
||||
# When we're prepared to use shared libraries in the programs we link here
|
||||
# we might set SHLIB_MARK to '$(SHARED_LIBS)'.
|
||||
SHLIB_MARK=
|
||||
|
||||
DIRS= crypto fips ssl $(SHLIB_MARK) sigs apps test tools
|
||||
DIRS= crypto fips-1.0 ssl $(SHLIB_MARK) apps test tools
|
||||
SHLIBDIRS= crypto ssl
|
||||
|
||||
# dirs in crypto to build
|
||||
@@ -206,7 +224,6 @@ ONEDIRS=out tmp
|
||||
EDIRS= times doc bugs util include certs ms shlib mt demos perl sf dep VMS
|
||||
WDIRS= windows
|
||||
LIBS= libcrypto.a libssl.a
|
||||
SIGS= libcrypto.a.sha1
|
||||
SHARED_CRYPTO=libcrypto$(SHLIB_EXT)
|
||||
SHARED_SSL=libssl$(SHLIB_EXT)
|
||||
SHARED_LIBS=
|
||||
@@ -226,19 +243,12 @@ HEADER= e_os.h
|
||||
|
||||
all: Makefile sub_all openssl.pc
|
||||
|
||||
sigs: $(SIGS)
|
||||
libcrypto.a.sha1: libcrypto.a
|
||||
@if egrep 'define OPENSSL_FIPS' $(TOP)/include/openssl/opensslconf.h > /dev/null; then \
|
||||
$(RANLIB) libcrypto.a; \
|
||||
fips/sha/fips_standalone_sha1 libcrypto.a > libcrypto.a.sha1; \
|
||||
fi
|
||||
|
||||
sub_all:
|
||||
@for i in $(DIRS); \
|
||||
do \
|
||||
if [ -d "$$i" ]; then \
|
||||
(cd $$i && echo "making all in $$i..." && \
|
||||
$(MAKE) CC='${CC}' PLATFORM='${PLATFORM}' CFLAG='${CFLAG}' AS='${AS}' ASFLAG='${ASFLAG}' SDIRS='$(SDIRS)' FDIRS='$(FDIRS)' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' BN_ASM='${BN_ASM}' DES_ENC='${DES_ENC}' FIPS_DES_ENC='${FIPS_DES_ENC}' FIPS_AES_ENC='${FIPS_AES_ENC}' BF_ENC='${BF_ENC}' CAST_ENC='${CAST_ENC}' RC4_ENC='${RC4_ENC}' RC5_ENC='${RC5_ENC}' SHA1_ASM_OBJ='${SHA1_ASM_OBJ}' FIPS_SHA1_ASM_OBJ='${FIPS_SHA1_ASM_OBJ}' MD5_ASM_OBJ='${MD5_ASM_OBJ}' RMD160_ASM_OBJ='${RMD160_ASM_OBJ}' AR='${AR}' PROCESSOR='${PROCESSOR}' PERL='${PERL}' RANLIB='${RANLIB}' KRB5_INCLUDES='${KRB5_INCLUDES}' LIBKRB5='${LIBKRB5}' EXE_EXT='${EXE_EXT}' SHARED_LIBS='${SHARED_LIBS}' SHLIB_EXT='${SHLIB_EXT}' SHLIB_TARGET='${SHLIB_TARGET}' all ) || exit 1; \
|
||||
$(MAKE) CC='${CC}' PLATFORM='${PLATFORM}' CFLAG='${CFLAG}' AS='${AS}' ASFLAG='${ASFLAG}' SDIRS='$(SDIRS)' FDIRS='$(FDIRS)' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' BN_ASM='${BN_ASM}' DES_ENC='${DES_ENC}' FIPS_DES_ENC='${FIPS_DES_ENC}' FIPS_AES_ENC='${FIPS_AES_ENC}' BF_ENC='${BF_ENC}' CAST_ENC='${CAST_ENC}' RC4_ENC='${RC4_ENC}' RC5_ENC='${RC5_ENC}' SHA1_ASM_OBJ='${SHA1_ASM_OBJ}' FIPS_SHA1_ASM_OBJ='${FIPS_SHA1_ASM_OBJ}' MD5_ASM_OBJ='${MD5_ASM_OBJ}' RMD160_ASM_OBJ='${RMD160_ASM_OBJ}' AR='${AR}' PROCESSOR='${PROCESSOR}' PERL='${PERL}' RANLIB='${RANLIB}' KRB5_INCLUDES='${KRB5_INCLUDES}' LIBKRB5='${LIBKRB5}' EXE_EXT='${EXE_EXT}' SHARED_LIBS='${SHARED_LIBS}' SHLIB_EXT='${SHLIB_EXT}' SHLIB_TARGET='${SHLIB_TARGET}' FIPSLIBDIR='${FIPSLIBDIR}' all ) || exit 1; \
|
||||
else \
|
||||
$(MAKE) $$i; \
|
||||
fi; \
|
||||
@@ -258,9 +268,6 @@ sub_target:
|
||||
libcrypto$(SHLIB_EXT): libcrypto.a
|
||||
@if [ "$(SHLIB_TARGET)" != "" ]; then \
|
||||
$(MAKE) SHLIBDIRS=crypto build-shared; \
|
||||
if egrep 'define OPENSSL_FIPS' $(TOP)/include/openssl/opensslconf.h > /dev/null; then \
|
||||
fips/sha/fips_standalone_sha1 -binary $@ > $@.$${HMAC_EXT:-sha1}; \
|
||||
fi; \
|
||||
else \
|
||||
echo "There's no support for shared libraries on this platform" >&2; \
|
||||
fi
|
||||
@@ -308,7 +315,7 @@ do_gnu-shared:
|
||||
if [ "${SHLIBDIRS}" = "ssl" -a -n "$(LIBKRB5)" ]; then \
|
||||
libs="$(LIBKRB5) $$libs"; \
|
||||
fi; \
|
||||
( set -x; ${CC} ${SHARED_LDFLAGS} \
|
||||
( set -x; $${FIPSLD:-${CC}} ${SHARED_LDFLAGS} \
|
||||
-shared -o lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
|
||||
-Wl,-soname=lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
|
||||
-Wl,-Bsymbolic \
|
||||
@@ -325,7 +332,7 @@ do_darwin-shared:
|
||||
if [ "${SHLIBDIRS}" = "ssl" -a -n "$(LIBKRB5)" ]; then \
|
||||
libs="$(LIBKRB5) $$libs"; \
|
||||
fi; \
|
||||
( set -x; ${CC} ${SHARED_LDFLAGS}
|
||||
( set -x; $${FIPSLD:-${CC}} ${SHARED_LDFLAGS} \
|
||||
--verbose -dynamiclib -o lib$$i${SHLIB_EXT} \
|
||||
lib$$i.a $$libs -all_load -current_version ${SHLIB_MAJOR}.${SHLIB_MINOR} \
|
||||
-compatibility_version ${SHLIB_MAJOR}.`echo ${SHLIB_MINOR} | cut -d. -f1` \
|
||||
@@ -344,13 +351,14 @@ do_cygwin-shared:
|
||||
[ -f apps/$$shlib ] && rm apps/$$shlib; \
|
||||
[ -f test/$$shlib ] && rm test/$$shlib; \
|
||||
base=; [ $$i = "crypto" ] && base=-Wl,--image-base,0x63000000; \
|
||||
( set -x; ${CC} ${SHARED_LDFLAGS} \
|
||||
( set -x; $${FIPSLD:-${CC}} ${SHARED_LDFLAGS} \
|
||||
-shared $$base -o $$shlib \
|
||||
-Wl,-Bsymbolic \
|
||||
-Wl,--whole-archive lib$$i.a \
|
||||
-Wl,--out-implib,lib$$i.dll.a \
|
||||
-Wl,--no-whole-archive $$libs ${EX_LIBS} ) || exit 1; \
|
||||
cp -p $$shlib apps/; cp -p $$shlib test/; \
|
||||
touch -c lib$$i.dll.a; \
|
||||
libs="-l$$i $$libs"; \
|
||||
done
|
||||
|
||||
@@ -363,7 +371,7 @@ do_alpha-osf1-shared:
|
||||
if [ "${SHLIBDIRS}" = "ssl" -a -n "$(LIBKRB5)" ]; then \
|
||||
libs="$(LIBKRB5) $$libs"; \
|
||||
fi; \
|
||||
( set -x; ${CC} ${SHARED_LDFLAGS} \
|
||||
( set -x; $${FIPSLD:-${CC}} ${SHARED_LDFLAGS} \
|
||||
-shared -o lib$$i.so \
|
||||
-set_version "${SHLIB_VERSION_HISTORY}${SHLIB_VERSION_NUMBER}" \
|
||||
-all lib$$i.a -none $$libs ${EX_LIBS} ) || exit 1; \
|
||||
@@ -382,7 +390,7 @@ do_tru64-shared:
|
||||
if [ "${SHLIBDIRS}" = "ssl" -a -n "$(LIBKRB5)" ]; then \
|
||||
libs="$(LIBKRB5) $$libs"; \
|
||||
fi; \
|
||||
( set -x; ${CC} ${SHARED_LDFLAGS} \
|
||||
( set -x; $${FIPSLD:-${CC}} ${SHARED_LDFLAGS} \
|
||||
-shared -msym -o lib$$i.so \
|
||||
-set_version "${SHLIB_VERSION_HISTORY}${SHLIB_VERSION_NUMBER}" \
|
||||
-all lib$$i.a -none $$libs ${EX_LIBS} ) || exit 1; \
|
||||
@@ -401,7 +409,7 @@ do_tru64-shared-rpath:
|
||||
if [ "${SHLIBDIRS}" = "ssl" -a -n "$(LIBKRB5)" ]; then \
|
||||
libs="$(LIBKRB5) $$libs"; \
|
||||
fi; \
|
||||
( set -x; ${CC} ${SHARED_LDFLAGS} \
|
||||
( set -x; $${FIPSLD:-${CC}} ${SHARED_LDFLAGS} \
|
||||
-shared -msym -o lib$$i.so \
|
||||
-rpath ${INSTALLTOP}/lib \
|
||||
-set_version "${SHLIB_VERSION_HISTORY}${SHLIB_VERSION_NUMBER}" \
|
||||
@@ -423,7 +431,7 @@ do_solaris-shared:
|
||||
( PATH=/usr/ccs/bin:$$PATH ; export PATH; \
|
||||
MINUSZ='-z '; \
|
||||
(${CC} -v 2>&1 | grep gcc) > /dev/null && MINUSZ='-Wl,-z,'; \
|
||||
set -x; ${CC} ${SHARED_LDFLAGS} \
|
||||
set -x; $${FIPSLD:-${CC}} ${SHARED_LDFLAGS} \
|
||||
-o lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
|
||||
-h lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
|
||||
-Wl,-Bsymbolic \
|
||||
@@ -448,7 +456,7 @@ do_svr3-shared:
|
||||
for obj in `ar t lib$$i.a` ; do \
|
||||
OBJS="$${OBJS} `grep /$$obj allobjs`" ; \
|
||||
done ; \
|
||||
set -x; ${CC} ${SHARED_LDFLAGS} \
|
||||
set -x; $${FIPSLD:-${CC}} ${SHARED_LDFLAGS} \
|
||||
-G -o lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
|
||||
-h lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
|
||||
$${OBJS} $$libs ${EX_LIBS} ) || exit 1; \
|
||||
@@ -474,7 +482,7 @@ do_svr5-shared:
|
||||
OBJS="$${OBJS} `grep /$$obj allobjs`" ; \
|
||||
done ; \
|
||||
set -x; LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH \
|
||||
${CC} ${SHARED_LDFLAGS} \
|
||||
$${FIPSLD:-${CC}} ${SHARED_LDFLAGS} \
|
||||
$${SHARE_FLAG} -o lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
|
||||
-h lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
|
||||
$${OBJS} $$libs ${EX_LIBS} ) || exit 1; \
|
||||
@@ -493,7 +501,7 @@ do_irix-shared:
|
||||
fi; \
|
||||
( WHOLELIB="-all lib$$i.a -none"; \
|
||||
(${CC} -v 2>&1 | grep gcc) > /dev/null && WHOLELIB="-Wl,-all,lib$$i.a,-none"; \
|
||||
set -x; ${CC} ${SHARED_LDFLAGS} \
|
||||
set -x; $${FIPSLD:-${CC}} ${SHARED_LDFLAGS} \
|
||||
-shared -o lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
|
||||
-Wl,-soname,lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
|
||||
$${WHOLELIB} $$libs ${EX_LIBS}) || exit 1; \
|
||||
@@ -516,7 +524,7 @@ do_hpux-shared:
|
||||
[ -f $$shlib ] && rm -f $$shlib; \
|
||||
ALLSYMSFLAGS='-Wl,-Fl'; \
|
||||
expr $(PLATFORM) : 'hpux64' > /dev/null && ALLSYMSFLAGS='-Wl,+forceload'; \
|
||||
( set -x; ${CC} ${SHARED_LDFLAGS} \
|
||||
( set -x; $${FIPSLD:-${CC}} ${SHARED_LDFLAGS} \
|
||||
-Wl,-B,symbolic,+vnocompatwarnings,-z,+h,$$shlib \
|
||||
-o $$shlib $$ALLSYMSFLAGS,lib$$i.a -ldld ) || exit 1; \
|
||||
chmod a=rx $$shlib; \
|
||||
@@ -564,7 +572,7 @@ do_aix-shared:
|
||||
OBJECT_MODE=$${OBJECT_MODE:-32}; export OBJECT_MODE; \
|
||||
ld -r -o lib$$i.o $(ALLSYMSFLAG) lib$$i.a && \
|
||||
( nm -Pg lib$$i.o | grep ' [BD] ' | cut -f1 -d' ' > lib$$i.exp; \
|
||||
$(SHAREDCMD) $(SHAREDFLAGS) \
|
||||
$${FIPSLD:-${CC}} $(SHAREDFLAGS) \
|
||||
-o lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} lib$$i.o \
|
||||
$$libs ${EX_LIBS} ) ) \
|
||||
|| exit 1; \
|
||||
@@ -580,7 +588,7 @@ do_reliantunix-shared:
|
||||
( set -x; \
|
||||
( Opwd=`pwd` ; mkdir $$tmpdir || exit 1; \
|
||||
cd $$tmpdir || exit 1 ; ar x $$Opwd/lib$$i.a ; \
|
||||
${CC} -G -o lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} *.o \
|
||||
$${FIPSLD:-${CC}} -G -o lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} *.o \
|
||||
) || exit 1; \
|
||||
cp $$tmpdir/lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} . ; \
|
||||
) || exit 1; \
|
||||
@@ -816,16 +824,7 @@ install_sw:
|
||||
if [ "$(PLATFORM)" != "Cygwin" ]; then \
|
||||
cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \
|
||||
chmod 555 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \
|
||||
mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new \
|
||||
$(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i; \
|
||||
sig="$$i.$${HMAC_EXT:-sha1}"; \
|
||||
if [ -f $$sig ]; then \
|
||||
echo installing $$sig; \
|
||||
cp $$sig $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$sig.new; \
|
||||
chmod 444 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$sig.new; \
|
||||
mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$sig.new \
|
||||
$(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$sig; \
|
||||
fi; \
|
||||
mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i; \
|
||||
else \
|
||||
c=`echo $$i | sed 's/^lib\(.*\)\.dll/cyg\1-$(SHLIB_VERSION_NUMBER).dll/'`; \
|
||||
cp $$c $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new; \
|
||||
@@ -848,15 +847,6 @@ install_sw:
|
||||
sed -e '1,/^$$/d' doc/openssl-shared.txt; \
|
||||
fi; \
|
||||
fi
|
||||
@for i in $(SIGS) ;\
|
||||
do \
|
||||
if [ -f "$$i" ]; then \
|
||||
( echo installing $$i; \
|
||||
cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \
|
||||
chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \
|
||||
mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i ); \
|
||||
fi; \
|
||||
done;
|
||||
cp openssl.pc $(INSTALL_PREFIX)$(INSTALLTOP)/lib/pkgconfig
|
||||
chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/pkgconfig/openssl.pc
|
||||
|
||||
|
||||
14
NEWS
14
NEWS
@@ -5,9 +5,21 @@
|
||||
This file gives a brief overview of the major changes between each OpenSSL
|
||||
release. For more details please read the CHANGES file.
|
||||
|
||||
Major changes between OpenSSL 0.9.7j and OpenSSL 0.9.7k:
|
||||
|
||||
o Fix Daniel Bleichenbacher forged signature attack, CVE-2006-4339
|
||||
|
||||
Major changes between OpenSSL 0.9.7i and OpenSSL 0.9.7j:
|
||||
|
||||
o Update Windows build system for FIPS.
|
||||
|
||||
Major changes between OpenSSL 0.9.7h and OpenSSL 0.9.7i:
|
||||
|
||||
o Give EVP_MAX_MD_SIZE it's old value, except for a FIPS build.
|
||||
|
||||
Major changes between OpenSSL 0.9.7g and OpenSSL 0.9.7h:
|
||||
|
||||
o Fix SSL 2.0 Rollback, CAN-2005-2969
|
||||
o Fix SSL 2.0 Rollback, CVE-2005-2969
|
||||
o Allow use of fixed-length exponent on DSA signing
|
||||
o Default fixed-window RSA, DSA, DH private-key operations
|
||||
|
||||
|
||||
4
README
4
README
@@ -1,7 +1,7 @@
|
||||
|
||||
OpenSSL 0.9.7h 11 Oct 2005
|
||||
OpenSSL 0.9.7k 05 Sep 2006
|
||||
|
||||
Copyright (c) 1998-2005 The OpenSSL Project
|
||||
Copyright (c) 1998-2006 The OpenSSL Project
|
||||
Copyright (c) 1995-1998 Eric A. Young, Tim J. Hudson
|
||||
All rights reserved.
|
||||
|
||||
|
||||
7
STATUS
7
STATUS
@@ -1,12 +1,17 @@
|
||||
|
||||
OpenSSL STATUS Last modified at
|
||||
______________ $Date: 2005/10/11 10:10:03 $
|
||||
______________ $Date: 2006/09/05 08:34:05 $
|
||||
|
||||
DEVELOPMENT STATE
|
||||
|
||||
o OpenSSL 0.9.9: Under development...
|
||||
o OpenSSL 0.9.8c: Released on September 5th, 2006
|
||||
o OpenSSL 0.9.8b: Released on May 4th, 2006
|
||||
o OpenSSL 0.9.8a: Released on October 11th, 2005
|
||||
o OpenSSL 0.9.8: Released on July 5th, 2005
|
||||
o OpenSSL 0.9.7k: Released on September 5th, 2006
|
||||
o OpenSSL 0.9.7j: Released on May 4th, 2006
|
||||
o OpenSSL 0.9.7i: Released on October 14th, 2005
|
||||
o OpenSSL 0.9.7h: Released on October 11th, 2005
|
||||
o OpenSSL 0.9.7g: Released on April 11th, 2005
|
||||
o OpenSSL 0.9.7f: Released on March 22nd, 2005
|
||||
|
||||
4
TABLE
4
TABLE
@@ -1402,7 +1402,7 @@ $arflags =
|
||||
|
||||
*** darwin-i386-cc
|
||||
$cc = cc
|
||||
$cflags = -O3 -fomit-frame-pointer -fno-common -DB_ENDIAN
|
||||
$cflags = -O3 -fomit-frame-pointer -fno-common
|
||||
$unistd =
|
||||
$thread_cflag = -D_REENTRANT
|
||||
$sys_id = MACOSX
|
||||
@@ -3920,7 +3920,7 @@ $rc5_obj =
|
||||
$dso_scheme = dlfcn
|
||||
$shared_target= solaris-shared
|
||||
$shared_cflag = -KPIC
|
||||
$shared_ldflag =
|
||||
$shared_ldflag = -G -dy -z text
|
||||
$shared_extension = .so.$(SHLIB_MAJOR).$(SHLIB_MINOR)
|
||||
$ranlib =
|
||||
$arflags =
|
||||
|
||||
@@ -103,14 +103,6 @@ install:
|
||||
chmod 755 $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i.new; \
|
||||
mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i.new \
|
||||
$(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i; \
|
||||
sig="$$i.$${HMAC_EXT:-sha1}"; \
|
||||
if [ -f $$sig ]; then \
|
||||
echo installing $$sig; \
|
||||
cp $$sig $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$sig.new; \
|
||||
chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$sig.new; \
|
||||
mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$sig.new \
|
||||
$(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$sig; \
|
||||
fi; \
|
||||
) done;
|
||||
@for i in $(SCRIPTS); \
|
||||
do \
|
||||
@@ -152,20 +144,18 @@ $(DLIBCRYPTO):
|
||||
|
||||
$(EXE): progs.h $(E_OBJ) $(PROGRAM).o $(DLIBCRYPTO) $(DLIBSSL)
|
||||
$(RM) $(EXE)
|
||||
@if egrep 'define OPENSSL_FIPS' $(TOP)/include/openssl/opensslconf.h > /dev/null; then \
|
||||
FIPSLD_CC=$(CC); CC=$(TOP)/fips-1.0/fipsld; export CC FIPSLD_CC; \
|
||||
fi; \
|
||||
SHARED_LIBS="$(SHARED_LIBS)"; \
|
||||
if [ "$(SHLIB_TARGET)" = "darwin-shared" ] ; then \
|
||||
SHARED_LIBS=""; \
|
||||
fi; \
|
||||
if [ -z "$(SHARED_LIBS)" ]; then \
|
||||
if [ -z "$$SHARED_LIBS" ]; then \
|
||||
set -x; $${CC:-$(CC)} -o $(EXE) $(CFLAGS) $(PROGRAM).o $(E_OBJ) $(PEX_LIBS) $(DLIBSSL) $(LIBKRB5) $(DLIBCRYPTO) $(EX_LIBS) ; \
|
||||
else \
|
||||
set -x; LD_LIBRARY_PATH=..:$$LD_LIBRARY_PATH \
|
||||
$(CC) -o $(EXE) $(CFLAGS) $(PROGRAM).o $(E_OBJ) $(PEX_LIBS) $(LIBSSL) $(LIBKRB5) $(LIBCRYPTO) $(EX_LIBS) ; \
|
||||
fi; \
|
||||
if [ -z "$$SHARED_LIBS" ]; then \
|
||||
if egrep 'define OPENSSL_FIPS' $(TOP)/include/openssl/opensslconf.h > /dev/null; then \
|
||||
TOP=$(TOP) $(TOP)/fips/openssl_fips_fingerprint $(TOP)/libcrypto.a $(EXE); \
|
||||
fi; \
|
||||
fi
|
||||
-(cd ..; \
|
||||
OPENSSL="`pwd`/util/opensslwrap.sh"; export OPENSSL; \
|
||||
|
||||
@@ -237,14 +237,7 @@ int main(int Argc, char *Argv[])
|
||||
|
||||
#ifdef OPENSSL_FIPS
|
||||
if(getenv("OPENSSL_FIPS")) {
|
||||
#if defined(_WIN32)
|
||||
char filename[MAX_PATH] = "";
|
||||
GetModuleFileNameA( NULL, filename, MAX_PATH) ;
|
||||
p = filename;
|
||||
#else
|
||||
p = Argv[0];
|
||||
#endif
|
||||
if (!FIPS_mode_set(1,p)) {
|
||||
if (!FIPS_mode_set(1)) {
|
||||
ERR_load_crypto_strings();
|
||||
ERR_print_errors(BIO_new_fp(stderr,BIO_NOCLOSE));
|
||||
EXIT(1);
|
||||
|
||||
@@ -873,10 +873,12 @@ int alg_print (BIO *x, X509_ALGOR *alg)
|
||||
unsigned char *p;
|
||||
p = alg->parameter->value.sequence->data;
|
||||
pbe = d2i_PBEPARAM (NULL, &p, alg->parameter->value.sequence->length);
|
||||
if (!pbe)
|
||||
return 1;
|
||||
BIO_printf (bio_err, "%s, Iteration %d\n",
|
||||
OBJ_nid2ln(OBJ_obj2nid(alg->algorithm)), ASN1_INTEGER_get(pbe->iter));
|
||||
PBEPARAM_free (pbe);
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Load all certificates from a given file */
|
||||
|
||||
@@ -483,7 +483,8 @@ int MAIN(int argc, char **argv)
|
||||
p7 = PKCS7_encrypt(encerts, in, cipher, flags);
|
||||
} else if(operation == SMIME_SIGN) {
|
||||
p7 = PKCS7_sign(signer, key, other, in, flags);
|
||||
if (BIO_reset(in) != 0 && (flags & PKCS7_DETACHED)) {
|
||||
if ((flags & PKCS7_DETACHED) && (outformat == FORMAT_SMIME)
|
||||
&& (BIO_reset(in) != 0)) {
|
||||
BIO_printf(bio_err, "Can't rewind input file\n");
|
||||
goto end;
|
||||
}
|
||||
|
||||
22
config
22
config
@@ -54,6 +54,22 @@ SYSTEM=`(uname -s) 2>/dev/null` || SYSTEM="unknown"
|
||||
VERSION=`(uname -v) 2>/dev/null` || VERSION="unknown"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# Check for VC++ presence first.
|
||||
#
|
||||
#if [ "x$MSVCDIR" != "x" -o "x$VCINSTALLDIR" != "x" ]; then
|
||||
# perl Configure VC-WIN32 $*
|
||||
# cmd /c ms\\do_masm.bat
|
||||
# perl util/mk1mf.pl VC-WIN32-GMAKE >mak.tmp
|
||||
# rm Makefile
|
||||
# mv mak.tmp Makefile
|
||||
# echo "Configured for VC++ using GNU make"
|
||||
# exit 0
|
||||
#fi
|
||||
#
|
||||
|
||||
# Now test for ISC and SCO, since it is has a braindamaged uname.
|
||||
#
|
||||
# We need to work around FreeBSD 1.1.5.1
|
||||
@@ -339,6 +355,10 @@ case "${SYSTEM}:${RELEASE}:${VERSION}:${MACHINE}" in
|
||||
|
||||
MINGW*)
|
||||
echo "${MACHINE}-whatever-mingw"; echo 0;
|
||||
# Save fipslib path so VC++ build can find it
|
||||
(cd /usr/local/ssl/lib ; pwd -W ) > util/fipslib_path.txt
|
||||
# Extract _chkstk.o so VC++ can use it, to avoid __alloca link error
|
||||
(cd ms ; ar x `gcc -print-libgcc-file-name` _chkstk.o)
|
||||
;;
|
||||
CYGWIN*)
|
||||
case "$RELEASE" in
|
||||
@@ -407,7 +427,7 @@ if [ "$GCCVER" != "" ]; then
|
||||
CC=gcc
|
||||
# then strip off whatever prefix egcs prepends the number with...
|
||||
# Hopefully, this will work for any future prefixes as well.
|
||||
GCCVER=`echo $GCCVER | sed 's/^[a-zA-Z]*\-//'`
|
||||
GCCVER=`echo $GCCVER | LC_ALL=C sed 's/^[a-zA-Z]*\-//'`
|
||||
# Since gcc 3.1 gcc --version behaviour has changed. gcc -dumpversion
|
||||
# does give us what we want though, so we use that. We just just the
|
||||
# major and minor version numbers.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# SSLeay/crypto/Makefile
|
||||
# OpenSSL/crypto/Makefile
|
||||
#
|
||||
|
||||
DIR= crypto
|
||||
|
||||
@@ -47,13 +47,12 @@ Te0[x] = S [x].[02, 01, 01, 03];
|
||||
Te1[x] = S [x].[03, 02, 01, 01];
|
||||
Te2[x] = S [x].[01, 03, 02, 01];
|
||||
Te3[x] = S [x].[01, 01, 03, 02];
|
||||
Te4[x] = S [x].[01, 01, 01, 01];
|
||||
|
||||
Td0[x] = Si[x].[0e, 09, 0d, 0b];
|
||||
Td1[x] = Si[x].[0b, 0e, 09, 0d];
|
||||
Td2[x] = Si[x].[0d, 0b, 0e, 09];
|
||||
Td3[x] = Si[x].[09, 0d, 0b, 0e];
|
||||
Td4[x] = Si[x].[01, 01, 01, 01];
|
||||
Td4[x] = Si[x].[01];
|
||||
*/
|
||||
|
||||
static const u32 Te0[256] = {
|
||||
@@ -255,7 +254,6 @@ static const u32 Te2[256] = {
|
||||
0xb0cb7bb0U, 0x54fca854U, 0xbbd66dbbU, 0x163a2c16U,
|
||||
};
|
||||
static const u32 Te3[256] = {
|
||||
|
||||
0x6363a5c6U, 0x7c7c84f8U, 0x777799eeU, 0x7b7b8df6U,
|
||||
0xf2f20dffU, 0x6b6bbdd6U, 0x6f6fb1deU, 0xc5c55491U,
|
||||
0x30305060U, 0x01010302U, 0x6767a9ceU, 0x2b2b7d56U,
|
||||
@@ -321,72 +319,7 @@ static const u32 Te3[256] = {
|
||||
0x4141c382U, 0x9999b029U, 0x2d2d775aU, 0x0f0f111eU,
|
||||
0xb0b0cb7bU, 0x5454fca8U, 0xbbbbd66dU, 0x16163a2cU,
|
||||
};
|
||||
static const u32 Te4[256] = {
|
||||
0x63636363U, 0x7c7c7c7cU, 0x77777777U, 0x7b7b7b7bU,
|
||||
0xf2f2f2f2U, 0x6b6b6b6bU, 0x6f6f6f6fU, 0xc5c5c5c5U,
|
||||
0x30303030U, 0x01010101U, 0x67676767U, 0x2b2b2b2bU,
|
||||
0xfefefefeU, 0xd7d7d7d7U, 0xababababU, 0x76767676U,
|
||||
0xcacacacaU, 0x82828282U, 0xc9c9c9c9U, 0x7d7d7d7dU,
|
||||
0xfafafafaU, 0x59595959U, 0x47474747U, 0xf0f0f0f0U,
|
||||
0xadadadadU, 0xd4d4d4d4U, 0xa2a2a2a2U, 0xafafafafU,
|
||||
0x9c9c9c9cU, 0xa4a4a4a4U, 0x72727272U, 0xc0c0c0c0U,
|
||||
0xb7b7b7b7U, 0xfdfdfdfdU, 0x93939393U, 0x26262626U,
|
||||
0x36363636U, 0x3f3f3f3fU, 0xf7f7f7f7U, 0xccccccccU,
|
||||
0x34343434U, 0xa5a5a5a5U, 0xe5e5e5e5U, 0xf1f1f1f1U,
|
||||
0x71717171U, 0xd8d8d8d8U, 0x31313131U, 0x15151515U,
|
||||
0x04040404U, 0xc7c7c7c7U, 0x23232323U, 0xc3c3c3c3U,
|
||||
0x18181818U, 0x96969696U, 0x05050505U, 0x9a9a9a9aU,
|
||||
0x07070707U, 0x12121212U, 0x80808080U, 0xe2e2e2e2U,
|
||||
0xebebebebU, 0x27272727U, 0xb2b2b2b2U, 0x75757575U,
|
||||
0x09090909U, 0x83838383U, 0x2c2c2c2cU, 0x1a1a1a1aU,
|
||||
0x1b1b1b1bU, 0x6e6e6e6eU, 0x5a5a5a5aU, 0xa0a0a0a0U,
|
||||
0x52525252U, 0x3b3b3b3bU, 0xd6d6d6d6U, 0xb3b3b3b3U,
|
||||
0x29292929U, 0xe3e3e3e3U, 0x2f2f2f2fU, 0x84848484U,
|
||||
0x53535353U, 0xd1d1d1d1U, 0x00000000U, 0xededededU,
|
||||
0x20202020U, 0xfcfcfcfcU, 0xb1b1b1b1U, 0x5b5b5b5bU,
|
||||
0x6a6a6a6aU, 0xcbcbcbcbU, 0xbebebebeU, 0x39393939U,
|
||||
0x4a4a4a4aU, 0x4c4c4c4cU, 0x58585858U, 0xcfcfcfcfU,
|
||||
0xd0d0d0d0U, 0xefefefefU, 0xaaaaaaaaU, 0xfbfbfbfbU,
|
||||
0x43434343U, 0x4d4d4d4dU, 0x33333333U, 0x85858585U,
|
||||
0x45454545U, 0xf9f9f9f9U, 0x02020202U, 0x7f7f7f7fU,
|
||||
0x50505050U, 0x3c3c3c3cU, 0x9f9f9f9fU, 0xa8a8a8a8U,
|
||||
0x51515151U, 0xa3a3a3a3U, 0x40404040U, 0x8f8f8f8fU,
|
||||
0x92929292U, 0x9d9d9d9dU, 0x38383838U, 0xf5f5f5f5U,
|
||||
0xbcbcbcbcU, 0xb6b6b6b6U, 0xdadadadaU, 0x21212121U,
|
||||
0x10101010U, 0xffffffffU, 0xf3f3f3f3U, 0xd2d2d2d2U,
|
||||
0xcdcdcdcdU, 0x0c0c0c0cU, 0x13131313U, 0xececececU,
|
||||
0x5f5f5f5fU, 0x97979797U, 0x44444444U, 0x17171717U,
|
||||
0xc4c4c4c4U, 0xa7a7a7a7U, 0x7e7e7e7eU, 0x3d3d3d3dU,
|
||||
0x64646464U, 0x5d5d5d5dU, 0x19191919U, 0x73737373U,
|
||||
0x60606060U, 0x81818181U, 0x4f4f4f4fU, 0xdcdcdcdcU,
|
||||
0x22222222U, 0x2a2a2a2aU, 0x90909090U, 0x88888888U,
|
||||
0x46464646U, 0xeeeeeeeeU, 0xb8b8b8b8U, 0x14141414U,
|
||||
0xdedededeU, 0x5e5e5e5eU, 0x0b0b0b0bU, 0xdbdbdbdbU,
|
||||
0xe0e0e0e0U, 0x32323232U, 0x3a3a3a3aU, 0x0a0a0a0aU,
|
||||
0x49494949U, 0x06060606U, 0x24242424U, 0x5c5c5c5cU,
|
||||
0xc2c2c2c2U, 0xd3d3d3d3U, 0xacacacacU, 0x62626262U,
|
||||
0x91919191U, 0x95959595U, 0xe4e4e4e4U, 0x79797979U,
|
||||
0xe7e7e7e7U, 0xc8c8c8c8U, 0x37373737U, 0x6d6d6d6dU,
|
||||
0x8d8d8d8dU, 0xd5d5d5d5U, 0x4e4e4e4eU, 0xa9a9a9a9U,
|
||||
0x6c6c6c6cU, 0x56565656U, 0xf4f4f4f4U, 0xeaeaeaeaU,
|
||||
0x65656565U, 0x7a7a7a7aU, 0xaeaeaeaeU, 0x08080808U,
|
||||
0xbabababaU, 0x78787878U, 0x25252525U, 0x2e2e2e2eU,
|
||||
0x1c1c1c1cU, 0xa6a6a6a6U, 0xb4b4b4b4U, 0xc6c6c6c6U,
|
||||
0xe8e8e8e8U, 0xddddddddU, 0x74747474U, 0x1f1f1f1fU,
|
||||
0x4b4b4b4bU, 0xbdbdbdbdU, 0x8b8b8b8bU, 0x8a8a8a8aU,
|
||||
0x70707070U, 0x3e3e3e3eU, 0xb5b5b5b5U, 0x66666666U,
|
||||
0x48484848U, 0x03030303U, 0xf6f6f6f6U, 0x0e0e0e0eU,
|
||||
0x61616161U, 0x35353535U, 0x57575757U, 0xb9b9b9b9U,
|
||||
0x86868686U, 0xc1c1c1c1U, 0x1d1d1d1dU, 0x9e9e9e9eU,
|
||||
0xe1e1e1e1U, 0xf8f8f8f8U, 0x98989898U, 0x11111111U,
|
||||
0x69696969U, 0xd9d9d9d9U, 0x8e8e8e8eU, 0x94949494U,
|
||||
0x9b9b9b9bU, 0x1e1e1e1eU, 0x87878787U, 0xe9e9e9e9U,
|
||||
0xcecececeU, 0x55555555U, 0x28282828U, 0xdfdfdfdfU,
|
||||
0x8c8c8c8cU, 0xa1a1a1a1U, 0x89898989U, 0x0d0d0d0dU,
|
||||
0xbfbfbfbfU, 0xe6e6e6e6U, 0x42424242U, 0x68686868U,
|
||||
0x41414141U, 0x99999999U, 0x2d2d2d2dU, 0x0f0f0f0fU,
|
||||
0xb0b0b0b0U, 0x54545454U, 0xbbbbbbbbU, 0x16161616U,
|
||||
};
|
||||
|
||||
static const u32 Td0[256] = {
|
||||
0x51f4a750U, 0x7e416553U, 0x1a17a4c3U, 0x3a275e96U,
|
||||
0x3bab6bcbU, 0x1f9d45f1U, 0xacfa58abU, 0x4be30393U,
|
||||
@@ -540,7 +473,6 @@ static const u32 Td2[256] = {
|
||||
0xf4cd65daU, 0xbed50605U, 0x621fd134U, 0xfe8ac4a6U,
|
||||
0x539d342eU, 0x55a0a2f3U, 0xe132058aU, 0xeb75a4f6U,
|
||||
0xec390b83U, 0xefaa4060U, 0x9f065e71U, 0x1051bd6eU,
|
||||
|
||||
0x8af93e21U, 0x063d96ddU, 0x05aedd3eU, 0xbd464de6U,
|
||||
0x8db59154U, 0x5d0571c4U, 0xd46f0406U, 0x15ff6050U,
|
||||
0xfb241998U, 0xe997d6bdU, 0x43cc8940U, 0x9e7767d9U,
|
||||
@@ -652,71 +584,39 @@ static const u32 Td3[256] = {
|
||||
0xa8017139U, 0x0cb3de08U, 0xb4e49cd8U, 0x56c19064U,
|
||||
0xcb84617bU, 0x32b670d5U, 0x6c5c7448U, 0xb85742d0U,
|
||||
};
|
||||
static const u32 Td4[256] = {
|
||||
0x52525252U, 0x09090909U, 0x6a6a6a6aU, 0xd5d5d5d5U,
|
||||
0x30303030U, 0x36363636U, 0xa5a5a5a5U, 0x38383838U,
|
||||
0xbfbfbfbfU, 0x40404040U, 0xa3a3a3a3U, 0x9e9e9e9eU,
|
||||
0x81818181U, 0xf3f3f3f3U, 0xd7d7d7d7U, 0xfbfbfbfbU,
|
||||
0x7c7c7c7cU, 0xe3e3e3e3U, 0x39393939U, 0x82828282U,
|
||||
0x9b9b9b9bU, 0x2f2f2f2fU, 0xffffffffU, 0x87878787U,
|
||||
0x34343434U, 0x8e8e8e8eU, 0x43434343U, 0x44444444U,
|
||||
0xc4c4c4c4U, 0xdedededeU, 0xe9e9e9e9U, 0xcbcbcbcbU,
|
||||
0x54545454U, 0x7b7b7b7bU, 0x94949494U, 0x32323232U,
|
||||
0xa6a6a6a6U, 0xc2c2c2c2U, 0x23232323U, 0x3d3d3d3dU,
|
||||
0xeeeeeeeeU, 0x4c4c4c4cU, 0x95959595U, 0x0b0b0b0bU,
|
||||
0x42424242U, 0xfafafafaU, 0xc3c3c3c3U, 0x4e4e4e4eU,
|
||||
0x08080808U, 0x2e2e2e2eU, 0xa1a1a1a1U, 0x66666666U,
|
||||
0x28282828U, 0xd9d9d9d9U, 0x24242424U, 0xb2b2b2b2U,
|
||||
0x76767676U, 0x5b5b5b5bU, 0xa2a2a2a2U, 0x49494949U,
|
||||
0x6d6d6d6dU, 0x8b8b8b8bU, 0xd1d1d1d1U, 0x25252525U,
|
||||
0x72727272U, 0xf8f8f8f8U, 0xf6f6f6f6U, 0x64646464U,
|
||||
0x86868686U, 0x68686868U, 0x98989898U, 0x16161616U,
|
||||
0xd4d4d4d4U, 0xa4a4a4a4U, 0x5c5c5c5cU, 0xccccccccU,
|
||||
0x5d5d5d5dU, 0x65656565U, 0xb6b6b6b6U, 0x92929292U,
|
||||
0x6c6c6c6cU, 0x70707070U, 0x48484848U, 0x50505050U,
|
||||
0xfdfdfdfdU, 0xededededU, 0xb9b9b9b9U, 0xdadadadaU,
|
||||
0x5e5e5e5eU, 0x15151515U, 0x46464646U, 0x57575757U,
|
||||
0xa7a7a7a7U, 0x8d8d8d8dU, 0x9d9d9d9dU, 0x84848484U,
|
||||
0x90909090U, 0xd8d8d8d8U, 0xababababU, 0x00000000U,
|
||||
0x8c8c8c8cU, 0xbcbcbcbcU, 0xd3d3d3d3U, 0x0a0a0a0aU,
|
||||
0xf7f7f7f7U, 0xe4e4e4e4U, 0x58585858U, 0x05050505U,
|
||||
0xb8b8b8b8U, 0xb3b3b3b3U, 0x45454545U, 0x06060606U,
|
||||
0xd0d0d0d0U, 0x2c2c2c2cU, 0x1e1e1e1eU, 0x8f8f8f8fU,
|
||||
0xcacacacaU, 0x3f3f3f3fU, 0x0f0f0f0fU, 0x02020202U,
|
||||
0xc1c1c1c1U, 0xafafafafU, 0xbdbdbdbdU, 0x03030303U,
|
||||
0x01010101U, 0x13131313U, 0x8a8a8a8aU, 0x6b6b6b6bU,
|
||||
0x3a3a3a3aU, 0x91919191U, 0x11111111U, 0x41414141U,
|
||||
0x4f4f4f4fU, 0x67676767U, 0xdcdcdcdcU, 0xeaeaeaeaU,
|
||||
0x97979797U, 0xf2f2f2f2U, 0xcfcfcfcfU, 0xcecececeU,
|
||||
0xf0f0f0f0U, 0xb4b4b4b4U, 0xe6e6e6e6U, 0x73737373U,
|
||||
0x96969696U, 0xacacacacU, 0x74747474U, 0x22222222U,
|
||||
0xe7e7e7e7U, 0xadadadadU, 0x35353535U, 0x85858585U,
|
||||
0xe2e2e2e2U, 0xf9f9f9f9U, 0x37373737U, 0xe8e8e8e8U,
|
||||
0x1c1c1c1cU, 0x75757575U, 0xdfdfdfdfU, 0x6e6e6e6eU,
|
||||
0x47474747U, 0xf1f1f1f1U, 0x1a1a1a1aU, 0x71717171U,
|
||||
0x1d1d1d1dU, 0x29292929U, 0xc5c5c5c5U, 0x89898989U,
|
||||
0x6f6f6f6fU, 0xb7b7b7b7U, 0x62626262U, 0x0e0e0e0eU,
|
||||
0xaaaaaaaaU, 0x18181818U, 0xbebebebeU, 0x1b1b1b1bU,
|
||||
0xfcfcfcfcU, 0x56565656U, 0x3e3e3e3eU, 0x4b4b4b4bU,
|
||||
0xc6c6c6c6U, 0xd2d2d2d2U, 0x79797979U, 0x20202020U,
|
||||
0x9a9a9a9aU, 0xdbdbdbdbU, 0xc0c0c0c0U, 0xfefefefeU,
|
||||
0x78787878U, 0xcdcdcdcdU, 0x5a5a5a5aU, 0xf4f4f4f4U,
|
||||
0x1f1f1f1fU, 0xddddddddU, 0xa8a8a8a8U, 0x33333333U,
|
||||
0x88888888U, 0x07070707U, 0xc7c7c7c7U, 0x31313131U,
|
||||
0xb1b1b1b1U, 0x12121212U, 0x10101010U, 0x59595959U,
|
||||
0x27272727U, 0x80808080U, 0xececececU, 0x5f5f5f5fU,
|
||||
0x60606060U, 0x51515151U, 0x7f7f7f7fU, 0xa9a9a9a9U,
|
||||
0x19191919U, 0xb5b5b5b5U, 0x4a4a4a4aU, 0x0d0d0d0dU,
|
||||
0x2d2d2d2dU, 0xe5e5e5e5U, 0x7a7a7a7aU, 0x9f9f9f9fU,
|
||||
0x93939393U, 0xc9c9c9c9U, 0x9c9c9c9cU, 0xefefefefU,
|
||||
0xa0a0a0a0U, 0xe0e0e0e0U, 0x3b3b3b3bU, 0x4d4d4d4dU,
|
||||
0xaeaeaeaeU, 0x2a2a2a2aU, 0xf5f5f5f5U, 0xb0b0b0b0U,
|
||||
0xc8c8c8c8U, 0xebebebebU, 0xbbbbbbbbU, 0x3c3c3c3cU,
|
||||
0x83838383U, 0x53535353U, 0x99999999U, 0x61616161U,
|
||||
0x17171717U, 0x2b2b2b2bU, 0x04040404U, 0x7e7e7e7eU,
|
||||
0xbabababaU, 0x77777777U, 0xd6d6d6d6U, 0x26262626U,
|
||||
0xe1e1e1e1U, 0x69696969U, 0x14141414U, 0x63636363U,
|
||||
0x55555555U, 0x21212121U, 0x0c0c0c0cU, 0x7d7d7d7dU,
|
||||
static const u8 Td4[256] = {
|
||||
0x52U, 0x09U, 0x6aU, 0xd5U, 0x30U, 0x36U, 0xa5U, 0x38U,
|
||||
0xbfU, 0x40U, 0xa3U, 0x9eU, 0x81U, 0xf3U, 0xd7U, 0xfbU,
|
||||
0x7cU, 0xe3U, 0x39U, 0x82U, 0x9bU, 0x2fU, 0xffU, 0x87U,
|
||||
0x34U, 0x8eU, 0x43U, 0x44U, 0xc4U, 0xdeU, 0xe9U, 0xcbU,
|
||||
0x54U, 0x7bU, 0x94U, 0x32U, 0xa6U, 0xc2U, 0x23U, 0x3dU,
|
||||
0xeeU, 0x4cU, 0x95U, 0x0bU, 0x42U, 0xfaU, 0xc3U, 0x4eU,
|
||||
0x08U, 0x2eU, 0xa1U, 0x66U, 0x28U, 0xd9U, 0x24U, 0xb2U,
|
||||
0x76U, 0x5bU, 0xa2U, 0x49U, 0x6dU, 0x8bU, 0xd1U, 0x25U,
|
||||
0x72U, 0xf8U, 0xf6U, 0x64U, 0x86U, 0x68U, 0x98U, 0x16U,
|
||||
0xd4U, 0xa4U, 0x5cU, 0xccU, 0x5dU, 0x65U, 0xb6U, 0x92U,
|
||||
0x6cU, 0x70U, 0x48U, 0x50U, 0xfdU, 0xedU, 0xb9U, 0xdaU,
|
||||
0x5eU, 0x15U, 0x46U, 0x57U, 0xa7U, 0x8dU, 0x9dU, 0x84U,
|
||||
0x90U, 0xd8U, 0xabU, 0x00U, 0x8cU, 0xbcU, 0xd3U, 0x0aU,
|
||||
0xf7U, 0xe4U, 0x58U, 0x05U, 0xb8U, 0xb3U, 0x45U, 0x06U,
|
||||
0xd0U, 0x2cU, 0x1eU, 0x8fU, 0xcaU, 0x3fU, 0x0fU, 0x02U,
|
||||
0xc1U, 0xafU, 0xbdU, 0x03U, 0x01U, 0x13U, 0x8aU, 0x6bU,
|
||||
0x3aU, 0x91U, 0x11U, 0x41U, 0x4fU, 0x67U, 0xdcU, 0xeaU,
|
||||
0x97U, 0xf2U, 0xcfU, 0xceU, 0xf0U, 0xb4U, 0xe6U, 0x73U,
|
||||
0x96U, 0xacU, 0x74U, 0x22U, 0xe7U, 0xadU, 0x35U, 0x85U,
|
||||
0xe2U, 0xf9U, 0x37U, 0xe8U, 0x1cU, 0x75U, 0xdfU, 0x6eU,
|
||||
0x47U, 0xf1U, 0x1aU, 0x71U, 0x1dU, 0x29U, 0xc5U, 0x89U,
|
||||
0x6fU, 0xb7U, 0x62U, 0x0eU, 0xaaU, 0x18U, 0xbeU, 0x1bU,
|
||||
0xfcU, 0x56U, 0x3eU, 0x4bU, 0xc6U, 0xd2U, 0x79U, 0x20U,
|
||||
0x9aU, 0xdbU, 0xc0U, 0xfeU, 0x78U, 0xcdU, 0x5aU, 0xf4U,
|
||||
0x1fU, 0xddU, 0xa8U, 0x33U, 0x88U, 0x07U, 0xc7U, 0x31U,
|
||||
0xb1U, 0x12U, 0x10U, 0x59U, 0x27U, 0x80U, 0xecU, 0x5fU,
|
||||
0x60U, 0x51U, 0x7fU, 0xa9U, 0x19U, 0xb5U, 0x4aU, 0x0dU,
|
||||
0x2dU, 0xe5U, 0x7aU, 0x9fU, 0x93U, 0xc9U, 0x9cU, 0xefU,
|
||||
0xa0U, 0xe0U, 0x3bU, 0x4dU, 0xaeU, 0x2aU, 0xf5U, 0xb0U,
|
||||
0xc8U, 0xebU, 0xbbU, 0x3cU, 0x83U, 0x53U, 0x99U, 0x61U,
|
||||
0x17U, 0x2bU, 0x04U, 0x7eU, 0xbaU, 0x77U, 0xd6U, 0x26U,
|
||||
0xe1U, 0x69U, 0x14U, 0x63U, 0x55U, 0x21U, 0x0cU, 0x7dU,
|
||||
};
|
||||
static const u32 rcon[] = {
|
||||
0x01000000, 0x02000000, 0x04000000, 0x08000000,
|
||||
@@ -756,10 +656,10 @@ int AES_set_encrypt_key(const unsigned char *userKey, const int bits,
|
||||
while (1) {
|
||||
temp = rk[3];
|
||||
rk[4] = rk[0] ^
|
||||
(Te4[(temp >> 16) & 0xff] & 0xff000000) ^
|
||||
(Te4[(temp >> 8) & 0xff] & 0x00ff0000) ^
|
||||
(Te4[(temp ) & 0xff] & 0x0000ff00) ^
|
||||
(Te4[(temp >> 24) ] & 0x000000ff) ^
|
||||
(Te2[(temp >> 16) & 0xff] & 0xff000000) ^
|
||||
(Te3[(temp >> 8) & 0xff] & 0x00ff0000) ^
|
||||
(Te0[(temp ) & 0xff] & 0x0000ff00) ^
|
||||
(Te1[(temp >> 24) ] & 0x000000ff) ^
|
||||
rcon[i];
|
||||
rk[5] = rk[1] ^ rk[4];
|
||||
rk[6] = rk[2] ^ rk[5];
|
||||
@@ -776,10 +676,10 @@ int AES_set_encrypt_key(const unsigned char *userKey, const int bits,
|
||||
while (1) {
|
||||
temp = rk[ 5];
|
||||
rk[ 6] = rk[ 0] ^
|
||||
(Te4[(temp >> 16) & 0xff] & 0xff000000) ^
|
||||
(Te4[(temp >> 8) & 0xff] & 0x00ff0000) ^
|
||||
(Te4[(temp ) & 0xff] & 0x0000ff00) ^
|
||||
(Te4[(temp >> 24) ] & 0x000000ff) ^
|
||||
(Te2[(temp >> 16) & 0xff] & 0xff000000) ^
|
||||
(Te3[(temp >> 8) & 0xff] & 0x00ff0000) ^
|
||||
(Te0[(temp ) & 0xff] & 0x0000ff00) ^
|
||||
(Te1[(temp >> 24) ] & 0x000000ff) ^
|
||||
rcon[i];
|
||||
rk[ 7] = rk[ 1] ^ rk[ 6];
|
||||
rk[ 8] = rk[ 2] ^ rk[ 7];
|
||||
@@ -798,10 +698,10 @@ int AES_set_encrypt_key(const unsigned char *userKey, const int bits,
|
||||
while (1) {
|
||||
temp = rk[ 7];
|
||||
rk[ 8] = rk[ 0] ^
|
||||
(Te4[(temp >> 16) & 0xff] & 0xff000000) ^
|
||||
(Te4[(temp >> 8) & 0xff] & 0x00ff0000) ^
|
||||
(Te4[(temp ) & 0xff] & 0x0000ff00) ^
|
||||
(Te4[(temp >> 24) ] & 0x000000ff) ^
|
||||
(Te2[(temp >> 16) & 0xff] & 0xff000000) ^
|
||||
(Te3[(temp >> 8) & 0xff] & 0x00ff0000) ^
|
||||
(Te0[(temp ) & 0xff] & 0x0000ff00) ^
|
||||
(Te1[(temp >> 24) ] & 0x000000ff) ^
|
||||
rcon[i];
|
||||
rk[ 9] = rk[ 1] ^ rk[ 8];
|
||||
rk[10] = rk[ 2] ^ rk[ 9];
|
||||
@@ -811,10 +711,10 @@ int AES_set_encrypt_key(const unsigned char *userKey, const int bits,
|
||||
}
|
||||
temp = rk[11];
|
||||
rk[12] = rk[ 4] ^
|
||||
(Te4[(temp >> 24) ] & 0xff000000) ^
|
||||
(Te4[(temp >> 16) & 0xff] & 0x00ff0000) ^
|
||||
(Te4[(temp >> 8) & 0xff] & 0x0000ff00) ^
|
||||
(Te4[(temp ) & 0xff] & 0x000000ff);
|
||||
(Te2[(temp >> 24) ] & 0xff000000) ^
|
||||
(Te3[(temp >> 16) & 0xff] & 0x00ff0000) ^
|
||||
(Te0[(temp >> 8) & 0xff] & 0x0000ff00) ^
|
||||
(Te1[(temp ) & 0xff] & 0x000000ff);
|
||||
rk[13] = rk[ 5] ^ rk[12];
|
||||
rk[14] = rk[ 6] ^ rk[13];
|
||||
rk[15] = rk[ 7] ^ rk[14];
|
||||
@@ -853,25 +753,25 @@ int AES_set_decrypt_key(const unsigned char *userKey, const int bits,
|
||||
for (i = 1; i < (key->rounds); i++) {
|
||||
rk += 4;
|
||||
rk[0] =
|
||||
Td0[Te4[(rk[0] >> 24) ] & 0xff] ^
|
||||
Td1[Te4[(rk[0] >> 16) & 0xff] & 0xff] ^
|
||||
Td2[Te4[(rk[0] >> 8) & 0xff] & 0xff] ^
|
||||
Td3[Te4[(rk[0] ) & 0xff] & 0xff];
|
||||
Td0[Te1[(rk[0] >> 24) ] & 0xff] ^
|
||||
Td1[Te1[(rk[0] >> 16) & 0xff] & 0xff] ^
|
||||
Td2[Te1[(rk[0] >> 8) & 0xff] & 0xff] ^
|
||||
Td3[Te1[(rk[0] ) & 0xff] & 0xff];
|
||||
rk[1] =
|
||||
Td0[Te4[(rk[1] >> 24) ] & 0xff] ^
|
||||
Td1[Te4[(rk[1] >> 16) & 0xff] & 0xff] ^
|
||||
Td2[Te4[(rk[1] >> 8) & 0xff] & 0xff] ^
|
||||
Td3[Te4[(rk[1] ) & 0xff] & 0xff];
|
||||
Td0[Te1[(rk[1] >> 24) ] & 0xff] ^
|
||||
Td1[Te1[(rk[1] >> 16) & 0xff] & 0xff] ^
|
||||
Td2[Te1[(rk[1] >> 8) & 0xff] & 0xff] ^
|
||||
Td3[Te1[(rk[1] ) & 0xff] & 0xff];
|
||||
rk[2] =
|
||||
Td0[Te4[(rk[2] >> 24) ] & 0xff] ^
|
||||
Td1[Te4[(rk[2] >> 16) & 0xff] & 0xff] ^
|
||||
Td2[Te4[(rk[2] >> 8) & 0xff] & 0xff] ^
|
||||
Td3[Te4[(rk[2] ) & 0xff] & 0xff];
|
||||
Td0[Te1[(rk[2] >> 24) ] & 0xff] ^
|
||||
Td1[Te1[(rk[2] >> 16) & 0xff] & 0xff] ^
|
||||
Td2[Te1[(rk[2] >> 8) & 0xff] & 0xff] ^
|
||||
Td3[Te1[(rk[2] ) & 0xff] & 0xff];
|
||||
rk[3] =
|
||||
Td0[Te4[(rk[3] >> 24) ] & 0xff] ^
|
||||
Td1[Te4[(rk[3] >> 16) & 0xff] & 0xff] ^
|
||||
Td2[Te4[(rk[3] >> 8) & 0xff] & 0xff] ^
|
||||
Td3[Te4[(rk[3] ) & 0xff] & 0xff];
|
||||
Td0[Te1[(rk[3] >> 24) ] & 0xff] ^
|
||||
Td1[Te1[(rk[3] >> 16) & 0xff] & 0xff] ^
|
||||
Td2[Te1[(rk[3] >> 8) & 0xff] & 0xff] ^
|
||||
Td3[Te1[(rk[3] ) & 0xff] & 0xff];
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -1038,31 +938,31 @@ void AES_encrypt(const unsigned char *in, unsigned char *out,
|
||||
* map cipher state to byte array block:
|
||||
*/
|
||||
s0 =
|
||||
(Te4[(t0 >> 24) ] & 0xff000000) ^
|
||||
(Te4[(t1 >> 16) & 0xff] & 0x00ff0000) ^
|
||||
(Te4[(t2 >> 8) & 0xff] & 0x0000ff00) ^
|
||||
(Te4[(t3 ) & 0xff] & 0x000000ff) ^
|
||||
(Te2[(t0 >> 24) ] & 0xff000000) ^
|
||||
(Te3[(t1 >> 16) & 0xff] & 0x00ff0000) ^
|
||||
(Te0[(t2 >> 8) & 0xff] & 0x0000ff00) ^
|
||||
(Te1[(t3 ) & 0xff] & 0x000000ff) ^
|
||||
rk[0];
|
||||
PUTU32(out , s0);
|
||||
s1 =
|
||||
(Te4[(t1 >> 24) ] & 0xff000000) ^
|
||||
(Te4[(t2 >> 16) & 0xff] & 0x00ff0000) ^
|
||||
(Te4[(t3 >> 8) & 0xff] & 0x0000ff00) ^
|
||||
(Te4[(t0 ) & 0xff] & 0x000000ff) ^
|
||||
(Te2[(t1 >> 24) ] & 0xff000000) ^
|
||||
(Te3[(t2 >> 16) & 0xff] & 0x00ff0000) ^
|
||||
(Te0[(t3 >> 8) & 0xff] & 0x0000ff00) ^
|
||||
(Te1[(t0 ) & 0xff] & 0x000000ff) ^
|
||||
rk[1];
|
||||
PUTU32(out + 4, s1);
|
||||
s2 =
|
||||
(Te4[(t2 >> 24) ] & 0xff000000) ^
|
||||
(Te4[(t3 >> 16) & 0xff] & 0x00ff0000) ^
|
||||
(Te4[(t0 >> 8) & 0xff] & 0x0000ff00) ^
|
||||
(Te4[(t1 ) & 0xff] & 0x000000ff) ^
|
||||
(Te2[(t2 >> 24) ] & 0xff000000) ^
|
||||
(Te3[(t3 >> 16) & 0xff] & 0x00ff0000) ^
|
||||
(Te0[(t0 >> 8) & 0xff] & 0x0000ff00) ^
|
||||
(Te1[(t1 ) & 0xff] & 0x000000ff) ^
|
||||
rk[2];
|
||||
PUTU32(out + 8, s2);
|
||||
s3 =
|
||||
(Te4[(t3 >> 24) ] & 0xff000000) ^
|
||||
(Te4[(t0 >> 16) & 0xff] & 0x00ff0000) ^
|
||||
(Te4[(t1 >> 8) & 0xff] & 0x0000ff00) ^
|
||||
(Te4[(t2 ) & 0xff] & 0x000000ff) ^
|
||||
(Te2[(t3 >> 24) ] & 0xff000000) ^
|
||||
(Te3[(t0 >> 16) & 0xff] & 0x00ff0000) ^
|
||||
(Te0[(t1 >> 8) & 0xff] & 0x0000ff00) ^
|
||||
(Te1[(t2 ) & 0xff] & 0x000000ff) ^
|
||||
rk[3];
|
||||
PUTU32(out + 12, s3);
|
||||
}
|
||||
@@ -1229,31 +1129,31 @@ void AES_decrypt(const unsigned char *in, unsigned char *out,
|
||||
* map cipher state to byte array block:
|
||||
*/
|
||||
s0 =
|
||||
(Td4[(t0 >> 24) ] & 0xff000000) ^
|
||||
(Td4[(t3 >> 16) & 0xff] & 0x00ff0000) ^
|
||||
(Td4[(t2 >> 8) & 0xff] & 0x0000ff00) ^
|
||||
(Td4[(t1 ) & 0xff] & 0x000000ff) ^
|
||||
(Td4[(t0 >> 24) ] << 24) ^
|
||||
(Td4[(t3 >> 16) & 0xff] << 16) ^
|
||||
(Td4[(t2 >> 8) & 0xff] << 8) ^
|
||||
(Td4[(t1 ) & 0xff]) ^
|
||||
rk[0];
|
||||
PUTU32(out , s0);
|
||||
s1 =
|
||||
(Td4[(t1 >> 24) ] & 0xff000000) ^
|
||||
(Td4[(t0 >> 16) & 0xff] & 0x00ff0000) ^
|
||||
(Td4[(t3 >> 8) & 0xff] & 0x0000ff00) ^
|
||||
(Td4[(t2 ) & 0xff] & 0x000000ff) ^
|
||||
(Td4[(t1 >> 24) ] << 24) ^
|
||||
(Td4[(t0 >> 16) & 0xff] << 16) ^
|
||||
(Td4[(t3 >> 8) & 0xff] << 8) ^
|
||||
(Td4[(t2 ) & 0xff]) ^
|
||||
rk[1];
|
||||
PUTU32(out + 4, s1);
|
||||
s2 =
|
||||
(Td4[(t2 >> 24) ] & 0xff000000) ^
|
||||
(Td4[(t1 >> 16) & 0xff] & 0x00ff0000) ^
|
||||
(Td4[(t0 >> 8) & 0xff] & 0x0000ff00) ^
|
||||
(Td4[(t3 ) & 0xff] & 0x000000ff) ^
|
||||
(Td4[(t2 >> 24) ] << 24) ^
|
||||
(Td4[(t1 >> 16) & 0xff] << 16) ^
|
||||
(Td4[(t0 >> 8) & 0xff] << 8) ^
|
||||
(Td4[(t3 ) & 0xff]) ^
|
||||
rk[2];
|
||||
PUTU32(out + 8, s2);
|
||||
s3 =
|
||||
(Td4[(t3 >> 24) ] & 0xff000000) ^
|
||||
(Td4[(t2 >> 16) & 0xff] & 0x00ff0000) ^
|
||||
(Td4[(t1 >> 8) & 0xff] & 0x0000ff00) ^
|
||||
(Td4[(t0 ) & 0xff] & 0x000000ff) ^
|
||||
(Td4[(t3 >> 24) ] << 24) ^
|
||||
(Td4[(t2 >> 16) & 0xff] << 16) ^
|
||||
(Td4[(t1 >> 8) & 0xff] << 8) ^
|
||||
(Td4[(t0 ) & 0xff]) ^
|
||||
rk[3];
|
||||
PUTU32(out + 12, s3);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# SSLeay/crypto/asn1/Makefile
|
||||
# OpenSSL/crypto/asn1/Makefile
|
||||
#
|
||||
|
||||
DIR= asn1
|
||||
|
||||
@@ -662,7 +662,11 @@ static int asn1_d2i_ex_primitive(ASN1_VALUE **pval, unsigned char **in, long inl
|
||||
* internally irrespective of the type. So instead just check
|
||||
* for UNIVERSAL class and ignore the tag.
|
||||
*/
|
||||
if(!asn1_collect(&buf, &p, plen, inf, -1, V_ASN1_UNIVERSAL)) goto err;
|
||||
if(!asn1_collect(&buf, &p, plen, inf, -1, V_ASN1_UNIVERSAL))
|
||||
{
|
||||
free_cont = 1;
|
||||
goto err;
|
||||
}
|
||||
len = buf.length;
|
||||
/* Append a final null to string */
|
||||
if(!BUF_MEM_grow_clean(&buf, len + 1)) {
|
||||
@@ -903,7 +907,7 @@ static int asn1_collect(BUF_MEM *buf, unsigned char **in, long len, char inf, in
|
||||
return 0;
|
||||
#endif
|
||||
} else {
|
||||
if(!collect_data(buf, &p, plen)) return 0;
|
||||
if(plen && !collect_data(buf, &p, plen)) return 0;
|
||||
}
|
||||
len -= p - q;
|
||||
}
|
||||
|
||||
@@ -445,9 +445,12 @@ int asn1_ex_i2c(ASN1_VALUE **pval, unsigned char *cout, int *putype, const ASN1_
|
||||
case V_ASN1_BOOLEAN:
|
||||
tbool = (ASN1_BOOLEAN *)pval;
|
||||
if(*tbool == -1) return -1;
|
||||
/* Default handling if value == size field then omit */
|
||||
if(*tbool && (it->size > 0)) return -1;
|
||||
if(!*tbool && !it->size) return -1;
|
||||
if (it->utype != V_ASN1_ANY)
|
||||
{
|
||||
/* Default handling if value == size field then omit */
|
||||
if(*tbool && (it->size > 0)) return -1;
|
||||
if(!*tbool && !it->size) return -1;
|
||||
}
|
||||
c = (unsigned char)*tbool;
|
||||
cont = &c;
|
||||
len = 1;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# SSLeay/crypto/blowfish/Makefile
|
||||
# OpenSSL/crypto/blowfish/Makefile
|
||||
#
|
||||
|
||||
DIR= bf
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# SSLeay/crypto/bio/Makefile
|
||||
# OpenSSL/crypto/bio/Makefile
|
||||
#
|
||||
|
||||
DIR= bio
|
||||
|
||||
@@ -469,7 +469,7 @@ static long conn_ctrl(BIO *b, int cmd, long num, void *ptr)
|
||||
break;
|
||||
case BIO_C_DO_STATE_MACHINE:
|
||||
/* use this one to start the connection */
|
||||
if (!(data->state != BIO_CONN_S_OK))
|
||||
if (data->state != BIO_CONN_S_OK)
|
||||
ret=(long)conn_state(b,data);
|
||||
else
|
||||
ret=1;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# SSLeay/crypto/bn/Makefile
|
||||
# OpenSSL/crypto/bn/Makefile
|
||||
#
|
||||
|
||||
DIR= bn
|
||||
@@ -329,3 +329,5 @@ bn_word.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
|
||||
bn_word.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
|
||||
bn_word.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
|
||||
bn_word.o: ../cryptlib.h bn_lcl.h bn_word.c
|
||||
bn_x931p.o: ../../include/openssl/bn.h ../../include/openssl/e_os2.h
|
||||
bn_x931p.o: ../../include/openssl/opensslconf.h bn_x931p.c
|
||||
|
||||
@@ -162,10 +162,14 @@
|
||||
* BN_ULONG w;
|
||||
*/
|
||||
bn_mul_add_words:
|
||||
sra %o2,%g0,%o2 ! signx %o2
|
||||
brgz,a %o2,.L_bn_mul_add_words_proceed
|
||||
lduw [%o1],%g2
|
||||
retl
|
||||
clr %o0
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
|
||||
.L_bn_mul_add_words_proceed:
|
||||
srl %o3,%g0,%o3 ! clruw %o3
|
||||
@@ -260,10 +264,14 @@ bn_mul_add_words:
|
||||
* BN_ULONG w;
|
||||
*/
|
||||
bn_mul_words:
|
||||
sra %o2,%g0,%o2 ! signx %o2
|
||||
brgz,a %o2,.L_bn_mul_words_proceeed
|
||||
lduw [%o1],%g2
|
||||
retl
|
||||
clr %o0
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
|
||||
.L_bn_mul_words_proceeed:
|
||||
srl %o3,%g0,%o3 ! clruw %o3
|
||||
@@ -344,10 +352,14 @@ bn_mul_words:
|
||||
* int n;
|
||||
*/
|
||||
bn_sqr_words:
|
||||
sra %o2,%g0,%o2 ! signx %o2
|
||||
brgz,a %o2,.L_bn_sqr_words_proceeed
|
||||
lduw [%o1],%g2
|
||||
retl
|
||||
clr %o0
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
|
||||
.L_bn_sqr_words_proceeed:
|
||||
andcc %o2,-4,%g0
|
||||
@@ -445,6 +457,7 @@ bn_div_words:
|
||||
* int n;
|
||||
*/
|
||||
bn_add_words:
|
||||
sra %o3,%g0,%o3 ! signx %o3
|
||||
brgz,a %o3,.L_bn_add_words_proceed
|
||||
lduw [%o1],%o4
|
||||
retl
|
||||
@@ -454,7 +467,6 @@ bn_add_words:
|
||||
andcc %o3,-4,%g0
|
||||
bz,pn %icc,.L_bn_add_words_tail
|
||||
addcc %g0,0,%g0 ! clear carry flag
|
||||
nop
|
||||
|
||||
.L_bn_add_words_loop: ! wow! 32 aligned!
|
||||
dec 4,%o3
|
||||
@@ -523,6 +535,7 @@ bn_add_words:
|
||||
* int n;
|
||||
*/
|
||||
bn_sub_words:
|
||||
sra %o3,%g0,%o3 ! signx %o3
|
||||
brgz,a %o3,.L_bn_sub_words_proceed
|
||||
lduw [%o1],%o4
|
||||
retl
|
||||
@@ -532,7 +545,6 @@ bn_sub_words:
|
||||
andcc %o3,-4,%g0
|
||||
bz,pn %icc,.L_bn_sub_words_tail
|
||||
addcc %g0,0,%g0 ! clear carry flag
|
||||
nop
|
||||
|
||||
.L_bn_sub_words_loop: ! wow! 32 aligned!
|
||||
dec 4,%o3
|
||||
|
||||
@@ -55,6 +55,59 @@
|
||||
* 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).
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* Details about Montgomery multiplication algorithms can be found at
|
||||
@@ -350,20 +403,32 @@ BN_MONT_CTX *BN_MONT_CTX_copy(BN_MONT_CTX *to, BN_MONT_CTX *from)
|
||||
BN_MONT_CTX *BN_MONT_CTX_set_locked(BN_MONT_CTX **pmont, int lock,
|
||||
const BIGNUM *mod, BN_CTX *ctx)
|
||||
{
|
||||
if (*pmont)
|
||||
return *pmont;
|
||||
CRYPTO_w_lock(lock);
|
||||
int got_write_lock = 0;
|
||||
BN_MONT_CTX *ret;
|
||||
|
||||
CRYPTO_r_lock(lock);
|
||||
if (!*pmont)
|
||||
{
|
||||
*pmont = BN_MONT_CTX_new();
|
||||
if (*pmont && !BN_MONT_CTX_set(*pmont, mod, ctx))
|
||||
CRYPTO_r_unlock(lock);
|
||||
CRYPTO_w_lock(lock);
|
||||
got_write_lock = 1;
|
||||
|
||||
if (!*pmont)
|
||||
{
|
||||
BN_MONT_CTX_free(*pmont);
|
||||
*pmont = NULL;
|
||||
ret = BN_MONT_CTX_new();
|
||||
if (ret && !BN_MONT_CTX_set(ret, mod, ctx))
|
||||
BN_MONT_CTX_free(ret);
|
||||
else
|
||||
*pmont = ret;
|
||||
}
|
||||
}
|
||||
CRYPTO_w_unlock(lock);
|
||||
return *pmont;
|
||||
}
|
||||
|
||||
ret = *pmont;
|
||||
|
||||
if (got_write_lock)
|
||||
CRYPTO_w_unlock(lock);
|
||||
else
|
||||
CRYPTO_r_unlock(lock);
|
||||
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# SSLeay/crypto/buffer/Makefile
|
||||
# OpenSSL/crypto/buffer/Makefile
|
||||
#
|
||||
|
||||
DIR= buffer
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# SSLeay/crypto/cast/Makefile
|
||||
# OpenSSL/crypto/cast/Makefile
|
||||
#
|
||||
|
||||
DIR= cast
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# SSLeay/crypto/comp/Makefile
|
||||
# OpenSSL/crypto/comp/Makefile
|
||||
#
|
||||
|
||||
DIR= comp
|
||||
|
||||
@@ -51,32 +51,17 @@ static COMP_METHOD zlib_method={
|
||||
*/
|
||||
#if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_WIN32)
|
||||
# include <windows.h>
|
||||
|
||||
# define Z_CALLCONV _stdcall
|
||||
# ifndef ZLIB_SHARED
|
||||
# define ZLIB_SHARED
|
||||
# endif
|
||||
#else
|
||||
# define Z_CALLCONV
|
||||
#endif /* !(OPENSSL_SYS_WINDOWS || OPENSSL_SYS_WIN32) */
|
||||
|
||||
#ifdef ZLIB_SHARED
|
||||
#include <openssl/dso.h>
|
||||
|
||||
/* Prototypes for built in stubs */
|
||||
static int stub_compress(Bytef *dest,uLongf *destLen,
|
||||
const Bytef *source, uLong sourceLen);
|
||||
static int stub_inflateEnd(z_streamp strm);
|
||||
static int stub_inflate(z_streamp strm, int flush);
|
||||
static int stub_inflateInit_(z_streamp strm, const char * version,
|
||||
int stream_size);
|
||||
|
||||
/* Function pointers */
|
||||
typedef int (Z_CALLCONV *compress_ft)(Bytef *dest,uLongf *destLen,
|
||||
typedef int (*compress_ft)(Bytef *dest,uLongf *destLen,
|
||||
const Bytef *source, uLong sourceLen);
|
||||
typedef int (Z_CALLCONV *inflateEnd_ft)(z_streamp strm);
|
||||
typedef int (Z_CALLCONV *inflate_ft)(z_streamp strm, int flush);
|
||||
typedef int (Z_CALLCONV *inflateInit__ft)(z_streamp strm,
|
||||
typedef int (*inflateEnd_ft)(z_streamp strm);
|
||||
typedef int (*inflate_ft)(z_streamp strm, int flush);
|
||||
typedef int (*inflateInit__ft)(z_streamp strm,
|
||||
const char * version, int stream_size);
|
||||
static compress_ft p_compress=NULL;
|
||||
static inflateEnd_ft p_inflateEnd=NULL;
|
||||
@@ -86,10 +71,10 @@ static inflateInit__ft p_inflateInit_=NULL;
|
||||
static int zlib_loaded = 0; /* only attempt to init func pts once */
|
||||
static DSO *zlib_dso = NULL;
|
||||
|
||||
#define compress stub_compress
|
||||
#define inflateEnd stub_inflateEnd
|
||||
#define inflate stub_inflate
|
||||
#define inflateInit_ stub_inflateInit_
|
||||
#define compress p_compress
|
||||
#define inflateEnd p_inflateEnd
|
||||
#define inflate p_inflate
|
||||
#define inflateInit_ p_inflateInit_
|
||||
#endif /* ZLIB_SHARED */
|
||||
|
||||
static int zlib_compress_block(COMP_CTX *ctx, unsigned char *out,
|
||||
@@ -193,16 +178,6 @@ COMP_METHOD *COMP_zlib(void)
|
||||
{
|
||||
#if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_WIN32)
|
||||
zlib_dso = DSO_load(NULL, "ZLIB1", NULL, 0);
|
||||
if (!zlib_dso)
|
||||
{
|
||||
zlib_dso = DSO_load(NULL, "ZLIB", NULL, 0);
|
||||
if (zlib_dso)
|
||||
{
|
||||
/* Clear the errors from the first failed
|
||||
DSO_load() */
|
||||
ERR_clear_error();
|
||||
}
|
||||
}
|
||||
#else
|
||||
zlib_dso = DSO_load(NULL, "z", NULL, 0);
|
||||
#endif
|
||||
@@ -220,54 +195,21 @@ COMP_METHOD *COMP_zlib(void)
|
||||
p_inflateInit_
|
||||
= (inflateInit__ft) DSO_bind_func(zlib_dso,
|
||||
"inflateInit_");
|
||||
zlib_loaded++;
|
||||
|
||||
if (p_compress && p_inflateEnd && p_inflate
|
||||
&& p_inflateInit_)
|
||||
zlib_loaded++;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
#ifdef ZLIB_SHARED
|
||||
if (zlib_loaded)
|
||||
#endif
|
||||
#if defined(ZLIB) || defined(ZLIB_SHARED)
|
||||
meth = &zlib_method;
|
||||
meth = &zlib_method;
|
||||
#endif
|
||||
|
||||
return(meth);
|
||||
}
|
||||
|
||||
#ifdef ZLIB_SHARED
|
||||
/* Stubs for each function to be dynamicly loaded */
|
||||
static int
|
||||
stub_compress(Bytef *dest,uLongf *destLen,const Bytef *source, uLong sourceLen)
|
||||
{
|
||||
if (p_compress)
|
||||
return(p_compress(dest,destLen,source,sourceLen));
|
||||
else
|
||||
return(Z_MEM_ERROR);
|
||||
}
|
||||
|
||||
static int
|
||||
stub_inflateEnd(z_streamp strm)
|
||||
{
|
||||
if ( p_inflateEnd )
|
||||
return(p_inflateEnd(strm));
|
||||
else
|
||||
return(Z_MEM_ERROR);
|
||||
}
|
||||
|
||||
static int
|
||||
stub_inflate(z_streamp strm, int flush)
|
||||
{
|
||||
if ( p_inflate )
|
||||
return(p_inflate(strm,flush));
|
||||
else
|
||||
return(Z_MEM_ERROR);
|
||||
}
|
||||
|
||||
static int
|
||||
stub_inflateInit_(z_streamp strm, const char * version, int stream_size)
|
||||
{
|
||||
if ( p_inflateInit_ )
|
||||
return(p_inflateInit_(strm,version,stream_size));
|
||||
else
|
||||
return(Z_MEM_ERROR);
|
||||
}
|
||||
|
||||
#endif /* ZLIB_SHARED */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# SSLeay/crypto/conf/Makefile
|
||||
# OpenSSL/crypto/conf/Makefile
|
||||
#
|
||||
|
||||
DIR= conf
|
||||
|
||||
@@ -734,5 +734,11 @@ int fips_clear_owning_thread(void)
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
unsigned char *fips_signature_witness(void)
|
||||
{
|
||||
extern unsigned char FIPS_signature[];
|
||||
return FIPS_signature;
|
||||
}
|
||||
#endif /* OPENSSL_FIPS */
|
||||
|
||||
|
||||
@@ -247,7 +247,7 @@ $ LIB_X509 = "x509_def,x509_d2,x509_r2x,x509_cmp,"+ -
|
||||
$ LIB_X509V3 = "v3_bcons,v3_bitst,v3_conf,v3_extku,v3_ia5,v3_lib,"+ -
|
||||
"v3_prn,v3_utl,v3err,v3_genn,v3_alt,v3_skey,v3_akey,v3_pku,"+ -
|
||||
"v3_int,v3_enum,v3_sxnet,v3_cpols,v3_crld,v3_purp,v3_info,"+ -
|
||||
"v3_ocsp,v3_akeya,v3_pcia,v3_pci"
|
||||
"v3_ocsp,v3_akeya,v3_pcia,v3_pci,v3_hex"
|
||||
$ LIB_CONF = "conf_err,conf_lib,conf_api,conf_def,conf_mod,conf_mall,conf_sap"
|
||||
$ LIB_TXT_DB = "txt_db"
|
||||
$ LIB_PKCS7 = "pk7_asn1,pk7_lib,pkcs7err,pk7_doit,pk7_smime,pk7_attr,"+ -
|
||||
@@ -265,10 +265,15 @@ $ LIB_KRB5 = "krb5_asn"
|
||||
$!
|
||||
$! Setup exceptional compilations
|
||||
$!
|
||||
$ ! Add definitions for no threads on OpenVMS 7.1 and higher
|
||||
$ COMPILEWITH_CC3 = ",bss_rtcp,"
|
||||
$ ! Disable the DOLLARID warning
|
||||
$ COMPILEWITH_CC4 = ",a_utctm,bss_log,o_time,"
|
||||
$ ! Disable disjoint optimization
|
||||
$ COMPILEWITH_CC5 = ",md2_dgst,md4_dgst,md5_dgst,mdc2dgst," + -
|
||||
"sha_dgst,sha1dgst,rmd_dgst,bf_enc,"
|
||||
$ ! Disable the MIXLINKAGE warning
|
||||
$ COMPILEWITH_CC6 = ",enc_read,set_key,"
|
||||
$!
|
||||
$! Figure Out What Other Modules We Are To Build.
|
||||
$!
|
||||
@@ -497,7 +502,12 @@ $ IF COMPILEWITH_CC5 - FILE_NAME0 .NES. COMPILEWITH_CC5
|
||||
$ THEN
|
||||
$ CC5/OBJECT='OBJECT_FILE' 'SOURCE_FILE'
|
||||
$ ELSE
|
||||
$ CC/OBJECT='OBJECT_FILE' 'SOURCE_FILE'
|
||||
$ IF COMPILEWITH_CC6 - FILE_NAME0 .NES. COMPILEWITH_CC6
|
||||
$ THEN
|
||||
$ CC6/OBJECT='OBJECT_FILE' 'SOURCE_FILE'
|
||||
$ ELSE
|
||||
$ CC/OBJECT='OBJECT_FILE' 'SOURCE_FILE'
|
||||
$ ENDIF
|
||||
$ ENDIF
|
||||
$ ENDIF
|
||||
$ ENDIF
|
||||
@@ -1077,14 +1087,18 @@ $ THEN
|
||||
$ IF CCDISABLEWARNINGS .EQS. ""
|
||||
$ THEN
|
||||
$ CC4DISABLEWARNINGS = "DOLLARID"
|
||||
$ CC6DISABLEWARNINGS = "MIXLINKAGE"
|
||||
$ ELSE
|
||||
$ CC4DISABLEWARNINGS = CCDISABLEWARNINGS + ",DOLLARID"
|
||||
$ CC6DISABLEWARNINGS = CCDISABLEWARNINGS + ",MIXLINKAGE"
|
||||
$ CCDISABLEWARNINGS = "/WARNING=(DISABLE=(" + CCDISABLEWARNINGS + "))"
|
||||
$ ENDIF
|
||||
$ CC4DISABLEWARNINGS = "/WARNING=(DISABLE=(" + CC4DISABLEWARNINGS + "))"
|
||||
$ CC6DISABLEWARNINGS = "/WARNING=(DISABLE=(" + CC6DISABLEWARNINGS + "))"
|
||||
$ ELSE
|
||||
$ CCDISABLEWARNINGS = ""
|
||||
$ CC4DISABLEWARNINGS = ""
|
||||
$ CC6DISABLEWARNINGS = ""
|
||||
$ ENDIF
|
||||
$ CC3 = CC + "/DEFINE=(" + CCDEFS + ISSEVEN + ")" + CCDISABLEWARNINGS
|
||||
$ CC = CC + "/DEFINE=(" + CCDEFS + ")" + CCDISABLEWARNINGS
|
||||
@@ -1095,6 +1109,7 @@ $ ELSE
|
||||
$ CC5 = CC + "/NOOPTIMIZE"
|
||||
$ ENDIF
|
||||
$ CC4 = CC - CCDISABLEWARNINGS + CC4DISABLEWARNINGS
|
||||
$ CC6 = CC - CCDISABLEWARNINGS + CC6DISABLEWARNINGS
|
||||
$!
|
||||
$! Show user the result
|
||||
$!
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# SSLeay/crypto/des/Makefile
|
||||
# OpenSSL/crypto/des/Makefile
|
||||
#
|
||||
|
||||
DIR= des
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# SSLeay/crypto/dh/Makefile
|
||||
# OpenSSL/crypto/dh/Makefile
|
||||
#
|
||||
|
||||
DIR= dh
|
||||
|
||||
@@ -213,8 +213,11 @@ static int compute_key(unsigned char *key, const BIGNUM *pub_key, DH *dh)
|
||||
|
||||
ret=BN_bn2bin(tmp,key);
|
||||
err:
|
||||
BN_CTX_end(ctx);
|
||||
BN_CTX_free(ctx);
|
||||
if (ctx != NULL)
|
||||
{
|
||||
BN_CTX_end(ctx);
|
||||
BN_CTX_free(ctx);
|
||||
}
|
||||
return(ret);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# SSLeay/crypto/dsa/Makefile
|
||||
# OpenSSL/crypto/dsa/Makefile
|
||||
#
|
||||
|
||||
DIR= dsa
|
||||
|
||||
@@ -88,6 +88,13 @@
|
||||
* be used for all exponents.
|
||||
*/
|
||||
|
||||
/* If this flag is set external DSA_METHOD callbacks are allowed in FIPS mode
|
||||
* it is then the applications responsibility to ensure the external method
|
||||
* is compliant.
|
||||
*/
|
||||
|
||||
#define DSA_FLAG_FIPS_EXTERNAL_METHOD_ALLOW 0x04
|
||||
|
||||
#if defined(OPENSSL_FIPS)
|
||||
#define FIPS_DSA_SIZE_T int
|
||||
#endif
|
||||
|
||||
@@ -72,7 +72,8 @@
|
||||
DSA_SIG * DSA_do_sign(const unsigned char *dgst, int dlen, DSA *dsa)
|
||||
{
|
||||
#ifdef OPENSSL_FIPS
|
||||
if(FIPS_mode() && !FIPS_dsa_check(dsa))
|
||||
if(FIPS_mode() && !(dsa->flags & DSA_FLAG_FIPS_EXTERNAL_METHOD_ALLOW)
|
||||
&& !FIPS_dsa_check(dsa))
|
||||
return NULL;
|
||||
#endif
|
||||
return dsa->meth->dsa_do_sign(dgst, dlen, dsa);
|
||||
@@ -96,7 +97,8 @@ int DSA_sign(int type, const unsigned char *dgst, int dlen, unsigned char *sig,
|
||||
int DSA_sign_setup(DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp, BIGNUM **rp)
|
||||
{
|
||||
#ifdef OPENSSL_FIPS
|
||||
if(FIPS_mode() && !FIPS_dsa_check(dsa))
|
||||
if(FIPS_mode() && !(dsa->flags & DSA_FLAG_FIPS_EXTERNAL_METHOD_ALLOW)
|
||||
&& !FIPS_dsa_check(dsa))
|
||||
return 0;
|
||||
#endif
|
||||
return dsa->meth->dsa_sign_setup(dsa, ctx_in, kinvp, rp);
|
||||
|
||||
@@ -74,7 +74,8 @@ int DSA_do_verify(const unsigned char *dgst, int dgst_len, DSA_SIG *sig,
|
||||
DSA *dsa)
|
||||
{
|
||||
#ifdef OPENSSL_FIPS
|
||||
if(FIPS_mode() && !FIPS_dsa_check(dsa))
|
||||
if(FIPS_mode() && !(dsa->flags & DSA_FLAG_FIPS_EXTERNAL_METHOD_ALLOW)
|
||||
&& !FIPS_dsa_check(dsa))
|
||||
return -1;
|
||||
#endif
|
||||
return dsa->meth->dsa_do_verify(dgst, dgst_len, sig, dsa);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# SSLeay/crypto/dso/Makefile
|
||||
# OpenSSL/crypto/dso/Makefile
|
||||
#
|
||||
|
||||
DIR= dso
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# SSLeay/crypto/err/Makefile
|
||||
# OpenSSL/crypto/err/Makefile
|
||||
#
|
||||
|
||||
DIR= err
|
||||
|
||||
@@ -549,9 +549,20 @@ static void build_SYS_str_reasons()
|
||||
int i;
|
||||
static int init = 1;
|
||||
|
||||
if (!init) return;
|
||||
|
||||
CRYPTO_r_lock(CRYPTO_LOCK_ERR);
|
||||
if (!init)
|
||||
{
|
||||
CRYPTO_r_unlock(CRYPTO_LOCK_ERR);
|
||||
return;
|
||||
}
|
||||
|
||||
CRYPTO_r_unlock(CRYPTO_LOCK_ERR);
|
||||
CRYPTO_w_lock(CRYPTO_LOCK_ERR);
|
||||
if (!init)
|
||||
{
|
||||
CRYPTO_w_unlock(CRYPTO_LOCK_ERR);
|
||||
return;
|
||||
}
|
||||
|
||||
for (i = 1; i <= NUM_SYS_STR_REASONS; i++)
|
||||
{
|
||||
|
||||
@@ -27,7 +27,7 @@ L DSO crypto/dso/dso.h crypto/dso/dso_err.c
|
||||
L ENGINE crypto/engine/engine.h crypto/engine/eng_err.c
|
||||
L OCSP crypto/ocsp/ocsp.h crypto/ocsp/ocsp_err.c
|
||||
L UI crypto/ui/ui.h crypto/ui/ui_err.c
|
||||
L FIPS fips/fips.h fips/fips_err.h
|
||||
L FIPS fips-1.0/fips.h fips-1.0/fips_err.h
|
||||
|
||||
# additional header files to be scanned for function names
|
||||
L NONE crypto/x509/x509_vfy.h NONE
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# SSLeay/crypto/evp/Makefile
|
||||
# OpenSSL/crypto/evp/Makefile
|
||||
#
|
||||
|
||||
DIR= evp
|
||||
|
||||
@@ -132,7 +132,11 @@
|
||||
#define EVP_CAST5_KEY_SIZE 16
|
||||
#define EVP_RC5_32_12_16_KEY_SIZE 16
|
||||
*/
|
||||
#ifdef OPENSSL_FIPS
|
||||
#define EVP_MAX_MD_SIZE 64 /* longest known SHA512 */
|
||||
#else
|
||||
#define EVP_MAX_MD_SIZE (16+20) /* The SSLv3 md5+sha1 type */
|
||||
#endif
|
||||
#define EVP_MAX_KEY_LENGTH 32
|
||||
#define EVP_MAX_IV_LENGTH 16
|
||||
#define EVP_MAX_BLOCK_LENGTH 32
|
||||
|
||||
@@ -126,7 +126,8 @@ int EVP_BytesToKey(const EVP_CIPHER *type, const EVP_MD *md,
|
||||
EVP_MD_CTX_init(&c);
|
||||
for (;;)
|
||||
{
|
||||
EVP_DigestInit_ex(&c,md, NULL);
|
||||
if (!EVP_DigestInit_ex(&c,md, NULL))
|
||||
return 0;
|
||||
if (addmd++)
|
||||
EVP_DigestUpdate(&c,&(md_buf[0]),mds);
|
||||
EVP_DigestUpdate(&c,data,datal);
|
||||
|
||||
@@ -194,11 +194,16 @@ int PKCS5_v2_PBE_keyivgen(EVP_CIPHER_CTX *ctx, const char *pass, int passlen,
|
||||
|
||||
/* Now decode key derivation function */
|
||||
|
||||
if(!pbe2->keyfunc->parameter ||
|
||||
(pbe2->keyfunc->parameter->type != V_ASN1_SEQUENCE))
|
||||
{
|
||||
EVPerr(EVP_F_PKCS5_V2_PBE_KEYIVGEN,EVP_R_DECODE_ERROR);
|
||||
goto err;
|
||||
}
|
||||
|
||||
pbuf = pbe2->keyfunc->parameter->value.sequence->data;
|
||||
plen = pbe2->keyfunc->parameter->value.sequence->length;
|
||||
if(!pbe2->keyfunc->parameter ||
|
||||
(pbe2->keyfunc->parameter->type != V_ASN1_SEQUENCE) ||
|
||||
!(kdf = d2i_PBKDF2PARAM(NULL, &pbuf, plen)) ) {
|
||||
if(!(kdf = d2i_PBKDF2PARAM(NULL, &pbuf, plen)) ) {
|
||||
EVPerr(EVP_F_PKCS5_V2_PBE_KEYIVGEN,EVP_R_DECODE_ERROR);
|
||||
goto err;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# SSLeay/crypto/md/Makefile
|
||||
# OpenSSL/crypto/md/Makefile
|
||||
#
|
||||
|
||||
DIR= hmac
|
||||
|
||||
@@ -64,7 +64,11 @@
|
||||
|
||||
#include <openssl/evp.h>
|
||||
|
||||
#ifdef OPENSSL_FIPS
|
||||
#define HMAC_MAX_MD_CBLOCK 128
|
||||
#else
|
||||
#define HMAC_MAX_MD_CBLOCK 64
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# SSLeay/crypto/idea/Makefile
|
||||
# OpenSSL/crypto/idea/Makefile
|
||||
#
|
||||
|
||||
DIR= idea
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# SSLeay/crypto/lhash/Makefile
|
||||
# OpenSSL/crypto/lhash/Makefile
|
||||
#
|
||||
|
||||
DIR= lhash
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# SSLeay/crypto/md/Makefile
|
||||
# OpenSSL/crypto/md/Makefile
|
||||
#
|
||||
|
||||
DIR= md2
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# SSLeay/crypto/md4/Makefile
|
||||
# OpenSSL/crypto/md4/Makefile
|
||||
#
|
||||
|
||||
DIR= md4
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# SSLeay/crypto/md5/Makefile
|
||||
# OpenSSL/crypto/md5/Makefile
|
||||
#
|
||||
|
||||
DIR= md5
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# SSLeay/crypto/mdc2/Makefile
|
||||
# OpenSSL/crypto/mdc2/Makefile
|
||||
#
|
||||
|
||||
DIR= mdc2
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# SSLeay/crypto/objects/Makefile
|
||||
# OpenSSL/crypto/objects/Makefile
|
||||
#
|
||||
|
||||
DIR= objects
|
||||
|
||||
@@ -25,11 +25,11 @@
|
||||
* (Prior to 0.9.5a beta1, a different scheme was used: MMNNFFRBB for
|
||||
* major minor fix final patch/beta)
|
||||
*/
|
||||
#define OPENSSL_VERSION_NUMBER 0x0090708fL
|
||||
#define OPENSSL_VERSION_NUMBER 0x009070bfL
|
||||
#ifdef OPENSSL_FIPS
|
||||
#define OPENSSL_VERSION_TEXT "OpenSSL 0.9.7h-fips 11 Oct 2005"
|
||||
#define OPENSSL_VERSION_TEXT "OpenSSL 0.9.7k-fips 05 Sep 2006"
|
||||
#else
|
||||
#define OPENSSL_VERSION_TEXT "OpenSSL 0.9.7h 11 Oct 2005"
|
||||
#define OPENSSL_VERSION_TEXT "OpenSSL 0.9.7k 05 Sep 2006"
|
||||
#endif
|
||||
#define OPENSSL_VERSION_PTEXT " part of " OPENSSL_VERSION_TEXT
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# SSLeay/crypto/pem/Makefile
|
||||
# OpenSSL/crypto/pem/Makefile
|
||||
#
|
||||
|
||||
DIR= pem
|
||||
|
||||
@@ -90,7 +90,7 @@ $tmp
|
||||
#ifdef OUT
|
||||
#define OK 1
|
||||
#define ALIGN 4
|
||||
#if defined(__CYGWIN__) || defined(__DJGPP__)
|
||||
#if defined(__CYGWIN__) || defined(__DJGPP__) || defined(__MINGW32__)
|
||||
#undef SIZE
|
||||
#undef TYPE
|
||||
#define SIZE(a,b)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# SSLeay/crypto/pkcs12/Makefile
|
||||
# OpenSSL/crypto/pkcs12/Makefile
|
||||
#
|
||||
|
||||
DIR= pkcs12
|
||||
|
||||
@@ -76,7 +76,15 @@ PKCS12 *PKCS12_create(char *pass, char *name, EVP_PKEY *pkey, X509 *cert,
|
||||
unsigned int keyidlen;
|
||||
|
||||
/* Set defaults */
|
||||
if(!nid_cert) nid_cert = NID_pbe_WithSHA1And40BitRC2_CBC;
|
||||
if(!nid_cert)
|
||||
{
|
||||
#ifdef OPENSSL_FIPS
|
||||
if (FIPS_mode())
|
||||
nid_cert = NID_pbe_WithSHA1And3_Key_TripleDES_CBC;
|
||||
else
|
||||
#endif
|
||||
nid_cert = NID_pbe_WithSHA1And40BitRC2_CBC;
|
||||
}
|
||||
if(!nid_key) nid_key = NID_pbe_WithSHA1And3_Key_TripleDES_CBC;
|
||||
if(!iter) iter = PKCS12_DEFAULT_ITER;
|
||||
if(!mac_iter) mac_iter = 1;
|
||||
|
||||
@@ -69,7 +69,7 @@ int PKCS12_gen_mac (PKCS12 *p12, const char *pass, int passlen,
|
||||
{
|
||||
const EVP_MD *md_type;
|
||||
HMAC_CTX hmac;
|
||||
unsigned char key[PKCS12_MAC_KEY_LENGTH], *salt;
|
||||
unsigned char key[EVP_MAX_MD_SIZE], *salt;
|
||||
int saltlen, iter;
|
||||
|
||||
if (!PKCS7_type_is_data(p12->authsafes))
|
||||
@@ -88,12 +88,12 @@ int PKCS12_gen_mac (PKCS12 *p12, const char *pass, int passlen,
|
||||
return 0;
|
||||
}
|
||||
if(!PKCS12_key_gen (pass, passlen, salt, saltlen, PKCS12_MAC_ID, iter,
|
||||
PKCS12_MAC_KEY_LENGTH, key, md_type)) {
|
||||
EVP_MD_size(md_type), key, md_type)) {
|
||||
PKCS12err(PKCS12_F_PKCS12_GEN_MAC,PKCS12_R_KEY_GEN_ERROR);
|
||||
return 0;
|
||||
}
|
||||
HMAC_CTX_init(&hmac);
|
||||
HMAC_Init_ex(&hmac, key, PKCS12_MAC_KEY_LENGTH, md_type, NULL);
|
||||
HMAC_Init_ex(&hmac, key, EVP_MD_size(md_type), md_type, NULL);
|
||||
HMAC_Update(&hmac, p12->authsafes->d.data->data,
|
||||
p12->authsafes->d.data->length);
|
||||
HMAC_Final(&hmac, mac, maclen);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# SSLeay/crypto/pkcs7/Makefile
|
||||
# OpenSSL/crypto/pkcs7/Makefile
|
||||
#
|
||||
|
||||
DIR= pkcs7
|
||||
|
||||
@@ -97,6 +97,8 @@ PKCS7 *PKCS7_sign(X509 *signcert, EVP_PKEY *pkey, STACK_OF(X509) *certs,
|
||||
PKCS7_add_certificate(p7, sk_X509_value(certs, i));
|
||||
}
|
||||
|
||||
if(flags & PKCS7_DETACHED)PKCS7_set_detached(p7, 1);
|
||||
|
||||
if(!(p7bio = PKCS7_dataInit(p7, NULL))) {
|
||||
PKCS7err(PKCS7_F_PKCS7_SIGN,ERR_R_MALLOC_FAILURE);
|
||||
return NULL;
|
||||
@@ -133,7 +135,6 @@ PKCS7 *PKCS7_sign(X509 *signcert, EVP_PKEY *pkey, STACK_OF(X509) *certs,
|
||||
}
|
||||
}
|
||||
|
||||
if(flags & PKCS7_DETACHED)PKCS7_set_detached(p7, 1);
|
||||
|
||||
if (!PKCS7_dataFinal(p7,p7bio)) {
|
||||
PKCS7err(PKCS7_F_PKCS7_SIGN,PKCS7_R_PKCS7_DATASIGN);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# SSLeay/crypto/rand/Makefile
|
||||
# OpenSSL/crypto/rand/Makefile
|
||||
#
|
||||
|
||||
DIR= rand
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
* [including the GNU Public Licence.]
|
||||
*/
|
||||
/* ====================================================================
|
||||
* Copyright (c) 1998-2000 The OpenSSL Project. All rights reserved.
|
||||
* 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
|
||||
@@ -124,6 +124,13 @@
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
#include <time.h>
|
||||
#if defined(OPENSSL_SYS_LINUX) /* should actually be available virtually everywhere */
|
||||
# include <poll.h>
|
||||
#endif
|
||||
#include <limits.h>
|
||||
#ifndef FD_SETSIZE
|
||||
# define FD_SETSIZE (8*sizeof(fd_set))
|
||||
#endif
|
||||
|
||||
#ifdef __OpenBSD__
|
||||
int RAND_poll(void)
|
||||
@@ -142,7 +149,7 @@ int RAND_poll(void)
|
||||
|
||||
return 1;
|
||||
}
|
||||
#else
|
||||
#else /* !defined(__OpenBSD__) */
|
||||
int RAND_poll(void)
|
||||
{
|
||||
unsigned long l;
|
||||
@@ -182,10 +189,8 @@ int RAND_poll(void)
|
||||
#endif
|
||||
)) >= 0)
|
||||
{
|
||||
struct timeval t = { 0, 10*1000 }; /* Spend 10ms on
|
||||
each file. */
|
||||
int usec = 10*1000; /* spend 10ms on each file */
|
||||
int r,j;
|
||||
fd_set fset;
|
||||
struct stat *st=&randomstats[i];
|
||||
|
||||
/* Avoid using same input... Used to be O_NOFOLLOW
|
||||
@@ -201,35 +206,75 @@ int RAND_poll(void)
|
||||
|
||||
do
|
||||
{
|
||||
FD_ZERO(&fset);
|
||||
FD_SET(fd, &fset);
|
||||
r = -1;
|
||||
int try_read = 0;
|
||||
|
||||
if (select(fd+1,&fset,NULL,NULL,&t) < 0)
|
||||
t.tv_usec=0;
|
||||
else if (FD_ISSET(fd, &fset))
|
||||
#if defined(OPENSSL_SYS_LINUX)
|
||||
/* use poll() */
|
||||
struct pollfd pset;
|
||||
|
||||
pset.fd = fd;
|
||||
pset.events = POLLIN;
|
||||
pset.revents = 0;
|
||||
|
||||
if (poll(&pset, 1, usec / 1000) < 0)
|
||||
usec = 0;
|
||||
else
|
||||
try_read = (pset.revents & POLLIN) != 0;
|
||||
|
||||
#else
|
||||
/* use select() */
|
||||
fd_set fset;
|
||||
struct timeval t;
|
||||
|
||||
t.tv_sec = 0;
|
||||
t.tv_usec = usec;
|
||||
|
||||
if (FD_SETSIZE > 0 && fd >= FD_SETSIZE)
|
||||
{
|
||||
r=read(fd,(unsigned char *)tmpbuf+n,
|
||||
ENTROPY_NEEDED-n);
|
||||
/* can't use select, so just try to read once anyway */
|
||||
try_read = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
FD_ZERO(&fset);
|
||||
FD_SET(fd, &fset);
|
||||
|
||||
if (select(fd+1,&fset,NULL,NULL,&t) >= 0)
|
||||
{
|
||||
usec = t.tv_usec;
|
||||
if (FD_ISSET(fd, &fset))
|
||||
try_read = 1;
|
||||
}
|
||||
else
|
||||
usec = 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (try_read)
|
||||
{
|
||||
r = read(fd,(unsigned char *)tmpbuf+n, ENTROPY_NEEDED-n);
|
||||
if (r > 0)
|
||||
n += r;
|
||||
}
|
||||
|
||||
/* Some Unixen will update t, some
|
||||
won't. For those who won't, give
|
||||
up here, otherwise, we will do
|
||||
else
|
||||
r = -1;
|
||||
|
||||
/* Some Unixen will update t in select(), some
|
||||
won't. For those who won't, or if we
|
||||
didn't use select() in the first place,
|
||||
give up here, otherwise, we will do
|
||||
this once again for the remaining
|
||||
time. */
|
||||
if (t.tv_usec == 10*1000)
|
||||
t.tv_usec=0;
|
||||
if (usec == 10*1000)
|
||||
usec = 0;
|
||||
}
|
||||
while ((r > 0 || (errno == EINTR || errno == EAGAIN))
|
||||
&& t.tv_usec != 0 && n < ENTROPY_NEEDED);
|
||||
while ((r > 0 ||
|
||||
(errno == EINTR || errno == EAGAIN)) && usec != 0 && n < ENTROPY_NEEDED);
|
||||
|
||||
close(fd);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif /* defined(DEVRANDOM) */
|
||||
|
||||
#ifdef DEVRANDOM_EGD
|
||||
/* Use an EGD socket to read entropy from an EGD or PRNGD entropy
|
||||
@@ -244,7 +289,7 @@ int RAND_poll(void)
|
||||
if (r > 0)
|
||||
n += r;
|
||||
}
|
||||
#endif
|
||||
#endif /* defined(DEVRANDOM_EGD) */
|
||||
|
||||
#if defined(DEVRANDOM) || defined(DEVRANDOM_EGD)
|
||||
if (n > 0)
|
||||
@@ -270,12 +315,13 @@ int RAND_poll(void)
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif
|
||||
#endif /* defined(__OpenBSD__) */
|
||||
#endif /* !(defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_VMS) || defined(OPENSSL_SYS_OS2) || defined(OPENSSL_SYS_VXWORKS) */
|
||||
|
||||
|
||||
#if defined(OPENSSL_SYS_VXWORKS)
|
||||
int RAND_poll(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# SSLeay/crypto/rc2/Makefile
|
||||
# OpenSSL/crypto/rc2/Makefile
|
||||
#
|
||||
|
||||
DIR= rc2
|
||||
|
||||
@@ -102,10 +102,10 @@ OPENSSL_DECLARE_EXIT
|
||||
#ifndef HZ
|
||||
#ifndef CLK_TCK
|
||||
#define HZ 100.0
|
||||
#endif
|
||||
#else /* CLK_TCK */
|
||||
#else /* CLK_TCK */
|
||||
#define HZ ((double)CLK_TCK)
|
||||
#endif
|
||||
#endif /* CLK_TCK */
|
||||
#endif /* HZ */
|
||||
|
||||
#define BUFSIZE ((long)1024)
|
||||
long run=0;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# SSLeay/crypto/rc4/Makefile
|
||||
# OpenSSL/crypto/rc4/Makefile
|
||||
#
|
||||
|
||||
DIR= rc4
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# SSLeay/crypto/rc5/Makefile
|
||||
# OpenSSL/crypto/rc5/Makefile
|
||||
#
|
||||
|
||||
DIR= rc5
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# SSLeay/crypto/ripemd/Makefile
|
||||
# OpenSSL/crypto/ripemd/Makefile
|
||||
#
|
||||
|
||||
DIR= ripemd
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# SSLeay/crypto/rsa/Makefile
|
||||
# OpenSSL/crypto/rsa/Makefile
|
||||
#
|
||||
|
||||
DIR= rsa
|
||||
|
||||
@@ -389,17 +389,18 @@ void ERR_load_RSA_strings(void);
|
||||
#define RSA_R_NULL_BEFORE_BLOCK_MISSING 113
|
||||
#define RSA_R_N_DOES_NOT_EQUAL_P_Q 127
|
||||
#define RSA_R_OAEP_DECODING_ERROR 121
|
||||
#define RSA_R_SLEN_RECOVERY_FAILED 135
|
||||
#define RSA_R_PADDING_CHECK_FAILED 114
|
||||
#define RSA_R_PKCS1_PADDING_TOO_SHORT 105
|
||||
#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_PADDING_TYPE 118
|
||||
#define RSA_R_WRONG_SIGNATURE_LENGTH 119
|
||||
#define RSA_R_SLEN_CHECK_FAILED 136
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
* [including the GNU Public Licence.]
|
||||
*/
|
||||
/* ====================================================================
|
||||
* Copyright (c) 1998-2005 The OpenSSL Project. All rights reserved.
|
||||
* 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
|
||||
@@ -228,25 +228,40 @@ err:
|
||||
return(r);
|
||||
}
|
||||
|
||||
static int rsa_eay_blinding(RSA *rsa, BN_CTX *ctx)
|
||||
static int blinding_helper(RSA *rsa, BN_CTX *ctx)
|
||||
{
|
||||
int ret = 1;
|
||||
CRYPTO_w_lock(CRYPTO_LOCK_RSA);
|
||||
/* Check again inside the lock - the macro's check is racey */
|
||||
if(rsa->blinding == NULL)
|
||||
ret = RSA_blinding_on(rsa, ctx);
|
||||
CRYPTO_w_unlock(CRYPTO_LOCK_RSA);
|
||||
int ret = 0;
|
||||
int got_write_lock = 0;
|
||||
|
||||
CRYPTO_r_lock(CRYPTO_LOCK_RSA);
|
||||
|
||||
if (rsa->flags & RSA_FLAG_NO_BLINDING)
|
||||
ret = 1;
|
||||
else
|
||||
{
|
||||
if (rsa->blinding != NULL)
|
||||
ret = 1;
|
||||
else
|
||||
{
|
||||
CRYPTO_r_unlock(CRYPTO_LOCK_RSA);
|
||||
CRYPTO_w_lock(CRYPTO_LOCK_RSA);
|
||||
got_write_lock = 1;
|
||||
|
||||
if(rsa->blinding != NULL)
|
||||
ret = 1;
|
||||
else
|
||||
ret = RSA_blinding_on(rsa, ctx);
|
||||
}
|
||||
}
|
||||
|
||||
if (got_write_lock)
|
||||
CRYPTO_w_unlock(CRYPTO_LOCK_RSA);
|
||||
else
|
||||
CRYPTO_r_unlock(CRYPTO_LOCK_RSA);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
#define BLINDING_HELPER(rsa, ctx, err_instr) \
|
||||
do { \
|
||||
if((!((rsa)->flags & RSA_FLAG_NO_BLINDING)) && \
|
||||
((rsa)->blinding == NULL) && \
|
||||
!rsa_eay_blinding(rsa, ctx)) \
|
||||
err_instr \
|
||||
} while(0)
|
||||
|
||||
static BN_BLINDING *setup_blinding(RSA *rsa, BN_CTX *ctx)
|
||||
{
|
||||
BIGNUM *A, *Ai;
|
||||
@@ -272,6 +287,13 @@ static BN_BLINDING *setup_blinding(RSA *rsa, BN_CTX *ctx)
|
||||
}
|
||||
if ((Ai=BN_mod_inverse(NULL,A,rsa->n,ctx)) == NULL) goto err;
|
||||
|
||||
if (rsa->flags & RSA_FLAG_CACHE_PUBLIC)
|
||||
{
|
||||
if (!BN_MONT_CTX_set_locked(&rsa->_method_mod_n,
|
||||
CRYPTO_LOCK_RSA, rsa->n, ctx))
|
||||
goto err;
|
||||
}
|
||||
|
||||
if (!rsa->meth->bn_mod_exp(A,A,rsa->e,rsa->n,ctx,rsa->_method_mod_n))
|
||||
goto err;
|
||||
ret = BN_BLINDING_new(A,Ai,rsa->n);
|
||||
@@ -327,7 +349,8 @@ static int RSA_eay_private_encrypt(int flen, const unsigned char *from,
|
||||
goto err;
|
||||
}
|
||||
|
||||
BLINDING_HELPER(rsa, ctx, goto err;);
|
||||
if (!blinding_helper(rsa, ctx))
|
||||
goto err;
|
||||
blinding = rsa->blinding;
|
||||
|
||||
/* Now unless blinding is disabled, 'blinding' is non-NULL.
|
||||
@@ -463,7 +486,8 @@ static int RSA_eay_private_decrypt(int flen, const unsigned char *from,
|
||||
goto err;
|
||||
}
|
||||
|
||||
BLINDING_HELPER(rsa, ctx, goto err;);
|
||||
if (!blinding_helper(rsa, ctx))
|
||||
goto err;
|
||||
blinding = rsa->blinding;
|
||||
|
||||
/* Now unless blinding is disabled, 'blinding' is non-NULL.
|
||||
@@ -627,6 +651,15 @@ static int RSA_eay_public_decrypt(int flen, const unsigned char *from,
|
||||
{
|
||||
case RSA_PKCS1_PADDING:
|
||||
r=RSA_padding_check_PKCS1_type_1(to,num,buf,i,num);
|
||||
/* Generally signatures should be at least 2/3 padding, though
|
||||
this isn't possible for really short keys and some standard
|
||||
signature schemes, so don't check if the unpadded data is
|
||||
small. */
|
||||
if(r > 42 && 3*8*r >= BN_num_bits(rsa->n))
|
||||
{
|
||||
RSAerr(RSA_F_RSA_EAY_PUBLIC_DECRYPT, RSA_R_PKCS1_PADDING_TOO_SHORT);
|
||||
goto err;
|
||||
}
|
||||
break;
|
||||
case RSA_NO_PADDING:
|
||||
r=RSA_padding_check_none(to,num,buf,i,num);
|
||||
|
||||
@@ -134,6 +134,7 @@ static ERR_STRING_DATA RSA_str_reasons[]=
|
||||
{ERR_REASON(RSA_R_OAEP_DECODING_ERROR) ,"oaep decoding error"},
|
||||
{ERR_REASON(RSA_R_SLEN_RECOVERY_FAILED) ,"salt length recovery failed"},
|
||||
{ERR_REASON(RSA_R_PADDING_CHECK_FAILED) ,"padding check failed"},
|
||||
{ERR_REASON(RSA_R_PKCS1_PADDING_TOO_SHORT),"pkcs1 padding too short"},
|
||||
{ERR_REASON(RSA_R_P_NOT_PRIME) ,"p not prime"},
|
||||
{ERR_REASON(RSA_R_Q_NOT_PRIME) ,"q not prime"},
|
||||
{ERR_REASON(RSA_R_RSA_OPERATIONS_NOT_SUPPORTED),"rsa operations not supported"},
|
||||
|
||||
@@ -184,7 +184,8 @@ err:
|
||||
RSAerr(RSA_F_RSA_GENERATE_KEY,ERR_LIB_BN);
|
||||
ok=0;
|
||||
}
|
||||
BN_CTX_end(ctx);
|
||||
if (ctx != NULL)
|
||||
BN_CTX_end(ctx);
|
||||
BN_CTX_free(ctx);
|
||||
BN_CTX_free(ctx2);
|
||||
|
||||
|
||||
@@ -185,6 +185,23 @@ int RSA_verify(int dtype, const unsigned char *m, unsigned int m_len,
|
||||
sig=d2i_X509_SIG(NULL,&p,(long)i);
|
||||
|
||||
if (sig == NULL) goto err;
|
||||
|
||||
/* Excess data can be used to create forgeries */
|
||||
if(p != s+i)
|
||||
{
|
||||
RSAerr(RSA_F_RSA_VERIFY,RSA_R_BAD_SIGNATURE);
|
||||
goto err;
|
||||
}
|
||||
|
||||
/* Parameters to the signature algorithm can also be used to
|
||||
create forgeries */
|
||||
if(sig->algor->parameter
|
||||
&& ASN1_TYPE_get(sig->algor->parameter) != V_ASN1_NULL)
|
||||
{
|
||||
RSAerr(RSA_F_RSA_VERIFY,RSA_R_BAD_SIGNATURE);
|
||||
goto err;
|
||||
}
|
||||
|
||||
sigtype=OBJ_obj2nid(sig->algor->algorithm);
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# SSLeay/crypto/sha/Makefile
|
||||
# OpenSSL/crypto/sha/Makefile
|
||||
#
|
||||
|
||||
DIR= sha
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# SSLeay/crypto/stack/Makefile
|
||||
# OpenSSL/crypto/stack/Makefile
|
||||
#
|
||||
|
||||
DIR= stack
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# SSLeay/crypto/txt_db/Makefile
|
||||
# OpenSSL/crypto/txt_db/Makefile
|
||||
#
|
||||
|
||||
DIR= txt_db
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# SSLeay/crypto/x509/Makefile
|
||||
# OpenSSL/crypto/x509/Makefile
|
||||
#
|
||||
|
||||
DIR= x509
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# SSLeay/crypto/x509v3/Makefile
|
||||
# OpenSSL/crypto/x509v3/Makefile
|
||||
#
|
||||
|
||||
DIR= x509v3
|
||||
@@ -25,11 +25,11 @@ LIB=$(TOP)/libcrypto.a
|
||||
LIBSRC= v3_bcons.c v3_bitst.c v3_conf.c v3_extku.c v3_ia5.c v3_lib.c \
|
||||
v3_prn.c v3_utl.c v3err.c v3_genn.c v3_alt.c v3_skey.c v3_akey.c v3_pku.c \
|
||||
v3_int.c v3_enum.c v3_sxnet.c v3_cpols.c v3_crld.c v3_purp.c v3_info.c \
|
||||
v3_ocsp.c v3_akeya.c v3_pcia.c v3_pci.c
|
||||
v3_ocsp.c v3_akeya.c v3_pcia.c v3_pci.c v3_hex.c
|
||||
LIBOBJ= v3_bcons.o v3_bitst.o v3_conf.o v3_extku.o v3_ia5.o v3_lib.o \
|
||||
v3_prn.o v3_utl.o v3err.o v3_genn.o v3_alt.o v3_skey.o v3_akey.o v3_pku.o \
|
||||
v3_int.o v3_enum.o v3_sxnet.o v3_cpols.o v3_crld.o v3_purp.o v3_info.o \
|
||||
v3_ocsp.o v3_akeya.o v3_pcia.o v3_pci.o
|
||||
v3_ocsp.o v3_akeya.o v3_pcia.o v3_pci.o v3_hex.o
|
||||
|
||||
SRC= $(LIBSRC)
|
||||
|
||||
|
||||
153
crypto/x509v3/v3_hex.c
Normal file
153
crypto/x509v3/v3_hex.c
Normal file
@@ -0,0 +1,153 @@
|
||||
/* v3_utl.c */
|
||||
/* Written by Dr Stephen N Henson (shenson@bigfoot.com) for the OpenSSL
|
||||
* project 1999.
|
||||
*/
|
||||
/* ====================================================================
|
||||
* Copyright (c) 1999 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).
|
||||
*
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
#include "cryptlib.h"
|
||||
#include <openssl/conf.h>
|
||||
#include <openssl/x509v3.h>
|
||||
|
||||
/* hex string utilities */
|
||||
|
||||
/* Given a buffer of length 'len' return a OPENSSL_malloc'ed string with its
|
||||
* hex representation
|
||||
* @@@ (Contents of buffer are always kept in ASCII, also on EBCDIC machines)
|
||||
*/
|
||||
|
||||
char *hex_to_string(unsigned char *buffer, long len)
|
||||
{
|
||||
char *tmp, *q;
|
||||
unsigned char *p;
|
||||
int i;
|
||||
static char hexdig[] = "0123456789ABCDEF";
|
||||
if(!buffer || !len) return NULL;
|
||||
if(!(tmp = OPENSSL_malloc(len * 3 + 1))) {
|
||||
X509V3err(X509V3_F_HEX_TO_STRING,ERR_R_MALLOC_FAILURE);
|
||||
return NULL;
|
||||
}
|
||||
q = tmp;
|
||||
for(i = 0, p = buffer; i < len; i++,p++) {
|
||||
*q++ = hexdig[(*p >> 4) & 0xf];
|
||||
*q++ = hexdig[*p & 0xf];
|
||||
*q++ = ':';
|
||||
}
|
||||
q[-1] = 0;
|
||||
#ifdef CHARSET_EBCDIC
|
||||
ebcdic2ascii(tmp, tmp, q - tmp - 1);
|
||||
#endif
|
||||
|
||||
return tmp;
|
||||
}
|
||||
|
||||
/* Give a string of hex digits convert to
|
||||
* a buffer
|
||||
*/
|
||||
|
||||
unsigned char *string_to_hex(char *str, long *len)
|
||||
{
|
||||
unsigned char *hexbuf, *q;
|
||||
unsigned char ch, cl, *p;
|
||||
if(!str) {
|
||||
X509V3err(X509V3_F_STRING_TO_HEX,X509V3_R_INVALID_NULL_ARGUMENT);
|
||||
return NULL;
|
||||
}
|
||||
if(!(hexbuf = OPENSSL_malloc(strlen(str) >> 1))) goto err;
|
||||
for(p = (unsigned char *)str, q = hexbuf; *p;) {
|
||||
ch = *p++;
|
||||
#ifdef CHARSET_EBCDIC
|
||||
ch = os_toebcdic[ch];
|
||||
#endif
|
||||
if(ch == ':') continue;
|
||||
cl = *p++;
|
||||
#ifdef CHARSET_EBCDIC
|
||||
cl = os_toebcdic[cl];
|
||||
#endif
|
||||
if(!cl) {
|
||||
X509V3err(X509V3_F_STRING_TO_HEX,X509V3_R_ODD_NUMBER_OF_DIGITS);
|
||||
OPENSSL_free(hexbuf);
|
||||
return NULL;
|
||||
}
|
||||
if(isupper(ch)) ch = tolower(ch);
|
||||
if(isupper(cl)) cl = tolower(cl);
|
||||
|
||||
if((ch >= '0') && (ch <= '9')) ch -= '0';
|
||||
else if ((ch >= 'a') && (ch <= 'f')) ch -= 'a' - 10;
|
||||
else goto badhex;
|
||||
|
||||
if((cl >= '0') && (cl <= '9')) cl -= '0';
|
||||
else if ((cl >= 'a') && (cl <= 'f')) cl -= 'a' - 10;
|
||||
else goto badhex;
|
||||
|
||||
*q++ = (ch << 4) | cl;
|
||||
}
|
||||
|
||||
if(len) *len = q - hexbuf;
|
||||
|
||||
return hexbuf;
|
||||
|
||||
err:
|
||||
if(hexbuf) OPENSSL_free(hexbuf);
|
||||
X509V3err(X509V3_F_STRING_TO_HEX,ERR_R_MALLOC_FAILURE);
|
||||
return NULL;
|
||||
|
||||
badhex:
|
||||
OPENSSL_free(hexbuf);
|
||||
X509V3err(X509V3_F_STRING_TO_HEX,X509V3_R_ILLEGAL_HEX_DIGIT);
|
||||
return NULL;
|
||||
|
||||
}
|
||||
@@ -346,96 +346,6 @@ static char *strip_spaces(char *name)
|
||||
return p;
|
||||
}
|
||||
|
||||
/* hex string utilities */
|
||||
|
||||
/* Given a buffer of length 'len' return a OPENSSL_malloc'ed string with its
|
||||
* hex representation
|
||||
* @@@ (Contents of buffer are always kept in ASCII, also on EBCDIC machines)
|
||||
*/
|
||||
|
||||
char *hex_to_string(unsigned char *buffer, long len)
|
||||
{
|
||||
char *tmp, *q;
|
||||
unsigned char *p;
|
||||
int i;
|
||||
static char hexdig[] = "0123456789ABCDEF";
|
||||
if(!buffer || !len) return NULL;
|
||||
if(!(tmp = OPENSSL_malloc(len * 3 + 1))) {
|
||||
X509V3err(X509V3_F_HEX_TO_STRING,ERR_R_MALLOC_FAILURE);
|
||||
return NULL;
|
||||
}
|
||||
q = tmp;
|
||||
for(i = 0, p = buffer; i < len; i++,p++) {
|
||||
*q++ = hexdig[(*p >> 4) & 0xf];
|
||||
*q++ = hexdig[*p & 0xf];
|
||||
*q++ = ':';
|
||||
}
|
||||
q[-1] = 0;
|
||||
#ifdef CHARSET_EBCDIC
|
||||
ebcdic2ascii(tmp, tmp, q - tmp - 1);
|
||||
#endif
|
||||
|
||||
return tmp;
|
||||
}
|
||||
|
||||
/* Give a string of hex digits convert to
|
||||
* a buffer
|
||||
*/
|
||||
|
||||
unsigned char *string_to_hex(char *str, long *len)
|
||||
{
|
||||
unsigned char *hexbuf, *q;
|
||||
unsigned char ch, cl, *p;
|
||||
if(!str) {
|
||||
X509V3err(X509V3_F_STRING_TO_HEX,X509V3_R_INVALID_NULL_ARGUMENT);
|
||||
return NULL;
|
||||
}
|
||||
if(!(hexbuf = OPENSSL_malloc(strlen(str) >> 1))) goto err;
|
||||
for(p = (unsigned char *)str, q = hexbuf; *p;) {
|
||||
ch = *p++;
|
||||
#ifdef CHARSET_EBCDIC
|
||||
ch = os_toebcdic[ch];
|
||||
#endif
|
||||
if(ch == ':') continue;
|
||||
cl = *p++;
|
||||
#ifdef CHARSET_EBCDIC
|
||||
cl = os_toebcdic[cl];
|
||||
#endif
|
||||
if(!cl) {
|
||||
X509V3err(X509V3_F_STRING_TO_HEX,X509V3_R_ODD_NUMBER_OF_DIGITS);
|
||||
OPENSSL_free(hexbuf);
|
||||
return NULL;
|
||||
}
|
||||
if(isupper(ch)) ch = tolower(ch);
|
||||
if(isupper(cl)) cl = tolower(cl);
|
||||
|
||||
if((ch >= '0') && (ch <= '9')) ch -= '0';
|
||||
else if ((ch >= 'a') && (ch <= 'f')) ch -= 'a' - 10;
|
||||
else goto badhex;
|
||||
|
||||
if((cl >= '0') && (cl <= '9')) cl -= '0';
|
||||
else if ((cl >= 'a') && (cl <= 'f')) cl -= 'a' - 10;
|
||||
else goto badhex;
|
||||
|
||||
*q++ = (ch << 4) | cl;
|
||||
}
|
||||
|
||||
if(len) *len = q - hexbuf;
|
||||
|
||||
return hexbuf;
|
||||
|
||||
err:
|
||||
if(hexbuf) OPENSSL_free(hexbuf);
|
||||
X509V3err(X509V3_F_STRING_TO_HEX,ERR_R_MALLOC_FAILURE);
|
||||
return NULL;
|
||||
|
||||
badhex:
|
||||
OPENSSL_free(hexbuf);
|
||||
X509V3err(X509V3_F_STRING_TO_HEX,X509V3_R_ILLEGAL_HEX_DIGIT);
|
||||
return NULL;
|
||||
|
||||
}
|
||||
|
||||
/* V2I name comparison function: returns zero if 'name' matches
|
||||
* cmp or cmp.*
|
||||
*/
|
||||
|
||||
@@ -125,11 +125,11 @@ the cipher suites not enabled by B<ALL>, currently being B<eNULL>.
|
||||
=item B<HIGH>
|
||||
|
||||
"high" encryption cipher suites. This currently means those with key lengths larger
|
||||
than 128 bits.
|
||||
than 128 bits, and some cipher suites with 128-bit keys.
|
||||
|
||||
=item B<MEDIUM>
|
||||
|
||||
"medium" encryption cipher suites, currently those using 128 bit encryption.
|
||||
"medium" encryption cipher suites, currently some of those using 128 bit encryption.
|
||||
|
||||
=item B<LOW>
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ PKCS7_verify - verify a PKCS#7 signedData structure
|
||||
|
||||
int PKCS7_verify(PKCS7 *p7, STACK_OF(X509) *certs, X509_STORE *store, BIO *indata, BIO *out, int flags);
|
||||
|
||||
int PKCS7_get0_signers(PKCS7 *p7, STACK_OF(X509) *certs, int flags);
|
||||
STACK_OF(X509) *PKCS7_get0_signers(PKCS7 *p7, STACK_OF(X509) *certs, int flags);
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ authentication code
|
||||
void HMAC_Init(HMAC_CTX *ctx, const void *key, int key_len,
|
||||
const EVP_MD *md);
|
||||
void HMAC_Init_ex(HMAC_CTX *ctx, const void *key, int key_len,
|
||||
const EVP_MD *md);
|
||||
const EVP_MD *md, ENGINE *impl);
|
||||
void HMAC_Update(HMAC_CTX *ctx, const unsigned char *data, int len);
|
||||
void HMAC_Final(HMAC_CTX *ctx, unsigned char *md, unsigned int *len);
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#
|
||||
# SSLeay/fips/Makefile
|
||||
# OpenSSL/fips-1.0/Makefile
|
||||
#
|
||||
|
||||
DIR= fips
|
||||
DIR= fips-1.0
|
||||
TOP= ..
|
||||
CC= cc
|
||||
INCLUDE= -I. -I$(TOP) -I../include
|
||||
@@ -32,15 +32,17 @@ GENERAL=Makefile README fips-lib.com install.com
|
||||
|
||||
LIB= $(TOP)/libcrypto.a
|
||||
SHARED_LIB= libcrypto$(SHLIB_EXT)
|
||||
LIBSRC=fips.c fips_err_wrapper.c
|
||||
LIBOBJ=fips.o fips_err_wrapper.o
|
||||
LIBSRC=fips.c fips_err_wrapper.c fipshashes.c
|
||||
LIBOBJ=fips.o fips_err_wrapper.o fipshashes.o
|
||||
|
||||
FIPS_OBJ_LISTS=sha/lib hmac/lib rand/lib des/lib aes/lib dsa/lib rsa/lib dh/lib
|
||||
|
||||
SRC= $(LIBSRC)
|
||||
|
||||
EXHEADER=fips.h
|
||||
HEADER=$(EXHEADER) fips_err.h
|
||||
EXE=openssl_fips_fingerprint
|
||||
TEST= fips_test_suite.c
|
||||
EXE=fipsld
|
||||
TEST=fips_test_suite.c
|
||||
|
||||
ALL= $(GENERAL) $(SRC) $(HEADER)
|
||||
|
||||
@@ -53,7 +55,51 @@ all:
|
||||
fi
|
||||
|
||||
check:
|
||||
$(PERL) ../util/checkhash.pl
|
||||
# $(PERL) ../util/checkhash.pl || (rm fipscanister.o* 2>/dev/null; exit 1)
|
||||
echo FIPS module not built: no check done
|
||||
|
||||
# Idea behind fipscanister.o is to "seize" the sequestered code between
|
||||
# known symbols for fingerprinting purposes, which would be commonly
|
||||
# done with ld -r start.o ... end.o. The latter however presents a minor
|
||||
# challenge on multi-ABI platforms. As just implied, we'd rather use ld,
|
||||
# but the trouble is that we don't generally know how ABI-selection
|
||||
# compiler flag is translated to corresponding linker flag. All compiler
|
||||
# drivers seem to recognize -r flag and pass it down to linker, but some
|
||||
# of them, including gcc, erroneously add -lc, as well as run-time
|
||||
# components, such as crt1.o and alike. Fortunately among those vendor
|
||||
# compilers which were observed to misinterpret -r flag multi-ABI ones
|
||||
# are equipped with smart linkers, which don't require any ABI-selection
|
||||
# flag and simply assume that all objects are of the same type as first
|
||||
# one in command line. So the idea is to identify gcc and deficient
|
||||
# vendor compiler drivers...
|
||||
|
||||
fipscanister.o: fips_start.o $(LIBOBJ) $(FIPS_OBJ_LISTS) fips_end.o
|
||||
@objs="fips_start.o $(LIBOBJ)"; \
|
||||
for i in $(FIPS_OBJ_LISTS); do \
|
||||
dir=`dirname $$i`; script="s|^|$$dir/|;s| | $$dir/|g"; \
|
||||
objs="$$objs `sed "$$script" $$i`"; \
|
||||
done; \
|
||||
objs="$$objs fips_end.o" ; \
|
||||
if [ -n "${FIPS_SITE_LD}" ]; then \
|
||||
set -x; ${FIPS_SITE_LD} -r -o $@ $$objs; \
|
||||
elif $(CC) -dumpversion >/dev/null 2>&1; then \
|
||||
set -x; $(CC) $(CFLAGS) -r -nostdlib -o $@ $$objs ; \
|
||||
else case "`(uname -s) 2>/dev/null`" in \
|
||||
HP-UX|OSF1|SunOS) set -x; /usr/ccs/bin/ld -r -o $@ $$objs ;; \
|
||||
*) set -x; $(CC) $(CFLAGS) -r -o $@ $$objs ;; \
|
||||
esac fi
|
||||
sha/fips_standalone_sha1 fipscanister.o > fipscanister.o.sha1
|
||||
|
||||
# If another exception is immediately required, assign approprite
|
||||
# site-specific ld command to FIPS_SITE_LD environment variable.
|
||||
|
||||
fips_start.o: fips_canister.c
|
||||
$(CC) $(CFLAGS) -DFIPS_START -c -o $@ fips_canister.c
|
||||
fips_end.o: fips_canister.c
|
||||
$(CC) $(CFLAGS) -DFIPS_END -c -o $@ fips_canister.c
|
||||
fips_premain_dso$(EXE_EXT): fips_premain.c
|
||||
$(CC) $(CFLAGS) -DFINGERPRINT_PREMAIN_DSO_LOAD -o $@ fips_premain.c \
|
||||
../libcrypto.a $(EX_LIBS)
|
||||
|
||||
subdirs:
|
||||
@for i in $(FDIRS) ;\
|
||||
@@ -85,14 +131,14 @@ links:
|
||||
$(MAKE) CC='$(CC)' INCLUDES='${INCLUDES}' CFLAG='${CFLAG}' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' BN_ASM='${BN_ASM}' DES_ENC='${DES_ENC}' FIPS_DES_ENC='${FIPS_DES_ENC}' SHA1_ASM_OBJ='${SHA1_ASM_OBJ}' FIPS_SHA1_ASM_OBJ='${FIPS_SHA1_ASM_OBJ}' MD5_ASM_OBJ='${MD5_ASM_OBJ}' RMD160_ASM_OBJ='${RMD160_ASM_OBJ}' BF_ENC='${BF_ENC}' CAST_ENC='${CAST_ENC}' RC4_ENC='${RC4_ENC}' RC5_ENC='${RC5_ENC}' AR='${AR}' PERL='${PERL}' links ); \
|
||||
done;
|
||||
|
||||
lib: $(LIBOBJ)
|
||||
$(AR) $(LIB) $(LIBOBJ)
|
||||
lib: $(FIPSLIBDIR)/fipscanister.o
|
||||
$(AR) $(LIB) $(FIPSLIBDIR)/fipscanister.o
|
||||
$(RANLIB) $(LIB) || echo Never mind.
|
||||
@touch lib
|
||||
|
||||
shared:
|
||||
shared: fips_premain_dso$(EXE_EXT)
|
||||
if [ -n "$(SHARED_LIBS)" ]; then \
|
||||
(cd ..; $(MAKE) $(SHARED_LIB)); \
|
||||
(cd ..; $(MAKE) FIPSLD_CC=$(CC) FIPSLD=fips-1.0/fipsld $(SHARED_LIB)); \
|
||||
fi
|
||||
|
||||
libs:
|
||||
@@ -130,6 +176,11 @@ install:
|
||||
chmod 755 $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i.new; \
|
||||
mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i; \
|
||||
done
|
||||
@cp -p -f fipscanister.o fipscanister.o.sha1 fips_premain.c \
|
||||
$(INSTALL_PREFIX)$(INSTALLTOP)/lib/; \
|
||||
strings fipscanister.o | grep "HMAC-SHA1(fips_premain\\.c)" > \
|
||||
$(INSTALL_PREFIX)$(INSTALLTOP)/lib/fips_premain.c.sha1; \
|
||||
chmod 0444 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/fips*
|
||||
|
||||
lint:
|
||||
@for i in $(FDIRS) ;\
|
||||
@@ -149,7 +200,7 @@ depend:
|
||||
done;
|
||||
|
||||
clean:
|
||||
rm -f buildinf.h *.o */*.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
|
||||
rm -f buildinf.h *.o *.obj fips_premain_dso$(EXE_EXT) lib tags core .pure .nfs* *.old *.bak fluff
|
||||
@for i in $(FDIRS) ;\
|
||||
do \
|
||||
(cd $$i && echo "making clean in fips/$$i..." && \
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# SSLeay/fips/aes/Makefile
|
||||
# OpenSSL/fips-1.0/aes/Makefile
|
||||
#
|
||||
|
||||
DIR= aes
|
||||
@@ -41,9 +41,7 @@ top:
|
||||
all: lib
|
||||
|
||||
lib: $(LIBOBJ)
|
||||
$(AR) $(LIB) $(LIBOBJ)
|
||||
$(RANLIB) $(LIB) || echo Never mind.
|
||||
@sleep 2; touch lib
|
||||
@echo $(LIBOBJ) > lib
|
||||
|
||||
files:
|
||||
$(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO
|
||||
@@ -939,7 +939,7 @@ int main(int argc, char **argv)
|
||||
int f_opt = 0, d_opt = 1;
|
||||
|
||||
#ifdef OPENSSL_FIPS
|
||||
if(!FIPS_mode_set(1,argv[0]))
|
||||
if(!FIPS_mode_set(1))
|
||||
{
|
||||
ERR_print_errors(BIO_new_fp(stderr,BIO_NOCLOSE));
|
||||
EXIT(1);
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# SSLeay/fips/des/Makefile
|
||||
# OpenSSL/fips-1.0/des/Makefile
|
||||
#
|
||||
|
||||
DIR= des
|
||||
@@ -40,9 +40,7 @@ top:
|
||||
all: lib
|
||||
|
||||
lib: $(LIBOBJ)
|
||||
$(AR) $(LIB) $(LIBOBJ)
|
||||
$(RANLIB) $(LIB) || echo Never mind.
|
||||
@sleep 2; touch lib
|
||||
@echo $(LIBOBJ) > lib
|
||||
|
||||
files:
|
||||
$(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user