SM3/SMS4/SM3Sign(modified ECDSA) Supported

This commit is contained in:
Zhi Guan
2015-08-14 01:08:27 +08:00
parent 57954c4567
commit db4d3aef00
832 changed files with 20719 additions and 48 deletions

View File

@@ -11,11 +11,11 @@ SHLIB_VERSION_NUMBER=1.0.0
SHLIB_VERSION_HISTORY=
SHLIB_MAJOR=1
SHLIB_MINOR=0.0
SHLIB_EXT=.so.$(SHLIB_MAJOR).$(SHLIB_MINOR)
PLATFORM=linux-x86_64
SHLIB_EXT=.$(SHLIB_MAJOR).$(SHLIB_MINOR).dylib
PLATFORM=darwin-i386-cc
OPTIONS= no-gmp no-jpake no-krb5 no-md2 no-rc5 no-rfc3779 no-shared no-store no-zlib no-zlib-dynamic static-engine
CONFIGURE_ARGS=linux-x86_64
SHLIB_TARGET=linux-shared
CONFIGURE_ARGS=darwin-i386-cc
SHLIB_TARGET=darwin-shared
# HERE indicates where this Makefile lives. This can be used to indicate
# where sub-Makefiles are expected to be. Currently has very limited usage,
@@ -59,20 +59,20 @@ OPENSSLDIR=/usr/local/ssl
# equal 4.
# PKCS1_CHECK - pkcs1 tests.
CC= gcc
CFLAG= -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -m64 -DL_ENDIAN -DTERMIO -O3 -Wall -DMD32_REG_T=int -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DAES_ASM -DWHIRLPOOL_ASM
CC= cc
CFLAG= -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -arch i386 -O3 -fomit-frame-pointer -DL_ENDIAN -DOPENSSL_BN_ASM_PART_WORDS -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DRMD160_ASM -DAES_ASM -DWHIRLPOOL_ASM
DEPFLAG= -DOPENSSL_NO_GMP -DOPENSSL_NO_JPAKE -DOPENSSL_NO_MD2 -DOPENSSL_NO_RC5 -DOPENSSL_NO_RFC3779 -DOPENSSL_NO_STORE
PEX_LIBS=
EX_LIBS= -ldl
PEX_LIBS= -Wl,-search_paths_first
EX_LIBS=
EXE_EXT=
ARFLAGS=
AR= ar $(ARFLAGS) r
RANLIB= /usr/bin/ranlib
RANLIB= /opt/local/bin/ranlib
NM= nm
PERL= /usr/bin/perl
PERL= /opt/local/bin/perl5
TAR= tar
TARFLAGS= --no-recursion
MAKEDEPPROG= gcc
MAKEDEPPROG=makedepend
LIBDIR=lib
# We let the C compiler driver to take care of .s files. This is done in
@@ -88,20 +88,20 @@ ASFLAG=$(CFLAG)
PROCESSOR=
# CPUID module collects small commonly used assembler snippets
CPUID_OBJ= x86_64cpuid.o
BN_ASM= x86_64-gcc.o x86_64-mont.o
DES_ENC= des_enc.o fcrypt_b.o
AES_ENC= aes-x86_64.o
BF_ENC= bf_enc.o
CAST_ENC= c_enc.o
RC4_ENC= rc4-x86_64.o
RC5_ENC= rc5_enc.o
MD5_ASM_OBJ= md5-x86_64.o
SHA1_ASM_OBJ= sha1-x86_64.o sha256-x86_64.o sha512-x86_64.o
RMD160_ASM_OBJ=
WP_ASM_OBJ= wp-x86_64.o
CMLL_ENC= cmll-x86_64.o cmll_misc.o
PERLASM_SCHEME= elf
CPUID_OBJ= x86cpuid.o
BN_ASM= bn-586.o co-586.o x86-mont.o
DES_ENC= des-586.o crypt586.o
AES_ENC= aes-586.o
BF_ENC= bf-586.o
CAST_ENC= cast-586.o
RC4_ENC= rc4-586.o
RC5_ENC= rc5-586.o
MD5_ASM_OBJ= md5-586.o
SHA1_ASM_OBJ= sha1-586.o sha256-586.o sha512-586.o
RMD160_ASM_OBJ= rmd-586.o
WP_ASM_OBJ= wp_block.o wp-mmx.o
CMLL_ENC= cmll-x86.o
PERLASM_SCHEME= macosx
# KRB5 stuff
KRB5_INCLUDES=
@@ -149,8 +149,8 @@ LIBS= libcrypto.a libssl.a
SHARED_CRYPTO=libcrypto$(SHLIB_EXT)
SHARED_SSL=libssl$(SHLIB_EXT)
SHARED_LIBS=
SHARED_LIBS_LINK_EXTS=.so.$(SHLIB_MAJOR) .so
SHARED_LDFLAGS=-m64
SHARED_LIBS_LINK_EXTS=.$(SHLIB_MAJOR).dylib .dylib
SHARED_LDFLAGS=-arch i386 -dynamiclib
GENERAL= Makefile
BASENAME= openssl

View File

@@ -11,11 +11,11 @@ SHLIB_VERSION_NUMBER=1.0.0
SHLIB_VERSION_HISTORY=
SHLIB_MAJOR=1
SHLIB_MINOR=0.0
SHLIB_EXT=.$(SHLIB_MAJOR).$(SHLIB_MINOR).dylib
PLATFORM=darwin64-x86_64-cc
OPTIONS=--prefix=/usr/local/ no-dso no-gmp no-jpake no-krb5 no-md2 no-rc5 no-rfc3779 no-shared no-store no-zlib no-zlib-dynamic static-engine
CONFIGURE_ARGS=no-shared no-dso --prefix=/usr/local/ darwin64-x86_64-cc
SHLIB_TARGET=darwin-shared
SHLIB_EXT=.so.$(SHLIB_MAJOR).$(SHLIB_MINOR)
PLATFORM=linux-x86_64
OPTIONS= no-gmp no-jpake no-krb5 no-md2 no-rc5 no-rfc3779 no-shared no-store no-zlib no-zlib-dynamic static-engine
CONFIGURE_ARGS=linux-x86_64
SHLIB_TARGET=linux-shared
# HERE indicates where this Makefile lives. This can be used to indicate
# where sub-Makefiles are expected to be. Currently has very limited usage,
@@ -26,7 +26,7 @@ HERE=.
# for, say, /usr/ and yet have everything installed to /tmp/somedir/usr/.
# Normally it is left empty.
INSTALL_PREFIX=
INSTALLTOP=/usr/local
INSTALLTOP=/usr/local/ssl
# Do not edit this manually. Use Configure --openssldir=DIR do change this!
OPENSSLDIR=/usr/local/ssl
@@ -59,11 +59,11 @@ OPENSSLDIR=/usr/local/ssl
# equal 4.
# PKCS1_CHECK - pkcs1 tests.
CC= cc
CFLAG= -DOPENSSL_THREADS -D_REENTRANT -arch x86_64 -O3 -DL_ENDIAN -DMD32_REG_T=int -Wall -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DAES_ASM -DWHIRLPOOL_ASM
CC= gcc
CFLAG= -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -m64 -DL_ENDIAN -DTERMIO -O3 -Wall -DMD32_REG_T=int -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DAES_ASM -DWHIRLPOOL_ASM
DEPFLAG= -DOPENSSL_NO_GMP -DOPENSSL_NO_JPAKE -DOPENSSL_NO_MD2 -DOPENSSL_NO_RC5 -DOPENSSL_NO_RFC3779 -DOPENSSL_NO_STORE
PEX_LIBS= -Wl,-search_paths_first
EX_LIBS=
PEX_LIBS=
EX_LIBS= -ldl
EXE_EXT=
ARFLAGS=
AR= ar $(ARFLAGS) r
@@ -72,7 +72,7 @@ NM= nm
PERL= /usr/bin/perl
TAR= tar
TARFLAGS= --no-recursion
MAKEDEPPROG=makedepend
MAKEDEPPROG= gcc
LIBDIR=lib
# We let the C compiler driver to take care of .s files. This is done in
@@ -101,7 +101,7 @@ SHA1_ASM_OBJ= sha1-x86_64.o sha256-x86_64.o sha512-x86_64.o
RMD160_ASM_OBJ=
WP_ASM_OBJ= wp-x86_64.o
CMLL_ENC= cmll-x86_64.o cmll_misc.o
PERLASM_SCHEME= macosx
PERLASM_SCHEME= elf
# KRB5 stuff
KRB5_INCLUDES=
@@ -149,8 +149,8 @@ LIBS= libcrypto.a libssl.a
SHARED_CRYPTO=libcrypto$(SHLIB_EXT)
SHARED_SSL=libssl$(SHLIB_EXT)
SHARED_LIBS=
SHARED_LIBS_LINK_EXTS=.$(SHLIB_MAJOR).dylib .dylib
SHARED_LDFLAGS=-arch x86_64 -dynamiclib
SHARED_LIBS_LINK_EXTS=.so.$(SHLIB_MAJOR) .so
SHARED_LDFLAGS=-m64
GENERAL= Makefile
BASENAME= openssl

View File

@@ -1,4 +1,4 @@
#!/usr/bin/perl
#!/opt/local/bin/perl5
#
# CA - wrapper around ca to make it easier to use ... basically ca requires
# some setup stuff to be done before you can use it and this makes

189
apps/CA.pl.bak Normal file
View File

@@ -0,0 +1,189 @@
#!/usr/bin/perl
#
# CA - wrapper around ca to make it easier to use ... basically ca requires
# some setup stuff to be done before you can use it and this makes
# things easier between now and when Eric is convinced to fix it :-)
#
# CA -newca ... will setup the right stuff
# CA -newreq[-nodes] ... will generate a certificate request
# CA -sign ... will sign the generated request and output
#
# At the end of that grab newreq.pem and newcert.pem (one has the key
# and the other the certificate) and cat them together and that is what
# you want/need ... I'll make even this a little cleaner later.
#
#
# 12-Jan-96 tjh Added more things ... including CA -signcert which
# converts a certificate to a request and then signs it.
# 10-Jan-96 eay Fixed a few more bugs and added the SSLEAY_CONFIG
# environment variable so this can be driven from
# a script.
# 25-Jul-96 eay Cleaned up filenames some more.
# 11-Jun-96 eay Fixed a few filename missmatches.
# 03-May-96 eay Modified to use 'ssleay cmd' instead of 'cmd'.
# 18-Apr-96 tjh Original hacking
#
# Tim Hudson
# tjh@cryptsoft.com
#
# 27-Apr-98 snh Translation into perl, fix existing CA bug.
#
#
# Steve Henson
# shenson@bigfoot.com
# default openssl.cnf file has setup as per the following
# demoCA ... where everything is stored
my $openssl;
if(defined $ENV{OPENSSL}) {
$openssl = $ENV{OPENSSL};
} else {
$openssl = "openssl";
$ENV{OPENSSL} = $openssl;
}
$SSLEAY_CONFIG=$ENV{"SSLEAY_CONFIG"};
$DAYS="-days 365"; # 1 year
$CADAYS="-days 1095"; # 3 years
$REQ="$openssl req $SSLEAY_CONFIG";
$CA="$openssl ca $SSLEAY_CONFIG";
$VERIFY="$openssl verify";
$X509="$openssl x509";
$PKCS12="$openssl pkcs12";
$CATOP="./demoCA";
$CAKEY="cakey.pem";
$CAREQ="careq.pem";
$CACERT="cacert.pem";
$DIRMODE = 0777;
$RET = 0;
foreach (@ARGV) {
if ( /^(-\?|-h|-help)$/ ) {
print STDERR "usage: CA -newcert|-newreq|-newreq-nodes|-newca|-sign|-verify\n";
exit 0;
} elsif (/^-newcert$/) {
# create a certificate
system ("$REQ -new -x509 -keyout newkey.pem -out newcert.pem $DAYS");
$RET=$?;
print "Certificate is in newcert.pem, private key is in newkey.pem\n"
} elsif (/^-newreq$/) {
# create a certificate request
system ("$REQ -new -keyout newkey.pem -out newreq.pem $DAYS");
$RET=$?;
print "Request is in newreq.pem, private key is in newkey.pem\n";
} elsif (/^-newreq-nodes$/) {
# create a certificate request
system ("$REQ -new -nodes -keyout newkey.pem -out newreq.pem $DAYS");
$RET=$?;
print "Request is in newreq.pem, private key is in newkey.pem\n";
} elsif (/^-newca$/) {
# if explicitly asked for or it doesn't exist then setup the
# directory structure that Eric likes to manage things
$NEW="1";
if ( "$NEW" || ! -f "${CATOP}/serial" ) {
# create the directory hierarchy
mkdir $CATOP, $DIRMODE;
mkdir "${CATOP}/certs", $DIRMODE;
mkdir "${CATOP}/crl", $DIRMODE ;
mkdir "${CATOP}/newcerts", $DIRMODE;
mkdir "${CATOP}/private", $DIRMODE;
open OUT, ">${CATOP}/index.txt";
close OUT;
open OUT, ">${CATOP}/crlnumber";
print OUT "01\n";
close OUT;
}
if ( ! -f "${CATOP}/private/$CAKEY" ) {
print "CA certificate filename (or enter to create)\n";
$FILE = <STDIN>;
chop $FILE;
# ask user for existing CA certificate
if ($FILE) {
cp_pem($FILE,"${CATOP}/private/$CAKEY", "PRIVATE");
cp_pem($FILE,"${CATOP}/$CACERT", "CERTIFICATE");
$RET=$?;
} else {
print "Making CA certificate ...\n";
system ("$REQ -new -keyout " .
"${CATOP}/private/$CAKEY -out ${CATOP}/$CAREQ");
system ("$CA -create_serial " .
"-out ${CATOP}/$CACERT $CADAYS -batch " .
"-keyfile ${CATOP}/private/$CAKEY -selfsign " .
"-extensions v3_ca " .
"-infiles ${CATOP}/$CAREQ ");
$RET=$?;
}
}
} elsif (/^-pkcs12$/) {
my $cname = $ARGV[1];
$cname = "My Certificate" unless defined $cname;
system ("$PKCS12 -in newcert.pem -inkey newkey.pem " .
"-certfile ${CATOP}/$CACERT -out newcert.p12 " .
"-export -name \"$cname\"");
$RET=$?;
print "PKCS #12 file is in newcert.p12\n";
exit $RET;
} elsif (/^-xsign$/) {
system ("$CA -policy policy_anything -infiles newreq.pem");
$RET=$?;
} elsif (/^(-sign|-signreq)$/) {
system ("$CA -policy policy_anything -out newcert.pem " .
"-infiles newreq.pem");
$RET=$?;
print "Signed certificate is in newcert.pem\n";
} elsif (/^(-signCA)$/) {
system ("$CA -policy policy_anything -out newcert.pem " .
"-extensions v3_ca -infiles newreq.pem");
$RET=$?;
print "Signed CA certificate is in newcert.pem\n";
} elsif (/^-signcert$/) {
system ("$X509 -x509toreq -in newreq.pem -signkey newreq.pem " .
"-out tmp.pem");
system ("$CA -policy policy_anything -out newcert.pem " .
"-infiles tmp.pem");
$RET = $?;
print "Signed certificate is in newcert.pem\n";
} elsif (/^-verify$/) {
if (shift) {
foreach $j (@ARGV) {
system ("$VERIFY -CAfile $CATOP/$CACERT $j");
$RET=$? if ($? != 0);
}
exit $RET;
} else {
system ("$VERIFY -CAfile $CATOP/$CACERT newcert.pem");
$RET=$?;
exit 0;
}
} else {
print STDERR "Unknown arg $_\n";
print STDERR "usage: CA -newcert|-newreq|-newreq-nodes|-newca|-sign|-verify\n";
exit 1;
}
}
exit $RET;
sub cp_pem {
my ($infile, $outfile, $bound) = @_;
open IN, $infile;
open OUT, ">$outfile";
my $flag = 0;
while (<IN>) {
$flag = 1 if (/^-----BEGIN.*$bound/) ;
print OUT $_ if ($flag);
if (/^-----END.*$bound/) {
close IN;
close OUT;
return;
}
}
}

BIN
apps/app_rand.o Normal file

Binary file not shown.

BIN
apps/apps.o Normal file

Binary file not shown.

BIN
apps/asn1pars.o Normal file

Binary file not shown.

BIN
apps/ca.o Normal file

Binary file not shown.

BIN
apps/ciphers.o Normal file

Binary file not shown.

BIN
apps/cms.o Normal file

Binary file not shown.

BIN
apps/crl.o Normal file

Binary file not shown.

BIN
apps/crl2p7.o Normal file

Binary file not shown.

BIN
apps/dgst.o Normal file

Binary file not shown.

BIN
apps/dh.o Normal file

Binary file not shown.

BIN
apps/dhparam.o Normal file

Binary file not shown.

BIN
apps/dsa.o Normal file

Binary file not shown.

BIN
apps/dsaparam.o Normal file

Binary file not shown.

BIN
apps/ec.o Normal file

Binary file not shown.

BIN
apps/ecparam.o Normal file

Binary file not shown.

BIN
apps/enc.o Normal file

Binary file not shown.

BIN
apps/engine.o Normal file

Binary file not shown.

BIN
apps/errstr.o Normal file

Binary file not shown.

BIN
apps/gendh.o Normal file

Binary file not shown.

BIN
apps/gendsa.o Normal file

Binary file not shown.

BIN
apps/genpkey.o Normal file

Binary file not shown.

BIN
apps/genrsa.o Normal file

Binary file not shown.

BIN
apps/nseq.o Normal file

Binary file not shown.

BIN
apps/ocsp.o Normal file

Binary file not shown.

BIN
apps/openssl Executable file

Binary file not shown.

BIN
apps/openssl.o Normal file

Binary file not shown.

BIN
apps/passwd.o Normal file

Binary file not shown.

BIN
apps/pkcs12.o Normal file

Binary file not shown.

BIN
apps/pkcs7.o Normal file

Binary file not shown.

BIN
apps/pkcs8.o Normal file

Binary file not shown.

BIN
apps/pkey.o Normal file

Binary file not shown.

BIN
apps/pkeyparam.o Normal file

Binary file not shown.

BIN
apps/pkeyutl.o Normal file

Binary file not shown.

BIN
apps/prime.o Normal file

Binary file not shown.

BIN
apps/rand.o Normal file

Binary file not shown.

BIN
apps/req.o Normal file

Binary file not shown.

BIN
apps/rsa.o Normal file

Binary file not shown.

BIN
apps/rsautl.o Normal file

Binary file not shown.

BIN
apps/s_cb.o Normal file

Binary file not shown.

BIN
apps/s_client.o Normal file

Binary file not shown.

BIN
apps/s_server.o Normal file

Binary file not shown.

BIN
apps/s_socket.o Normal file

Binary file not shown.

BIN
apps/s_time.o Normal file

Binary file not shown.

BIN
apps/sess_id.o Normal file

Binary file not shown.

BIN
apps/smime.o Normal file

Binary file not shown.

BIN
apps/speed.o Normal file

Binary file not shown.

BIN
apps/spkac.o Normal file

Binary file not shown.

BIN
apps/ts.o Normal file

Binary file not shown.

BIN
apps/verify.o Normal file

Binary file not shown.

BIN
apps/version.o Normal file

Binary file not shown.

BIN
apps/x509.o Normal file

Binary file not shown.

BIN
crypto/aes/aes-586.o Normal file

Binary file not shown.

3196
crypto/aes/aes-586.s Normal file

File diff suppressed because it is too large Load Diff

BIN
crypto/aes/aes_cfb.o Normal file

Binary file not shown.

BIN
crypto/aes/aes_ctr.o Normal file

Binary file not shown.

BIN
crypto/aes/aes_ecb.o Normal file

Binary file not shown.

BIN
crypto/aes/aes_ige.o Normal file

Binary file not shown.

BIN
crypto/aes/aes_misc.o Normal file

Binary file not shown.

BIN
crypto/aes/aes_ofb.o Normal file

Binary file not shown.

BIN
crypto/aes/aes_wrap.o Normal file

Binary file not shown.

0
crypto/aes/lib Normal file
View File

BIN
crypto/asn1/a_bitstr.o Normal file

Binary file not shown.

BIN
crypto/asn1/a_bool.o Normal file

Binary file not shown.

BIN
crypto/asn1/a_bytes.o Normal file

Binary file not shown.

BIN
crypto/asn1/a_d2i_fp.o Normal file

Binary file not shown.

BIN
crypto/asn1/a_digest.o Normal file

Binary file not shown.

BIN
crypto/asn1/a_dup.o Normal file

Binary file not shown.

BIN
crypto/asn1/a_enum.o Normal file

Binary file not shown.

BIN
crypto/asn1/a_gentm.o Normal file

Binary file not shown.

BIN
crypto/asn1/a_i2d_fp.o Normal file

Binary file not shown.

BIN
crypto/asn1/a_int.o Normal file

Binary file not shown.

BIN
crypto/asn1/a_mbstr.o Normal file

Binary file not shown.

BIN
crypto/asn1/a_object.o Normal file

Binary file not shown.

BIN
crypto/asn1/a_octet.o Normal file

Binary file not shown.

BIN
crypto/asn1/a_print.o Normal file

Binary file not shown.

BIN
crypto/asn1/a_set.o Normal file

Binary file not shown.

BIN
crypto/asn1/a_sign.o Normal file

Binary file not shown.

BIN
crypto/asn1/a_strex.o Normal file

Binary file not shown.

BIN
crypto/asn1/a_strnid.o Normal file

Binary file not shown.

BIN
crypto/asn1/a_time.o Normal file

Binary file not shown.

BIN
crypto/asn1/a_type.o Normal file

Binary file not shown.

BIN
crypto/asn1/a_utctm.o Normal file

Binary file not shown.

BIN
crypto/asn1/a_utf8.o Normal file

Binary file not shown.

BIN
crypto/asn1/a_verify.o Normal file

Binary file not shown.

BIN
crypto/asn1/ameth_lib.o Normal file

Binary file not shown.

BIN
crypto/asn1/asn1_err.o Normal file

Binary file not shown.

BIN
crypto/asn1/asn1_gen.o Normal file

Binary file not shown.

BIN
crypto/asn1/asn1_lib.o Normal file

Binary file not shown.

BIN
crypto/asn1/asn1_par.o Normal file

Binary file not shown.

BIN
crypto/asn1/asn_mime.o Normal file

Binary file not shown.

BIN
crypto/asn1/asn_moid.o Normal file

Binary file not shown.

BIN
crypto/asn1/asn_pack.o Normal file

Binary file not shown.

BIN
crypto/asn1/bio_asn1.o Normal file

Binary file not shown.

BIN
crypto/asn1/bio_ndef.o Normal file

Binary file not shown.

BIN
crypto/asn1/d2i_pr.o Normal file

Binary file not shown.

BIN
crypto/asn1/d2i_pu.o Normal file

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More