Compare commits
214 Commits
main
...
OpenSSL_1_
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c90c41f09d | ||
|
|
c47b636a2c | ||
|
|
7200b39ecd | ||
|
|
84c95826de | ||
|
|
63819e6f00 | ||
|
|
8206dba75c | ||
|
|
528ef87850 | ||
|
|
9004c53107 | ||
|
|
f47f99f295 | ||
|
|
00f473b3cc | ||
|
|
356de7146e | ||
|
|
9eab925395 | ||
|
|
22d89c501e | ||
|
|
c06916db9f | ||
|
|
ef7545a3e6 | ||
|
|
fecb4ff331 | ||
|
|
2a4adf19c8 | ||
|
|
44c854ddb9 | ||
|
|
47091035f1 | ||
|
|
f3d51d7740 | ||
|
|
70d3b4b653 | ||
|
|
2fb94e4861 | ||
|
|
1b84893905 | ||
|
|
68b5330040 | ||
|
|
da7ae62abd | ||
|
|
f53337b89c | ||
|
|
f70a5895e3 | ||
|
|
d41bbd0db5 | ||
|
|
49956294fc | ||
|
|
48373e55d1 | ||
|
|
42369021ed | ||
|
|
b00fe7ce18 | ||
|
|
872e3fd502 | ||
|
|
c11ada6c99 | ||
|
|
8f0968850b | ||
|
|
0b96f60a56 | ||
|
|
ab06ff6bee | ||
|
|
bba8456e65 | ||
|
|
b493a05720 | ||
|
|
c2a8133d1c | ||
|
|
e935440ad7 | ||
|
|
8eaf563c41 | ||
|
|
80d7e6b039 | ||
|
|
9c44e33230 | ||
|
|
b86f3197b7 | ||
|
|
0875c00584 | ||
|
|
dd3a770e07 | ||
|
|
64763ce09b | ||
|
|
2fffc29bd1 | ||
|
|
d2650c3a4a | ||
|
|
b5bd966ea4 | ||
|
|
e71f7786e3 | ||
|
|
e3b95e6b24 | ||
|
|
658eeec7cd | ||
|
|
e1c3d65f08 | ||
|
|
2e4abe2ce2 | ||
|
|
ea294bb50e | ||
|
|
b58ea0b941 | ||
|
|
16067fe5fd | ||
|
|
f2e9070f26 | ||
|
|
fe8629e1a5 | ||
|
|
2a12eff4b2 | ||
|
|
b680fef061 | ||
|
|
7f7414e054 | ||
|
|
8b9db484ed | ||
|
|
f59f2fcbff | ||
|
|
419a530194 | ||
|
|
69a8901eb1 | ||
|
|
2bcd08e691 | ||
|
|
167d692925 | ||
|
|
025ee1dbde | ||
|
|
dce7b92d0b | ||
|
|
db886c2a2b | ||
|
|
4d43129446 | ||
|
|
92107f8150 | ||
|
|
e82d6a2019 | ||
|
|
4e5755cd85 | ||
|
|
dda8dcd2c0 | ||
|
|
16646b0018 | ||
|
|
320881c25c | ||
|
|
1d23fb382e | ||
|
|
c4f1942a76 | ||
|
|
38c42c6eea | ||
|
|
51eb247d0f | ||
|
|
8d22673a62 | ||
|
|
3622d3743e | ||
|
|
fbbf28e7c2 | ||
|
|
f5dac77c06 | ||
|
|
067d72a082 | ||
|
|
ac0f3f506a | ||
|
|
f819147028 | ||
|
|
a530963f05 | ||
|
|
bc5a53f5e9 | ||
|
|
83382fb9d5 | ||
|
|
0674370017 | ||
|
|
2f91cb2c5e | ||
|
|
acb25c2327 | ||
|
|
2d842a90f8 | ||
|
|
80705bfc50 | ||
|
|
2a8692311d | ||
|
|
7d0ed89d57 | ||
|
|
0912fae6ce | ||
|
|
0bb2154ee9 | ||
|
|
c9355e20c3 | ||
|
|
6545372c24 | ||
|
|
17f8412983 | ||
|
|
d48df9a91b | ||
|
|
65448fd0d3 | ||
|
|
a677c87b7b | ||
|
|
f8a123b4a2 | ||
|
|
c64beae686 | ||
|
|
99ef8323e4 | ||
|
|
2668c58969 | ||
|
|
5ae3168a77 | ||
|
|
559579659c | ||
|
|
2dd74160cc | ||
|
|
2adf63272c | ||
|
|
fb5a0fb8f1 | ||
|
|
c222de16ce | ||
|
|
19091ac236 | ||
|
|
2fcf251d3d | ||
|
|
dab5848cd9 | ||
|
|
a02f0f3d69 | ||
|
|
e69d49364e | ||
|
|
38921f0abf | ||
|
|
d76ce84c92 | ||
|
|
c3c7a0d26e | ||
|
|
d06bc800f2 | ||
|
|
a01dc637bd | ||
|
|
3bbbe757ea | ||
|
|
76474e519f | ||
|
|
420f572d49 | ||
|
|
6d65d44b95 | ||
|
|
91e1ff77a0 | ||
|
|
c8e60ec8fa | ||
|
|
e840570207 | ||
|
|
077527f19e | ||
|
|
00daa2e6c6 | ||
|
|
000f221d60 | ||
|
|
579a605494 | ||
|
|
fa29ebd7ed | ||
|
|
3360999046 | ||
|
|
0b965e59cb | ||
|
|
1684846f54 | ||
|
|
dde6d9520c | ||
|
|
f9a772b743 | ||
|
|
0d6f7dbb50 | ||
|
|
994a1ea900 | ||
|
|
e5d1fd38d1 | ||
|
|
a330ed26be | ||
|
|
ca0a86c89d | ||
|
|
1cf7bbce48 | ||
|
|
4cdde22432 | ||
|
|
a28cee6efe | ||
|
|
1977bafba4 | ||
|
|
3c96907f2b | ||
|
|
2d96a30dc7 | ||
|
|
c09d1df7d3 | ||
|
|
c20dd45477 | ||
|
|
abb320463d | ||
|
|
ada3f8b5d3 | ||
|
|
6172561597 | ||
|
|
368b64d6dd | ||
|
|
4ed0ca2b3e | ||
|
|
a92f98c630 | ||
|
|
4385b556b4 | ||
|
|
5e7c9519b8 | ||
|
|
ef02492908 | ||
|
|
86d5f9ba4f | ||
|
|
febcec6254 | ||
|
|
f07cb1ce8e | ||
|
|
b3c17a4805 | ||
|
|
7b83fe34c0 | ||
|
|
e0b1c57ae0 | ||
|
|
6806b06d21 | ||
|
|
0af0e9d747 | ||
|
|
2191b3ba44 | ||
|
|
73020a945b | ||
|
|
9c2d0cd11c | ||
|
|
0ef9b9c7bf | ||
|
|
c14c6e996d | ||
|
|
51381cd4ed | ||
|
|
8c9ab050e5 | ||
|
|
b6996c7849 | ||
|
|
2c23b0716e | ||
|
|
f548a0e4d5 | ||
|
|
a404f63f92 | ||
|
|
b54f50d277 | ||
|
|
10ba241909 | ||
|
|
1f238b1c4a | ||
|
|
ef85bf8c2b | ||
|
|
cbfccdb729 | ||
|
|
94111aa401 | ||
|
|
eec48070a1 | ||
|
|
eebe668174 | ||
|
|
8a15a4a7b4 | ||
|
|
19057003f1 | ||
|
|
031648d4ce | ||
|
|
02bee340a2 | ||
|
|
f6f2f68a05 | ||
|
|
982d68a0c0 | ||
|
|
7585a86a76 | ||
|
|
73190f1b46 | ||
|
|
6673ac592a | ||
|
|
59aa655b53 | ||
|
|
c4c99b4961 | ||
|
|
ccbbcddd5f | ||
|
|
65d82478d8 | ||
|
|
02a6518a02 | ||
|
|
a79053511b | ||
|
|
eb56eb2279 | ||
|
|
d40f6d4a02 | ||
|
|
943ae0951a | ||
|
|
999eeaba14 |
22
.cvsignore
Normal file
22
.cvsignore
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
openssl.pc
|
||||||
|
libcrypto.pc
|
||||||
|
libssl.pc
|
||||||
|
MINFO
|
||||||
|
makefile.one
|
||||||
|
tmp
|
||||||
|
out
|
||||||
|
outinc
|
||||||
|
rehash.time
|
||||||
|
testlog
|
||||||
|
make.log
|
||||||
|
maketest.log
|
||||||
|
cctest
|
||||||
|
cctest.c
|
||||||
|
cctest.a
|
||||||
|
*.flc
|
||||||
|
semantic.cache
|
||||||
|
Makefile
|
||||||
|
*.dll*
|
||||||
|
*.so*
|
||||||
|
*.sl*
|
||||||
|
*.dylib*
|
||||||
114
.gitignore
vendored
114
.gitignore
vendored
@@ -1,114 +0,0 @@
|
|||||||
# Object files
|
|
||||||
*.o
|
|
||||||
*.obj
|
|
||||||
|
|
||||||
# editor artefacts
|
|
||||||
*.swp
|
|
||||||
.#*
|
|
||||||
#*#
|
|
||||||
*~
|
|
||||||
/.dir-locals.el
|
|
||||||
|
|
||||||
# Top level excludes
|
|
||||||
/Makefile.bak
|
|
||||||
/Makefile
|
|
||||||
/*.a
|
|
||||||
/include
|
|
||||||
/*.pc
|
|
||||||
/rehash.time
|
|
||||||
|
|
||||||
# Most *.c files under test/ are symlinks
|
|
||||||
/test/*.c
|
|
||||||
# Apart from these
|
|
||||||
!/test/asn1test.c
|
|
||||||
!/test/methtest.c
|
|
||||||
!/test/dummytest.c
|
|
||||||
!/test/igetest.c
|
|
||||||
!/test/r160test.c
|
|
||||||
!/test/fips_algvs.c
|
|
||||||
|
|
||||||
/test/*.ss
|
|
||||||
/test/*.srl
|
|
||||||
/test/.rnd
|
|
||||||
/test/test*.pem
|
|
||||||
/test/newkey.pem
|
|
||||||
|
|
||||||
# Certificate symbolic links
|
|
||||||
*.0
|
|
||||||
|
|
||||||
# Links under apps
|
|
||||||
/apps/CA.pl
|
|
||||||
/apps/md4.c
|
|
||||||
|
|
||||||
|
|
||||||
# Auto generated headers
|
|
||||||
/crypto/buildinf.h
|
|
||||||
/crypto/opensslconf.h
|
|
||||||
|
|
||||||
# Auto generated assembly language source files
|
|
||||||
*.s
|
|
||||||
!/crypto/bn/asm/pa-risc2.s
|
|
||||||
!/crypto/bn/asm/pa-risc2W.s
|
|
||||||
crypto/aes/asm/a_win32.asm
|
|
||||||
crypto/bf/asm/b_win32.asm
|
|
||||||
crypto/bn/asm/bn_win32.asm
|
|
||||||
crypto/bn/asm/co_win32.asm
|
|
||||||
crypto/bn/asm/mt_win32.asm
|
|
||||||
crypto/cast/asm/c_win32.asm
|
|
||||||
crypto/cpu_win32.asm
|
|
||||||
crypto/des/asm/d_win32.asm
|
|
||||||
crypto/des/asm/y_win32.asm
|
|
||||||
crypto/md5/asm/m5_win32.asm
|
|
||||||
crypto/rc4/asm/r4_win32.asm
|
|
||||||
crypto/rc5/asm/r5_win32.asm
|
|
||||||
crypto/ripemd/asm/rm_win32.asm
|
|
||||||
crypto/sha/asm/s1_win32.asm
|
|
||||||
crypto/sha/asm/sha512-sse2.asm
|
|
||||||
|
|
||||||
# Executables
|
|
||||||
/apps/openssl
|
|
||||||
/test/sha256t
|
|
||||||
/test/sha512t
|
|
||||||
/test/*test
|
|
||||||
/test/fips_aesavs
|
|
||||||
/test/fips_desmovs
|
|
||||||
/test/fips_dhvs
|
|
||||||
/test/fips_drbgvs
|
|
||||||
/test/fips_dssvs
|
|
||||||
/test/fips_ecdhvs
|
|
||||||
/test/fips_ecdsavs
|
|
||||||
/test/fips_rngvs
|
|
||||||
/test/fips_test_suite
|
|
||||||
*.so*
|
|
||||||
*.dylib*
|
|
||||||
*.dll*
|
|
||||||
# Exceptions
|
|
||||||
!/test/bctest
|
|
||||||
!/crypto/des/times/486-50.sol
|
|
||||||
|
|
||||||
# Misc auto generated files
|
|
||||||
/tools/c_rehash
|
|
||||||
/test/evptests.txt
|
|
||||||
lib
|
|
||||||
Makefile.save
|
|
||||||
*.bak
|
|
||||||
tags
|
|
||||||
TAGS
|
|
||||||
|
|
||||||
# Windows
|
|
||||||
/tmp32
|
|
||||||
/tmp32.dbg
|
|
||||||
/tmp32dll
|
|
||||||
/tmp32dll.dbg
|
|
||||||
/out32
|
|
||||||
/out32.dbg
|
|
||||||
/out32dll
|
|
||||||
/out32dll.dbg
|
|
||||||
/inc32
|
|
||||||
/MINFO
|
|
||||||
ms/bcb.mak
|
|
||||||
ms/libeay32.def
|
|
||||||
ms/nt.mak
|
|
||||||
ms/ntdll.mak
|
|
||||||
ms/ssleay32.def
|
|
||||||
ms/version32.rc
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
#! /bin/sh
|
|
||||||
|
|
||||||
# $1 is expected to be $TRAVIS_OS_NAME
|
|
||||||
|
|
||||||
if [ "$1" == osx ]; then
|
|
||||||
make -f Makefile.org \
|
|
||||||
DISTTARVARS="NAME=_srcdist TAR_COMMAND='\$\$(TAR) \$\$(TARFLAGS) -s \"|^|\$\$(NAME)/|\" -T \$\$(TARFILE).list -cvf -' TARFLAGS='-n' TARFILE=_srcdist.tar" SHELL='sh -vx' dist
|
|
||||||
else
|
|
||||||
make -f Makefile.org DISTTARVARS='TARFILE=_srcdist.tar NAME=_srcdist' SHELL='sh -v' dist
|
|
||||||
fi
|
|
||||||
60
.travis.yml
60
.travis.yml
@@ -1,60 +0,0 @@
|
|||||||
language: c
|
|
||||||
|
|
||||||
addons:
|
|
||||||
apt_packages:
|
|
||||||
- binutils-mingw-w64
|
|
||||||
- gcc-mingw-w64
|
|
||||||
|
|
||||||
os:
|
|
||||||
- linux
|
|
||||||
- osx
|
|
||||||
|
|
||||||
compiler:
|
|
||||||
- clang
|
|
||||||
- gcc
|
|
||||||
- i686-w64-mingw32-gcc
|
|
||||||
- x86_64-w64-mingw32-gcc
|
|
||||||
|
|
||||||
env:
|
|
||||||
- CONFIG_OPTS=""
|
|
||||||
- CONFIG_OPTS="shared"
|
|
||||||
- CONFIG_OPTS="-d --strict-warnings"
|
|
||||||
|
|
||||||
matrix:
|
|
||||||
exclude:
|
|
||||||
- os: osx
|
|
||||||
compiler: i686-w64-mingw32-gcc
|
|
||||||
- os: osx
|
|
||||||
compiler: x86_64-w64-mingw32-gcc
|
|
||||||
- compiler: i686-w64-mingw32-gcc
|
|
||||||
env: CONFIG_OPTS="-d --strict-warnings"
|
|
||||||
- compiler: x86_64-w64-mingw32-gcc
|
|
||||||
env: CONFIG_OPTS="-d --strict-warnings"
|
|
||||||
|
|
||||||
before_script:
|
|
||||||
- sh .travis-create-release.sh $TRAVIS_OS_NAME
|
|
||||||
- tar -xvzf _srcdist.tar.gz
|
|
||||||
- cd _srcdist
|
|
||||||
- if [ "$CC" == i686-w64-mingw32-gcc ]; then
|
|
||||||
export CROSS_COMPILE=${CC%%gcc}; unset CC;
|
|
||||||
./Configure mingw $CONFIG_OPTS;
|
|
||||||
elif [ "$CC" == x86_64-w64-mingw32-gcc ]; then
|
|
||||||
export CROSS_COMPILE=${CC%%gcc}; unset CC;
|
|
||||||
./Configure mingw64 $CONFIG_OPTS;
|
|
||||||
else
|
|
||||||
./config $CONFIG_OPTS;
|
|
||||||
fi
|
|
||||||
- cd ..
|
|
||||||
|
|
||||||
script:
|
|
||||||
- cd _srcdist
|
|
||||||
- make
|
|
||||||
- if [ -z "$CROSS_COMPILE" ]; then make test; fi
|
|
||||||
- cd ..
|
|
||||||
|
|
||||||
notifications:
|
|
||||||
recipient:
|
|
||||||
- openssl-commits@openssl.org
|
|
||||||
email:
|
|
||||||
on_success: change
|
|
||||||
on_failure: always
|
|
||||||
@@ -1,2 +1,25 @@
|
|||||||
Please https://www.openssl.org/community/thanks.html for the current
|
The OpenSSL project depends on volunteer efforts and financial support from
|
||||||
acknowledgements.
|
the end user community. That support comes in the form of donations and paid
|
||||||
|
sponsorships, software support contracts, paid consulting services
|
||||||
|
and commissioned software development.
|
||||||
|
|
||||||
|
Since all these activities support the continued development and improvement
|
||||||
|
of OpenSSL we consider all these clients and customers as sponsors of the
|
||||||
|
OpenSSL project.
|
||||||
|
|
||||||
|
We would like to identify and thank the following such sponsors for their past
|
||||||
|
or current significant support of the OpenSSL project:
|
||||||
|
|
||||||
|
Very significant support:
|
||||||
|
|
||||||
|
OpenGear: www.opengear.com
|
||||||
|
|
||||||
|
Significant support:
|
||||||
|
|
||||||
|
PSW Group: www.psw.net
|
||||||
|
|
||||||
|
Please note that we ask permission to identify sponsors and that some sponsors
|
||||||
|
we consider eligible for inclusion here have requested to remain anonymous.
|
||||||
|
|
||||||
|
Additional sponsorship or financial support is always welcome: for more
|
||||||
|
information please contact the OpenSSL Software Foundation.
|
||||||
|
|||||||
38
CONTRIBUTING
38
CONTRIBUTING
@@ -1,38 +0,0 @@
|
|||||||
HOW TO CONTRIBUTE TO OpenSSL
|
|
||||||
----------------------------
|
|
||||||
|
|
||||||
Development is coordinated on the openssl-dev mailing list (see
|
|
||||||
http://www.openssl.org for information on subscribing). If you
|
|
||||||
would like to submit a patch, send it to rt@openssl.org with
|
|
||||||
the string "[PATCH]" in the subject. Please be sure to include a
|
|
||||||
textual explanation of what your patch does.
|
|
||||||
|
|
||||||
You can also make GitHub pull requests. If you do this, please also send
|
|
||||||
mail to rt@openssl.org with a brief description and a link to the PR so
|
|
||||||
that we can more easily keep track of it.
|
|
||||||
|
|
||||||
If you are unsure as to whether a feature will be useful for the general
|
|
||||||
OpenSSL community please discuss it on the openssl-dev mailing list first.
|
|
||||||
Someone may be already working on the same thing or there may be a good
|
|
||||||
reason as to why that feature isn't implemented.
|
|
||||||
|
|
||||||
Patches should be as up to date as possible, preferably relative to the
|
|
||||||
current Git or the last snapshot. They should follow our coding style
|
|
||||||
(see https://www.openssl.org/policies/codingstyle.html) and compile without
|
|
||||||
warnings using the --strict-warnings flag. OpenSSL compiles on many varied
|
|
||||||
platforms: try to ensure you only use portable features.
|
|
||||||
|
|
||||||
Our preferred format for patch files is "git format-patch" output. For example
|
|
||||||
to provide a patch file containing the last commit in your local git repository
|
|
||||||
use the following command:
|
|
||||||
|
|
||||||
# git format-patch --stdout HEAD^ >mydiffs.patch
|
|
||||||
|
|
||||||
Another method of creating an acceptable patch file without using git is as
|
|
||||||
follows:
|
|
||||||
|
|
||||||
# cd openssl-work
|
|
||||||
# [your changes]
|
|
||||||
# ./Configure dist; make clean
|
|
||||||
# cd ..
|
|
||||||
# diff -ur openssl-orig openssl-work > mydiffs.patch
|
|
||||||
405
Configure
405
Configure
@@ -10,7 +10,7 @@ use strict;
|
|||||||
|
|
||||||
# see INSTALL for instructions.
|
# see INSTALL for instructions.
|
||||||
|
|
||||||
my $usage="Usage: Configure [no-<cipher> ...] [enable-<cipher> ...] [experimental-<cipher> ...] [-Dxxx] [-lxxx] [-Lxxx] [-fxxx] [-Kxxx] [no-hw-xxx|no-hw] [[no-]threads] [[no-]shared] [[no-]zlib|zlib-dynamic] [no-asm] [no-dso] [no-krb5] [sctp] [386] [--prefix=DIR] [--openssldir=OPENSSLDIR] [--with-xxx[=vvv]] [--test-sanity] os/compiler[:flags]\n";
|
my $usage="Usage: Configure [no-<cipher> ...] [enable-<cipher> ...] [experimental-<cipher> ...] [-Dxxx] [-lxxx] [-Lxxx] [-fxxx] [-Kxxx] [no-hw-xxx|no-hw] [[no-]threads] [[no-]shared] [[no-]zlib|zlib-dynamic] [no-asm] [no-dso] [no-krb5] [386] [--prefix=DIR] [--openssldir=OPENSSLDIR] [--with-xxx[=vvv]] [--test-sanity] os/compiler[:flags]\n";
|
||||||
|
|
||||||
# Options:
|
# Options:
|
||||||
#
|
#
|
||||||
@@ -56,12 +56,7 @@ my $usage="Usage: Configure [no-<cipher> ...] [enable-<cipher> ...] [experimenta
|
|||||||
# [no-]zlib [don't] compile support for zlib compression.
|
# [no-]zlib [don't] compile support for zlib compression.
|
||||||
# zlib-dynamic Like "zlib", but the zlib library is expected to be a shared
|
# zlib-dynamic Like "zlib", but the zlib library is expected to be a shared
|
||||||
# library and will be loaded in run-time by the OpenSSL library.
|
# library and will be loaded in run-time by the OpenSSL library.
|
||||||
# sctp include SCTP support
|
|
||||||
# 386 generate 80386 code
|
# 386 generate 80386 code
|
||||||
# enable-weak-ssl-ciphers
|
|
||||||
# Enable EXPORT and LOW SSLv3 ciphers that are disabled by
|
|
||||||
# default. Note, weak SSLv2 ciphers are unconditionally
|
|
||||||
# disabled.
|
|
||||||
# no-sse2 disables IA-32 SSE2 code, above option implies no-sse2
|
# no-sse2 disables IA-32 SSE2 code, above option implies no-sse2
|
||||||
# no-<cipher> build without specified algorithm (rsa, idea, rc5, ...)
|
# no-<cipher> build without specified algorithm (rsa, idea, rc5, ...)
|
||||||
# -<xxx> +<xxx> compiler options are passed through
|
# -<xxx> +<xxx> compiler options are passed through
|
||||||
@@ -109,11 +104,6 @@ my $usage="Usage: Configure [no-<cipher> ...] [enable-<cipher> ...] [experimenta
|
|||||||
|
|
||||||
my $gcc_devteam_warn = "-Wall -pedantic -DPEDANTIC -Wno-long-long -Wsign-compare -Wmissing-prototypes -Wshadow -Wformat -Werror -DCRYPTO_MDEBUG_ALL -DCRYPTO_MDEBUG_ABORT -DREF_CHECK -DOPENSSL_NO_DEPRECATED";
|
my $gcc_devteam_warn = "-Wall -pedantic -DPEDANTIC -Wno-long-long -Wsign-compare -Wmissing-prototypes -Wshadow -Wformat -Werror -DCRYPTO_MDEBUG_ALL -DCRYPTO_MDEBUG_ABORT -DREF_CHECK -DOPENSSL_NO_DEPRECATED";
|
||||||
|
|
||||||
# Warn that "make depend" should be run?
|
|
||||||
my $warn_make_depend = 0;
|
|
||||||
|
|
||||||
my $clang_devteam_warn = "-Wno-unused-parameter -Wno-missing-field-initializers -Wno-language-extension-token -Wno-extended-offsetof -Qunused-arguments";
|
|
||||||
|
|
||||||
my $strict_warnings = 0;
|
my $strict_warnings = 0;
|
||||||
|
|
||||||
my $x86_gcc_des="DES_PTR DES_RISC1 DES_UNROLL";
|
my $x86_gcc_des="DES_PTR DES_RISC1 DES_UNROLL";
|
||||||
@@ -133,24 +123,21 @@ my $tlib="-lnsl -lsocket";
|
|||||||
my $bits1="THIRTY_TWO_BIT ";
|
my $bits1="THIRTY_TWO_BIT ";
|
||||||
my $bits2="SIXTY_FOUR_BIT ";
|
my $bits2="SIXTY_FOUR_BIT ";
|
||||||
|
|
||||||
my $x86_asm="x86cpuid.o:bn-586.o co-586.o x86-mont.o x86-gf2m.o:des-586.o crypt586.o:aes-586.o vpaes-x86.o aesni-x86.o:bf-586.o:md5-586.o:sha1-586.o sha256-586.o sha512-586.o:cast-586.o:rc4-586.o:rmd-586.o:rc5-586.o:wp_block.o wp-mmx.o:cmll-x86.o:ghash-x86.o:";
|
my $x86_asm="x86cpuid.o:bn-586.o co-586.o x86-mont.o:des-586.o crypt586.o:aes-586.o:bf-586.o:md5-586.o:sha1-586.o sha256-586.o sha512-586.o:cast-586.o:rc4-586.o:rmd-586.o:rc5-586.o:wp_block.o wp-mmx.o:cmll-x86.o";
|
||||||
|
|
||||||
my $x86_elf_asm="$x86_asm:elf";
|
my $x86_elf_asm="$x86_asm:elf";
|
||||||
|
|
||||||
my $x86_64_asm="x86_64cpuid.o:x86_64-gcc.o x86_64-mont.o x86_64-mont5.o x86_64-gf2m.o modexp512-x86_64.o::aes-x86_64.o vpaes-x86_64.o bsaes-x86_64.o aesni-x86_64.o aesni-sha1-x86_64.o::md5-x86_64.o:sha1-x86_64.o sha256-x86_64.o sha512-x86_64.o::rc4-x86_64.o rc4-md5-x86_64.o:::wp-x86_64.o:cmll-x86_64.o cmll_misc.o:ghash-x86_64.o:";
|
my $x86_64_asm="x86_64cpuid.o:x86_64-gcc.o x86_64-mont.o::aes-x86_64.o::md5-x86_64.o:sha1-x86_64.o sha256-x86_64.o sha512-x86_64.o::rc4-x86_64.o:::wp-x86_64.o:cmll-x86_64.o cmll_misc.o";
|
||||||
my $ia64_asm="ia64cpuid.o:bn-ia64.o ia64-mont.o::aes_core.o aes_cbc.o aes-ia64.o::md5-ia64.o:sha1-ia64.o sha256-ia64.o sha512-ia64.o::rc4-ia64.o rc4_skey.o:::::ghash-ia64.o::void";
|
my $ia64_asm="ia64cpuid.o:bn-ia64.o::aes_core.o aes_cbc.o aes-ia64.o::md5-ia64.o:sha1-ia64.o sha256-ia64.o sha512-ia64.o::rc4-ia64.o rc4_skey.o:::::void";
|
||||||
my $sparcv9_asm="sparcv9cap.o sparccpuid.o:bn-sparcv9.o sparcv9-mont.o sparcv9a-mont.o:des_enc-sparc.o fcrypt_b.o:aes_core.o aes_cbc.o aes-sparcv9.o:::sha1-sparcv9.o sha256-sparcv9.o sha512-sparcv9.o:::::::ghash-sparcv9.o::void";
|
my $sparcv9_asm="sparcv9cap.o sparccpuid.o:bn-sparcv9.o sparcv9-mont.o sparcv9a-mont.o:des_enc-sparc.o fcrypt_b.o:aes_core.o aes_cbc.o aes-sparcv9.o:::sha1-sparcv9.o sha256-sparcv9.o sha512-sparcv9.o:::::::void";
|
||||||
my $sparcv8_asm=":sparcv8.o:des_enc-sparc.o fcrypt_b.o:::::::::::::void";
|
my $sparcv8_asm=":sparcv8.o:des_enc-sparc.o fcrypt_b.o:::::::::::void";
|
||||||
my $alpha_asm="alphacpuid.o:bn_asm.o alpha-mont.o:::::sha1-alpha.o:::::::ghash-alpha.o::void";
|
my $alpha_asm="alphacpuid.o:bn_asm.o alpha-mont.o::::::::::::void";
|
||||||
my $mips32_asm=":bn-mips.o::aes_cbc.o aes-mips.o:::sha1-mips.o sha256-mips.o::::::::";
|
my $mips3_asm=":bn-mips3.o::::::::::::void";
|
||||||
my $mips64_asm=":bn-mips.o mips-mont.o::aes_cbc.o aes-mips.o:::sha1-mips.o sha256-mips.o sha512-mips.o::::::::";
|
my $s390x_asm="s390xcap.o s390xcpuid.o:bn-s390x.o s390x-mont.o::aes-s390x.o:::sha1-s390x.o sha256-s390x.o sha512-s390x.o::rc4-s390x.o:::::void";
|
||||||
my $s390x_asm="s390xcap.o s390xcpuid.o:bn-s390x.o s390x-mont.o s390x-gf2m.o::aes-s390x.o aes-ctr.o aes-xts.o:::sha1-s390x.o sha256-s390x.o sha512-s390x.o::rc4-s390x.o:::::ghash-s390x.o:";
|
my $armv4_asm=":bn_asm.o armv4-mont.o::aes_cbc.o aes-armv4.o:::sha1-armv4-large.o sha256-armv4.o sha512-armv4.o:::::::void";
|
||||||
my $armv4_asm="armcap.o armv4cpuid.o:bn_asm.o armv4-mont.o armv4-gf2m.o::aes_cbc.o aes-armv4.o:::sha1-armv4-large.o sha256-armv4.o sha512-armv4.o:::::::ghash-armv4.o::void";
|
my $ppc32_asm="ppccpuid.o:bn-ppc.o::aes_core.o aes_cbc.o aes-ppc.o:::sha1-ppc.o sha256-ppc.o::::::";
|
||||||
my $parisc11_asm="pariscid.o:bn_asm.o parisc-mont.o::aes_core.o aes_cbc.o aes-parisc.o:::sha1-parisc.o sha256-parisc.o sha512-parisc.o::rc4-parisc.o:::::ghash-parisc.o::32";
|
my $ppc64_asm="ppccpuid.o:bn-ppc.o ppc-mont.o::aes_core.o aes_cbc.o aes-ppc.o:::sha1-ppc.o sha256-ppc.o sha512-ppc.o::::::";
|
||||||
my $parisc20_asm="pariscid.o:pa-risc2W.o parisc-mont.o::aes_core.o aes_cbc.o aes-parisc.o:::sha1-parisc.o sha256-parisc.o sha512-parisc.o::rc4-parisc.o:::::ghash-parisc.o::64";
|
my $no_asm=":::::::::::::void";
|
||||||
my $ppc32_asm="ppccpuid.o ppccap.o:bn-ppc.o ppc-mont.o ppc64-mont.o::aes_core.o aes_cbc.o aes-ppc.o:::sha1-ppc.o sha256-ppc.o::::::::";
|
|
||||||
my $ppc64_asm="ppccpuid.o ppccap.o:bn-ppc.o ppc-mont.o ppc64-mont.o::aes_core.o aes_cbc.o aes-ppc.o:::sha1-ppc.o sha256-ppc.o sha512-ppc.o::::::::";
|
|
||||||
my $no_asm=":::::::::::::::void";
|
|
||||||
|
|
||||||
# As for $BSDthreads. Idea is to maintain "collective" set of flags,
|
# As for $BSDthreads. Idea is to maintain "collective" set of flags,
|
||||||
# which would cover all BSD flavors. -pthread applies to them all,
|
# which would cover all BSD flavors. -pthread applies to them all,
|
||||||
@@ -161,7 +148,7 @@ my $no_asm=":::::::::::::::void";
|
|||||||
# seems to be sufficient?
|
# seems to be sufficient?
|
||||||
my $BSDthreads="-pthread -D_THREAD_SAFE -D_REENTRANT";
|
my $BSDthreads="-pthread -D_THREAD_SAFE -D_REENTRANT";
|
||||||
|
|
||||||
#config-string $cc : $cflags : $unistd : $thread_cflag : $sys_id : $lflags : $bn_ops : $cpuid_obj : $bn_obj : $des_obj : $aes_obj : $bf_obj : $md5_obj : $sha1_obj : $cast_obj : $rc4_obj : $rmd160_obj : $rc5_obj : $wp_obj : $cmll_obj : $modes_obj : $engines_obj : $dso_scheme : $shared_target : $shared_cflag : $shared_ldflag : $shared_extension : $ranlib : $arflags : $multilib
|
#config-string $cc : $cflags : $unistd : $thread_cflag : $sys_id : $lflags : $bn_ops : $cpuid_obj : $bn_obj : $des_obj : $aes_obj : $bf_obj : $md5_obj : $sha1_obj : $cast_obj : $rc4_obj : $rmd160_obj : $rc5_obj : $wp_obj : $cmll_obj : $dso_scheme : $shared_target : $shared_cflag : $shared_ldflag : $shared_extension : $ranlib : $arflags : $multilib
|
||||||
|
|
||||||
my %table=(
|
my %table=(
|
||||||
# File 'TABLE' (created by 'make TABLE') contains the data from this list,
|
# File 'TABLE' (created by 'make TABLE') contains the data from this list,
|
||||||
@@ -176,37 +163,32 @@ my %table=(
|
|||||||
# Our development configs
|
# Our development configs
|
||||||
"purify", "purify gcc:-g -DPURIFY -Wall::(unknown)::-lsocket -lnsl::::",
|
"purify", "purify gcc:-g -DPURIFY -Wall::(unknown)::-lsocket -lnsl::::",
|
||||||
"debug", "gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DOPENSSL_NO_ASM -ggdb -g2 -Wformat -Wshadow -Wmissing-prototypes -Wmissing-declarations -Werror::(unknown)::-lefence::::",
|
"debug", "gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DOPENSSL_NO_ASM -ggdb -g2 -Wformat -Wshadow -Wmissing-prototypes -Wmissing-declarations -Werror::(unknown)::-lefence::::",
|
||||||
"debug-ben", "gcc:$gcc_devteam_warn -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DDEBUG_SAFESTACK -O2 -pipe::(unknown):::::",
|
"debug-ben", "gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DPEDANTIC -DDEBUG_SAFESTACK -DDEBUG_UNUSED -O2 -pedantic -Wall -Wshadow -Werror -pipe::(unknown):::::bn86-elf.o co86-elf.o",
|
||||||
"debug-ben-openbsd","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DPEDANTIC -DDEBUG_SAFESTACK -DOPENSSL_OPENBSD_DEV_CRYPTO -DOPENSSL_NO_ASM -O2 -pedantic -Wall -Wshadow -Werror -pipe::(unknown)::::",
|
"debug-ben-openbsd","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DPEDANTIC -DDEBUG_SAFESTACK -DOPENSSL_OPENBSD_DEV_CRYPTO -DOPENSSL_NO_ASM -O2 -pedantic -Wall -Wshadow -Werror -pipe::(unknown)::::",
|
||||||
"debug-ben-openbsd-debug","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DPEDANTIC -DDEBUG_SAFESTACK -DOPENSSL_OPENBSD_DEV_CRYPTO -DOPENSSL_NO_ASM -g3 -O2 -pedantic -Wall -Wshadow -Werror -pipe::(unknown)::::",
|
"debug-ben-openbsd-debug","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DPEDANTIC -DDEBUG_SAFESTACK -DOPENSSL_OPENBSD_DEV_CRYPTO -DOPENSSL_NO_ASM -g3 -O2 -pedantic -Wall -Wshadow -Werror -pipe::(unknown)::::",
|
||||||
"debug-ben-debug", "gcc44:$gcc_devteam_warn -DBN_DEBUG -DCONF_DEBUG -DDEBUG_SAFESTACK -DDEBUG_UNUSED -g3 -O2 -pipe::(unknown)::::::",
|
"debug-ben-debug", "gcc44:$gcc_devteam_warn -DBN_DEBUG -DCONF_DEBUG -DDEBUG_SAFESTACK -DDEBUG_UNUSED -g3 -O2 -pipe::(unknown)::::::",
|
||||||
"debug-ben-debug-64", "gcc:$gcc_devteam_warn -Wno-error=overlength-strings -DBN_DEBUG -DCONF_DEBUG -DDEBUG_SAFESTACK -DDEBUG_UNUSED -g3 -O3 -pipe::${BSDthreads}:::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
|
||||||
"debug-ben-macos", "cc:$gcc_devteam_warn -arch i386 -DBN_DEBUG -DCONF_DEBUG -DDEBUG_SAFESTACK -DDEBUG_UNUSED -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -O3 -DL_ENDIAN -g3 -pipe::(unknown)::-Wl,-search_paths_first::::",
|
|
||||||
"debug-ben-macos-gcc46", "gcc-mp-4.6:$gcc_devteam_warn -Wconversion -DBN_DEBUG -DCONF_DEBUG -DDEBUG_SAFESTACK -DDEBUG_UNUSED -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -O3 -DL_ENDIAN -g3 -pipe::(unknown)::::::",
|
|
||||||
"debug-ben-darwin64","cc:$gcc_devteam_warn -Wno-language-extension-token -Wno-extended-offsetof -arch x86_64 -O3 -DL_ENDIAN -Wall::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL:".eval{my $asm=$x86_64_asm;$asm=~s/rc4\-[^:]+//;$asm}.":macosx:dlfcn:darwin-shared:-fPIC -fno-common:-arch x86_64 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
|
|
||||||
"debug-ben-no-opt", "gcc: -Wall -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations -DDEBUG_SAFESTACK -DCRYPTO_MDEBUG -Werror -DL_ENDIAN -DTERMIOS -Wall -g3::(unknown)::::::",
|
"debug-ben-no-opt", "gcc: -Wall -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations -DDEBUG_SAFESTACK -DCRYPTO_MDEBUG -Werror -DL_ENDIAN -DTERMIOS -Wall -g3::(unknown)::::::",
|
||||||
"debug-ben-strict", "gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DCONST_STRICT -O2 -Wall -Wshadow -Werror -Wpointer-arith -Wcast-qual -Wwrite-strings -pipe::(unknown)::::::",
|
"debug-ben-strict", "gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DCONST_STRICT -O2 -Wall -Wshadow -Werror -Wpointer-arith -Wcast-qual -Wwrite-strings -pipe::(unknown)::::::",
|
||||||
"debug-rse","cc:-DTERMIOS -DL_ENDIAN -pipe -O -g -ggdb3 -Wall::(unknown):::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}",
|
"debug-rse","cc:-DTERMIOS -DL_ENDIAN -pipe -O -g -ggdb3 -Wall::(unknown):::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}",
|
||||||
"debug-bodo", "gcc:$gcc_devteam_warn -Wno-error=overlength-strings -DBN_DEBUG -DBN_DEBUG_RAND -DCONF_DEBUG -DBIO_PAIR_DEBUG -m64 -DL_ENDIAN -DTERMIO -g -DMD32_REG_T=int::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64",
|
"debug-bodo", "gcc:-DL_ENDIAN -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBIO_PAIR_DEBUG -DPEDANTIC -g -march=i486 -pedantic -Wshadow -Wall -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wundef -Wconversion::-D_REENTRANT:::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}",
|
||||||
"debug-ulf", "gcc:-DTERMIOS -DL_ENDIAN -march=i486 -Wall -DBN_DEBUG -DBN_DEBUG_RAND -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DOPENSSL_NO_ASM -g -Wformat -Wshadow -Wmissing-prototypes -Wmissing-declarations:::CYGWIN32:::${no_asm}:win32:cygwin-shared:::.dll",
|
"debug-ulf", "gcc:-DTERMIOS -DL_ENDIAN -march=i486 -Wall -DBN_DEBUG -DBN_DEBUG_RAND -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DOPENSSL_NO_ASM -g -Wformat -Wshadow -Wmissing-prototypes -Wmissing-declarations:::CYGWIN32:::${no_asm}:win32:cygwin-shared:::.dll",
|
||||||
"debug-steve64", "gcc:$gcc_devteam_warn -m64 -DL_ENDIAN -DTERMIO -DCONF_DEBUG -DDEBUG_SAFESTACK -Wno-overlength-strings -g::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
"debug-steve64", "gcc:$gcc_devteam_warn -m64 -DL_ENDIAN -DTERMIO -DCONF_DEBUG -DDEBUG_SAFESTACK -g -DMD32_REG_T=int::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
"debug-steve32", "gcc:$gcc_devteam_warn -m32 -DL_ENDIAN -DCONF_DEBUG -DDEBUG_SAFESTACK -g -pipe::-D_REENTRANT::-rdynamic -ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC:-m32:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
"debug-steve32", "gcc:$gcc_devteam_warn -m32 -DL_ENDIAN -DCONF_DEBUG -DDEBUG_SAFESTACK -g -pipe::-D_REENTRANT::-rdynamic -ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC:-m32:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
"debug-steve-opt", "gcc:$gcc_devteam_warn -m64 -O3 -DL_ENDIAN -DTERMIO -DCONF_DEBUG -DDEBUG_SAFESTACK -g::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
"debug-steve-opt", "gcc:$gcc_devteam_warn -m64 -O3 -DL_ENDIAN -DTERMIO -DCONF_DEBUG -DDEBUG_SAFESTACK -g -DMD32_REG_T=int::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
"debug-levitte-linux-elf","gcc:-DLEVITTE_DEBUG -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -ggdb -g3 -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
"debug-levitte-linux-elf","gcc:-DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_DEBUG -DBN_DEBUG_RAND -DCRYPTO_MDEBUG -DENGINE_CONF_DEBUG -DL_ENDIAN -DTERMIO -D_POSIX_SOURCE -DPEDANTIC -ggdb -g3 -mcpu=i486 -pedantic -ansi -Wall -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wundef -Wconversion -pipe::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
"debug-levitte-linux-noasm","gcc:-DLEVITTE_DEBUG -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -DOPENSSL_NO_ASM -DL_ENDIAN -ggdb -g3 -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
"debug-levitte-linux-noasm","gcc:-DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_DEBUG -DBN_DEBUG_RAND -DCRYPTO_MDEBUG -DENGINE_CONF_DEBUG -DOPENSSL_NO_ASM -DL_ENDIAN -DTERMIO -D_POSIX_SOURCE -DPEDANTIC -ggdb -g3 -mcpu=i486 -pedantic -ansi -Wall -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wundef -Wconversion -pipe::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
"debug-levitte-linux-elf-extreme","gcc:-DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_DEBUG -DBN_DEBUG_RAND -DCRYPTO_MDEBUG -DENGINE_CONF_DEBUG -DL_ENDIAN -DPEDANTIC -ggdb -g3 -pedantic -ansi -Wall -W -Wundef -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wundef -Wconversion -pipe::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
"debug-levitte-linux-elf-extreme","gcc:-DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_DEBUG -DBN_DEBUG_RAND -DCRYPTO_MDEBUG -DENGINE_CONF_DEBUG -DL_ENDIAN -DTERMIO -D_POSIX_SOURCE -DPEDANTIC -ggdb -g3 -mcpu=i486 -pedantic -ansi -Wall -W -Wundef -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wundef -Wconversion -pipe::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
"debug-levitte-linux-noasm-extreme","gcc:-DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_DEBUG -DBN_DEBUG_RAND -DCRYPTO_MDEBUG -DENGINE_CONF_DEBUG -DOPENSSL_NO_ASM -DL_ENDIAN -DPEDANTIC -ggdb -g3 -pedantic -ansi -Wall -W -Wundef -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wundef -Wconversion -pipe::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
"debug-levitte-linux-noasm-extreme","gcc:-DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_DEBUG -DBN_DEBUG_RAND -DCRYPTO_MDEBUG -DENGINE_CONF_DEBUG -DOPENSSL_NO_ASM -DL_ENDIAN -DTERMIO -D_POSIX_SOURCE -DPEDANTIC -ggdb -g3 -mcpu=i486 -pedantic -ansi -Wall -W -Wundef -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wundef -Wconversion -pipe::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
"debug-geoff32","gcc:-DBN_DEBUG -DBN_DEBUG_RAND -DBN_STRICT -DPURIFY -DOPENSSL_NO_DEPRECATED -DOPENSSL_NO_ASM -DOPENSSL_NO_INLINE_ASM -DL_ENDIAN -DTERMIO -DPEDANTIC -O1 -ggdb2 -Wall -Werror -Wundef -pedantic -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-align -Wsign-compare -Wmissing-prototypes -Wmissing-declarations -Wno-long-long::-D_REENTRANT::-ldl:BN_LLONG:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
"debug-geoff32","gcc:-DBN_DEBUG -DBN_DEBUG_RAND -DBN_STRICT -DPURIFY -DOPENSSL_NO_DEPRECATED -DOPENSSL_NO_ASM -DOPENSSL_NO_INLINE_ASM -DL_ENDIAN -DTERMIO -DPEDANTIC -DMD32_REG_T=int -O1 -ggdb2 -Wall -Werror -Wundef -pedantic -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-align -Wsign-compare -Wmissing-prototypes -Wmissing-declarations -Wno-long-long::-D_REENTRANT::-ldl:BN_LLONG:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
"debug-geoff64","gcc:-DBN_DEBUG -DBN_DEBUG_RAND -DBN_STRICT -DPURIFY -DOPENSSL_NO_DEPRECATED -DOPENSSL_NO_ASM -DOPENSSL_NO_INLINE_ASM -DL_ENDIAN -DTERMIO -DPEDANTIC -O1 -ggdb2 -Wall -Werror -Wundef -pedantic -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-align -Wsign-compare -Wmissing-prototypes -Wmissing-declarations -Wno-long-long::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
"debug-geoff64","gcc:-DBN_DEBUG -DBN_DEBUG_RAND -DBN_STRICT -DPURIFY -DOPENSSL_NO_DEPRECATED -DOPENSSL_NO_ASM -DOPENSSL_NO_INLINE_ASM -DL_ENDIAN -DTERMIO -DPEDANTIC -DMD32_REG_T=int -O1 -ggdb2 -Wall -Werror -Wundef -pedantic -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-align -Wsign-compare -Wmissing-prototypes -Wmissing-declarations -Wno-long-long::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
"debug-linux-pentium","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -g -mcpu=pentium -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn",
|
"debug-linux-pentium","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -DTERMIO -g -mcpu=pentium -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn",
|
||||||
"debug-linux-ppro","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -g -mcpu=pentiumpro -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn",
|
"debug-linux-ppro","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -DTERMIO -g -mcpu=pentiumpro -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn",
|
||||||
"debug-linux-elf","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -g -march=i486 -Wall::-D_REENTRANT::-lefence -ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
"debug-linux-elf","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -DTERMIO -g -march=i486 -Wall::-D_REENTRANT::-lefence -ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
"debug-linux-elf-noefence","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -g -march=i486 -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
"debug-linux-elf-noefence","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -DTERMIO -g -march=i486 -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
"debug-linux-ia32-aes", "gcc:-DAES_EXPERIMENTAL -DL_ENDIAN -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:x86cpuid.o:bn-586.o co-586.o x86-mont.o:des-586.o crypt586.o:aes_x86core.o aes_cbc.o aesni-x86.o:bf-586.o:md5-586.o:sha1-586.o sha256-586.o sha512-586.o:cast-586.o:rc4-586.o:rmd-586.o:rc5-586.o:wp_block.o wp-mmx.o::ghash-x86.o::elf:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
"debug-linux-ia32-aes", "gcc:-DAES_EXPERIMENTAL -DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:x86cpuid.o:bn-586.o co-586.o x86-mont.o:des-586.o crypt586.o:aes_x86core.o aes_cbc.o:bf-586.o:md5-586.o:sha1-586.o sha256-586.o sha512-586.o:cast-586.o:rc4-586.o:rmd-586.o:rc5-586.o:wp_block.o wp-mmx.o::elf:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
"debug-linux-generic32","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -g -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
"debug-linux-generic32","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -DTERMIO -g -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
"debug-linux-generic64","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -g -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
"debug-linux-generic64","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -DTERMIO -g -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
"debug-linux-x86_64","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -m64 -DL_ENDIAN -g -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64",
|
"debug-linux-x86_64", "gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -m64 -DL_ENDIAN -DTERMIO -g -Wall -DMD32_REG_T=int::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64",
|
||||||
"debug-linux-x86_64-clang","clang: -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -m64 -DL_ENDIAN -g -Wall -Qunused-arguments::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64",
|
|
||||||
"dist", "cc:-O::(unknown)::::::",
|
"dist", "cc:-O::(unknown)::::::",
|
||||||
|
|
||||||
# Basic configs that should work on any (32 and less bit) box
|
# Basic configs that should work on any (32 and less bit) box
|
||||||
@@ -232,7 +214,7 @@ my %table=(
|
|||||||
# actually recommend to consider using gcc shared build even with vendor
|
# actually recommend to consider using gcc shared build even with vendor
|
||||||
# compiler:-)
|
# compiler:-)
|
||||||
# <appro@fy.chalmers.se>
|
# <appro@fy.chalmers.se>
|
||||||
"solaris64-x86_64-gcc","gcc:-m64 -O3 -Wall -DL_ENDIAN::-D_REENTRANT::-lsocket -lnsl -ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:solaris-shared:-fPIC:-m64 -shared -static-libgcc:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::/64",
|
"solaris64-x86_64-gcc","gcc:-m64 -O3 -Wall -DL_ENDIAN -DMD32_REG_T=int::-D_REENTRANT::-lsocket -lnsl -ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:solaris-shared:-fPIC:-m64 -shared -static-libgcc:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::/64",
|
||||||
|
|
||||||
#### Solaris x86 with Sun C setups
|
#### Solaris x86 with Sun C setups
|
||||||
"solaris-x86-cc","cc:-fast -O -Xa::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_UNROLL BF_PTR:${no_asm}:dlfcn:solaris-shared:-KPIC:-G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
"solaris-x86-cc","cc:-fast -O -Xa::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_UNROLL BF_PTR:${no_asm}:dlfcn:solaris-shared:-KPIC:-G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
@@ -240,12 +222,12 @@ my %table=(
|
|||||||
|
|
||||||
#### SPARC Solaris with GNU C setups
|
#### SPARC Solaris with GNU C setups
|
||||||
"solaris-sparcv7-gcc","gcc:-O3 -fomit-frame-pointer -Wall -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${no_asm}:dlfcn:solaris-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
"solaris-sparcv7-gcc","gcc:-O3 -fomit-frame-pointer -Wall -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${no_asm}:dlfcn:solaris-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
"solaris-sparcv8-gcc","gcc:-mcpu=v8 -O3 -fomit-frame-pointer -Wall -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${sparcv8_asm}:dlfcn:solaris-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
"solaris-sparcv8-gcc","gcc:-mv8 -O3 -fomit-frame-pointer -Wall -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${sparcv8_asm}:dlfcn:solaris-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
# -m32 should be safe to add as long as driver recognizes -mcpu=ultrasparc
|
# -m32 should be safe to add as long as driver recognizes -mcpu=ultrasparc
|
||||||
"solaris-sparcv9-gcc","gcc:-m32 -mcpu=ultrasparc -O3 -fomit-frame-pointer -Wall -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${sparcv9_asm}:dlfcn:solaris-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
"solaris-sparcv9-gcc","gcc:-m32 -mcpu=ultrasparc -O3 -fomit-frame-pointer -Wall -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${sparcv9_asm}:dlfcn:solaris-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
"solaris64-sparcv9-gcc","gcc:-m64 -mcpu=ultrasparc -O3 -Wall -DB_ENDIAN::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL BF_PTR:${sparcv9_asm}:dlfcn:solaris-shared:-fPIC:-m64 -shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::/64",
|
"solaris64-sparcv9-gcc","gcc:-m64 -mcpu=ultrasparc -O3 -Wall -DB_ENDIAN::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL BF_PTR:${sparcv9_asm}:dlfcn:solaris-shared:-fPIC:-m64 -shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::/64",
|
||||||
####
|
####
|
||||||
"debug-solaris-sparcv8-gcc","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -O -g -mcpu=v8 -Wall -DB_ENDIAN::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${sparcv8_asm}:dlfcn:solaris-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
"debug-solaris-sparcv8-gcc","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -O -g -mv8 -Wall -DB_ENDIAN::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${sparcv8_asm}:dlfcn:solaris-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
"debug-solaris-sparcv9-gcc","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -DPEDANTIC -O -g -mcpu=ultrasparc -pedantic -ansi -Wall -Wshadow -Wno-long-long -D__EXTENSIONS__ -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${sparcv9_asm}:dlfcn:solaris-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
"debug-solaris-sparcv9-gcc","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -DPEDANTIC -O -g -mcpu=ultrasparc -pedantic -ansi -Wall -Wshadow -Wno-long-long -D__EXTENSIONS__ -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${sparcv9_asm}:dlfcn:solaris-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
|
|
||||||
#### SPARC Solaris with Sun C setups
|
#### SPARC Solaris with Sun C setups
|
||||||
@@ -255,27 +237,27 @@ my %table=(
|
|||||||
"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:${no_asm}:dlfcn:solaris-shared:-KPIC:-G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
"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:${no_asm}: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:${sparcv8_asm}: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:${sparcv8_asm}: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:${sparcv9_asm}: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:${sparcv9_asm}: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:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL BF_PTR:${sparcv9_asm}:dlfcn:solaris-shared:-KPIC:-xarch=v9 -G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::/64",
|
"solaris64-sparcv9-cc","cc:-xtarget=ultra -xarch=v9 -xO5 -xstrconst -xdepend -Xa -DB_ENDIAN::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL BF_PTR:${sparcv9_asm}:dlfcn:solaris-shared:-KPIC:-xarch=v9 -G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):/usr/ccs/bin/ar rs::/64",
|
||||||
####
|
####
|
||||||
"debug-solaris-sparcv8-cc","cc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -xarch=v8 -g -O -xstrconst -Xa -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_RISC1 DES_UNROLL BF_PTR:${sparcv8_asm}:dlfcn:solaris-shared:-KPIC:-G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
"debug-solaris-sparcv8-cc","cc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -xarch=v8 -g -O -xstrconst -Xa -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_RISC1 DES_UNROLL BF_PTR:${sparcv8_asm}:dlfcn:solaris-shared:-KPIC:-G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
"debug-solaris-sparcv9-cc","cc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -xtarget=ultra -xarch=v8plus -g -O -xstrconst -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:${sparcv9_asm}:dlfcn:solaris-shared:-KPIC:-G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
"debug-solaris-sparcv9-cc","cc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -xtarget=ultra -xarch=v8plus -g -O -xstrconst -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:${sparcv9_asm}:dlfcn:solaris-shared:-KPIC:-G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
|
|
||||||
#### SunOS configs, assuming sparc for the gcc one.
|
#### SunOS configs, assuming sparc for the gcc one.
|
||||||
#"sunos-cc", "cc:-O4 -DNOPROTO -DNOCONST::(unknown):SUNOS::DES_UNROLL:${no_asm}::",
|
#"sunos-cc", "cc:-O4 -DNOPROTO -DNOCONST::(unknown):SUNOS::DES_UNROLL:${no_asm}::",
|
||||||
"sunos-gcc","gcc:-O3 -mcpu=v8 -Dssize_t=int::(unknown):SUNOS::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL DES_PTR DES_RISC1:${no_asm}::",
|
"sunos-gcc","gcc:-O3 -mv8 -Dssize_t=int::(unknown):SUNOS::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL DES_PTR DES_RISC1:${no_asm}::",
|
||||||
|
|
||||||
#### IRIX 5.x configs
|
#### IRIX 5.x configs
|
||||||
# -mips2 flag is added by ./config when appropriate.
|
# -mips2 flag is added by ./config when appropriate.
|
||||||
"irix-gcc","gcc:-O3 -DB_ENDIAN::(unknown):::BN_LLONG MD2_CHAR RC4_INDEX RC4_CHAR RC4_CHUNK DES_UNROLL DES_RISC2 DES_PTR BF_PTR:${mips32_asm}:o32:dlfcn:irix-shared:::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
"irix-gcc","gcc:-O3 -DTERMIOS -DB_ENDIAN::(unknown):::BN_LLONG MD2_CHAR RC4_INDEX RC4_CHAR RC4_CHUNK DES_UNROLL DES_RISC2 DES_PTR BF_PTR:${no_asm}:dlfcn:irix-shared:::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
"irix-cc", "cc:-O2 -use_readonly_const -DB_ENDIAN::(unknown):::BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_RISC2 DES_UNROLL BF_PTR:${mips32_asm}:o32:dlfcn:irix-shared:::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
"irix-cc", "cc:-O2 -use_readonly_const -DTERMIOS -DB_ENDIAN::(unknown):::BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_RISC2 DES_UNROLL BF_PTR:${no_asm}:dlfcn:irix-shared:::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
#### IRIX 6.x configs
|
#### IRIX 6.x configs
|
||||||
# Only N32 and N64 ABIs are supported. If you need O32 ABI build, invoke
|
# Only N32 and N64 ABIs are supported. If you need O32 ABI build, invoke
|
||||||
# './Configure irix-cc -o32' manually.
|
# './Configure irix-cc -o32' manually.
|
||||||
"irix-mips3-gcc","gcc:-mabi=n32 -O3 -DB_ENDIAN -DBN_DIV3W::-D_SGI_MP_SOURCE:::MD2_CHAR RC4_INDEX RC4_CHAR RC4_CHUNK_LL DES_UNROLL DES_RISC2 DES_PTR BF_PTR SIXTY_FOUR_BIT:${mips64_asm}:n32:dlfcn:irix-shared::-mabi=n32:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::32",
|
"irix-mips3-gcc","gcc:-mabi=n32 -O3 -DTERMIOS -DB_ENDIAN -DBN_DIV3W::-D_SGI_MP_SOURCE:::MD2_CHAR RC4_INDEX RC4_CHAR RC4_CHUNK_LL DES_UNROLL DES_RISC2 DES_PTR BF_PTR SIXTY_FOUR_BIT:${mips3_asm}:dlfcn:irix-shared::-mabi=n32:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::32",
|
||||||
"irix-mips3-cc", "cc:-n32 -mips3 -O2 -use_readonly_const -G0 -rdata_shared -DB_ENDIAN -DBN_DIV3W::-D_SGI_MP_SOURCE:::DES_PTR RC4_CHAR RC4_CHUNK_LL DES_RISC2 DES_UNROLL BF_PTR SIXTY_FOUR_BIT:${mips64_asm}:n32:dlfcn:irix-shared::-n32:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::32",
|
"irix-mips3-cc", "cc:-n32 -mips3 -O2 -use_readonly_const -G0 -rdata_shared -DTERMIOS -DB_ENDIAN -DBN_DIV3W::-D_SGI_MP_SOURCE:::DES_PTR RC4_CHAR RC4_CHUNK_LL DES_RISC2 DES_UNROLL BF_PTR SIXTY_FOUR_BIT:${mips3_asm}:dlfcn:irix-shared::-n32:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::32",
|
||||||
# N64 ABI builds.
|
# N64 ABI builds.
|
||||||
"irix64-mips4-gcc","gcc:-mabi=64 -mips4 -O3 -DB_ENDIAN -DBN_DIV3W::-D_SGI_MP_SOURCE:::RC4_CHAR RC4_CHUNK DES_RISC2 DES_UNROLL SIXTY_FOUR_BIT_LONG:${mips64_asm}:64:dlfcn:irix-shared::-mabi=64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64",
|
"irix64-mips4-gcc","gcc:-mabi=64 -mips4 -O3 -DTERMIOS -DB_ENDIAN -DBN_DIV3W::-D_SGI_MP_SOURCE:::RC4_CHAR RC4_CHUNK DES_RISC2 DES_UNROLL SIXTY_FOUR_BIT_LONG:${mips3_asm}:dlfcn:irix-shared::-mabi=64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64",
|
||||||
"irix64-mips4-cc", "cc:-64 -mips4 -O2 -use_readonly_const -G0 -rdata_shared -DB_ENDIAN -DBN_DIV3W::-D_SGI_MP_SOURCE:::RC4_CHAR RC4_CHUNK DES_RISC2 DES_UNROLL SIXTY_FOUR_BIT_LONG:${mips64_asm}:64:dlfcn:irix-shared::-64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64",
|
"irix64-mips4-cc", "cc:-64 -mips4 -O2 -use_readonly_const -G0 -rdata_shared -DTERMIOS -DB_ENDIAN -DBN_DIV3W::-D_SGI_MP_SOURCE:::RC4_CHAR RC4_CHUNK DES_RISC2 DES_UNROLL SIXTY_FOUR_BIT_LONG:${mips3_asm}:dlfcn:irix-shared::-64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64",
|
||||||
|
|
||||||
#### Unified HP-UX ANSI C configs.
|
#### Unified HP-UX ANSI C configs.
|
||||||
# Special notes:
|
# Special notes:
|
||||||
@@ -308,18 +290,17 @@ my %table=(
|
|||||||
# Since there is mention of this in shlib/hpux10-cc.sh
|
# Since there is mention of this in shlib/hpux10-cc.sh
|
||||||
"hpux-parisc-cc-o4","cc:-Ae +O4 +ESlit -z -DB_ENDIAN -DBN_DIV2W -DMD32_XARRAY::-D_REENTRANT::-ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1:${no_asm}:dl:hpux-shared:+Z:-b:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
"hpux-parisc-cc-o4","cc:-Ae +O4 +ESlit -z -DB_ENDIAN -DBN_DIV2W -DMD32_XARRAY::-D_REENTRANT::-ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1:${no_asm}:dl:hpux-shared:+Z:-b:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
"hpux-parisc-gcc","gcc:-O3 -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT::-Wl,+s -ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1:${no_asm}:dl:hpux-shared:-fPIC:-shared:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
"hpux-parisc-gcc","gcc:-O3 -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT::-Wl,+s -ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1:${no_asm}:dl:hpux-shared:-fPIC:-shared:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
"hpux-parisc1_1-gcc","gcc:-O3 -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT::-Wl,+s -ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1:${parisc11_asm}:dl:hpux-shared:-fPIC:-shared:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::/pa1.1",
|
"hpux-parisc2-gcc","gcc:-march=2.0 -O3 -DB_ENDIAN -D_REENTRANT::::-Wl,+s -ldld:SIXTY_FOUR_BIT RC4_CHAR RC4_CHUNK DES_PTR DES_UNROLL DES_RISC1::pa-risc2.o::::::::::::void:dl:hpux-shared:-fPIC:-shared:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
"hpux-parisc2-gcc","gcc:-march=2.0 -O3 -DB_ENDIAN -D_REENTRANT::::-Wl,+s -ldld:SIXTY_FOUR_BIT RC4_CHAR RC4_CHUNK DES_PTR DES_UNROLL DES_RISC1:".eval{my $asm=$parisc20_asm;$asm=~s/2W\./2\./;$asm=~s/:64/:32/;$asm}.":dl:hpux-shared:-fPIC:-shared:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::/pa20_32",
|
"hpux64-parisc2-gcc","gcc:-O3 -DB_ENDIAN -D_REENTRANT::::-ldl:SIXTY_FOUR_BIT_LONG MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT::pa-risc2W.o::::::::::::void:dlfcn:hpux-shared:-fpic:-shared:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::/pa20_64",
|
||||||
"hpux64-parisc2-gcc","gcc:-O3 -DB_ENDIAN -D_REENTRANT::::-ldl:SIXTY_FOUR_BIT_LONG MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT::pa-risc2W.o::::::::::::::void:dlfcn:hpux-shared:-fpic:-shared:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::/pa20_64",
|
|
||||||
|
|
||||||
# More attempts at unified 10.X and 11.X targets for HP C compiler.
|
# More attempts at unified 10.X and 11.X targets for HP C compiler.
|
||||||
#
|
#
|
||||||
# Chris Ruemmler <ruemmler@cup.hp.com>
|
# Chris Ruemmler <ruemmler@cup.hp.com>
|
||||||
# Kevin Steves <ks@hp.se>
|
# Kevin Steves <ks@hp.se>
|
||||||
"hpux-parisc-cc","cc:+O3 +Optrs_strongly_typed -Ae +ESlit -DB_ENDIAN -DBN_DIV2W -DMD32_XARRAY::-D_REENTRANT::-Wl,+s -ldld:MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT:${no_asm}:dl:hpux-shared:+Z:-b:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
"hpux-parisc-cc","cc:+O3 +Optrs_strongly_typed -Ae +ESlit -DB_ENDIAN -DBN_DIV2W -DMD32_XARRAY::-D_REENTRANT::-Wl,+s -ldld:MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT:${no_asm}:dl:hpux-shared:+Z:-b:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
"hpux-parisc1_1-cc","cc:+DA1.1 +O3 +Optrs_strongly_typed -Ae +ESlit -DB_ENDIAN -DMD32_XARRAY::-D_REENTRANT::-Wl,+s -ldld:MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT:${parisc11_asm}:dl:hpux-shared:+Z:-b:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::/pa1.1",
|
"hpux-parisc1_0-cc","cc:+DAportable +O3 +Optrs_strongly_typed -Ae +ESlit -DB_ENDIAN -DMD32_XARRAY::-D_REENTRANT::-Wl,+s -ldld:MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT:${no_asm}:dl:hpux-shared:+Z:-b:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
"hpux-parisc2-cc","cc:+DA2.0 +DS2.0 +O3 +Optrs_strongly_typed -Ae +ESlit -DB_ENDIAN -DMD32_XARRAY -D_REENTRANT::::-Wl,+s -ldld:SIXTY_FOUR_BIT MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT:".eval{my $asm=$parisc20_asm;$asm=~s/2W\./2\./;$asm=~s/:64/:32/;$asm}.":dl:hpux-shared:+Z:-b:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::/pa20_32",
|
"hpux-parisc2-cc","cc:+DA2.0 +DS2.0 +O3 +Optrs_strongly_typed -Ae +ESlit -DB_ENDIAN -DMD32_XARRAY -D_REENTRANT::::-Wl,+s -ldld:SIXTY_FOUR_BIT MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT::pa-risc2.o::::::::::::void:dl:hpux-shared:+Z:-b:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
"hpux64-parisc2-cc","cc:+DD64 +O3 +Optrs_strongly_typed -Ae +ESlit -DB_ENDIAN -DMD32_XARRAY -D_REENTRANT::::-ldl:SIXTY_FOUR_BIT_LONG MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT:${parisc20_asm}:dlfcn:hpux-shared:+Z:+DD64 -b:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::/pa20_64",
|
"hpux64-parisc2-cc","cc:+DD64 +O3 +Optrs_strongly_typed -Ae +ESlit -DB_ENDIAN -DMD32_XARRAY -D_REENTRANT::::-ldl:SIXTY_FOUR_BIT_LONG MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT::pa-risc2W.o::::::::::::void:dlfcn:hpux-shared:+Z:+DD64 -b:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::/pa20_64",
|
||||||
|
|
||||||
# HP/UX IA-64 targets
|
# HP/UX IA-64 targets
|
||||||
"hpux-ia64-cc","cc:-Ae +DD32 +O2 +Olit=all -z -DB_ENDIAN -D_REENTRANT::::-ldl:SIXTY_FOUR_BIT MD2_CHAR RC4_INDEX DES_UNROLL DES_RISC1 DES_INT:${ia64_asm}:dlfcn:hpux-shared:+Z:+DD32 -b:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::/hpux32",
|
"hpux-ia64-cc","cc:-Ae +DD32 +O2 +Olit=all -z -DB_ENDIAN -D_REENTRANT::::-ldl:SIXTY_FOUR_BIT MD2_CHAR RC4_INDEX DES_UNROLL DES_RISC1 DES_INT:${ia64_asm}:dlfcn:hpux-shared:+Z:+DD32 -b:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::/hpux32",
|
||||||
@@ -355,47 +336,32 @@ my %table=(
|
|||||||
####
|
####
|
||||||
# *-generic* is endian-neutral target, but ./config is free to
|
# *-generic* is endian-neutral target, but ./config is free to
|
||||||
# throw in -D[BL]_ENDIAN, whichever appropriate...
|
# throw in -D[BL]_ENDIAN, whichever appropriate...
|
||||||
"linux-generic32","gcc:-O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
"linux-generic32","gcc:-DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
"linux-ppc", "gcc:-DB_ENDIAN -O3 -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_RISC1 DES_UNROLL:${ppc32_asm}:linux32:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
"linux-ppc", "gcc:-DB_ENDIAN -DTERMIO -O3 -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_RISC1 DES_UNROLL:${ppc32_asm}:linux32:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
# It's believed that majority of ARM toolchains predefine appropriate -march.
|
# It's believed that majority of ARM toolchains predefine appropriate -march.
|
||||||
# If you compiler does not, do complement config command line with one!
|
# If you compiler does not, do complement config command line with one!
|
||||||
"linux-armv4", "gcc:-O3 -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${armv4_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
"linux-armv4", "gcc:-DTERMIO -O3 -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${armv4_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
#### IA-32 targets...
|
#### IA-32 targets...
|
||||||
"linux-ia32-icc", "icc:-DL_ENDIAN -O2 -no_cpprt::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-KPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
"linux-ia32-icc", "icc:-DL_ENDIAN -DTERMIO -O2 -no_cpprt::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-KPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
"linux-elf", "gcc:-DL_ENDIAN -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
"linux-elf", "gcc:-DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
"linux-aout", "gcc:-DL_ENDIAN -O3 -fomit-frame-pointer -march=i486 -Wall::(unknown):::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_asm}:a.out",
|
"linux-aout", "gcc:-DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -march=i486 -Wall::(unknown):::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_asm}:a.out",
|
||||||
####
|
####
|
||||||
"linux-generic64","gcc:-O3 -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
"linux-generic64","gcc:-DTERMIO -O3 -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
"linux-ppc64", "gcc:-m64 -DB_ENDIAN -O3 -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_RISC1 DES_UNROLL:${ppc64_asm}:linux64:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64",
|
"linux-ppc64", "gcc:-m64 -DB_ENDIAN -DTERMIO -O3 -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_RISC1 DES_UNROLL:${ppc64_asm}:linux64:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64",
|
||||||
"linux-ia64", "gcc:-DL_ENDIAN -O3 -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_UNROLL DES_INT:${ia64_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
"linux-ia64", "gcc:-DL_ENDIAN -DTERMIO -O3 -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_UNROLL DES_INT:${ia64_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
"linux-ia64-ecc","ecc:-DL_ENDIAN -O2 -Wall -no_cpprt::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT:${ia64_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
"linux-ia64-ecc","ecc:-DL_ENDIAN -DTERMIO -O2 -Wall -no_cpprt::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT:${ia64_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
"linux-ia64-icc","icc:-DL_ENDIAN -O2 -Wall -no_cpprt::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_RISC1 DES_INT:${ia64_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
"linux-ia64-icc","icc:-DL_ENDIAN -DTERMIO -O2 -Wall -no_cpprt::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_RISC1 DES_INT:${ia64_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
"linux-x86_64", "gcc:-m64 -DL_ENDIAN -O3 -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64",
|
"linux-x86_64", "gcc:-m64 -DL_ENDIAN -DTERMIO -O3 -Wall -DMD32_REG_T=int::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64",
|
||||||
"linux-x86_64-clang","clang: -m64 -DL_ENDIAN -O3 -Wall -Qunused-arguments::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64",
|
"linux-s390x", "gcc:-m64 -DB_ENDIAN -DTERMIO -O3 -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL:${s390x_asm}:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64",
|
||||||
"linux64-s390x", "gcc:-m64 -DB_ENDIAN -O3 -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL:${s390x_asm}:64:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64",
|
|
||||||
#### So called "highgprs" target for z/Architecture CPUs
|
|
||||||
# "Highgprs" is kernel feature first implemented in Linux 2.6.32, see
|
|
||||||
# /proc/cpuinfo. The idea is to preserve most significant bits of
|
|
||||||
# general purpose registers not only upon 32-bit process context
|
|
||||||
# switch, but even on asynchronous signal delivery to such process.
|
|
||||||
# This makes it possible to deploy 64-bit instructions even in legacy
|
|
||||||
# application context and achieve better [or should we say adequate]
|
|
||||||
# performance. The build is binary compatible with linux-generic32,
|
|
||||||
# and the idea is to be able to install the resulting libcrypto.so
|
|
||||||
# alongside generic one, e.g. as /lib/highgprs/libcrypto.so.x.y, for
|
|
||||||
# ldconfig and run-time linker to autodiscover. Unfortunately it
|
|
||||||
# doesn't work just yet, because of couple of bugs in glibc
|
|
||||||
# sysdeps/s390/dl-procinfo.c affecting ldconfig and ld.so.1...
|
|
||||||
"linux32-s390x", "gcc:-m31 -Wa,-mzarch -DB_ENDIAN -O3 -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL:".eval{my $asm=$s390x_asm;$asm=~s/bn\-s390x\.o/bn_asm.o/;$asm}.":31:dlfcn:linux-shared:-fPIC:-m31:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::/highgprs",
|
|
||||||
#### SPARC Linux setups
|
#### SPARC Linux setups
|
||||||
# Ray Miller <ray.miller@computing-services.oxford.ac.uk> has patiently
|
# Ray Miller <ray.miller@computing-services.oxford.ac.uk> has patiently
|
||||||
# assisted with debugging of following two configs.
|
# assisted with debugging of following two configs.
|
||||||
"linux-sparcv8","gcc:-mcpu=v8 -DB_ENDIAN -O3 -fomit-frame-pointer -Wall -DBN_DIV2W::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${sparcv8_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
"linux-sparcv8","gcc:-mv8 -DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall -DBN_DIV2W::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${sparcv8_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
# it's a real mess with -mcpu=ultrasparc option under Linux, but
|
# it's a real mess with -mcpu=ultrasparc option under Linux, but
|
||||||
# -Wa,-Av8plus should do the trick no matter what.
|
# -Wa,-Av8plus should do the trick no matter what.
|
||||||
"linux-sparcv9","gcc:-m32 -mcpu=ultrasparc -DB_ENDIAN -O3 -fomit-frame-pointer -Wall -Wa,-Av8plus -DBN_DIV2W::-D_REENTRANT:ULTRASPARC:-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${sparcv9_asm}:dlfcn:linux-shared:-fPIC:-m32:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
"linux-sparcv9","gcc:-m32 -mcpu=ultrasparc -DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall -Wa,-Av8plus -DBN_DIV2W::-D_REENTRANT:ULTRASPARC:-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${sparcv9_asm}:dlfcn:linux-shared:-fPIC:-m32:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
# GCC 3.1 is a requirement
|
# GCC 3.1 is a requirement
|
||||||
"linux64-sparcv9","gcc:-m64 -mcpu=ultrasparc -DB_ENDIAN -O3 -fomit-frame-pointer -Wall::-D_REENTRANT:ULTRASPARC:-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL BF_PTR:${sparcv9_asm}:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64",
|
"linux64-sparcv9","gcc:-m64 -mcpu=ultrasparc -DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT:ULTRASPARC:-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL BF_PTR:${sparcv9_asm}:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64",
|
||||||
#### Alpha Linux with GNU C and Compaq C setups
|
#### Alpha Linux with GNU C and Compaq C setups
|
||||||
# Special notes:
|
# Special notes:
|
||||||
# - linux-alpha+bwx-gcc is ment to be used from ./config only. If you
|
# - linux-alpha+bwx-gcc is ment to be used from ./config only. If you
|
||||||
@@ -409,30 +375,25 @@ my %table=(
|
|||||||
#
|
#
|
||||||
# <appro@fy.chalmers.se>
|
# <appro@fy.chalmers.se>
|
||||||
#
|
#
|
||||||
"linux-alpha-gcc","gcc:-O3 -DL_ENDIAN::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_RISC1 DES_UNROLL:${alpha_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
"linux-alpha-gcc","gcc:-O3 -DL_ENDIAN -DTERMIO::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_RISC1 DES_UNROLL:${alpha_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
"linux-alpha+bwx-gcc","gcc:-O3 -DL_ENDIAN::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_RISC1 DES_UNROLL:${alpha_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
"linux-alpha+bwx-gcc","gcc:-O3 -DL_ENDIAN -DTERMIO::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_RISC1 DES_UNROLL:${alpha_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
"linux-alpha-ccc","ccc:-fast -readonly_strings -DL_ENDIAN::-D_REENTRANT:::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL:${alpha_asm}",
|
"linux-alpha-ccc","ccc:-fast -readonly_strings -DL_ENDIAN -DTERMIO::-D_REENTRANT:::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL:${alpha_asm}",
|
||||||
"linux-alpha+bwx-ccc","ccc:-fast -readonly_strings -DL_ENDIAN::-D_REENTRANT:::SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL:${alpha_asm}",
|
"linux-alpha+bwx-ccc","ccc:-fast -readonly_strings -DL_ENDIAN -DTERMIO::-D_REENTRANT:::SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL:${alpha_asm}",
|
||||||
|
|
||||||
# Android: linux-* but without pointers to headers and libs.
|
|
||||||
"android","gcc:-mandroid -I\$(ANDROID_DEV)/include -B\$(ANDROID_DEV)/lib -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
|
||||||
"android-x86","gcc:-mandroid -I\$(ANDROID_DEV)/include -B\$(ANDROID_DEV)/lib -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:".eval{my $asm=${x86_elf_asm};$asm=~s/:elf/:android/;$asm}.":dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
|
||||||
"android-armv7","gcc:-march=armv7-a -mandroid -I\$(ANDROID_DEV)/include -B\$(ANDROID_DEV)/lib -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${armv4_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
|
||||||
|
|
||||||
#### *BSD [do see comment about ${BSDthreads} above!]
|
#### *BSD [do see comment about ${BSDthreads} above!]
|
||||||
"BSD-generic32","gcc:-O3 -fomit-frame-pointer -Wall::${BSDthreads}:::BN_LLONG RC2_CHAR RC4_INDEX DES_INT DES_UNROLL:${no_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
"BSD-generic32","gcc:-DTERMIOS -O3 -fomit-frame-pointer -Wall::${BSDthreads}:::BN_LLONG RC2_CHAR RC4_INDEX DES_INT DES_UNROLL:${no_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
"BSD-x86", "gcc:-DL_ENDIAN -O3 -fomit-frame-pointer -Wall::${BSDthreads}:::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_asm}:a.out:dlfcn:bsd-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
"BSD-x86", "gcc:-DL_ENDIAN -DTERMIOS -O3 -fomit-frame-pointer -Wall::${BSDthreads}:::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_asm}:a.out:dlfcn:bsd-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
"BSD-x86-elf", "gcc:-DL_ENDIAN -O3 -fomit-frame-pointer -Wall::${BSDthreads}:::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:bsd-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
"BSD-x86-elf", "gcc:-DL_ENDIAN -DTERMIOS -O3 -fomit-frame-pointer -Wall::${BSDthreads}:::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:bsd-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
"debug-BSD-x86-elf", "gcc:-DL_ENDIAN -O3 -Wall -g::${BSDthreads}:::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:bsd-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
"debug-BSD-x86-elf", "gcc:-DL_ENDIAN -DTERMIOS -O3 -Wall -g::${BSDthreads}:::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:bsd-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
"BSD-sparcv8", "gcc:-DB_ENDIAN -O3 -mcpu=v8 -Wall::${BSDthreads}:::BN_LLONG RC2_CHAR RC4_INDEX DES_INT DES_UNROLL:${sparcv8_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
"BSD-sparcv8", "gcc:-DB_ENDIAN -DTERMIOS -O3 -mv8 -Wall::${BSDthreads}:::BN_LLONG RC2_CHAR RC4_INDEX DES_INT DES_UNROLL:${sparcv8_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
|
|
||||||
"BSD-generic64","gcc:-O3 -Wall::${BSDthreads}:::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${no_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
"BSD-generic64","gcc:-DTERMIOS -O3 -Wall::${BSDthreads}:::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${no_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
# -DMD32_REG_T=int doesn't actually belong in sparc64 target, it
|
# -DMD32_REG_T=int doesn't actually belong in sparc64 target, it
|
||||||
# simply *happens* to work around a compiler bug in gcc 3.3.3,
|
# simply *happens* to work around a compiler bug in gcc 3.3.3,
|
||||||
# triggered by RIPEMD160 code.
|
# triggered by RIPEMD160 code.
|
||||||
"BSD-sparc64", "gcc:-DB_ENDIAN -O3 -DMD32_REG_T=int -Wall::${BSDthreads}:::BN_LLONG RC2_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC2 BF_PTR:${sparcv9_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
"BSD-sparc64", "gcc:-DB_ENDIAN -DTERMIOS -O3 -DMD32_REG_T=int -Wall::${BSDthreads}:::BN_LLONG RC2_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC2 BF_PTR:${sparcv9_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
"BSD-ia64", "gcc:-DL_ENDIAN -O3 -Wall::${BSDthreads}:::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_UNROLL DES_INT:${ia64_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
"BSD-ia64", "gcc:-DL_ENDIAN -DTERMIOS -O3 -Wall::${BSDthreads}:::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_UNROLL DES_INT:${ia64_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
"BSD-x86_64", "gcc:-DL_ENDIAN -O3 -Wall::${BSDthreads}:::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
"BSD-x86_64", "gcc:-DL_ENDIAN -DTERMIOS -O3 -DMD32_REG_T=int -Wall::${BSDthreads}:::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
|
|
||||||
"bsdi-elf-gcc", "gcc:-DPERL5 -DL_ENDIAN -fomit-frame-pointer -O3 -march=i486 -Wall::(unknown)::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
"bsdi-elf-gcc", "gcc:-DPERL5 -DL_ENDIAN -fomit-frame-pointer -O3 -march=i486 -Wall::(unknown)::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
|
|
||||||
@@ -444,8 +405,8 @@ my %table=(
|
|||||||
|
|
||||||
# QNX
|
# QNX
|
||||||
"qnx4", "cc:-DL_ENDIAN -DTERMIO::(unknown):::${x86_gcc_des} ${x86_gcc_opts}:",
|
"qnx4", "cc:-DL_ENDIAN -DTERMIO::(unknown):::${x86_gcc_des} ${x86_gcc_opts}:",
|
||||||
"QNX6", "gcc:::::-lsocket::${no_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
"QNX6", "gcc:-DTERMIOS::::-lsocket::${no_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
"QNX6-i386", "gcc:-DL_ENDIAN -O2 -Wall::::-lsocket:${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
"QNX6-i386", "gcc:-DL_ENDIAN -DTERMIOS -O2 -Wall::::-lsocket:${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
|
|
||||||
# BeOS
|
# BeOS
|
||||||
"beos-x86-r5", "gcc:-DL_ENDIAN -DTERMIOS -O3 -fomit-frame-pointer -mcpu=pentium -Wall::-D_REENTRANT:BEOS:-lbe -lnet:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:beos:beos-shared:-fPIC -DPIC:-shared:.so",
|
"beos-x86-r5", "gcc:-DL_ENDIAN -DTERMIOS -O3 -fomit-frame-pointer -mcpu=pentium -Wall::-D_REENTRANT:BEOS:-lbe -lnet:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:beos:beos-shared:-fPIC -DPIC:-shared:.so",
|
||||||
@@ -477,8 +438,8 @@ my %table=(
|
|||||||
"aix64-gcc","gcc:-maix64 -O -DB_ENDIAN::-pthread:AIX::SIXTY_FOUR_BIT_LONG RC4_CHAR:${ppc64_asm}:aix64:dlfcn:aix-shared::-maix64 -shared -Wl,-G:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)::-X64",
|
"aix64-gcc","gcc:-maix64 -O -DB_ENDIAN::-pthread:AIX::SIXTY_FOUR_BIT_LONG RC4_CHAR:${ppc64_asm}:aix64:dlfcn:aix-shared::-maix64 -shared -Wl,-G:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)::-X64",
|
||||||
# Below targets assume AIX 5. Idea is to effectively disregard $OBJECT_MODE
|
# Below targets assume AIX 5. Idea is to effectively disregard $OBJECT_MODE
|
||||||
# at build time. $OBJECT_MODE is respected at ./config stage!
|
# at build time. $OBJECT_MODE is respected at ./config stage!
|
||||||
"aix-cc", "cc:-q32 -O -DB_ENDIAN -qmaxmem=16384 -qro -qroconst::-qthreaded -D_THREAD_SAFE:AIX::BN_LLONG RC4_CHAR:${ppc32_asm}:aix32:dlfcn:aix-shared::-q32 -G:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)::-X 32",
|
"aix-cc", "cc:-q32 -O -DB_ENDIAN -qmaxmem=16384 -qro -qroconst::-qthreaded:AIX::BN_LLONG RC4_CHAR:${ppc32_asm}:aix32:dlfcn:aix-shared::-q32 -G:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)::-X 32",
|
||||||
"aix64-cc", "cc:-q64 -O -DB_ENDIAN -qmaxmem=16384 -qro -qroconst::-qthreaded -D_THREAD_SAFE:AIX::SIXTY_FOUR_BIT_LONG RC4_CHAR:${ppc64_asm}:aix64:dlfcn:aix-shared::-q64 -G:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)::-X 64",
|
"aix64-cc", "cc:-q64 -O -DB_ENDIAN -qmaxmem=16384 -qro -qroconst::-qthreaded:AIX::SIXTY_FOUR_BIT_LONG RC4_CHAR:${ppc64_asm}:aix64:dlfcn:aix-shared::-q64 -G:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)::-X 64",
|
||||||
|
|
||||||
#
|
#
|
||||||
# Cray T90 and similar (SDSC)
|
# Cray T90 and similar (SDSC)
|
||||||
@@ -518,7 +479,7 @@ my %table=(
|
|||||||
"SINIX-N","/usr/ucb/cc:-O2 -misaligned::(unknown)::-lucb:RC4_INDEX RC4_CHAR:::",
|
"SINIX-N","/usr/ucb/cc:-O2 -misaligned::(unknown)::-lucb:RC4_INDEX RC4_CHAR:::",
|
||||||
|
|
||||||
# SIEMENS BS2000/OSD: an EBCDIC-based mainframe
|
# SIEMENS BS2000/OSD: an EBCDIC-based mainframe
|
||||||
"BS2000-OSD","c89:-O -XLLML -XLLMK -XL -DB_ENDIAN -DCHARSET_EBCDIC::(unknown)::-lsocket -lnsl:THIRTY_TWO_BIT DES_PTR DES_UNROLL MD2_CHAR RC4_INDEX RC4_CHAR BF_PTR:::",
|
"BS2000-OSD","c89:-O -XLLML -XLLMK -XL -DB_ENDIAN -DTERMIOS -DCHARSET_EBCDIC::(unknown)::-lsocket -lnsl:THIRTY_TWO_BIT DES_PTR DES_UNROLL MD2_CHAR RC4_INDEX RC4_CHAR BF_PTR:::",
|
||||||
|
|
||||||
# OS/390 Unix an EBCDIC-based Unix system on IBM mainframe
|
# OS/390 Unix an EBCDIC-based Unix system on IBM mainframe
|
||||||
# You need to compile using the c89.sh wrapper in the tools directory, because the
|
# You need to compile using the c89.sh wrapper in the tools directory, because the
|
||||||
@@ -529,15 +490,15 @@ my %table=(
|
|||||||
# Visual C targets
|
# Visual C targets
|
||||||
#
|
#
|
||||||
# Win64 targets, WIN64I denotes IA-64 and WIN64A - AMD64
|
# Win64 targets, WIN64I denotes IA-64 and WIN64A - AMD64
|
||||||
"VC-WIN64I","cl:-W3 -Gs0 -Gy -nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -DUNICODE -D_UNICODE -D_CRT_SECURE_NO_DEPRECATE:::WIN64I::SIXTY_FOUR_BIT RC4_CHUNK_LL DES_INT EXPORT_VAR_AS_FN:ia64cpuid.o:ia64.o ia64-mont.o::aes_core.o aes_cbc.o aes-ia64.o::md5-ia64.o:sha1-ia64.o sha256-ia64.o sha512-ia64.o:::::::ghash-ia64.o::ias:win32",
|
"VC-WIN64I","cl:-W3 -Gs0 -Gy -nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -DUNICODE -D_UNICODE -D_CRT_SECURE_NO_DEPRECATE:::WIN64I::SIXTY_FOUR_BIT RC4_CHUNK_LL DES_INT EXPORT_VAR_AS_FN:ia64cpuid.o:ia64.o::aes_core.o aes_cbc.o aes-ia64.o::md5-ia64.o:sha1-ia64.o sha256-ia64.o sha512-ia64.o:::::::ias:win32",
|
||||||
"VC-WIN64A","cl:-W3 -Gs0 -Gy -nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -DUNICODE -D_UNICODE -D_CRT_SECURE_NO_DEPRECATE:::WIN64A::SIXTY_FOUR_BIT RC4_CHUNK_LL DES_INT EXPORT_VAR_AS_FN:".eval{my $asm=$x86_64_asm;$asm=~s/x86_64-gcc\.o/bn_asm.o/;$asm}.":auto:win32",
|
"VC-WIN64A","cl:-W3 -Gs0 -Gy -nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -DUNICODE -D_UNICODE -D_CRT_SECURE_NO_DEPRECATE:::WIN64A::SIXTY_FOUR_BIT RC4_CHUNK_LL DES_INT EXPORT_VAR_AS_FN:x86_64cpuid.o:bn_asm.o x86_64-mont.o::aes-x86_64.o::md5-x86_64.o:sha1-x86_64.o sha256-x86_64.o sha512-x86_64.o::rc4-x86_64.o:::wp-x86_64.o:cmll-x86_64.o cmll_misc.o:auto:win32",
|
||||||
"debug-VC-WIN64I","cl:-W3 -Gs0 -Gy -Zi -nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -DUNICODE -D_UNICODE -D_CRT_SECURE_NO_DEPRECATE:::WIN64I::SIXTY_FOUR_BIT RC4_CHUNK_LL DES_INT EXPORT_VAR_AS_FN:ia64cpuid.o:ia64.o::aes_core.o aes_cbc.o aes-ia64.o::md5-ia64.o:sha1-ia64.o sha256-ia64.o sha512-ia64.o:::::::ghash-ia64.o::ias:win32",
|
"debug-VC-WIN64I","cl:-W3 -Gs0 -Gy -Zi -nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -DUNICODE -D_UNICODE -D_CRT_SECURE_NO_DEPRECATE:::WIN64I::SIXTY_FOUR_BIT RC4_CHUNK_LL DES_INT EXPORT_VAR_AS_FN:ia64cpuid.o:ia64.o::aes_core.o aes_cbc.o aes-ia64.o::md5-ia64.o:sha1-ia64.o sha256-ia64.o sha512-ia64.o:::::::ias:win32",
|
||||||
"debug-VC-WIN64A","cl:-W3 -Gs0 -Gy -Zi -nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -DUNICODE -D_UNICODE -D_CRT_SECURE_NO_DEPRECATE:::WIN64A::SIXTY_FOUR_BIT RC4_CHUNK_LL DES_INT EXPORT_VAR_AS_FN:".eval{my $asm=$x86_64_asm;$asm=~s/x86_64-gcc\.o/bn_asm.o/;$asm}.":auto:win32",
|
"debug-VC-WIN64A","cl:-W3 -Gs0 -Gy -Zi -nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -DUNICODE -D_UNICODE -D_CRT_SECURE_NO_DEPRECATE:::WIN64A::SIXTY_FOUR_BIT RC4_CHUNK_LL DES_INT EXPORT_VAR_AS_FN:x86_64cpuid.o:bn_asm.o x86_64-mont.o::aes-x86_64.o::md5-x86_64.o:sha1-x86_64.o sha256-x86_64.o sha512-x86_64.o::rc4-x86_64.o:::wp-x86_64.o:cmll-x86_64.o cmll_misc.o:auto:win32",
|
||||||
# x86 Win32 target defaults to ANSI API, if you want UNICODE, complement
|
# x86 Win32 target defaults to ANSI API, if you want UNICODE, complement
|
||||||
# 'perl Configure VC-WIN32' with '-DUNICODE -D_UNICODE'
|
# 'perl Configure VC-WIN32' with '-DUNICODE -D_UNICODE'
|
||||||
"VC-WIN32","cl:-W3 -Gs0 -GF -Gy -nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -D_CRT_SECURE_NO_DEPRECATE:::WIN32::BN_LLONG RC4_INDEX EXPORT_VAR_AS_FN ${x86_gcc_opts}:${x86_asm}:win32n:win32",
|
"VC-WIN32","cl:-W3 -WX -Gs0 -GF -Gy -nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -D_CRT_SECURE_NO_DEPRECATE:::WIN32::BN_LLONG RC4_INDEX EXPORT_VAR_AS_FN ${x86_gcc_opts}:${x86_asm}:win32n:win32",
|
||||||
# Unified CE target
|
# Unified CE target
|
||||||
"debug-VC-WIN32","cl:-W3 -Gs0 -GF -Gy -Zi -nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -D_CRT_SECURE_NO_DEPRECATE:::WIN32::BN_LLONG RC4_INDEX EXPORT_VAR_AS_FN ${x86_gcc_opts}:${x86_asm}:win32n:win32",
|
"debug-VC-WIN32","cl:-W3 -WX -Gs0 -GF -Gy -Zi -nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -D_CRT_SECURE_NO_DEPRECATE:::WIN32::BN_LLONG RC4_INDEX EXPORT_VAR_AS_FN ${x86_gcc_opts}:${x86_asm}:win32n:win32",
|
||||||
"VC-CE","cl::::WINCE::BN_LLONG RC4_INDEX EXPORT_VAR_AS_FN ${x86_gcc_opts}:${no_asm}:win32",
|
"VC-CE","cl::::WINCE::BN_LLONG RC4_INDEX EXPORT_VAR_AS_FN ${x86_gcc_opts}:${no_asm}:win32",
|
||||||
|
|
||||||
# Borland C++ 4.5
|
# Borland C++ 4.5
|
||||||
@@ -578,7 +539,7 @@ my %table=(
|
|||||||
"netware-libc-bsdsock-gcc", "i586-netware-gcc:-nostdinc -I/ndk/libc/include -DNETWARE_BSDSOCK -DL_ENDIAN -DNETWARE_LIBC -DOPENSSL_SYSNAME_NETWARE -DTERMIO -O2 -Wall:::::BN_LLONG ${x86_gcc_opts}::",
|
"netware-libc-bsdsock-gcc", "i586-netware-gcc:-nostdinc -I/ndk/libc/include -DNETWARE_BSDSOCK -DL_ENDIAN -DNETWARE_LIBC -DOPENSSL_SYSNAME_NETWARE -DTERMIO -O2 -Wall:::::BN_LLONG ${x86_gcc_opts}::",
|
||||||
|
|
||||||
# DJGPP
|
# DJGPP
|
||||||
"DJGPP", "gcc:-I/dev/env/WATT_ROOT/inc -DTERMIO -DL_ENDIAN -fomit-frame-pointer -O2 -Wall:::MSDOS:-L/dev/env/WATT_ROOT/lib -lwatt:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_asm}:a.out:",
|
"DJGPP", "gcc:-I/dev/env/WATT_ROOT/inc -DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O2 -Wall:::MSDOS:-L/dev/env/WATT_ROOT/lib -lwatt:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_asm}:a.out:",
|
||||||
|
|
||||||
# Ultrix from Bernhard Simon <simon@zid.tuwien.ac.at>
|
# Ultrix from Bernhard Simon <simon@zid.tuwien.ac.at>
|
||||||
"ultrix-cc","cc:-std1 -O -Olimit 2500 -DL_ENDIAN::(unknown):::::::",
|
"ultrix-cc","cc:-std1 -O -Olimit 2500 -DL_ENDIAN::(unknown):::::::",
|
||||||
@@ -590,12 +551,10 @@ my %table=(
|
|||||||
"rhapsody-ppc-cc","cc:-O3 -DB_ENDIAN::(unknown):MACOSX_RHAPSODY::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${no_asm}::",
|
"rhapsody-ppc-cc","cc:-O3 -DB_ENDIAN::(unknown):MACOSX_RHAPSODY::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${no_asm}::",
|
||||||
"darwin-ppc-cc","cc:-arch ppc -O3 -DB_ENDIAN -Wa,-force_cpusubtype_ALL::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${ppc32_asm}:osx32:dlfcn:darwin-shared:-fPIC -fno-common:-arch ppc -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
|
"darwin-ppc-cc","cc:-arch ppc -O3 -DB_ENDIAN -Wa,-force_cpusubtype_ALL::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${ppc32_asm}:osx32:dlfcn:darwin-shared:-fPIC -fno-common:-arch ppc -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
|
||||||
"darwin64-ppc-cc","cc:-arch ppc64 -O3 -DB_ENDIAN::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${ppc64_asm}:osx64:dlfcn:darwin-shared:-fPIC -fno-common:-arch ppc64 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
|
"darwin64-ppc-cc","cc:-arch ppc64 -O3 -DB_ENDIAN::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${ppc64_asm}:osx64:dlfcn:darwin-shared:-fPIC -fno-common:-arch ppc64 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
|
||||||
"darwin-i386-cc","cc:-arch i386 -O3 -fomit-frame-pointer -DL_ENDIAN::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:BN_LLONG RC4_INT RC4_CHUNK DES_UNROLL BF_PTR:".eval{my $asm=$x86_asm;$asm=~s/cast\-586\.o//;$asm}.":macosx:dlfcn:darwin-shared:-fPIC -fno-common:-arch i386 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
|
"darwin-i386-cc","cc:-arch i386 -O3 -fomit-frame-pointer -DL_ENDIAN::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:BN_LLONG RC4_INT RC4_CHUNK DES_UNROLL BF_PTR:${x86_asm}:macosx:dlfcn:darwin-shared:-fPIC -fno-common:-arch i386 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
|
||||||
"debug-darwin-i386-cc","cc:-arch i386 -g3 -DL_ENDIAN::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:BN_LLONG RC4_INT RC4_CHUNK DES_UNROLL BF_PTR:${x86_asm}:macosx:dlfcn:darwin-shared:-fPIC -fno-common:-arch i386 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
|
"debug-darwin-i386-cc","cc:-arch i386 -g3 -DL_ENDIAN::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:BN_LLONG RC4_INT RC4_CHUNK DES_UNROLL BF_PTR:${x86_asm}:macosx:dlfcn:darwin-shared:-fPIC -fno-common:-arch i386 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
|
||||||
"darwin64-x86_64-cc","cc:-arch x86_64 -O3 -DL_ENDIAN -Wall::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL:".eval{my $asm=$x86_64_asm;$asm=~s/rc4\-[^:]+//;$asm}.":macosx:dlfcn:darwin-shared:-fPIC -fno-common:-arch x86_64 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
|
"darwin64-x86_64-cc","cc:-arch x86_64 -O3 -DL_ENDIAN -DMD32_REG_T=int -Wall::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL:".eval{my $asm=$x86_64_asm;$asm=~s/rc4\-[^:]+//;$asm}.":macosx:dlfcn:darwin-shared:-fPIC -fno-common:-arch x86_64 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
|
||||||
"debug-darwin-ppc-cc","cc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -DB_ENDIAN -g -Wall -O::-D_REENTRANT:MACOSX::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${ppc32_asm}:osx32:dlfcn:darwin-shared:-fPIC:-dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
|
"debug-darwin-ppc-cc","cc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -DB_ENDIAN -g -Wall -O::-D_REENTRANT:MACOSX::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${ppc32_asm}:osx32:dlfcn:darwin-shared:-fPIC:-dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
|
||||||
# iPhoneOS/iOS
|
|
||||||
"iphoneos-cross","llvm-gcc:-O3 -isysroot \$(CROSS_TOP)/SDKs/\$(CROSS_SDK) -fomit-frame-pointer -fno-common::-D_REENTRANT:iOS:-Wl,-search_paths_first%:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${no_asm}:dlfcn:darwin-shared:-fPIC -fno-common:-dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
|
|
||||||
|
|
||||||
##### A/UX
|
##### A/UX
|
||||||
"aux3-gcc","gcc:-O2 -DTERMIO::(unknown):AUX:-lbsd:RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:::",
|
"aux3-gcc","gcc:-O2 -DTERMIO::(unknown):AUX:-lbsd:RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:::",
|
||||||
@@ -604,27 +563,24 @@ my %table=(
|
|||||||
"newsos4-gcc","gcc:-O -DB_ENDIAN::(unknown):NEWS4:-lmld -liberty:BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_RISC1 DES_UNROLL BF_PTR::::",
|
"newsos4-gcc","gcc:-O -DB_ENDIAN::(unknown):NEWS4:-lmld -liberty:BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_RISC1 DES_UNROLL BF_PTR::::",
|
||||||
|
|
||||||
##### GNU Hurd
|
##### GNU Hurd
|
||||||
"hurd-x86", "gcc:-DL_ENDIAN -O3 -fomit-frame-pointer -march=i486 -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC",
|
"hurd-x86", "gcc:-DL_ENDIAN -DTERMIOS -O3 -fomit-frame-pointer -march=i486 -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC",
|
||||||
|
|
||||||
##### OS/2 EMX
|
##### OS/2 EMX
|
||||||
"OS2-EMX", "gcc::::::::",
|
"OS2-EMX", "gcc::::::::",
|
||||||
|
|
||||||
##### VxWorks for various targets
|
##### VxWorks for various targets
|
||||||
"vxworks-ppc60x","ccppc:-D_REENTRANT -mrtp -mhard-float -mstrict-align -fno-implicit-fp -DPPC32_fp60x -O2 -fstrength-reduce -fno-builtin -fno-strict-aliasing -Wall -DCPU=PPC32 -DTOOL_FAMILY=gnu -DTOOL=gnu -I\$(WIND_BASE)/target/usr/h -I\$(WIND_BASE)/target/usr/h/wrn/coreip:::VXWORKS:-Wl,--defsym,__wrs_rtp_base=0xe0000000 -L \$(WIND_BASE)/target/usr/lib/ppc/PPC32/common:::::",
|
|
||||||
"vxworks-ppcgen","ccppc:-D_REENTRANT -mrtp -msoft-float -mstrict-align -O1 -fno-builtin -fno-strict-aliasing -Wall -DCPU=PPC32 -DTOOL_FAMILY=gnu -DTOOL=gnu -I\$(WIND_BASE)/target/usr/h -I\$(WIND_BASE)/target/usr/h/wrn/coreip:::VXWORKS:-Wl,--defsym,__wrs_rtp_base=0xe0000000 -L \$(WIND_BASE)/target/usr/lib/ppc/PPC32/sfcommon:::::",
|
|
||||||
"vxworks-ppc405","ccppc:-g -msoft-float -mlongcall -DCPU=PPC405 -I\$(WIND_BASE)/target/h:::VXWORKS:-r:::::",
|
"vxworks-ppc405","ccppc:-g -msoft-float -mlongcall -DCPU=PPC405 -I\$(WIND_BASE)/target/h:::VXWORKS:-r:::::",
|
||||||
"vxworks-ppc750","ccppc:-ansi -nostdinc -DPPC750 -D_REENTRANT -fvolatile -fno-builtin -fno-for-scope -fsigned-char -Wall -msoft-float -mlongcall -DCPU=PPC604 -I\$(WIND_BASE)/target/h \$(DEBUG_FLAG):::VXWORKS:-r:::::",
|
"vxworks-ppc750","ccppc:-ansi -nostdinc -DPPC750 -D_REENTRANT -fvolatile -fno-builtin -fno-for-scope -fsigned-char -Wall -msoft-float -mlongcall -DCPU=PPC604 -I\$(WIND_BASE)/target/h \$(DEBUG_FLAG):::VXWORKS:-r:::::",
|
||||||
"vxworks-ppc750-debug","ccppc:-ansi -nostdinc -DPPC750 -D_REENTRANT -fvolatile -fno-builtin -fno-for-scope -fsigned-char -Wall -msoft-float -mlongcall -DCPU=PPC604 -I\$(WIND_BASE)/target/h -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DPEDANTIC -DDEBUG_SAFESTACK -DDEBUG -g:::VXWORKS:-r:::::",
|
"vxworks-ppc750-debug","ccppc:-ansi -nostdinc -DPPC750 -D_REENTRANT -fvolatile -fno-builtin -fno-for-scope -fsigned-char -Wall -msoft-float -mlongcall -DCPU=PPC604 -I\$(WIND_BASE)/target/h -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DPEDANTIC -DDEBUG_SAFESTACK -DDEBUG -g:::VXWORKS:-r:::::",
|
||||||
"vxworks-ppc860","ccppc:-nostdinc -msoft-float -DCPU=PPC860 -DNO_STRINGS_H -I\$(WIND_BASE)/target/h:::VXWORKS:-r:::::",
|
"vxworks-ppc860","ccppc:-nostdinc -msoft-float -DCPU=PPC860 -DNO_STRINGS_H -I\$(WIND_BASE)/target/h:::VXWORKS:-r:::::",
|
||||||
"vxworks-simlinux","ccpentium:-B\$(WIND_BASE)/host/\$(WIND_HOST_TYPE)/lib/gcc-lib/ -D_VSB_CONFIG_FILE=\"\$(WIND_BASE)/target/lib/h/config/vsbConfig.h\" -DL_ENDIAN -DCPU=SIMLINUX -DTOOL_FAMILY=gnu -DTOOL=gnu -fno-builtin -fno-defer-pop -DNO_STRINGS_H -I\$(WIND_BASE)/target/h -I\$(WIND_BASE)/target/h/wrn/coreip -DOPENSSL_NO_HW_PADLOCK:::VXWORKS:-r::${no_asm}::::::ranlibpentium:",
|
"vxworks-mipsle","ccmips:-B\$(WIND_BASE)/host/\$(WIND_HOST_TYPE)/lib/gcc-lib/ -DL_ENDIAN -EL -Wl,-EL -mips2 -mno-branch-likely -G 0 -fno-builtin -msoft-float -DCPU=MIPS32 -DMIPSEL -DNO_STRINGS_H -I\$(WIND_BASE)/target/h:::VXWORKS:-r::${no_asm}::::::ranlibmips:",
|
||||||
"vxworks-mips","ccmips:-mrtp -mips2 -O -G 0 -B\$(WIND_BASE)/host/\$(WIND_HOST_TYPE)/lib/gcc-lib/ -D_VSB_CONFIG_FILE=\"\$(WIND_BASE)/target/lib/h/config/vsbConfig.h\" -DCPU=MIPS32 -msoft-float -mno-branch-likely -DTOOL_FAMILY=gnu -DTOOL=gnu -fno-builtin -fno-defer-pop -DNO_STRINGS_H -I\$(WIND_BASE)/target/usr/h -I\$(WIND_BASE)/target/h/wrn/coreip::-D_REENTRANT:VXWORKS:-Wl,--defsym,__wrs_rtp_base=0xe0000000 -L \$(WIND_BASE)/target/usr/lib/mips/MIPSI32/sfcommon::${mips32_asm}:o32::::::ranlibmips:",
|
|
||||||
|
|
||||||
##### Compaq Non-Stop Kernel (Tandem)
|
##### Compaq Non-Stop Kernel (Tandem)
|
||||||
"tandem-c89","c89:-Ww -D__TANDEM -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1 -D_TANDEM_SOURCE -DB_ENDIAN::(unknown):::THIRTY_TWO_BIT:::",
|
"tandem-c89","c89:-Ww -D__TANDEM -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1 -D_TANDEM_SOURCE -DB_ENDIAN::(unknown):::THIRTY_TWO_BIT:::",
|
||||||
|
|
||||||
# uClinux
|
# uClinux
|
||||||
"uClinux-dist","$ENV{'CC'}:\$(CFLAGS)::-D_REENTRANT::\$(LDFLAGS) \$(LDLIBS):BN_LLONG:${no_asm}:$ENV{'LIBSSL_dlfcn'}:linux-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):$ENV{'RANLIB'}::",
|
"uClinux-dist","$ENV{'CC'}:\$(CFLAGS)::-D_REENTRANT::\$(LDFLAGS) \$(LDLIBS):BN_LLONG:::::::::::::::$ENV{'LIBSSL_dlfcn'}:linux-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):$ENV{'RANLIB'}::",
|
||||||
"uClinux-dist64","$ENV{'CC'}:\$(CFLAGS)::-D_REENTRANT::\$(LDFLAGS) \$(LDLIBS):SIXTY_FOUR_BIT_LONG:${no_asm}:$ENV{'LIBSSL_dlfcn'}:linux-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):$ENV{'RANLIB'}::",
|
"uClinux-dist64","$ENV{'CC'}:\$(CFLAGS)::-D_REENTRANT::\$(LDFLAGS) \$(LDLIBS):SIXTY_FOUR_BIT_LONG:::::::::::::::$ENV{'LIBSSL_dlfcn'}:linux-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):$ENV{'RANLIB'}::",
|
||||||
|
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -656,8 +612,6 @@ my $idx_rmd160_obj = $idx++;
|
|||||||
my $idx_rc5_obj = $idx++;
|
my $idx_rc5_obj = $idx++;
|
||||||
my $idx_wp_obj = $idx++;
|
my $idx_wp_obj = $idx++;
|
||||||
my $idx_cmll_obj = $idx++;
|
my $idx_cmll_obj = $idx++;
|
||||||
my $idx_modes_obj = $idx++;
|
|
||||||
my $idx_engines_obj = $idx++;
|
|
||||||
my $idx_perlasm_scheme = $idx++;
|
my $idx_perlasm_scheme = $idx++;
|
||||||
my $idx_dso_scheme = $idx++;
|
my $idx_dso_scheme = $idx++;
|
||||||
my $idx_shared_target = $idx++;
|
my $idx_shared_target = $idx++;
|
||||||
@@ -674,9 +628,6 @@ my $openssldir="";
|
|||||||
my $exe_ext="";
|
my $exe_ext="";
|
||||||
my $install_prefix= "$ENV{'INSTALL_PREFIX'}";
|
my $install_prefix= "$ENV{'INSTALL_PREFIX'}";
|
||||||
my $cross_compile_prefix="";
|
my $cross_compile_prefix="";
|
||||||
my $fipsdir="/usr/local/ssl/fips-2.0";
|
|
||||||
my $fipslibdir="";
|
|
||||||
my $baseaddr="0xFB00000";
|
|
||||||
my $no_threads=0;
|
my $no_threads=0;
|
||||||
my $threads=0;
|
my $threads=0;
|
||||||
my $no_shared=0; # but "no-shared" is default
|
my $no_shared=0; # but "no-shared" is default
|
||||||
@@ -711,37 +662,26 @@ my $cmll_enc="camellia.o cmll_misc.o cmll_cbc.o";
|
|||||||
my $processor="";
|
my $processor="";
|
||||||
my $default_ranlib;
|
my $default_ranlib;
|
||||||
my $perl;
|
my $perl;
|
||||||
my $fips=0;
|
|
||||||
|
|
||||||
if (exists $ENV{FIPSDIR})
|
|
||||||
{
|
|
||||||
$fipsdir = $ENV{FIPSDIR};
|
|
||||||
$fipsdir =~ s/\/$//;
|
|
||||||
}
|
|
||||||
|
|
||||||
# All of the following is disabled by default (RC5 was enabled before 0.9.8):
|
# All of the following is disabled by default (RC5 was enabled before 0.9.8):
|
||||||
|
|
||||||
my %disabled = ( # "what" => "comment" [or special keyword "experimental"]
|
my %disabled = ( # "what" => "comment" [or special keyword "experimental"]
|
||||||
"ec_nistp_64_gcc_128" => "default",
|
|
||||||
"gmp" => "default",
|
"gmp" => "default",
|
||||||
"jpake" => "experimental",
|
"jpake" => "experimental",
|
||||||
"md2" => "default",
|
"md2" => "default",
|
||||||
"rc5" => "default",
|
"rc5" => "default",
|
||||||
"rfc3779" => "default",
|
"rfc3779" => "default",
|
||||||
"sctp" => "default",
|
"shared" => "default",
|
||||||
"shared" => "default",
|
|
||||||
"ssl2" => "default",
|
|
||||||
"store" => "experimental",
|
"store" => "experimental",
|
||||||
"unit-test" => "default",
|
"zlib" => "default",
|
||||||
"weak-ssl-ciphers" => "default",
|
"zlib-dynamic" => "default"
|
||||||
"zlib" => "default",
|
);
|
||||||
"zlib-dynamic" => "default"
|
|
||||||
);
|
|
||||||
my @experimental = ();
|
my @experimental = ();
|
||||||
|
|
||||||
# This is what $depflags will look like with the above defaults
|
# This is what $depflags will look like with the above defaults
|
||||||
# (we need this to see if we should advise the user to run "make depend"):
|
# (we need this to see if we should advise the user to run "make depend"):
|
||||||
my $default_depflags = " -DOPENSSL_NO_EC_NISTP_64_GCC_128 -DOPENSSL_NO_GMP -DOPENSSL_NO_JPAKE -DOPENSSL_NO_MD2 -DOPENSSL_NO_RC5 -DOPENSSL_NO_RFC3779 -DOPENSSL_NO_SCTP -DOPENSSL_NO_STORE -DOPENSSL_NO_UNIT_TEST";
|
my $default_depflags = " -DOPENSSL_NO_GMP -DOPENSSL_NO_JPAKE -DOPENSSL_NO_MD2 -DOPENSSL_NO_RC5 -DOPENSSL_NO_RFC3779 -DOPENSSL_NO_STORE";
|
||||||
|
|
||||||
# Explicit "no-..." options will be collected in %disabled along with the defaults.
|
# Explicit "no-..." options will be collected in %disabled along with the defaults.
|
||||||
# To remove something from %disabled, use "enable-foo" (unless it's experimental).
|
# To remove something from %disabled, use "enable-foo" (unless it's experimental).
|
||||||
@@ -799,7 +739,6 @@ PROCESS_ARGS:
|
|||||||
|
|
||||||
# rewrite some options in "enable-..." form
|
# rewrite some options in "enable-..." form
|
||||||
s /^-?-?shared$/enable-shared/;
|
s /^-?-?shared$/enable-shared/;
|
||||||
s /^sctp$/enable-sctp/;
|
|
||||||
s /^threads$/enable-threads/;
|
s /^threads$/enable-threads/;
|
||||||
s /^zlib$/enable-zlib/;
|
s /^zlib$/enable-zlib/;
|
||||||
s /^zlib-dynamic$/enable-zlib-dynamic/;
|
s /^zlib-dynamic$/enable-zlib-dynamic/;
|
||||||
@@ -817,11 +756,6 @@ PROCESS_ARGS:
|
|||||||
{
|
{
|
||||||
$disabled{"tls1"} = "option(tls)"
|
$disabled{"tls1"} = "option(tls)"
|
||||||
}
|
}
|
||||||
elsif ($1 eq "ssl3-method")
|
|
||||||
{
|
|
||||||
$disabled{"ssl3-method"} = "option(ssl)";
|
|
||||||
$disabled{"ssl3"} = "option(ssl)";
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$disabled{$1} = "option";
|
$disabled{$1} = "option";
|
||||||
@@ -874,10 +808,6 @@ PROCESS_ARGS:
|
|||||||
}
|
}
|
||||||
elsif (/^386$/)
|
elsif (/^386$/)
|
||||||
{ $processor=386; }
|
{ $processor=386; }
|
||||||
elsif (/^fips$/)
|
|
||||||
{
|
|
||||||
$fips=1;
|
|
||||||
}
|
|
||||||
elsif (/^rsaref$/)
|
elsif (/^rsaref$/)
|
||||||
{
|
{
|
||||||
# No RSAref support any more since it's not needed.
|
# No RSAref support any more since it's not needed.
|
||||||
@@ -892,7 +822,6 @@ PROCESS_ARGS:
|
|||||||
}
|
}
|
||||||
elsif (/^-[^-]/ or /^\+/)
|
elsif (/^-[^-]/ or /^\+/)
|
||||||
{
|
{
|
||||||
$_ =~ s/%([0-9a-f]{1,2})/chr(hex($1))/gei;
|
|
||||||
$flags.=$_." ";
|
$flags.=$_." ";
|
||||||
}
|
}
|
||||||
elsif (/^--prefix=(.*)$/)
|
elsif (/^--prefix=(.*)$/)
|
||||||
@@ -923,18 +852,6 @@ PROCESS_ARGS:
|
|||||||
{
|
{
|
||||||
$withargs{"zlib-include"}="-I$1";
|
$withargs{"zlib-include"}="-I$1";
|
||||||
}
|
}
|
||||||
elsif (/^--with-fipsdir=(.*)$/)
|
|
||||||
{
|
|
||||||
$fipsdir="$1";
|
|
||||||
}
|
|
||||||
elsif (/^--with-fipslibdir=(.*)$/)
|
|
||||||
{
|
|
||||||
$fipslibdir="$1";
|
|
||||||
}
|
|
||||||
elsif (/^--with-baseaddr=(.*)$/)
|
|
||||||
{
|
|
||||||
$baseaddr="$1";
|
|
||||||
}
|
|
||||||
elsif (/^--cross-compile-prefix=(.*)$/)
|
elsif (/^--cross-compile-prefix=(.*)$/)
|
||||||
{
|
{
|
||||||
$cross_compile_prefix=$1;
|
$cross_compile_prefix=$1;
|
||||||
@@ -1009,17 +926,6 @@ if (defined($disabled{"md5"}) || defined($disabled{"rsa"}))
|
|||||||
$disabled{"ssl2"} = "forced";
|
$disabled{"ssl2"} = "forced";
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($fips && $fipslibdir eq "")
|
|
||||||
{
|
|
||||||
$fipslibdir = $fipsdir . "/lib/";
|
|
||||||
}
|
|
||||||
|
|
||||||
# RSAX ENGINE sets default non-FIPS RSA method.
|
|
||||||
if ($fips)
|
|
||||||
{
|
|
||||||
$disabled{"rsax"} = "forced";
|
|
||||||
}
|
|
||||||
|
|
||||||
# SSL 3.0 and TLS requires MD5 and SHA and either RSA or DSA+DH
|
# SSL 3.0 and TLS requires MD5 and SHA and either RSA or DSA+DH
|
||||||
if (defined($disabled{"md5"}) || defined($disabled{"sha"})
|
if (defined($disabled{"md5"}) || defined($disabled{"sha"})
|
||||||
|| (defined($disabled{"rsa"})
|
|| (defined($disabled{"rsa"})
|
||||||
@@ -1040,13 +946,6 @@ if (defined($disabled{"ec"}) || defined($disabled{"dsa"})
|
|||||||
$disabled{"gost"} = "forced";
|
$disabled{"gost"} = "forced";
|
||||||
}
|
}
|
||||||
|
|
||||||
# SRP and HEARTBEATS require TLSEXT
|
|
||||||
if (defined($disabled{"tlsext"}))
|
|
||||||
{
|
|
||||||
$disabled{"srp"} = "forced";
|
|
||||||
$disabled{"heartbeats"} = "forced";
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($target eq "TABLE") {
|
if ($target eq "TABLE") {
|
||||||
foreach $target (sort keys %table) {
|
foreach $target (sort keys %table) {
|
||||||
print_table_entry($target);
|
print_table_entry($target);
|
||||||
@@ -1096,7 +995,7 @@ foreach (sort (keys %disabled))
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
my ($ALGO, $algo);
|
my ($ALGO, $algo);
|
||||||
($ALGO = $algo = $_) =~ tr/[\-a-z]/[_A-Z]/;
|
($ALGO = $algo = $_) =~ tr/[a-z]/[A-Z]/;
|
||||||
|
|
||||||
if (/^asm$/ || /^err$/ || /^hw$/ || /^hw-/)
|
if (/^asm$/ || /^err$/ || /^hw$/ || /^hw-/)
|
||||||
{
|
{
|
||||||
@@ -1116,8 +1015,6 @@ foreach (sort (keys %disabled))
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
push @skip, $algo;
|
push @skip, $algo;
|
||||||
# fix-up crypto/directory name(s)
|
|
||||||
@skip[$#skip]="whrlpool" if $algo eq "whirlpool";
|
|
||||||
print " (skip dir)";
|
print " (skip dir)";
|
||||||
|
|
||||||
$depflags .= " -DOPENSSL_NO_$ALGO";
|
$depflags .= " -DOPENSSL_NO_$ALGO";
|
||||||
@@ -1188,8 +1085,6 @@ my $rmd160_obj = $fields[$idx_rmd160_obj];
|
|||||||
my $rc5_obj = $fields[$idx_rc5_obj];
|
my $rc5_obj = $fields[$idx_rc5_obj];
|
||||||
my $wp_obj = $fields[$idx_wp_obj];
|
my $wp_obj = $fields[$idx_wp_obj];
|
||||||
my $cmll_obj = $fields[$idx_cmll_obj];
|
my $cmll_obj = $fields[$idx_cmll_obj];
|
||||||
my $modes_obj = $fields[$idx_modes_obj];
|
|
||||||
my $engines_obj = $fields[$idx_engines_obj];
|
|
||||||
my $perlasm_scheme = $fields[$idx_perlasm_scheme];
|
my $perlasm_scheme = $fields[$idx_perlasm_scheme];
|
||||||
my $dso_scheme = $fields[$idx_dso_scheme];
|
my $dso_scheme = $fields[$idx_dso_scheme];
|
||||||
my $shared_target = $fields[$idx_shared_target];
|
my $shared_target = $fields[$idx_shared_target];
|
||||||
@@ -1350,7 +1245,7 @@ if ($no_asm)
|
|||||||
{
|
{
|
||||||
$cpuid_obj=$bn_obj=
|
$cpuid_obj=$bn_obj=
|
||||||
$des_obj=$aes_obj=$bf_obj=$cast_obj=$rc4_obj=$rc5_obj=$cmll_obj=
|
$des_obj=$aes_obj=$bf_obj=$cast_obj=$rc4_obj=$rc5_obj=$cmll_obj=
|
||||||
$modes_obj=$sha1_obj=$md5_obj=$rmd160_obj=$wp_obj=$engines_obj="";
|
$sha1_obj=$md5_obj=$rmd160_obj=$wp_obj="";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$no_shared)
|
if (!$no_shared)
|
||||||
@@ -1414,7 +1309,7 @@ if (!$IsMK1MF)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$cpuid_obj.=" uplink.o uplink-x86.o" if ($cflags =~ /\-DOPENSSL_USE_APPLINK/);
|
$cpuid_obj.=" uplink.o uplink-cof.o" if ($cflags =~ /\-DOPENSSL_USE_APPLINK/);
|
||||||
|
|
||||||
#
|
#
|
||||||
# Platform fix-ups
|
# Platform fix-ups
|
||||||
@@ -1455,7 +1350,7 @@ if ($target =~ /\-icc$/) # Intel C compiler
|
|||||||
# linker only when --prefix is not /usr.
|
# linker only when --prefix is not /usr.
|
||||||
if ($target =~ /^BSD\-/)
|
if ($target =~ /^BSD\-/)
|
||||||
{
|
{
|
||||||
$shared_ldflag.=" -Wl,-rpath,\$\$(LIBRPATH)" if ($prefix !~ m|^/usr[/]*$|);
|
$shared_ldflag.=" -Wl,-rpath,\$(LIBRPATH)" if ($prefix !~ m|^/usr[/]*$|);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($sys_id ne "")
|
if ($sys_id ne "")
|
||||||
@@ -1482,14 +1377,6 @@ $cflags.=" -DOPENSSL_BN_ASM_PART_WORDS" if ($bn_obj =~ /bn-586/);
|
|||||||
$cflags.=" -DOPENSSL_IA32_SSE2" if (!$no_sse2 && $bn_obj =~ /86/);
|
$cflags.=" -DOPENSSL_IA32_SSE2" if (!$no_sse2 && $bn_obj =~ /86/);
|
||||||
|
|
||||||
$cflags.=" -DOPENSSL_BN_ASM_MONT" if ($bn_obj =~ /-mont/);
|
$cflags.=" -DOPENSSL_BN_ASM_MONT" if ($bn_obj =~ /-mont/);
|
||||||
$cflags.=" -DOPENSSL_BN_ASM_MONT5" if ($bn_obj =~ /-mont5/);
|
|
||||||
$cflags.=" -DOPENSSL_BN_ASM_GF2m" if ($bn_obj =~ /-gf2m/);
|
|
||||||
|
|
||||||
if ($fips)
|
|
||||||
{
|
|
||||||
$openssl_other_defines.="#define OPENSSL_FIPS\n";
|
|
||||||
$cflags .= " -I\$(FIPSDIR)/include";
|
|
||||||
}
|
|
||||||
|
|
||||||
$cpuid_obj="mem_clr.o" unless ($cpuid_obj =~ /\.o$/);
|
$cpuid_obj="mem_clr.o" unless ($cpuid_obj =~ /\.o$/);
|
||||||
$des_obj=$des_enc unless ($des_obj =~ /\.o$/);
|
$des_obj=$des_enc unless ($des_obj =~ /\.o$/);
|
||||||
@@ -1523,20 +1410,12 @@ if ($rmd160_obj =~ /\.o$/)
|
|||||||
if ($aes_obj =~ /\.o$/)
|
if ($aes_obj =~ /\.o$/)
|
||||||
{
|
{
|
||||||
$cflags.=" -DAES_ASM";
|
$cflags.=" -DAES_ASM";
|
||||||
# aes-ctr.o is not a real file, only indication that assembler
|
|
||||||
# module implements AES_ctr32_encrypt...
|
|
||||||
$cflags.=" -DAES_CTR_ASM" if ($aes_obj =~ s/\s*aes\-ctr\.o//);
|
|
||||||
# aes-xts.o indicates presense of AES_xts_[en|de]crypt...
|
|
||||||
$cflags.=" -DAES_XTS_ASM" if ($aes_obj =~ s/\s*aes\-xts\.o//);
|
|
||||||
$aes_obj =~ s/\s*(vpaes|aesni)\-x86\.o//g if ($no_sse2);
|
|
||||||
$cflags.=" -DVPAES_ASM" if ($aes_obj =~ m/vpaes/);
|
|
||||||
$cflags.=" -DBSAES_ASM" if ($aes_obj =~ m/bsaes/);
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$aes_obj=$aes_enc;
|
$aes_obj=$aes_enc;
|
||||||
}
|
}
|
||||||
$wp_obj="" if ($wp_obj =~ /mmx/ && $processor eq "386");
|
$wp_obj="" if ($wp_obj =~ /mmx/ && $processor eq "386");
|
||||||
if ($wp_obj =~ /\.o$/ && !$disabled{"whirlpool"})
|
if ($wp_obj =~ /\.o$/)
|
||||||
{
|
{
|
||||||
$cflags.=" -DWHIRLPOOL_ASM";
|
$cflags.=" -DWHIRLPOOL_ASM";
|
||||||
}
|
}
|
||||||
@@ -1544,10 +1423,6 @@ else {
|
|||||||
$wp_obj="wp_block.o";
|
$wp_obj="wp_block.o";
|
||||||
}
|
}
|
||||||
$cmll_obj=$cmll_enc unless ($cmll_obj =~ /.o$/);
|
$cmll_obj=$cmll_enc unless ($cmll_obj =~ /.o$/);
|
||||||
if ($modes_obj =~ /ghash/)
|
|
||||||
{
|
|
||||||
$cflags.=" -DGHASH_ASM";
|
|
||||||
}
|
|
||||||
|
|
||||||
# "Stringify" the C flags string. This permits it to be made part of a string
|
# "Stringify" the C flags string. This permits it to be made part of a string
|
||||||
# and works as well on command lines.
|
# and works as well on command lines.
|
||||||
@@ -1587,20 +1462,11 @@ if ($shlib_version_number =~ /(^[0-9]*)\.([0-9\.]*)/)
|
|||||||
|
|
||||||
if ($strict_warnings)
|
if ($strict_warnings)
|
||||||
{
|
{
|
||||||
my $ecc = $cc;
|
|
||||||
$ecc = "clang" if `$cc --version 2>&1` =~ /clang/;
|
|
||||||
my $wopt;
|
my $wopt;
|
||||||
die "ERROR --strict-warnings requires gcc or clang" unless ($ecc =~ /gcc$/ or $ecc =~ /clang$/);
|
die "ERROR --strict-warnings requires gcc" unless ($cc =~ /gcc$/);
|
||||||
foreach $wopt (split /\s+/, $gcc_devteam_warn)
|
foreach $wopt (split /\s+/, $gcc_devteam_warn)
|
||||||
{
|
{
|
||||||
$cflags .= " $wopt" unless ($cflags =~ /(^|\s)$wopt(\s|$)/)
|
$cflags .= " $wopt" unless ($cflags =~ /$wopt/)
|
||||||
}
|
|
||||||
if ($ecc eq "clang")
|
|
||||||
{
|
|
||||||
foreach $wopt (split /\s+/, $clang_devteam_warn)
|
|
||||||
{
|
|
||||||
$cflags .= " $wopt" unless ($cflags =~ /(^|\s)$wopt(\s|$)/)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1671,8 +1537,6 @@ while (<IN>)
|
|||||||
s/^RMD160_ASM_OBJ=.*$/RMD160_ASM_OBJ= $rmd160_obj/;
|
s/^RMD160_ASM_OBJ=.*$/RMD160_ASM_OBJ= $rmd160_obj/;
|
||||||
s/^WP_ASM_OBJ=.*$/WP_ASM_OBJ= $wp_obj/;
|
s/^WP_ASM_OBJ=.*$/WP_ASM_OBJ= $wp_obj/;
|
||||||
s/^CMLL_ENC=.*$/CMLL_ENC= $cmll_obj/;
|
s/^CMLL_ENC=.*$/CMLL_ENC= $cmll_obj/;
|
||||||
s/^MODES_ASM_OBJ.=*$/MODES_ASM_OBJ= $modes_obj/;
|
|
||||||
s/^ENGINES_ASM_OBJ.=*$/ENGINES_ASM_OBJ= $engines_obj/;
|
|
||||||
s/^PERLASM_SCHEME=.*$/PERLASM_SCHEME= $perlasm_scheme/;
|
s/^PERLASM_SCHEME=.*$/PERLASM_SCHEME= $perlasm_scheme/;
|
||||||
s/^PROCESSOR=.*/PROCESSOR= $processor/;
|
s/^PROCESSOR=.*/PROCESSOR= $processor/;
|
||||||
s/^ARFLAGS=.*/ARFLAGS= $arflags/;
|
s/^ARFLAGS=.*/ARFLAGS= $arflags/;
|
||||||
@@ -1681,12 +1545,6 @@ while (<IN>)
|
|||||||
s/^LIBKRB5=.*/LIBKRB5=$withargs{"krb5-lib"}/;
|
s/^LIBKRB5=.*/LIBKRB5=$withargs{"krb5-lib"}/;
|
||||||
s/^LIBZLIB=.*/LIBZLIB=$withargs{"zlib-lib"}/;
|
s/^LIBZLIB=.*/LIBZLIB=$withargs{"zlib-lib"}/;
|
||||||
s/^ZLIB_INCLUDE=.*/ZLIB_INCLUDE=$withargs{"zlib-include"}/;
|
s/^ZLIB_INCLUDE=.*/ZLIB_INCLUDE=$withargs{"zlib-include"}/;
|
||||||
|
|
||||||
s/^FIPSDIR=.*/FIPSDIR=$fipsdir/;
|
|
||||||
s/^FIPSLIBDIR=.*/FIPSLIBDIR=$fipslibdir/;
|
|
||||||
s/^FIPSCANLIB=.*/FIPSCANLIB=libcrypto/ if $fips;
|
|
||||||
s/^BASEADDR=.*/BASEADDR=$baseaddr/;
|
|
||||||
|
|
||||||
s/^SHLIB_TARGET=.*/SHLIB_TARGET=$shared_target/;
|
s/^SHLIB_TARGET=.*/SHLIB_TARGET=$shared_target/;
|
||||||
s/^SHLIB_MARK=.*/SHLIB_MARK=$shared_mark/;
|
s/^SHLIB_MARK=.*/SHLIB_MARK=$shared_mark/;
|
||||||
s/^SHARED_LIBS=.*/SHARED_LIBS=\$(SHARED_CRYPTO) \$(SHARED_SSL)/ if (!$no_shared);
|
s/^SHARED_LIBS=.*/SHARED_LIBS=\$(SHARED_CRYPTO) \$(SHARED_SSL)/ if (!$no_shared);
|
||||||
@@ -1730,9 +1588,7 @@ print "RC5_ENC =$rc5_obj\n";
|
|||||||
print "MD5_OBJ_ASM =$md5_obj\n";
|
print "MD5_OBJ_ASM =$md5_obj\n";
|
||||||
print "SHA1_OBJ_ASM =$sha1_obj\n";
|
print "SHA1_OBJ_ASM =$sha1_obj\n";
|
||||||
print "RMD160_OBJ_ASM=$rmd160_obj\n";
|
print "RMD160_OBJ_ASM=$rmd160_obj\n";
|
||||||
print "CMLL_ENC =$cmll_obj\n";
|
print "CMLL_ENC= =$cmll_obj\n";
|
||||||
print "MODES_OBJ =$modes_obj\n";
|
|
||||||
print "ENGINES_OBJ =$engines_obj\n";
|
|
||||||
print "PROCESSOR =$processor\n";
|
print "PROCESSOR =$processor\n";
|
||||||
print "RANLIB =$ranlib\n";
|
print "RANLIB =$ranlib\n";
|
||||||
print "ARFLAGS =$arflags\n";
|
print "ARFLAGS =$arflags\n";
|
||||||
@@ -1794,9 +1650,6 @@ open(OUT,'>crypto/opensslconf.h.new') || die "unable to create crypto/opensslcon
|
|||||||
print OUT "/* opensslconf.h */\n";
|
print OUT "/* opensslconf.h */\n";
|
||||||
print OUT "/* WARNING: Generated automatically from opensslconf.h.in by Configure. */\n\n";
|
print OUT "/* WARNING: Generated automatically from opensslconf.h.in by Configure. */\n\n";
|
||||||
|
|
||||||
print OUT "#ifdef __cplusplus\n";
|
|
||||||
print OUT "extern \"C\" {\n";
|
|
||||||
print OUT "#endif\n";
|
|
||||||
print OUT "/* OpenSSL was configured with the following options: */\n";
|
print OUT "/* OpenSSL was configured with the following options: */\n";
|
||||||
my $openssl_algorithm_defines_trans = $openssl_algorithm_defines;
|
my $openssl_algorithm_defines_trans = $openssl_algorithm_defines;
|
||||||
$openssl_experimental_defines =~ s/^\s*#\s*define\s+OPENSSL_NO_(.*)/#ifndef OPENSSL_EXPERIMENTAL_$1\n# ifndef OPENSSL_NO_$1\n# define OPENSSL_NO_$1\n# endif\n#endif/mg;
|
$openssl_experimental_defines =~ s/^\s*#\s*define\s+OPENSSL_NO_(.*)/#ifndef OPENSSL_EXPERIMENTAL_$1\n# ifndef OPENSSL_NO_$1\n# define OPENSSL_NO_$1\n# endif\n#endif/mg;
|
||||||
@@ -1901,9 +1754,6 @@ while (<IN>)
|
|||||||
{ print OUT $_; }
|
{ print OUT $_; }
|
||||||
}
|
}
|
||||||
close(IN);
|
close(IN);
|
||||||
print OUT "#ifdef __cplusplus\n";
|
|
||||||
print OUT "}\n";
|
|
||||||
print OUT "#endif\n";
|
|
||||||
close(OUT);
|
close(OUT);
|
||||||
rename("crypto/opensslconf.h","crypto/opensslconf.h.bak") || die "unable to rename crypto/opensslconf.h\n" if -e "crypto/opensslconf.h";
|
rename("crypto/opensslconf.h","crypto/opensslconf.h.bak") || die "unable to rename crypto/opensslconf.h\n" if -e "crypto/opensslconf.h";
|
||||||
rename("crypto/opensslconf.h.new","crypto/opensslconf.h") || die "unable to rename crypto/opensslconf.h.new\n";
|
rename("crypto/opensslconf.h.new","crypto/opensslconf.h") || die "unable to rename crypto/opensslconf.h.new\n";
|
||||||
@@ -1962,8 +1812,14 @@ EOF
|
|||||||
&dofile("apps/CA.pl",'/usr/local/bin/perl','^#!/', '#!%s');
|
&dofile("apps/CA.pl",'/usr/local/bin/perl','^#!/', '#!%s');
|
||||||
}
|
}
|
||||||
if ($depflags ne $default_depflags && !$make_depend) {
|
if ($depflags ne $default_depflags && !$make_depend) {
|
||||||
$warn_make_depend++;
|
print <<EOF;
|
||||||
}
|
|
||||||
|
Since you've disabled or enabled at least one algorithm, you need to do
|
||||||
|
the following before building:
|
||||||
|
|
||||||
|
make depend
|
||||||
|
EOF
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# create the ms/version32.rc file if needed
|
# create the ms/version32.rc file if needed
|
||||||
@@ -2042,18 +1898,12 @@ EOF
|
|||||||
|
|
||||||
print <<\EOF if ($no_shared_warn);
|
print <<\EOF if ($no_shared_warn);
|
||||||
|
|
||||||
You gave the option 'shared', which is not supported on this platform, so
|
You gave the option 'shared'. Normally, that would give you shared libraries.
|
||||||
we will pretend you gave the option 'no-shared'. If you know how to implement
|
Unfortunately, the OpenSSL configuration doesn't include shared library support
|
||||||
shared libraries, please let us know (but please first make sure you have
|
for this platform yet, so it will pretend you gave the option 'no-shared'. If
|
||||||
tried with a current version of OpenSSL).
|
you can inform the developpers (openssl-dev\@openssl.org) how to support shared
|
||||||
EOF
|
libraries on this platform, they will at least look at it and try their best
|
||||||
|
(but please first make sure you have tried with a current version of OpenSSL).
|
||||||
print <<EOF if ($warn_make_depend);
|
|
||||||
|
|
||||||
*** Because of configuration changes, you MUST do the following before
|
|
||||||
*** building:
|
|
||||||
|
|
||||||
make depend
|
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
exit(0);
|
exit(0);
|
||||||
@@ -2131,8 +1981,7 @@ sub print_table_entry
|
|||||||
(my $cc,my $cflags,my $unistd,my $thread_cflag,my $sys_id,my $lflags,
|
(my $cc,my $cflags,my $unistd,my $thread_cflag,my $sys_id,my $lflags,
|
||||||
my $bn_ops,my $cpuid_obj,my $bn_obj,my $des_obj,my $aes_obj, my $bf_obj,
|
my $bn_ops,my $cpuid_obj,my $bn_obj,my $des_obj,my $aes_obj, my $bf_obj,
|
||||||
my $md5_obj,my $sha1_obj,my $cast_obj,my $rc4_obj,my $rmd160_obj,
|
my $md5_obj,my $sha1_obj,my $cast_obj,my $rc4_obj,my $rmd160_obj,
|
||||||
my $rc5_obj,my $wp_obj,my $cmll_obj,my $modes_obj, my $engines_obj,
|
my $rc5_obj,my $wp_obj,my $cmll_obj,my $perlasm_scheme,my $dso_scheme,my $shared_target,my $shared_cflag,
|
||||||
my $perlasm_scheme,my $dso_scheme,my $shared_target,my $shared_cflag,
|
|
||||||
my $shared_ldflag,my $shared_extension,my $ranlib,my $arflags,my $multilib)=
|
my $shared_ldflag,my $shared_extension,my $ranlib,my $arflags,my $multilib)=
|
||||||
split(/\s*:\s*/,$table{$target} . ":" x 30 , -1);
|
split(/\s*:\s*/,$table{$target} . ":" x 30 , -1);
|
||||||
|
|
||||||
@@ -2159,8 +2008,6 @@ sub print_table_entry
|
|||||||
\$rc5_obj = $rc5_obj
|
\$rc5_obj = $rc5_obj
|
||||||
\$wp_obj = $wp_obj
|
\$wp_obj = $wp_obj
|
||||||
\$cmll_obj = $cmll_obj
|
\$cmll_obj = $cmll_obj
|
||||||
\$modes_obj = $modes_obj
|
|
||||||
\$engines_obj = $engines_obj
|
|
||||||
\$perlasm_scheme = $perlasm_scheme
|
\$perlasm_scheme = $perlasm_scheme
|
||||||
\$dso_scheme = $dso_scheme
|
\$dso_scheme = $dso_scheme
|
||||||
\$shared_target= $shared_target
|
\$shared_target= $shared_target
|
||||||
|
|||||||
8
INSTALL
8
INSTALL
@@ -164,10 +164,10 @@
|
|||||||
standard headers). If it is a problem with OpenSSL itself, please
|
standard headers). If it is a problem with OpenSSL itself, please
|
||||||
report the problem to <openssl-bugs@openssl.org> (note that your
|
report the problem to <openssl-bugs@openssl.org> (note that your
|
||||||
message will be recorded in the request tracker publicly readable
|
message will be recorded in the request tracker publicly readable
|
||||||
at https://www.openssl.org/community/index.html#bugs and will be
|
via http://www.openssl.org/support/rt.html and will be forwarded to a
|
||||||
forwarded to a public mailing list). Include the output of "make
|
public mailing list). Include the output of "make report" in your message.
|
||||||
report" in your message. Please check out the request tracker. Maybe
|
Please check out the request tracker. Maybe the bug was already
|
||||||
the bug was already reported or has already been fixed.
|
reported or has already been fixed.
|
||||||
|
|
||||||
[If you encounter assembler error messages, try the "no-asm"
|
[If you encounter assembler error messages, try the "no-asm"
|
||||||
configuration option as an immediate fix.]
|
configuration option as an immediate fix.]
|
||||||
|
|||||||
@@ -29,7 +29,7 @@
|
|||||||
is required if you intend to utilize assembler modules. Note that NASM
|
is required if you intend to utilize assembler modules. Note that NASM
|
||||||
is now the only supported assembler.
|
is now the only supported assembler.
|
||||||
|
|
||||||
If you are compiling from a tarball or a Git snapshot then the Win32 files
|
If you are compiling from a tarball or a CVS snapshot then the Win32 files
|
||||||
may well be not up to date. This may mean that some "tweaking" is required to
|
may well be not up to date. This may mean that some "tweaking" is required to
|
||||||
get it all to work. See the trouble shooting section later on for if (when?)
|
get it all to work. See the trouble shooting section later on for if (when?)
|
||||||
it goes wrong.
|
it goes wrong.
|
||||||
@@ -257,7 +257,7 @@
|
|||||||
|
|
||||||
then ms\do_XXX should not give a warning any more. However the numbers that
|
then ms\do_XXX should not give a warning any more. However the numbers that
|
||||||
get assigned by this technique may not match those that eventually get
|
get assigned by this technique may not match those that eventually get
|
||||||
assigned in the Git tree: so anything linked against this version of the
|
assigned in the CVS tree: so anything linked against this version of the
|
||||||
library may need to be recompiled.
|
library may need to be recompiled.
|
||||||
|
|
||||||
If you get errors about unresolved symbols there are several possible
|
If you get errors about unresolved symbols there are several possible
|
||||||
|
|||||||
2
LICENSE
2
LICENSE
@@ -12,7 +12,7 @@
|
|||||||
---------------
|
---------------
|
||||||
|
|
||||||
/* ====================================================================
|
/* ====================================================================
|
||||||
* Copyright (c) 1998-2016 The OpenSSL Project. All rights reserved.
|
* Copyright (c) 1998-2011 The OpenSSL Project. All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions
|
* modification, are permitted provided that the following conditions
|
||||||
|
|||||||
@@ -5,98 +5,97 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
enum {
|
|
||||||
kMacSocket_TimeoutErr = -2
|
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
kMacSocket_TimeoutErr = -2
|
||||||
};
|
};
|
||||||
|
|
||||||
// Since MacSocket does busy waiting, I do a callback while waiting
|
|
||||||
|
|
||||||
typedef OSErr(*MacSocket_IdleWaitCallback) (void *);
|
// Since MacSocket does busy waiting, I do a callback while waiting
|
||||||
|
|
||||||
// Call this before anything else!
|
typedef OSErr (*MacSocket_IdleWaitCallback)(void *);
|
||||||
|
|
||||||
|
|
||||||
|
// Call this before anything else!
|
||||||
|
|
||||||
OSErr MacSocket_Startup(void);
|
OSErr MacSocket_Startup(void);
|
||||||
|
|
||||||
// Call this to cleanup before quitting
|
|
||||||
|
// Call this to cleanup before quitting
|
||||||
|
|
||||||
OSErr MacSocket_Shutdown(void);
|
OSErr MacSocket_Shutdown(void);
|
||||||
|
|
||||||
// Call this to allocate a "socket" (reference number is returned in
|
|
||||||
// outSocketNum)
|
|
||||||
// Note that inDoThreadSwitching is pretty much irrelevant right now, since I
|
|
||||||
// ignore it
|
|
||||||
// The inTimeoutTicks parameter is applied during reads/writes of data
|
|
||||||
// The inIdleWaitCallback parameter specifies a callback which is called
|
|
||||||
// during busy-waiting periods
|
|
||||||
// The inUserRefPtr parameter is passed back to the idle-wait callback
|
|
||||||
|
|
||||||
OSErr MacSocket_socket(int *outSocketNum, const Boolean inDoThreadSwitching,
|
// Call this to allocate a "socket" (reference number is returned in outSocketNum)
|
||||||
const long inTimeoutTicks,
|
// Note that inDoThreadSwitching is pretty much irrelevant right now, since I ignore it
|
||||||
MacSocket_IdleWaitCallback inIdleWaitCallback,
|
// The inTimeoutTicks parameter is applied during reads/writes of data
|
||||||
void *inUserRefPtr);
|
// The inIdleWaitCallback parameter specifies a callback which is called during busy-waiting periods
|
||||||
|
// The inUserRefPtr parameter is passed back to the idle-wait callback
|
||||||
|
|
||||||
// Call this to connect to an IP/DNS address
|
OSErr MacSocket_socket(int *outSocketNum,const Boolean inDoThreadSwitching,const long inTimeoutTicks,MacSocket_IdleWaitCallback inIdleWaitCallback,void *inUserRefPtr);
|
||||||
// Note that inTargetAddressAndPort is in "IP:port" format-- e.g.
|
|
||||||
// 10.1.1.1:123
|
|
||||||
|
|
||||||
OSErr MacSocket_connect(const int inSocketNum, char *inTargetAddressAndPort);
|
|
||||||
|
|
||||||
// Call this to listen on a port
|
// Call this to connect to an IP/DNS address
|
||||||
// Since this a low-performance implementation, I allow a maximum of 1 (one!)
|
// Note that inTargetAddressAndPort is in "IP:port" format-- e.g. 10.1.1.1:123
|
||||||
// incoming request when I listen
|
|
||||||
|
|
||||||
OSErr MacSocket_listen(const int inSocketNum, const int inPortNum);
|
OSErr MacSocket_connect(const int inSocketNum,char *inTargetAddressAndPort);
|
||||||
|
|
||||||
// Call this to close a socket
|
|
||||||
|
// Call this to listen on a port
|
||||||
|
// Since this a low-performance implementation, I allow a maximum of 1 (one!) incoming request when I listen
|
||||||
|
|
||||||
|
OSErr MacSocket_listen(const int inSocketNum,const int inPortNum);
|
||||||
|
|
||||||
|
|
||||||
|
// Call this to close a socket
|
||||||
|
|
||||||
OSErr MacSocket_close(const int inSocketNum);
|
OSErr MacSocket_close(const int inSocketNum);
|
||||||
|
|
||||||
// Call this to receive data on a socket
|
|
||||||
// Most parameters' purpose are obvious-- except maybe "inBlock" which
|
|
||||||
// controls whether I wait for data or return immediately
|
|
||||||
|
|
||||||
int MacSocket_recv(const int inSocketNum, void *outBuff, int outBuffLength,
|
// Call this to receive data on a socket
|
||||||
const Boolean inBlock);
|
// Most parameters' purpose are obvious-- except maybe "inBlock" which controls whether I wait for data or return immediately
|
||||||
|
|
||||||
// Call this to send data on a socket
|
int MacSocket_recv(const int inSocketNum,void *outBuff,int outBuffLength,const Boolean inBlock);
|
||||||
|
|
||||||
int MacSocket_send(const int inSocketNum, const void *inBuff,
|
|
||||||
int inBuffLength);
|
|
||||||
|
|
||||||
// If zero bytes were read in a call to MacSocket_recv(), it may be that the
|
// Call this to send data on a socket
|
||||||
// remote end has done a half-close
|
|
||||||
// This function will let you check whether that's true or not
|
int MacSocket_send(const int inSocketNum,const void *inBuff,int inBuffLength);
|
||||||
|
|
||||||
|
|
||||||
|
// If zero bytes were read in a call to MacSocket_recv(), it may be that the remote end has done a half-close
|
||||||
|
// This function will let you check whether that's true or not
|
||||||
|
|
||||||
Boolean MacSocket_RemoteEndIsClosing(const int inSocketNum);
|
Boolean MacSocket_RemoteEndIsClosing(const int inSocketNum);
|
||||||
|
|
||||||
// Call this to see if the listen has completed after a call to
|
|
||||||
// MacSocket_listen()
|
// Call this to see if the listen has completed after a call to MacSocket_listen()
|
||||||
|
|
||||||
Boolean MacSocket_ListenCompleted(const int inSocketNum);
|
Boolean MacSocket_ListenCompleted(const int inSocketNum);
|
||||||
|
|
||||||
// These really aren't very useful anymore
|
|
||||||
|
// These really aren't very useful anymore
|
||||||
|
|
||||||
Boolean MacSocket_LocalEndIsOpen(const int inSocketNum);
|
Boolean MacSocket_LocalEndIsOpen(const int inSocketNum);
|
||||||
Boolean MacSocket_RemoteEndIsOpen(const int inSocketNum);
|
Boolean MacSocket_RemoteEndIsOpen(const int inSocketNum);
|
||||||
|
|
||||||
// You may wish to change the userRefPtr for a socket callback-- use this to
|
|
||||||
// do it
|
|
||||||
|
|
||||||
void MacSocket_SetUserRefPtr(const int inSocketNum, void *inNewRefPtr);
|
// You may wish to change the userRefPtr for a socket callback-- use this to do it
|
||||||
|
|
||||||
// Call these to get the socket's IP:port descriptor
|
void MacSocket_SetUserRefPtr(const int inSocketNum,void *inNewRefPtr);
|
||||||
|
|
||||||
void MacSocket_GetLocalIPAndPort(const int inSocketNum, char *outIPAndPort,
|
|
||||||
const int inIPAndPortLength);
|
|
||||||
void MacSocket_GetRemoteIPAndPort(const int inSocketNum, char *outIPAndPort,
|
|
||||||
const int inIPAndPortLength);
|
|
||||||
|
|
||||||
// Call this to get error info from a socket
|
// Call these to get the socket's IP:port descriptor
|
||||||
|
|
||||||
void MacSocket_GetSocketErrorInfo(const int inSocketNum,
|
void MacSocket_GetLocalIPAndPort(const int inSocketNum,char *outIPAndPort,const int inIPAndPortLength);
|
||||||
int *outSocketErrCode,
|
void MacSocket_GetRemoteIPAndPort(const int inSocketNum,char *outIPAndPort,const int inIPAndPortLength);
|
||||||
char *outSocketErrString,
|
|
||||||
const int inSocketErrStringMaxLength);
|
|
||||||
|
// Call this to get error info from a socket
|
||||||
|
|
||||||
|
void MacSocket_GetSocketErrorInfo(const int inSocketNum,int *outSocketErrCode,char *outSocketErrString,const int inSocketErrStringMaxLength);
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|||||||
@@ -1,42 +1,43 @@
|
|||||||
|
|
||||||
// Gathers unpredictable system data to be used for generating
|
// Gathers unpredictable system data to be used for generating
|
||||||
// random bits
|
// random bits
|
||||||
|
|
||||||
#include <MacTypes.h>
|
#include <MacTypes.h>
|
||||||
|
|
||||||
class CRandomizer {
|
class CRandomizer
|
||||||
public:
|
{
|
||||||
CRandomizer(void);
|
public:
|
||||||
void PeriodicAction(void);
|
CRandomizer (void);
|
||||||
|
void PeriodicAction (void);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
// Private calls
|
// Private calls
|
||||||
|
|
||||||
void AddTimeSinceMachineStartup(void);
|
void AddTimeSinceMachineStartup (void);
|
||||||
void AddAbsoluteSystemStartupTime(void);
|
void AddAbsoluteSystemStartupTime (void);
|
||||||
void AddAppRunningTime(void);
|
void AddAppRunningTime (void);
|
||||||
void AddStartupVolumeInfo(void);
|
void AddStartupVolumeInfo (void);
|
||||||
void AddFiller(void);
|
void AddFiller (void);
|
||||||
|
|
||||||
void AddCurrentMouse(void);
|
void AddCurrentMouse (void);
|
||||||
void AddNow(double millisecondUncertainty);
|
void AddNow (double millisecondUncertainty);
|
||||||
void AddBytes(void *data, long size, double entropy);
|
void AddBytes (void *data, long size, double entropy);
|
||||||
|
|
||||||
void GetTimeBaseResolution(void);
|
void GetTimeBaseResolution (void);
|
||||||
unsigned long SysTimer(void);
|
unsigned long SysTimer (void);
|
||||||
|
|
||||||
// System Info
|
// System Info
|
||||||
bool mSupportsLargeVolumes;
|
bool mSupportsLargeVolumes;
|
||||||
bool mIsPowerPC;
|
bool mIsPowerPC;
|
||||||
bool mIs601;
|
bool mIs601;
|
||||||
|
|
||||||
// Time info
|
// Time info
|
||||||
double mTimebaseTicksPerMillisec;
|
double mTimebaseTicksPerMillisec;
|
||||||
unsigned long mLastPeriodicTicks;
|
unsigned long mLastPeriodicTicks;
|
||||||
|
|
||||||
// Mouse info
|
// Mouse info
|
||||||
long mSamplePeriod;
|
long mSamplePeriod;
|
||||||
Point mLastMouse;
|
Point mLastMouse;
|
||||||
long mMouseStill;
|
long mMouseStill;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
#include <MacHeaders.h>
|
#include <MacHeaders.h>
|
||||||
#define B_ENDIAN
|
#define B_ENDIAN
|
||||||
#ifdef __POWERPC__
|
#ifdef __POWERPC__
|
||||||
# pragma longlong on
|
#pragma longlong on
|
||||||
#endif
|
#endif
|
||||||
#if 1
|
#if 1
|
||||||
# define MAC_OS_GUSI_SOURCE
|
#define MAC_OS_GUSI_SOURCE
|
||||||
#endif
|
#endif
|
||||||
#define MONOLITH
|
#define MONOLITH
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
#include <MacHeaders.h>
|
#include <MacHeaders.h>
|
||||||
#define B_ENDIAN
|
#define B_ENDIAN
|
||||||
#ifdef __POWERPC__
|
#ifdef __POWERPC__
|
||||||
# pragma longlong on
|
#pragma longlong on
|
||||||
#endif
|
#endif
|
||||||
#if 0
|
#if 0
|
||||||
# define MAC_OS_GUSI_SOURCE
|
#define MAC_OS_GUSI_SOURCE
|
||||||
#endif
|
#endif
|
||||||
#define MONOLITH
|
#define MONOLITH
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#ifndef MK1MF_BUILD
|
#ifndef MK1MF_BUILD
|
||||||
# define CFLAGS "-DB_ENDIAN"
|
# define CFLAGS "-DB_ENDIAN"
|
||||||
# define PLATFORM "macos"
|
# define PLATFORM "macos"
|
||||||
# define DATE "Sun Feb 27 19:44:16 MET 2000"
|
# define DATE "Sun Feb 27 19:44:16 MET 2000"
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,126 +1,116 @@
|
|||||||
/* MacOS/opensslconf.h */
|
/* MacOS/opensslconf.h */
|
||||||
|
|
||||||
#if !(defined(VMS) || defined(__VMS)) /* VMS uses logical names instead */
|
#if !(defined(VMS) || defined(__VMS)) /* VMS uses logical names instead */
|
||||||
# if defined(HEADER_CRYPTLIB_H) && !defined(OPENSSLDIR)
|
#if defined(HEADER_CRYPTLIB_H) && !defined(OPENSSLDIR)
|
||||||
# define OPENSSLDIR "/usr/local/ssl"
|
#define OPENSSLDIR "/usr/local/ssl"
|
||||||
# endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(HEADER_IDEA_H) && !defined(IDEA_INT)
|
#if defined(HEADER_IDEA_H) && !defined(IDEA_INT)
|
||||||
# define IDEA_INT unsigned int
|
#define IDEA_INT unsigned int
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(HEADER_MD2_H) && !defined(MD2_INT)
|
#if defined(HEADER_MD2_H) && !defined(MD2_INT)
|
||||||
# define MD2_INT unsigned int
|
#define MD2_INT unsigned int
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(HEADER_RC2_H) && !defined(RC2_INT)
|
#if defined(HEADER_RC2_H) && !defined(RC2_INT)
|
||||||
/* I need to put in a mod for the alpha - eay */
|
/* I need to put in a mod for the alpha - eay */
|
||||||
# define RC2_INT unsigned int
|
#define RC2_INT unsigned int
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(HEADER_RC4_H)
|
#if defined(HEADER_RC4_H)
|
||||||
# if !defined(RC4_INT)
|
#if !defined(RC4_INT)
|
||||||
|
/* using int types make the structure larger but make the code faster
|
||||||
|
* on most boxes I have tested - up to %20 faster. */
|
||||||
/*
|
/*
|
||||||
* using int types make the structure larger but make the code faster on most
|
|
||||||
* boxes I have tested - up to %20 faster.
|
|
||||||
*/
|
|
||||||
/*-
|
|
||||||
* I don't know what does "most" mean, but declaring "int" is a must on:
|
* I don't know what does "most" mean, but declaring "int" is a must on:
|
||||||
* - Intel P6 because partial register stalls are very expensive;
|
* - Intel P6 because partial register stalls are very expensive;
|
||||||
* - elder Alpha because it lacks byte load/store instructions;
|
* - elder Alpha because it lacks byte load/store instructions;
|
||||||
*/
|
*/
|
||||||
# define RC4_INT unsigned char
|
#define RC4_INT unsigned char
|
||||||
# endif
|
#endif
|
||||||
# if !defined(RC4_CHUNK)
|
#if !defined(RC4_CHUNK)
|
||||||
/*
|
/*
|
||||||
* This enables code handling data aligned at natural CPU word
|
* This enables code handling data aligned at natural CPU word
|
||||||
* boundary. See crypto/rc4/rc4_enc.c for further details.
|
* boundary. See crypto/rc4/rc4_enc.c for further details.
|
||||||
*/
|
*/
|
||||||
# define RC4_CHUNK unsigned long
|
#define RC4_CHUNK unsigned long
|
||||||
# endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(HEADER_DES_H) && !defined(DES_LONG)
|
#if defined(HEADER_DES_H) && !defined(DES_LONG)
|
||||||
/*
|
/* If this is set to 'unsigned int' on a DEC Alpha, this gives about a
|
||||||
* If this is set to 'unsigned int' on a DEC Alpha, this gives about a %20
|
* %20 speed up (longs are 8 bytes, int's are 4). */
|
||||||
* speed up (longs are 8 bytes, int's are 4).
|
#ifndef DES_LONG
|
||||||
*/
|
#define DES_LONG unsigned long
|
||||||
# ifndef DES_LONG
|
#endif
|
||||||
# define DES_LONG unsigned long
|
|
||||||
# endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(HEADER_BN_H) && !defined(CONFIG_HEADER_BN_H)
|
#if defined(HEADER_BN_H) && !defined(CONFIG_HEADER_BN_H)
|
||||||
# define CONFIG_HEADER_BN_H
|
#define CONFIG_HEADER_BN_H
|
||||||
# if __option(longlong)
|
#if __option(longlong)
|
||||||
# define BN_LLONG
|
# define BN_LLONG
|
||||||
# else
|
#else
|
||||||
# undef BN_LLONG
|
# undef BN_LLONG
|
||||||
# endif
|
#endif
|
||||||
|
|
||||||
/* Should we define BN_DIV2W here? */
|
/* Should we define BN_DIV2W here? */
|
||||||
|
|
||||||
/* Only one for the following should be defined */
|
/* Only one for the following should be defined */
|
||||||
/*
|
/* The prime number generation stuff may not work when
|
||||||
* The prime number generation stuff may not work when EIGHT_BIT but I don't
|
* EIGHT_BIT but I don't care since I've only used this mode
|
||||||
* care since I've only used this mode for debuging the bignum libraries
|
* for debuging the bignum libraries */
|
||||||
*/
|
#undef SIXTY_FOUR_BIT_LONG
|
||||||
# undef SIXTY_FOUR_BIT_LONG
|
#undef SIXTY_FOUR_BIT
|
||||||
# undef SIXTY_FOUR_BIT
|
#define THIRTY_TWO_BIT
|
||||||
# define THIRTY_TWO_BIT
|
#undef SIXTEEN_BIT
|
||||||
# undef SIXTEEN_BIT
|
#undef EIGHT_BIT
|
||||||
# undef EIGHT_BIT
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(HEADER_RC4_LOCL_H) && !defined(CONFIG_HEADER_RC4_LOCL_H)
|
#if defined(HEADER_RC4_LOCL_H) && !defined(CONFIG_HEADER_RC4_LOCL_H)
|
||||||
# define CONFIG_HEADER_RC4_LOCL_H
|
#define CONFIG_HEADER_RC4_LOCL_H
|
||||||
/*
|
/* if this is defined data[i] is used instead of *data, this is a %20
|
||||||
* if this is defined data[i] is used instead of *data, this is a %20 speedup
|
* speedup on x86 */
|
||||||
* on x86
|
#undef RC4_INDEX
|
||||||
*/
|
|
||||||
# undef RC4_INDEX
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(HEADER_BF_LOCL_H) && !defined(CONFIG_HEADER_BF_LOCL_H)
|
#if defined(HEADER_BF_LOCL_H) && !defined(CONFIG_HEADER_BF_LOCL_H)
|
||||||
# define CONFIG_HEADER_BF_LOCL_H
|
#define CONFIG_HEADER_BF_LOCL_H
|
||||||
# define BF_PTR
|
#define BF_PTR
|
||||||
#endif /* HEADER_BF_LOCL_H */
|
#endif /* HEADER_BF_LOCL_H */
|
||||||
|
|
||||||
#if defined(HEADER_DES_LOCL_H) && !defined(CONFIG_HEADER_DES_LOCL_H)
|
#if defined(HEADER_DES_LOCL_H) && !defined(CONFIG_HEADER_DES_LOCL_H)
|
||||||
# define CONFIG_HEADER_DES_LOCL_H
|
#define CONFIG_HEADER_DES_LOCL_H
|
||||||
/*
|
/* the following is tweaked from a config script, that is why it is a
|
||||||
* the following is tweaked from a config script, that is why it is a
|
* protected undef/define */
|
||||||
* protected undef/define
|
#ifndef DES_PTR
|
||||||
*/
|
#define DES_PTR
|
||||||
# ifndef DES_PTR
|
#endif
|
||||||
# define DES_PTR
|
|
||||||
# endif
|
/* This helps C compiler generate the correct code for multiple functional
|
||||||
|
* units. It reduces register dependancies at the expense of 2 more
|
||||||
/*
|
* registers */
|
||||||
* This helps C compiler generate the correct code for multiple functional
|
#ifndef DES_RISC1
|
||||||
* units. It reduces register dependancies at the expense of 2 more
|
#define DES_RISC1
|
||||||
* registers
|
#endif
|
||||||
*/
|
|
||||||
# ifndef DES_RISC1
|
#ifndef DES_RISC2
|
||||||
# define DES_RISC1
|
#undef DES_RISC2
|
||||||
# endif
|
#endif
|
||||||
|
|
||||||
# ifndef DES_RISC2
|
#if defined(DES_RISC1) && defined(DES_RISC2)
|
||||||
# undef DES_RISC2
|
YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!!
|
||||||
# endif
|
#endif
|
||||||
|
|
||||||
# if defined(DES_RISC1) && defined(DES_RISC2)
|
/* Unroll the inner loop, this sometimes helps, sometimes hinders.
|
||||||
YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED ! !!!!
|
* Very mucy CPU dependant */
|
||||||
# endif
|
#ifndef DES_UNROLL
|
||||||
/*
|
#define DES_UNROLL
|
||||||
* Unroll the inner loop, this sometimes helps, sometimes hinders. Very mucy
|
#endif
|
||||||
* CPU dependant
|
|
||||||
*/
|
#endif /* HEADER_DES_LOCL_H */
|
||||||
# ifndef DES_UNROLL
|
|
||||||
# define DES_UNROLL
|
#ifndef __POWERPC__
|
||||||
# endif
|
#define MD32_XARRAY
|
||||||
#endif /* HEADER_DES_LOCL_H */
|
|
||||||
#ifndef __POWERPC__
|
|
||||||
# define MD32_XARRAY
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
152
Makefile.org
152
Makefile.org
@@ -69,7 +69,7 @@ RANLIB= ranlib
|
|||||||
NM= nm
|
NM= nm
|
||||||
PERL= perl
|
PERL= perl
|
||||||
TAR= tar
|
TAR= tar
|
||||||
TARFLAGS= --no-recursion --record-size=10240
|
TARFLAGS= --no-recursion
|
||||||
MAKEDEPPROG=makedepend
|
MAKEDEPPROG=makedepend
|
||||||
LIBDIR=lib
|
LIBDIR=lib
|
||||||
|
|
||||||
@@ -99,8 +99,6 @@ SHA1_ASM_OBJ=
|
|||||||
RMD160_ASM_OBJ=
|
RMD160_ASM_OBJ=
|
||||||
WP_ASM_OBJ=
|
WP_ASM_OBJ=
|
||||||
CMLL_ENC=
|
CMLL_ENC=
|
||||||
MODES_ASM_OBJ=
|
|
||||||
ENGINES_ASM_OBJ=
|
|
||||||
PERLASM_SCHEME=
|
PERLASM_SCHEME=
|
||||||
|
|
||||||
# KRB5 stuff
|
# KRB5 stuff
|
||||||
@@ -111,30 +109,6 @@ LIBKRB5=
|
|||||||
ZLIB_INCLUDE=
|
ZLIB_INCLUDE=
|
||||||
LIBZLIB=
|
LIBZLIB=
|
||||||
|
|
||||||
# TOP level FIPS install directory.
|
|
||||||
FIPSDIR=
|
|
||||||
|
|
||||||
# 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 may be different so hard
|
|
||||||
# code the path.
|
|
||||||
|
|
||||||
FIPSLIBDIR=
|
|
||||||
|
|
||||||
# The location of the library which contains fipscanister.o
|
|
||||||
# normally it will be libcrypto unless fipsdso is set in which
|
|
||||||
# case it will be libfips. If not compiling in FIPS mode at all
|
|
||||||
# this is empty making it a useful test for a FIPS compile.
|
|
||||||
|
|
||||||
FIPSCANLIB=
|
|
||||||
|
|
||||||
# Shared library base address. Currently only used on Windows.
|
|
||||||
#
|
|
||||||
|
|
||||||
BASEADDR=
|
|
||||||
|
|
||||||
DIRS= crypto ssl engines apps test tools
|
DIRS= crypto ssl engines apps test tools
|
||||||
ENGDIRS= ccgost
|
ENGDIRS= ccgost
|
||||||
SHLIBDIRS= crypto ssl
|
SHLIBDIRS= crypto ssl
|
||||||
@@ -147,7 +121,7 @@ SDIRS= \
|
|||||||
bn ec rsa dsa ecdsa dh ecdh dso engine \
|
bn ec rsa dsa ecdsa dh ecdh dso engine \
|
||||||
buffer bio stack lhash rand err \
|
buffer bio stack lhash rand err \
|
||||||
evp asn1 pem x509 x509v3 conf txt_db pkcs7 pkcs12 comp ocsp ui krb5 \
|
evp asn1 pem x509 x509v3 conf txt_db pkcs7 pkcs12 comp ocsp ui krb5 \
|
||||||
cms pqueue ts jpake srp store cmac
|
cms pqueue ts jpake store
|
||||||
# keep in mind that the above list is adjusted by ./Configure
|
# keep in mind that the above list is adjusted by ./Configure
|
||||||
# according to no-xxx arguments...
|
# according to no-xxx arguments...
|
||||||
|
|
||||||
@@ -179,11 +153,12 @@ SHARED_LDFLAGS=
|
|||||||
GENERAL= Makefile
|
GENERAL= Makefile
|
||||||
BASENAME= openssl
|
BASENAME= openssl
|
||||||
NAME= $(BASENAME)-$(VERSION)
|
NAME= $(BASENAME)-$(VERSION)
|
||||||
TARFILE= ../$(NAME).tar
|
TARFILE= $(NAME).tar
|
||||||
|
WTARFILE= $(NAME)-win.tar
|
||||||
EXHEADER= e_os2.h
|
EXHEADER= e_os2.h
|
||||||
HEADER= e_os.h
|
HEADER= e_os.h
|
||||||
|
|
||||||
all: Makefile build_all
|
all: Makefile build_all openssl.pc libssl.pc libcrypto.pc
|
||||||
|
|
||||||
# as we stick to -e, CLEARENV ensures that local variables in lower
|
# as we stick to -e, CLEARENV ensures that local variables in lower
|
||||||
# Makefiles remain local and variable. $${VAR+VAR} is tribute to Korn
|
# Makefiles remain local and variable. $${VAR+VAR} is tribute to Korn
|
||||||
@@ -197,7 +172,7 @@ CLEARENV= TOP= && unset TOP $${LIB+LIB} $${LIBS+LIBS} \
|
|||||||
$${EXHEADER+EXHEADER} $${HEADER+HEADER} \
|
$${EXHEADER+EXHEADER} $${HEADER+HEADER} \
|
||||||
$${GENERAL+GENERAL} $${CFLAGS+CFLAGS} \
|
$${GENERAL+GENERAL} $${CFLAGS+CFLAGS} \
|
||||||
$${ASFLAGS+ASFLAGS} $${AFLAGS+AFLAGS} \
|
$${ASFLAGS+ASFLAGS} $${AFLAGS+AFLAGS} \
|
||||||
$${LDCMD+LDCMD} $${LDFLAGS+LDFLAGS} $${SCRIPTS+SCRIPTS} \
|
$${LDCMD+LDCMD} $${LDFLAGS+LDFLAGS} \
|
||||||
$${SHAREDCMD+SHAREDCMD} $${SHAREDFLAGS+SHAREDFLAGS} \
|
$${SHAREDCMD+SHAREDCMD} $${SHAREDFLAGS+SHAREDFLAGS} \
|
||||||
$${SHARED_LIB+SHARED_LIB} $${LIBEXTRAS+LIBEXTRAS}
|
$${SHARED_LIB+SHARED_LIB} $${LIBEXTRAS+LIBEXTRAS}
|
||||||
|
|
||||||
@@ -229,12 +204,7 @@ BUILDENV= PLATFORM='$(PLATFORM)' PROCESSOR='$(PROCESSOR)' \
|
|||||||
MD5_ASM_OBJ='$(MD5_ASM_OBJ)' \
|
MD5_ASM_OBJ='$(MD5_ASM_OBJ)' \
|
||||||
RMD160_ASM_OBJ='$(RMD160_ASM_OBJ)' \
|
RMD160_ASM_OBJ='$(RMD160_ASM_OBJ)' \
|
||||||
WP_ASM_OBJ='$(WP_ASM_OBJ)' \
|
WP_ASM_OBJ='$(WP_ASM_OBJ)' \
|
||||||
MODES_ASM_OBJ='$(MODES_ASM_OBJ)' \
|
|
||||||
ENGINES_ASM_OBJ='$(ENGINES_ASM_OBJ)' \
|
|
||||||
PERLASM_SCHEME='$(PERLASM_SCHEME)' \
|
PERLASM_SCHEME='$(PERLASM_SCHEME)' \
|
||||||
FIPSLIBDIR='${FIPSLIBDIR}' \
|
|
||||||
FIPSDIR='${FIPSDIR}' \
|
|
||||||
FIPSCANLIB="$${FIPSCANLIB:-$(FIPSCANLIB)}" \
|
|
||||||
THIS=$${THIS:-$@} MAKEFILE=Makefile MAKEOVERRIDES=
|
THIS=$${THIS:-$@} MAKEFILE=Makefile MAKEOVERRIDES=
|
||||||
# MAKEOVERRIDES= effectively "equalizes" GNU-ish and SysV-ish make flavors,
|
# MAKEOVERRIDES= effectively "equalizes" GNU-ish and SysV-ish make flavors,
|
||||||
# which in turn eliminates ambiguities in variable treatment with -e.
|
# which in turn eliminates ambiguities in variable treatment with -e.
|
||||||
@@ -267,46 +237,30 @@ reflect:
|
|||||||
@[ -n "$(THIS)" ] && $(CLEARENV) && $(MAKE) $(THIS) -e $(BUILDENV)
|
@[ -n "$(THIS)" ] && $(CLEARENV) && $(MAKE) $(THIS) -e $(BUILDENV)
|
||||||
|
|
||||||
sub_all: build_all
|
sub_all: build_all
|
||||||
|
|
||||||
build_all: build_libs build_apps build_tests build_tools
|
build_all: build_libs build_apps build_tests build_tools
|
||||||
|
|
||||||
build_libs: build_libcrypto build_libssl openssl.pc
|
build_libs: build_crypto build_ssl build_engines
|
||||||
|
|
||||||
build_libcrypto: build_crypto build_engines libcrypto.pc
|
|
||||||
build_libssl: build_ssl libssl.pc
|
|
||||||
|
|
||||||
build_crypto:
|
build_crypto:
|
||||||
@dir=crypto; target=all; $(BUILD_ONE_CMD)
|
@dir=crypto; target=all; $(BUILD_ONE_CMD)
|
||||||
build_ssl: build_crypto
|
build_ssl:
|
||||||
@dir=ssl; target=all; $(BUILD_ONE_CMD)
|
@dir=ssl; target=all; $(BUILD_ONE_CMD)
|
||||||
build_engines: build_crypto
|
build_engines:
|
||||||
@dir=engines; target=all; $(BUILD_ONE_CMD)
|
@dir=engines; target=all; $(BUILD_ONE_CMD)
|
||||||
build_apps: build_libs
|
build_apps:
|
||||||
@dir=apps; target=all; $(BUILD_ONE_CMD)
|
@dir=apps; target=all; $(BUILD_ONE_CMD)
|
||||||
build_tests: build_libs
|
build_tests:
|
||||||
@dir=test; target=all; $(BUILD_ONE_CMD)
|
@dir=test; target=all; $(BUILD_ONE_CMD)
|
||||||
build_tools: build_libs
|
build_tools:
|
||||||
@dir=tools; target=all; $(BUILD_ONE_CMD)
|
@dir=tools; target=all; $(BUILD_ONE_CMD)
|
||||||
|
|
||||||
all_testapps: build_libs build_testapps
|
all_testapps: build_libs build_testapps
|
||||||
build_testapps:
|
build_testapps:
|
||||||
@dir=crypto; target=testapps; $(BUILD_ONE_CMD)
|
@dir=crypto; target=testapps; $(BUILD_ONE_CMD)
|
||||||
|
|
||||||
fips_premain_dso$(EXE_EXT): libcrypto.a
|
libcrypto$(SHLIB_EXT): libcrypto.a
|
||||||
[ -z "$(FIPSCANLIB)" ] || $(CC) $(CFLAG) -Iinclude \
|
|
||||||
-DFINGERPRINT_PREMAIN_DSO_LOAD -o $@ \
|
|
||||||
$(FIPSLIBDIR)fips_premain.c $(FIPSLIBDIR)fipscanister.o \
|
|
||||||
libcrypto.a $(EX_LIBS)
|
|
||||||
|
|
||||||
libcrypto$(SHLIB_EXT): libcrypto.a fips_premain_dso$(EXE_EXT)
|
|
||||||
@if [ "$(SHLIB_TARGET)" != "" ]; then \
|
@if [ "$(SHLIB_TARGET)" != "" ]; then \
|
||||||
if [ "$(FIPSCANLIB)" = "libcrypto" ]; then \
|
$(MAKE) SHLIBDIRS=crypto build-shared; \
|
||||||
FIPSLD_LIBCRYPTO=libcrypto.a ; \
|
|
||||||
FIPSLD_CC="$(CC)"; CC=$(FIPSDIR)/bin/fipsld; \
|
|
||||||
export CC FIPSLD_CC FIPSLD_LIBCRYPTO; \
|
|
||||||
fi; \
|
|
||||||
$(MAKE) -e SHLIBDIRS=crypto CC="$${CC:-$(CC)}" build-shared && \
|
|
||||||
(touch -c fips_premain_dso$(EXE_EXT) || :); \
|
|
||||||
else \
|
else \
|
||||||
echo "There's no support for shared libraries on this platform" >&2; \
|
echo "There's no support for shared libraries on this platform" >&2; \
|
||||||
exit 1; \
|
exit 1; \
|
||||||
@@ -368,8 +322,7 @@ libcrypto.pc: Makefile
|
|||||||
echo 'Description: OpenSSL cryptography library'; \
|
echo 'Description: OpenSSL cryptography library'; \
|
||||||
echo 'Version: '$(VERSION); \
|
echo 'Version: '$(VERSION); \
|
||||||
echo 'Requires: '; \
|
echo 'Requires: '; \
|
||||||
echo 'Libs: -L$${libdir} -lcrypto'; \
|
echo 'Libs: -L$${libdir} -lcrypto $(EX_LIBS)'; \
|
||||||
echo 'Libs.private: $(EX_LIBS)'; \
|
|
||||||
echo 'Cflags: -I$${includedir} $(KRB5_INCLUDES)' ) > libcrypto.pc
|
echo 'Cflags: -I$${includedir} $(KRB5_INCLUDES)' ) > libcrypto.pc
|
||||||
|
|
||||||
libssl.pc: Makefile
|
libssl.pc: Makefile
|
||||||
@@ -382,8 +335,7 @@ libssl.pc: Makefile
|
|||||||
echo 'Description: Secure Sockets Layer and cryptography libraries'; \
|
echo 'Description: Secure Sockets Layer and cryptography libraries'; \
|
||||||
echo 'Version: '$(VERSION); \
|
echo 'Version: '$(VERSION); \
|
||||||
echo 'Requires: '; \
|
echo 'Requires: '; \
|
||||||
echo 'Libs: -L$${libdir} -lssl -lcrypto'; \
|
echo 'Libs: -L$${libdir} -lssl -lcrypto $(EX_LIBS)'; \
|
||||||
echo 'Libs.private: $(EX_LIBS)'; \
|
|
||||||
echo 'Cflags: -I$${includedir} $(KRB5_INCLUDES)' ) > libssl.pc
|
echo 'Cflags: -I$${includedir} $(KRB5_INCLUDES)' ) > libssl.pc
|
||||||
|
|
||||||
openssl.pc: Makefile
|
openssl.pc: Makefile
|
||||||
@@ -396,8 +348,7 @@ openssl.pc: Makefile
|
|||||||
echo 'Description: Secure Sockets Layer and cryptography libraries and tools'; \
|
echo 'Description: Secure Sockets Layer and cryptography libraries and tools'; \
|
||||||
echo 'Version: '$(VERSION); \
|
echo 'Version: '$(VERSION); \
|
||||||
echo 'Requires: '; \
|
echo 'Requires: '; \
|
||||||
echo 'Libs: -L$${libdir} -lssl -lcrypto'; \
|
echo 'Libs: -L$${libdir} -lssl -lcrypto $(EX_LIBS)'; \
|
||||||
echo 'Libs.private: $(EX_LIBS)'; \
|
|
||||||
echo 'Cflags: -I$${includedir} $(KRB5_INCLUDES)' ) > openssl.pc
|
echo 'Cflags: -I$${includedir} $(KRB5_INCLUDES)' ) > openssl.pc
|
||||||
|
|
||||||
Makefile: Makefile.org Configure config
|
Makefile: Makefile.org Configure config
|
||||||
@@ -406,7 +357,7 @@ Makefile: Makefile.org Configure config
|
|||||||
@false
|
@false
|
||||||
|
|
||||||
libclean:
|
libclean:
|
||||||
rm -f *.map *.so *.so.* *.dylib *.dll engines/*.so engines/*.dll engines/*.dylib *.a engines/*.a */lib */*/lib
|
rm -f *.map *.so *.so.* *.dll engines/*.so engines/*.dll *.a engines/*.a */lib */*/lib
|
||||||
|
|
||||||
clean: libclean
|
clean: libclean
|
||||||
rm -f shlib/*.o *.o core a.out fluff rehash.time testlog make.log cctest cctest.c
|
rm -f shlib/*.o *.o core a.out fluff rehash.time testlog make.log cctest cctest.c
|
||||||
@@ -448,7 +399,7 @@ rehash.time: certs apps
|
|||||||
[ -x "apps/openssl.exe" ] && OPENSSL="apps/openssl.exe" || :; \
|
[ -x "apps/openssl.exe" ] && OPENSSL="apps/openssl.exe" || :; \
|
||||||
OPENSSL_DEBUG_MEMORY=on; \
|
OPENSSL_DEBUG_MEMORY=on; \
|
||||||
export OPENSSL OPENSSL_DEBUG_MEMORY; \
|
export OPENSSL OPENSSL_DEBUG_MEMORY; \
|
||||||
$(PERL) tools/c_rehash certs/demo) && \
|
$(PERL) tools/c_rehash certs) && \
|
||||||
touch rehash.time; \
|
touch rehash.time; \
|
||||||
else :; fi
|
else :; fi
|
||||||
|
|
||||||
@@ -462,9 +413,6 @@ tests: rehash
|
|||||||
report:
|
report:
|
||||||
@$(PERL) util/selftest.pl
|
@$(PERL) util/selftest.pl
|
||||||
|
|
||||||
update: errors stacks util/libeay.num util/ssleay.num TABLE
|
|
||||||
@set -e; target=update; $(RECURSIVE_BUILD_CMD)
|
|
||||||
|
|
||||||
depend:
|
depend:
|
||||||
@set -e; target=depend; $(RECURSIVE_BUILD_CMD)
|
@set -e; target=depend; $(RECURSIVE_BUILD_CMD)
|
||||||
|
|
||||||
@@ -476,9 +424,9 @@ tags:
|
|||||||
find . -name '[^.]*.[ch]' | xargs etags -a
|
find . -name '[^.]*.[ch]' | xargs etags -a
|
||||||
|
|
||||||
errors:
|
errors:
|
||||||
$(PERL) util/ck_errf.pl -strict */*.c */*/*.c
|
|
||||||
$(PERL) util/mkerr.pl -recurse -write
|
$(PERL) util/mkerr.pl -recurse -write
|
||||||
(cd engines; $(MAKE) PERL=$(PERL) errors)
|
(cd engines; $(MAKE) PERL=$(PERL) errors)
|
||||||
|
$(PERL) util/ck_errf.pl */*.c */*/*.c
|
||||||
|
|
||||||
stacks:
|
stacks:
|
||||||
$(PERL) util/mkstack.pl -write
|
$(PERL) util/mkstack.pl -write
|
||||||
@@ -489,44 +437,60 @@ util/libeay.num::
|
|||||||
util/ssleay.num::
|
util/ssleay.num::
|
||||||
$(PERL) util/mkdef.pl ssl update
|
$(PERL) util/mkdef.pl ssl update
|
||||||
|
|
||||||
|
crypto/objects/obj_dat.h: crypto/objects/obj_dat.pl crypto/objects/obj_mac.h
|
||||||
|
$(PERL) crypto/objects/obj_dat.pl crypto/objects/obj_mac.h crypto/objects/obj_dat.h
|
||||||
|
crypto/objects/obj_mac.h: crypto/objects/objects.pl crypto/objects/objects.txt crypto/objects/obj_mac.num
|
||||||
|
$(PERL) crypto/objects/objects.pl crypto/objects/objects.txt crypto/objects/obj_mac.num crypto/objects/obj_mac.h
|
||||||
|
crypto/objects/obj_xref.h: crypto/objects/objxref.pl crypto/objects/obj_xref.txt crypto/objects/obj_mac.num
|
||||||
|
$(PERL) crypto/objects/objxref.pl crypto/objects/obj_mac.num crypto/objects/obj_xref.txt >crypto/objects/obj_xref.h
|
||||||
|
|
||||||
|
apps/openssl-vms.cnf: apps/openssl.cnf
|
||||||
|
$(PERL) VMS/VMSify-conf.pl < apps/openssl.cnf > apps/openssl-vms.cnf
|
||||||
|
|
||||||
|
crypto/bn/bn_prime.h: crypto/bn/bn_prime.pl
|
||||||
|
$(PERL) crypto/bn/bn_prime.pl >crypto/bn/bn_prime.h
|
||||||
|
|
||||||
|
|
||||||
TABLE: Configure
|
TABLE: Configure
|
||||||
(echo 'Output of `Configure TABLE'"':"; \
|
(echo 'Output of `Configure TABLE'"':"; \
|
||||||
$(PERL) Configure TABLE) > TABLE
|
$(PERL) Configure TABLE) > TABLE
|
||||||
|
|
||||||
|
update: errors stacks util/libeay.num util/ssleay.num crypto/objects/obj_dat.h crypto/objects/obj_xref.h apps/openssl-vms.cnf crypto/bn/bn_prime.h TABLE depend
|
||||||
|
|
||||||
# Build distribution tar-file. As the list of files returned by "find" is
|
# Build distribution tar-file. As the list of files returned by "find" is
|
||||||
# pretty long, on several platforms a "too many arguments" error or similar
|
# pretty long, on several platforms a "too many arguments" error or similar
|
||||||
# would occur. Therefore the list of files is temporarily stored into a file
|
# would occur. Therefore the list of files is temporarily stored into a file
|
||||||
# and read directly, requiring GNU-Tar. Call "make TAR=gtar dist" if the normal
|
# and read directly, requiring GNU-Tar. Call "make TAR=gtar dist" if the normal
|
||||||
# tar does not support the --files-from option.
|
# tar does not support the --files-from option.
|
||||||
TAR_COMMAND=$(TAR) $(TARFLAGS) --files-from $(TARFILE).list \
|
tar:
|
||||||
--owner 0 --group 0 \
|
|
||||||
--transform 's|^|$(NAME)/|' \
|
|
||||||
-cvf -
|
|
||||||
|
|
||||||
$(TARFILE).list:
|
|
||||||
find * \! -name STATUS \! -name TABLE \! -name '*.o' \! -name '*.a' \
|
|
||||||
\! -name '*.so' \! -name '*.so.*' \! -name 'openssl' \
|
|
||||||
\( \! -name '*test' -o -name bctest -o -name pod2mantest \) \
|
|
||||||
\! -name '.#*' \! -name '*~' \! -type l \
|
|
||||||
| sort > $(TARFILE).list
|
|
||||||
|
|
||||||
tar: $(TARFILE).list
|
|
||||||
find . -type d -print | xargs chmod 755
|
find . -type d -print | xargs chmod 755
|
||||||
find . -type f -print | xargs chmod a+r
|
find . -type f -print | xargs chmod a+r
|
||||||
find . -type f -perm -0100 -print | xargs chmod a+x
|
find . -type f -perm -0100 -print | xargs chmod a+x
|
||||||
$(TAR_COMMAND) | gzip --best > $(TARFILE).gz
|
find * \! -path CVS/\* \! -path \*/CVS/\* \! -name CVS \! -name .cvsignore \! -name STATUS \! -name TABLE | sort > ../$(TARFILE).list; \
|
||||||
rm -f $(TARFILE).list
|
$(TAR) $(TARFLAGS) --files-from ../$(TARFILE).list -cvf - | \
|
||||||
ls -l $(TARFILE).gz
|
tardy --user_number=0 --user_name=openssl \
|
||||||
|
--group_number=0 --group_name=openssl \
|
||||||
|
--prefix=openssl-$(VERSION) - |\
|
||||||
|
gzip --best >../$(TARFILE).gz; \
|
||||||
|
rm -f ../$(TARFILE).list; \
|
||||||
|
ls -l ../$(TARFILE).gz
|
||||||
|
|
||||||
tar-snap: $(TARFILE).list
|
tar-snap:
|
||||||
$(TAR_COMMAND) > $(TARFILE)
|
@$(TAR) $(TARFLAGS) -cvf - \
|
||||||
rm -f $(TARFILE).list
|
`find * \! -path CVS/\* \! -path \*/CVS/\* \! -name CVS \! -name .cvsignore \! -name STATUS \! -name TABLE \! -name '*.o' \! -name '*.a' \! -name '*.so' \! -name '*.so.*' \! -name 'openssl' \! -name '*test' \! -name '.#*' \! -name '*~' | sort` |\
|
||||||
ls -l $(TARFILE)
|
tardy --user_number=0 --user_name=openssl \
|
||||||
|
--group_number=0 --group_name=openssl \
|
||||||
|
--prefix=openssl-$(VERSION) - > ../$(TARFILE);\
|
||||||
|
ls -l ../$(TARFILE)
|
||||||
|
|
||||||
dist:
|
dist:
|
||||||
$(PERL) Configure dist
|
$(PERL) Configure dist
|
||||||
|
@$(MAKE) dist_pem_h
|
||||||
@$(MAKE) SDIRS='$(SDIRS)' clean
|
@$(MAKE) SDIRS='$(SDIRS)' clean
|
||||||
@$(MAKE) TAR='$(TAR)' TARFLAGS='$(TARFLAGS)' $(DISTTARVARS) tar
|
@$(MAKE) TAR='$(TAR)' TARFLAGS='$(TARFLAGS)' tar
|
||||||
|
|
||||||
|
dist_pem_h:
|
||||||
|
(cd crypto/pem; $(MAKE) -e $(BUILDENV) pem.h; $(MAKE) clean)
|
||||||
|
|
||||||
install: all install_docs install_sw
|
install: all install_docs install_sw
|
||||||
|
|
||||||
@@ -545,7 +509,7 @@ install_sw:
|
|||||||
chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \
|
chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \
|
||||||
done;
|
done;
|
||||||
@set -e; target=install; $(RECURSIVE_BUILD_CMD)
|
@set -e; target=install; $(RECURSIVE_BUILD_CMD)
|
||||||
@set -e; liblist="$(LIBS)"; for i in $$liblist ;\
|
@set -e; for i in $(LIBS) ;\
|
||||||
do \
|
do \
|
||||||
if [ -f "$$i" ]; then \
|
if [ -f "$$i" ]; then \
|
||||||
( echo installing $$i; \
|
( echo installing $$i; \
|
||||||
|
|||||||
292
NEWS
292
NEWS
@@ -5,172 +5,7 @@
|
|||||||
This file gives a brief overview of the major changes between each OpenSSL
|
This file gives a brief overview of the major changes between each OpenSSL
|
||||||
release. For more details please read the CHANGES file.
|
release. For more details please read the CHANGES file.
|
||||||
|
|
||||||
Major changes between OpenSSL 1.0.1s and OpenSSL 1.0.1t [under development]
|
Major changes between OpenSSL 1.0.0e and OpenSSL 1.0.0f:
|
||||||
|
|
||||||
o
|
|
||||||
|
|
||||||
Major changes between OpenSSL 1.0.1r and OpenSSL 1.0.1s [1 Mar 2016]
|
|
||||||
|
|
||||||
o Disable weak ciphers in SSLv3 and up in default builds of OpenSSL.
|
|
||||||
o Disable SSLv2 default build, default negotiation and weak ciphers
|
|
||||||
(CVE-2016-0800)
|
|
||||||
o Fix a double-free in DSA code (CVE-2016-0705)
|
|
||||||
o Disable SRP fake user seed to address a server memory leak
|
|
||||||
(CVE-2016-0798)
|
|
||||||
o Fix BN_hex2bn/BN_dec2bn NULL pointer deref/heap corruption
|
|
||||||
(CVE-2016-0797)
|
|
||||||
o Fix memory issues in BIO_*printf functions (CVE-2016-0799)
|
|
||||||
o Fix side channel attack on modular exponentiation (CVE-2016-0702)
|
|
||||||
|
|
||||||
Major changes between OpenSSL 1.0.1q and OpenSSL 1.0.1r [28 Jan 2016]
|
|
||||||
|
|
||||||
o Protection for DH small subgroup attacks
|
|
||||||
o SSLv2 doesn't block disabled ciphers (CVE-2015-3197)
|
|
||||||
|
|
||||||
Major changes between OpenSSL 1.0.1p and OpenSSL 1.0.1q [3 Dec 2015]
|
|
||||||
|
|
||||||
o Certificate verify crash with missing PSS parameter (CVE-2015-3194)
|
|
||||||
o X509_ATTRIBUTE memory leak (CVE-2015-3195)
|
|
||||||
o Rewrite EVP_DecodeUpdate (base64 decoding) to fix several bugs
|
|
||||||
o In DSA_generate_parameters_ex, if the provided seed is too short,
|
|
||||||
return an error
|
|
||||||
|
|
||||||
Major changes between OpenSSL 1.0.1o and OpenSSL 1.0.1p [9 Jul 2015]
|
|
||||||
|
|
||||||
o Alternate chains certificate forgery (CVE-2015-1793)
|
|
||||||
o Race condition handling PSK identify hint (CVE-2015-3196)
|
|
||||||
|
|
||||||
Major changes between OpenSSL 1.0.1n and OpenSSL 1.0.1o [12 Jun 2015]
|
|
||||||
|
|
||||||
o Fix HMAC ABI incompatibility
|
|
||||||
|
|
||||||
Major changes between OpenSSL 1.0.1m and OpenSSL 1.0.1n [11 Jun 2015]
|
|
||||||
|
|
||||||
o Malformed ECParameters causes infinite loop (CVE-2015-1788)
|
|
||||||
o Exploitable out-of-bounds read in X509_cmp_time (CVE-2015-1789)
|
|
||||||
o PKCS7 crash with missing EnvelopedContent (CVE-2015-1790)
|
|
||||||
o CMS verify infinite loop with unknown hash function (CVE-2015-1792)
|
|
||||||
o Race condition handling NewSessionTicket (CVE-2015-1791)
|
|
||||||
|
|
||||||
Major changes between OpenSSL 1.0.1l and OpenSSL 1.0.1m [19 Mar 2015]
|
|
||||||
|
|
||||||
o Segmentation fault in ASN1_TYPE_cmp fix (CVE-2015-0286)
|
|
||||||
o ASN.1 structure reuse memory corruption fix (CVE-2015-0287)
|
|
||||||
o PKCS7 NULL pointer dereferences fix (CVE-2015-0289)
|
|
||||||
o DoS via reachable assert in SSLv2 servers fix (CVE-2015-0293)
|
|
||||||
o Use After Free following d2i_ECPrivatekey error fix (CVE-2015-0209)
|
|
||||||
o X509_to_X509_REQ NULL pointer deref fix (CVE-2015-0288)
|
|
||||||
o Removed the export ciphers from the DEFAULT ciphers
|
|
||||||
|
|
||||||
Major changes between OpenSSL 1.0.1k and OpenSSL 1.0.1l [15 Jan 2015]
|
|
||||||
|
|
||||||
o Build fixes for the Windows and OpenVMS platforms
|
|
||||||
|
|
||||||
Major changes between OpenSSL 1.0.1j and OpenSSL 1.0.1k [8 Jan 2015]
|
|
||||||
|
|
||||||
o Fix for CVE-2014-3571
|
|
||||||
o Fix for CVE-2015-0206
|
|
||||||
o Fix for CVE-2014-3569
|
|
||||||
o Fix for CVE-2014-3572
|
|
||||||
o Fix for CVE-2015-0204
|
|
||||||
o Fix for CVE-2015-0205
|
|
||||||
o Fix for CVE-2014-8275
|
|
||||||
o Fix for CVE-2014-3570
|
|
||||||
|
|
||||||
Major changes between OpenSSL 1.0.1i and OpenSSL 1.0.1j [15 Oct 2014]
|
|
||||||
|
|
||||||
o Fix for CVE-2014-3513
|
|
||||||
o Fix for CVE-2014-3567
|
|
||||||
o Mitigation for CVE-2014-3566 (SSL protocol vulnerability)
|
|
||||||
o Fix for CVE-2014-3568
|
|
||||||
|
|
||||||
Major changes between OpenSSL 1.0.1h and OpenSSL 1.0.1i [6 Aug 2014]
|
|
||||||
|
|
||||||
o Fix for CVE-2014-3512
|
|
||||||
o Fix for CVE-2014-3511
|
|
||||||
o Fix for CVE-2014-3510
|
|
||||||
o Fix for CVE-2014-3507
|
|
||||||
o Fix for CVE-2014-3506
|
|
||||||
o Fix for CVE-2014-3505
|
|
||||||
o Fix for CVE-2014-3509
|
|
||||||
o Fix for CVE-2014-5139
|
|
||||||
o Fix for CVE-2014-3508
|
|
||||||
|
|
||||||
Major changes between OpenSSL 1.0.1g and OpenSSL 1.0.1h [5 Jun 2014]
|
|
||||||
|
|
||||||
o Fix for CVE-2014-0224
|
|
||||||
o Fix for CVE-2014-0221
|
|
||||||
o Fix for CVE-2014-0198
|
|
||||||
o Fix for CVE-2014-0195
|
|
||||||
o Fix for CVE-2014-3470
|
|
||||||
o Fix for CVE-2010-5298
|
|
||||||
|
|
||||||
Major changes between OpenSSL 1.0.1f and OpenSSL 1.0.1g [7 Apr 2014]
|
|
||||||
|
|
||||||
o Fix for CVE-2014-0160
|
|
||||||
o Add TLS padding extension workaround for broken servers.
|
|
||||||
o Fix for CVE-2014-0076
|
|
||||||
|
|
||||||
Major changes between OpenSSL 1.0.1e and OpenSSL 1.0.1f [6 Jan 2014]
|
|
||||||
|
|
||||||
o Don't include gmt_unix_time in TLS server and client random values
|
|
||||||
o Fix for TLS record tampering bug CVE-2013-4353
|
|
||||||
o Fix for TLS version checking bug CVE-2013-6449
|
|
||||||
o Fix for DTLS retransmission bug CVE-2013-6450
|
|
||||||
|
|
||||||
Major changes between OpenSSL 1.0.1d and OpenSSL 1.0.1e [11 Feb 2013]:
|
|
||||||
|
|
||||||
o Corrected fix for CVE-2013-0169
|
|
||||||
|
|
||||||
Major changes between OpenSSL 1.0.1c and OpenSSL 1.0.1d [4 Feb 2013]:
|
|
||||||
|
|
||||||
o Fix renegotiation in TLS 1.1, 1.2 by using the correct TLS version.
|
|
||||||
o Include the fips configuration module.
|
|
||||||
o Fix OCSP bad key DoS attack CVE-2013-0166
|
|
||||||
o Fix for SSL/TLS/DTLS CBC plaintext recovery attack CVE-2013-0169
|
|
||||||
o Fix for TLS AESNI record handling flaw CVE-2012-2686
|
|
||||||
|
|
||||||
Major changes between OpenSSL 1.0.1b and OpenSSL 1.0.1c [10 May 2012]:
|
|
||||||
|
|
||||||
o Fix TLS/DTLS record length checking bug CVE-2012-2333
|
|
||||||
o Don't attempt to use non-FIPS composite ciphers in FIPS mode.
|
|
||||||
|
|
||||||
Major changes between OpenSSL 1.0.1a and OpenSSL 1.0.1b [26 Apr 2012]:
|
|
||||||
|
|
||||||
o Fix compilation error on non-x86 platforms.
|
|
||||||
o Make FIPS capable OpenSSL ciphers work in non-FIPS mode.
|
|
||||||
o Fix SSL_OP_NO_TLSv1_1 clash with SSL_OP_ALL in OpenSSL 1.0.0
|
|
||||||
|
|
||||||
Major changes between OpenSSL 1.0.1 and OpenSSL 1.0.1a [19 Apr 2012]:
|
|
||||||
|
|
||||||
o Fix for ASN1 overflow bug CVE-2012-2110
|
|
||||||
o Workarounds for some servers that hang on long client hellos.
|
|
||||||
o Fix SEGV in AES code.
|
|
||||||
|
|
||||||
Major changes between OpenSSL 1.0.0h and OpenSSL 1.0.1 [14 Mar 2012]:
|
|
||||||
|
|
||||||
o TLS/DTLS heartbeat support.
|
|
||||||
o SCTP support.
|
|
||||||
o RFC 5705 TLS key material exporter.
|
|
||||||
o RFC 5764 DTLS-SRTP negotiation.
|
|
||||||
o Next Protocol Negotiation.
|
|
||||||
o PSS signatures in certificates, requests and CRLs.
|
|
||||||
o Support for password based recipient info for CMS.
|
|
||||||
o Support TLS v1.2 and TLS v1.1.
|
|
||||||
o Preliminary FIPS capability for unvalidated 2.0 FIPS module.
|
|
||||||
o SRP support.
|
|
||||||
|
|
||||||
Major changes between OpenSSL 1.0.0g and OpenSSL 1.0.0h [12 Mar 2012]:
|
|
||||||
|
|
||||||
o Fix for CMS/PKCS#7 MMA CVE-2012-0884
|
|
||||||
o Corrected fix for CVE-2011-4619
|
|
||||||
o Various DTLS fixes.
|
|
||||||
|
|
||||||
Major changes between OpenSSL 1.0.0f and OpenSSL 1.0.0g [18 Jan 2012]:
|
|
||||||
|
|
||||||
o Fix for DTLS DoS issue CVE-2012-0050
|
|
||||||
|
|
||||||
Major changes between OpenSSL 1.0.0e and OpenSSL 1.0.0f [4 Jan 2012]:
|
|
||||||
|
|
||||||
o Fix for DTLS plaintext recovery attack CVE-2011-4108
|
o Fix for DTLS plaintext recovery attack CVE-2011-4108
|
||||||
o Clear block padding bytes of SSL 3.0 records CVE-2011-4576
|
o Clear block padding bytes of SSL 3.0 records CVE-2011-4576
|
||||||
@@ -178,7 +13,7 @@
|
|||||||
o Check parameters are not NULL in GOST ENGINE CVE-2012-0027
|
o Check parameters are not NULL in GOST ENGINE CVE-2012-0027
|
||||||
o Check for malformed RFC3779 data CVE-2011-4577
|
o Check for malformed RFC3779 data CVE-2011-4577
|
||||||
|
|
||||||
Major changes between OpenSSL 1.0.0d and OpenSSL 1.0.0e [6 Sep 2011]:
|
Major changes between OpenSSL 1.0.0d and OpenSSL 1.0.0e:
|
||||||
|
|
||||||
o Fix for CRL vulnerability issue CVE-2011-3207
|
o Fix for CRL vulnerability issue CVE-2011-3207
|
||||||
o Fix for ECDH crashes CVE-2011-3210
|
o Fix for ECDH crashes CVE-2011-3210
|
||||||
@@ -186,11 +21,11 @@
|
|||||||
o Support ECDH ciphersuites for certificates using SHA2 algorithms.
|
o Support ECDH ciphersuites for certificates using SHA2 algorithms.
|
||||||
o Various DTLS fixes.
|
o Various DTLS fixes.
|
||||||
|
|
||||||
Major changes between OpenSSL 1.0.0c and OpenSSL 1.0.0d [8 Feb 2011]:
|
Major changes between OpenSSL 1.0.0c and OpenSSL 1.0.0d:
|
||||||
|
|
||||||
o Fix for security issue CVE-2011-0014
|
o Fix for security issue CVE-2011-0014
|
||||||
|
|
||||||
Major changes between OpenSSL 1.0.0b and OpenSSL 1.0.0c [2 Dec 2010]:
|
Major changes between OpenSSL 1.0.0b and OpenSSL 1.0.0c:
|
||||||
|
|
||||||
o Fix for security issue CVE-2010-4180
|
o Fix for security issue CVE-2010-4180
|
||||||
o Fix for CVE-2010-4252
|
o Fix for CVE-2010-4252
|
||||||
@@ -198,18 +33,18 @@
|
|||||||
o Fix various platform compilation issues.
|
o Fix various platform compilation issues.
|
||||||
o Corrected fix for security issue CVE-2010-3864.
|
o Corrected fix for security issue CVE-2010-3864.
|
||||||
|
|
||||||
Major changes between OpenSSL 1.0.0a and OpenSSL 1.0.0b [16 Nov 2010]:
|
Major changes between OpenSSL 1.0.0a and OpenSSL 1.0.0b:
|
||||||
|
|
||||||
o Fix for security issue CVE-2010-3864.
|
o Fix for security issue CVE-2010-3864.
|
||||||
o Fix for CVE-2010-2939
|
o Fix for CVE-2010-2939
|
||||||
o Fix WIN32 build system for GOST ENGINE.
|
o Fix WIN32 build system for GOST ENGINE.
|
||||||
|
|
||||||
Major changes between OpenSSL 1.0.0 and OpenSSL 1.0.0a [1 Jun 2010]:
|
Major changes between OpenSSL 1.0.0 and OpenSSL 1.0.0a:
|
||||||
|
|
||||||
o Fix for security issue CVE-2010-1633.
|
o Fix for security issue CVE-2010-1633.
|
||||||
o GOST MAC and CFB fixes.
|
o GOST MAC and CFB fixes.
|
||||||
|
|
||||||
Major changes between OpenSSL 0.9.8n and OpenSSL 1.0.0 [29 Mar 2010]:
|
Major changes between OpenSSL 0.9.8n and OpenSSL 1.0.0:
|
||||||
|
|
||||||
o RFC3280 path validation: sufficient to process PKITS tests.
|
o RFC3280 path validation: sufficient to process PKITS tests.
|
||||||
o Integrated support for PVK files and keyblobs.
|
o Integrated support for PVK files and keyblobs.
|
||||||
@@ -232,12 +67,33 @@
|
|||||||
o Opaque PRF Input TLS extension support.
|
o Opaque PRF Input TLS extension support.
|
||||||
o Updated time routines to avoid OS limitations.
|
o Updated time routines to avoid OS limitations.
|
||||||
|
|
||||||
Major changes between OpenSSL 0.9.8m and OpenSSL 0.9.8n [24 Mar 2010]:
|
Major changes between OpenSSL 0.9.8q and OpenSSL 0.9.8r:
|
||||||
|
|
||||||
|
o Fix for security issue CVE-2011-0014
|
||||||
|
|
||||||
|
Major changes between OpenSSL 0.9.8p and OpenSSL 0.9.8q:
|
||||||
|
|
||||||
|
o Fix for security issue CVE-2010-4180
|
||||||
|
o Fix for CVE-2010-4252
|
||||||
|
|
||||||
|
Major changes between OpenSSL 0.9.8o and OpenSSL 0.9.8p:
|
||||||
|
|
||||||
|
o Fix for security issue CVE-2010-3864.
|
||||||
|
|
||||||
|
Major changes between OpenSSL 0.9.8n and OpenSSL 0.9.8o:
|
||||||
|
|
||||||
|
o Fix for security issue CVE-2010-0742.
|
||||||
|
o Various DTLS fixes.
|
||||||
|
o Recognise SHA2 certificates if only SSL algorithms added.
|
||||||
|
o Fix for no-rc4 compilation.
|
||||||
|
o Chil ENGINE unload workaround.
|
||||||
|
|
||||||
|
Major changes between OpenSSL 0.9.8m and OpenSSL 0.9.8n:
|
||||||
|
|
||||||
o CFB cipher definition fixes.
|
o CFB cipher definition fixes.
|
||||||
o Fix security issues CVE-2010-0740 and CVE-2010-0433.
|
o Fix security issues CVE-2010-0740 and CVE-2010-0433.
|
||||||
|
|
||||||
Major changes between OpenSSL 0.9.8l and OpenSSL 0.9.8m [25 Feb 2010]:
|
Major changes between OpenSSL 0.9.8l and OpenSSL 0.9.8m:
|
||||||
|
|
||||||
o Cipher definition fixes.
|
o Cipher definition fixes.
|
||||||
o Workaround for slow RAND_poll() on some WIN32 versions.
|
o Workaround for slow RAND_poll() on some WIN32 versions.
|
||||||
@@ -249,33 +105,33 @@
|
|||||||
o Ticket and SNI coexistence fixes.
|
o Ticket and SNI coexistence fixes.
|
||||||
o Many fixes to DTLS handling.
|
o Many fixes to DTLS handling.
|
||||||
|
|
||||||
Major changes between OpenSSL 0.9.8k and OpenSSL 0.9.8l [5 Nov 2009]:
|
Major changes between OpenSSL 0.9.8k and OpenSSL 0.9.8l:
|
||||||
|
|
||||||
o Temporary work around for CVE-2009-3555: disable renegotiation.
|
o Temporary work around for CVE-2009-3555: disable renegotiation.
|
||||||
|
|
||||||
Major changes between OpenSSL 0.9.8j and OpenSSL 0.9.8k [25 Mar 2009]:
|
Major changes between OpenSSL 0.9.8j and OpenSSL 0.9.8k:
|
||||||
|
|
||||||
o Fix various build issues.
|
o Fix various build issues.
|
||||||
o Fix security issues (CVE-2009-0590, CVE-2009-0591, CVE-2009-0789)
|
o Fix security issues (CVE-2009-0590, CVE-2009-0591, CVE-2009-0789)
|
||||||
|
|
||||||
Major changes between OpenSSL 0.9.8i and OpenSSL 0.9.8j [7 Jan 2009]:
|
Major changes between OpenSSL 0.9.8i and OpenSSL 0.9.8j:
|
||||||
|
|
||||||
o Fix security issue (CVE-2008-5077)
|
o Fix security issue (CVE-2008-5077)
|
||||||
o Merge FIPS 140-2 branch code.
|
o Merge FIPS 140-2 branch code.
|
||||||
|
|
||||||
Major changes between OpenSSL 0.9.8g and OpenSSL 0.9.8h [28 May 2008]:
|
Major changes between OpenSSL 0.9.8g and OpenSSL 0.9.8h:
|
||||||
|
|
||||||
o CryptoAPI ENGINE support.
|
o CryptoAPI ENGINE support.
|
||||||
o Various precautionary measures.
|
o Various precautionary measures.
|
||||||
o Fix for bugs affecting certificate request creation.
|
o Fix for bugs affecting certificate request creation.
|
||||||
o Support for local machine keyset attribute in PKCS#12 files.
|
o Support for local machine keyset attribute in PKCS#12 files.
|
||||||
|
|
||||||
Major changes between OpenSSL 0.9.8f and OpenSSL 0.9.8g [19 Oct 2007]:
|
Major changes between OpenSSL 0.9.8f and OpenSSL 0.9.8g:
|
||||||
|
|
||||||
o Backport of CMS functionality to 0.9.8.
|
o Backport of CMS functionality to 0.9.8.
|
||||||
o Fixes for bugs introduced with 0.9.8f.
|
o Fixes for bugs introduced with 0.9.8f.
|
||||||
|
|
||||||
Major changes between OpenSSL 0.9.8e and OpenSSL 0.9.8f [11 Oct 2007]:
|
Major changes between OpenSSL 0.9.8e and OpenSSL 0.9.8f:
|
||||||
|
|
||||||
o Add gcc 4.2 support.
|
o Add gcc 4.2 support.
|
||||||
o Add support for AES and SSE2 assembly lanugauge optimization
|
o Add support for AES and SSE2 assembly lanugauge optimization
|
||||||
@@ -286,23 +142,23 @@
|
|||||||
o RFC4507bis support.
|
o RFC4507bis support.
|
||||||
o TLS Extensions support.
|
o TLS Extensions support.
|
||||||
|
|
||||||
Major changes between OpenSSL 0.9.8d and OpenSSL 0.9.8e [23 Feb 2007]:
|
Major changes between OpenSSL 0.9.8d and OpenSSL 0.9.8e:
|
||||||
|
|
||||||
o Various ciphersuite selection fixes.
|
o Various ciphersuite selection fixes.
|
||||||
o RFC3779 support.
|
o RFC3779 support.
|
||||||
|
|
||||||
Major changes between OpenSSL 0.9.8c and OpenSSL 0.9.8d [28 Sep 2006]:
|
Major changes between OpenSSL 0.9.8c and OpenSSL 0.9.8d:
|
||||||
|
|
||||||
o Introduce limits to prevent malicious key DoS (CVE-2006-2940)
|
o Introduce limits to prevent malicious key DoS (CVE-2006-2940)
|
||||||
o Fix security issues (CVE-2006-2937, CVE-2006-3737, CVE-2006-4343)
|
o Fix security issues (CVE-2006-2937, CVE-2006-3737, CVE-2006-4343)
|
||||||
o Changes to ciphersuite selection algorithm
|
o Changes to ciphersuite selection algorithm
|
||||||
|
|
||||||
Major changes between OpenSSL 0.9.8b and OpenSSL 0.9.8c [5 Sep 2006]:
|
Major changes between OpenSSL 0.9.8b and OpenSSL 0.9.8c:
|
||||||
|
|
||||||
o Fix Daniel Bleichenbacher forged signature attack, CVE-2006-4339
|
o Fix Daniel Bleichenbacher forged signature attack, CVE-2006-4339
|
||||||
o New cipher Camellia
|
o New cipher Camellia
|
||||||
|
|
||||||
Major changes between OpenSSL 0.9.8a and OpenSSL 0.9.8b [4 May 2006]:
|
Major changes between OpenSSL 0.9.8a and OpenSSL 0.9.8b:
|
||||||
|
|
||||||
o Cipher string fixes.
|
o Cipher string fixes.
|
||||||
o Fixes for VC++ 2005.
|
o Fixes for VC++ 2005.
|
||||||
@@ -312,12 +168,12 @@
|
|||||||
o Built in dynamic engine compilation support on Win32.
|
o Built in dynamic engine compilation support on Win32.
|
||||||
o Fixes auto dynamic engine loading in Win32.
|
o Fixes auto dynamic engine loading in Win32.
|
||||||
|
|
||||||
Major changes between OpenSSL 0.9.8 and OpenSSL 0.9.8a [11 Oct 2005]:
|
Major changes between OpenSSL 0.9.8 and OpenSSL 0.9.8a:
|
||||||
|
|
||||||
o Fix potential SSL 2.0 rollback, CVE-2005-2969
|
o Fix potential SSL 2.0 rollback, CVE-2005-2969
|
||||||
o Extended Windows CE support
|
o Extended Windows CE support
|
||||||
|
|
||||||
Major changes between OpenSSL 0.9.7g and OpenSSL 0.9.8 [5 Jul 2005]:
|
Major changes between OpenSSL 0.9.7g and OpenSSL 0.9.8:
|
||||||
|
|
||||||
o Major work on the BIGNUM library for higher efficiency and to
|
o Major work on the BIGNUM library for higher efficiency and to
|
||||||
make operations more streamlined and less contradictory. This
|
make operations more streamlined and less contradictory. This
|
||||||
@@ -391,36 +247,36 @@
|
|||||||
o Added initial support for Win64.
|
o Added initial support for Win64.
|
||||||
o Added alternate pkg-config files.
|
o Added alternate pkg-config files.
|
||||||
|
|
||||||
Major changes between OpenSSL 0.9.7l and OpenSSL 0.9.7m [23 Feb 2007]:
|
Major changes between OpenSSL 0.9.7l and OpenSSL 0.9.7m:
|
||||||
|
|
||||||
o FIPS 1.1.1 module linking.
|
o FIPS 1.1.1 module linking.
|
||||||
o Various ciphersuite selection fixes.
|
o Various ciphersuite selection fixes.
|
||||||
|
|
||||||
Major changes between OpenSSL 0.9.7k and OpenSSL 0.9.7l [28 Sep 2006]:
|
Major changes between OpenSSL 0.9.7k and OpenSSL 0.9.7l:
|
||||||
|
|
||||||
o Introduce limits to prevent malicious key DoS (CVE-2006-2940)
|
o Introduce limits to prevent malicious key DoS (CVE-2006-2940)
|
||||||
o Fix security issues (CVE-2006-2937, CVE-2006-3737, CVE-2006-4343)
|
o Fix security issues (CVE-2006-2937, CVE-2006-3737, CVE-2006-4343)
|
||||||
|
|
||||||
Major changes between OpenSSL 0.9.7j and OpenSSL 0.9.7k [5 Sep 2006]:
|
Major changes between OpenSSL 0.9.7j and OpenSSL 0.9.7k:
|
||||||
|
|
||||||
o Fix Daniel Bleichenbacher forged signature attack, CVE-2006-4339
|
o Fix Daniel Bleichenbacher forged signature attack, CVE-2006-4339
|
||||||
|
|
||||||
Major changes between OpenSSL 0.9.7i and OpenSSL 0.9.7j [4 May 2006]:
|
Major changes between OpenSSL 0.9.7i and OpenSSL 0.9.7j:
|
||||||
|
|
||||||
o Visual C++ 2005 fixes.
|
o Visual C++ 2005 fixes.
|
||||||
o Update Windows build system for FIPS.
|
o Update Windows build system for FIPS.
|
||||||
|
|
||||||
Major changes between OpenSSL 0.9.7h and OpenSSL 0.9.7i [14 Oct 2005]:
|
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.
|
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 [11 Oct 2005]:
|
Major changes between OpenSSL 0.9.7g and OpenSSL 0.9.7h:
|
||||||
|
|
||||||
o Fix SSL 2.0 Rollback, CVE-2005-2969
|
o Fix SSL 2.0 Rollback, CVE-2005-2969
|
||||||
o Allow use of fixed-length exponent on DSA signing
|
o Allow use of fixed-length exponent on DSA signing
|
||||||
o Default fixed-window RSA, DSA, DH private-key operations
|
o Default fixed-window RSA, DSA, DH private-key operations
|
||||||
|
|
||||||
Major changes between OpenSSL 0.9.7f and OpenSSL 0.9.7g [11 Apr 2005]:
|
Major changes between OpenSSL 0.9.7f and OpenSSL 0.9.7g:
|
||||||
|
|
||||||
o More compilation issues fixed.
|
o More compilation issues fixed.
|
||||||
o Adaptation to more modern Kerberos API.
|
o Adaptation to more modern Kerberos API.
|
||||||
@@ -429,7 +285,7 @@
|
|||||||
o More constification.
|
o More constification.
|
||||||
o Added processing of proxy certificates (RFC 3820).
|
o Added processing of proxy certificates (RFC 3820).
|
||||||
|
|
||||||
Major changes between OpenSSL 0.9.7e and OpenSSL 0.9.7f [22 Mar 2005]:
|
Major changes between OpenSSL 0.9.7e and OpenSSL 0.9.7f:
|
||||||
|
|
||||||
o Several compilation issues fixed.
|
o Several compilation issues fixed.
|
||||||
o Many memory allocation failure checks added.
|
o Many memory allocation failure checks added.
|
||||||
@@ -437,12 +293,12 @@
|
|||||||
o Mandatory basic checks on certificates.
|
o Mandatory basic checks on certificates.
|
||||||
o Performance improvements.
|
o Performance improvements.
|
||||||
|
|
||||||
Major changes between OpenSSL 0.9.7d and OpenSSL 0.9.7e [25 Oct 2004]:
|
Major changes between OpenSSL 0.9.7d and OpenSSL 0.9.7e:
|
||||||
|
|
||||||
o Fix race condition in CRL checking code.
|
o Fix race condition in CRL checking code.
|
||||||
o Fixes to PKCS#7 (S/MIME) code.
|
o Fixes to PKCS#7 (S/MIME) code.
|
||||||
|
|
||||||
Major changes between OpenSSL 0.9.7c and OpenSSL 0.9.7d [17 Mar 2004]:
|
Major changes between OpenSSL 0.9.7c and OpenSSL 0.9.7d:
|
||||||
|
|
||||||
o Security: Fix Kerberos ciphersuite SSL/TLS handshaking bug
|
o Security: Fix Kerberos ciphersuite SSL/TLS handshaking bug
|
||||||
o Security: Fix null-pointer assignment in do_change_cipher_spec()
|
o Security: Fix null-pointer assignment in do_change_cipher_spec()
|
||||||
@@ -450,14 +306,14 @@
|
|||||||
o Multiple X509 verification fixes
|
o Multiple X509 verification fixes
|
||||||
o Speed up HMAC and other operations
|
o Speed up HMAC and other operations
|
||||||
|
|
||||||
Major changes between OpenSSL 0.9.7b and OpenSSL 0.9.7c [30 Sep 2003]:
|
Major changes between OpenSSL 0.9.7b and OpenSSL 0.9.7c:
|
||||||
|
|
||||||
o Security: fix various ASN1 parsing bugs.
|
o Security: fix various ASN1 parsing bugs.
|
||||||
o New -ignore_err option to OCSP utility.
|
o New -ignore_err option to OCSP utility.
|
||||||
o Various interop and bug fixes in S/MIME code.
|
o Various interop and bug fixes in S/MIME code.
|
||||||
o SSL/TLS protocol fix for unrequested client certificates.
|
o SSL/TLS protocol fix for unrequested client certificates.
|
||||||
|
|
||||||
Major changes between OpenSSL 0.9.7a and OpenSSL 0.9.7b [10 Apr 2003]:
|
Major changes between OpenSSL 0.9.7a and OpenSSL 0.9.7b:
|
||||||
|
|
||||||
o Security: counter the Klima-Pokorny-Rosa extension of
|
o Security: counter the Klima-Pokorny-Rosa extension of
|
||||||
Bleichbacher's attack
|
Bleichbacher's attack
|
||||||
@@ -468,7 +324,7 @@
|
|||||||
o ASN.1: treat domainComponent correctly.
|
o ASN.1: treat domainComponent correctly.
|
||||||
o Documentation: fixes and additions.
|
o Documentation: fixes and additions.
|
||||||
|
|
||||||
Major changes between OpenSSL 0.9.7 and OpenSSL 0.9.7a [19 Feb 2003]:
|
Major changes between OpenSSL 0.9.7 and OpenSSL 0.9.7a:
|
||||||
|
|
||||||
o Security: Important security related bugfixes.
|
o Security: Important security related bugfixes.
|
||||||
o Enhanced compatibility with MIT Kerberos.
|
o Enhanced compatibility with MIT Kerberos.
|
||||||
@@ -479,7 +335,7 @@
|
|||||||
o SSL/TLS: now handles manual certificate chain building.
|
o SSL/TLS: now handles manual certificate chain building.
|
||||||
o SSL/TLS: certain session ID malfunctions corrected.
|
o SSL/TLS: certain session ID malfunctions corrected.
|
||||||
|
|
||||||
Major changes between OpenSSL 0.9.6 and OpenSSL 0.9.7 [30 Dec 2002]:
|
Major changes between OpenSSL 0.9.6 and OpenSSL 0.9.7:
|
||||||
|
|
||||||
o New library section OCSP.
|
o New library section OCSP.
|
||||||
o Complete rewrite of ASN1 code.
|
o Complete rewrite of ASN1 code.
|
||||||
@@ -525,23 +381,23 @@
|
|||||||
o SSL/TLS: add callback to retrieve SSL/TLS messages.
|
o SSL/TLS: add callback to retrieve SSL/TLS messages.
|
||||||
o SSL/TLS: support AES cipher suites (RFC3268).
|
o SSL/TLS: support AES cipher suites (RFC3268).
|
||||||
|
|
||||||
Major changes between OpenSSL 0.9.6j and OpenSSL 0.9.6k [30 Sep 2003]:
|
Major changes between OpenSSL 0.9.6j and OpenSSL 0.9.6k:
|
||||||
|
|
||||||
o Security: fix various ASN1 parsing bugs.
|
o Security: fix various ASN1 parsing bugs.
|
||||||
o SSL/TLS protocol fix for unrequested client certificates.
|
o SSL/TLS protocol fix for unrequested client certificates.
|
||||||
|
|
||||||
Major changes between OpenSSL 0.9.6i and OpenSSL 0.9.6j [10 Apr 2003]:
|
Major changes between OpenSSL 0.9.6i and OpenSSL 0.9.6j:
|
||||||
|
|
||||||
o Security: counter the Klima-Pokorny-Rosa extension of
|
o Security: counter the Klima-Pokorny-Rosa extension of
|
||||||
Bleichbacher's attack
|
Bleichbacher's attack
|
||||||
o Security: make RSA blinding default.
|
o Security: make RSA blinding default.
|
||||||
o Build: shared library support fixes.
|
o Build: shared library support fixes.
|
||||||
|
|
||||||
Major changes between OpenSSL 0.9.6h and OpenSSL 0.9.6i [19 Feb 2003]:
|
Major changes between OpenSSL 0.9.6h and OpenSSL 0.9.6i:
|
||||||
|
|
||||||
o Important security related bugfixes.
|
o Important security related bugfixes.
|
||||||
|
|
||||||
Major changes between OpenSSL 0.9.6g and OpenSSL 0.9.6h [5 Dec 2002]:
|
Major changes between OpenSSL 0.9.6g and OpenSSL 0.9.6h:
|
||||||
|
|
||||||
o New configuration targets for Tandem OSS and A/UX.
|
o New configuration targets for Tandem OSS and A/UX.
|
||||||
o New OIDs for Microsoft attributes.
|
o New OIDs for Microsoft attributes.
|
||||||
@@ -555,25 +411,25 @@
|
|||||||
o Fixes for smaller building problems.
|
o Fixes for smaller building problems.
|
||||||
o Updates of manuals, FAQ and other instructive documents.
|
o Updates of manuals, FAQ and other instructive documents.
|
||||||
|
|
||||||
Major changes between OpenSSL 0.9.6f and OpenSSL 0.9.6g [9 Aug 2002]:
|
Major changes between OpenSSL 0.9.6f and OpenSSL 0.9.6g:
|
||||||
|
|
||||||
o Important building fixes on Unix.
|
o Important building fixes on Unix.
|
||||||
|
|
||||||
Major changes between OpenSSL 0.9.6e and OpenSSL 0.9.6f [8 Aug 2002]:
|
Major changes between OpenSSL 0.9.6e and OpenSSL 0.9.6f:
|
||||||
|
|
||||||
o Various important bugfixes.
|
o Various important bugfixes.
|
||||||
|
|
||||||
Major changes between OpenSSL 0.9.6d and OpenSSL 0.9.6e [30 Jul 2002]:
|
Major changes between OpenSSL 0.9.6d and OpenSSL 0.9.6e:
|
||||||
|
|
||||||
o Important security related bugfixes.
|
o Important security related bugfixes.
|
||||||
o Various SSL/TLS library bugfixes.
|
o Various SSL/TLS library bugfixes.
|
||||||
|
|
||||||
Major changes between OpenSSL 0.9.6c and OpenSSL 0.9.6d [9 May 2002]:
|
Major changes between OpenSSL 0.9.6c and OpenSSL 0.9.6d:
|
||||||
|
|
||||||
o Various SSL/TLS library bugfixes.
|
o Various SSL/TLS library bugfixes.
|
||||||
o Fix DH parameter generation for 'non-standard' generators.
|
o Fix DH parameter generation for 'non-standard' generators.
|
||||||
|
|
||||||
Major changes between OpenSSL 0.9.6b and OpenSSL 0.9.6c [21 Dec 2001]:
|
Major changes between OpenSSL 0.9.6b and OpenSSL 0.9.6c:
|
||||||
|
|
||||||
o Various SSL/TLS library bugfixes.
|
o Various SSL/TLS library bugfixes.
|
||||||
o BIGNUM library fixes.
|
o BIGNUM library fixes.
|
||||||
@@ -586,7 +442,7 @@
|
|||||||
Broadcom and Cryptographic Appliance's keyserver
|
Broadcom and Cryptographic Appliance's keyserver
|
||||||
[in 0.9.6c-engine release].
|
[in 0.9.6c-engine release].
|
||||||
|
|
||||||
Major changes between OpenSSL 0.9.6a and OpenSSL 0.9.6b [9 Jul 2001]:
|
Major changes between OpenSSL 0.9.6a and OpenSSL 0.9.6b:
|
||||||
|
|
||||||
o Security fix: PRNG improvements.
|
o Security fix: PRNG improvements.
|
||||||
o Security fix: RSA OAEP check.
|
o Security fix: RSA OAEP check.
|
||||||
@@ -603,7 +459,7 @@
|
|||||||
o Increase default size for BIO buffering filter.
|
o Increase default size for BIO buffering filter.
|
||||||
o Compatibility fixes in some scripts.
|
o Compatibility fixes in some scripts.
|
||||||
|
|
||||||
Major changes between OpenSSL 0.9.6 and OpenSSL 0.9.6a [5 Apr 2001]:
|
Major changes between OpenSSL 0.9.6 and OpenSSL 0.9.6a:
|
||||||
|
|
||||||
o Security fix: change behavior of OpenSSL to avoid using
|
o Security fix: change behavior of OpenSSL to avoid using
|
||||||
environment variables when running as root.
|
environment variables when running as root.
|
||||||
@@ -628,7 +484,7 @@
|
|||||||
o New function BN_rand_range().
|
o New function BN_rand_range().
|
||||||
o Add "-rand" option to openssl s_client and s_server.
|
o Add "-rand" option to openssl s_client and s_server.
|
||||||
|
|
||||||
Major changes between OpenSSL 0.9.5a and OpenSSL 0.9.6 [10 Oct 2000]:
|
Major changes between OpenSSL 0.9.5a and OpenSSL 0.9.6:
|
||||||
|
|
||||||
o Some documentation for BIO and SSL libraries.
|
o Some documentation for BIO and SSL libraries.
|
||||||
o Enhanced chain verification using key identifiers.
|
o Enhanced chain verification using key identifiers.
|
||||||
@@ -643,7 +499,7 @@
|
|||||||
[1] The support for external crypto devices is currently a separate
|
[1] The support for external crypto devices is currently a separate
|
||||||
distribution. See the file README.ENGINE.
|
distribution. See the file README.ENGINE.
|
||||||
|
|
||||||
Major changes between OpenSSL 0.9.5 and OpenSSL 0.9.5a [1 Apr 2000]:
|
Major changes between OpenSSL 0.9.5 and OpenSSL 0.9.5a:
|
||||||
|
|
||||||
o Bug fixes for Win32, SuSE Linux, NeXTSTEP and FreeBSD 2.2.8
|
o Bug fixes for Win32, SuSE Linux, NeXTSTEP and FreeBSD 2.2.8
|
||||||
o Shared library support for HPUX and Solaris-gcc
|
o Shared library support for HPUX and Solaris-gcc
|
||||||
@@ -652,7 +508,7 @@
|
|||||||
o New 'rand' application
|
o New 'rand' application
|
||||||
o New way to check for existence of algorithms from scripts
|
o New way to check for existence of algorithms from scripts
|
||||||
|
|
||||||
Major changes between OpenSSL 0.9.4 and OpenSSL 0.9.5 [25 May 2000]:
|
Major changes between OpenSSL 0.9.4 and OpenSSL 0.9.5:
|
||||||
|
|
||||||
o S/MIME support in new 'smime' command
|
o S/MIME support in new 'smime' command
|
||||||
o Documentation for the OpenSSL command line application
|
o Documentation for the OpenSSL command line application
|
||||||
@@ -688,7 +544,7 @@
|
|||||||
o Enhanced support for Alpha Linux
|
o Enhanced support for Alpha Linux
|
||||||
o Experimental MacOS support
|
o Experimental MacOS support
|
||||||
|
|
||||||
Major changes between OpenSSL 0.9.3 and OpenSSL 0.9.4 [9 Aug 1999]:
|
Major changes between OpenSSL 0.9.3 and OpenSSL 0.9.4:
|
||||||
|
|
||||||
o Transparent support for PKCS#8 format private keys: these are used
|
o Transparent support for PKCS#8 format private keys: these are used
|
||||||
by several software packages and are more secure than the standard
|
by several software packages and are more secure than the standard
|
||||||
@@ -699,7 +555,7 @@
|
|||||||
o New pipe-like BIO that allows using the SSL library when actual I/O
|
o New pipe-like BIO that allows using the SSL library when actual I/O
|
||||||
must be handled by the application (BIO pair)
|
must be handled by the application (BIO pair)
|
||||||
|
|
||||||
Major changes between OpenSSL 0.9.2b and OpenSSL 0.9.3 [24 May 1999]:
|
Major changes between OpenSSL 0.9.2b and OpenSSL 0.9.3:
|
||||||
o Lots of enhancements and cleanups to the Configuration mechanism
|
o Lots of enhancements and cleanups to the Configuration mechanism
|
||||||
o RSA OEAP related fixes
|
o RSA OEAP related fixes
|
||||||
o Added `openssl ca -revoke' option for revoking a certificate
|
o Added `openssl ca -revoke' option for revoking a certificate
|
||||||
@@ -713,7 +569,7 @@
|
|||||||
o Sparc assembler bignum implementation, optimized hash functions
|
o Sparc assembler bignum implementation, optimized hash functions
|
||||||
o Option to disable selected ciphers
|
o Option to disable selected ciphers
|
||||||
|
|
||||||
Major changes between OpenSSL 0.9.1c and OpenSSL 0.9.2b [22 Mar 1999]:
|
Major changes between OpenSSL 0.9.1c and OpenSSL 0.9.2b:
|
||||||
o Fixed a security hole related to session resumption
|
o Fixed a security hole related to session resumption
|
||||||
o Fixed RSA encryption routines for the p < q case
|
o Fixed RSA encryption routines for the p < q case
|
||||||
o "ALL" in cipher lists now means "everything except NULL ciphers"
|
o "ALL" in cipher lists now means "everything except NULL ciphers"
|
||||||
@@ -735,7 +591,7 @@
|
|||||||
o Lots of memory leak fixes.
|
o Lots of memory leak fixes.
|
||||||
o Lots of bug fixes.
|
o Lots of bug fixes.
|
||||||
|
|
||||||
Major changes between SSLeay 0.9.0b and OpenSSL 0.9.1c [23 Dec 1998]:
|
Major changes between SSLeay 0.9.0b and OpenSSL 0.9.1c:
|
||||||
o Integration of the popular NO_RSA/NO_DSA patches
|
o Integration of the popular NO_RSA/NO_DSA patches
|
||||||
o Initial support for compression inside the SSL record layer
|
o Initial support for compression inside the SSL record layer
|
||||||
o Added BIO proxy and filtering functionality
|
o Added BIO proxy and filtering functionality
|
||||||
|
|||||||
14
PROBLEMS
14
PROBLEMS
@@ -197,17 +197,3 @@ reconfigure with additional no-sse2 [or 386] option passed to ./config.
|
|||||||
We don't have framework to associate -ldl with no-dso, therefore the only
|
We don't have framework to associate -ldl with no-dso, therefore the only
|
||||||
way is to edit Makefile right after ./config no-dso and remove -ldl from
|
way is to edit Makefile right after ./config no-dso and remove -ldl from
|
||||||
EX_LIBS line.
|
EX_LIBS line.
|
||||||
|
|
||||||
* hpux-parisc2-cc no-asm build fails with SEGV in ECDSA/DH.
|
|
||||||
|
|
||||||
Compiler bug, presumably at particular patch level. Remaining
|
|
||||||
hpux*-parisc*-cc configurations can be affected too. Drop optimization
|
|
||||||
level to +O2 when compiling bn_nist.o.
|
|
||||||
|
|
||||||
* solaris64-sparcv9-cc link failure
|
|
||||||
|
|
||||||
Solaris 8 ar can fail to maintain symbol table in .a, which results in
|
|
||||||
link failures. Apply 109147-09 or later or modify Makefile generated
|
|
||||||
by ./Configure solaris64-sparcv9-cc and replace RANLIB assignment with
|
|
||||||
|
|
||||||
RANLIB= /usr/ccs/bin/ar rs
|
|
||||||
|
|||||||
205
README
205
README
@@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
OpenSSL 1.0.1t-dev
|
OpenSSL 1.0.0f 4 Jan 2012
|
||||||
|
|
||||||
Copyright (c) 1998-2015 The OpenSSL Project
|
Copyright (c) 1998-2011 The OpenSSL Project
|
||||||
Copyright (c) 1995-1998 Eric A. Young, Tim J. Hudson
|
Copyright (c) 1995-1998 Eric A. Young, Tim J. Hudson
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
@@ -10,17 +10,17 @@
|
|||||||
|
|
||||||
The OpenSSL Project is a collaborative effort to develop a robust,
|
The OpenSSL Project is a collaborative effort to develop a robust,
|
||||||
commercial-grade, fully featured, and Open Source toolkit implementing the
|
commercial-grade, fully featured, and Open Source toolkit implementing the
|
||||||
Secure Sockets Layer (SSLv3) and Transport Layer Security (TLS) protocols as
|
Secure Sockets Layer (SSL v2/v3) and Transport Layer Security (TLS v1)
|
||||||
well as a full-strength general purpose cryptograpic library. The project is
|
protocols as well as a full-strength general purpose cryptography library.
|
||||||
managed by a worldwide community of volunteers that use the Internet to
|
The project is managed by a worldwide community of volunteers that use the
|
||||||
communicate, plan, and develop the OpenSSL toolkit and its related
|
Internet to communicate, plan, and develop the OpenSSL toolkit and its
|
||||||
documentation.
|
related documentation.
|
||||||
|
|
||||||
OpenSSL is descended from the SSLeay library developed by Eric A. Young
|
OpenSSL is based on the excellent SSLeay library developed from Eric A. Young
|
||||||
and Tim J. Hudson. The OpenSSL toolkit is licensed under a dual-license (the
|
and Tim J. Hudson. The OpenSSL toolkit is licensed under a dual-license (the
|
||||||
OpenSSL license plus the SSLeay license), which means that you are free to
|
OpenSSL license plus the SSLeay license) situation, which basically means
|
||||||
get and use it for commercial and non-commercial purposes as long as you
|
that you are free to get and use it for commercial and non-commercial
|
||||||
fulfill the conditions of both licenses.
|
purposes as long as you fulfill the conditions of both licenses.
|
||||||
|
|
||||||
OVERVIEW
|
OVERVIEW
|
||||||
--------
|
--------
|
||||||
@@ -28,39 +28,116 @@
|
|||||||
The OpenSSL toolkit includes:
|
The OpenSSL toolkit includes:
|
||||||
|
|
||||||
libssl.a:
|
libssl.a:
|
||||||
Provides the client and server-side implementations for SSLv3 and TLS.
|
Implementation of SSLv2, SSLv3, TLSv1 and the required code to support
|
||||||
|
both SSLv2, SSLv3 and TLSv1 in the one server and client.
|
||||||
|
|
||||||
libcrypto.a:
|
libcrypto.a:
|
||||||
Provides general cryptographic and X.509 support needed by SSL/TLS but
|
General encryption and X.509 v1/v3 stuff needed by SSL/TLS but not
|
||||||
not logically part of it.
|
actually logically part of it. It includes routines for the following:
|
||||||
|
|
||||||
|
Ciphers
|
||||||
|
libdes - EAY's libdes DES encryption package which was floating
|
||||||
|
around the net for a few years, and was then relicensed by
|
||||||
|
him as part of SSLeay. It includes 15 'modes/variations'
|
||||||
|
of DES (1, 2 and 3 key versions of ecb, cbc, cfb and ofb;
|
||||||
|
pcbc and a more general form of cfb and ofb) including desx
|
||||||
|
in cbc mode, a fast crypt(3), and routines to read
|
||||||
|
passwords from the keyboard.
|
||||||
|
RC4 encryption,
|
||||||
|
RC2 encryption - 4 different modes, ecb, cbc, cfb and ofb.
|
||||||
|
Blowfish encryption - 4 different modes, ecb, cbc, cfb and ofb.
|
||||||
|
IDEA encryption - 4 different modes, ecb, cbc, cfb and ofb.
|
||||||
|
|
||||||
|
Digests
|
||||||
|
MD5 and MD2 message digest algorithms, fast implementations,
|
||||||
|
SHA (SHA-0) and SHA-1 message digest algorithms,
|
||||||
|
MDC2 message digest. A DES based hash that is popular on smart cards.
|
||||||
|
|
||||||
|
Public Key
|
||||||
|
RSA encryption/decryption/generation.
|
||||||
|
There is no limit on the number of bits.
|
||||||
|
DSA encryption/decryption/generation.
|
||||||
|
There is no limit on the number of bits.
|
||||||
|
Diffie-Hellman key-exchange/key generation.
|
||||||
|
There is no limit on the number of bits.
|
||||||
|
|
||||||
|
X.509v3 certificates
|
||||||
|
X509 encoding/decoding into/from binary ASN1 and a PEM
|
||||||
|
based ASCII-binary encoding which supports encryption with a
|
||||||
|
private key. Program to generate RSA and DSA certificate
|
||||||
|
requests and to generate RSA and DSA certificates.
|
||||||
|
|
||||||
|
Systems
|
||||||
|
The normal digital envelope routines and base64 encoding. Higher
|
||||||
|
level access to ciphers and digests by name. New ciphers can be
|
||||||
|
loaded at run time. The BIO io system which is a simple non-blocking
|
||||||
|
IO abstraction. Current methods supported are file descriptors,
|
||||||
|
sockets, socket accept, socket connect, memory buffer, buffering, SSL
|
||||||
|
client/server, file pointer, encryption, digest, non-blocking testing
|
||||||
|
and null.
|
||||||
|
|
||||||
|
Data structures
|
||||||
|
A dynamically growing hashing system
|
||||||
|
A simple stack.
|
||||||
|
A Configuration loader that uses a format similar to MS .ini files.
|
||||||
|
|
||||||
openssl:
|
openssl:
|
||||||
A command line tool that can be used for:
|
A command line tool that can be used for:
|
||||||
Creation of key parameters
|
Creation of RSA, DH and DSA key parameters
|
||||||
Creation of X.509 certificates, CSRs and CRLs
|
Creation of X.509 certificates, CSRs and CRLs
|
||||||
Calculation of message digests
|
Calculation of Message Digests
|
||||||
Encryption and decryption
|
Encryption and Decryption with Ciphers
|
||||||
SSL/TLS client and server tests
|
SSL/TLS Client and Server Tests
|
||||||
Handling of S/MIME signed or encrypted mail
|
Handling of S/MIME signed or encrypted mail
|
||||||
And more...
|
|
||||||
|
|
||||||
|
PATENTS
|
||||||
|
-------
|
||||||
|
|
||||||
|
Various companies hold various patents for various algorithms in various
|
||||||
|
locations around the world. _YOU_ are responsible for ensuring that your use
|
||||||
|
of any algorithms is legal by checking if there are any patents in your
|
||||||
|
country. The file contains some of the patents that we know about or are
|
||||||
|
rumored to exist. This is not a definitive list.
|
||||||
|
|
||||||
|
RSA Security holds software patents on the RC5 algorithm. If you
|
||||||
|
intend to use this cipher, you must contact RSA Security for
|
||||||
|
licensing conditions. Their web page is http://www.rsasecurity.com/.
|
||||||
|
|
||||||
|
RC4 is a trademark of RSA Security, so use of this label should perhaps
|
||||||
|
only be used with RSA Security's permission.
|
||||||
|
|
||||||
|
The IDEA algorithm is patented by Ascom in Austria, France, Germany, Italy,
|
||||||
|
Japan, the Netherlands, Spain, Sweden, Switzerland, UK and the USA. They
|
||||||
|
should be contacted if that algorithm is to be used; their web page is
|
||||||
|
http://www.ascom.ch/.
|
||||||
|
|
||||||
|
NTT and Mitsubishi have patents and pending patents on the Camellia
|
||||||
|
algorithm, but allow use at no charge without requiring an explicit
|
||||||
|
licensing agreement: http://info.isl.ntt.co.jp/crypt/eng/info/chiteki.html
|
||||||
|
|
||||||
INSTALLATION
|
INSTALLATION
|
||||||
------------
|
------------
|
||||||
|
|
||||||
See the appropriate file:
|
To install this package under a Unix derivative, read the INSTALL file. For
|
||||||
INSTALL Linux, Unix, etc.
|
a Win32 platform, read the INSTALL.W32 file. For OpenVMS systems, read
|
||||||
INSTALL.DJGPP DOS platform with DJGPP
|
INSTALL.VMS.
|
||||||
INSTALL.NW Netware
|
|
||||||
INSTALL.OS2 OS/2
|
Read the documentation in the doc/ directory. It is quite rough, but it
|
||||||
INSTALL.VMS VMS
|
lists the functions; you will probably have to look at the code to work out
|
||||||
INSTALL.W32 Windows (32bit)
|
how to use them. Look at the example programs.
|
||||||
INSTALL.W64 Windows (64bit)
|
|
||||||
INSTALL.WCE Windows CE
|
PROBLEMS
|
||||||
|
--------
|
||||||
|
|
||||||
|
For some platforms, there are some known problems that may affect the user
|
||||||
|
or application author. We try to collect those in doc/PROBLEMS, with current
|
||||||
|
thoughts on how they should be solved in a future of OpenSSL.
|
||||||
|
|
||||||
SUPPORT
|
SUPPORT
|
||||||
-------
|
-------
|
||||||
|
|
||||||
See the OpenSSL website www.openssl.org for details on how to obtain
|
See the OpenSSL website www.openssl.org for details of how to obtain
|
||||||
commercial technical support.
|
commercial technical support.
|
||||||
|
|
||||||
If you have any problems with OpenSSL then please take the following steps
|
If you have any problems with OpenSSL then please take the following steps
|
||||||
@@ -84,36 +161,58 @@
|
|||||||
- Problem Description (steps that will reproduce the problem, if known)
|
- Problem Description (steps that will reproduce the problem, if known)
|
||||||
- Stack Traceback (if the application dumps core)
|
- Stack Traceback (if the application dumps core)
|
||||||
|
|
||||||
Email the report to:
|
Report the bug to the OpenSSL project via the Request Tracker
|
||||||
|
(http://www.openssl.org/support/rt.html) by mail to:
|
||||||
|
|
||||||
rt@openssl.org
|
openssl-bugs@openssl.org
|
||||||
|
|
||||||
In order to avoid spam, this is a moderated mailing list, and it might
|
Note that the request tracker should NOT be used for general assistance
|
||||||
take a day for the ticket to show up. (We also scan posts to make sure
|
or support queries. Just because something doesn't work the way you expect
|
||||||
that security disclosures aren't publically posted by mistake.) Mail
|
does not mean it is necessarily a bug in OpenSSL.
|
||||||
to this address is recorded in the public RT (request tracker) database
|
|
||||||
(see https://www.openssl.org/community/index.html#bugs for details) and
|
|
||||||
also forwarded the public openssl-dev mailing list. Confidential mail
|
|
||||||
may be sent to openssl-security@openssl.org (PGP key available from the
|
|
||||||
key servers).
|
|
||||||
|
|
||||||
Please do NOT use this for general assistance or support queries.
|
Note that mail to openssl-bugs@openssl.org is recorded in the publicly
|
||||||
Just because something doesn't work the way you expect does not mean it
|
readable request tracker database and is forwarded to a public
|
||||||
is necessarily a bug in OpenSSL.
|
mailing list. Confidential mail may be sent to openssl-security@openssl.org
|
||||||
|
(PGP key available from the key servers).
|
||||||
You can also make GitHub pull requests. If you do this, please also send
|
|
||||||
mail to rt@openssl.org with a link to the PR so that we can more easily
|
|
||||||
keep track of it.
|
|
||||||
|
|
||||||
HOW TO CONTRIBUTE TO OpenSSL
|
HOW TO CONTRIBUTE TO OpenSSL
|
||||||
----------------------------
|
----------------------------
|
||||||
|
|
||||||
See CONTRIBUTING
|
Development is coordinated on the openssl-dev mailing list (see
|
||||||
|
http://www.openssl.org for information on subscribing). If you
|
||||||
|
would like to submit a patch, send it to openssl-bugs@openssl.org with
|
||||||
|
the string "[PATCH]" in the subject. Please be sure to include a
|
||||||
|
textual explanation of what your patch does.
|
||||||
|
|
||||||
LEGALITIES
|
If you are unsure as to whether a feature will be useful for the general
|
||||||
----------
|
OpenSSL community please discuss it on the openssl-dev mailing list first.
|
||||||
|
Someone may be already working on the same thing or there may be a good
|
||||||
|
reason as to why that feature isn't implemented.
|
||||||
|
|
||||||
|
Patches should be as up to date as possible, preferably relative to the
|
||||||
|
current CVS or the last snapshot. They should follow the coding style of
|
||||||
|
OpenSSL and compile without warnings. Some of the core team developer targets
|
||||||
|
can be used for testing purposes, (debug-steve64, debug-geoff etc). OpenSSL
|
||||||
|
compiles on many varied platforms: try to ensure you only use portable
|
||||||
|
features.
|
||||||
|
|
||||||
|
Note: For legal reasons, contributions from the US can be accepted only
|
||||||
|
if a TSU notification and a copy of the patch are sent to crypt@bis.doc.gov
|
||||||
|
(formerly BXA) with a copy to the ENC Encryption Request Coordinator;
|
||||||
|
please take some time to look at
|
||||||
|
http://www.bis.doc.gov/Encryption/PubAvailEncSourceCodeNofify.html [sic]
|
||||||
|
and
|
||||||
|
http://w3.access.gpo.gov/bis/ear/pdf/740.pdf (EAR Section 740.13(e))
|
||||||
|
for the details. If "your encryption source code is too large to serve as
|
||||||
|
an email attachment", they are glad to receive it by fax instead; hope you
|
||||||
|
have a cheap long-distance plan.
|
||||||
|
|
||||||
|
Our preferred format for changes is "diff -u" output. You might
|
||||||
|
generate it like this:
|
||||||
|
|
||||||
|
# cd openssl-work
|
||||||
|
# [your changes]
|
||||||
|
# ./Configure dist; make clean
|
||||||
|
# cd ..
|
||||||
|
# diff -ur openssl-orig openssl-work > mydiffs.patch
|
||||||
|
|
||||||
A number of nations, in particular the U.S., restrict the use or export
|
|
||||||
of cryptography. If you are potentially subject to such restrictions
|
|
||||||
you should seek competent professional legal advice before attempting to
|
|
||||||
develop or distribute cryptographic code.
|
|
||||||
|
|||||||
150
STATUS
Normal file
150
STATUS
Normal file
@@ -0,0 +1,150 @@
|
|||||||
|
|
||||||
|
OpenSSL STATUS Last modified at
|
||||||
|
______________ $Date: 2012/01/04 17:01:30 $
|
||||||
|
|
||||||
|
DEVELOPMENT STATE
|
||||||
|
|
||||||
|
o OpenSSL 1.1.0: Under development...
|
||||||
|
o OpenSSL 1.0.1: Under development...
|
||||||
|
o OpenSSL 1.0.0f: Released on January 4th, 2012
|
||||||
|
o OpenSSL 1.0.0e: Released on September 6th, 2011
|
||||||
|
o OpenSSL 1.0.0d: Released on February 8nd, 2011
|
||||||
|
o OpenSSL 1.0.0c: Released on December 2nd, 2010
|
||||||
|
o OpenSSL 1.0.0b: Released on November 16th, 2010
|
||||||
|
o OpenSSL 1.0.0a: Released on June 1st, 2010
|
||||||
|
o OpenSSL 1.0.0: Released on March 29th, 2010
|
||||||
|
o OpenSSL 0.9.8r: Released on February 8nd, 2011
|
||||||
|
o OpenSSL 0.9.8q: Released on December 2nd, 2010
|
||||||
|
o OpenSSL 0.9.8p: Released on November 16th, 2010
|
||||||
|
o OpenSSL 0.9.8o: Released on June 1st, 2010
|
||||||
|
o OpenSSL 0.9.8n: Released on March 24th, 2010
|
||||||
|
o OpenSSL 0.9.8m: Released on February 25th, 2010
|
||||||
|
o OpenSSL 0.9.8l: Released on November 5th, 2009
|
||||||
|
o OpenSSL 0.9.8k: Released on March 25th, 2009
|
||||||
|
o OpenSSL 0.9.8j: Released on January 7th, 2009
|
||||||
|
o OpenSSL 0.9.8i: Released on September 15th, 2008
|
||||||
|
o OpenSSL 0.9.8h: Released on May 28th, 2008
|
||||||
|
o OpenSSL 0.9.8g: Released on October 19th, 2007
|
||||||
|
o OpenSSL 0.9.8f: Released on October 11th, 2007
|
||||||
|
o OpenSSL 0.9.8e: Released on February 23rd, 2007
|
||||||
|
o OpenSSL 0.9.8d: Released on September 28th, 2006
|
||||||
|
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.7m: Released on February 23rd, 2007
|
||||||
|
o OpenSSL 0.9.7l: Released on September 28th, 2006
|
||||||
|
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
|
||||||
|
o OpenSSL 0.9.7e: Released on October 25th, 2004
|
||||||
|
o OpenSSL 0.9.7d: Released on March 17th, 2004
|
||||||
|
o OpenSSL 0.9.7c: Released on September 30th, 2003
|
||||||
|
o OpenSSL 0.9.7b: Released on April 10th, 2003
|
||||||
|
o OpenSSL 0.9.7a: Released on February 19th, 2003
|
||||||
|
o OpenSSL 0.9.7: Released on December 31st, 2002
|
||||||
|
o OpenSSL 0.9.6m: Released on March 17th, 2004
|
||||||
|
o OpenSSL 0.9.6l: Released on November 4th, 2003
|
||||||
|
o OpenSSL 0.9.6k: Released on September 30th, 2003
|
||||||
|
o OpenSSL 0.9.6j: Released on April 10th, 2003
|
||||||
|
o OpenSSL 0.9.6i: Released on February 19th, 2003
|
||||||
|
o OpenSSL 0.9.6h: Released on December 5th, 2002
|
||||||
|
o OpenSSL 0.9.6g: Released on August 9th, 2002
|
||||||
|
o OpenSSL 0.9.6f: Released on August 8th, 2002
|
||||||
|
o OpenSSL 0.9.6e: Released on July 30th, 2002
|
||||||
|
o OpenSSL 0.9.6d: Released on May 9th, 2002
|
||||||
|
o OpenSSL 0.9.6c: Released on December 21st, 2001
|
||||||
|
o OpenSSL 0.9.6b: Released on July 9th, 2001
|
||||||
|
o OpenSSL 0.9.6a: Released on April 5th, 2001
|
||||||
|
o OpenSSL 0.9.6: Released on September 24th, 2000
|
||||||
|
o OpenSSL 0.9.5a: Released on April 1st, 2000
|
||||||
|
o OpenSSL 0.9.5: Released on February 28th, 2000
|
||||||
|
o OpenSSL 0.9.4: Released on August 09th, 1999
|
||||||
|
o OpenSSL 0.9.3a: Released on May 29th, 1999
|
||||||
|
o OpenSSL 0.9.3: Released on May 25th, 1999
|
||||||
|
o OpenSSL 0.9.2b: Released on March 22th, 1999
|
||||||
|
o OpenSSL 0.9.1c: Released on December 23th, 1998
|
||||||
|
|
||||||
|
[See also http://www.openssl.org/support/rt.html]
|
||||||
|
|
||||||
|
RELEASE SHOWSTOPPERS
|
||||||
|
|
||||||
|
o The Makefiles fail with some SysV makes.
|
||||||
|
o
|
||||||
|
|
||||||
|
AVAILABLE PATCHES
|
||||||
|
|
||||||
|
o
|
||||||
|
|
||||||
|
IN PROGRESS
|
||||||
|
|
||||||
|
o Steve is currently working on (in no particular order):
|
||||||
|
ASN1 code redesign, butchery, replacement.
|
||||||
|
OCSP
|
||||||
|
EVP cipher enhancement.
|
||||||
|
Enhanced certificate chain verification.
|
||||||
|
Private key, certificate and CRL API and implementation.
|
||||||
|
Developing and bugfixing PKCS#7 (S/MIME code).
|
||||||
|
Various X509 issues: character sets, certificate request extensions.
|
||||||
|
o Richard is currently working on:
|
||||||
|
Constification
|
||||||
|
Attribute Certificate support
|
||||||
|
Certificate Pair support
|
||||||
|
Storage Engines (primarly an LDAP storage engine)
|
||||||
|
Certificate chain validation with full RFC 3280 compatibility
|
||||||
|
|
||||||
|
NEEDS PATCH
|
||||||
|
|
||||||
|
o 0.9.8-dev: COMPLEMENTOFALL and COMPLEMENTOFDEFAULT do not
|
||||||
|
handle ECCdraft cipher suites correctly.
|
||||||
|
|
||||||
|
o apps/ca.c: "Sign the certificate?" - "n" creates empty certificate file
|
||||||
|
|
||||||
|
o "OpenSSL STATUS" is never up-to-date.
|
||||||
|
|
||||||
|
OPEN ISSUES
|
||||||
|
|
||||||
|
o The Makefile hierarchy and build mechanism is still not a round thing:
|
||||||
|
|
||||||
|
1. The config vs. Configure scripts
|
||||||
|
It's the same nasty situation as for Apache with APACI vs.
|
||||||
|
src/Configure. It confuses.
|
||||||
|
Suggestion: Merge Configure and config into a single configure
|
||||||
|
script with a Autoconf style interface ;-) and remove
|
||||||
|
Configure and config. Or even let us use GNU Autoconf
|
||||||
|
itself. Then we can avoid a lot of those platform checks
|
||||||
|
which are currently in Configure.
|
||||||
|
|
||||||
|
o Support for Shared Libraries has to be added at least
|
||||||
|
for the major Unix platforms. The details we can rip from the stuff
|
||||||
|
Ralf has done for the Apache src/Configure script. Ben wants the
|
||||||
|
solution to be really simple.
|
||||||
|
|
||||||
|
Status: Ralf will look how we can easily incorporate the
|
||||||
|
compiler PIC and linker DSO flags from Apache
|
||||||
|
into the OpenSSL Configure script.
|
||||||
|
|
||||||
|
Ulf: +1 for using GNU autoconf and libtool (but not automake,
|
||||||
|
which apparently is not flexible enough to generate
|
||||||
|
libcrypto)
|
||||||
|
|
||||||
|
WISHES
|
||||||
|
|
||||||
|
o Add variants of DH_generate_parameters() and BN_generate_prime() [etc?]
|
||||||
|
where the callback function can request that the function be aborted.
|
||||||
|
[Gregory Stark <ghstark@pobox.com>, <rayyang2000@yahoo.com>]
|
||||||
|
|
||||||
|
o SRP in TLS.
|
||||||
|
[wished by:
|
||||||
|
Dj <derek@yo.net>, Tom Wu <tom@arcot.com>,
|
||||||
|
Tom Holroyd <tomh@po.crl.go.jp>]
|
||||||
|
|
||||||
|
See http://search.ietf.org/internet-drafts/draft-ietf-tls-srp-00.txt
|
||||||
|
as well as http://www-cs-students.stanford.edu/~tjw/srp/.
|
||||||
|
|
||||||
|
Tom Holroyd tells us there is a SRP patch for OpenSSH at
|
||||||
|
http://members.tripod.com/professor_tom/archives/, that could
|
||||||
|
be useful.
|
||||||
8
apps/.cvsignore
Normal file
8
apps/.cvsignore
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
openssl
|
||||||
|
Makefile.save
|
||||||
|
der_chop
|
||||||
|
der_chop.bak
|
||||||
|
CA.pl
|
||||||
|
*.flc
|
||||||
|
semantic.cache
|
||||||
|
*.dll
|
||||||
186
apps/Makefile
186
apps/Makefile
@@ -39,7 +39,7 @@ E_EXE= verify asn1pars req dgst dh dhparam enc passwd gendh errstr \
|
|||||||
ca crl rsa rsautl dsa dsaparam ec ecparam \
|
ca crl rsa rsautl dsa dsaparam ec ecparam \
|
||||||
x509 genrsa gendsa genpkey s_server s_client speed \
|
x509 genrsa gendsa genpkey s_server s_client speed \
|
||||||
s_time version pkcs7 cms crl2pkcs7 sess_id ciphers nseq pkcs12 \
|
s_time version pkcs7 cms crl2pkcs7 sess_id ciphers nseq pkcs12 \
|
||||||
pkcs8 pkey pkeyparam pkeyutl spkac smime rand engine ocsp prime ts srp
|
pkcs8 pkey pkeyparam pkeyutl spkac smime rand engine ocsp prime ts
|
||||||
|
|
||||||
PROGS= $(PROGRAM).c
|
PROGS= $(PROGRAM).c
|
||||||
|
|
||||||
@@ -56,7 +56,7 @@ E_OBJ= verify.o asn1pars.o req.o dgst.o dh.o dhparam.o enc.o passwd.o gendh.o er
|
|||||||
x509.o genrsa.o gendsa.o genpkey.o s_server.o s_client.o speed.o \
|
x509.o genrsa.o gendsa.o genpkey.o s_server.o s_client.o speed.o \
|
||||||
s_time.o $(A_OBJ) $(S_OBJ) $(RAND_OBJ) version.o sess_id.o \
|
s_time.o $(A_OBJ) $(S_OBJ) $(RAND_OBJ) version.o sess_id.o \
|
||||||
ciphers.o nseq.o pkcs12.o pkcs8.o pkey.o pkeyparam.o pkeyutl.o \
|
ciphers.o nseq.o pkcs12.o pkcs8.o pkey.o pkeyparam.o pkeyutl.o \
|
||||||
spkac.o smime.o cms.o rand.o engine.o ocsp.o prime.o ts.o srp.o
|
spkac.o smime.o cms.o rand.o engine.o ocsp.o prime.o ts.o
|
||||||
|
|
||||||
E_SRC= verify.c asn1pars.c req.c dgst.c dh.c enc.c passwd.c gendh.c errstr.c ca.c \
|
E_SRC= verify.c asn1pars.c req.c dgst.c dh.c enc.c passwd.c gendh.c errstr.c ca.c \
|
||||||
pkcs7.c crl2p7.c crl.c \
|
pkcs7.c crl2p7.c crl.c \
|
||||||
@@ -64,7 +64,7 @@ E_SRC= verify.c asn1pars.c req.c dgst.c dh.c enc.c passwd.c gendh.c errstr.c ca.
|
|||||||
x509.c genrsa.c gendsa.c genpkey.c s_server.c s_client.c speed.c \
|
x509.c genrsa.c gendsa.c genpkey.c s_server.c s_client.c speed.c \
|
||||||
s_time.c $(A_SRC) $(S_SRC) $(RAND_SRC) version.c sess_id.c \
|
s_time.c $(A_SRC) $(S_SRC) $(RAND_SRC) version.c sess_id.c \
|
||||||
ciphers.c nseq.c pkcs12.c pkcs8.c pkey.c pkeyparam.c pkeyutl.c \
|
ciphers.c nseq.c pkcs12.c pkcs8.c pkey.c pkeyparam.c pkeyutl.c \
|
||||||
spkac.c smime.c cms.c rand.c engine.c ocsp.c prime.c ts.c srp.c
|
spkac.c smime.c cms.c rand.c engine.c ocsp.c prime.c ts.c
|
||||||
|
|
||||||
SRC=$(E_SRC)
|
SRC=$(E_SRC)
|
||||||
|
|
||||||
@@ -94,9 +94,6 @@ req: sreq.o $(A_OBJ) $(DLIBCRYPTO)
|
|||||||
sreq.o: req.c
|
sreq.o: req.c
|
||||||
$(CC) -c $(INCLUDES) $(CFLAG) -o sreq.o req.c
|
$(CC) -c $(INCLUDES) $(CFLAG) -o sreq.o req.c
|
||||||
|
|
||||||
openssl-vms.cnf: openssl.cnf
|
|
||||||
$(PERL) $(TOP)/VMS/VMSify-conf.pl < openssl.cnf > openssl-vms.cnf
|
|
||||||
|
|
||||||
files:
|
files:
|
||||||
$(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO
|
$(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO
|
||||||
|
|
||||||
@@ -130,12 +127,12 @@ links:
|
|||||||
lint:
|
lint:
|
||||||
lint -DLINT $(INCLUDES) $(SRC)>fluff
|
lint -DLINT $(INCLUDES) $(SRC)>fluff
|
||||||
|
|
||||||
update: openssl-vms.cnf local_depend
|
depend:
|
||||||
|
@if [ -z "$(THIS)" ]; then \
|
||||||
depend: local_depend
|
$(MAKE) -f $(TOP)/Makefile reflect THIS=$@; \
|
||||||
@if [ -z "$(THIS)" ]; then $(MAKE) -f $(TOP)/Makefile reflect THIS=$@; fi
|
else \
|
||||||
local_depend:
|
$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(SRC); \
|
||||||
@[ -z "$(THIS)" ] || $(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(SRC)
|
fi
|
||||||
|
|
||||||
dclean:
|
dclean:
|
||||||
$(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
|
$(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
|
||||||
@@ -147,17 +144,15 @@ clean:
|
|||||||
rm -f req
|
rm -f req
|
||||||
|
|
||||||
$(DLIBSSL):
|
$(DLIBSSL):
|
||||||
(cd ..; $(MAKE) build_libssl)
|
(cd ..; $(MAKE) DIRS=ssl all)
|
||||||
|
|
||||||
$(DLIBCRYPTO):
|
$(DLIBCRYPTO):
|
||||||
(cd ..; $(MAKE) build_libcrypto)
|
(cd ..; $(MAKE) DIRS=crypto all)
|
||||||
|
|
||||||
$(EXE): progs.h $(E_OBJ) $(PROGRAM).o $(DLIBCRYPTO) $(DLIBSSL)
|
$(EXE): progs.h $(E_OBJ) $(PROGRAM).o $(DLIBCRYPTO) $(DLIBSSL)
|
||||||
$(RM) $(EXE)
|
$(RM) $(EXE)
|
||||||
shlib_target=; if [ -n "$(SHARED_LIBS)" ]; then \
|
shlib_target=; if [ -n "$(SHARED_LIBS)" ]; then \
|
||||||
shlib_target="$(SHLIB_TARGET)"; \
|
shlib_target="$(SHLIB_TARGET)"; \
|
||||||
elif [ -n "$(FIPSCANLIB)" ]; then \
|
|
||||||
FIPSLD_CC="$(CC)"; CC=$(FIPSDIR)/bin/fipsld; export CC FIPSLD_CC; \
|
|
||||||
fi; \
|
fi; \
|
||||||
LIBRARIES="$(LIBSSL) $(LIBKRB5) $(LIBCRYPTO)" ; \
|
LIBRARIES="$(LIBSSL) $(LIBKRB5) $(LIBCRYPTO)" ; \
|
||||||
$(MAKE) -f $(TOP)/Makefile.shared -e \
|
$(MAKE) -f $(TOP)/Makefile.shared -e \
|
||||||
@@ -250,13 +245,13 @@ ciphers.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
|
|||||||
ciphers.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h
|
ciphers.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h
|
||||||
ciphers.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h
|
ciphers.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h
|
||||||
ciphers.o: ../include/openssl/pqueue.h ../include/openssl/safestack.h
|
ciphers.o: ../include/openssl/pqueue.h ../include/openssl/safestack.h
|
||||||
ciphers.o: ../include/openssl/sha.h ../include/openssl/srtp.h
|
ciphers.o: ../include/openssl/sha.h ../include/openssl/ssl.h
|
||||||
ciphers.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h
|
ciphers.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h
|
||||||
ciphers.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h
|
ciphers.o: ../include/openssl/ssl3.h ../include/openssl/stack.h
|
||||||
ciphers.o: ../include/openssl/stack.h ../include/openssl/symhacks.h
|
ciphers.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h
|
||||||
ciphers.o: ../include/openssl/tls1.h ../include/openssl/txt_db.h
|
ciphers.o: ../include/openssl/txt_db.h ../include/openssl/x509.h
|
||||||
ciphers.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h
|
ciphers.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h
|
||||||
ciphers.o: ../include/openssl/x509v3.h apps.h ciphers.c
|
ciphers.o: ciphers.c
|
||||||
cms.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
|
cms.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
|
||||||
cms.o: ../include/openssl/buffer.h ../include/openssl/cms.h
|
cms.o: ../include/openssl/buffer.h ../include/openssl/cms.h
|
||||||
cms.o: ../include/openssl/conf.h ../include/openssl/crypto.h
|
cms.o: ../include/openssl/conf.h ../include/openssl/crypto.h
|
||||||
@@ -432,13 +427,13 @@ engine.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
|
|||||||
engine.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h
|
engine.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h
|
||||||
engine.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h
|
engine.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h
|
||||||
engine.o: ../include/openssl/pqueue.h ../include/openssl/safestack.h
|
engine.o: ../include/openssl/pqueue.h ../include/openssl/safestack.h
|
||||||
engine.o: ../include/openssl/sha.h ../include/openssl/srtp.h
|
engine.o: ../include/openssl/sha.h ../include/openssl/ssl.h
|
||||||
engine.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h
|
engine.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h
|
||||||
engine.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h
|
engine.o: ../include/openssl/ssl3.h ../include/openssl/stack.h
|
||||||
engine.o: ../include/openssl/stack.h ../include/openssl/symhacks.h
|
engine.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h
|
||||||
engine.o: ../include/openssl/tls1.h ../include/openssl/txt_db.h
|
engine.o: ../include/openssl/txt_db.h ../include/openssl/x509.h
|
||||||
engine.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h
|
engine.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h
|
||||||
engine.o: ../include/openssl/x509v3.h apps.h engine.c
|
engine.o: engine.c
|
||||||
errstr.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
|
errstr.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
|
||||||
errstr.o: ../include/openssl/buffer.h ../include/openssl/comp.h
|
errstr.o: ../include/openssl/buffer.h ../include/openssl/comp.h
|
||||||
errstr.o: ../include/openssl/conf.h ../include/openssl/crypto.h
|
errstr.o: ../include/openssl/conf.h ../include/openssl/crypto.h
|
||||||
@@ -453,13 +448,13 @@ errstr.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
|
|||||||
errstr.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h
|
errstr.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h
|
||||||
errstr.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h
|
errstr.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h
|
||||||
errstr.o: ../include/openssl/pqueue.h ../include/openssl/safestack.h
|
errstr.o: ../include/openssl/pqueue.h ../include/openssl/safestack.h
|
||||||
errstr.o: ../include/openssl/sha.h ../include/openssl/srtp.h
|
errstr.o: ../include/openssl/sha.h ../include/openssl/ssl.h
|
||||||
errstr.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h
|
errstr.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h
|
||||||
errstr.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h
|
errstr.o: ../include/openssl/ssl3.h ../include/openssl/stack.h
|
||||||
errstr.o: ../include/openssl/stack.h ../include/openssl/symhacks.h
|
errstr.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h
|
||||||
errstr.o: ../include/openssl/tls1.h ../include/openssl/txt_db.h
|
errstr.o: ../include/openssl/txt_db.h ../include/openssl/x509.h
|
||||||
errstr.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h
|
errstr.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h
|
||||||
errstr.o: ../include/openssl/x509v3.h apps.h errstr.c
|
errstr.o: errstr.c
|
||||||
gendh.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
|
gendh.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
|
||||||
gendh.o: ../include/openssl/bn.h ../include/openssl/buffer.h
|
gendh.o: ../include/openssl/bn.h ../include/openssl/buffer.h
|
||||||
gendh.o: ../include/openssl/conf.h ../include/openssl/crypto.h
|
gendh.o: ../include/openssl/conf.h ../include/openssl/crypto.h
|
||||||
@@ -561,12 +556,12 @@ ocsp.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h
|
|||||||
ocsp.o: ../include/openssl/pem.h ../include/openssl/pem2.h
|
ocsp.o: ../include/openssl/pem.h ../include/openssl/pem2.h
|
||||||
ocsp.o: ../include/openssl/pkcs7.h ../include/openssl/pqueue.h
|
ocsp.o: ../include/openssl/pkcs7.h ../include/openssl/pqueue.h
|
||||||
ocsp.o: ../include/openssl/safestack.h ../include/openssl/sha.h
|
ocsp.o: ../include/openssl/safestack.h ../include/openssl/sha.h
|
||||||
ocsp.o: ../include/openssl/srtp.h ../include/openssl/ssl.h
|
ocsp.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h
|
||||||
ocsp.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h
|
ocsp.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h
|
||||||
ocsp.o: ../include/openssl/ssl3.h ../include/openssl/stack.h
|
ocsp.o: ../include/openssl/stack.h ../include/openssl/symhacks.h
|
||||||
ocsp.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h
|
ocsp.o: ../include/openssl/tls1.h ../include/openssl/txt_db.h
|
||||||
ocsp.o: ../include/openssl/txt_db.h ../include/openssl/x509.h
|
ocsp.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h
|
||||||
ocsp.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h ocsp.c
|
ocsp.o: ../include/openssl/x509v3.h apps.h ocsp.c
|
||||||
openssl.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
|
openssl.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
|
||||||
openssl.o: ../include/openssl/buffer.h ../include/openssl/comp.h
|
openssl.o: ../include/openssl/buffer.h ../include/openssl/comp.h
|
||||||
openssl.o: ../include/openssl/conf.h ../include/openssl/crypto.h
|
openssl.o: ../include/openssl/conf.h ../include/openssl/crypto.h
|
||||||
@@ -580,9 +575,8 @@ openssl.o: ../include/openssl/objects.h ../include/openssl/ocsp.h
|
|||||||
openssl.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
|
openssl.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
|
||||||
openssl.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h
|
openssl.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h
|
||||||
openssl.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h
|
openssl.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h
|
||||||
openssl.o: ../include/openssl/pqueue.h ../include/openssl/rand.h
|
openssl.o: ../include/openssl/pqueue.h ../include/openssl/safestack.h
|
||||||
openssl.o: ../include/openssl/safestack.h ../include/openssl/sha.h
|
openssl.o: ../include/openssl/sha.h ../include/openssl/ssl.h
|
||||||
openssl.o: ../include/openssl/srtp.h ../include/openssl/ssl.h
|
|
||||||
openssl.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h
|
openssl.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h
|
||||||
openssl.o: ../include/openssl/ssl3.h ../include/openssl/stack.h
|
openssl.o: ../include/openssl/ssl3.h ../include/openssl/stack.h
|
||||||
openssl.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h
|
openssl.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h
|
||||||
@@ -797,13 +791,12 @@ s_cb.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h
|
|||||||
s_cb.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h
|
s_cb.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h
|
||||||
s_cb.o: ../include/openssl/pqueue.h ../include/openssl/rand.h
|
s_cb.o: ../include/openssl/pqueue.h ../include/openssl/rand.h
|
||||||
s_cb.o: ../include/openssl/safestack.h ../include/openssl/sha.h
|
s_cb.o: ../include/openssl/safestack.h ../include/openssl/sha.h
|
||||||
s_cb.o: ../include/openssl/srtp.h ../include/openssl/ssl.h
|
s_cb.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h
|
||||||
s_cb.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h
|
s_cb.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h
|
||||||
s_cb.o: ../include/openssl/ssl3.h ../include/openssl/stack.h
|
s_cb.o: ../include/openssl/stack.h ../include/openssl/symhacks.h
|
||||||
s_cb.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h
|
s_cb.o: ../include/openssl/tls1.h ../include/openssl/txt_db.h
|
||||||
s_cb.o: ../include/openssl/txt_db.h ../include/openssl/x509.h
|
s_cb.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h
|
||||||
s_cb.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h
|
s_cb.o: ../include/openssl/x509v3.h apps.h s_apps.h s_cb.c
|
||||||
s_cb.o: s_apps.h s_cb.c
|
|
||||||
s_client.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
|
s_client.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
|
||||||
s_client.o: ../include/openssl/bn.h ../include/openssl/buffer.h
|
s_client.o: ../include/openssl/bn.h ../include/openssl/buffer.h
|
||||||
s_client.o: ../include/openssl/comp.h ../include/openssl/conf.h
|
s_client.o: ../include/openssl/comp.h ../include/openssl/conf.h
|
||||||
@@ -819,8 +812,7 @@ s_client.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h
|
|||||||
s_client.o: ../include/openssl/pem.h ../include/openssl/pem2.h
|
s_client.o: ../include/openssl/pem.h ../include/openssl/pem2.h
|
||||||
s_client.o: ../include/openssl/pkcs7.h ../include/openssl/pqueue.h
|
s_client.o: ../include/openssl/pkcs7.h ../include/openssl/pqueue.h
|
||||||
s_client.o: ../include/openssl/rand.h ../include/openssl/safestack.h
|
s_client.o: ../include/openssl/rand.h ../include/openssl/safestack.h
|
||||||
s_client.o: ../include/openssl/sha.h ../include/openssl/srp.h
|
s_client.o: ../include/openssl/sha.h ../include/openssl/ssl.h
|
||||||
s_client.o: ../include/openssl/srtp.h ../include/openssl/ssl.h
|
|
||||||
s_client.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h
|
s_client.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h
|
||||||
s_client.o: ../include/openssl/ssl3.h ../include/openssl/stack.h
|
s_client.o: ../include/openssl/ssl3.h ../include/openssl/stack.h
|
||||||
s_client.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h
|
s_client.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h
|
||||||
@@ -844,7 +836,6 @@ s_server.o: ../include/openssl/pem.h ../include/openssl/pem2.h
|
|||||||
s_server.o: ../include/openssl/pkcs7.h ../include/openssl/pqueue.h
|
s_server.o: ../include/openssl/pkcs7.h ../include/openssl/pqueue.h
|
||||||
s_server.o: ../include/openssl/rand.h ../include/openssl/rsa.h
|
s_server.o: ../include/openssl/rand.h ../include/openssl/rsa.h
|
||||||
s_server.o: ../include/openssl/safestack.h ../include/openssl/sha.h
|
s_server.o: ../include/openssl/safestack.h ../include/openssl/sha.h
|
||||||
s_server.o: ../include/openssl/srp.h ../include/openssl/srtp.h
|
|
||||||
s_server.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h
|
s_server.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h
|
||||||
s_server.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h
|
s_server.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h
|
||||||
s_server.o: ../include/openssl/stack.h ../include/openssl/symhacks.h
|
s_server.o: ../include/openssl/stack.h ../include/openssl/symhacks.h
|
||||||
@@ -866,13 +857,13 @@ s_socket.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
|
|||||||
s_socket.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h
|
s_socket.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h
|
||||||
s_socket.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h
|
s_socket.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h
|
||||||
s_socket.o: ../include/openssl/pqueue.h ../include/openssl/safestack.h
|
s_socket.o: ../include/openssl/pqueue.h ../include/openssl/safestack.h
|
||||||
s_socket.o: ../include/openssl/sha.h ../include/openssl/srtp.h
|
s_socket.o: ../include/openssl/sha.h ../include/openssl/ssl.h
|
||||||
s_socket.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h
|
s_socket.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h
|
||||||
s_socket.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h
|
s_socket.o: ../include/openssl/ssl3.h ../include/openssl/stack.h
|
||||||
s_socket.o: ../include/openssl/stack.h ../include/openssl/symhacks.h
|
s_socket.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h
|
||||||
s_socket.o: ../include/openssl/tls1.h ../include/openssl/txt_db.h
|
s_socket.o: ../include/openssl/txt_db.h ../include/openssl/x509.h
|
||||||
s_socket.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h
|
s_socket.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h
|
||||||
s_socket.o: ../include/openssl/x509v3.h apps.h s_apps.h s_socket.c
|
s_socket.o: s_apps.h s_socket.c
|
||||||
s_time.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
|
s_time.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
|
||||||
s_time.o: ../include/openssl/buffer.h ../include/openssl/comp.h
|
s_time.o: ../include/openssl/buffer.h ../include/openssl/comp.h
|
||||||
s_time.o: ../include/openssl/conf.h ../include/openssl/crypto.h
|
s_time.o: ../include/openssl/conf.h ../include/openssl/crypto.h
|
||||||
@@ -887,13 +878,13 @@ s_time.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
|
|||||||
s_time.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h
|
s_time.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h
|
||||||
s_time.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h
|
s_time.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h
|
||||||
s_time.o: ../include/openssl/pqueue.h ../include/openssl/safestack.h
|
s_time.o: ../include/openssl/pqueue.h ../include/openssl/safestack.h
|
||||||
s_time.o: ../include/openssl/sha.h ../include/openssl/srtp.h
|
s_time.o: ../include/openssl/sha.h ../include/openssl/ssl.h
|
||||||
s_time.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h
|
s_time.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h
|
||||||
s_time.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h
|
s_time.o: ../include/openssl/ssl3.h ../include/openssl/stack.h
|
||||||
s_time.o: ../include/openssl/stack.h ../include/openssl/symhacks.h
|
s_time.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h
|
||||||
s_time.o: ../include/openssl/tls1.h ../include/openssl/txt_db.h
|
s_time.o: ../include/openssl/txt_db.h ../include/openssl/x509.h
|
||||||
s_time.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h
|
s_time.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h
|
||||||
s_time.o: ../include/openssl/x509v3.h apps.h s_apps.h s_time.c
|
s_time.o: s_apps.h s_time.c
|
||||||
sess_id.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
|
sess_id.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
|
||||||
sess_id.o: ../include/openssl/buffer.h ../include/openssl/comp.h
|
sess_id.o: ../include/openssl/buffer.h ../include/openssl/comp.h
|
||||||
sess_id.o: ../include/openssl/conf.h ../include/openssl/crypto.h
|
sess_id.o: ../include/openssl/conf.h ../include/openssl/crypto.h
|
||||||
@@ -908,13 +899,13 @@ sess_id.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
|
|||||||
sess_id.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h
|
sess_id.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h
|
||||||
sess_id.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h
|
sess_id.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h
|
||||||
sess_id.o: ../include/openssl/pqueue.h ../include/openssl/safestack.h
|
sess_id.o: ../include/openssl/pqueue.h ../include/openssl/safestack.h
|
||||||
sess_id.o: ../include/openssl/sha.h ../include/openssl/srtp.h
|
sess_id.o: ../include/openssl/sha.h ../include/openssl/ssl.h
|
||||||
sess_id.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h
|
sess_id.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h
|
||||||
sess_id.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h
|
sess_id.o: ../include/openssl/ssl3.h ../include/openssl/stack.h
|
||||||
sess_id.o: ../include/openssl/stack.h ../include/openssl/symhacks.h
|
sess_id.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h
|
||||||
sess_id.o: ../include/openssl/tls1.h ../include/openssl/txt_db.h
|
sess_id.o: ../include/openssl/txt_db.h ../include/openssl/x509.h
|
||||||
sess_id.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h
|
sess_id.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h
|
||||||
sess_id.o: ../include/openssl/x509v3.h apps.h sess_id.c
|
sess_id.o: sess_id.c
|
||||||
smime.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
|
smime.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
|
||||||
smime.o: ../include/openssl/buffer.h ../include/openssl/conf.h
|
smime.o: ../include/openssl/buffer.h ../include/openssl/conf.h
|
||||||
smime.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
|
smime.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
|
||||||
@@ -944,19 +935,19 @@ speed.o: ../include/openssl/err.h ../include/openssl/evp.h
|
|||||||
speed.o: ../include/openssl/hmac.h ../include/openssl/idea.h
|
speed.o: ../include/openssl/hmac.h ../include/openssl/idea.h
|
||||||
speed.o: ../include/openssl/lhash.h ../include/openssl/md4.h
|
speed.o: ../include/openssl/lhash.h ../include/openssl/md4.h
|
||||||
speed.o: ../include/openssl/md5.h ../include/openssl/mdc2.h
|
speed.o: ../include/openssl/md5.h ../include/openssl/mdc2.h
|
||||||
speed.o: ../include/openssl/modes.h ../include/openssl/obj_mac.h
|
speed.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h
|
||||||
speed.o: ../include/openssl/objects.h ../include/openssl/ocsp.h
|
speed.o: ../include/openssl/ocsp.h ../include/openssl/opensslconf.h
|
||||||
speed.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
|
speed.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h
|
||||||
speed.o: ../include/openssl/ossl_typ.h ../include/openssl/pkcs7.h
|
speed.o: ../include/openssl/pkcs7.h ../include/openssl/rand.h
|
||||||
speed.o: ../include/openssl/rand.h ../include/openssl/rc2.h
|
speed.o: ../include/openssl/rc2.h ../include/openssl/rc4.h
|
||||||
speed.o: ../include/openssl/rc4.h ../include/openssl/ripemd.h
|
speed.o: ../include/openssl/ripemd.h ../include/openssl/rsa.h
|
||||||
speed.o: ../include/openssl/rsa.h ../include/openssl/safestack.h
|
speed.o: ../include/openssl/safestack.h ../include/openssl/seed.h
|
||||||
speed.o: ../include/openssl/seed.h ../include/openssl/sha.h
|
speed.o: ../include/openssl/sha.h ../include/openssl/stack.h
|
||||||
speed.o: ../include/openssl/stack.h ../include/openssl/symhacks.h
|
speed.o: ../include/openssl/symhacks.h ../include/openssl/txt_db.h
|
||||||
speed.o: ../include/openssl/txt_db.h ../include/openssl/ui.h
|
speed.o: ../include/openssl/ui.h ../include/openssl/ui_compat.h
|
||||||
speed.o: ../include/openssl/ui_compat.h ../include/openssl/whrlpool.h
|
speed.o: ../include/openssl/whrlpool.h ../include/openssl/x509.h
|
||||||
speed.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h
|
speed.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h
|
||||||
speed.o: ../include/openssl/x509v3.h apps.h speed.c testdsa.h testrsa.h
|
speed.o: speed.c testdsa.h testrsa.h
|
||||||
spkac.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
|
spkac.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
|
||||||
spkac.o: ../include/openssl/buffer.h ../include/openssl/conf.h
|
spkac.o: ../include/openssl/buffer.h ../include/openssl/conf.h
|
||||||
spkac.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
|
spkac.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
|
||||||
@@ -973,21 +964,6 @@ spkac.o: ../include/openssl/stack.h ../include/openssl/symhacks.h
|
|||||||
spkac.o: ../include/openssl/txt_db.h ../include/openssl/x509.h
|
spkac.o: ../include/openssl/txt_db.h ../include/openssl/x509.h
|
||||||
spkac.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h
|
spkac.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h
|
||||||
spkac.o: spkac.c
|
spkac.o: spkac.c
|
||||||
srp.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
|
|
||||||
srp.o: ../include/openssl/bn.h ../include/openssl/buffer.h
|
|
||||||
srp.o: ../include/openssl/conf.h ../include/openssl/crypto.h
|
|
||||||
srp.o: ../include/openssl/e_os2.h ../include/openssl/ec.h
|
|
||||||
srp.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h
|
|
||||||
srp.o: ../include/openssl/engine.h ../include/openssl/err.h
|
|
||||||
srp.o: ../include/openssl/evp.h ../include/openssl/lhash.h
|
|
||||||
srp.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h
|
|
||||||
srp.o: ../include/openssl/ocsp.h ../include/openssl/opensslconf.h
|
|
||||||
srp.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h
|
|
||||||
srp.o: ../include/openssl/pkcs7.h ../include/openssl/safestack.h
|
|
||||||
srp.o: ../include/openssl/sha.h ../include/openssl/srp.h
|
|
||||||
srp.o: ../include/openssl/stack.h ../include/openssl/symhacks.h
|
|
||||||
srp.o: ../include/openssl/txt_db.h ../include/openssl/x509.h
|
|
||||||
srp.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h srp.c
|
|
||||||
ts.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
|
ts.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
|
||||||
ts.o: ../include/openssl/bn.h ../include/openssl/buffer.h
|
ts.o: ../include/openssl/bn.h ../include/openssl/buffer.h
|
||||||
ts.o: ../include/openssl/conf.h ../include/openssl/crypto.h
|
ts.o: ../include/openssl/conf.h ../include/openssl/crypto.h
|
||||||
|
|||||||
168
apps/app_rand.c
168
apps/app_rand.c
@@ -115,106 +115,104 @@
|
|||||||
#include <openssl/bio.h>
|
#include <openssl/bio.h>
|
||||||
#include <openssl/rand.h>
|
#include <openssl/rand.h>
|
||||||
|
|
||||||
|
|
||||||
static int seeded = 0;
|
static int seeded = 0;
|
||||||
static int egdsocket = 0;
|
static int egdsocket = 0;
|
||||||
|
|
||||||
int app_RAND_load_file(const char *file, BIO *bio_e, int dont_warn)
|
int app_RAND_load_file(const char *file, BIO *bio_e, int dont_warn)
|
||||||
{
|
{
|
||||||
int consider_randfile = (file == NULL);
|
int consider_randfile = (file == NULL);
|
||||||
char buffer[200];
|
char buffer[200];
|
||||||
|
|
||||||
#ifdef OPENSSL_SYS_WINDOWS
|
#ifdef OPENSSL_SYS_WINDOWS
|
||||||
BIO_printf(bio_e, "Loading 'screen' into random state -");
|
BIO_printf(bio_e,"Loading 'screen' into random state -");
|
||||||
BIO_flush(bio_e);
|
BIO_flush(bio_e);
|
||||||
RAND_screen();
|
RAND_screen();
|
||||||
BIO_printf(bio_e, " done\n");
|
BIO_printf(bio_e," done\n");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (file == NULL)
|
if (file == NULL)
|
||||||
file = RAND_file_name(buffer, sizeof buffer);
|
file = RAND_file_name(buffer, sizeof buffer);
|
||||||
else if (RAND_egd(file) > 0) {
|
else if (RAND_egd(file) > 0)
|
||||||
/*
|
{
|
||||||
* we try if the given filename is an EGD socket. if it is, we don't
|
/* we try if the given filename is an EGD socket.
|
||||||
* write anything back to the file.
|
if it is, we don't write anything back to the file. */
|
||||||
*/
|
egdsocket = 1;
|
||||||
egdsocket = 1;
|
return 1;
|
||||||
return 1;
|
}
|
||||||
}
|
if (file == NULL || !RAND_load_file(file, -1))
|
||||||
if (file == NULL || !RAND_load_file(file, -1)) {
|
{
|
||||||
if (RAND_status() == 0) {
|
if (RAND_status() == 0)
|
||||||
if (!dont_warn) {
|
{
|
||||||
BIO_printf(bio_e, "unable to load 'random state'\n");
|
if (!dont_warn)
|
||||||
BIO_printf(bio_e,
|
{
|
||||||
"This means that the random number generator has not been seeded\n");
|
BIO_printf(bio_e,"unable to load 'random state'\n");
|
||||||
BIO_printf(bio_e, "with much random data.\n");
|
BIO_printf(bio_e,"This means that the random number generator has not been seeded\n");
|
||||||
if (consider_randfile) { /* explanation does not apply when a
|
BIO_printf(bio_e,"with much random data.\n");
|
||||||
* file is explicitly named */
|
if (consider_randfile) /* explanation does not apply when a file is explicitly named */
|
||||||
BIO_printf(bio_e,
|
{
|
||||||
"Consider setting the RANDFILE environment variable to point at a file that\n");
|
BIO_printf(bio_e,"Consider setting the RANDFILE environment variable to point at a file that\n");
|
||||||
BIO_printf(bio_e,
|
BIO_printf(bio_e,"'random' data can be kept in (the file will be overwritten).\n");
|
||||||
"'random' data can be kept in (the file will be overwritten).\n");
|
}
|
||||||
}
|
}
|
||||||
}
|
return 0;
|
||||||
return 0;
|
}
|
||||||
}
|
}
|
||||||
}
|
seeded = 1;
|
||||||
seeded = 1;
|
return 1;
|
||||||
return 1;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
long app_RAND_load_files(char *name)
|
long app_RAND_load_files(char *name)
|
||||||
{
|
{
|
||||||
char *p, *n;
|
char *p,*n;
|
||||||
int last;
|
int last;
|
||||||
long tot = 0;
|
long tot=0;
|
||||||
int egd;
|
int egd;
|
||||||
|
|
||||||
for (;;) {
|
for (;;)
|
||||||
last = 0;
|
{
|
||||||
for (p = name; ((*p != '\0') && (*p != LIST_SEPARATOR_CHAR)); p++) ;
|
last=0;
|
||||||
if (*p == '\0')
|
for (p=name; ((*p != '\0') && (*p != LIST_SEPARATOR_CHAR)); p++);
|
||||||
last = 1;
|
if (*p == '\0') last=1;
|
||||||
*p = '\0';
|
*p='\0';
|
||||||
n = name;
|
n=name;
|
||||||
name = p + 1;
|
name=p+1;
|
||||||
if (*n == '\0')
|
if (*n == '\0') break;
|
||||||
break;
|
|
||||||
|
|
||||||
egd = RAND_egd(n);
|
egd=RAND_egd(n);
|
||||||
if (egd > 0)
|
if (egd > 0)
|
||||||
tot += egd;
|
tot+=egd;
|
||||||
else
|
else
|
||||||
tot += RAND_load_file(n, -1);
|
tot+=RAND_load_file(n,-1);
|
||||||
if (last)
|
if (last) break;
|
||||||
break;
|
}
|
||||||
}
|
if (tot > 512)
|
||||||
if (tot > 512)
|
app_RAND_allow_write_file();
|
||||||
app_RAND_allow_write_file();
|
return(tot);
|
||||||
return (tot);
|
}
|
||||||
}
|
|
||||||
|
|
||||||
int app_RAND_write_file(const char *file, BIO *bio_e)
|
int app_RAND_write_file(const char *file, BIO *bio_e)
|
||||||
{
|
{
|
||||||
char buffer[200];
|
char buffer[200];
|
||||||
|
|
||||||
if (egdsocket || !seeded)
|
if (egdsocket || !seeded)
|
||||||
/*
|
/* If we did not manage to read the seed file,
|
||||||
* If we did not manage to read the seed file, we should not write a
|
* we should not write a low-entropy seed file back --
|
||||||
* low-entropy seed file back -- it would suppress a crucial warning
|
* it would suppress a crucial warning the next time
|
||||||
* the next time we want to use it.
|
* we want to use it. */
|
||||||
*/
|
return 0;
|
||||||
return 0;
|
|
||||||
|
|
||||||
if (file == NULL)
|
if (file == NULL)
|
||||||
file = RAND_file_name(buffer, sizeof buffer);
|
file = RAND_file_name(buffer, sizeof buffer);
|
||||||
if (file == NULL || !RAND_write_file(file)) {
|
if (file == NULL || !RAND_write_file(file))
|
||||||
BIO_printf(bio_e, "unable to write 'random state'\n");
|
{
|
||||||
return 0;
|
BIO_printf(bio_e,"unable to write 'random state'\n");
|
||||||
}
|
return 0;
|
||||||
return 1;
|
}
|
||||||
}
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
void app_RAND_allow_write_file(void)
|
void app_RAND_allow_write_file(void)
|
||||||
{
|
{
|
||||||
seeded = 1;
|
seeded = 1;
|
||||||
}
|
}
|
||||||
|
|||||||
4668
apps/apps.c
4668
apps/apps.c
File diff suppressed because it is too large
Load Diff
319
apps/apps.h
319
apps/apps.h
@@ -110,119 +110,120 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef HEADER_APPS_H
|
#ifndef HEADER_APPS_H
|
||||||
# define HEADER_APPS_H
|
#define HEADER_APPS_H
|
||||||
|
|
||||||
# include "e_os.h"
|
#include "e_os.h"
|
||||||
|
|
||||||
# include <openssl/bio.h>
|
#include <openssl/bio.h>
|
||||||
# include <openssl/x509.h>
|
#include <openssl/x509.h>
|
||||||
# include <openssl/lhash.h>
|
#include <openssl/lhash.h>
|
||||||
# include <openssl/conf.h>
|
#include <openssl/conf.h>
|
||||||
# include <openssl/txt_db.h>
|
#include <openssl/txt_db.h>
|
||||||
# ifndef OPENSSL_NO_ENGINE
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
# include <openssl/engine.h>
|
#include <openssl/engine.h>
|
||||||
# endif
|
#endif
|
||||||
# ifndef OPENSSL_NO_OCSP
|
#ifndef OPENSSL_NO_OCSP
|
||||||
# include <openssl/ocsp.h>
|
#include <openssl/ocsp.h>
|
||||||
# endif
|
#endif
|
||||||
# include <openssl/ossl_typ.h>
|
#include <openssl/ossl_typ.h>
|
||||||
|
|
||||||
int app_RAND_load_file(const char *file, BIO *bio_e, int dont_warn);
|
int app_RAND_load_file(const char *file, BIO *bio_e, int dont_warn);
|
||||||
int app_RAND_write_file(const char *file, BIO *bio_e);
|
int app_RAND_write_file(const char *file, BIO *bio_e);
|
||||||
/*
|
/* When `file' is NULL, use defaults.
|
||||||
* When `file' is NULL, use defaults. `bio_e' is for error messages.
|
* `bio_e' is for error messages. */
|
||||||
*/
|
|
||||||
void app_RAND_allow_write_file(void);
|
void app_RAND_allow_write_file(void);
|
||||||
long app_RAND_load_files(char *file); /* `file' is a list of files to read,
|
long app_RAND_load_files(char *file); /* `file' is a list of files to read,
|
||||||
* separated by LIST_SEPARATOR_CHAR
|
* separated by LIST_SEPARATOR_CHAR
|
||||||
* (see e_os.h). The string is
|
* (see e_os.h). The string is
|
||||||
* destroyed! */
|
* destroyed! */
|
||||||
|
|
||||||
# ifndef MONOLITH
|
#ifndef MONOLITH
|
||||||
|
|
||||||
# define MAIN(a,v) main(a,v)
|
#define MAIN(a,v) main(a,v)
|
||||||
|
|
||||||
# ifndef NON_MAIN
|
#ifndef NON_MAIN
|
||||||
CONF *config = NULL;
|
CONF *config=NULL;
|
||||||
BIO *bio_err = NULL;
|
BIO *bio_err=NULL;
|
||||||
# else
|
#else
|
||||||
extern CONF *config;
|
extern CONF *config;
|
||||||
extern BIO *bio_err;
|
extern BIO *bio_err;
|
||||||
# endif
|
#endif
|
||||||
|
|
||||||
# else
|
#else
|
||||||
|
|
||||||
# define MAIN(a,v) PROG(a,v)
|
#define MAIN(a,v) PROG(a,v)
|
||||||
extern CONF *config;
|
extern CONF *config;
|
||||||
extern char *default_config_file;
|
extern char *default_config_file;
|
||||||
extern BIO *bio_err;
|
extern BIO *bio_err;
|
||||||
|
|
||||||
# endif
|
#endif
|
||||||
|
|
||||||
# ifndef OPENSSL_SYS_NETWARE
|
#ifndef OPENSSL_SYS_NETWARE
|
||||||
# include <signal.h>
|
#include <signal.h>
|
||||||
# endif
|
#endif
|
||||||
|
|
||||||
# ifdef SIGPIPE
|
#ifdef SIGPIPE
|
||||||
# define do_pipe_sig() signal(SIGPIPE,SIG_IGN)
|
#define do_pipe_sig() signal(SIGPIPE,SIG_IGN)
|
||||||
# else
|
#else
|
||||||
# define do_pipe_sig()
|
#define do_pipe_sig()
|
||||||
# endif
|
#endif
|
||||||
|
|
||||||
# ifdef OPENSSL_NO_COMP
|
#ifdef OPENSSL_NO_COMP
|
||||||
# define zlib_cleanup()
|
#define zlib_cleanup()
|
||||||
# else
|
#else
|
||||||
# define zlib_cleanup() COMP_zlib_cleanup()
|
#define zlib_cleanup() COMP_zlib_cleanup()
|
||||||
# endif
|
#endif
|
||||||
|
|
||||||
# if defined(MONOLITH) && !defined(OPENSSL_C)
|
#if defined(MONOLITH) && !defined(OPENSSL_C)
|
||||||
# define apps_startup() \
|
# define apps_startup() \
|
||||||
do_pipe_sig()
|
do_pipe_sig()
|
||||||
# define apps_shutdown()
|
# define apps_shutdown()
|
||||||
# else
|
#else
|
||||||
# ifndef OPENSSL_NO_ENGINE
|
# ifndef OPENSSL_NO_ENGINE
|
||||||
# define apps_startup() \
|
# define apps_startup() \
|
||||||
do { do_pipe_sig(); CRYPTO_malloc_init(); \
|
do { do_pipe_sig(); CRYPTO_malloc_init(); \
|
||||||
ERR_load_crypto_strings(); OpenSSL_add_all_algorithms(); \
|
ERR_load_crypto_strings(); OpenSSL_add_all_algorithms(); \
|
||||||
ENGINE_load_builtin_engines(); setup_ui_method(); } while(0)
|
ENGINE_load_builtin_engines(); setup_ui_method(); } while(0)
|
||||||
# define apps_shutdown() \
|
# define apps_shutdown() \
|
||||||
do { CONF_modules_unload(1); destroy_ui_method(); \
|
do { CONF_modules_unload(1); destroy_ui_method(); \
|
||||||
OBJ_cleanup(); EVP_cleanup(); ENGINE_cleanup(); \
|
OBJ_cleanup(); EVP_cleanup(); ENGINE_cleanup(); \
|
||||||
CRYPTO_cleanup_all_ex_data(); ERR_remove_thread_state(NULL); \
|
CRYPTO_cleanup_all_ex_data(); ERR_remove_thread_state(NULL); \
|
||||||
RAND_cleanup(); \
|
ERR_free_strings(); zlib_cleanup();} while(0)
|
||||||
ERR_free_strings(); zlib_cleanup();} while(0)
|
|
||||||
# else
|
# else
|
||||||
# define apps_startup() \
|
# define apps_startup() \
|
||||||
do { do_pipe_sig(); CRYPTO_malloc_init(); \
|
do { do_pipe_sig(); CRYPTO_malloc_init(); \
|
||||||
ERR_load_crypto_strings(); OpenSSL_add_all_algorithms(); \
|
ERR_load_crypto_strings(); OpenSSL_add_all_algorithms(); \
|
||||||
setup_ui_method(); } while(0)
|
setup_ui_method(); } while(0)
|
||||||
# define apps_shutdown() \
|
# define apps_shutdown() \
|
||||||
do { CONF_modules_unload(1); destroy_ui_method(); \
|
do { CONF_modules_unload(1); destroy_ui_method(); \
|
||||||
OBJ_cleanup(); EVP_cleanup(); \
|
OBJ_cleanup(); EVP_cleanup(); \
|
||||||
CRYPTO_cleanup_all_ex_data(); ERR_remove_thread_state(NULL); \
|
CRYPTO_cleanup_all_ex_data(); ERR_remove_thread_state(NULL); \
|
||||||
RAND_cleanup(); \
|
ERR_free_strings(); zlib_cleanup(); } while(0)
|
||||||
ERR_free_strings(); zlib_cleanup(); } while(0)
|
|
||||||
# endif
|
# endif
|
||||||
# endif
|
#endif
|
||||||
|
|
||||||
# ifdef OPENSSL_SYSNAME_WIN32
|
#ifdef OPENSSL_SYSNAME_WIN32
|
||||||
# define openssl_fdset(a,b) FD_SET((unsigned int)a, b)
|
# define openssl_fdset(a,b) FD_SET((unsigned int)a, b)
|
||||||
# else
|
#else
|
||||||
# define openssl_fdset(a,b) FD_SET(a, b)
|
# define openssl_fdset(a,b) FD_SET(a, b)
|
||||||
# endif
|
#endif
|
||||||
|
|
||||||
typedef struct args_st {
|
|
||||||
char **data;
|
|
||||||
int count;
|
|
||||||
} ARGS;
|
|
||||||
|
|
||||||
# define PW_MIN_LENGTH 4
|
typedef struct args_st
|
||||||
typedef struct pw_cb_data {
|
{
|
||||||
const void *password;
|
char **data;
|
||||||
const char *prompt_info;
|
int count;
|
||||||
} PW_CB_DATA;
|
} ARGS;
|
||||||
|
|
||||||
int password_callback(char *buf, int bufsiz, int verify, PW_CB_DATA *cb_data);
|
#define PW_MIN_LENGTH 4
|
||||||
|
typedef struct pw_cb_data
|
||||||
|
{
|
||||||
|
const void *password;
|
||||||
|
const char *prompt_info;
|
||||||
|
} PW_CB_DATA;
|
||||||
|
|
||||||
|
int password_callback(char *buf, int bufsiz, int verify,
|
||||||
|
PW_CB_DATA *cb_data);
|
||||||
|
|
||||||
int setup_ui_method(void);
|
int setup_ui_method(void);
|
||||||
void destroy_ui_method(void);
|
void destroy_ui_method(void);
|
||||||
@@ -230,13 +231,12 @@ void destroy_ui_method(void);
|
|||||||
int should_retry(int i);
|
int should_retry(int i);
|
||||||
int args_from_file(char *file, int *argc, char **argv[]);
|
int args_from_file(char *file, int *argc, char **argv[]);
|
||||||
int str2fmt(char *s);
|
int str2fmt(char *s);
|
||||||
void program_name(char *in, char *out, int size);
|
void program_name(char *in,char *out,int size);
|
||||||
int chopup_args(ARGS *arg, char *buf, int *argc, char **argv[]);
|
int chopup_args(ARGS *arg,char *buf, int *argc, char **argv[]);
|
||||||
# ifdef HEADER_X509_H
|
#ifdef HEADER_X509_H
|
||||||
int dump_cert_text(BIO *out, X509 *x);
|
int dump_cert_text(BIO *out, X509 *x);
|
||||||
void print_name(BIO *out, const char *title, X509_NAME *nm,
|
void print_name(BIO *out, const char *title, X509_NAME *nm, unsigned long lflags);
|
||||||
unsigned long lflags);
|
#endif
|
||||||
# endif
|
|
||||||
int set_cert_ex(unsigned long *flags, const char *arg);
|
int set_cert_ex(unsigned long *flags, const char *arg);
|
||||||
int set_name_ex(unsigned long *flags, const char *arg);
|
int set_name_ex(unsigned long *flags, const char *arg);
|
||||||
int set_ext_copy(int *copy_type, const char *arg);
|
int set_ext_copy(int *copy_type, const char *arg);
|
||||||
@@ -244,134 +244,117 @@ int copy_extensions(X509 *x, X509_REQ *req, int copy_type);
|
|||||||
int app_passwd(BIO *err, char *arg1, char *arg2, char **pass1, char **pass2);
|
int app_passwd(BIO *err, char *arg1, char *arg2, char **pass1, char **pass2);
|
||||||
int add_oid_section(BIO *err, CONF *conf);
|
int add_oid_section(BIO *err, CONF *conf);
|
||||||
X509 *load_cert(BIO *err, const char *file, int format,
|
X509 *load_cert(BIO *err, const char *file, int format,
|
||||||
const char *pass, ENGINE *e, const char *cert_descrip);
|
const char *pass, ENGINE *e, const char *cert_descrip);
|
||||||
EVP_PKEY *load_key(BIO *err, const char *file, int format, int maybe_stdin,
|
EVP_PKEY *load_key(BIO *err, const char *file, int format, int maybe_stdin,
|
||||||
const char *pass, ENGINE *e, const char *key_descrip);
|
const char *pass, ENGINE *e, const char *key_descrip);
|
||||||
EVP_PKEY *load_pubkey(BIO *err, const char *file, int format, int maybe_stdin,
|
EVP_PKEY *load_pubkey(BIO *err, const char *file, int format, int maybe_stdin,
|
||||||
const char *pass, ENGINE *e, const char *key_descrip);
|
const char *pass, ENGINE *e, const char *key_descrip);
|
||||||
STACK_OF(X509) *load_certs(BIO *err, const char *file, int format,
|
STACK_OF(X509) *load_certs(BIO *err, const char *file, int format,
|
||||||
const char *pass, ENGINE *e,
|
const char *pass, ENGINE *e, const char *cert_descrip);
|
||||||
const char *cert_descrip);
|
|
||||||
STACK_OF(X509_CRL) *load_crls(BIO *err, const char *file, int format,
|
STACK_OF(X509_CRL) *load_crls(BIO *err, const char *file, int format,
|
||||||
const char *pass, ENGINE *e,
|
const char *pass, ENGINE *e, const char *cert_descrip);
|
||||||
const char *cert_descrip);
|
|
||||||
X509_STORE *setup_verify(BIO *bp, char *CAfile, char *CApath);
|
X509_STORE *setup_verify(BIO *bp, char *CAfile, char *CApath);
|
||||||
# ifndef OPENSSL_NO_ENGINE
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
ENGINE *setup_engine(BIO *err, const char *engine, int debug);
|
ENGINE *setup_engine(BIO *err, const char *engine, int debug);
|
||||||
# endif
|
#endif
|
||||||
|
|
||||||
# ifndef OPENSSL_NO_OCSP
|
#ifndef OPENSSL_NO_OCSP
|
||||||
OCSP_RESPONSE *process_responder(BIO *err, OCSP_REQUEST *req,
|
OCSP_RESPONSE *process_responder(BIO *err, OCSP_REQUEST *req,
|
||||||
char *host, char *path, char *port,
|
char *host, char *path, char *port, int use_ssl,
|
||||||
int use_ssl, STACK_OF(CONF_VALUE) *headers,
|
STACK_OF(CONF_VALUE) *headers,
|
||||||
int req_timeout);
|
int req_timeout);
|
||||||
# endif
|
#endif
|
||||||
|
|
||||||
int load_config(BIO *err, CONF *cnf);
|
int load_config(BIO *err, CONF *cnf);
|
||||||
char *make_config_name(void);
|
char *make_config_name(void);
|
||||||
|
|
||||||
/* Functions defined in ca.c and also used in ocsp.c */
|
/* Functions defined in ca.c and also used in ocsp.c */
|
||||||
int unpack_revinfo(ASN1_TIME **prevtm, int *preason, ASN1_OBJECT **phold,
|
int unpack_revinfo(ASN1_TIME **prevtm, int *preason, ASN1_OBJECT **phold,
|
||||||
ASN1_GENERALIZEDTIME **pinvtm, const char *str);
|
ASN1_GENERALIZEDTIME **pinvtm, const char *str);
|
||||||
|
|
||||||
# define DB_type 0
|
#define DB_type 0
|
||||||
# define DB_exp_date 1
|
#define DB_exp_date 1
|
||||||
# define DB_rev_date 2
|
#define DB_rev_date 2
|
||||||
# define DB_serial 3 /* index - unique */
|
#define DB_serial 3 /* index - unique */
|
||||||
# define DB_file 4
|
#define DB_file 4
|
||||||
# define DB_name 5 /* index - unique when active and not
|
#define DB_name 5 /* index - unique when active and not disabled */
|
||||||
* disabled */
|
#define DB_NUMBER 6
|
||||||
# define DB_NUMBER 6
|
|
||||||
|
|
||||||
# define DB_TYPE_REV 'R'
|
#define DB_TYPE_REV 'R'
|
||||||
# define DB_TYPE_EXP 'E'
|
#define DB_TYPE_EXP 'E'
|
||||||
# define DB_TYPE_VAL 'V'
|
#define DB_TYPE_VAL 'V'
|
||||||
|
|
||||||
typedef struct db_attr_st {
|
typedef struct db_attr_st
|
||||||
int unique_subject;
|
{
|
||||||
} DB_ATTR;
|
int unique_subject;
|
||||||
typedef struct ca_db_st {
|
} DB_ATTR;
|
||||||
DB_ATTR attributes;
|
typedef struct ca_db_st
|
||||||
TXT_DB *db;
|
{
|
||||||
} CA_DB;
|
DB_ATTR attributes;
|
||||||
|
TXT_DB *db;
|
||||||
|
} CA_DB;
|
||||||
|
|
||||||
BIGNUM *load_serial(char *serialfile, int create, ASN1_INTEGER **retai);
|
BIGNUM *load_serial(char *serialfile, int create, ASN1_INTEGER **retai);
|
||||||
int save_serial(char *serialfile, char *suffix, BIGNUM *serial,
|
int save_serial(char *serialfile, char *suffix, BIGNUM *serial, ASN1_INTEGER **retai);
|
||||||
ASN1_INTEGER **retai);
|
|
||||||
int rotate_serial(char *serialfile, char *new_suffix, char *old_suffix);
|
int rotate_serial(char *serialfile, char *new_suffix, char *old_suffix);
|
||||||
int rand_serial(BIGNUM *b, ASN1_INTEGER *ai);
|
int rand_serial(BIGNUM *b, ASN1_INTEGER *ai);
|
||||||
CA_DB *load_index(char *dbfile, DB_ATTR *dbattr);
|
CA_DB *load_index(char *dbfile, DB_ATTR *dbattr);
|
||||||
int index_index(CA_DB *db);
|
int index_index(CA_DB *db);
|
||||||
int save_index(const char *dbfile, const char *suffix, CA_DB *db);
|
int save_index(const char *dbfile, const char *suffix, CA_DB *db);
|
||||||
int rotate_index(const char *dbfile, const char *new_suffix,
|
int rotate_index(const char *dbfile, const char *new_suffix, const char *old_suffix);
|
||||||
const char *old_suffix);
|
|
||||||
void free_index(CA_DB *db);
|
void free_index(CA_DB *db);
|
||||||
# define index_name_cmp_noconst(a, b) \
|
#define index_name_cmp_noconst(a, b) \
|
||||||
index_name_cmp((const OPENSSL_CSTRING *)CHECKED_PTR_OF(OPENSSL_STRING, a), \
|
index_name_cmp((const OPENSSL_CSTRING *)CHECKED_PTR_OF(OPENSSL_STRING, a), \
|
||||||
(const OPENSSL_CSTRING *)CHECKED_PTR_OF(OPENSSL_STRING, b))
|
(const OPENSSL_CSTRING *)CHECKED_PTR_OF(OPENSSL_STRING, b))
|
||||||
int index_name_cmp(const OPENSSL_CSTRING *a, const OPENSSL_CSTRING *b);
|
int index_name_cmp(const OPENSSL_CSTRING *a, const OPENSSL_CSTRING *b);
|
||||||
int parse_yesno(const char *str, int def);
|
int parse_yesno(const char *str, int def);
|
||||||
|
|
||||||
X509_NAME *parse_name(char *str, long chtype, int multirdn);
|
X509_NAME *parse_name(char *str, long chtype, int multirdn);
|
||||||
int args_verify(char ***pargs, int *pargc,
|
int args_verify(char ***pargs, int *pargc,
|
||||||
int *badarg, BIO *err, X509_VERIFY_PARAM **pm);
|
int *badarg, BIO *err, X509_VERIFY_PARAM **pm);
|
||||||
void policies_print(BIO *out, X509_STORE_CTX *ctx);
|
void policies_print(BIO *out, X509_STORE_CTX *ctx);
|
||||||
int bio_to_mem(unsigned char **out, int maxlen, BIO *in);
|
int bio_to_mem(unsigned char **out, int maxlen, BIO *in);
|
||||||
int pkey_ctrl_string(EVP_PKEY_CTX *ctx, char *value);
|
int pkey_ctrl_string(EVP_PKEY_CTX *ctx, char *value);
|
||||||
int init_gen_str(BIO *err, EVP_PKEY_CTX **pctx,
|
int init_gen_str(BIO *err, EVP_PKEY_CTX **pctx,
|
||||||
const char *algname, ENGINE *e, int do_param);
|
const char *algname, ENGINE *e, int do_param);
|
||||||
int do_X509_sign(BIO *err, X509 *x, EVP_PKEY *pkey, const EVP_MD *md,
|
#ifndef OPENSSL_NO_PSK
|
||||||
STACK_OF(OPENSSL_STRING) *sigopts);
|
|
||||||
int do_X509_REQ_sign(BIO *err, X509_REQ *x, EVP_PKEY *pkey, const EVP_MD *md,
|
|
||||||
STACK_OF(OPENSSL_STRING) *sigopts);
|
|
||||||
int do_X509_CRL_sign(BIO *err, X509_CRL *x, EVP_PKEY *pkey, const EVP_MD *md,
|
|
||||||
STACK_OF(OPENSSL_STRING) *sigopts);
|
|
||||||
# ifndef OPENSSL_NO_PSK
|
|
||||||
extern char *psk_key;
|
extern char *psk_key;
|
||||||
# endif
|
#endif
|
||||||
# ifndef OPENSSL_NO_JPAKE
|
#ifndef OPENSSL_NO_JPAKE
|
||||||
void jpake_client_auth(BIO *out, BIO *conn, const char *secret);
|
void jpake_client_auth(BIO *out, BIO *conn, const char *secret);
|
||||||
void jpake_server_auth(BIO *out, BIO *conn, const char *secret);
|
void jpake_server_auth(BIO *out, BIO *conn, const char *secret);
|
||||||
# endif
|
#endif
|
||||||
|
|
||||||
# if !defined(OPENSSL_NO_TLSEXT) && !defined(OPENSSL_NO_NEXTPROTONEG)
|
#define FORMAT_UNDEF 0
|
||||||
unsigned char *next_protos_parse(unsigned short *outlen, const char *in);
|
#define FORMAT_ASN1 1
|
||||||
# endif /* !OPENSSL_NO_TLSEXT &&
|
#define FORMAT_TEXT 2
|
||||||
* !OPENSSL_NO_NEXTPROTONEG */
|
#define FORMAT_PEM 3
|
||||||
|
#define FORMAT_NETSCAPE 4
|
||||||
|
#define FORMAT_PKCS12 5
|
||||||
|
#define FORMAT_SMIME 6
|
||||||
|
#define FORMAT_ENGINE 7
|
||||||
|
#define FORMAT_IISSGC 8 /* XXX this stupid macro helps us to avoid
|
||||||
|
* adding yet another param to load_*key() */
|
||||||
|
#define FORMAT_PEMRSA 9 /* PEM RSAPubicKey format */
|
||||||
|
#define FORMAT_ASN1RSA 10 /* DER RSAPubicKey format */
|
||||||
|
#define FORMAT_MSBLOB 11 /* MS Key blob format */
|
||||||
|
#define FORMAT_PVK 12 /* MS PVK file format */
|
||||||
|
|
||||||
# define FORMAT_UNDEF 0
|
#define EXT_COPY_NONE 0
|
||||||
# define FORMAT_ASN1 1
|
#define EXT_COPY_ADD 1
|
||||||
# define FORMAT_TEXT 2
|
#define EXT_COPY_ALL 2
|
||||||
# define FORMAT_PEM 3
|
|
||||||
# define FORMAT_NETSCAPE 4
|
|
||||||
# define FORMAT_PKCS12 5
|
|
||||||
# define FORMAT_SMIME 6
|
|
||||||
# define FORMAT_ENGINE 7
|
|
||||||
# define FORMAT_IISSGC 8 /* XXX this stupid macro helps us to avoid
|
|
||||||
* adding yet another param to load_*key() */
|
|
||||||
# define FORMAT_PEMRSA 9 /* PEM RSAPubicKey format */
|
|
||||||
# define FORMAT_ASN1RSA 10 /* DER RSAPubicKey format */
|
|
||||||
# define FORMAT_MSBLOB 11 /* MS Key blob format */
|
|
||||||
# define FORMAT_PVK 12 /* MS PVK file format */
|
|
||||||
|
|
||||||
# define EXT_COPY_NONE 0
|
#define NETSCAPE_CERT_HDR "certificate"
|
||||||
# define EXT_COPY_ADD 1
|
|
||||||
# define EXT_COPY_ALL 2
|
|
||||||
|
|
||||||
# define NETSCAPE_CERT_HDR "certificate"
|
#define APP_PASS_LEN 1024
|
||||||
|
|
||||||
# define APP_PASS_LEN 1024
|
#define SERIAL_RAND_BITS 64
|
||||||
|
|
||||||
# define SERIAL_RAND_BITS 64
|
|
||||||
|
|
||||||
int app_isdir(const char *);
|
int app_isdir(const char *);
|
||||||
int raw_read_stdin(void *, int);
|
int raw_read_stdin(void *,int);
|
||||||
int raw_write_stdout(const void *, int);
|
int raw_write_stdout(const void *,int);
|
||||||
|
|
||||||
# define TM_START 0
|
|
||||||
# define TM_STOP 1
|
|
||||||
double app_tminterval(int stop, int usertime);
|
|
||||||
|
|
||||||
# define OPENSSL_NO_SSL_INTERN
|
|
||||||
|
|
||||||
|
#define TM_START 0
|
||||||
|
#define TM_STOP 1
|
||||||
|
double app_tminterval (int stop,int usertime);
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
639
apps/asn1pars.c
639
apps/asn1pars.c
@@ -56,9 +56,8 @@
|
|||||||
* [including the GNU Public Licence.]
|
* [including the GNU Public Licence.]
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/* A nice addition from Dr Stephen Henson <steve@openssl.org> to
|
||||||
* A nice addition from Dr Stephen Henson <steve@openssl.org> to add the
|
* add the -strparse option which parses nested binary structures
|
||||||
* -strparse option which parses nested binary structures
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@@ -70,361 +69,377 @@
|
|||||||
#include <openssl/x509.h>
|
#include <openssl/x509.h>
|
||||||
#include <openssl/pem.h>
|
#include <openssl/pem.h>
|
||||||
|
|
||||||
/*-
|
/* -inform arg - input format - default PEM (DER or PEM)
|
||||||
* -inform arg - input format - default PEM (DER or PEM)
|
* -in arg - input file - default stdin
|
||||||
* -in arg - input file - default stdin
|
* -i - indent the details by depth
|
||||||
* -i - indent the details by depth
|
* -offset - where in the file to start
|
||||||
* -offset - where in the file to start
|
* -length - how many bytes to use
|
||||||
* -length - how many bytes to use
|
* -oid file - extra oid description file
|
||||||
* -oid file - extra oid description file
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#undef PROG
|
#undef PROG
|
||||||
#define PROG asn1parse_main
|
#define PROG asn1parse_main
|
||||||
|
|
||||||
int MAIN(int, char **);
|
int MAIN(int, char **);
|
||||||
|
|
||||||
static int do_generate(BIO *bio, char *genstr, char *genconf, BUF_MEM *buf);
|
static int do_generate(BIO *bio, char *genstr, char *genconf, BUF_MEM *buf);
|
||||||
|
|
||||||
int MAIN(int argc, char **argv)
|
int MAIN(int argc, char **argv)
|
||||||
{
|
{
|
||||||
int i, badops = 0, offset = 0, ret = 1, j;
|
int i,badops=0,offset=0,ret=1,j;
|
||||||
unsigned int length = 0;
|
unsigned int length=0;
|
||||||
long num, tmplen;
|
long num,tmplen;
|
||||||
BIO *in = NULL, *out = NULL, *b64 = NULL, *derout = NULL;
|
BIO *in=NULL,*out=NULL,*b64=NULL, *derout = NULL;
|
||||||
int informat, indent = 0, noout = 0, dump = 0;
|
int informat,indent=0, noout = 0, dump = 0;
|
||||||
char *infile = NULL, *str = NULL, *prog, *oidfile = NULL, *derfile = NULL;
|
char *infile=NULL,*str=NULL,*prog,*oidfile=NULL, *derfile=NULL;
|
||||||
char *genstr = NULL, *genconf = NULL;
|
char *genstr=NULL, *genconf=NULL;
|
||||||
unsigned char *tmpbuf;
|
unsigned char *tmpbuf;
|
||||||
const unsigned char *ctmpbuf;
|
const unsigned char *ctmpbuf;
|
||||||
BUF_MEM *buf = NULL;
|
BUF_MEM *buf=NULL;
|
||||||
STACK_OF(OPENSSL_STRING) *osk = NULL;
|
STACK_OF(OPENSSL_STRING) *osk=NULL;
|
||||||
ASN1_TYPE *at = NULL;
|
ASN1_TYPE *at=NULL;
|
||||||
|
|
||||||
informat = FORMAT_PEM;
|
informat=FORMAT_PEM;
|
||||||
|
|
||||||
apps_startup();
|
apps_startup();
|
||||||
|
|
||||||
if (bio_err == NULL)
|
if (bio_err == NULL)
|
||||||
if ((bio_err = BIO_new(BIO_s_file())) != NULL)
|
if ((bio_err=BIO_new(BIO_s_file())) != NULL)
|
||||||
BIO_set_fp(bio_err, stderr, BIO_NOCLOSE | BIO_FP_TEXT);
|
BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT);
|
||||||
|
|
||||||
if (!load_config(bio_err, NULL))
|
if (!load_config(bio_err, NULL))
|
||||||
goto end;
|
goto end;
|
||||||
|
|
||||||
prog = argv[0];
|
prog=argv[0];
|
||||||
argc--;
|
argc--;
|
||||||
argv++;
|
argv++;
|
||||||
if ((osk = sk_OPENSSL_STRING_new_null()) == NULL) {
|
if ((osk=sk_OPENSSL_STRING_new_null()) == NULL)
|
||||||
BIO_printf(bio_err, "Memory allocation failure\n");
|
{
|
||||||
goto end;
|
BIO_printf(bio_err,"Memory allocation failure\n");
|
||||||
}
|
goto end;
|
||||||
while (argc >= 1) {
|
}
|
||||||
if (strcmp(*argv, "-inform") == 0) {
|
while (argc >= 1)
|
||||||
if (--argc < 1)
|
{
|
||||||
goto bad;
|
if (strcmp(*argv,"-inform") == 0)
|
||||||
informat = str2fmt(*(++argv));
|
{
|
||||||
} else if (strcmp(*argv, "-in") == 0) {
|
if (--argc < 1) goto bad;
|
||||||
if (--argc < 1)
|
informat=str2fmt(*(++argv));
|
||||||
goto bad;
|
}
|
||||||
infile = *(++argv);
|
else if (strcmp(*argv,"-in") == 0)
|
||||||
} else if (strcmp(*argv, "-out") == 0) {
|
{
|
||||||
if (--argc < 1)
|
if (--argc < 1) goto bad;
|
||||||
goto bad;
|
infile= *(++argv);
|
||||||
derfile = *(++argv);
|
}
|
||||||
} else if (strcmp(*argv, "-i") == 0) {
|
else if (strcmp(*argv,"-out") == 0)
|
||||||
indent = 1;
|
{
|
||||||
} else if (strcmp(*argv, "-noout") == 0)
|
if (--argc < 1) goto bad;
|
||||||
noout = 1;
|
derfile= *(++argv);
|
||||||
else if (strcmp(*argv, "-oid") == 0) {
|
}
|
||||||
if (--argc < 1)
|
else if (strcmp(*argv,"-i") == 0)
|
||||||
goto bad;
|
{
|
||||||
oidfile = *(++argv);
|
indent=1;
|
||||||
} else if (strcmp(*argv, "-offset") == 0) {
|
}
|
||||||
if (--argc < 1)
|
else if (strcmp(*argv,"-noout") == 0) noout = 1;
|
||||||
goto bad;
|
else if (strcmp(*argv,"-oid") == 0)
|
||||||
offset = atoi(*(++argv));
|
{
|
||||||
} else if (strcmp(*argv, "-length") == 0) {
|
if (--argc < 1) goto bad;
|
||||||
if (--argc < 1)
|
oidfile= *(++argv);
|
||||||
goto bad;
|
}
|
||||||
length = atoi(*(++argv));
|
else if (strcmp(*argv,"-offset") == 0)
|
||||||
if (length == 0)
|
{
|
||||||
goto bad;
|
if (--argc < 1) goto bad;
|
||||||
} else if (strcmp(*argv, "-dump") == 0) {
|
offset= atoi(*(++argv));
|
||||||
dump = -1;
|
}
|
||||||
} else if (strcmp(*argv, "-dlimit") == 0) {
|
else if (strcmp(*argv,"-length") == 0)
|
||||||
if (--argc < 1)
|
{
|
||||||
goto bad;
|
if (--argc < 1) goto bad;
|
||||||
dump = atoi(*(++argv));
|
length= atoi(*(++argv));
|
||||||
if (dump <= 0)
|
if (length == 0) goto bad;
|
||||||
goto bad;
|
}
|
||||||
} else if (strcmp(*argv, "-strparse") == 0) {
|
else if (strcmp(*argv,"-dump") == 0)
|
||||||
if (--argc < 1)
|
{
|
||||||
goto bad;
|
dump= -1;
|
||||||
sk_OPENSSL_STRING_push(osk, *(++argv));
|
}
|
||||||
} else if (strcmp(*argv, "-genstr") == 0) {
|
else if (strcmp(*argv,"-dlimit") == 0)
|
||||||
if (--argc < 1)
|
{
|
||||||
goto bad;
|
if (--argc < 1) goto bad;
|
||||||
genstr = *(++argv);
|
dump= atoi(*(++argv));
|
||||||
} else if (strcmp(*argv, "-genconf") == 0) {
|
if (dump <= 0) goto bad;
|
||||||
if (--argc < 1)
|
}
|
||||||
goto bad;
|
else if (strcmp(*argv,"-strparse") == 0)
|
||||||
genconf = *(++argv);
|
{
|
||||||
} else {
|
if (--argc < 1) goto bad;
|
||||||
BIO_printf(bio_err, "unknown option %s\n", *argv);
|
sk_OPENSSL_STRING_push(osk,*(++argv));
|
||||||
badops = 1;
|
}
|
||||||
break;
|
else if (strcmp(*argv,"-genstr") == 0)
|
||||||
}
|
{
|
||||||
argc--;
|
if (--argc < 1) goto bad;
|
||||||
argv++;
|
genstr= *(++argv);
|
||||||
}
|
}
|
||||||
|
else if (strcmp(*argv,"-genconf") == 0)
|
||||||
|
{
|
||||||
|
if (--argc < 1) goto bad;
|
||||||
|
genconf= *(++argv);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
BIO_printf(bio_err,"unknown option %s\n",*argv);
|
||||||
|
badops=1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
argc--;
|
||||||
|
argv++;
|
||||||
|
}
|
||||||
|
|
||||||
if (badops) {
|
if (badops)
|
||||||
bad:
|
{
|
||||||
BIO_printf(bio_err, "%s [options] <infile\n", prog);
|
bad:
|
||||||
BIO_printf(bio_err, "where options are\n");
|
BIO_printf(bio_err,"%s [options] <infile\n",prog);
|
||||||
BIO_printf(bio_err, " -inform arg input format - one of DER PEM\n");
|
BIO_printf(bio_err,"where options are\n");
|
||||||
BIO_printf(bio_err, " -in arg input file\n");
|
BIO_printf(bio_err," -inform arg input format - one of DER PEM\n");
|
||||||
BIO_printf(bio_err,
|
BIO_printf(bio_err," -in arg input file\n");
|
||||||
" -out arg output file (output format is always DER\n");
|
BIO_printf(bio_err," -out arg output file (output format is always DER\n");
|
||||||
BIO_printf(bio_err, " -noout arg don't produce any output\n");
|
BIO_printf(bio_err," -noout arg don't produce any output\n");
|
||||||
BIO_printf(bio_err, " -offset arg offset into file\n");
|
BIO_printf(bio_err," -offset arg offset into file\n");
|
||||||
BIO_printf(bio_err, " -length arg length of section in file\n");
|
BIO_printf(bio_err," -length arg length of section in file\n");
|
||||||
BIO_printf(bio_err, " -i indent entries\n");
|
BIO_printf(bio_err," -i indent entries\n");
|
||||||
BIO_printf(bio_err, " -dump dump unknown data in hex form\n");
|
BIO_printf(bio_err," -dump dump unknown data in hex form\n");
|
||||||
BIO_printf(bio_err,
|
BIO_printf(bio_err," -dlimit arg dump the first arg bytes of unknown data in hex form\n");
|
||||||
" -dlimit arg dump the first arg bytes of unknown data in hex form\n");
|
BIO_printf(bio_err," -oid file file of extra oid definitions\n");
|
||||||
BIO_printf(bio_err, " -oid file file of extra oid definitions\n");
|
BIO_printf(bio_err," -strparse offset\n");
|
||||||
BIO_printf(bio_err, " -strparse offset\n");
|
BIO_printf(bio_err," a series of these can be used to 'dig' into multiple\n");
|
||||||
BIO_printf(bio_err,
|
BIO_printf(bio_err," ASN1 blob wrappings\n");
|
||||||
" a series of these can be used to 'dig' into multiple\n");
|
BIO_printf(bio_err," -genstr str string to generate ASN1 structure from\n");
|
||||||
BIO_printf(bio_err, " ASN1 blob wrappings\n");
|
BIO_printf(bio_err," -genconf file file to generate ASN1 structure from\n");
|
||||||
BIO_printf(bio_err,
|
goto end;
|
||||||
" -genstr str string to generate ASN1 structure from\n");
|
}
|
||||||
BIO_printf(bio_err,
|
|
||||||
" -genconf file file to generate ASN1 structure from\n");
|
|
||||||
goto end;
|
|
||||||
}
|
|
||||||
|
|
||||||
ERR_load_crypto_strings();
|
ERR_load_crypto_strings();
|
||||||
|
|
||||||
in = BIO_new(BIO_s_file());
|
in=BIO_new(BIO_s_file());
|
||||||
out = BIO_new(BIO_s_file());
|
out=BIO_new(BIO_s_file());
|
||||||
if ((in == NULL) || (out == NULL)) {
|
if ((in == NULL) || (out == NULL))
|
||||||
ERR_print_errors(bio_err);
|
{
|
||||||
goto end;
|
ERR_print_errors(bio_err);
|
||||||
}
|
goto end;
|
||||||
BIO_set_fp(out, stdout, BIO_NOCLOSE | BIO_FP_TEXT);
|
}
|
||||||
|
BIO_set_fp(out,stdout,BIO_NOCLOSE|BIO_FP_TEXT);
|
||||||
#ifdef OPENSSL_SYS_VMS
|
#ifdef OPENSSL_SYS_VMS
|
||||||
{
|
{
|
||||||
BIO *tmpbio = BIO_new(BIO_f_linebuffer());
|
BIO *tmpbio = BIO_new(BIO_f_linebuffer());
|
||||||
out = BIO_push(tmpbio, out);
|
out = BIO_push(tmpbio, out);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (oidfile != NULL) {
|
if (oidfile != NULL)
|
||||||
if (BIO_read_filename(in, oidfile) <= 0) {
|
{
|
||||||
BIO_printf(bio_err, "problems opening %s\n", oidfile);
|
if (BIO_read_filename(in,oidfile) <= 0)
|
||||||
ERR_print_errors(bio_err);
|
{
|
||||||
goto end;
|
BIO_printf(bio_err,"problems opening %s\n",oidfile);
|
||||||
}
|
ERR_print_errors(bio_err);
|
||||||
OBJ_create_objects(in);
|
goto end;
|
||||||
}
|
}
|
||||||
|
OBJ_create_objects(in);
|
||||||
|
}
|
||||||
|
|
||||||
if (infile == NULL)
|
if (infile == NULL)
|
||||||
BIO_set_fp(in, stdin, BIO_NOCLOSE);
|
BIO_set_fp(in,stdin,BIO_NOCLOSE);
|
||||||
else {
|
else
|
||||||
if (BIO_read_filename(in, infile) <= 0) {
|
{
|
||||||
perror(infile);
|
if (BIO_read_filename(in,infile) <= 0)
|
||||||
goto end;
|
{
|
||||||
}
|
perror(infile);
|
||||||
}
|
goto end;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (derfile) {
|
if (derfile) {
|
||||||
if (!(derout = BIO_new_file(derfile, "wb"))) {
|
if(!(derout = BIO_new_file(derfile, "wb"))) {
|
||||||
BIO_printf(bio_err, "problems opening %s\n", derfile);
|
BIO_printf(bio_err,"problems opening %s\n",derfile);
|
||||||
ERR_print_errors(bio_err);
|
ERR_print_errors(bio_err);
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((buf = BUF_MEM_new()) == NULL)
|
if ((buf=BUF_MEM_new()) == NULL) goto end;
|
||||||
goto end;
|
if (!BUF_MEM_grow(buf,BUFSIZ*8)) goto end; /* Pre-allocate :-) */
|
||||||
if (!BUF_MEM_grow(buf, BUFSIZ * 8))
|
|
||||||
goto end; /* Pre-allocate :-) */
|
|
||||||
|
|
||||||
if (genstr || genconf) {
|
if (genstr || genconf)
|
||||||
num = do_generate(bio_err, genstr, genconf, buf);
|
{
|
||||||
if (num < 0) {
|
num = do_generate(bio_err, genstr, genconf, buf);
|
||||||
ERR_print_errors(bio_err);
|
if (num < 0)
|
||||||
goto end;
|
{
|
||||||
}
|
ERR_print_errors(bio_err);
|
||||||
}
|
goto end;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
|
|
||||||
if (informat == FORMAT_PEM) {
|
if (informat == FORMAT_PEM)
|
||||||
BIO *tmp;
|
{
|
||||||
|
BIO *tmp;
|
||||||
|
|
||||||
if ((b64 = BIO_new(BIO_f_base64())) == NULL)
|
if ((b64=BIO_new(BIO_f_base64())) == NULL)
|
||||||
goto end;
|
goto end;
|
||||||
BIO_push(b64, in);
|
BIO_push(b64,in);
|
||||||
tmp = in;
|
tmp=in;
|
||||||
in = b64;
|
in=b64;
|
||||||
b64 = tmp;
|
b64=tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
num = 0;
|
num=0;
|
||||||
for (;;) {
|
for (;;)
|
||||||
if (!BUF_MEM_grow(buf, (int)num + BUFSIZ))
|
{
|
||||||
goto end;
|
if (!BUF_MEM_grow(buf,(int)num+BUFSIZ)) goto end;
|
||||||
i = BIO_read(in, &(buf->data[num]), BUFSIZ);
|
i=BIO_read(in,&(buf->data[num]),BUFSIZ);
|
||||||
if (i <= 0)
|
if (i <= 0) break;
|
||||||
break;
|
num+=i;
|
||||||
num += i;
|
}
|
||||||
}
|
}
|
||||||
}
|
str=buf->data;
|
||||||
str = buf->data;
|
|
||||||
|
|
||||||
/* If any structs to parse go through in sequence */
|
/* If any structs to parse go through in sequence */
|
||||||
|
|
||||||
if (sk_OPENSSL_STRING_num(osk)) {
|
if (sk_OPENSSL_STRING_num(osk))
|
||||||
tmpbuf = (unsigned char *)str;
|
{
|
||||||
tmplen = num;
|
tmpbuf=(unsigned char *)str;
|
||||||
for (i = 0; i < sk_OPENSSL_STRING_num(osk); i++) {
|
tmplen=num;
|
||||||
ASN1_TYPE *atmp;
|
for (i=0; i<sk_OPENSSL_STRING_num(osk); i++)
|
||||||
int typ;
|
{
|
||||||
j = atoi(sk_OPENSSL_STRING_value(osk, i));
|
ASN1_TYPE *atmp;
|
||||||
if (j == 0) {
|
int typ;
|
||||||
BIO_printf(bio_err, "'%s' is an invalid number\n",
|
j=atoi(sk_OPENSSL_STRING_value(osk,i));
|
||||||
sk_OPENSSL_STRING_value(osk, i));
|
if (j == 0)
|
||||||
continue;
|
{
|
||||||
}
|
BIO_printf(bio_err,"'%s' is an invalid number\n",sk_OPENSSL_STRING_value(osk,i));
|
||||||
tmpbuf += j;
|
continue;
|
||||||
tmplen -= j;
|
}
|
||||||
atmp = at;
|
tmpbuf+=j;
|
||||||
ctmpbuf = tmpbuf;
|
tmplen-=j;
|
||||||
at = d2i_ASN1_TYPE(NULL, &ctmpbuf, tmplen);
|
atmp = at;
|
||||||
ASN1_TYPE_free(atmp);
|
ctmpbuf = tmpbuf;
|
||||||
if (!at) {
|
at = d2i_ASN1_TYPE(NULL,&ctmpbuf,tmplen);
|
||||||
BIO_printf(bio_err, "Error parsing structure\n");
|
ASN1_TYPE_free(atmp);
|
||||||
ERR_print_errors(bio_err);
|
if(!at)
|
||||||
goto end;
|
{
|
||||||
}
|
BIO_printf(bio_err,"Error parsing structure\n");
|
||||||
typ = ASN1_TYPE_get(at);
|
ERR_print_errors(bio_err);
|
||||||
if ((typ == V_ASN1_OBJECT)
|
goto end;
|
||||||
|| (typ == V_ASN1_BOOLEAN)
|
}
|
||||||
|| (typ == V_ASN1_NULL)) {
|
typ = ASN1_TYPE_get(at);
|
||||||
BIO_printf(bio_err, "Can't parse %s type\n", ASN1_tag2str(typ));
|
if ((typ == V_ASN1_OBJECT)
|
||||||
ERR_print_errors(bio_err);
|
|| (typ == V_ASN1_NULL))
|
||||||
goto end;
|
{
|
||||||
}
|
BIO_printf(bio_err, "Can't parse %s type\n",
|
||||||
/* hmm... this is a little evil but it works */
|
typ == V_ASN1_NULL ? "NULL" : "OBJECT");
|
||||||
tmpbuf = at->value.asn1_string->data;
|
ERR_print_errors(bio_err);
|
||||||
tmplen = at->value.asn1_string->length;
|
goto end;
|
||||||
}
|
}
|
||||||
str = (char *)tmpbuf;
|
/* hmm... this is a little evil but it works */
|
||||||
num = tmplen;
|
tmpbuf=at->value.asn1_string->data;
|
||||||
}
|
tmplen=at->value.asn1_string->length;
|
||||||
|
}
|
||||||
|
str=(char *)tmpbuf;
|
||||||
|
num=tmplen;
|
||||||
|
}
|
||||||
|
|
||||||
if (offset >= num) {
|
if (offset >= num)
|
||||||
BIO_printf(bio_err, "Error: offset too large\n");
|
{
|
||||||
goto end;
|
BIO_printf(bio_err, "Error: offset too large\n");
|
||||||
}
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
num -= offset;
|
num -= offset;
|
||||||
|
|
||||||
if ((length == 0) || ((long)length > num))
|
if ((length == 0) || ((long)length > num)) length=(unsigned int)num;
|
||||||
length = (unsigned int)num;
|
if(derout) {
|
||||||
if (derout) {
|
if(BIO_write(derout, str + offset, length) != (int)length) {
|
||||||
if (BIO_write(derout, str + offset, length) != (int)length) {
|
BIO_printf(bio_err, "Error writing output\n");
|
||||||
BIO_printf(bio_err, "Error writing output\n");
|
ERR_print_errors(bio_err);
|
||||||
ERR_print_errors(bio_err);
|
goto end;
|
||||||
goto end;
|
}
|
||||||
}
|
}
|
||||||
}
|
if (!noout &&
|
||||||
if (!noout &&
|
!ASN1_parse_dump(out,(unsigned char *)&(str[offset]),length,
|
||||||
!ASN1_parse_dump(out, (unsigned char *)&(str[offset]), length,
|
indent,dump))
|
||||||
indent, dump)) {
|
{
|
||||||
ERR_print_errors(bio_err);
|
ERR_print_errors(bio_err);
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
ret = 0;
|
ret=0;
|
||||||
end:
|
end:
|
||||||
BIO_free(derout);
|
BIO_free(derout);
|
||||||
if (in != NULL)
|
if (in != NULL) BIO_free(in);
|
||||||
BIO_free(in);
|
if (out != NULL) BIO_free_all(out);
|
||||||
if (out != NULL)
|
if (b64 != NULL) BIO_free(b64);
|
||||||
BIO_free_all(out);
|
if (ret != 0)
|
||||||
if (b64 != NULL)
|
ERR_print_errors(bio_err);
|
||||||
BIO_free(b64);
|
if (buf != NULL) BUF_MEM_free(buf);
|
||||||
if (ret != 0)
|
if (at != NULL) ASN1_TYPE_free(at);
|
||||||
ERR_print_errors(bio_err);
|
if (osk != NULL) sk_OPENSSL_STRING_free(osk);
|
||||||
if (buf != NULL)
|
OBJ_cleanup();
|
||||||
BUF_MEM_free(buf);
|
apps_shutdown();
|
||||||
if (at != NULL)
|
OPENSSL_EXIT(ret);
|
||||||
ASN1_TYPE_free(at);
|
}
|
||||||
if (osk != NULL)
|
|
||||||
sk_OPENSSL_STRING_free(osk);
|
|
||||||
OBJ_cleanup();
|
|
||||||
apps_shutdown();
|
|
||||||
OPENSSL_EXIT(ret);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int do_generate(BIO *bio, char *genstr, char *genconf, BUF_MEM *buf)
|
static int do_generate(BIO *bio, char *genstr, char *genconf, BUF_MEM *buf)
|
||||||
{
|
{
|
||||||
CONF *cnf = NULL;
|
CONF *cnf = NULL;
|
||||||
int len;
|
int len;
|
||||||
long errline = 0;
|
long errline;
|
||||||
unsigned char *p;
|
unsigned char *p;
|
||||||
ASN1_TYPE *atyp = NULL;
|
ASN1_TYPE *atyp = NULL;
|
||||||
|
|
||||||
if (genconf) {
|
if (genconf)
|
||||||
cnf = NCONF_new(NULL);
|
{
|
||||||
if (!NCONF_load(cnf, genconf, &errline))
|
cnf = NCONF_new(NULL);
|
||||||
goto conferr;
|
if (!NCONF_load(cnf, genconf, &errline))
|
||||||
if (!genstr)
|
goto conferr;
|
||||||
genstr = NCONF_get_string(cnf, "default", "asn1");
|
if (!genstr)
|
||||||
if (!genstr) {
|
genstr = NCONF_get_string(cnf, "default", "asn1");
|
||||||
BIO_printf(bio, "Can't find 'asn1' in '%s'\n", genconf);
|
if (!genstr)
|
||||||
goto err;
|
{
|
||||||
}
|
BIO_printf(bio, "Can't find 'asn1' in '%s'\n", genconf);
|
||||||
}
|
goto err;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
atyp = ASN1_generate_nconf(genstr, cnf);
|
atyp = ASN1_generate_nconf(genstr, cnf);
|
||||||
NCONF_free(cnf);
|
NCONF_free(cnf);
|
||||||
cnf = NULL;
|
cnf = NULL;
|
||||||
|
|
||||||
if (!atyp)
|
if (!atyp)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
len = i2d_ASN1_TYPE(atyp, NULL);
|
len = i2d_ASN1_TYPE(atyp, NULL);
|
||||||
|
|
||||||
if (len <= 0)
|
if (len <= 0)
|
||||||
goto err;
|
goto err;
|
||||||
|
|
||||||
if (!BUF_MEM_grow(buf, len))
|
if (!BUF_MEM_grow(buf,len))
|
||||||
goto err;
|
goto err;
|
||||||
|
|
||||||
p = (unsigned char *)buf->data;
|
p=(unsigned char *)buf->data;
|
||||||
|
|
||||||
i2d_ASN1_TYPE(atyp, &p);
|
i2d_ASN1_TYPE(atyp, &p);
|
||||||
|
|
||||||
ASN1_TYPE_free(atyp);
|
ASN1_TYPE_free(atyp);
|
||||||
return len;
|
return len;
|
||||||
|
|
||||||
conferr:
|
conferr:
|
||||||
|
|
||||||
if (errline > 0)
|
if (errline > 0)
|
||||||
BIO_printf(bio, "Error on line %ld of config file '%s'\n",
|
BIO_printf(bio, "Error on line %ld of config file '%s'\n",
|
||||||
errline, genconf);
|
errline, genconf);
|
||||||
else
|
else
|
||||||
BIO_printf(bio, "Error loading config file '%s'\n", genconf);
|
BIO_printf(bio, "Error loading config file '%s'\n", genconf);
|
||||||
|
|
||||||
err:
|
err:
|
||||||
NCONF_free(cnf);
|
NCONF_free(cnf);
|
||||||
ASN1_TYPE_free(atyp);
|
ASN1_TYPE_free(atyp);
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
268
apps/ciphers.c
268
apps/ciphers.c
@@ -60,166 +60,172 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#ifdef OPENSSL_NO_STDIO
|
#ifdef OPENSSL_NO_STDIO
|
||||||
# define APPS_WIN16
|
#define APPS_WIN16
|
||||||
#endif
|
#endif
|
||||||
#include "apps.h"
|
#include "apps.h"
|
||||||
#include <openssl/err.h>
|
#include <openssl/err.h>
|
||||||
#include <openssl/ssl.h>
|
#include <openssl/ssl.h>
|
||||||
|
|
||||||
#undef PROG
|
#undef PROG
|
||||||
#define PROG ciphers_main
|
#define PROG ciphers_main
|
||||||
|
|
||||||
static const char *ciphers_usage[] = {
|
static const char *ciphers_usage[]={
|
||||||
"usage: ciphers args\n",
|
"usage: ciphers args\n",
|
||||||
" -v - verbose mode, a textual listing of the SSL/TLS ciphers in OpenSSL\n",
|
" -v - verbose mode, a textual listing of the SSL/TLS ciphers in OpenSSL\n",
|
||||||
" -V - even more verbose\n",
|
" -V - even more verbose\n",
|
||||||
" -ssl2 - SSL2 mode\n",
|
" -ssl2 - SSL2 mode\n",
|
||||||
" -ssl3 - SSL3 mode\n",
|
" -ssl3 - SSL3 mode\n",
|
||||||
" -tls1 - TLS1 mode\n",
|
" -tls1 - TLS1 mode\n",
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
int MAIN(int, char **);
|
int MAIN(int, char **);
|
||||||
|
|
||||||
int MAIN(int argc, char **argv)
|
int MAIN(int argc, char **argv)
|
||||||
{
|
{
|
||||||
int ret = 1, i;
|
int ret=1,i;
|
||||||
int verbose = 0, Verbose = 0;
|
int verbose=0,Verbose=0;
|
||||||
const char **pp;
|
const char **pp;
|
||||||
const char *p;
|
const char *p;
|
||||||
int badops = 0;
|
int badops=0;
|
||||||
SSL_CTX *ctx = NULL;
|
SSL_CTX *ctx=NULL;
|
||||||
SSL *ssl = NULL;
|
SSL *ssl=NULL;
|
||||||
char *ciphers = NULL;
|
char *ciphers=NULL;
|
||||||
const SSL_METHOD *meth = NULL;
|
const SSL_METHOD *meth=NULL;
|
||||||
STACK_OF(SSL_CIPHER) *sk;
|
STACK_OF(SSL_CIPHER) *sk;
|
||||||
char buf[512];
|
char buf[512];
|
||||||
BIO *STDout = NULL;
|
BIO *STDout=NULL;
|
||||||
|
|
||||||
meth = SSLv23_server_method();
|
#if !defined(OPENSSL_NO_SSL2) && !defined(OPENSSL_NO_SSL3)
|
||||||
|
meth=SSLv23_server_method();
|
||||||
apps_startup();
|
#elif !defined(OPENSSL_NO_SSL3)
|
||||||
|
meth=SSLv3_server_method();
|
||||||
if (bio_err == NULL)
|
#elif !defined(OPENSSL_NO_SSL2)
|
||||||
bio_err = BIO_new_fp(stderr, BIO_NOCLOSE);
|
meth=SSLv2_server_method();
|
||||||
STDout = BIO_new_fp(stdout, BIO_NOCLOSE);
|
|
||||||
#ifdef OPENSSL_SYS_VMS
|
|
||||||
{
|
|
||||||
BIO *tmpbio = BIO_new(BIO_f_linebuffer());
|
|
||||||
STDout = BIO_push(tmpbio, STDout);
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
if (!load_config(bio_err, NULL))
|
|
||||||
goto end;
|
|
||||||
|
|
||||||
argc--;
|
apps_startup();
|
||||||
argv++;
|
|
||||||
while (argc >= 1) {
|
if (bio_err == NULL)
|
||||||
if (strcmp(*argv, "-v") == 0)
|
bio_err=BIO_new_fp(stderr,BIO_NOCLOSE);
|
||||||
verbose = 1;
|
STDout=BIO_new_fp(stdout,BIO_NOCLOSE);
|
||||||
else if (strcmp(*argv, "-V") == 0)
|
#ifdef OPENSSL_SYS_VMS
|
||||||
verbose = Verbose = 1;
|
{
|
||||||
|
BIO *tmpbio = BIO_new(BIO_f_linebuffer());
|
||||||
|
STDout = BIO_push(tmpbio, STDout);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
if (!load_config(bio_err, NULL))
|
||||||
|
goto end;
|
||||||
|
|
||||||
|
argc--;
|
||||||
|
argv++;
|
||||||
|
while (argc >= 1)
|
||||||
|
{
|
||||||
|
if (strcmp(*argv,"-v") == 0)
|
||||||
|
verbose=1;
|
||||||
|
else if (strcmp(*argv,"-V") == 0)
|
||||||
|
verbose=Verbose=1;
|
||||||
#ifndef OPENSSL_NO_SSL2
|
#ifndef OPENSSL_NO_SSL2
|
||||||
else if (strcmp(*argv, "-ssl2") == 0)
|
else if (strcmp(*argv,"-ssl2") == 0)
|
||||||
meth = SSLv2_client_method();
|
meth=SSLv2_client_method();
|
||||||
#endif
|
#endif
|
||||||
#ifndef OPENSSL_NO_SSL3
|
#ifndef OPENSSL_NO_SSL3
|
||||||
else if (strcmp(*argv, "-ssl3") == 0)
|
else if (strcmp(*argv,"-ssl3") == 0)
|
||||||
meth = SSLv3_client_method();
|
meth=SSLv3_client_method();
|
||||||
#endif
|
#endif
|
||||||
#ifndef OPENSSL_NO_TLS1
|
#ifndef OPENSSL_NO_TLS1
|
||||||
else if (strcmp(*argv, "-tls1") == 0)
|
else if (strcmp(*argv,"-tls1") == 0)
|
||||||
meth = TLSv1_client_method();
|
meth=TLSv1_client_method();
|
||||||
#endif
|
#endif
|
||||||
else if ((strncmp(*argv, "-h", 2) == 0) || (strcmp(*argv, "-?") == 0)) {
|
else if ((strncmp(*argv,"-h",2) == 0) ||
|
||||||
badops = 1;
|
(strcmp(*argv,"-?") == 0))
|
||||||
break;
|
{
|
||||||
} else {
|
badops=1;
|
||||||
ciphers = *argv;
|
break;
|
||||||
}
|
}
|
||||||
argc--;
|
else
|
||||||
argv++;
|
{
|
||||||
}
|
ciphers= *argv;
|
||||||
|
}
|
||||||
|
argc--;
|
||||||
|
argv++;
|
||||||
|
}
|
||||||
|
|
||||||
if (badops) {
|
if (badops)
|
||||||
for (pp = ciphers_usage; (*pp != NULL); pp++)
|
{
|
||||||
BIO_printf(bio_err, "%s", *pp);
|
for (pp=ciphers_usage; (*pp != NULL); pp++)
|
||||||
goto end;
|
BIO_printf(bio_err,"%s",*pp);
|
||||||
}
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
OpenSSL_add_ssl_algorithms();
|
OpenSSL_add_ssl_algorithms();
|
||||||
|
|
||||||
ctx = SSL_CTX_new(meth);
|
ctx=SSL_CTX_new(meth);
|
||||||
if (ctx == NULL)
|
if (ctx == NULL) goto err;
|
||||||
goto err;
|
if (ciphers != NULL) {
|
||||||
if (ciphers != NULL) {
|
if(!SSL_CTX_set_cipher_list(ctx,ciphers)) {
|
||||||
if (!SSL_CTX_set_cipher_list(ctx, ciphers)) {
|
BIO_printf(bio_err, "Error in cipher list\n");
|
||||||
BIO_printf(bio_err, "Error in cipher list\n");
|
goto err;
|
||||||
goto err;
|
}
|
||||||
}
|
}
|
||||||
}
|
ssl=SSL_new(ctx);
|
||||||
ssl = SSL_new(ctx);
|
if (ssl == NULL) goto err;
|
||||||
if (ssl == NULL)
|
|
||||||
goto err;
|
|
||||||
|
|
||||||
if (!verbose) {
|
|
||||||
for (i = 0;; i++) {
|
|
||||||
p = SSL_get_cipher_list(ssl, i);
|
|
||||||
if (p == NULL)
|
|
||||||
break;
|
|
||||||
if (i != 0)
|
|
||||||
BIO_printf(STDout, ":");
|
|
||||||
BIO_printf(STDout, "%s", p);
|
|
||||||
}
|
|
||||||
BIO_printf(STDout, "\n");
|
|
||||||
} else { /* verbose */
|
|
||||||
|
|
||||||
sk = SSL_get_ciphers(ssl);
|
if (!verbose)
|
||||||
|
{
|
||||||
|
for (i=0; ; i++)
|
||||||
|
{
|
||||||
|
p=SSL_get_cipher_list(ssl,i);
|
||||||
|
if (p == NULL) break;
|
||||||
|
if (i != 0) BIO_printf(STDout,":");
|
||||||
|
BIO_printf(STDout,"%s",p);
|
||||||
|
}
|
||||||
|
BIO_printf(STDout,"\n");
|
||||||
|
}
|
||||||
|
else /* verbose */
|
||||||
|
{
|
||||||
|
sk=SSL_get_ciphers(ssl);
|
||||||
|
|
||||||
for (i = 0; i < sk_SSL_CIPHER_num(sk); i++) {
|
for (i=0; i<sk_SSL_CIPHER_num(sk); i++)
|
||||||
SSL_CIPHER *c;
|
{
|
||||||
|
SSL_CIPHER *c;
|
||||||
|
|
||||||
c = sk_SSL_CIPHER_value(sk, i);
|
c = sk_SSL_CIPHER_value(sk,i);
|
||||||
|
|
||||||
if (Verbose) {
|
if (Verbose)
|
||||||
unsigned long id = SSL_CIPHER_get_id(c);
|
{
|
||||||
int id0 = (int)(id >> 24);
|
unsigned long id = c->id;
|
||||||
int id1 = (int)((id >> 16) & 0xffL);
|
int id0 = (int)(id >> 24);
|
||||||
int id2 = (int)((id >> 8) & 0xffL);
|
int id1 = (int)((id >> 16) & 0xffL);
|
||||||
int id3 = (int)(id & 0xffL);
|
int id2 = (int)((id >> 8) & 0xffL);
|
||||||
|
int id3 = (int)(id & 0xffL);
|
||||||
|
|
||||||
if ((id & 0xff000000L) == 0x02000000L) {
|
if ((id & 0xff000000L) == 0x02000000L)
|
||||||
/* SSL2 cipher */
|
BIO_printf(STDout, " 0x%02X,0x%02X,0x%02X - ", id1, id2, id3); /* SSL2 cipher */
|
||||||
BIO_printf(STDout, " 0x%02X,0x%02X,0x%02X - ", id1,
|
else if ((id & 0xff000000L) == 0x03000000L)
|
||||||
id2, id3);
|
BIO_printf(STDout, " 0x%02X,0x%02X - ", id2, id3); /* SSL3 cipher */
|
||||||
} else if ((id & 0xff000000L) == 0x03000000L) {
|
else
|
||||||
/* SSL3 cipher */
|
BIO_printf(STDout, "0x%02X,0x%02X,0x%02X,0x%02X - ", id0, id1, id2, id3); /* whatever */
|
||||||
BIO_printf(STDout, " 0x%02X,0x%02X - ", id2,
|
}
|
||||||
id3);
|
|
||||||
} else {
|
|
||||||
/* whatever */
|
|
||||||
BIO_printf(STDout, "0x%02X,0x%02X,0x%02X,0x%02X - ", id0,
|
|
||||||
id1, id2, id3);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
BIO_puts(STDout, SSL_CIPHER_description(c, buf, sizeof buf));
|
BIO_puts(STDout,SSL_CIPHER_description(c,buf,sizeof buf));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ret=0;
|
||||||
|
if (0)
|
||||||
|
{
|
||||||
|
err:
|
||||||
|
SSL_load_error_strings();
|
||||||
|
ERR_print_errors(bio_err);
|
||||||
|
}
|
||||||
|
end:
|
||||||
|
if (ctx != NULL) SSL_CTX_free(ctx);
|
||||||
|
if (ssl != NULL) SSL_free(ssl);
|
||||||
|
if (STDout != NULL) BIO_free_all(STDout);
|
||||||
|
apps_shutdown();
|
||||||
|
OPENSSL_EXIT(ret);
|
||||||
|
}
|
||||||
|
|
||||||
ret = 0;
|
|
||||||
if (0) {
|
|
||||||
err:
|
|
||||||
SSL_load_error_strings();
|
|
||||||
ERR_print_errors(bio_err);
|
|
||||||
}
|
|
||||||
end:
|
|
||||||
if (ctx != NULL)
|
|
||||||
SSL_CTX_free(ctx);
|
|
||||||
if (ssl != NULL)
|
|
||||||
SSL_free(ssl);
|
|
||||||
if (STDout != NULL)
|
|
||||||
BIO_free_all(STDout);
|
|
||||||
apps_shutdown();
|
|
||||||
OPENSSL_EXIT(ret);
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,52 +1,24 @@
|
|||||||
subject= C = UK, O = OpenSSL Group, OU = FOR TESTING PURPOSES ONLY, CN = Test Client Cert
|
issuer= /C=AU/ST=Queensland/O=CryptSoft Pty Ltd/CN=Test CA (1024 bit)
|
||||||
issuer= C = UK, O = OpenSSL Group, OU = FOR TESTING PURPOSES ONLY, CN = OpenSSL Test Intermediate CA
|
subject=/C=AU/ST=Queensland/O=CryptSoft Pty Ltd/CN=Client test cert (512 bit)
|
||||||
-----BEGIN CERTIFICATE-----
|
-----BEGIN CERTIFICATE-----
|
||||||
MIID5zCCAs+gAwIBAgIJALnu1NlVpZ6yMA0GCSqGSIb3DQEBBQUAMHAxCzAJBgNV
|
MIIB6TCCAVICAQIwDQYJKoZIhvcNAQEEBQAwWzELMAkGA1UEBhMCQVUxEzARBgNV
|
||||||
BAYTAlVLMRYwFAYDVQQKDA1PcGVuU1NMIEdyb3VwMSIwIAYDVQQLDBlGT1IgVEVT
|
BAgTClF1ZWVuc2xhbmQxGjAYBgNVBAoTEUNyeXB0U29mdCBQdHkgTHRkMRswGQYD
|
||||||
VElORyBQVVJQT1NFUyBPTkxZMSUwIwYDVQQDDBxPcGVuU1NMIFRlc3QgSW50ZXJt
|
VQQDExJUZXN0IENBICgxMDI0IGJpdCkwHhcNOTcwNjA5MTM1NzU2WhcNOTgwNjA5
|
||||||
ZWRpYXRlIENBMB4XDTExMTIwODE0MDE0OFoXDTIxMTAxNjE0MDE0OFowZDELMAkG
|
MTM1NzU2WjBjMQswCQYDVQQGEwJBVTETMBEGA1UECBMKUXVlZW5zbGFuZDEaMBgG
|
||||||
A1UEBhMCVUsxFjAUBgNVBAoMDU9wZW5TU0wgR3JvdXAxIjAgBgNVBAsMGUZPUiBU
|
A1UEChMRQ3J5cHRTb2Z0IFB0eSBMdGQxIzAhBgNVBAMTGkNsaWVudCB0ZXN0IGNl
|
||||||
RVNUSU5HIFBVUlBPU0VTIE9OTFkxGTAXBgNVBAMMEFRlc3QgQ2xpZW50IENlcnQw
|
cnQgKDUxMiBiaXQpMFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBALtv55QyzG6i2Plw
|
||||||
ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC0ranbHRLcLVqN+0BzcZpY
|
Z1pah7++Gv8L5j6Hnyr/uTZE1NLG0ABDDexmq/R4KedLjFEIYjocDui+IXs62NNt
|
||||||
+yOLqxzDWT1LD9eW1stC4NzXX9/DCtSIVyN7YIHdGLrIPr64IDdXXaMRzgZ2rOKs
|
XrT8odkCAwEAATANBgkqhkiG9w0BAQQFAAOBgQBwtMmI7oGUG8nKmftQssATViH5
|
||||||
lmHCAiFpO/ja99gGCJRxH0xwQatqAULfJVHeUhs7OEGOZc2nWifjqKvGfNTilP7D
|
NRRtoEw07DxJp/LfatHdrhqQB73eGdL5WILZJXk46Xz2e9WMSUjVCSYhdKxtflU3
|
||||||
nwi69ipQFq9oS19FmhwVHk2wg7KZGHI1qDyG04UrfCZMRitvS9+UVhPpIPjuiBi2
|
UR2Ajv1Oo0sTNdfz0wDqJNirLNtzyhhsaq8qMTrLwXrCP31VxBiigFSQSUFnZyTE
|
||||||
x3/FZIpL5gXJvvFK6xHY63oq2asyzBATntBgnP4qJFWWcvRx24wF1PnZabxuVoL2
|
9TKwhS4GlwbtCfxSKQ==
|
||||||
bPnQ/KvONDrw3IdqkKhYNTul7jEcu3OlcZIMw+7DiaKJLAzKb/bBF5gm/pwW6As9
|
|
||||||
AgMBAAGjgY8wgYwwDAYDVR0TAQH/BAIwADAOBgNVHQ8BAf8EBAMCBeAwLAYJYIZI
|
|
||||||
AYb4QgENBB8WHU9wZW5TU0wgR2VuZXJhdGVkIENlcnRpZmljYXRlMB0GA1UdDgQW
|
|
||||||
BBSZHKyLoTh7Mb409Zn/mK1ceSDAjDAfBgNVHSMEGDAWgBQ2w2yI55X+sL3szj49
|
|
||||||
hqshgYfa2jANBgkqhkiG9w0BAQUFAAOCAQEAD0mL7PtPYgCEuDyOQSbLpeND5hVS
|
|
||||||
curxQdGnrJ6Acrhodb7E9ccATokeb0PLx6HBLQUicxhTZIQ9FbO43YkQcOU6C3BB
|
|
||||||
IlwskqmtN6+VmrQzNolHCDzvxNZs9lYL2VbGPGqVRyjZeHpoAlf9cQr8PgDb4d4b
|
|
||||||
vUx2KAhHQvV2nkmYvKyXcgnRuHggumF87mkxidriGAEFwH4qfOqetUg64WyxP7P2
|
|
||||||
QLipm04SyQa7ONtIApfVXgHcE42Py4/f4arzCzMjKe3VyhGkS7nsT55X/fWgTaRm
|
|
||||||
CQPkO+H94P958WTvQDt77bQ+D3IvYaVvfil8n6HJMOJfFT0LJuSUbpSXJg==
|
|
||||||
-----END CERTIFICATE-----
|
-----END CERTIFICATE-----
|
||||||
-----BEGIN RSA PRIVATE KEY-----
|
-----BEGIN RSA PRIVATE KEY-----
|
||||||
MIIEpQIBAAKCAQEAtK2p2x0S3C1ajftAc3GaWPsji6scw1k9Sw/XltbLQuDc11/f
|
MIIBOwIBAAJBALtv55QyzG6i2PlwZ1pah7++Gv8L5j6Hnyr/uTZE1NLG0ABDDexm
|
||||||
wwrUiFcje2CB3Ri6yD6+uCA3V12jEc4GdqzirJZhwgIhaTv42vfYBgiUcR9McEGr
|
q/R4KedLjFEIYjocDui+IXs62NNtXrT8odkCAwEAAQJAbwXq0vJ/+uyEvsNgxLko
|
||||||
agFC3yVR3lIbOzhBjmXNp1on46irxnzU4pT+w58IuvYqUBavaEtfRZocFR5NsIOy
|
/V86mGXQ/KrSkeKlL0r4ENxjcyeMAGoKu6J9yMY7+X9+Zm4nxShNfTsf/+Freoe1
|
||||||
mRhyNag8htOFK3wmTEYrb0vflFYT6SD47ogYtsd/xWSKS+YFyb7xSusR2Ot6Ktmr
|
HQIhAPOSm5Q1YI+KIsII2GeVJx1U69+wnd71OasIPakS1L1XAiEAxQAW+J3/JWE0
|
||||||
MswQE57QYJz+KiRVlnL0cduMBdT52Wm8blaC9mz50PyrzjQ68NyHapCoWDU7pe4x
|
ftEYakbhUOKL8tD1OaFZS71/5GdG7E8CIQCefUMmySSvwd6kC0VlATSWbW+d+jp/
|
||||||
HLtzpXGSDMPuw4miiSwMym/2wReYJv6cFugLPQIDAQABAoIBAAZOyc9MhIwLSU4L
|
nWmM1KvqnAo5uQIhALqEADu5U1Wvt8UN8UDGBRPQulHWNycuNV45d3nnskWPAiAw
|
||||||
p4RgQvM4UVVe8/Id+3XTZ8NsXExJbWxXfIhiqGjaIfL8u4vsgRjcl+v1s/jo2/iT
|
ueTyr6WsZ5+SD8g/Hy3xuvF3nPmJRH+rwvVihlcFOg==
|
||||||
KMab4o4D8gXD7UavQVDjtjb/ta79WL3SjRl2Uc9YjjMkyq6WmDNQeo2NKDdafCTB
|
|
||||||
1uzSJtLNipB8Z53ELPuHJhxX9QMHrMnuha49riQgXZ7buP9iQrHJFhImBjSzbxJx
|
|
||||||
L+TI6rkyLSf9Wi0Pd3L27Ob3QWNfNRYNSeTE+08eSRChkur5W0RuXAcuAICdQlCl
|
|
||||||
LBvWO/LmmvbzCqiDcgy/TliSb6CGGwgiNG7LJZmlkYNj8laGwalNlYZs3UrVv6NO
|
|
||||||
Br2loAECgYEA2kvCvPGj0Dg/6g7WhXDvAkEbcaL1tSeCxBbNH+6HS2UWMWvyTtCn
|
|
||||||
/bbD519QIdkvayy1QjEf32GV/UjUVmlULMLBcDy0DGjtL3+XpIhLKWDNxN1v1/ai
|
|
||||||
1oz23ZJCOgnk6K4qtFtlRS1XtynjA+rBetvYvLP9SKeFrnpzCgaA2r0CgYEA0+KX
|
|
||||||
1ACXDTNH5ySX3kMjSS9xdINf+OOw4CvPHFwbtc9aqk2HePlEsBTz5I/W3rKwXva3
|
|
||||||
NqZ/bRqVVeZB/hHKFywgdUQk2Uc5z/S7Lw70/w1HubNTXGU06Ngb6zOFAo/o/TwZ
|
|
||||||
zTP1BMIKSOB6PAZPS3l+aLO4FRIRotfFhgRHOoECgYEAmiZbqt8cJaJDB/5YYDzC
|
|
||||||
mp3tSk6gIb936Q6M5VqkMYp9pIKsxhk0N8aDCnTU+kIK6SzWBpr3/d9Ecmqmfyq7
|
|
||||||
5SvWO3KyVf0WWK9KH0abhOm2BKm2HBQvI0DB5u8sUx2/hsvOnjPYDISbZ11t0MtK
|
|
||||||
u35Zy89yMYcSsIYJjG/ROCUCgYEAgI2P9G5PNxEP5OtMwOsW84Y3Xat/hPAQFlI+
|
|
||||||
HES+AzbFGWJkeT8zL2nm95tVkFP1sggZ7Kxjz3w7cpx7GX0NkbWSE9O+T51pNASV
|
|
||||||
tN1sQ3p5M+/a+cnlqgfEGJVvc7iAcXQPa3LEi5h2yPR49QYXAgG6cifn3dDSpmwn
|
|
||||||
SUI7PQECgYEApGCIIpSRPLAEHTGmP87RBL1smurhwmy2s/pghkvUkWehtxg0sGHh
|
|
||||||
kuaqDWcskogv+QC0sVdytiLSz8G0DwcEcsHK1Fkyb8A+ayiw6jWJDo2m9+IF4Fww
|
|
||||||
1Te6jFPYDESnbhq7+TLGgHGhtwcu5cnb4vSuYXGXKupZGzoLOBbv1Zw=
|
|
||||||
-----END RSA PRIVATE KEY-----
|
-----END RSA PRIVATE KEY-----
|
||||||
|
|||||||
2301
apps/cms.c
2301
apps/cms.c
File diff suppressed because it is too large
Load Diff
662
apps/crl.c
662
apps/crl.c
@@ -67,368 +67,380 @@
|
|||||||
#include <openssl/pem.h>
|
#include <openssl/pem.h>
|
||||||
|
|
||||||
#undef PROG
|
#undef PROG
|
||||||
#define PROG crl_main
|
#define PROG crl_main
|
||||||
|
|
||||||
#undef POSTFIX
|
#undef POSTFIX
|
||||||
#define POSTFIX ".rvk"
|
#define POSTFIX ".rvk"
|
||||||
|
|
||||||
static const char *crl_usage[] = {
|
static const char *crl_usage[]={
|
||||||
"usage: crl args\n",
|
"usage: crl args\n",
|
||||||
"\n",
|
"\n",
|
||||||
" -inform arg - input format - default PEM (DER or PEM)\n",
|
" -inform arg - input format - default PEM (DER or PEM)\n",
|
||||||
" -outform arg - output format - default PEM\n",
|
" -outform arg - output format - default PEM\n",
|
||||||
" -text - print out a text format version\n",
|
" -text - print out a text format version\n",
|
||||||
" -in arg - input file - default stdin\n",
|
" -in arg - input file - default stdin\n",
|
||||||
" -out arg - output file - default stdout\n",
|
" -out arg - output file - default stdout\n",
|
||||||
" -hash - print hash value\n",
|
" -hash - print hash value\n",
|
||||||
#ifndef OPENSSL_NO_MD5
|
" -fingerprint - print the crl fingerprint\n",
|
||||||
" -hash_old - print old-style (MD5) hash value\n",
|
" -issuer - print issuer DN\n",
|
||||||
#endif
|
" -lastupdate - lastUpdate field\n",
|
||||||
" -fingerprint - print the crl fingerprint\n",
|
" -nextupdate - nextUpdate field\n",
|
||||||
" -issuer - print issuer DN\n",
|
" -crlnumber - print CRL number\n",
|
||||||
" -lastupdate - lastUpdate field\n",
|
" -noout - no CRL output\n",
|
||||||
" -nextupdate - nextUpdate field\n",
|
" -CAfile name - verify CRL using certificates in file \"name\"\n",
|
||||||
" -crlnumber - print CRL number\n",
|
" -CApath dir - verify CRL using certificates in \"dir\"\n",
|
||||||
" -noout - no CRL output\n",
|
" -nameopt arg - various certificate name options\n",
|
||||||
" -CAfile name - verify CRL using certificates in file \"name\"\n",
|
NULL
|
||||||
" -CApath dir - verify CRL using certificates in \"dir\"\n",
|
|
||||||
" -nameopt arg - various certificate name options\n",
|
|
||||||
NULL
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static X509_CRL *load_crl(char *file, int format);
|
static X509_CRL *load_crl(char *file, int format);
|
||||||
static BIO *bio_out = NULL;
|
static BIO *bio_out=NULL;
|
||||||
|
|
||||||
int MAIN(int, char **);
|
int MAIN(int, char **);
|
||||||
|
|
||||||
int MAIN(int argc, char **argv)
|
int MAIN(int argc, char **argv)
|
||||||
{
|
{
|
||||||
unsigned long nmflag = 0;
|
unsigned long nmflag = 0;
|
||||||
X509_CRL *x = NULL;
|
X509_CRL *x=NULL;
|
||||||
char *CAfile = NULL, *CApath = NULL;
|
char *CAfile = NULL, *CApath = NULL;
|
||||||
int ret = 1, i, num, badops = 0;
|
int ret=1,i,num,badops=0;
|
||||||
BIO *out = NULL;
|
BIO *out=NULL;
|
||||||
int informat, outformat;
|
int informat,outformat;
|
||||||
char *infile = NULL, *outfile = NULL;
|
char *infile=NULL,*outfile=NULL;
|
||||||
int hash = 0, issuer = 0, lastupdate = 0, nextupdate = 0, noout =
|
int hash=0,issuer=0,lastupdate=0,nextupdate=0,noout=0,text=0;
|
||||||
0, text = 0;
|
int fingerprint = 0, crlnumber = 0;
|
||||||
#ifndef OPENSSL_NO_MD5
|
const char **pp;
|
||||||
int hash_old = 0;
|
X509_STORE *store = NULL;
|
||||||
#endif
|
X509_STORE_CTX ctx;
|
||||||
int fingerprint = 0, crlnumber = 0;
|
X509_LOOKUP *lookup = NULL;
|
||||||
const char **pp;
|
X509_OBJECT xobj;
|
||||||
X509_STORE *store = NULL;
|
EVP_PKEY *pkey;
|
||||||
X509_STORE_CTX ctx;
|
int do_ver = 0;
|
||||||
X509_LOOKUP *lookup = NULL;
|
const EVP_MD *md_alg,*digest=EVP_sha1();
|
||||||
X509_OBJECT xobj;
|
|
||||||
EVP_PKEY *pkey;
|
|
||||||
int do_ver = 0;
|
|
||||||
const EVP_MD *md_alg, *digest = EVP_sha1();
|
|
||||||
|
|
||||||
apps_startup();
|
apps_startup();
|
||||||
|
|
||||||
if (bio_err == NULL)
|
if (bio_err == NULL)
|
||||||
if ((bio_err = BIO_new(BIO_s_file())) != NULL)
|
if ((bio_err=BIO_new(BIO_s_file())) != NULL)
|
||||||
BIO_set_fp(bio_err, stderr, BIO_NOCLOSE | BIO_FP_TEXT);
|
BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT);
|
||||||
|
|
||||||
if (!load_config(bio_err, NULL))
|
if (!load_config(bio_err, NULL))
|
||||||
goto end;
|
goto end;
|
||||||
|
|
||||||
if (bio_out == NULL)
|
if (bio_out == NULL)
|
||||||
if ((bio_out = BIO_new(BIO_s_file())) != NULL) {
|
if ((bio_out=BIO_new(BIO_s_file())) != NULL)
|
||||||
BIO_set_fp(bio_out, stdout, BIO_NOCLOSE);
|
{
|
||||||
|
BIO_set_fp(bio_out,stdout,BIO_NOCLOSE);
|
||||||
#ifdef OPENSSL_SYS_VMS
|
#ifdef OPENSSL_SYS_VMS
|
||||||
{
|
{
|
||||||
BIO *tmpbio = BIO_new(BIO_f_linebuffer());
|
BIO *tmpbio = BIO_new(BIO_f_linebuffer());
|
||||||
bio_out = BIO_push(tmpbio, bio_out);
|
bio_out = BIO_push(tmpbio, bio_out);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
informat = FORMAT_PEM;
|
informat=FORMAT_PEM;
|
||||||
outformat = FORMAT_PEM;
|
outformat=FORMAT_PEM;
|
||||||
|
|
||||||
argc--;
|
argc--;
|
||||||
argv++;
|
argv++;
|
||||||
num = 0;
|
num=0;
|
||||||
while (argc >= 1) {
|
while (argc >= 1)
|
||||||
|
{
|
||||||
#ifdef undef
|
#ifdef undef
|
||||||
if (strcmp(*argv, "-p") == 0) {
|
if (strcmp(*argv,"-p") == 0)
|
||||||
if (--argc < 1)
|
{
|
||||||
goto bad;
|
if (--argc < 1) goto bad;
|
||||||
if (!args_from_file(++argv, Nargc, Nargv)) {
|
if (!args_from_file(++argv,Nargc,Nargv)) { goto end; }*/
|
||||||
goto end;
|
}
|
||||||
}
|
|
||||||
*/}
|
|
||||||
#endif
|
#endif
|
||||||
if (strcmp(*argv, "-inform") == 0) {
|
if (strcmp(*argv,"-inform") == 0)
|
||||||
if (--argc < 1)
|
{
|
||||||
goto bad;
|
if (--argc < 1) goto bad;
|
||||||
informat = str2fmt(*(++argv));
|
informat=str2fmt(*(++argv));
|
||||||
} else if (strcmp(*argv, "-outform") == 0) {
|
}
|
||||||
if (--argc < 1)
|
else if (strcmp(*argv,"-outform") == 0)
|
||||||
goto bad;
|
{
|
||||||
outformat = str2fmt(*(++argv));
|
if (--argc < 1) goto bad;
|
||||||
} else if (strcmp(*argv, "-in") == 0) {
|
outformat=str2fmt(*(++argv));
|
||||||
if (--argc < 1)
|
}
|
||||||
goto bad;
|
else if (strcmp(*argv,"-in") == 0)
|
||||||
infile = *(++argv);
|
{
|
||||||
} else if (strcmp(*argv, "-out") == 0) {
|
if (--argc < 1) goto bad;
|
||||||
if (--argc < 1)
|
infile= *(++argv);
|
||||||
goto bad;
|
}
|
||||||
outfile = *(++argv);
|
else if (strcmp(*argv,"-out") == 0)
|
||||||
} else if (strcmp(*argv, "-CApath") == 0) {
|
{
|
||||||
if (--argc < 1)
|
if (--argc < 1) goto bad;
|
||||||
goto bad;
|
outfile= *(++argv);
|
||||||
CApath = *(++argv);
|
}
|
||||||
do_ver = 1;
|
else if (strcmp(*argv,"-CApath") == 0)
|
||||||
} else if (strcmp(*argv, "-CAfile") == 0) {
|
{
|
||||||
if (--argc < 1)
|
if (--argc < 1) goto bad;
|
||||||
goto bad;
|
CApath = *(++argv);
|
||||||
CAfile = *(++argv);
|
do_ver = 1;
|
||||||
do_ver = 1;
|
}
|
||||||
} else if (strcmp(*argv, "-verify") == 0)
|
else if (strcmp(*argv,"-CAfile") == 0)
|
||||||
do_ver = 1;
|
{
|
||||||
else if (strcmp(*argv, "-text") == 0)
|
if (--argc < 1) goto bad;
|
||||||
text = 1;
|
CAfile = *(++argv);
|
||||||
else if (strcmp(*argv, "-hash") == 0)
|
do_ver = 1;
|
||||||
hash = ++num;
|
}
|
||||||
#ifndef OPENSSL_NO_MD5
|
else if (strcmp(*argv,"-verify") == 0)
|
||||||
else if (strcmp(*argv, "-hash_old") == 0)
|
do_ver = 1;
|
||||||
hash_old = ++num;
|
else if (strcmp(*argv,"-text") == 0)
|
||||||
#endif
|
text = 1;
|
||||||
else if (strcmp(*argv, "-nameopt") == 0) {
|
else if (strcmp(*argv,"-hash") == 0)
|
||||||
if (--argc < 1)
|
hash= ++num;
|
||||||
goto bad;
|
else if (strcmp(*argv,"-nameopt") == 0)
|
||||||
if (!set_name_ex(&nmflag, *(++argv)))
|
{
|
||||||
goto bad;
|
if (--argc < 1) goto bad;
|
||||||
} else if (strcmp(*argv, "-issuer") == 0)
|
if (!set_name_ex(&nmflag, *(++argv))) goto bad;
|
||||||
issuer = ++num;
|
}
|
||||||
else if (strcmp(*argv, "-lastupdate") == 0)
|
else if (strcmp(*argv,"-issuer") == 0)
|
||||||
lastupdate = ++num;
|
issuer= ++num;
|
||||||
else if (strcmp(*argv, "-nextupdate") == 0)
|
else if (strcmp(*argv,"-lastupdate") == 0)
|
||||||
nextupdate = ++num;
|
lastupdate= ++num;
|
||||||
else if (strcmp(*argv, "-noout") == 0)
|
else if (strcmp(*argv,"-nextupdate") == 0)
|
||||||
noout = ++num;
|
nextupdate= ++num;
|
||||||
else if (strcmp(*argv, "-fingerprint") == 0)
|
else if (strcmp(*argv,"-noout") == 0)
|
||||||
fingerprint = ++num;
|
noout= ++num;
|
||||||
else if (strcmp(*argv, "-crlnumber") == 0)
|
else if (strcmp(*argv,"-fingerprint") == 0)
|
||||||
crlnumber = ++num;
|
fingerprint= ++num;
|
||||||
else if ((md_alg = EVP_get_digestbyname(*argv + 1))) {
|
else if (strcmp(*argv,"-crlnumber") == 0)
|
||||||
/* ok */
|
crlnumber= ++num;
|
||||||
digest = md_alg;
|
else if ((md_alg=EVP_get_digestbyname(*argv + 1)))
|
||||||
} else {
|
{
|
||||||
BIO_printf(bio_err, "unknown option %s\n", *argv);
|
/* ok */
|
||||||
badops = 1;
|
digest=md_alg;
|
||||||
break;
|
}
|
||||||
}
|
else
|
||||||
argc--;
|
{
|
||||||
argv++;
|
BIO_printf(bio_err,"unknown option %s\n",*argv);
|
||||||
}
|
badops=1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
argc--;
|
||||||
|
argv++;
|
||||||
|
}
|
||||||
|
|
||||||
if (badops) {
|
if (badops)
|
||||||
bad:
|
{
|
||||||
for (pp = crl_usage; (*pp != NULL); pp++)
|
bad:
|
||||||
BIO_printf(bio_err, "%s", *pp);
|
for (pp=crl_usage; (*pp != NULL); pp++)
|
||||||
goto end;
|
BIO_printf(bio_err,"%s",*pp);
|
||||||
}
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
ERR_load_crypto_strings();
|
ERR_load_crypto_strings();
|
||||||
x = load_crl(infile, informat);
|
x=load_crl(infile,informat);
|
||||||
if (x == NULL) {
|
if (x == NULL) { goto end; }
|
||||||
goto end;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (do_ver) {
|
if(do_ver) {
|
||||||
store = X509_STORE_new();
|
store = X509_STORE_new();
|
||||||
lookup = X509_STORE_add_lookup(store, X509_LOOKUP_file());
|
lookup=X509_STORE_add_lookup(store,X509_LOOKUP_file());
|
||||||
if (lookup == NULL)
|
if (lookup == NULL) goto end;
|
||||||
goto end;
|
if (!X509_LOOKUP_load_file(lookup,CAfile,X509_FILETYPE_PEM))
|
||||||
if (!X509_LOOKUP_load_file(lookup, CAfile, X509_FILETYPE_PEM))
|
X509_LOOKUP_load_file(lookup,NULL,X509_FILETYPE_DEFAULT);
|
||||||
X509_LOOKUP_load_file(lookup, NULL, X509_FILETYPE_DEFAULT);
|
|
||||||
|
|
||||||
lookup = X509_STORE_add_lookup(store, X509_LOOKUP_hash_dir());
|
lookup=X509_STORE_add_lookup(store,X509_LOOKUP_hash_dir());
|
||||||
if (lookup == NULL)
|
if (lookup == NULL) goto end;
|
||||||
goto end;
|
if (!X509_LOOKUP_add_dir(lookup,CApath,X509_FILETYPE_PEM))
|
||||||
if (!X509_LOOKUP_add_dir(lookup, CApath, X509_FILETYPE_PEM))
|
X509_LOOKUP_add_dir(lookup,NULL,X509_FILETYPE_DEFAULT);
|
||||||
X509_LOOKUP_add_dir(lookup, NULL, X509_FILETYPE_DEFAULT);
|
ERR_clear_error();
|
||||||
ERR_clear_error();
|
|
||||||
|
|
||||||
if (!X509_STORE_CTX_init(&ctx, store, NULL, NULL)) {
|
if(!X509_STORE_CTX_init(&ctx, store, NULL, NULL)) {
|
||||||
BIO_printf(bio_err, "Error initialising X509 store\n");
|
BIO_printf(bio_err,
|
||||||
goto end;
|
"Error initialising X509 store\n");
|
||||||
}
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
i = X509_STORE_get_by_subject(&ctx, X509_LU_X509,
|
i = X509_STORE_get_by_subject(&ctx, X509_LU_X509,
|
||||||
X509_CRL_get_issuer(x), &xobj);
|
X509_CRL_get_issuer(x), &xobj);
|
||||||
if (i <= 0) {
|
if(i <= 0) {
|
||||||
BIO_printf(bio_err, "Error getting CRL issuer certificate\n");
|
BIO_printf(bio_err,
|
||||||
goto end;
|
"Error getting CRL issuer certificate\n");
|
||||||
}
|
goto end;
|
||||||
pkey = X509_get_pubkey(xobj.data.x509);
|
}
|
||||||
X509_OBJECT_free_contents(&xobj);
|
pkey = X509_get_pubkey(xobj.data.x509);
|
||||||
if (!pkey) {
|
X509_OBJECT_free_contents(&xobj);
|
||||||
BIO_printf(bio_err, "Error getting CRL issuer public key\n");
|
if(!pkey) {
|
||||||
goto end;
|
BIO_printf(bio_err,
|
||||||
}
|
"Error getting CRL issuer public key\n");
|
||||||
i = X509_CRL_verify(x, pkey);
|
goto end;
|
||||||
EVP_PKEY_free(pkey);
|
}
|
||||||
if (i < 0)
|
i = X509_CRL_verify(x, pkey);
|
||||||
goto end;
|
EVP_PKEY_free(pkey);
|
||||||
if (i == 0)
|
if(i < 0) goto end;
|
||||||
BIO_printf(bio_err, "verify failure\n");
|
if(i == 0) BIO_printf(bio_err, "verify failure\n");
|
||||||
else
|
else BIO_printf(bio_err, "verify OK\n");
|
||||||
BIO_printf(bio_err, "verify OK\n");
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (num) {
|
if (num)
|
||||||
for (i = 1; i <= num; i++) {
|
{
|
||||||
if (issuer == i) {
|
for (i=1; i<=num; i++)
|
||||||
print_name(bio_out, "issuer=", X509_CRL_get_issuer(x),
|
{
|
||||||
nmflag);
|
if (issuer == i)
|
||||||
}
|
{
|
||||||
if (crlnumber == i) {
|
print_name(bio_out, "issuer=", X509_CRL_get_issuer(x), nmflag);
|
||||||
ASN1_INTEGER *crlnum;
|
}
|
||||||
crlnum = X509_CRL_get_ext_d2i(x, NID_crl_number, NULL, NULL);
|
if (crlnumber == i)
|
||||||
BIO_printf(bio_out, "crlNumber=");
|
{
|
||||||
if (crlnum) {
|
ASN1_INTEGER *crlnum;
|
||||||
i2a_ASN1_INTEGER(bio_out, crlnum);
|
crlnum = X509_CRL_get_ext_d2i(x, NID_crl_number,
|
||||||
ASN1_INTEGER_free(crlnum);
|
NULL, NULL);
|
||||||
} else
|
BIO_printf(bio_out,"crlNumber=");
|
||||||
BIO_puts(bio_out, "<NONE>");
|
if (crlnum)
|
||||||
BIO_printf(bio_out, "\n");
|
{
|
||||||
}
|
i2a_ASN1_INTEGER(bio_out, crlnum);
|
||||||
if (hash == i) {
|
ASN1_INTEGER_free(crlnum);
|
||||||
BIO_printf(bio_out, "%08lx\n",
|
}
|
||||||
X509_NAME_hash(X509_CRL_get_issuer(x)));
|
else
|
||||||
}
|
BIO_puts(bio_out, "<NONE>");
|
||||||
#ifndef OPENSSL_NO_MD5
|
BIO_printf(bio_out,"\n");
|
||||||
if (hash_old == i) {
|
}
|
||||||
BIO_printf(bio_out, "%08lx\n",
|
if (hash == i)
|
||||||
X509_NAME_hash_old(X509_CRL_get_issuer(x)));
|
{
|
||||||
}
|
BIO_printf(bio_out,"%08lx\n",
|
||||||
#endif
|
X509_NAME_hash(X509_CRL_get_issuer(x)));
|
||||||
if (lastupdate == i) {
|
}
|
||||||
BIO_printf(bio_out, "lastUpdate=");
|
if (lastupdate == i)
|
||||||
ASN1_TIME_print(bio_out, X509_CRL_get_lastUpdate(x));
|
{
|
||||||
BIO_printf(bio_out, "\n");
|
BIO_printf(bio_out,"lastUpdate=");
|
||||||
}
|
ASN1_TIME_print(bio_out,
|
||||||
if (nextupdate == i) {
|
X509_CRL_get_lastUpdate(x));
|
||||||
BIO_printf(bio_out, "nextUpdate=");
|
BIO_printf(bio_out,"\n");
|
||||||
if (X509_CRL_get_nextUpdate(x))
|
}
|
||||||
ASN1_TIME_print(bio_out, X509_CRL_get_nextUpdate(x));
|
if (nextupdate == i)
|
||||||
else
|
{
|
||||||
BIO_printf(bio_out, "NONE");
|
BIO_printf(bio_out,"nextUpdate=");
|
||||||
BIO_printf(bio_out, "\n");
|
if (X509_CRL_get_nextUpdate(x))
|
||||||
}
|
ASN1_TIME_print(bio_out,
|
||||||
if (fingerprint == i) {
|
X509_CRL_get_nextUpdate(x));
|
||||||
int j;
|
else
|
||||||
unsigned int n;
|
BIO_printf(bio_out,"NONE");
|
||||||
unsigned char md[EVP_MAX_MD_SIZE];
|
BIO_printf(bio_out,"\n");
|
||||||
|
}
|
||||||
|
if (fingerprint == i)
|
||||||
|
{
|
||||||
|
int j;
|
||||||
|
unsigned int n;
|
||||||
|
unsigned char md[EVP_MAX_MD_SIZE];
|
||||||
|
|
||||||
if (!X509_CRL_digest(x, digest, md, &n)) {
|
if (!X509_CRL_digest(x,digest,md,&n))
|
||||||
BIO_printf(bio_err, "out of memory\n");
|
{
|
||||||
goto end;
|
BIO_printf(bio_err,"out of memory\n");
|
||||||
}
|
goto end;
|
||||||
BIO_printf(bio_out, "%s Fingerprint=",
|
}
|
||||||
OBJ_nid2sn(EVP_MD_type(digest)));
|
BIO_printf(bio_out,"%s Fingerprint=",
|
||||||
for (j = 0; j < (int)n; j++) {
|
OBJ_nid2sn(EVP_MD_type(digest)));
|
||||||
BIO_printf(bio_out, "%02X%c", md[j], (j + 1 == (int)n)
|
for (j=0; j<(int)n; j++)
|
||||||
? '\n' : ':');
|
{
|
||||||
}
|
BIO_printf(bio_out,"%02X%c",md[j],
|
||||||
}
|
(j+1 == (int)n)
|
||||||
}
|
?'\n':':');
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
out = BIO_new(BIO_s_file());
|
out=BIO_new(BIO_s_file());
|
||||||
if (out == NULL) {
|
if (out == NULL)
|
||||||
ERR_print_errors(bio_err);
|
{
|
||||||
goto end;
|
ERR_print_errors(bio_err);
|
||||||
}
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
if (outfile == NULL) {
|
if (outfile == NULL)
|
||||||
BIO_set_fp(out, stdout, BIO_NOCLOSE);
|
{
|
||||||
|
BIO_set_fp(out,stdout,BIO_NOCLOSE);
|
||||||
#ifdef OPENSSL_SYS_VMS
|
#ifdef OPENSSL_SYS_VMS
|
||||||
{
|
{
|
||||||
BIO *tmpbio = BIO_new(BIO_f_linebuffer());
|
BIO *tmpbio = BIO_new(BIO_f_linebuffer());
|
||||||
out = BIO_push(tmpbio, out);
|
out = BIO_push(tmpbio, out);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
} else {
|
}
|
||||||
if (BIO_write_filename(out, outfile) <= 0) {
|
else
|
||||||
perror(outfile);
|
{
|
||||||
goto end;
|
if (BIO_write_filename(out,outfile) <= 0)
|
||||||
}
|
{
|
||||||
}
|
perror(outfile);
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (text)
|
if (text) X509_CRL_print(out, x);
|
||||||
X509_CRL_print(out, x);
|
|
||||||
|
|
||||||
if (noout) {
|
if (noout)
|
||||||
ret = 0;
|
{
|
||||||
goto end;
|
ret = 0;
|
||||||
}
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
if (outformat == FORMAT_ASN1)
|
if (outformat == FORMAT_ASN1)
|
||||||
i = (int)i2d_X509_CRL_bio(out, x);
|
i=(int)i2d_X509_CRL_bio(out,x);
|
||||||
else if (outformat == FORMAT_PEM)
|
else if (outformat == FORMAT_PEM)
|
||||||
i = PEM_write_bio_X509_CRL(out, x);
|
i=PEM_write_bio_X509_CRL(out,x);
|
||||||
else {
|
else
|
||||||
BIO_printf(bio_err, "bad output format specified for outfile\n");
|
{
|
||||||
goto end;
|
BIO_printf(bio_err,"bad output format specified for outfile\n");
|
||||||
}
|
goto end;
|
||||||
if (!i) {
|
}
|
||||||
BIO_printf(bio_err, "unable to write CRL\n");
|
if (!i) { BIO_printf(bio_err,"unable to write CRL\n"); goto end; }
|
||||||
goto end;
|
ret=0;
|
||||||
}
|
end:
|
||||||
ret = 0;
|
BIO_free_all(out);
|
||||||
end:
|
BIO_free_all(bio_out);
|
||||||
BIO_free_all(out);
|
bio_out=NULL;
|
||||||
BIO_free_all(bio_out);
|
X509_CRL_free(x);
|
||||||
bio_out = NULL;
|
if(store) {
|
||||||
X509_CRL_free(x);
|
X509_STORE_CTX_cleanup(&ctx);
|
||||||
if (store) {
|
X509_STORE_free(store);
|
||||||
X509_STORE_CTX_cleanup(&ctx);
|
}
|
||||||
X509_STORE_free(store);
|
apps_shutdown();
|
||||||
}
|
OPENSSL_EXIT(ret);
|
||||||
apps_shutdown();
|
}
|
||||||
OPENSSL_EXIT(ret);
|
|
||||||
}
|
|
||||||
|
|
||||||
static X509_CRL *load_crl(char *infile, int format)
|
static X509_CRL *load_crl(char *infile, int format)
|
||||||
{
|
{
|
||||||
X509_CRL *x = NULL;
|
X509_CRL *x=NULL;
|
||||||
BIO *in = NULL;
|
BIO *in=NULL;
|
||||||
|
|
||||||
in = BIO_new(BIO_s_file());
|
in=BIO_new(BIO_s_file());
|
||||||
if (in == NULL) {
|
if (in == NULL)
|
||||||
ERR_print_errors(bio_err);
|
{
|
||||||
goto end;
|
ERR_print_errors(bio_err);
|
||||||
}
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
if (infile == NULL)
|
if (infile == NULL)
|
||||||
BIO_set_fp(in, stdin, BIO_NOCLOSE);
|
BIO_set_fp(in,stdin,BIO_NOCLOSE);
|
||||||
else {
|
else
|
||||||
if (BIO_read_filename(in, infile) <= 0) {
|
{
|
||||||
perror(infile);
|
if (BIO_read_filename(in,infile) <= 0)
|
||||||
goto end;
|
{
|
||||||
}
|
perror(infile);
|
||||||
}
|
goto end;
|
||||||
if (format == FORMAT_ASN1)
|
}
|
||||||
x = d2i_X509_CRL_bio(in, NULL);
|
}
|
||||||
else if (format == FORMAT_PEM)
|
if (format == FORMAT_ASN1)
|
||||||
x = PEM_read_bio_X509_CRL(in, NULL, NULL, NULL);
|
x=d2i_X509_CRL_bio(in,NULL);
|
||||||
else {
|
else if (format == FORMAT_PEM)
|
||||||
BIO_printf(bio_err, "bad input format specified for input crl\n");
|
x=PEM_read_bio_X509_CRL(in,NULL,NULL,NULL);
|
||||||
goto end;
|
else {
|
||||||
}
|
BIO_printf(bio_err,"bad input format specified for input crl\n");
|
||||||
if (x == NULL) {
|
goto end;
|
||||||
BIO_printf(bio_err, "unable to load CRL\n");
|
}
|
||||||
ERR_print_errors(bio_err);
|
if (x == NULL)
|
||||||
goto end;
|
{
|
||||||
}
|
BIO_printf(bio_err,"unable to load CRL\n");
|
||||||
|
ERR_print_errors(bio_err);
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
|
end:
|
||||||
|
BIO_free(in);
|
||||||
|
return(x);
|
||||||
|
}
|
||||||
|
|
||||||
end:
|
|
||||||
BIO_free(in);
|
|
||||||
return (x);
|
|
||||||
}
|
|
||||||
|
|||||||
449
apps/crl2p7.c
449
apps/crl2p7.c
@@ -56,11 +56,9 @@
|
|||||||
* [including the GNU Public Licence.]
|
* [including the GNU Public Licence.]
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/* This was written by Gordon Chaffee <chaffee@plateau.cs.berkeley.edu>
|
||||||
* This was written by Gordon Chaffee <chaffee@plateau.cs.berkeley.edu> and
|
* and donated 'to the cause' along with lots and lots of other fixes to
|
||||||
* donated 'to the cause' along with lots and lots of other fixes to the
|
* the library. */
|
||||||
* library.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@@ -75,260 +73,265 @@
|
|||||||
|
|
||||||
static int add_certs_from_file(STACK_OF(X509) *stack, char *certfile);
|
static int add_certs_from_file(STACK_OF(X509) *stack, char *certfile);
|
||||||
#undef PROG
|
#undef PROG
|
||||||
#define PROG crl2pkcs7_main
|
#define PROG crl2pkcs7_main
|
||||||
|
|
||||||
/*-
|
/* -inform arg - input format - default PEM (DER or PEM)
|
||||||
* -inform arg - input format - default PEM (DER or PEM)
|
|
||||||
* -outform arg - output format - default PEM
|
* -outform arg - output format - default PEM
|
||||||
* -in arg - input file - default stdin
|
* -in arg - input file - default stdin
|
||||||
* -out arg - output file - default stdout
|
* -out arg - output file - default stdout
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int MAIN(int, char **);
|
int MAIN(int, char **);
|
||||||
|
|
||||||
int MAIN(int argc, char **argv)
|
int MAIN(int argc, char **argv)
|
||||||
{
|
{
|
||||||
int i, badops = 0;
|
int i,badops=0;
|
||||||
BIO *in = NULL, *out = NULL;
|
BIO *in=NULL,*out=NULL;
|
||||||
int informat, outformat;
|
int informat,outformat;
|
||||||
char *infile, *outfile, *prog, *certfile;
|
char *infile,*outfile,*prog,*certfile;
|
||||||
PKCS7 *p7 = NULL;
|
PKCS7 *p7 = NULL;
|
||||||
PKCS7_SIGNED *p7s = NULL;
|
PKCS7_SIGNED *p7s = NULL;
|
||||||
X509_CRL *crl = NULL;
|
X509_CRL *crl=NULL;
|
||||||
STACK_OF(OPENSSL_STRING) *certflst = NULL;
|
STACK_OF(OPENSSL_STRING) *certflst=NULL;
|
||||||
STACK_OF(X509_CRL) *crl_stack = NULL;
|
STACK_OF(X509_CRL) *crl_stack=NULL;
|
||||||
STACK_OF(X509) *cert_stack = NULL;
|
STACK_OF(X509) *cert_stack=NULL;
|
||||||
int ret = 1, nocrl = 0;
|
int ret=1,nocrl=0;
|
||||||
|
|
||||||
apps_startup();
|
apps_startup();
|
||||||
|
|
||||||
if (bio_err == NULL)
|
if (bio_err == NULL)
|
||||||
if ((bio_err = BIO_new(BIO_s_file())) != NULL)
|
if ((bio_err=BIO_new(BIO_s_file())) != NULL)
|
||||||
BIO_set_fp(bio_err, stderr, BIO_NOCLOSE | BIO_FP_TEXT);
|
BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT);
|
||||||
|
|
||||||
infile = NULL;
|
infile=NULL;
|
||||||
outfile = NULL;
|
outfile=NULL;
|
||||||
informat = FORMAT_PEM;
|
informat=FORMAT_PEM;
|
||||||
outformat = FORMAT_PEM;
|
outformat=FORMAT_PEM;
|
||||||
|
|
||||||
prog = argv[0];
|
prog=argv[0];
|
||||||
argc--;
|
argc--;
|
||||||
argv++;
|
argv++;
|
||||||
while (argc >= 1) {
|
while (argc >= 1)
|
||||||
if (strcmp(*argv, "-inform") == 0) {
|
{
|
||||||
if (--argc < 1)
|
if (strcmp(*argv,"-inform") == 0)
|
||||||
goto bad;
|
{
|
||||||
informat = str2fmt(*(++argv));
|
if (--argc < 1) goto bad;
|
||||||
} else if (strcmp(*argv, "-outform") == 0) {
|
informat=str2fmt(*(++argv));
|
||||||
if (--argc < 1)
|
}
|
||||||
goto bad;
|
else if (strcmp(*argv,"-outform") == 0)
|
||||||
outformat = str2fmt(*(++argv));
|
{
|
||||||
} else if (strcmp(*argv, "-in") == 0) {
|
if (--argc < 1) goto bad;
|
||||||
if (--argc < 1)
|
outformat=str2fmt(*(++argv));
|
||||||
goto bad;
|
}
|
||||||
infile = *(++argv);
|
else if (strcmp(*argv,"-in") == 0)
|
||||||
} else if (strcmp(*argv, "-nocrl") == 0) {
|
{
|
||||||
nocrl = 1;
|
if (--argc < 1) goto bad;
|
||||||
} else if (strcmp(*argv, "-out") == 0) {
|
infile= *(++argv);
|
||||||
if (--argc < 1)
|
}
|
||||||
goto bad;
|
else if (strcmp(*argv,"-nocrl") == 0)
|
||||||
outfile = *(++argv);
|
{
|
||||||
} else if (strcmp(*argv, "-certfile") == 0) {
|
nocrl=1;
|
||||||
if (--argc < 1)
|
}
|
||||||
goto bad;
|
else if (strcmp(*argv,"-out") == 0)
|
||||||
if (!certflst)
|
{
|
||||||
certflst = sk_OPENSSL_STRING_new_null();
|
if (--argc < 1) goto bad;
|
||||||
if (!certflst)
|
outfile= *(++argv);
|
||||||
goto end;
|
}
|
||||||
if (!sk_OPENSSL_STRING_push(certflst, *(++argv))) {
|
else if (strcmp(*argv,"-certfile") == 0)
|
||||||
sk_OPENSSL_STRING_free(certflst);
|
{
|
||||||
goto end;
|
if (--argc < 1) goto bad;
|
||||||
}
|
if(!certflst) certflst = sk_OPENSSL_STRING_new_null();
|
||||||
} else {
|
sk_OPENSSL_STRING_push(certflst,*(++argv));
|
||||||
BIO_printf(bio_err, "unknown option %s\n", *argv);
|
}
|
||||||
badops = 1;
|
else
|
||||||
break;
|
{
|
||||||
}
|
BIO_printf(bio_err,"unknown option %s\n",*argv);
|
||||||
argc--;
|
badops=1;
|
||||||
argv++;
|
break;
|
||||||
}
|
}
|
||||||
|
argc--;
|
||||||
|
argv++;
|
||||||
|
}
|
||||||
|
|
||||||
if (badops) {
|
if (badops)
|
||||||
bad:
|
{
|
||||||
BIO_printf(bio_err, "%s [options] <infile >outfile\n", prog);
|
bad:
|
||||||
BIO_printf(bio_err, "where options are\n");
|
BIO_printf(bio_err,"%s [options] <infile >outfile\n",prog);
|
||||||
BIO_printf(bio_err, " -inform arg input format - DER or PEM\n");
|
BIO_printf(bio_err,"where options are\n");
|
||||||
BIO_printf(bio_err, " -outform arg output format - DER or PEM\n");
|
BIO_printf(bio_err," -inform arg input format - DER or PEM\n");
|
||||||
BIO_printf(bio_err, " -in arg input file\n");
|
BIO_printf(bio_err," -outform arg output format - DER or PEM\n");
|
||||||
BIO_printf(bio_err, " -out arg output file\n");
|
BIO_printf(bio_err," -in arg input file\n");
|
||||||
BIO_printf(bio_err,
|
BIO_printf(bio_err," -out arg output file\n");
|
||||||
" -certfile arg certificates file of chain to a trusted CA\n");
|
BIO_printf(bio_err," -certfile arg certificates file of chain to a trusted CA\n");
|
||||||
BIO_printf(bio_err, " (can be used more than once)\n");
|
BIO_printf(bio_err," (can be used more than once)\n");
|
||||||
BIO_printf(bio_err,
|
BIO_printf(bio_err," -nocrl no crl to load, just certs from '-certfile'\n");
|
||||||
" -nocrl no crl to load, just certs from '-certfile'\n");
|
ret = 1;
|
||||||
ret = 1;
|
goto end;
|
||||||
goto end;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
ERR_load_crypto_strings();
|
ERR_load_crypto_strings();
|
||||||
|
|
||||||
in = BIO_new(BIO_s_file());
|
in=BIO_new(BIO_s_file());
|
||||||
out = BIO_new(BIO_s_file());
|
out=BIO_new(BIO_s_file());
|
||||||
if ((in == NULL) || (out == NULL)) {
|
if ((in == NULL) || (out == NULL))
|
||||||
ERR_print_errors(bio_err);
|
{
|
||||||
goto end;
|
ERR_print_errors(bio_err);
|
||||||
}
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
if (!nocrl) {
|
if (!nocrl)
|
||||||
if (infile == NULL)
|
{
|
||||||
BIO_set_fp(in, stdin, BIO_NOCLOSE);
|
if (infile == NULL)
|
||||||
else {
|
BIO_set_fp(in,stdin,BIO_NOCLOSE);
|
||||||
if (BIO_read_filename(in, infile) <= 0) {
|
else
|
||||||
perror(infile);
|
{
|
||||||
goto end;
|
if (BIO_read_filename(in,infile) <= 0)
|
||||||
}
|
{
|
||||||
}
|
perror(infile);
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (informat == FORMAT_ASN1)
|
if (informat == FORMAT_ASN1)
|
||||||
crl = d2i_X509_CRL_bio(in, NULL);
|
crl=d2i_X509_CRL_bio(in,NULL);
|
||||||
else if (informat == FORMAT_PEM)
|
else if (informat == FORMAT_PEM)
|
||||||
crl = PEM_read_bio_X509_CRL(in, NULL, NULL, NULL);
|
crl=PEM_read_bio_X509_CRL(in,NULL,NULL,NULL);
|
||||||
else {
|
else {
|
||||||
BIO_printf(bio_err, "bad input format specified for input crl\n");
|
BIO_printf(bio_err,"bad input format specified for input crl\n");
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
if (crl == NULL) {
|
if (crl == NULL)
|
||||||
BIO_printf(bio_err, "unable to load CRL\n");
|
{
|
||||||
ERR_print_errors(bio_err);
|
BIO_printf(bio_err,"unable to load CRL\n");
|
||||||
goto end;
|
ERR_print_errors(bio_err);
|
||||||
}
|
goto end;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ((p7 = PKCS7_new()) == NULL)
|
if ((p7=PKCS7_new()) == NULL) goto end;
|
||||||
goto end;
|
if ((p7s=PKCS7_SIGNED_new()) == NULL) goto end;
|
||||||
if ((p7s = PKCS7_SIGNED_new()) == NULL)
|
p7->type=OBJ_nid2obj(NID_pkcs7_signed);
|
||||||
goto end;
|
p7->d.sign=p7s;
|
||||||
p7->type = OBJ_nid2obj(NID_pkcs7_signed);
|
p7s->contents->type=OBJ_nid2obj(NID_pkcs7_data);
|
||||||
p7->d.sign = p7s;
|
|
||||||
p7s->contents->type = OBJ_nid2obj(NID_pkcs7_data);
|
|
||||||
|
|
||||||
if (!ASN1_INTEGER_set(p7s->version, 1))
|
if (!ASN1_INTEGER_set(p7s->version,1)) goto end;
|
||||||
goto end;
|
if ((crl_stack=sk_X509_CRL_new_null()) == NULL) goto end;
|
||||||
if ((crl_stack = sk_X509_CRL_new_null()) == NULL)
|
p7s->crl=crl_stack;
|
||||||
goto end;
|
if (crl != NULL)
|
||||||
p7s->crl = crl_stack;
|
{
|
||||||
if (crl != NULL) {
|
sk_X509_CRL_push(crl_stack,crl);
|
||||||
sk_X509_CRL_push(crl_stack, crl);
|
crl=NULL; /* now part of p7 for OPENSSL_freeing */
|
||||||
crl = NULL; /* now part of p7 for OPENSSL_freeing */
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if ((cert_stack = sk_X509_new_null()) == NULL)
|
if ((cert_stack=sk_X509_new_null()) == NULL) goto end;
|
||||||
goto end;
|
p7s->cert=cert_stack;
|
||||||
p7s->cert = cert_stack;
|
|
||||||
|
|
||||||
if (certflst)
|
if(certflst) for(i = 0; i < sk_OPENSSL_STRING_num(certflst); i++) {
|
||||||
for (i = 0; i < sk_OPENSSL_STRING_num(certflst); i++) {
|
certfile = sk_OPENSSL_STRING_value(certflst, i);
|
||||||
certfile = sk_OPENSSL_STRING_value(certflst, i);
|
if (add_certs_from_file(cert_stack,certfile) < 0)
|
||||||
if (add_certs_from_file(cert_stack, certfile) < 0) {
|
{
|
||||||
BIO_printf(bio_err, "error loading certificates\n");
|
BIO_printf(bio_err, "error loading certificates\n");
|
||||||
ERR_print_errors(bio_err);
|
ERR_print_errors(bio_err);
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sk_OPENSSL_STRING_free(certflst);
|
sk_OPENSSL_STRING_free(certflst);
|
||||||
|
|
||||||
if (outfile == NULL) {
|
if (outfile == NULL)
|
||||||
BIO_set_fp(out, stdout, BIO_NOCLOSE);
|
{
|
||||||
|
BIO_set_fp(out,stdout,BIO_NOCLOSE);
|
||||||
#ifdef OPENSSL_SYS_VMS
|
#ifdef OPENSSL_SYS_VMS
|
||||||
{
|
{
|
||||||
BIO *tmpbio = BIO_new(BIO_f_linebuffer());
|
BIO *tmpbio = BIO_new(BIO_f_linebuffer());
|
||||||
out = BIO_push(tmpbio, out);
|
out = BIO_push(tmpbio, out);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
} else {
|
}
|
||||||
if (BIO_write_filename(out, outfile) <= 0) {
|
else
|
||||||
perror(outfile);
|
{
|
||||||
goto end;
|
if (BIO_write_filename(out,outfile) <= 0)
|
||||||
}
|
{
|
||||||
}
|
perror(outfile);
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (outformat == FORMAT_ASN1)
|
if (outformat == FORMAT_ASN1)
|
||||||
i = i2d_PKCS7_bio(out, p7);
|
i=i2d_PKCS7_bio(out,p7);
|
||||||
else if (outformat == FORMAT_PEM)
|
else if (outformat == FORMAT_PEM)
|
||||||
i = PEM_write_bio_PKCS7(out, p7);
|
i=PEM_write_bio_PKCS7(out,p7);
|
||||||
else {
|
else {
|
||||||
BIO_printf(bio_err, "bad output format specified for outfile\n");
|
BIO_printf(bio_err,"bad output format specified for outfile\n");
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
if (!i) {
|
if (!i)
|
||||||
BIO_printf(bio_err, "unable to write pkcs7 object\n");
|
{
|
||||||
ERR_print_errors(bio_err);
|
BIO_printf(bio_err,"unable to write pkcs7 object\n");
|
||||||
goto end;
|
ERR_print_errors(bio_err);
|
||||||
}
|
goto end;
|
||||||
ret = 0;
|
}
|
||||||
end:
|
ret=0;
|
||||||
if (in != NULL)
|
end:
|
||||||
BIO_free(in);
|
if (in != NULL) BIO_free(in);
|
||||||
if (out != NULL)
|
if (out != NULL) BIO_free_all(out);
|
||||||
BIO_free_all(out);
|
if (p7 != NULL) PKCS7_free(p7);
|
||||||
if (p7 != NULL)
|
if (crl != NULL) X509_CRL_free(crl);
|
||||||
PKCS7_free(p7);
|
|
||||||
if (crl != NULL)
|
|
||||||
X509_CRL_free(crl);
|
|
||||||
|
|
||||||
apps_shutdown();
|
apps_shutdown();
|
||||||
OPENSSL_EXIT(ret);
|
OPENSSL_EXIT(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*-
|
/*
|
||||||
*----------------------------------------------------------------------
|
*----------------------------------------------------------------------
|
||||||
* int add_certs_from_file
|
* int add_certs_from_file
|
||||||
*
|
*
|
||||||
* Read a list of certificates to be checked from a file.
|
* Read a list of certificates to be checked from a file.
|
||||||
*
|
*
|
||||||
* Results:
|
* Results:
|
||||||
* number of certs added if successful, -1 if not.
|
* number of certs added if successful, -1 if not.
|
||||||
*----------------------------------------------------------------------
|
*----------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
static int add_certs_from_file(STACK_OF(X509) *stack, char *certfile)
|
static int add_certs_from_file(STACK_OF(X509) *stack, char *certfile)
|
||||||
{
|
{
|
||||||
BIO *in = NULL;
|
BIO *in=NULL;
|
||||||
int count = 0;
|
int count=0;
|
||||||
int ret = -1;
|
int ret= -1;
|
||||||
STACK_OF(X509_INFO) *sk = NULL;
|
STACK_OF(X509_INFO) *sk=NULL;
|
||||||
X509_INFO *xi;
|
X509_INFO *xi;
|
||||||
|
|
||||||
in = BIO_new(BIO_s_file());
|
in=BIO_new(BIO_s_file());
|
||||||
if ((in == NULL) || (BIO_read_filename(in, certfile) <= 0)) {
|
if ((in == NULL) || (BIO_read_filename(in,certfile) <= 0))
|
||||||
BIO_printf(bio_err, "error opening the file, %s\n", certfile);
|
{
|
||||||
goto end;
|
BIO_printf(bio_err,"error opening the file, %s\n",certfile);
|
||||||
}
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
/* This loads from a file, a stack of x509/crl/pkey sets */
|
/* This loads from a file, a stack of x509/crl/pkey sets */
|
||||||
sk = PEM_X509_INFO_read_bio(in, NULL, NULL, NULL);
|
sk=PEM_X509_INFO_read_bio(in,NULL,NULL,NULL);
|
||||||
if (sk == NULL) {
|
if (sk == NULL) {
|
||||||
BIO_printf(bio_err, "error reading the file, %s\n", certfile);
|
BIO_printf(bio_err,"error reading the file, %s\n",certfile);
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* scan over it and pull out the CRL's */
|
/* scan over it and pull out the CRL's */
|
||||||
while (sk_X509_INFO_num(sk)) {
|
while (sk_X509_INFO_num(sk))
|
||||||
xi = sk_X509_INFO_shift(sk);
|
{
|
||||||
if (xi->x509 != NULL) {
|
xi=sk_X509_INFO_shift(sk);
|
||||||
sk_X509_push(stack, xi->x509);
|
if (xi->x509 != NULL)
|
||||||
xi->x509 = NULL;
|
{
|
||||||
count++;
|
sk_X509_push(stack,xi->x509);
|
||||||
}
|
xi->x509=NULL;
|
||||||
X509_INFO_free(xi);
|
count++;
|
||||||
}
|
}
|
||||||
|
X509_INFO_free(xi);
|
||||||
|
}
|
||||||
|
|
||||||
|
ret=count;
|
||||||
|
end:
|
||||||
|
/* never need to OPENSSL_free x */
|
||||||
|
if (in != NULL) BIO_free(in);
|
||||||
|
if (sk != NULL) sk_X509_INFO_free(sk);
|
||||||
|
return(ret);
|
||||||
|
}
|
||||||
|
|
||||||
ret = count;
|
|
||||||
end:
|
|
||||||
/* never need to OPENSSL_free x */
|
|
||||||
if (in != NULL)
|
|
||||||
BIO_free(in);
|
|
||||||
if (sk != NULL)
|
|
||||||
sk_X509_INFO_free(sk);
|
|
||||||
return (ret);
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,6 +0,0 @@
|
|||||||
# This is a file that will be filled by the openssl srp routine.
|
|
||||||
# You can initialize the file with additional groups, these are
|
|
||||||
# records starting with a I followed by the g and N values and the id.
|
|
||||||
# The exact values ... you have to dig this out from the source of srp.c
|
|
||||||
# or srp_vfy.c
|
|
||||||
# The last value of an I is used as the default group for new users.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
unique_subject = yes
|
|
||||||
996
apps/dgst.c
996
apps/dgst.c
File diff suppressed because it is too large
Load Diff
506
apps/dh.c
506
apps/dh.c
@@ -57,29 +57,28 @@
|
|||||||
* [including the GNU Public Licence.]
|
* [including the GNU Public Licence.]
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <openssl/opensslconf.h> /* for OPENSSL_NO_DH */
|
#include <openssl/opensslconf.h> /* for OPENSSL_NO_DH */
|
||||||
#ifndef OPENSSL_NO_DH
|
#ifndef OPENSSL_NO_DH
|
||||||
# include <stdio.h>
|
#include <stdio.h>
|
||||||
# include <stdlib.h>
|
#include <stdlib.h>
|
||||||
# include <time.h>
|
#include <time.h>
|
||||||
# include <string.h>
|
#include <string.h>
|
||||||
# include "apps.h"
|
#include "apps.h"
|
||||||
# include <openssl/bio.h>
|
#include <openssl/bio.h>
|
||||||
# include <openssl/err.h>
|
#include <openssl/err.h>
|
||||||
# include <openssl/bn.h>
|
#include <openssl/bn.h>
|
||||||
# include <openssl/dh.h>
|
#include <openssl/dh.h>
|
||||||
# include <openssl/x509.h>
|
#include <openssl/x509.h>
|
||||||
# include <openssl/pem.h>
|
#include <openssl/pem.h>
|
||||||
|
|
||||||
# undef PROG
|
#undef PROG
|
||||||
# define PROG dh_main
|
#define PROG dh_main
|
||||||
|
|
||||||
/*-
|
/* -inform arg - input format - default PEM (DER or PEM)
|
||||||
* -inform arg - input format - default PEM (DER or PEM)
|
|
||||||
* -outform arg - output format - default PEM
|
* -outform arg - output format - default PEM
|
||||||
* -in arg - input file - default stdin
|
* -in arg - input file - default stdin
|
||||||
* -out arg - output file - default stdout
|
* -out arg - output file - default stdout
|
||||||
* -check - check the parameters are ok
|
* -check - check the parameters are ok
|
||||||
* -noout
|
* -noout
|
||||||
* -text
|
* -text
|
||||||
* -C
|
* -C
|
||||||
@@ -88,250 +87,269 @@
|
|||||||
int MAIN(int, char **);
|
int MAIN(int, char **);
|
||||||
|
|
||||||
int MAIN(int argc, char **argv)
|
int MAIN(int argc, char **argv)
|
||||||
{
|
{
|
||||||
DH *dh = NULL;
|
DH *dh=NULL;
|
||||||
int i, badops = 0, text = 0;
|
int i,badops=0,text=0;
|
||||||
BIO *in = NULL, *out = NULL;
|
BIO *in=NULL,*out=NULL;
|
||||||
int informat, outformat, check = 0, noout = 0, C = 0, ret = 1;
|
int informat,outformat,check=0,noout=0,C=0,ret=1;
|
||||||
char *infile, *outfile, *prog;
|
char *infile,*outfile,*prog;
|
||||||
# ifndef OPENSSL_NO_ENGINE
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
char *engine;
|
char *engine;
|
||||||
# endif
|
#endif
|
||||||
|
|
||||||
apps_startup();
|
apps_startup();
|
||||||
|
|
||||||
if (bio_err == NULL)
|
if (bio_err == NULL)
|
||||||
if ((bio_err = BIO_new(BIO_s_file())) != NULL)
|
if ((bio_err=BIO_new(BIO_s_file())) != NULL)
|
||||||
BIO_set_fp(bio_err, stderr, BIO_NOCLOSE | BIO_FP_TEXT);
|
BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT);
|
||||||
|
|
||||||
if (!load_config(bio_err, NULL))
|
if (!load_config(bio_err, NULL))
|
||||||
goto end;
|
goto end;
|
||||||
|
|
||||||
# ifndef OPENSSL_NO_ENGINE
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
engine = NULL;
|
engine=NULL;
|
||||||
# endif
|
#endif
|
||||||
infile = NULL;
|
infile=NULL;
|
||||||
outfile = NULL;
|
outfile=NULL;
|
||||||
informat = FORMAT_PEM;
|
informat=FORMAT_PEM;
|
||||||
outformat = FORMAT_PEM;
|
outformat=FORMAT_PEM;
|
||||||
|
|
||||||
prog = argv[0];
|
prog=argv[0];
|
||||||
argc--;
|
argc--;
|
||||||
argv++;
|
argv++;
|
||||||
while (argc >= 1) {
|
while (argc >= 1)
|
||||||
if (strcmp(*argv, "-inform") == 0) {
|
{
|
||||||
if (--argc < 1)
|
if (strcmp(*argv,"-inform") == 0)
|
||||||
goto bad;
|
{
|
||||||
informat = str2fmt(*(++argv));
|
if (--argc < 1) goto bad;
|
||||||
} else if (strcmp(*argv, "-outform") == 0) {
|
informat=str2fmt(*(++argv));
|
||||||
if (--argc < 1)
|
}
|
||||||
goto bad;
|
else if (strcmp(*argv,"-outform") == 0)
|
||||||
outformat = str2fmt(*(++argv));
|
{
|
||||||
} else if (strcmp(*argv, "-in") == 0) {
|
if (--argc < 1) goto bad;
|
||||||
if (--argc < 1)
|
outformat=str2fmt(*(++argv));
|
||||||
goto bad;
|
}
|
||||||
infile = *(++argv);
|
else if (strcmp(*argv,"-in") == 0)
|
||||||
} else if (strcmp(*argv, "-out") == 0) {
|
{
|
||||||
if (--argc < 1)
|
if (--argc < 1) goto bad;
|
||||||
goto bad;
|
infile= *(++argv);
|
||||||
outfile = *(++argv);
|
}
|
||||||
}
|
else if (strcmp(*argv,"-out") == 0)
|
||||||
# ifndef OPENSSL_NO_ENGINE
|
{
|
||||||
else if (strcmp(*argv, "-engine") == 0) {
|
if (--argc < 1) goto bad;
|
||||||
if (--argc < 1)
|
outfile= *(++argv);
|
||||||
goto bad;
|
}
|
||||||
engine = *(++argv);
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
}
|
else if (strcmp(*argv,"-engine") == 0)
|
||||||
# endif
|
{
|
||||||
else if (strcmp(*argv, "-check") == 0)
|
if (--argc < 1) goto bad;
|
||||||
check = 1;
|
engine= *(++argv);
|
||||||
else if (strcmp(*argv, "-text") == 0)
|
}
|
||||||
text = 1;
|
#endif
|
||||||
else if (strcmp(*argv, "-C") == 0)
|
else if (strcmp(*argv,"-check") == 0)
|
||||||
C = 1;
|
check=1;
|
||||||
else if (strcmp(*argv, "-noout") == 0)
|
else if (strcmp(*argv,"-text") == 0)
|
||||||
noout = 1;
|
text=1;
|
||||||
else {
|
else if (strcmp(*argv,"-C") == 0)
|
||||||
BIO_printf(bio_err, "unknown option %s\n", *argv);
|
C=1;
|
||||||
badops = 1;
|
else if (strcmp(*argv,"-noout") == 0)
|
||||||
break;
|
noout=1;
|
||||||
}
|
else
|
||||||
argc--;
|
{
|
||||||
argv++;
|
BIO_printf(bio_err,"unknown option %s\n",*argv);
|
||||||
}
|
badops=1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
argc--;
|
||||||
|
argv++;
|
||||||
|
}
|
||||||
|
|
||||||
if (badops) {
|
if (badops)
|
||||||
bad:
|
{
|
||||||
BIO_printf(bio_err, "%s [options] <infile >outfile\n", prog);
|
bad:
|
||||||
BIO_printf(bio_err, "where options are\n");
|
BIO_printf(bio_err,"%s [options] <infile >outfile\n",prog);
|
||||||
BIO_printf(bio_err, " -inform arg input format - one of DER PEM\n");
|
BIO_printf(bio_err,"where options are\n");
|
||||||
BIO_printf(bio_err,
|
BIO_printf(bio_err," -inform arg input format - one of DER PEM\n");
|
||||||
" -outform arg output format - one of DER PEM\n");
|
BIO_printf(bio_err," -outform arg output format - one of DER PEM\n");
|
||||||
BIO_printf(bio_err, " -in arg input file\n");
|
BIO_printf(bio_err," -in arg input file\n");
|
||||||
BIO_printf(bio_err, " -out arg output file\n");
|
BIO_printf(bio_err," -out arg output file\n");
|
||||||
BIO_printf(bio_err, " -check check the DH parameters\n");
|
BIO_printf(bio_err," -check check the DH parameters\n");
|
||||||
BIO_printf(bio_err,
|
BIO_printf(bio_err," -text print a text form of the DH parameters\n");
|
||||||
" -text print a text form of the DH parameters\n");
|
BIO_printf(bio_err," -C Output C code\n");
|
||||||
BIO_printf(bio_err, " -C Output C code\n");
|
BIO_printf(bio_err," -noout no output\n");
|
||||||
BIO_printf(bio_err, " -noout no output\n");
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
# ifndef OPENSSL_NO_ENGINE
|
BIO_printf(bio_err," -engine e use engine e, possibly a hardware device.\n");
|
||||||
BIO_printf(bio_err,
|
#endif
|
||||||
" -engine e use engine e, possibly a hardware device.\n");
|
goto end;
|
||||||
# endif
|
}
|
||||||
goto end;
|
|
||||||
}
|
|
||||||
|
|
||||||
ERR_load_crypto_strings();
|
ERR_load_crypto_strings();
|
||||||
|
|
||||||
# ifndef OPENSSL_NO_ENGINE
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
setup_engine(bio_err, engine, 0);
|
setup_engine(bio_err, engine, 0);
|
||||||
# endif
|
#endif
|
||||||
|
|
||||||
in = BIO_new(BIO_s_file());
|
in=BIO_new(BIO_s_file());
|
||||||
out = BIO_new(BIO_s_file());
|
out=BIO_new(BIO_s_file());
|
||||||
if ((in == NULL) || (out == NULL)) {
|
if ((in == NULL) || (out == NULL))
|
||||||
ERR_print_errors(bio_err);
|
{
|
||||||
goto end;
|
ERR_print_errors(bio_err);
|
||||||
}
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
if (infile == NULL)
|
if (infile == NULL)
|
||||||
BIO_set_fp(in, stdin, BIO_NOCLOSE);
|
BIO_set_fp(in,stdin,BIO_NOCLOSE);
|
||||||
else {
|
else
|
||||||
if (BIO_read_filename(in, infile) <= 0) {
|
{
|
||||||
perror(infile);
|
if (BIO_read_filename(in,infile) <= 0)
|
||||||
goto end;
|
{
|
||||||
}
|
perror(infile);
|
||||||
}
|
goto end;
|
||||||
if (outfile == NULL) {
|
}
|
||||||
BIO_set_fp(out, stdout, BIO_NOCLOSE);
|
}
|
||||||
# ifdef OPENSSL_SYS_VMS
|
if (outfile == NULL)
|
||||||
{
|
{
|
||||||
BIO *tmpbio = BIO_new(BIO_f_linebuffer());
|
BIO_set_fp(out,stdout,BIO_NOCLOSE);
|
||||||
out = BIO_push(tmpbio, out);
|
#ifdef OPENSSL_SYS_VMS
|
||||||
}
|
{
|
||||||
# endif
|
BIO *tmpbio = BIO_new(BIO_f_linebuffer());
|
||||||
} else {
|
out = BIO_push(tmpbio, out);
|
||||||
if (BIO_write_filename(out, outfile) <= 0) {
|
}
|
||||||
perror(outfile);
|
#endif
|
||||||
goto end;
|
}
|
||||||
}
|
else
|
||||||
}
|
{
|
||||||
|
if (BIO_write_filename(out,outfile) <= 0)
|
||||||
|
{
|
||||||
|
perror(outfile);
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (informat == FORMAT_ASN1)
|
if (informat == FORMAT_ASN1)
|
||||||
dh = d2i_DHparams_bio(in, NULL);
|
dh=d2i_DHparams_bio(in,NULL);
|
||||||
else if (informat == FORMAT_PEM)
|
else if (informat == FORMAT_PEM)
|
||||||
dh = PEM_read_bio_DHparams(in, NULL, NULL, NULL);
|
dh=PEM_read_bio_DHparams(in,NULL,NULL,NULL);
|
||||||
else {
|
else
|
||||||
BIO_printf(bio_err, "bad input format specified\n");
|
{
|
||||||
goto end;
|
BIO_printf(bio_err,"bad input format specified\n");
|
||||||
}
|
goto end;
|
||||||
if (dh == NULL) {
|
}
|
||||||
BIO_printf(bio_err, "unable to load DH parameters\n");
|
if (dh == NULL)
|
||||||
ERR_print_errors(bio_err);
|
{
|
||||||
goto end;
|
BIO_printf(bio_err,"unable to load DH parameters\n");
|
||||||
}
|
ERR_print_errors(bio_err);
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
if (text) {
|
|
||||||
DHparams_print(out, dh);
|
|
||||||
# ifdef undef
|
|
||||||
printf("p=");
|
|
||||||
BN_print(stdout, dh->p);
|
|
||||||
printf("\ng=");
|
|
||||||
BN_print(stdout, dh->g);
|
|
||||||
printf("\n");
|
|
||||||
if (dh->length != 0)
|
|
||||||
printf("recommended private length=%ld\n", dh->length);
|
|
||||||
# endif
|
|
||||||
}
|
|
||||||
|
|
||||||
if (check) {
|
|
||||||
if (!DH_check(dh, &i)) {
|
|
||||||
ERR_print_errors(bio_err);
|
|
||||||
goto end;
|
|
||||||
}
|
|
||||||
if (i & DH_CHECK_P_NOT_PRIME)
|
|
||||||
printf("p value is not prime\n");
|
|
||||||
if (i & DH_CHECK_P_NOT_SAFE_PRIME)
|
|
||||||
printf("p value is not a safe prime\n");
|
|
||||||
if (i & DH_UNABLE_TO_CHECK_GENERATOR)
|
|
||||||
printf("unable to check the generator value\n");
|
|
||||||
if (i & DH_NOT_SUITABLE_GENERATOR)
|
|
||||||
printf("the g value is not a generator\n");
|
|
||||||
if (i == 0)
|
|
||||||
printf("DH parameters appear to be ok.\n");
|
|
||||||
}
|
|
||||||
if (C) {
|
|
||||||
unsigned char *data;
|
|
||||||
int len, l, bits;
|
|
||||||
|
|
||||||
len = BN_num_bytes(dh->p);
|
if (text)
|
||||||
bits = BN_num_bits(dh->p);
|
{
|
||||||
data = (unsigned char *)OPENSSL_malloc(len);
|
DHparams_print(out,dh);
|
||||||
if (data == NULL) {
|
#ifdef undef
|
||||||
perror("OPENSSL_malloc");
|
printf("p=");
|
||||||
goto end;
|
BN_print(stdout,dh->p);
|
||||||
}
|
printf("\ng=");
|
||||||
l = BN_bn2bin(dh->p, data);
|
BN_print(stdout,dh->g);
|
||||||
printf("static unsigned char dh%d_p[]={", bits);
|
printf("\n");
|
||||||
for (i = 0; i < l; i++) {
|
if (dh->length != 0)
|
||||||
if ((i % 12) == 0)
|
printf("recommended private length=%ld\n",dh->length);
|
||||||
printf("\n\t");
|
#endif
|
||||||
printf("0x%02X,", data[i]);
|
}
|
||||||
}
|
|
||||||
printf("\n\t};\n");
|
|
||||||
|
|
||||||
l = BN_bn2bin(dh->g, data);
|
if (check)
|
||||||
printf("static unsigned char dh%d_g[]={", bits);
|
{
|
||||||
for (i = 0; i < l; i++) {
|
if (!DH_check(dh,&i))
|
||||||
if ((i % 12) == 0)
|
{
|
||||||
printf("\n\t");
|
ERR_print_errors(bio_err);
|
||||||
printf("0x%02X,", data[i]);
|
goto end;
|
||||||
}
|
}
|
||||||
printf("\n\t};\n\n");
|
if (i & DH_CHECK_P_NOT_PRIME)
|
||||||
|
printf("p value is not prime\n");
|
||||||
|
if (i & DH_CHECK_P_NOT_SAFE_PRIME)
|
||||||
|
printf("p value is not a safe prime\n");
|
||||||
|
if (i & DH_UNABLE_TO_CHECK_GENERATOR)
|
||||||
|
printf("unable to check the generator value\n");
|
||||||
|
if (i & DH_NOT_SUITABLE_GENERATOR)
|
||||||
|
printf("the g value is not a generator\n");
|
||||||
|
if (i == 0)
|
||||||
|
printf("DH parameters appear to be ok.\n");
|
||||||
|
}
|
||||||
|
if (C)
|
||||||
|
{
|
||||||
|
unsigned char *data;
|
||||||
|
int len,l,bits;
|
||||||
|
|
||||||
printf("DH *get_dh%d()\n\t{\n", bits);
|
len=BN_num_bytes(dh->p);
|
||||||
printf("\tDH *dh;\n\n");
|
bits=BN_num_bits(dh->p);
|
||||||
printf("\tif ((dh=DH_new()) == NULL) return(NULL);\n");
|
data=(unsigned char *)OPENSSL_malloc(len);
|
||||||
printf("\tdh->p=BN_bin2bn(dh%d_p,sizeof(dh%d_p),NULL);\n",
|
if (data == NULL)
|
||||||
bits, bits);
|
{
|
||||||
printf("\tdh->g=BN_bin2bn(dh%d_g,sizeof(dh%d_g),NULL);\n",
|
perror("OPENSSL_malloc");
|
||||||
bits, bits);
|
goto end;
|
||||||
printf("\tif ((dh->p == NULL) || (dh->g == NULL))\n");
|
}
|
||||||
printf("\t\treturn(NULL);\n");
|
l=BN_bn2bin(dh->p,data);
|
||||||
printf("\treturn(dh);\n\t}\n");
|
printf("static unsigned char dh%d_p[]={",bits);
|
||||||
OPENSSL_free(data);
|
for (i=0; i<l; i++)
|
||||||
}
|
{
|
||||||
|
if ((i%12) == 0) printf("\n\t");
|
||||||
|
printf("0x%02X,",data[i]);
|
||||||
|
}
|
||||||
|
printf("\n\t};\n");
|
||||||
|
|
||||||
if (!noout) {
|
l=BN_bn2bin(dh->g,data);
|
||||||
if (outformat == FORMAT_ASN1)
|
printf("static unsigned char dh%d_g[]={",bits);
|
||||||
i = i2d_DHparams_bio(out, dh);
|
for (i=0; i<l; i++)
|
||||||
else if (outformat == FORMAT_PEM)
|
{
|
||||||
i = PEM_write_bio_DHparams(out, dh);
|
if ((i%12) == 0) printf("\n\t");
|
||||||
else {
|
printf("0x%02X,",data[i]);
|
||||||
BIO_printf(bio_err, "bad output format specified for outfile\n");
|
}
|
||||||
goto end;
|
printf("\n\t};\n\n");
|
||||||
}
|
|
||||||
if (!i) {
|
printf("DH *get_dh%d()\n\t{\n",bits);
|
||||||
BIO_printf(bio_err, "unable to write DH parameters\n");
|
printf("\tDH *dh;\n\n");
|
||||||
ERR_print_errors(bio_err);
|
printf("\tif ((dh=DH_new()) == NULL) return(NULL);\n");
|
||||||
goto end;
|
printf("\tdh->p=BN_bin2bn(dh%d_p,sizeof(dh%d_p),NULL);\n",
|
||||||
}
|
bits,bits);
|
||||||
}
|
printf("\tdh->g=BN_bin2bn(dh%d_g,sizeof(dh%d_g),NULL);\n",
|
||||||
ret = 0;
|
bits,bits);
|
||||||
end:
|
printf("\tif ((dh->p == NULL) || (dh->g == NULL))\n");
|
||||||
if (in != NULL)
|
printf("\t\treturn(NULL);\n");
|
||||||
BIO_free(in);
|
printf("\treturn(dh);\n\t}\n");
|
||||||
if (out != NULL)
|
OPENSSL_free(data);
|
||||||
BIO_free_all(out);
|
}
|
||||||
if (dh != NULL)
|
|
||||||
DH_free(dh);
|
|
||||||
apps_shutdown();
|
if (!noout)
|
||||||
OPENSSL_EXIT(ret);
|
{
|
||||||
}
|
if (outformat == FORMAT_ASN1)
|
||||||
#else /* !OPENSSL_NO_DH */
|
i=i2d_DHparams_bio(out,dh);
|
||||||
|
else if (outformat == FORMAT_PEM)
|
||||||
|
i=PEM_write_bio_DHparams(out,dh);
|
||||||
|
else {
|
||||||
|
BIO_printf(bio_err,"bad output format specified for outfile\n");
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
if (!i)
|
||||||
|
{
|
||||||
|
BIO_printf(bio_err,"unable to write DH parameters\n");
|
||||||
|
ERR_print_errors(bio_err);
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ret=0;
|
||||||
|
end:
|
||||||
|
if (in != NULL) BIO_free(in);
|
||||||
|
if (out != NULL) BIO_free_all(out);
|
||||||
|
if (dh != NULL) DH_free(dh);
|
||||||
|
apps_shutdown();
|
||||||
|
OPENSSL_EXIT(ret);
|
||||||
|
}
|
||||||
|
#else /* !OPENSSL_NO_DH */
|
||||||
|
|
||||||
# if PEDANTIC
|
# if PEDANTIC
|
||||||
static void *dummy = &dummy;
|
static void *dummy=&dummy;
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
765
apps/dhparam.c
765
apps/dhparam.c
@@ -109,36 +109,35 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <openssl/opensslconf.h> /* for OPENSSL_NO_DH */
|
#include <openssl/opensslconf.h> /* for OPENSSL_NO_DH */
|
||||||
#ifndef OPENSSL_NO_DH
|
#ifndef OPENSSL_NO_DH
|
||||||
# include <stdio.h>
|
#include <stdio.h>
|
||||||
# include <stdlib.h>
|
#include <stdlib.h>
|
||||||
# include <time.h>
|
#include <time.h>
|
||||||
# include <string.h>
|
#include <string.h>
|
||||||
# include "apps.h"
|
#include "apps.h"
|
||||||
# include <openssl/bio.h>
|
#include <openssl/bio.h>
|
||||||
# include <openssl/err.h>
|
#include <openssl/err.h>
|
||||||
# include <openssl/bn.h>
|
#include <openssl/bn.h>
|
||||||
# include <openssl/dh.h>
|
#include <openssl/dh.h>
|
||||||
# include <openssl/x509.h>
|
#include <openssl/x509.h>
|
||||||
# include <openssl/pem.h>
|
#include <openssl/pem.h>
|
||||||
|
|
||||||
# ifndef OPENSSL_NO_DSA
|
#ifndef OPENSSL_NO_DSA
|
||||||
# include <openssl/dsa.h>
|
#include <openssl/dsa.h>
|
||||||
# endif
|
#endif
|
||||||
|
|
||||||
# undef PROG
|
#undef PROG
|
||||||
# define PROG dhparam_main
|
#define PROG dhparam_main
|
||||||
|
|
||||||
# define DEFBITS 2048
|
#define DEFBITS 512
|
||||||
|
|
||||||
/*-
|
/* -inform arg - input format - default PEM (DER or PEM)
|
||||||
* -inform arg - input format - default PEM (DER or PEM)
|
|
||||||
* -outform arg - output format - default PEM
|
* -outform arg - output format - default PEM
|
||||||
* -in arg - input file - default stdin
|
* -in arg - input file - default stdin
|
||||||
* -out arg - output file - default stdout
|
* -out arg - output file - default stdout
|
||||||
* -dsaparam - read or generate DSA parameters, convert to DH
|
* -dsaparam - read or generate DSA parameters, convert to DH
|
||||||
* -check - check the parameters are ok
|
* -check - check the parameters are ok
|
||||||
* -noout
|
* -noout
|
||||||
* -text
|
* -text
|
||||||
* -C
|
* -C
|
||||||
@@ -149,395 +148,413 @@ static int MS_CALLBACK dh_cb(int p, int n, BN_GENCB *cb);
|
|||||||
int MAIN(int, char **);
|
int MAIN(int, char **);
|
||||||
|
|
||||||
int MAIN(int argc, char **argv)
|
int MAIN(int argc, char **argv)
|
||||||
{
|
{
|
||||||
DH *dh = NULL;
|
DH *dh=NULL;
|
||||||
int i, badops = 0, text = 0;
|
int i,badops=0,text=0;
|
||||||
# ifndef OPENSSL_NO_DSA
|
#ifndef OPENSSL_NO_DSA
|
||||||
int dsaparam = 0;
|
int dsaparam=0;
|
||||||
# endif
|
#endif
|
||||||
BIO *in = NULL, *out = NULL;
|
BIO *in=NULL,*out=NULL;
|
||||||
int informat, outformat, check = 0, noout = 0, C = 0, ret = 1;
|
int informat,outformat,check=0,noout=0,C=0,ret=1;
|
||||||
char *infile, *outfile, *prog;
|
char *infile,*outfile,*prog;
|
||||||
char *inrand = NULL;
|
char *inrand=NULL;
|
||||||
# ifndef OPENSSL_NO_ENGINE
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
char *engine = NULL;
|
char *engine=NULL;
|
||||||
# endif
|
#endif
|
||||||
int num = 0, g = 0;
|
int num = 0, g = 0;
|
||||||
|
|
||||||
apps_startup();
|
apps_startup();
|
||||||
|
|
||||||
if (bio_err == NULL)
|
if (bio_err == NULL)
|
||||||
if ((bio_err = BIO_new(BIO_s_file())) != NULL)
|
if ((bio_err=BIO_new(BIO_s_file())) != NULL)
|
||||||
BIO_set_fp(bio_err, stderr, BIO_NOCLOSE | BIO_FP_TEXT);
|
BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT);
|
||||||
|
|
||||||
if (!load_config(bio_err, NULL))
|
if (!load_config(bio_err, NULL))
|
||||||
goto end;
|
goto end;
|
||||||
|
|
||||||
infile = NULL;
|
infile=NULL;
|
||||||
outfile = NULL;
|
outfile=NULL;
|
||||||
informat = FORMAT_PEM;
|
informat=FORMAT_PEM;
|
||||||
outformat = FORMAT_PEM;
|
outformat=FORMAT_PEM;
|
||||||
|
|
||||||
prog = argv[0];
|
prog=argv[0];
|
||||||
argc--;
|
argc--;
|
||||||
argv++;
|
argv++;
|
||||||
while (argc >= 1) {
|
while (argc >= 1)
|
||||||
if (strcmp(*argv, "-inform") == 0) {
|
{
|
||||||
if (--argc < 1)
|
if (strcmp(*argv,"-inform") == 0)
|
||||||
goto bad;
|
{
|
||||||
informat = str2fmt(*(++argv));
|
if (--argc < 1) goto bad;
|
||||||
} else if (strcmp(*argv, "-outform") == 0) {
|
informat=str2fmt(*(++argv));
|
||||||
if (--argc < 1)
|
}
|
||||||
goto bad;
|
else if (strcmp(*argv,"-outform") == 0)
|
||||||
outformat = str2fmt(*(++argv));
|
{
|
||||||
} else if (strcmp(*argv, "-in") == 0) {
|
if (--argc < 1) goto bad;
|
||||||
if (--argc < 1)
|
outformat=str2fmt(*(++argv));
|
||||||
goto bad;
|
}
|
||||||
infile = *(++argv);
|
else if (strcmp(*argv,"-in") == 0)
|
||||||
} else if (strcmp(*argv, "-out") == 0) {
|
{
|
||||||
if (--argc < 1)
|
if (--argc < 1) goto bad;
|
||||||
goto bad;
|
infile= *(++argv);
|
||||||
outfile = *(++argv);
|
}
|
||||||
}
|
else if (strcmp(*argv,"-out") == 0)
|
||||||
# ifndef OPENSSL_NO_ENGINE
|
{
|
||||||
else if (strcmp(*argv, "-engine") == 0) {
|
if (--argc < 1) goto bad;
|
||||||
if (--argc < 1)
|
outfile= *(++argv);
|
||||||
goto bad;
|
}
|
||||||
engine = *(++argv);
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
}
|
else if (strcmp(*argv,"-engine") == 0)
|
||||||
# endif
|
{
|
||||||
else if (strcmp(*argv, "-check") == 0)
|
if (--argc < 1) goto bad;
|
||||||
check = 1;
|
engine= *(++argv);
|
||||||
else if (strcmp(*argv, "-text") == 0)
|
}
|
||||||
text = 1;
|
#endif
|
||||||
# ifndef OPENSSL_NO_DSA
|
else if (strcmp(*argv,"-check") == 0)
|
||||||
else if (strcmp(*argv, "-dsaparam") == 0)
|
check=1;
|
||||||
dsaparam = 1;
|
else if (strcmp(*argv,"-text") == 0)
|
||||||
# endif
|
text=1;
|
||||||
else if (strcmp(*argv, "-C") == 0)
|
#ifndef OPENSSL_NO_DSA
|
||||||
C = 1;
|
else if (strcmp(*argv,"-dsaparam") == 0)
|
||||||
else if (strcmp(*argv, "-noout") == 0)
|
dsaparam=1;
|
||||||
noout = 1;
|
#endif
|
||||||
else if (strcmp(*argv, "-2") == 0)
|
else if (strcmp(*argv,"-C") == 0)
|
||||||
g = 2;
|
C=1;
|
||||||
else if (strcmp(*argv, "-5") == 0)
|
else if (strcmp(*argv,"-noout") == 0)
|
||||||
g = 5;
|
noout=1;
|
||||||
else if (strcmp(*argv, "-rand") == 0) {
|
else if (strcmp(*argv,"-2") == 0)
|
||||||
if (--argc < 1)
|
g=2;
|
||||||
goto bad;
|
else if (strcmp(*argv,"-5") == 0)
|
||||||
inrand = *(++argv);
|
g=5;
|
||||||
} else if (((sscanf(*argv, "%d", &num) == 0) || (num <= 0)))
|
else if (strcmp(*argv,"-rand") == 0)
|
||||||
goto bad;
|
{
|
||||||
argv++;
|
if (--argc < 1) goto bad;
|
||||||
argc--;
|
inrand= *(++argv);
|
||||||
}
|
}
|
||||||
|
else if (((sscanf(*argv,"%d",&num) == 0) || (num <= 0)))
|
||||||
|
goto bad;
|
||||||
|
argv++;
|
||||||
|
argc--;
|
||||||
|
}
|
||||||
|
|
||||||
if (badops) {
|
if (badops)
|
||||||
bad:
|
{
|
||||||
BIO_printf(bio_err, "%s [options] [numbits]\n", prog);
|
bad:
|
||||||
BIO_printf(bio_err, "where options are\n");
|
BIO_printf(bio_err,"%s [options] [numbits]\n",prog);
|
||||||
BIO_printf(bio_err, " -inform arg input format - one of DER PEM\n");
|
BIO_printf(bio_err,"where options are\n");
|
||||||
BIO_printf(bio_err,
|
BIO_printf(bio_err," -inform arg input format - one of DER PEM\n");
|
||||||
" -outform arg output format - one of DER PEM\n");
|
BIO_printf(bio_err," -outform arg output format - one of DER PEM\n");
|
||||||
BIO_printf(bio_err, " -in arg input file\n");
|
BIO_printf(bio_err," -in arg input file\n");
|
||||||
BIO_printf(bio_err, " -out arg output file\n");
|
BIO_printf(bio_err," -out arg output file\n");
|
||||||
# ifndef OPENSSL_NO_DSA
|
#ifndef OPENSSL_NO_DSA
|
||||||
BIO_printf(bio_err,
|
BIO_printf(bio_err," -dsaparam read or generate DSA parameters, convert to DH\n");
|
||||||
" -dsaparam read or generate DSA parameters, convert to DH\n");
|
#endif
|
||||||
# endif
|
BIO_printf(bio_err," -check check the DH parameters\n");
|
||||||
BIO_printf(bio_err, " -check check the DH parameters\n");
|
BIO_printf(bio_err," -text print a text form of the DH parameters\n");
|
||||||
BIO_printf(bio_err,
|
BIO_printf(bio_err," -C Output C code\n");
|
||||||
" -text print a text form of the DH parameters\n");
|
BIO_printf(bio_err," -2 generate parameters using 2 as the generator value\n");
|
||||||
BIO_printf(bio_err, " -C Output C code\n");
|
BIO_printf(bio_err," -5 generate parameters using 5 as the generator value\n");
|
||||||
BIO_printf(bio_err,
|
BIO_printf(bio_err," numbits number of bits in to generate (default 512)\n");
|
||||||
" -2 generate parameters using 2 as the generator value\n");
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
BIO_printf(bio_err,
|
BIO_printf(bio_err," -engine e use engine e, possibly a hardware device.\n");
|
||||||
" -5 generate parameters using 5 as the generator value\n");
|
#endif
|
||||||
BIO_printf(bio_err,
|
BIO_printf(bio_err," -rand file%cfile%c...\n", LIST_SEPARATOR_CHAR, LIST_SEPARATOR_CHAR);
|
||||||
" numbits number of bits in to generate (default 2048)\n");
|
BIO_printf(bio_err," - load the file (or the files in the directory) into\n");
|
||||||
# ifndef OPENSSL_NO_ENGINE
|
BIO_printf(bio_err," the random number generator\n");
|
||||||
BIO_printf(bio_err,
|
BIO_printf(bio_err," -noout no output\n");
|
||||||
" -engine e use engine e, possibly a hardware device.\n");
|
goto end;
|
||||||
# endif
|
}
|
||||||
BIO_printf(bio_err, " -rand file%cfile%c...\n", LIST_SEPARATOR_CHAR,
|
|
||||||
LIST_SEPARATOR_CHAR);
|
|
||||||
BIO_printf(bio_err,
|
|
||||||
" - load the file (or the files in the directory) into\n");
|
|
||||||
BIO_printf(bio_err, " the random number generator\n");
|
|
||||||
BIO_printf(bio_err, " -noout no output\n");
|
|
||||||
goto end;
|
|
||||||
}
|
|
||||||
|
|
||||||
ERR_load_crypto_strings();
|
ERR_load_crypto_strings();
|
||||||
|
|
||||||
# ifndef OPENSSL_NO_ENGINE
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
setup_engine(bio_err, engine, 0);
|
setup_engine(bio_err, engine, 0);
|
||||||
# endif
|
#endif
|
||||||
|
|
||||||
if (g && !num)
|
if (g && !num)
|
||||||
num = DEFBITS;
|
num = DEFBITS;
|
||||||
|
|
||||||
# ifndef OPENSSL_NO_DSA
|
#ifndef OPENSSL_NO_DSA
|
||||||
if (dsaparam) {
|
if (dsaparam)
|
||||||
if (g) {
|
{
|
||||||
BIO_printf(bio_err,
|
if (g)
|
||||||
"generator may not be chosen for DSA parameters\n");
|
{
|
||||||
goto end;
|
BIO_printf(bio_err, "generator may not be chosen for DSA parameters\n");
|
||||||
}
|
goto end;
|
||||||
} else
|
}
|
||||||
# endif
|
}
|
||||||
{
|
else
|
||||||
/* DH parameters */
|
#endif
|
||||||
if (num && !g)
|
{
|
||||||
g = 2;
|
/* DH parameters */
|
||||||
}
|
if (num && !g)
|
||||||
|
g = 2;
|
||||||
|
}
|
||||||
|
|
||||||
if (num) {
|
if(num) {
|
||||||
|
|
||||||
BN_GENCB cb;
|
BN_GENCB cb;
|
||||||
BN_GENCB_set(&cb, dh_cb, bio_err);
|
BN_GENCB_set(&cb, dh_cb, bio_err);
|
||||||
if (!app_RAND_load_file(NULL, bio_err, 1) && inrand == NULL) {
|
if (!app_RAND_load_file(NULL, bio_err, 1) && inrand == NULL)
|
||||||
BIO_printf(bio_err,
|
{
|
||||||
"warning, not much extra random data, consider using the -rand option\n");
|
BIO_printf(bio_err,"warning, not much extra random data, consider using the -rand option\n");
|
||||||
}
|
}
|
||||||
if (inrand != NULL)
|
if (inrand != NULL)
|
||||||
BIO_printf(bio_err, "%ld semi-random bytes loaded\n",
|
BIO_printf(bio_err,"%ld semi-random bytes loaded\n",
|
||||||
app_RAND_load_files(inrand));
|
app_RAND_load_files(inrand));
|
||||||
|
|
||||||
# ifndef OPENSSL_NO_DSA
|
#ifndef OPENSSL_NO_DSA
|
||||||
if (dsaparam) {
|
if (dsaparam)
|
||||||
DSA *dsa = DSA_new();
|
{
|
||||||
|
DSA *dsa = DSA_new();
|
||||||
|
|
||||||
BIO_printf(bio_err,
|
BIO_printf(bio_err,"Generating DSA parameters, %d bit long prime\n",num);
|
||||||
"Generating DSA parameters, %d bit long prime\n", num);
|
if(!dsa || !DSA_generate_parameters_ex(dsa, num,
|
||||||
if (!dsa
|
NULL, 0, NULL, NULL, &cb))
|
||||||
|| !DSA_generate_parameters_ex(dsa, num, NULL, 0, NULL, NULL,
|
{
|
||||||
&cb)) {
|
if(dsa) DSA_free(dsa);
|
||||||
if (dsa)
|
ERR_print_errors(bio_err);
|
||||||
DSA_free(dsa);
|
goto end;
|
||||||
ERR_print_errors(bio_err);
|
}
|
||||||
goto end;
|
|
||||||
}
|
|
||||||
|
|
||||||
dh = DSA_dup_DH(dsa);
|
dh = DSA_dup_DH(dsa);
|
||||||
DSA_free(dsa);
|
DSA_free(dsa);
|
||||||
if (dh == NULL) {
|
if (dh == NULL)
|
||||||
ERR_print_errors(bio_err);
|
{
|
||||||
goto end;
|
ERR_print_errors(bio_err);
|
||||||
}
|
goto end;
|
||||||
} else
|
}
|
||||||
# endif
|
}
|
||||||
{
|
else
|
||||||
dh = DH_new();
|
#endif
|
||||||
BIO_printf(bio_err,
|
{
|
||||||
"Generating DH parameters, %d bit long safe prime, generator %d\n",
|
dh = DH_new();
|
||||||
num, g);
|
BIO_printf(bio_err,"Generating DH parameters, %d bit long safe prime, generator %d\n",num,g);
|
||||||
BIO_printf(bio_err, "This is going to take a long time\n");
|
BIO_printf(bio_err,"This is going to take a long time\n");
|
||||||
if (!dh || !DH_generate_parameters_ex(dh, num, g, &cb)) {
|
if(!dh || !DH_generate_parameters_ex(dh, num, g, &cb))
|
||||||
ERR_print_errors(bio_err);
|
{
|
||||||
goto end;
|
if(dh) DH_free(dh);
|
||||||
}
|
ERR_print_errors(bio_err);
|
||||||
}
|
goto end;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
app_RAND_write_file(NULL, bio_err);
|
app_RAND_write_file(NULL, bio_err);
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
in = BIO_new(BIO_s_file());
|
in=BIO_new(BIO_s_file());
|
||||||
if (in == NULL) {
|
if (in == NULL)
|
||||||
ERR_print_errors(bio_err);
|
{
|
||||||
goto end;
|
ERR_print_errors(bio_err);
|
||||||
}
|
goto end;
|
||||||
if (infile == NULL)
|
}
|
||||||
BIO_set_fp(in, stdin, BIO_NOCLOSE);
|
if (infile == NULL)
|
||||||
else {
|
BIO_set_fp(in,stdin,BIO_NOCLOSE);
|
||||||
if (BIO_read_filename(in, infile) <= 0) {
|
else
|
||||||
perror(infile);
|
{
|
||||||
goto end;
|
if (BIO_read_filename(in,infile) <= 0)
|
||||||
}
|
{
|
||||||
}
|
perror(infile);
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (informat != FORMAT_ASN1 && informat != FORMAT_PEM) {
|
if (informat != FORMAT_ASN1 && informat != FORMAT_PEM)
|
||||||
BIO_printf(bio_err, "bad input format specified\n");
|
{
|
||||||
goto end;
|
BIO_printf(bio_err,"bad input format specified\n");
|
||||||
}
|
goto end;
|
||||||
# ifndef OPENSSL_NO_DSA
|
}
|
||||||
if (dsaparam) {
|
|
||||||
DSA *dsa;
|
|
||||||
|
|
||||||
if (informat == FORMAT_ASN1)
|
#ifndef OPENSSL_NO_DSA
|
||||||
dsa = d2i_DSAparams_bio(in, NULL);
|
if (dsaparam)
|
||||||
else /* informat == FORMAT_PEM */
|
{
|
||||||
dsa = PEM_read_bio_DSAparams(in, NULL, NULL, NULL);
|
DSA *dsa;
|
||||||
|
|
||||||
if (dsa == NULL) {
|
if (informat == FORMAT_ASN1)
|
||||||
BIO_printf(bio_err, "unable to load DSA parameters\n");
|
dsa=d2i_DSAparams_bio(in,NULL);
|
||||||
ERR_print_errors(bio_err);
|
else /* informat == FORMAT_PEM */
|
||||||
goto end;
|
dsa=PEM_read_bio_DSAparams(in,NULL,NULL,NULL);
|
||||||
}
|
|
||||||
|
|
||||||
dh = DSA_dup_DH(dsa);
|
if (dsa == NULL)
|
||||||
DSA_free(dsa);
|
{
|
||||||
if (dh == NULL) {
|
BIO_printf(bio_err,"unable to load DSA parameters\n");
|
||||||
ERR_print_errors(bio_err);
|
ERR_print_errors(bio_err);
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
} else
|
|
||||||
# endif
|
|
||||||
{
|
|
||||||
if (informat == FORMAT_ASN1)
|
|
||||||
dh = d2i_DHparams_bio(in, NULL);
|
|
||||||
else /* informat == FORMAT_PEM */
|
|
||||||
dh = PEM_read_bio_DHparams(in, NULL, NULL, NULL);
|
|
||||||
|
|
||||||
if (dh == NULL) {
|
dh = DSA_dup_DH(dsa);
|
||||||
BIO_printf(bio_err, "unable to load DH parameters\n");
|
DSA_free(dsa);
|
||||||
ERR_print_errors(bio_err);
|
if (dh == NULL)
|
||||||
goto end;
|
{
|
||||||
}
|
ERR_print_errors(bio_err);
|
||||||
}
|
goto end;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
if (informat == FORMAT_ASN1)
|
||||||
|
dh=d2i_DHparams_bio(in,NULL);
|
||||||
|
else /* informat == FORMAT_PEM */
|
||||||
|
dh=PEM_read_bio_DHparams(in,NULL,NULL,NULL);
|
||||||
|
|
||||||
/* dh != NULL */
|
if (dh == NULL)
|
||||||
}
|
{
|
||||||
|
BIO_printf(bio_err,"unable to load DH parameters\n");
|
||||||
|
ERR_print_errors(bio_err);
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
out = BIO_new(BIO_s_file());
|
/* dh != NULL */
|
||||||
if (out == NULL) {
|
}
|
||||||
ERR_print_errors(bio_err);
|
|
||||||
goto end;
|
|
||||||
}
|
|
||||||
if (outfile == NULL) {
|
|
||||||
BIO_set_fp(out, stdout, BIO_NOCLOSE);
|
|
||||||
# ifdef OPENSSL_SYS_VMS
|
|
||||||
{
|
|
||||||
BIO *tmpbio = BIO_new(BIO_f_linebuffer());
|
|
||||||
out = BIO_push(tmpbio, out);
|
|
||||||
}
|
|
||||||
# endif
|
|
||||||
} else {
|
|
||||||
if (BIO_write_filename(out, outfile) <= 0) {
|
|
||||||
perror(outfile);
|
|
||||||
goto end;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (text) {
|
out=BIO_new(BIO_s_file());
|
||||||
DHparams_print(out, dh);
|
if (out == NULL)
|
||||||
}
|
{
|
||||||
|
ERR_print_errors(bio_err);
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
if (outfile == NULL)
|
||||||
|
{
|
||||||
|
BIO_set_fp(out,stdout,BIO_NOCLOSE);
|
||||||
|
#ifdef OPENSSL_SYS_VMS
|
||||||
|
{
|
||||||
|
BIO *tmpbio = BIO_new(BIO_f_linebuffer());
|
||||||
|
out = BIO_push(tmpbio, out);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (BIO_write_filename(out,outfile) <= 0)
|
||||||
|
{
|
||||||
|
perror(outfile);
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (check) {
|
|
||||||
if (!DH_check(dh, &i)) {
|
|
||||||
ERR_print_errors(bio_err);
|
|
||||||
goto end;
|
|
||||||
}
|
|
||||||
if (i & DH_CHECK_P_NOT_PRIME)
|
|
||||||
printf("p value is not prime\n");
|
|
||||||
if (i & DH_CHECK_P_NOT_SAFE_PRIME)
|
|
||||||
printf("p value is not a safe prime\n");
|
|
||||||
if (i & DH_UNABLE_TO_CHECK_GENERATOR)
|
|
||||||
printf("unable to check the generator value\n");
|
|
||||||
if (i & DH_NOT_SUITABLE_GENERATOR)
|
|
||||||
printf("the g value is not a generator\n");
|
|
||||||
if (i == 0)
|
|
||||||
printf("DH parameters appear to be ok.\n");
|
|
||||||
}
|
|
||||||
if (C) {
|
|
||||||
unsigned char *data;
|
|
||||||
int len, l, bits;
|
|
||||||
|
|
||||||
len = BN_num_bytes(dh->p);
|
if (text)
|
||||||
bits = BN_num_bits(dh->p);
|
{
|
||||||
data = (unsigned char *)OPENSSL_malloc(len);
|
DHparams_print(out,dh);
|
||||||
if (data == NULL) {
|
}
|
||||||
perror("OPENSSL_malloc");
|
|
||||||
goto end;
|
|
||||||
}
|
|
||||||
printf("#ifndef HEADER_DH_H\n"
|
|
||||||
"#include <openssl/dh.h>\n" "#endif\n");
|
|
||||||
printf("DH *get_dh%d()\n\t{\n", bits);
|
|
||||||
|
|
||||||
l = BN_bn2bin(dh->p, data);
|
if (check)
|
||||||
printf("\tstatic unsigned char dh%d_p[]={", bits);
|
{
|
||||||
for (i = 0; i < l; i++) {
|
if (!DH_check(dh,&i))
|
||||||
if ((i % 12) == 0)
|
{
|
||||||
printf("\n\t\t");
|
ERR_print_errors(bio_err);
|
||||||
printf("0x%02X,", data[i]);
|
goto end;
|
||||||
}
|
}
|
||||||
printf("\n\t\t};\n");
|
if (i & DH_CHECK_P_NOT_PRIME)
|
||||||
|
printf("p value is not prime\n");
|
||||||
|
if (i & DH_CHECK_P_NOT_SAFE_PRIME)
|
||||||
|
printf("p value is not a safe prime\n");
|
||||||
|
if (i & DH_UNABLE_TO_CHECK_GENERATOR)
|
||||||
|
printf("unable to check the generator value\n");
|
||||||
|
if (i & DH_NOT_SUITABLE_GENERATOR)
|
||||||
|
printf("the g value is not a generator\n");
|
||||||
|
if (i == 0)
|
||||||
|
printf("DH parameters appear to be ok.\n");
|
||||||
|
}
|
||||||
|
if (C)
|
||||||
|
{
|
||||||
|
unsigned char *data;
|
||||||
|
int len,l,bits;
|
||||||
|
|
||||||
l = BN_bn2bin(dh->g, data);
|
len=BN_num_bytes(dh->p);
|
||||||
printf("\tstatic unsigned char dh%d_g[]={", bits);
|
bits=BN_num_bits(dh->p);
|
||||||
for (i = 0; i < l; i++) {
|
data=(unsigned char *)OPENSSL_malloc(len);
|
||||||
if ((i % 12) == 0)
|
if (data == NULL)
|
||||||
printf("\n\t\t");
|
{
|
||||||
printf("0x%02X,", data[i]);
|
perror("OPENSSL_malloc");
|
||||||
}
|
goto end;
|
||||||
printf("\n\t\t};\n");
|
}
|
||||||
|
printf("#ifndef HEADER_DH_H\n"
|
||||||
|
"#include <openssl/dh.h>\n"
|
||||||
|
"#endif\n");
|
||||||
|
printf("DH *get_dh%d()\n\t{\n",bits);
|
||||||
|
|
||||||
printf("\tDH *dh;\n\n");
|
l=BN_bn2bin(dh->p,data);
|
||||||
printf("\tif ((dh=DH_new()) == NULL) return(NULL);\n");
|
printf("\tstatic unsigned char dh%d_p[]={",bits);
|
||||||
printf("\tdh->p=BN_bin2bn(dh%d_p,sizeof(dh%d_p),NULL);\n",
|
for (i=0; i<l; i++)
|
||||||
bits, bits);
|
{
|
||||||
printf("\tdh->g=BN_bin2bn(dh%d_g,sizeof(dh%d_g),NULL);\n",
|
if ((i%12) == 0) printf("\n\t\t");
|
||||||
bits, bits);
|
printf("0x%02X,",data[i]);
|
||||||
printf("\tif ((dh->p == NULL) || (dh->g == NULL))\n");
|
}
|
||||||
printf("\t\t{ DH_free(dh); return(NULL); }\n");
|
printf("\n\t\t};\n");
|
||||||
if (dh->length)
|
|
||||||
printf("\tdh->length = %ld;\n", dh->length);
|
|
||||||
printf("\treturn(dh);\n\t}\n");
|
|
||||||
OPENSSL_free(data);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!noout) {
|
l=BN_bn2bin(dh->g,data);
|
||||||
if (outformat == FORMAT_ASN1)
|
printf("\tstatic unsigned char dh%d_g[]={",bits);
|
||||||
i = i2d_DHparams_bio(out, dh);
|
for (i=0; i<l; i++)
|
||||||
else if (outformat == FORMAT_PEM)
|
{
|
||||||
i = PEM_write_bio_DHparams(out, dh);
|
if ((i%12) == 0) printf("\n\t\t");
|
||||||
else {
|
printf("0x%02X,",data[i]);
|
||||||
BIO_printf(bio_err, "bad output format specified for outfile\n");
|
}
|
||||||
goto end;
|
printf("\n\t\t};\n");
|
||||||
}
|
|
||||||
if (!i) {
|
printf("\tDH *dh;\n\n");
|
||||||
BIO_printf(bio_err, "unable to write DH parameters\n");
|
printf("\tif ((dh=DH_new()) == NULL) return(NULL);\n");
|
||||||
ERR_print_errors(bio_err);
|
printf("\tdh->p=BN_bin2bn(dh%d_p,sizeof(dh%d_p),NULL);\n",
|
||||||
goto end;
|
bits,bits);
|
||||||
}
|
printf("\tdh->g=BN_bin2bn(dh%d_g,sizeof(dh%d_g),NULL);\n",
|
||||||
}
|
bits,bits);
|
||||||
ret = 0;
|
printf("\tif ((dh->p == NULL) || (dh->g == NULL))\n");
|
||||||
end:
|
printf("\t\t{ DH_free(dh); return(NULL); }\n");
|
||||||
if (in != NULL)
|
if (dh->length)
|
||||||
BIO_free(in);
|
printf("\tdh->length = %ld;\n", dh->length);
|
||||||
if (out != NULL)
|
printf("\treturn(dh);\n\t}\n");
|
||||||
BIO_free_all(out);
|
OPENSSL_free(data);
|
||||||
if (dh != NULL)
|
}
|
||||||
DH_free(dh);
|
|
||||||
apps_shutdown();
|
|
||||||
OPENSSL_EXIT(ret);
|
if (!noout)
|
||||||
}
|
{
|
||||||
|
if (outformat == FORMAT_ASN1)
|
||||||
|
i=i2d_DHparams_bio(out,dh);
|
||||||
|
else if (outformat == FORMAT_PEM)
|
||||||
|
i=PEM_write_bio_DHparams(out,dh);
|
||||||
|
else {
|
||||||
|
BIO_printf(bio_err,"bad output format specified for outfile\n");
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
if (!i)
|
||||||
|
{
|
||||||
|
BIO_printf(bio_err,"unable to write DH parameters\n");
|
||||||
|
ERR_print_errors(bio_err);
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ret=0;
|
||||||
|
end:
|
||||||
|
if (in != NULL) BIO_free(in);
|
||||||
|
if (out != NULL) BIO_free_all(out);
|
||||||
|
if (dh != NULL) DH_free(dh);
|
||||||
|
apps_shutdown();
|
||||||
|
OPENSSL_EXIT(ret);
|
||||||
|
}
|
||||||
|
|
||||||
/* dh_cb is identical to dsa_cb in apps/dsaparam.c */
|
/* dh_cb is identical to dsa_cb in apps/dsaparam.c */
|
||||||
static int MS_CALLBACK dh_cb(int p, int n, BN_GENCB *cb)
|
static int MS_CALLBACK dh_cb(int p, int n, BN_GENCB *cb)
|
||||||
{
|
{
|
||||||
char c = '*';
|
char c='*';
|
||||||
|
|
||||||
if (p == 0)
|
if (p == 0) c='.';
|
||||||
c = '.';
|
if (p == 1) c='+';
|
||||||
if (p == 1)
|
if (p == 2) c='*';
|
||||||
c = '+';
|
if (p == 3) c='\n';
|
||||||
if (p == 2)
|
BIO_write(cb->arg,&c,1);
|
||||||
c = '*';
|
(void)BIO_flush(cb->arg);
|
||||||
if (p == 3)
|
#ifdef LINT
|
||||||
c = '\n';
|
p=n;
|
||||||
BIO_write(cb->arg, &c, 1);
|
#endif
|
||||||
(void)BIO_flush(cb->arg);
|
return 1;
|
||||||
# ifdef LINT
|
}
|
||||||
p = n;
|
|
||||||
# endif
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
#else /* !OPENSSL_NO_DH */
|
#else /* !OPENSSL_NO_DH */
|
||||||
|
|
||||||
# if PEDANTIC
|
# if PEDANTIC
|
||||||
static void *dummy = &dummy;
|
static void *dummy=&dummy;
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
558
apps/dsa.c
558
apps/dsa.c
@@ -56,319 +56,321 @@
|
|||||||
* [including the GNU Public Licence.]
|
* [including the GNU Public Licence.]
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <openssl/opensslconf.h> /* for OPENSSL_NO_DSA */
|
#include <openssl/opensslconf.h> /* for OPENSSL_NO_DSA */
|
||||||
#ifndef OPENSSL_NO_DSA
|
#ifndef OPENSSL_NO_DSA
|
||||||
# include <stdio.h>
|
#include <stdio.h>
|
||||||
# include <stdlib.h>
|
#include <stdlib.h>
|
||||||
# include <string.h>
|
#include <string.h>
|
||||||
# include <time.h>
|
#include <time.h>
|
||||||
# include "apps.h"
|
#include "apps.h"
|
||||||
# include <openssl/bio.h>
|
#include <openssl/bio.h>
|
||||||
# include <openssl/err.h>
|
#include <openssl/err.h>
|
||||||
# include <openssl/dsa.h>
|
#include <openssl/dsa.h>
|
||||||
# include <openssl/evp.h>
|
#include <openssl/evp.h>
|
||||||
# include <openssl/x509.h>
|
#include <openssl/x509.h>
|
||||||
# include <openssl/pem.h>
|
#include <openssl/pem.h>
|
||||||
# include <openssl/bn.h>
|
#include <openssl/bn.h>
|
||||||
|
|
||||||
# undef PROG
|
#undef PROG
|
||||||
# define PROG dsa_main
|
#define PROG dsa_main
|
||||||
|
|
||||||
/*-
|
/* -inform arg - input format - default PEM (one of DER, NET or PEM)
|
||||||
* -inform arg - input format - default PEM (one of DER, NET or PEM)
|
|
||||||
* -outform arg - output format - default PEM
|
* -outform arg - output format - default PEM
|
||||||
* -in arg - input file - default stdin
|
* -in arg - input file - default stdin
|
||||||
* -out arg - output file - default stdout
|
* -out arg - output file - default stdout
|
||||||
* -des - encrypt output if PEM format with DES in cbc mode
|
* -des - encrypt output if PEM format with DES in cbc mode
|
||||||
* -des3 - encrypt output if PEM format
|
* -des3 - encrypt output if PEM format
|
||||||
* -idea - encrypt output if PEM format
|
* -idea - encrypt output if PEM format
|
||||||
* -aes128 - encrypt output if PEM format
|
* -aes128 - encrypt output if PEM format
|
||||||
* -aes192 - encrypt output if PEM format
|
* -aes192 - encrypt output if PEM format
|
||||||
* -aes256 - encrypt output if PEM format
|
* -aes256 - encrypt output if PEM format
|
||||||
* -camellia128 - encrypt output if PEM format
|
* -camellia128 - encrypt output if PEM format
|
||||||
* -camellia192 - encrypt output if PEM format
|
* -camellia192 - encrypt output if PEM format
|
||||||
* -camellia256 - encrypt output if PEM format
|
* -camellia256 - encrypt output if PEM format
|
||||||
* -seed - encrypt output if PEM format
|
* -seed - encrypt output if PEM format
|
||||||
* -text - print a text version
|
* -text - print a text version
|
||||||
* -modulus - print the DSA public key
|
* -modulus - print the DSA public key
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int MAIN(int, char **);
|
int MAIN(int, char **);
|
||||||
|
|
||||||
int MAIN(int argc, char **argv)
|
int MAIN(int argc, char **argv)
|
||||||
{
|
{
|
||||||
ENGINE *e = NULL;
|
ENGINE *e = NULL;
|
||||||
int ret = 1;
|
int ret=1;
|
||||||
DSA *dsa = NULL;
|
DSA *dsa=NULL;
|
||||||
int i, badops = 0;
|
int i,badops=0;
|
||||||
const EVP_CIPHER *enc = NULL;
|
const EVP_CIPHER *enc=NULL;
|
||||||
BIO *in = NULL, *out = NULL;
|
BIO *in=NULL,*out=NULL;
|
||||||
int informat, outformat, text = 0, noout = 0;
|
int informat,outformat,text=0,noout=0;
|
||||||
int pubin = 0, pubout = 0;
|
int pubin = 0, pubout = 0;
|
||||||
char *infile, *outfile, *prog;
|
char *infile,*outfile,*prog;
|
||||||
# ifndef OPENSSL_NO_ENGINE
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
char *engine;
|
char *engine;
|
||||||
# endif
|
#endif
|
||||||
char *passargin = NULL, *passargout = NULL;
|
char *passargin = NULL, *passargout = NULL;
|
||||||
char *passin = NULL, *passout = NULL;
|
char *passin = NULL, *passout = NULL;
|
||||||
int modulus = 0;
|
int modulus=0;
|
||||||
|
|
||||||
int pvk_encr = 2;
|
int pvk_encr = 2;
|
||||||
|
|
||||||
apps_startup();
|
apps_startup();
|
||||||
|
|
||||||
if (bio_err == NULL)
|
if (bio_err == NULL)
|
||||||
if ((bio_err = BIO_new(BIO_s_file())) != NULL)
|
if ((bio_err=BIO_new(BIO_s_file())) != NULL)
|
||||||
BIO_set_fp(bio_err, stderr, BIO_NOCLOSE | BIO_FP_TEXT);
|
BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT);
|
||||||
|
|
||||||
if (!load_config(bio_err, NULL))
|
if (!load_config(bio_err, NULL))
|
||||||
goto end;
|
goto end;
|
||||||
|
|
||||||
# ifndef OPENSSL_NO_ENGINE
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
engine = NULL;
|
engine=NULL;
|
||||||
# endif
|
#endif
|
||||||
infile = NULL;
|
infile=NULL;
|
||||||
outfile = NULL;
|
outfile=NULL;
|
||||||
informat = FORMAT_PEM;
|
informat=FORMAT_PEM;
|
||||||
outformat = FORMAT_PEM;
|
outformat=FORMAT_PEM;
|
||||||
|
|
||||||
prog = argv[0];
|
prog=argv[0];
|
||||||
argc--;
|
argc--;
|
||||||
argv++;
|
argv++;
|
||||||
while (argc >= 1) {
|
while (argc >= 1)
|
||||||
if (strcmp(*argv, "-inform") == 0) {
|
{
|
||||||
if (--argc < 1)
|
if (strcmp(*argv,"-inform") == 0)
|
||||||
goto bad;
|
{
|
||||||
informat = str2fmt(*(++argv));
|
if (--argc < 1) goto bad;
|
||||||
} else if (strcmp(*argv, "-outform") == 0) {
|
informat=str2fmt(*(++argv));
|
||||||
if (--argc < 1)
|
}
|
||||||
goto bad;
|
else if (strcmp(*argv,"-outform") == 0)
|
||||||
outformat = str2fmt(*(++argv));
|
{
|
||||||
} else if (strcmp(*argv, "-in") == 0) {
|
if (--argc < 1) goto bad;
|
||||||
if (--argc < 1)
|
outformat=str2fmt(*(++argv));
|
||||||
goto bad;
|
}
|
||||||
infile = *(++argv);
|
else if (strcmp(*argv,"-in") == 0)
|
||||||
} else if (strcmp(*argv, "-out") == 0) {
|
{
|
||||||
if (--argc < 1)
|
if (--argc < 1) goto bad;
|
||||||
goto bad;
|
infile= *(++argv);
|
||||||
outfile = *(++argv);
|
}
|
||||||
} else if (strcmp(*argv, "-passin") == 0) {
|
else if (strcmp(*argv,"-out") == 0)
|
||||||
if (--argc < 1)
|
{
|
||||||
goto bad;
|
if (--argc < 1) goto bad;
|
||||||
passargin = *(++argv);
|
outfile= *(++argv);
|
||||||
} else if (strcmp(*argv, "-passout") == 0) {
|
}
|
||||||
if (--argc < 1)
|
else if (strcmp(*argv,"-passin") == 0)
|
||||||
goto bad;
|
{
|
||||||
passargout = *(++argv);
|
if (--argc < 1) goto bad;
|
||||||
}
|
passargin= *(++argv);
|
||||||
# ifndef OPENSSL_NO_ENGINE
|
}
|
||||||
else if (strcmp(*argv, "-engine") == 0) {
|
else if (strcmp(*argv,"-passout") == 0)
|
||||||
if (--argc < 1)
|
{
|
||||||
goto bad;
|
if (--argc < 1) goto bad;
|
||||||
engine = *(++argv);
|
passargout= *(++argv);
|
||||||
}
|
}
|
||||||
# endif
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
else if (strcmp(*argv, "-pvk-strong") == 0)
|
else if (strcmp(*argv,"-engine") == 0)
|
||||||
pvk_encr = 2;
|
{
|
||||||
else if (strcmp(*argv, "-pvk-weak") == 0)
|
if (--argc < 1) goto bad;
|
||||||
pvk_encr = 1;
|
engine= *(++argv);
|
||||||
else if (strcmp(*argv, "-pvk-none") == 0)
|
}
|
||||||
pvk_encr = 0;
|
#endif
|
||||||
else if (strcmp(*argv, "-noout") == 0)
|
else if (strcmp(*argv,"-pvk-strong") == 0)
|
||||||
noout = 1;
|
pvk_encr=2;
|
||||||
else if (strcmp(*argv, "-text") == 0)
|
else if (strcmp(*argv,"-pvk-weak") == 0)
|
||||||
text = 1;
|
pvk_encr=1;
|
||||||
else if (strcmp(*argv, "-modulus") == 0)
|
else if (strcmp(*argv,"-pvk-none") == 0)
|
||||||
modulus = 1;
|
pvk_encr=0;
|
||||||
else if (strcmp(*argv, "-pubin") == 0)
|
else if (strcmp(*argv,"-noout") == 0)
|
||||||
pubin = 1;
|
noout=1;
|
||||||
else if (strcmp(*argv, "-pubout") == 0)
|
else if (strcmp(*argv,"-text") == 0)
|
||||||
pubout = 1;
|
text=1;
|
||||||
else if ((enc = EVP_get_cipherbyname(&(argv[0][1]))) == NULL) {
|
else if (strcmp(*argv,"-modulus") == 0)
|
||||||
BIO_printf(bio_err, "unknown option %s\n", *argv);
|
modulus=1;
|
||||||
badops = 1;
|
else if (strcmp(*argv,"-pubin") == 0)
|
||||||
break;
|
pubin=1;
|
||||||
}
|
else if (strcmp(*argv,"-pubout") == 0)
|
||||||
argc--;
|
pubout=1;
|
||||||
argv++;
|
else if ((enc=EVP_get_cipherbyname(&(argv[0][1]))) == NULL)
|
||||||
}
|
{
|
||||||
|
BIO_printf(bio_err,"unknown option %s\n",*argv);
|
||||||
|
badops=1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
argc--;
|
||||||
|
argv++;
|
||||||
|
}
|
||||||
|
|
||||||
if (badops) {
|
if (badops)
|
||||||
bad:
|
{
|
||||||
BIO_printf(bio_err, "%s [options] <infile >outfile\n", prog);
|
bad:
|
||||||
BIO_printf(bio_err, "where options are\n");
|
BIO_printf(bio_err,"%s [options] <infile >outfile\n",prog);
|
||||||
BIO_printf(bio_err, " -inform arg input format - DER or PEM\n");
|
BIO_printf(bio_err,"where options are\n");
|
||||||
BIO_printf(bio_err, " -outform arg output format - DER or PEM\n");
|
BIO_printf(bio_err," -inform arg input format - DER or PEM\n");
|
||||||
BIO_printf(bio_err, " -in arg input file\n");
|
BIO_printf(bio_err," -outform arg output format - DER or PEM\n");
|
||||||
BIO_printf(bio_err,
|
BIO_printf(bio_err," -in arg input file\n");
|
||||||
" -passin arg input file pass phrase source\n");
|
BIO_printf(bio_err," -passin arg input file pass phrase source\n");
|
||||||
BIO_printf(bio_err, " -out arg output file\n");
|
BIO_printf(bio_err," -out arg output file\n");
|
||||||
BIO_printf(bio_err,
|
BIO_printf(bio_err," -passout arg output file pass phrase source\n");
|
||||||
" -passout arg output file pass phrase source\n");
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
# ifndef OPENSSL_NO_ENGINE
|
BIO_printf(bio_err," -engine e use engine e, possibly a hardware device.\n");
|
||||||
BIO_printf(bio_err,
|
#endif
|
||||||
" -engine e use engine e, possibly a hardware device.\n");
|
BIO_printf(bio_err," -des encrypt PEM output with cbc des\n");
|
||||||
# endif
|
BIO_printf(bio_err," -des3 encrypt PEM output with ede cbc des using 168 bit key\n");
|
||||||
BIO_printf(bio_err,
|
#ifndef OPENSSL_NO_IDEA
|
||||||
" -des encrypt PEM output with cbc des\n");
|
BIO_printf(bio_err," -idea encrypt PEM output with cbc idea\n");
|
||||||
BIO_printf(bio_err,
|
#endif
|
||||||
" -des3 encrypt PEM output with ede cbc des using 168 bit key\n");
|
#ifndef OPENSSL_NO_AES
|
||||||
# ifndef OPENSSL_NO_IDEA
|
BIO_printf(bio_err," -aes128, -aes192, -aes256\n");
|
||||||
BIO_printf(bio_err,
|
BIO_printf(bio_err," encrypt PEM output with cbc aes\n");
|
||||||
" -idea encrypt PEM output with cbc idea\n");
|
#endif
|
||||||
# endif
|
#ifndef OPENSSL_NO_CAMELLIA
|
||||||
# ifndef OPENSSL_NO_AES
|
BIO_printf(bio_err," -camellia128, -camellia192, -camellia256\n");
|
||||||
BIO_printf(bio_err, " -aes128, -aes192, -aes256\n");
|
BIO_printf(bio_err," encrypt PEM output with cbc camellia\n");
|
||||||
BIO_printf(bio_err,
|
#endif
|
||||||
" encrypt PEM output with cbc aes\n");
|
#ifndef OPENSSL_NO_SEED
|
||||||
# endif
|
BIO_printf(bio_err," -seed encrypt PEM output with cbc seed\n");
|
||||||
# ifndef OPENSSL_NO_CAMELLIA
|
#endif
|
||||||
BIO_printf(bio_err, " -camellia128, -camellia192, -camellia256\n");
|
BIO_printf(bio_err," -text print the key in text\n");
|
||||||
BIO_printf(bio_err,
|
BIO_printf(bio_err," -noout don't print key out\n");
|
||||||
" encrypt PEM output with cbc camellia\n");
|
BIO_printf(bio_err," -modulus print the DSA public value\n");
|
||||||
# endif
|
goto end;
|
||||||
# ifndef OPENSSL_NO_SEED
|
}
|
||||||
BIO_printf(bio_err,
|
|
||||||
" -seed encrypt PEM output with cbc seed\n");
|
|
||||||
# endif
|
|
||||||
BIO_printf(bio_err, " -text print the key in text\n");
|
|
||||||
BIO_printf(bio_err, " -noout don't print key out\n");
|
|
||||||
BIO_printf(bio_err, " -modulus print the DSA public value\n");
|
|
||||||
goto end;
|
|
||||||
}
|
|
||||||
|
|
||||||
ERR_load_crypto_strings();
|
ERR_load_crypto_strings();
|
||||||
|
|
||||||
# ifndef OPENSSL_NO_ENGINE
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
e = setup_engine(bio_err, engine, 0);
|
e = setup_engine(bio_err, engine, 0);
|
||||||
# endif
|
#endif
|
||||||
|
|
||||||
if (!app_passwd(bio_err, passargin, passargout, &passin, &passout)) {
|
if(!app_passwd(bio_err, passargin, passargout, &passin, &passout)) {
|
||||||
BIO_printf(bio_err, "Error getting passwords\n");
|
BIO_printf(bio_err, "Error getting passwords\n");
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
in = BIO_new(BIO_s_file());
|
in=BIO_new(BIO_s_file());
|
||||||
out = BIO_new(BIO_s_file());
|
out=BIO_new(BIO_s_file());
|
||||||
if ((in == NULL) || (out == NULL)) {
|
if ((in == NULL) || (out == NULL))
|
||||||
ERR_print_errors(bio_err);
|
{
|
||||||
goto end;
|
ERR_print_errors(bio_err);
|
||||||
}
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
if (infile == NULL)
|
if (infile == NULL)
|
||||||
BIO_set_fp(in, stdin, BIO_NOCLOSE);
|
BIO_set_fp(in,stdin,BIO_NOCLOSE);
|
||||||
else {
|
else
|
||||||
if (BIO_read_filename(in, infile) <= 0) {
|
{
|
||||||
perror(infile);
|
if (BIO_read_filename(in,infile) <= 0)
|
||||||
goto end;
|
{
|
||||||
}
|
perror(infile);
|
||||||
}
|
goto end;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
BIO_printf(bio_err, "read DSA key\n");
|
BIO_printf(bio_err,"read DSA key\n");
|
||||||
|
|
||||||
{
|
{
|
||||||
EVP_PKEY *pkey;
|
EVP_PKEY *pkey;
|
||||||
|
|
||||||
if (pubin)
|
if (pubin)
|
||||||
pkey = load_pubkey(bio_err, infile, informat, 1,
|
pkey = load_pubkey(bio_err, infile, informat, 1,
|
||||||
passin, e, "Public Key");
|
passin, e, "Public Key");
|
||||||
else
|
else
|
||||||
pkey = load_key(bio_err, infile, informat, 1,
|
pkey = load_key(bio_err, infile, informat, 1,
|
||||||
passin, e, "Private Key");
|
passin, e, "Private Key");
|
||||||
|
|
||||||
if (pkey) {
|
if (pkey)
|
||||||
dsa = EVP_PKEY_get1_DSA(pkey);
|
{
|
||||||
EVP_PKEY_free(pkey);
|
dsa = EVP_PKEY_get1_DSA(pkey);
|
||||||
}
|
EVP_PKEY_free(pkey);
|
||||||
}
|
}
|
||||||
if (dsa == NULL) {
|
}
|
||||||
BIO_printf(bio_err, "unable to load Key\n");
|
if (dsa == NULL)
|
||||||
ERR_print_errors(bio_err);
|
{
|
||||||
goto end;
|
BIO_printf(bio_err,"unable to load Key\n");
|
||||||
}
|
ERR_print_errors(bio_err);
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
if (outfile == NULL) {
|
if (outfile == NULL)
|
||||||
BIO_set_fp(out, stdout, BIO_NOCLOSE);
|
{
|
||||||
# ifdef OPENSSL_SYS_VMS
|
BIO_set_fp(out,stdout,BIO_NOCLOSE);
|
||||||
{
|
#ifdef OPENSSL_SYS_VMS
|
||||||
BIO *tmpbio = BIO_new(BIO_f_linebuffer());
|
{
|
||||||
out = BIO_push(tmpbio, out);
|
BIO *tmpbio = BIO_new(BIO_f_linebuffer());
|
||||||
}
|
out = BIO_push(tmpbio, out);
|
||||||
# endif
|
}
|
||||||
} else {
|
#endif
|
||||||
if (BIO_write_filename(out, outfile) <= 0) {
|
}
|
||||||
perror(outfile);
|
else
|
||||||
goto end;
|
{
|
||||||
}
|
if (BIO_write_filename(out,outfile) <= 0)
|
||||||
}
|
{
|
||||||
|
perror(outfile);
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (text)
|
if (text)
|
||||||
if (!DSA_print(out, dsa, 0)) {
|
if (!DSA_print(out,dsa,0))
|
||||||
perror(outfile);
|
{
|
||||||
ERR_print_errors(bio_err);
|
perror(outfile);
|
||||||
goto end;
|
ERR_print_errors(bio_err);
|
||||||
}
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
if (modulus) {
|
if (modulus)
|
||||||
fprintf(stdout, "Public Key=");
|
{
|
||||||
BN_print(out, dsa->pub_key);
|
fprintf(stdout,"Public Key=");
|
||||||
fprintf(stdout, "\n");
|
BN_print(out,dsa->pub_key);
|
||||||
}
|
fprintf(stdout,"\n");
|
||||||
|
}
|
||||||
|
|
||||||
if (noout)
|
if (noout) goto end;
|
||||||
goto end;
|
BIO_printf(bio_err,"writing DSA key\n");
|
||||||
BIO_printf(bio_err, "writing DSA key\n");
|
if (outformat == FORMAT_ASN1) {
|
||||||
if (outformat == FORMAT_ASN1) {
|
if(pubin || pubout) i=i2d_DSA_PUBKEY_bio(out,dsa);
|
||||||
if (pubin || pubout)
|
else i=i2d_DSAPrivateKey_bio(out,dsa);
|
||||||
i = i2d_DSA_PUBKEY_bio(out, dsa);
|
} else if (outformat == FORMAT_PEM) {
|
||||||
else
|
if(pubin || pubout)
|
||||||
i = i2d_DSAPrivateKey_bio(out, dsa);
|
i=PEM_write_bio_DSA_PUBKEY(out,dsa);
|
||||||
} else if (outformat == FORMAT_PEM) {
|
else i=PEM_write_bio_DSAPrivateKey(out,dsa,enc,
|
||||||
if (pubin || pubout)
|
NULL,0,NULL, passout);
|
||||||
i = PEM_write_bio_DSA_PUBKEY(out, dsa);
|
#if !defined(OPENSSL_NO_RSA) && !defined(OPENSSL_NO_RC4)
|
||||||
else
|
} else if (outformat == FORMAT_MSBLOB || outformat == FORMAT_PVK) {
|
||||||
i = PEM_write_bio_DSAPrivateKey(out, dsa, enc,
|
EVP_PKEY *pk;
|
||||||
NULL, 0, NULL, passout);
|
pk = EVP_PKEY_new();
|
||||||
# if !defined(OPENSSL_NO_RSA) && !defined(OPENSSL_NO_RC4)
|
EVP_PKEY_set1_DSA(pk, dsa);
|
||||||
} else if (outformat == FORMAT_MSBLOB || outformat == FORMAT_PVK) {
|
if (outformat == FORMAT_PVK)
|
||||||
EVP_PKEY *pk;
|
i = i2b_PVK_bio(out, pk, pvk_encr, 0, passout);
|
||||||
pk = EVP_PKEY_new();
|
else if (pubin || pubout)
|
||||||
EVP_PKEY_set1_DSA(pk, dsa);
|
i = i2b_PublicKey_bio(out, pk);
|
||||||
if (outformat == FORMAT_PVK)
|
else
|
||||||
i = i2b_PVK_bio(out, pk, pvk_encr, 0, passout);
|
i = i2b_PrivateKey_bio(out, pk);
|
||||||
else if (pubin || pubout)
|
EVP_PKEY_free(pk);
|
||||||
i = i2b_PublicKey_bio(out, pk);
|
#endif
|
||||||
else
|
} else {
|
||||||
i = i2b_PrivateKey_bio(out, pk);
|
BIO_printf(bio_err,"bad output format specified for outfile\n");
|
||||||
EVP_PKEY_free(pk);
|
goto end;
|
||||||
# endif
|
}
|
||||||
} else {
|
if (i <= 0)
|
||||||
BIO_printf(bio_err, "bad output format specified for outfile\n");
|
{
|
||||||
goto end;
|
BIO_printf(bio_err,"unable to write private key\n");
|
||||||
}
|
ERR_print_errors(bio_err);
|
||||||
if (i <= 0) {
|
}
|
||||||
BIO_printf(bio_err, "unable to write private key\n");
|
else
|
||||||
ERR_print_errors(bio_err);
|
ret=0;
|
||||||
} else
|
end:
|
||||||
ret = 0;
|
if(in != NULL) BIO_free(in);
|
||||||
end:
|
if(out != NULL) BIO_free_all(out);
|
||||||
if (in != NULL)
|
if(dsa != NULL) DSA_free(dsa);
|
||||||
BIO_free(in);
|
if(passin) OPENSSL_free(passin);
|
||||||
if (out != NULL)
|
if(passout) OPENSSL_free(passout);
|
||||||
BIO_free_all(out);
|
apps_shutdown();
|
||||||
if (dsa != NULL)
|
OPENSSL_EXIT(ret);
|
||||||
DSA_free(dsa);
|
}
|
||||||
if (passin)
|
#else /* !OPENSSL_NO_DSA */
|
||||||
OPENSSL_free(passin);
|
|
||||||
if (passout)
|
|
||||||
OPENSSL_free(passout);
|
|
||||||
apps_shutdown();
|
|
||||||
OPENSSL_EXIT(ret);
|
|
||||||
}
|
|
||||||
#else /* !OPENSSL_NO_DSA */
|
|
||||||
|
|
||||||
# if PEDANTIC
|
# if PEDANTIC
|
||||||
static void *dummy = &dummy;
|
static void *dummy=&dummy;
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
720
apps/dsaparam.c
720
apps/dsaparam.c
@@ -56,37 +56,34 @@
|
|||||||
* [including the GNU Public Licence.]
|
* [including the GNU Public Licence.]
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <openssl/opensslconf.h> /* for OPENSSL_NO_DSA */
|
#include <openssl/opensslconf.h> /* for OPENSSL_NO_DSA */
|
||||||
/*
|
/* Until the key-gen callbacks are modified to use newer prototypes, we allow
|
||||||
* Until the key-gen callbacks are modified to use newer prototypes, we allow
|
* deprecated functions for openssl-internal code */
|
||||||
* deprecated functions for openssl-internal code
|
|
||||||
*/
|
|
||||||
#ifdef OPENSSL_NO_DEPRECATED
|
#ifdef OPENSSL_NO_DEPRECATED
|
||||||
# undef OPENSSL_NO_DEPRECATED
|
#undef OPENSSL_NO_DEPRECATED
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef OPENSSL_NO_DSA
|
#ifndef OPENSSL_NO_DSA
|
||||||
# include <assert.h>
|
#include <assert.h>
|
||||||
# include <stdio.h>
|
#include <stdio.h>
|
||||||
# include <stdlib.h>
|
#include <stdlib.h>
|
||||||
# include <time.h>
|
#include <time.h>
|
||||||
# include <string.h>
|
#include <string.h>
|
||||||
# include "apps.h"
|
#include "apps.h"
|
||||||
# include <openssl/bio.h>
|
#include <openssl/bio.h>
|
||||||
# include <openssl/err.h>
|
#include <openssl/err.h>
|
||||||
# include <openssl/bn.h>
|
#include <openssl/bn.h>
|
||||||
# include <openssl/dsa.h>
|
#include <openssl/dsa.h>
|
||||||
# include <openssl/x509.h>
|
#include <openssl/x509.h>
|
||||||
# include <openssl/pem.h>
|
#include <openssl/pem.h>
|
||||||
|
|
||||||
# undef PROG
|
#undef PROG
|
||||||
# define PROG dsaparam_main
|
#define PROG dsaparam_main
|
||||||
|
|
||||||
/*-
|
/* -inform arg - input format - default PEM (DER or PEM)
|
||||||
* -inform arg - input format - default PEM (DER or PEM)
|
|
||||||
* -outform arg - output format - default PEM
|
* -outform arg - output format - default PEM
|
||||||
* -in arg - input file - default stdin
|
* -in arg - input file - default stdin
|
||||||
* -out arg - output file - default stdout
|
* -out arg - output file - default stdout
|
||||||
* -noout
|
* -noout
|
||||||
* -text
|
* -text
|
||||||
* -C
|
* -C
|
||||||
@@ -97,373 +94,386 @@
|
|||||||
* #endif
|
* #endif
|
||||||
*/
|
*/
|
||||||
|
|
||||||
# ifdef GENCB_TEST
|
#ifdef GENCB_TEST
|
||||||
|
|
||||||
static int stop_keygen_flag = 0;
|
static int stop_keygen_flag = 0;
|
||||||
|
|
||||||
static void timebomb_sigalarm(int foo)
|
static void timebomb_sigalarm(int foo)
|
||||||
{
|
{
|
||||||
stop_keygen_flag = 1;
|
stop_keygen_flag = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
# endif
|
#endif
|
||||||
|
|
||||||
static int MS_CALLBACK dsa_cb(int p, int n, BN_GENCB *cb);
|
static int MS_CALLBACK dsa_cb(int p, int n, BN_GENCB *cb);
|
||||||
|
|
||||||
int MAIN(int, char **);
|
int MAIN(int, char **);
|
||||||
|
|
||||||
int MAIN(int argc, char **argv)
|
int MAIN(int argc, char **argv)
|
||||||
{
|
{
|
||||||
DSA *dsa = NULL;
|
DSA *dsa=NULL;
|
||||||
int i, badops = 0, text = 0;
|
int i,badops=0,text=0;
|
||||||
BIO *in = NULL, *out = NULL;
|
BIO *in=NULL,*out=NULL;
|
||||||
int informat, outformat, noout = 0, C = 0, ret = 1;
|
int informat,outformat,noout=0,C=0,ret=1;
|
||||||
char *infile, *outfile, *prog, *inrand = NULL;
|
char *infile,*outfile,*prog,*inrand=NULL;
|
||||||
int numbits = -1, num, genkey = 0;
|
int numbits= -1,num,genkey=0;
|
||||||
int need_rand = 0;
|
int need_rand=0;
|
||||||
# ifndef OPENSSL_NO_ENGINE
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
char *engine = NULL;
|
char *engine=NULL;
|
||||||
# endif
|
#endif
|
||||||
# ifdef GENCB_TEST
|
#ifdef GENCB_TEST
|
||||||
int timebomb = 0;
|
int timebomb=0;
|
||||||
# endif
|
#endif
|
||||||
|
|
||||||
apps_startup();
|
apps_startup();
|
||||||
|
|
||||||
if (bio_err == NULL)
|
if (bio_err == NULL)
|
||||||
if ((bio_err = BIO_new(BIO_s_file())) != NULL)
|
if ((bio_err=BIO_new(BIO_s_file())) != NULL)
|
||||||
BIO_set_fp(bio_err, stderr, BIO_NOCLOSE | BIO_FP_TEXT);
|
BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT);
|
||||||
|
|
||||||
if (!load_config(bio_err, NULL))
|
if (!load_config(bio_err, NULL))
|
||||||
goto end;
|
goto end;
|
||||||
|
|
||||||
infile = NULL;
|
infile=NULL;
|
||||||
outfile = NULL;
|
outfile=NULL;
|
||||||
informat = FORMAT_PEM;
|
informat=FORMAT_PEM;
|
||||||
outformat = FORMAT_PEM;
|
outformat=FORMAT_PEM;
|
||||||
|
|
||||||
prog = argv[0];
|
prog=argv[0];
|
||||||
argc--;
|
argc--;
|
||||||
argv++;
|
argv++;
|
||||||
while (argc >= 1) {
|
while (argc >= 1)
|
||||||
if (strcmp(*argv, "-inform") == 0) {
|
{
|
||||||
if (--argc < 1)
|
if (strcmp(*argv,"-inform") == 0)
|
||||||
goto bad;
|
{
|
||||||
informat = str2fmt(*(++argv));
|
if (--argc < 1) goto bad;
|
||||||
} else if (strcmp(*argv, "-outform") == 0) {
|
informat=str2fmt(*(++argv));
|
||||||
if (--argc < 1)
|
}
|
||||||
goto bad;
|
else if (strcmp(*argv,"-outform") == 0)
|
||||||
outformat = str2fmt(*(++argv));
|
{
|
||||||
} else if (strcmp(*argv, "-in") == 0) {
|
if (--argc < 1) goto bad;
|
||||||
if (--argc < 1)
|
outformat=str2fmt(*(++argv));
|
||||||
goto bad;
|
}
|
||||||
infile = *(++argv);
|
else if (strcmp(*argv,"-in") == 0)
|
||||||
} else if (strcmp(*argv, "-out") == 0) {
|
{
|
||||||
if (--argc < 1)
|
if (--argc < 1) goto bad;
|
||||||
goto bad;
|
infile= *(++argv);
|
||||||
outfile = *(++argv);
|
}
|
||||||
}
|
else if (strcmp(*argv,"-out") == 0)
|
||||||
# ifndef OPENSSL_NO_ENGINE
|
{
|
||||||
else if (strcmp(*argv, "-engine") == 0) {
|
if (--argc < 1) goto bad;
|
||||||
if (--argc < 1)
|
outfile= *(++argv);
|
||||||
goto bad;
|
}
|
||||||
engine = *(++argv);
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
}
|
else if(strcmp(*argv, "-engine") == 0)
|
||||||
# endif
|
{
|
||||||
# ifdef GENCB_TEST
|
if (--argc < 1) goto bad;
|
||||||
else if (strcmp(*argv, "-timebomb") == 0) {
|
engine = *(++argv);
|
||||||
if (--argc < 1)
|
}
|
||||||
goto bad;
|
#endif
|
||||||
timebomb = atoi(*(++argv));
|
#ifdef GENCB_TEST
|
||||||
}
|
else if(strcmp(*argv, "-timebomb") == 0)
|
||||||
# endif
|
{
|
||||||
else if (strcmp(*argv, "-text") == 0)
|
if (--argc < 1) goto bad;
|
||||||
text = 1;
|
timebomb = atoi(*(++argv));
|
||||||
else if (strcmp(*argv, "-C") == 0)
|
}
|
||||||
C = 1;
|
#endif
|
||||||
else if (strcmp(*argv, "-genkey") == 0) {
|
else if (strcmp(*argv,"-text") == 0)
|
||||||
genkey = 1;
|
text=1;
|
||||||
need_rand = 1;
|
else if (strcmp(*argv,"-C") == 0)
|
||||||
} else if (strcmp(*argv, "-rand") == 0) {
|
C=1;
|
||||||
if (--argc < 1)
|
else if (strcmp(*argv,"-genkey") == 0)
|
||||||
goto bad;
|
{
|
||||||
inrand = *(++argv);
|
genkey=1;
|
||||||
need_rand = 1;
|
need_rand=1;
|
||||||
} else if (strcmp(*argv, "-noout") == 0)
|
}
|
||||||
noout = 1;
|
else if (strcmp(*argv,"-rand") == 0)
|
||||||
else if (sscanf(*argv, "%d", &num) == 1) {
|
{
|
||||||
/* generate a key */
|
if (--argc < 1) goto bad;
|
||||||
numbits = num;
|
inrand= *(++argv);
|
||||||
need_rand = 1;
|
need_rand=1;
|
||||||
} else {
|
}
|
||||||
BIO_printf(bio_err, "unknown option %s\n", *argv);
|
else if (strcmp(*argv,"-noout") == 0)
|
||||||
badops = 1;
|
noout=1;
|
||||||
break;
|
else if (sscanf(*argv,"%d",&num) == 1)
|
||||||
}
|
{
|
||||||
argc--;
|
/* generate a key */
|
||||||
argv++;
|
numbits=num;
|
||||||
}
|
need_rand=1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
BIO_printf(bio_err,"unknown option %s\n",*argv);
|
||||||
|
badops=1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
argc--;
|
||||||
|
argv++;
|
||||||
|
}
|
||||||
|
|
||||||
if (badops) {
|
if (badops)
|
||||||
bad:
|
{
|
||||||
BIO_printf(bio_err, "%s [options] [bits] <infile >outfile\n", prog);
|
bad:
|
||||||
BIO_printf(bio_err, "where options are\n");
|
BIO_printf(bio_err,"%s [options] [bits] <infile >outfile\n",prog);
|
||||||
BIO_printf(bio_err, " -inform arg input format - DER or PEM\n");
|
BIO_printf(bio_err,"where options are\n");
|
||||||
BIO_printf(bio_err, " -outform arg output format - DER or PEM\n");
|
BIO_printf(bio_err," -inform arg input format - DER or PEM\n");
|
||||||
BIO_printf(bio_err, " -in arg input file\n");
|
BIO_printf(bio_err," -outform arg output format - DER or PEM\n");
|
||||||
BIO_printf(bio_err, " -out arg output file\n");
|
BIO_printf(bio_err," -in arg input file\n");
|
||||||
BIO_printf(bio_err, " -text print as text\n");
|
BIO_printf(bio_err," -out arg output file\n");
|
||||||
BIO_printf(bio_err, " -C Output C code\n");
|
BIO_printf(bio_err," -text print as text\n");
|
||||||
BIO_printf(bio_err, " -noout no output\n");
|
BIO_printf(bio_err," -C Output C code\n");
|
||||||
BIO_printf(bio_err, " -genkey generate a DSA key\n");
|
BIO_printf(bio_err," -noout no output\n");
|
||||||
BIO_printf(bio_err,
|
BIO_printf(bio_err," -genkey generate a DSA key\n");
|
||||||
" -rand files to use for random number input\n");
|
BIO_printf(bio_err," -rand files to use for random number input\n");
|
||||||
# ifndef OPENSSL_NO_ENGINE
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
BIO_printf(bio_err,
|
BIO_printf(bio_err," -engine e use engine e, possibly a hardware device.\n");
|
||||||
" -engine e use engine e, possibly a hardware device.\n");
|
#endif
|
||||||
# endif
|
#ifdef GENCB_TEST
|
||||||
# ifdef GENCB_TEST
|
BIO_printf(bio_err," -timebomb n interrupt keygen after <n> seconds\n");
|
||||||
BIO_printf(bio_err,
|
#endif
|
||||||
" -timebomb n interrupt keygen after <n> seconds\n");
|
BIO_printf(bio_err," number number of bits to use for generating private key\n");
|
||||||
# endif
|
goto end;
|
||||||
BIO_printf(bio_err,
|
}
|
||||||
" number number of bits to use for generating private key\n");
|
|
||||||
goto end;
|
|
||||||
}
|
|
||||||
|
|
||||||
ERR_load_crypto_strings();
|
ERR_load_crypto_strings();
|
||||||
|
|
||||||
in = BIO_new(BIO_s_file());
|
in=BIO_new(BIO_s_file());
|
||||||
out = BIO_new(BIO_s_file());
|
out=BIO_new(BIO_s_file());
|
||||||
if ((in == NULL) || (out == NULL)) {
|
if ((in == NULL) || (out == NULL))
|
||||||
ERR_print_errors(bio_err);
|
{
|
||||||
goto end;
|
ERR_print_errors(bio_err);
|
||||||
}
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
if (infile == NULL)
|
if (infile == NULL)
|
||||||
BIO_set_fp(in, stdin, BIO_NOCLOSE);
|
BIO_set_fp(in,stdin,BIO_NOCLOSE);
|
||||||
else {
|
else
|
||||||
if (BIO_read_filename(in, infile) <= 0) {
|
{
|
||||||
perror(infile);
|
if (BIO_read_filename(in,infile) <= 0)
|
||||||
goto end;
|
{
|
||||||
}
|
perror(infile);
|
||||||
}
|
goto end;
|
||||||
if (outfile == NULL) {
|
}
|
||||||
BIO_set_fp(out, stdout, BIO_NOCLOSE);
|
}
|
||||||
# ifdef OPENSSL_SYS_VMS
|
if (outfile == NULL)
|
||||||
{
|
{
|
||||||
BIO *tmpbio = BIO_new(BIO_f_linebuffer());
|
BIO_set_fp(out,stdout,BIO_NOCLOSE);
|
||||||
out = BIO_push(tmpbio, out);
|
#ifdef OPENSSL_SYS_VMS
|
||||||
}
|
{
|
||||||
# endif
|
BIO *tmpbio = BIO_new(BIO_f_linebuffer());
|
||||||
} else {
|
out = BIO_push(tmpbio, out);
|
||||||
if (BIO_write_filename(out, outfile) <= 0) {
|
}
|
||||||
perror(outfile);
|
#endif
|
||||||
goto end;
|
}
|
||||||
}
|
else
|
||||||
}
|
{
|
||||||
|
if (BIO_write_filename(out,outfile) <= 0)
|
||||||
|
{
|
||||||
|
perror(outfile);
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
# ifndef OPENSSL_NO_ENGINE
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
setup_engine(bio_err, engine, 0);
|
setup_engine(bio_err, engine, 0);
|
||||||
# endif
|
#endif
|
||||||
|
|
||||||
if (need_rand) {
|
if (need_rand)
|
||||||
app_RAND_load_file(NULL, bio_err, (inrand != NULL));
|
{
|
||||||
if (inrand != NULL)
|
app_RAND_load_file(NULL, bio_err, (inrand != NULL));
|
||||||
BIO_printf(bio_err, "%ld semi-random bytes loaded\n",
|
if (inrand != NULL)
|
||||||
app_RAND_load_files(inrand));
|
BIO_printf(bio_err,"%ld semi-random bytes loaded\n",
|
||||||
}
|
app_RAND_load_files(inrand));
|
||||||
|
}
|
||||||
|
|
||||||
if (numbits > 0) {
|
if (numbits > 0)
|
||||||
BN_GENCB cb;
|
{
|
||||||
BN_GENCB_set(&cb, dsa_cb, bio_err);
|
BN_GENCB cb;
|
||||||
assert(need_rand);
|
BN_GENCB_set(&cb, dsa_cb, bio_err);
|
||||||
dsa = DSA_new();
|
assert(need_rand);
|
||||||
if (!dsa) {
|
dsa = DSA_new();
|
||||||
BIO_printf(bio_err, "Error allocating DSA object\n");
|
if(!dsa)
|
||||||
goto end;
|
{
|
||||||
}
|
BIO_printf(bio_err,"Error allocating DSA object\n");
|
||||||
BIO_printf(bio_err, "Generating DSA parameters, %d bit long prime\n",
|
goto end;
|
||||||
num);
|
}
|
||||||
BIO_printf(bio_err, "This could take some time\n");
|
BIO_printf(bio_err,"Generating DSA parameters, %d bit long prime\n",num);
|
||||||
# ifdef GENCB_TEST
|
BIO_printf(bio_err,"This could take some time\n");
|
||||||
if (timebomb > 0) {
|
#ifdef GENCB_TEST
|
||||||
struct sigaction act;
|
if(timebomb > 0)
|
||||||
act.sa_handler = timebomb_sigalarm;
|
{
|
||||||
act.sa_flags = 0;
|
struct sigaction act;
|
||||||
BIO_printf(bio_err,
|
act.sa_handler = timebomb_sigalarm;
|
||||||
"(though I'll stop it if not done within %d secs)\n",
|
act.sa_flags = 0;
|
||||||
timebomb);
|
BIO_printf(bio_err,"(though I'll stop it if not done within %d secs)\n",
|
||||||
if (sigaction(SIGALRM, &act, NULL) != 0) {
|
timebomb);
|
||||||
BIO_printf(bio_err, "Error, couldn't set SIGALRM handler\n");
|
if(sigaction(SIGALRM, &act, NULL) != 0)
|
||||||
goto end;
|
{
|
||||||
}
|
BIO_printf(bio_err,"Error, couldn't set SIGALRM handler\n");
|
||||||
alarm(timebomb);
|
goto end;
|
||||||
}
|
}
|
||||||
# endif
|
alarm(timebomb);
|
||||||
if (!DSA_generate_parameters_ex(dsa, num, NULL, 0, NULL, NULL, &cb)) {
|
}
|
||||||
# ifdef GENCB_TEST
|
#endif
|
||||||
if (stop_keygen_flag) {
|
if(!DSA_generate_parameters_ex(dsa,num,NULL,0,NULL,NULL, &cb))
|
||||||
BIO_printf(bio_err, "DSA key generation time-stopped\n");
|
{
|
||||||
/* This is an asked-for behaviour! */
|
#ifdef GENCB_TEST
|
||||||
ret = 0;
|
if(stop_keygen_flag)
|
||||||
goto end;
|
{
|
||||||
}
|
BIO_printf(bio_err,"DSA key generation time-stopped\n");
|
||||||
# endif
|
/* This is an asked-for behaviour! */
|
||||||
ERR_print_errors(bio_err);
|
ret = 0;
|
||||||
BIO_printf(bio_err, "Error, DSA key generation failed\n");
|
goto end;
|
||||||
goto end;
|
}
|
||||||
}
|
#endif
|
||||||
} else if (informat == FORMAT_ASN1)
|
BIO_printf(bio_err,"Error, DSA key generation failed\n");
|
||||||
dsa = d2i_DSAparams_bio(in, NULL);
|
goto end;
|
||||||
else if (informat == FORMAT_PEM)
|
}
|
||||||
dsa = PEM_read_bio_DSAparams(in, NULL, NULL, NULL);
|
}
|
||||||
else {
|
else if (informat == FORMAT_ASN1)
|
||||||
BIO_printf(bio_err, "bad input format specified\n");
|
dsa=d2i_DSAparams_bio(in,NULL);
|
||||||
goto end;
|
else if (informat == FORMAT_PEM)
|
||||||
}
|
dsa=PEM_read_bio_DSAparams(in,NULL,NULL,NULL);
|
||||||
if (dsa == NULL) {
|
else
|
||||||
BIO_printf(bio_err, "unable to load DSA parameters\n");
|
{
|
||||||
ERR_print_errors(bio_err);
|
BIO_printf(bio_err,"bad input format specified\n");
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
if (dsa == NULL)
|
||||||
|
{
|
||||||
|
BIO_printf(bio_err,"unable to load DSA parameters\n");
|
||||||
|
ERR_print_errors(bio_err);
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
if (text) {
|
if (text)
|
||||||
DSAparams_print(out, dsa);
|
{
|
||||||
}
|
DSAparams_print(out,dsa);
|
||||||
|
}
|
||||||
|
|
||||||
if (C) {
|
if (C)
|
||||||
unsigned char *data;
|
{
|
||||||
int l, len, bits_p;
|
unsigned char *data;
|
||||||
|
int l,len,bits_p;
|
||||||
|
|
||||||
len = BN_num_bytes(dsa->p);
|
len=BN_num_bytes(dsa->p);
|
||||||
bits_p = BN_num_bits(dsa->p);
|
bits_p=BN_num_bits(dsa->p);
|
||||||
data = (unsigned char *)OPENSSL_malloc(len + 20);
|
data=(unsigned char *)OPENSSL_malloc(len+20);
|
||||||
if (data == NULL) {
|
if (data == NULL)
|
||||||
perror("OPENSSL_malloc");
|
{
|
||||||
goto end;
|
perror("OPENSSL_malloc");
|
||||||
}
|
goto end;
|
||||||
l = BN_bn2bin(dsa->p, data);
|
}
|
||||||
printf("static unsigned char dsa%d_p[]={", bits_p);
|
l=BN_bn2bin(dsa->p,data);
|
||||||
for (i = 0; i < l; i++) {
|
printf("static unsigned char dsa%d_p[]={",bits_p);
|
||||||
if ((i % 12) == 0)
|
for (i=0; i<l; i++)
|
||||||
printf("\n\t");
|
{
|
||||||
printf("0x%02X,", data[i]);
|
if ((i%12) == 0) printf("\n\t");
|
||||||
}
|
printf("0x%02X,",data[i]);
|
||||||
printf("\n\t};\n");
|
}
|
||||||
|
printf("\n\t};\n");
|
||||||
|
|
||||||
l = BN_bn2bin(dsa->q, data);
|
l=BN_bn2bin(dsa->q,data);
|
||||||
printf("static unsigned char dsa%d_q[]={", bits_p);
|
printf("static unsigned char dsa%d_q[]={",bits_p);
|
||||||
for (i = 0; i < l; i++) {
|
for (i=0; i<l; i++)
|
||||||
if ((i % 12) == 0)
|
{
|
||||||
printf("\n\t");
|
if ((i%12) == 0) printf("\n\t");
|
||||||
printf("0x%02X,", data[i]);
|
printf("0x%02X,",data[i]);
|
||||||
}
|
}
|
||||||
printf("\n\t};\n");
|
printf("\n\t};\n");
|
||||||
|
|
||||||
l = BN_bn2bin(dsa->g, data);
|
l=BN_bn2bin(dsa->g,data);
|
||||||
printf("static unsigned char dsa%d_g[]={", bits_p);
|
printf("static unsigned char dsa%d_g[]={",bits_p);
|
||||||
for (i = 0; i < l; i++) {
|
for (i=0; i<l; i++)
|
||||||
if ((i % 12) == 0)
|
{
|
||||||
printf("\n\t");
|
if ((i%12) == 0) printf("\n\t");
|
||||||
printf("0x%02X,", data[i]);
|
printf("0x%02X,",data[i]);
|
||||||
}
|
}
|
||||||
printf("\n\t};\n\n");
|
printf("\n\t};\n\n");
|
||||||
|
|
||||||
printf("DSA *get_dsa%d()\n\t{\n", bits_p);
|
printf("DSA *get_dsa%d()\n\t{\n",bits_p);
|
||||||
printf("\tDSA *dsa;\n\n");
|
printf("\tDSA *dsa;\n\n");
|
||||||
printf("\tif ((dsa=DSA_new()) == NULL) return(NULL);\n");
|
printf("\tif ((dsa=DSA_new()) == NULL) return(NULL);\n");
|
||||||
printf("\tdsa->p=BN_bin2bn(dsa%d_p,sizeof(dsa%d_p),NULL);\n",
|
printf("\tdsa->p=BN_bin2bn(dsa%d_p,sizeof(dsa%d_p),NULL);\n",
|
||||||
bits_p, bits_p);
|
bits_p,bits_p);
|
||||||
printf("\tdsa->q=BN_bin2bn(dsa%d_q,sizeof(dsa%d_q),NULL);\n",
|
printf("\tdsa->q=BN_bin2bn(dsa%d_q,sizeof(dsa%d_q),NULL);\n",
|
||||||
bits_p, bits_p);
|
bits_p,bits_p);
|
||||||
printf("\tdsa->g=BN_bin2bn(dsa%d_g,sizeof(dsa%d_g),NULL);\n",
|
printf("\tdsa->g=BN_bin2bn(dsa%d_g,sizeof(dsa%d_g),NULL);\n",
|
||||||
bits_p, bits_p);
|
bits_p,bits_p);
|
||||||
printf
|
printf("\tif ((dsa->p == NULL) || (dsa->q == NULL) || (dsa->g == NULL))\n");
|
||||||
("\tif ((dsa->p == NULL) || (dsa->q == NULL) || (dsa->g == NULL))\n");
|
printf("\t\t{ DSA_free(dsa); return(NULL); }\n");
|
||||||
printf("\t\t{ DSA_free(dsa); return(NULL); }\n");
|
printf("\treturn(dsa);\n\t}\n");
|
||||||
printf("\treturn(dsa);\n\t}\n");
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (!noout) {
|
|
||||||
if (outformat == FORMAT_ASN1)
|
|
||||||
i = i2d_DSAparams_bio(out, dsa);
|
|
||||||
else if (outformat == FORMAT_PEM)
|
|
||||||
i = PEM_write_bio_DSAparams(out, dsa);
|
|
||||||
else {
|
|
||||||
BIO_printf(bio_err, "bad output format specified for outfile\n");
|
|
||||||
goto end;
|
|
||||||
}
|
|
||||||
if (!i) {
|
|
||||||
BIO_printf(bio_err, "unable to write DSA parameters\n");
|
|
||||||
ERR_print_errors(bio_err);
|
|
||||||
goto end;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (genkey) {
|
|
||||||
DSA *dsakey;
|
|
||||||
|
|
||||||
assert(need_rand);
|
if (!noout)
|
||||||
if ((dsakey = DSAparams_dup(dsa)) == NULL)
|
{
|
||||||
goto end;
|
if (outformat == FORMAT_ASN1)
|
||||||
if (!DSA_generate_key(dsakey)) {
|
i=i2d_DSAparams_bio(out,dsa);
|
||||||
ERR_print_errors(bio_err);
|
else if (outformat == FORMAT_PEM)
|
||||||
DSA_free(dsakey);
|
i=PEM_write_bio_DSAparams(out,dsa);
|
||||||
goto end;
|
else {
|
||||||
}
|
BIO_printf(bio_err,"bad output format specified for outfile\n");
|
||||||
if (outformat == FORMAT_ASN1)
|
goto end;
|
||||||
i = i2d_DSAPrivateKey_bio(out, dsakey);
|
}
|
||||||
else if (outformat == FORMAT_PEM)
|
if (!i)
|
||||||
i = PEM_write_bio_DSAPrivateKey(out, dsakey, NULL, NULL, 0, NULL,
|
{
|
||||||
NULL);
|
BIO_printf(bio_err,"unable to write DSA parameters\n");
|
||||||
else {
|
ERR_print_errors(bio_err);
|
||||||
BIO_printf(bio_err, "bad output format specified for outfile\n");
|
goto end;
|
||||||
DSA_free(dsakey);
|
}
|
||||||
goto end;
|
}
|
||||||
}
|
if (genkey)
|
||||||
DSA_free(dsakey);
|
{
|
||||||
}
|
DSA *dsakey;
|
||||||
if (need_rand)
|
|
||||||
app_RAND_write_file(NULL, bio_err);
|
assert(need_rand);
|
||||||
ret = 0;
|
if ((dsakey=DSAparams_dup(dsa)) == NULL) goto end;
|
||||||
end:
|
if (!DSA_generate_key(dsakey)) goto end;
|
||||||
if (in != NULL)
|
if (outformat == FORMAT_ASN1)
|
||||||
BIO_free(in);
|
i=i2d_DSAPrivateKey_bio(out,dsakey);
|
||||||
if (out != NULL)
|
else if (outformat == FORMAT_PEM)
|
||||||
BIO_free_all(out);
|
i=PEM_write_bio_DSAPrivateKey(out,dsakey,NULL,NULL,0,NULL,NULL);
|
||||||
if (dsa != NULL)
|
else {
|
||||||
DSA_free(dsa);
|
BIO_printf(bio_err,"bad output format specified for outfile\n");
|
||||||
apps_shutdown();
|
goto end;
|
||||||
OPENSSL_EXIT(ret);
|
}
|
||||||
}
|
DSA_free(dsakey);
|
||||||
|
}
|
||||||
|
if (need_rand)
|
||||||
|
app_RAND_write_file(NULL, bio_err);
|
||||||
|
ret=0;
|
||||||
|
end:
|
||||||
|
if (in != NULL) BIO_free(in);
|
||||||
|
if (out != NULL) BIO_free_all(out);
|
||||||
|
if (dsa != NULL) DSA_free(dsa);
|
||||||
|
apps_shutdown();
|
||||||
|
OPENSSL_EXIT(ret);
|
||||||
|
}
|
||||||
|
|
||||||
static int MS_CALLBACK dsa_cb(int p, int n, BN_GENCB *cb)
|
static int MS_CALLBACK dsa_cb(int p, int n, BN_GENCB *cb)
|
||||||
{
|
{
|
||||||
char c = '*';
|
char c='*';
|
||||||
|
|
||||||
if (p == 0)
|
if (p == 0) c='.';
|
||||||
c = '.';
|
if (p == 1) c='+';
|
||||||
if (p == 1)
|
if (p == 2) c='*';
|
||||||
c = '+';
|
if (p == 3) c='\n';
|
||||||
if (p == 2)
|
BIO_write(cb->arg,&c,1);
|
||||||
c = '*';
|
(void)BIO_flush(cb->arg);
|
||||||
if (p == 3)
|
#ifdef LINT
|
||||||
c = '\n';
|
p=n;
|
||||||
BIO_write(cb->arg, &c, 1);
|
#endif
|
||||||
(void)BIO_flush(cb->arg);
|
#ifdef GENCB_TEST
|
||||||
# ifdef LINT
|
if(stop_keygen_flag)
|
||||||
p = n;
|
return 0;
|
||||||
# endif
|
#endif
|
||||||
# ifdef GENCB_TEST
|
return 1;
|
||||||
if (stop_keygen_flag)
|
}
|
||||||
return 0;
|
#else /* !OPENSSL_NO_DSA */
|
||||||
# endif
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
#else /* !OPENSSL_NO_DSA */
|
|
||||||
|
|
||||||
# if PEDANTIC
|
# if PEDANTIC
|
||||||
static void *dummy = &dummy;
|
static void *dummy=&dummy;
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
567
apps/ec.c
567
apps/ec.c
@@ -58,20 +58,19 @@
|
|||||||
|
|
||||||
#include <openssl/opensslconf.h>
|
#include <openssl/opensslconf.h>
|
||||||
#ifndef OPENSSL_NO_EC
|
#ifndef OPENSSL_NO_EC
|
||||||
# include <stdio.h>
|
#include <stdio.h>
|
||||||
# include <stdlib.h>
|
#include <stdlib.h>
|
||||||
# include <string.h>
|
#include <string.h>
|
||||||
# include "apps.h"
|
#include "apps.h"
|
||||||
# include <openssl/bio.h>
|
#include <openssl/bio.h>
|
||||||
# include <openssl/err.h>
|
#include <openssl/err.h>
|
||||||
# include <openssl/evp.h>
|
#include <openssl/evp.h>
|
||||||
# include <openssl/pem.h>
|
#include <openssl/pem.h>
|
||||||
|
|
||||||
# undef PROG
|
#undef PROG
|
||||||
# define PROG ec_main
|
#define PROG ec_main
|
||||||
|
|
||||||
/*-
|
/* -inform arg - input format - default PEM (one of DER, NET or PEM)
|
||||||
* -inform arg - input format - default PEM (one of DER, NET or PEM)
|
|
||||||
* -outform arg - output format - default PEM
|
* -outform arg - output format - default PEM
|
||||||
* -in arg - input file - default stdin
|
* -in arg - input file - default stdin
|
||||||
* -out arg - output file - default stdout
|
* -out arg - output file - default stdout
|
||||||
@@ -86,280 +85,322 @@ int MAIN(int, char **);
|
|||||||
|
|
||||||
int MAIN(int argc, char **argv)
|
int MAIN(int argc, char **argv)
|
||||||
{
|
{
|
||||||
int ret = 1;
|
int ret = 1;
|
||||||
EC_KEY *eckey = NULL;
|
EC_KEY *eckey = NULL;
|
||||||
const EC_GROUP *group;
|
const EC_GROUP *group;
|
||||||
int i, badops = 0;
|
int i, badops = 0;
|
||||||
const EVP_CIPHER *enc = NULL;
|
const EVP_CIPHER *enc = NULL;
|
||||||
BIO *in = NULL, *out = NULL;
|
BIO *in = NULL, *out = NULL;
|
||||||
int informat, outformat, text = 0, noout = 0;
|
int informat, outformat, text=0, noout=0;
|
||||||
int pubin = 0, pubout = 0, param_out = 0;
|
int pubin = 0, pubout = 0, param_out = 0;
|
||||||
char *infile, *outfile, *prog, *engine;
|
char *infile, *outfile, *prog, *engine;
|
||||||
char *passargin = NULL, *passargout = NULL;
|
char *passargin = NULL, *passargout = NULL;
|
||||||
char *passin = NULL, *passout = NULL;
|
char *passin = NULL, *passout = NULL;
|
||||||
point_conversion_form_t form = POINT_CONVERSION_UNCOMPRESSED;
|
point_conversion_form_t form = POINT_CONVERSION_UNCOMPRESSED;
|
||||||
int new_form = 0;
|
int new_form = 0;
|
||||||
int asn1_flag = OPENSSL_EC_NAMED_CURVE;
|
int asn1_flag = OPENSSL_EC_NAMED_CURVE;
|
||||||
int new_asn1_flag = 0;
|
int new_asn1_flag = 0;
|
||||||
|
|
||||||
apps_startup();
|
apps_startup();
|
||||||
|
|
||||||
if (bio_err == NULL)
|
if (bio_err == NULL)
|
||||||
if ((bio_err = BIO_new(BIO_s_file())) != NULL)
|
if ((bio_err=BIO_new(BIO_s_file())) != NULL)
|
||||||
BIO_set_fp(bio_err, stderr, BIO_NOCLOSE | BIO_FP_TEXT);
|
BIO_set_fp(bio_err, stderr, BIO_NOCLOSE|BIO_FP_TEXT);
|
||||||
|
|
||||||
if (!load_config(bio_err, NULL))
|
if (!load_config(bio_err, NULL))
|
||||||
goto end;
|
goto end;
|
||||||
|
|
||||||
engine = NULL;
|
engine = NULL;
|
||||||
infile = NULL;
|
infile = NULL;
|
||||||
outfile = NULL;
|
outfile = NULL;
|
||||||
informat = FORMAT_PEM;
|
informat = FORMAT_PEM;
|
||||||
outformat = FORMAT_PEM;
|
outformat = FORMAT_PEM;
|
||||||
|
|
||||||
prog = argv[0];
|
prog = argv[0];
|
||||||
argc--;
|
argc--;
|
||||||
argv++;
|
argv++;
|
||||||
while (argc >= 1) {
|
while (argc >= 1)
|
||||||
if (strcmp(*argv, "-inform") == 0) {
|
{
|
||||||
if (--argc < 1)
|
if (strcmp(*argv,"-inform") == 0)
|
||||||
goto bad;
|
{
|
||||||
informat = str2fmt(*(++argv));
|
if (--argc < 1) goto bad;
|
||||||
} else if (strcmp(*argv, "-outform") == 0) {
|
informat=str2fmt(*(++argv));
|
||||||
if (--argc < 1)
|
}
|
||||||
goto bad;
|
else if (strcmp(*argv,"-outform") == 0)
|
||||||
outformat = str2fmt(*(++argv));
|
{
|
||||||
} else if (strcmp(*argv, "-in") == 0) {
|
if (--argc < 1) goto bad;
|
||||||
if (--argc < 1)
|
outformat=str2fmt(*(++argv));
|
||||||
goto bad;
|
}
|
||||||
infile = *(++argv);
|
else if (strcmp(*argv,"-in") == 0)
|
||||||
} else if (strcmp(*argv, "-out") == 0) {
|
{
|
||||||
if (--argc < 1)
|
if (--argc < 1) goto bad;
|
||||||
goto bad;
|
infile= *(++argv);
|
||||||
outfile = *(++argv);
|
}
|
||||||
} else if (strcmp(*argv, "-passin") == 0) {
|
else if (strcmp(*argv,"-out") == 0)
|
||||||
if (--argc < 1)
|
{
|
||||||
goto bad;
|
if (--argc < 1) goto bad;
|
||||||
passargin = *(++argv);
|
outfile= *(++argv);
|
||||||
} else if (strcmp(*argv, "-passout") == 0) {
|
}
|
||||||
if (--argc < 1)
|
else if (strcmp(*argv,"-passin") == 0)
|
||||||
goto bad;
|
{
|
||||||
passargout = *(++argv);
|
if (--argc < 1) goto bad;
|
||||||
} else if (strcmp(*argv, "-engine") == 0) {
|
passargin= *(++argv);
|
||||||
if (--argc < 1)
|
}
|
||||||
goto bad;
|
else if (strcmp(*argv,"-passout") == 0)
|
||||||
engine = *(++argv);
|
{
|
||||||
} else if (strcmp(*argv, "-noout") == 0)
|
if (--argc < 1) goto bad;
|
||||||
noout = 1;
|
passargout= *(++argv);
|
||||||
else if (strcmp(*argv, "-text") == 0)
|
}
|
||||||
text = 1;
|
else if (strcmp(*argv, "-engine") == 0)
|
||||||
else if (strcmp(*argv, "-conv_form") == 0) {
|
{
|
||||||
if (--argc < 1)
|
if (--argc < 1) goto bad;
|
||||||
goto bad;
|
engine= *(++argv);
|
||||||
++argv;
|
}
|
||||||
new_form = 1;
|
else if (strcmp(*argv, "-noout") == 0)
|
||||||
if (strcmp(*argv, "compressed") == 0)
|
noout = 1;
|
||||||
form = POINT_CONVERSION_COMPRESSED;
|
else if (strcmp(*argv, "-text") == 0)
|
||||||
else if (strcmp(*argv, "uncompressed") == 0)
|
text = 1;
|
||||||
form = POINT_CONVERSION_UNCOMPRESSED;
|
else if (strcmp(*argv, "-conv_form") == 0)
|
||||||
else if (strcmp(*argv, "hybrid") == 0)
|
{
|
||||||
form = POINT_CONVERSION_HYBRID;
|
if (--argc < 1)
|
||||||
else
|
goto bad;
|
||||||
goto bad;
|
++argv;
|
||||||
} else if (strcmp(*argv, "-param_enc") == 0) {
|
new_form = 1;
|
||||||
if (--argc < 1)
|
if (strcmp(*argv, "compressed") == 0)
|
||||||
goto bad;
|
form = POINT_CONVERSION_COMPRESSED;
|
||||||
++argv;
|
else if (strcmp(*argv, "uncompressed") == 0)
|
||||||
new_asn1_flag = 1;
|
form = POINT_CONVERSION_UNCOMPRESSED;
|
||||||
if (strcmp(*argv, "named_curve") == 0)
|
else if (strcmp(*argv, "hybrid") == 0)
|
||||||
asn1_flag = OPENSSL_EC_NAMED_CURVE;
|
form = POINT_CONVERSION_HYBRID;
|
||||||
else if (strcmp(*argv, "explicit") == 0)
|
else
|
||||||
asn1_flag = 0;
|
goto bad;
|
||||||
else
|
}
|
||||||
goto bad;
|
else if (strcmp(*argv, "-param_enc") == 0)
|
||||||
} else if (strcmp(*argv, "-param_out") == 0)
|
{
|
||||||
param_out = 1;
|
if (--argc < 1)
|
||||||
else if (strcmp(*argv, "-pubin") == 0)
|
goto bad;
|
||||||
pubin = 1;
|
++argv;
|
||||||
else if (strcmp(*argv, "-pubout") == 0)
|
new_asn1_flag = 1;
|
||||||
pubout = 1;
|
if (strcmp(*argv, "named_curve") == 0)
|
||||||
else if ((enc = EVP_get_cipherbyname(&(argv[0][1]))) == NULL) {
|
asn1_flag = OPENSSL_EC_NAMED_CURVE;
|
||||||
BIO_printf(bio_err, "unknown option %s\n", *argv);
|
else if (strcmp(*argv, "explicit") == 0)
|
||||||
badops = 1;
|
asn1_flag = 0;
|
||||||
break;
|
else
|
||||||
}
|
goto bad;
|
||||||
argc--;
|
}
|
||||||
argv++;
|
else if (strcmp(*argv, "-param_out") == 0)
|
||||||
}
|
param_out = 1;
|
||||||
|
else if (strcmp(*argv, "-pubin") == 0)
|
||||||
|
pubin=1;
|
||||||
|
else if (strcmp(*argv, "-pubout") == 0)
|
||||||
|
pubout=1;
|
||||||
|
else if ((enc=EVP_get_cipherbyname(&(argv[0][1]))) == NULL)
|
||||||
|
{
|
||||||
|
BIO_printf(bio_err, "unknown option %s\n", *argv);
|
||||||
|
badops=1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
argc--;
|
||||||
|
argv++;
|
||||||
|
}
|
||||||
|
|
||||||
if (badops) {
|
if (badops)
|
||||||
bad:
|
{
|
||||||
BIO_printf(bio_err, "%s [options] <infile >outfile\n", prog);
|
bad:
|
||||||
BIO_printf(bio_err, "where options are\n");
|
BIO_printf(bio_err, "%s [options] <infile >outfile\n", prog);
|
||||||
BIO_printf(bio_err, " -inform arg input format - "
|
BIO_printf(bio_err, "where options are\n");
|
||||||
"DER or PEM\n");
|
BIO_printf(bio_err, " -inform arg input format - "
|
||||||
BIO_printf(bio_err, " -outform arg output format - "
|
"DER or PEM\n");
|
||||||
"DER or PEM\n");
|
BIO_printf(bio_err, " -outform arg output format - "
|
||||||
BIO_printf(bio_err, " -in arg input file\n");
|
"DER or PEM\n");
|
||||||
BIO_printf(bio_err, " -passin arg input file pass "
|
BIO_printf(bio_err, " -in arg input file\n");
|
||||||
"phrase source\n");
|
BIO_printf(bio_err, " -passin arg input file pass "
|
||||||
BIO_printf(bio_err, " -out arg output file\n");
|
"phrase source\n");
|
||||||
BIO_printf(bio_err, " -passout arg output file pass "
|
BIO_printf(bio_err, " -out arg output file\n");
|
||||||
"phrase source\n");
|
BIO_printf(bio_err, " -passout arg output file pass "
|
||||||
BIO_printf(bio_err, " -engine e use engine e, "
|
"phrase source\n");
|
||||||
"possibly a hardware device.\n");
|
BIO_printf(bio_err, " -engine e use engine e, "
|
||||||
BIO_printf(bio_err, " -des encrypt PEM output, "
|
"possibly a hardware device.\n");
|
||||||
"instead of 'des' every other \n"
|
BIO_printf(bio_err, " -des encrypt PEM output, "
|
||||||
" cipher "
|
"instead of 'des' every other \n"
|
||||||
"supported by OpenSSL can be used\n");
|
" cipher "
|
||||||
BIO_printf(bio_err, " -text print the key\n");
|
"supported by OpenSSL can be used\n");
|
||||||
BIO_printf(bio_err, " -noout don't print key out\n");
|
BIO_printf(bio_err, " -text print the key\n");
|
||||||
BIO_printf(bio_err, " -param_out print the elliptic "
|
BIO_printf(bio_err, " -noout don't print key out\n");
|
||||||
"curve parameters\n");
|
BIO_printf(bio_err, " -param_out print the elliptic "
|
||||||
BIO_printf(bio_err, " -conv_form arg specifies the "
|
"curve parameters\n");
|
||||||
"point conversion form \n");
|
BIO_printf(bio_err, " -conv_form arg specifies the "
|
||||||
BIO_printf(bio_err, " possible values:"
|
"point conversion form \n");
|
||||||
" compressed\n");
|
BIO_printf(bio_err, " possible values:"
|
||||||
BIO_printf(bio_err, " "
|
" compressed\n");
|
||||||
" uncompressed (default)\n");
|
BIO_printf(bio_err, " "
|
||||||
BIO_printf(bio_err, " " " hybrid\n");
|
" uncompressed (default)\n");
|
||||||
BIO_printf(bio_err, " -param_enc arg specifies the way"
|
BIO_printf(bio_err, " "
|
||||||
" the ec parameters are encoded\n");
|
" hybrid\n");
|
||||||
BIO_printf(bio_err, " in the asn1 der " "encoding\n");
|
BIO_printf(bio_err, " -param_enc arg specifies the way"
|
||||||
BIO_printf(bio_err, " possible values:"
|
" the ec parameters are encoded\n");
|
||||||
" named_curve (default)\n");
|
BIO_printf(bio_err, " in the asn1 der "
|
||||||
BIO_printf(bio_err, " "
|
"encoding\n");
|
||||||
"explicit\n");
|
BIO_printf(bio_err, " possible values:"
|
||||||
goto end;
|
" named_curve (default)\n");
|
||||||
}
|
BIO_printf(bio_err," "
|
||||||
|
"explicit\n");
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
ERR_load_crypto_strings();
|
ERR_load_crypto_strings();
|
||||||
|
|
||||||
# ifndef OPENSSL_NO_ENGINE
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
setup_engine(bio_err, engine, 0);
|
setup_engine(bio_err, engine, 0);
|
||||||
# endif
|
#endif
|
||||||
|
|
||||||
if (!app_passwd(bio_err, passargin, passargout, &passin, &passout)) {
|
if(!app_passwd(bio_err, passargin, passargout, &passin, &passout))
|
||||||
BIO_printf(bio_err, "Error getting passwords\n");
|
{
|
||||||
goto end;
|
BIO_printf(bio_err, "Error getting passwords\n");
|
||||||
}
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
in = BIO_new(BIO_s_file());
|
in = BIO_new(BIO_s_file());
|
||||||
out = BIO_new(BIO_s_file());
|
out = BIO_new(BIO_s_file());
|
||||||
if ((in == NULL) || (out == NULL)) {
|
if ((in == NULL) || (out == NULL))
|
||||||
ERR_print_errors(bio_err);
|
{
|
||||||
goto end;
|
ERR_print_errors(bio_err);
|
||||||
}
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
if (infile == NULL)
|
if (infile == NULL)
|
||||||
BIO_set_fp(in, stdin, BIO_NOCLOSE);
|
BIO_set_fp(in, stdin, BIO_NOCLOSE);
|
||||||
else {
|
else
|
||||||
if (BIO_read_filename(in, infile) <= 0) {
|
{
|
||||||
perror(infile);
|
if (BIO_read_filename(in, infile) <= 0)
|
||||||
goto end;
|
{
|
||||||
}
|
perror(infile);
|
||||||
}
|
goto end;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
BIO_printf(bio_err, "read EC key\n");
|
BIO_printf(bio_err, "read EC key\n");
|
||||||
if (informat == FORMAT_ASN1) {
|
if (informat == FORMAT_ASN1)
|
||||||
if (pubin)
|
{
|
||||||
eckey = d2i_EC_PUBKEY_bio(in, NULL);
|
if (pubin)
|
||||||
else
|
eckey = d2i_EC_PUBKEY_bio(in, NULL);
|
||||||
eckey = d2i_ECPrivateKey_bio(in, NULL);
|
else
|
||||||
} else if (informat == FORMAT_PEM) {
|
eckey = d2i_ECPrivateKey_bio(in, NULL);
|
||||||
if (pubin)
|
}
|
||||||
eckey = PEM_read_bio_EC_PUBKEY(in, NULL, NULL, NULL);
|
else if (informat == FORMAT_PEM)
|
||||||
else
|
{
|
||||||
eckey = PEM_read_bio_ECPrivateKey(in, NULL, NULL, passin);
|
if (pubin)
|
||||||
} else {
|
eckey = PEM_read_bio_EC_PUBKEY(in, NULL, NULL,
|
||||||
BIO_printf(bio_err, "bad input format specified for key\n");
|
NULL);
|
||||||
goto end;
|
else
|
||||||
}
|
eckey = PEM_read_bio_ECPrivateKey(in, NULL, NULL,
|
||||||
if (eckey == NULL) {
|
passin);
|
||||||
BIO_printf(bio_err, "unable to load Key\n");
|
}
|
||||||
ERR_print_errors(bio_err);
|
else
|
||||||
goto end;
|
{
|
||||||
}
|
BIO_printf(bio_err, "bad input format specified for key\n");
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
if (eckey == NULL)
|
||||||
|
{
|
||||||
|
BIO_printf(bio_err,"unable to load Key\n");
|
||||||
|
ERR_print_errors(bio_err);
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
if (outfile == NULL) {
|
if (outfile == NULL)
|
||||||
BIO_set_fp(out, stdout, BIO_NOCLOSE);
|
{
|
||||||
# ifdef OPENSSL_SYS_VMS
|
BIO_set_fp(out, stdout, BIO_NOCLOSE);
|
||||||
{
|
#ifdef OPENSSL_SYS_VMS
|
||||||
BIO *tmpbio = BIO_new(BIO_f_linebuffer());
|
{
|
||||||
out = BIO_push(tmpbio, out);
|
BIO *tmpbio = BIO_new(BIO_f_linebuffer());
|
||||||
}
|
out = BIO_push(tmpbio, out);
|
||||||
# endif
|
}
|
||||||
} else {
|
#endif
|
||||||
if (BIO_write_filename(out, outfile) <= 0) {
|
}
|
||||||
perror(outfile);
|
else
|
||||||
goto end;
|
{
|
||||||
}
|
if (BIO_write_filename(out, outfile) <= 0)
|
||||||
}
|
{
|
||||||
|
perror(outfile);
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
group = EC_KEY_get0_group(eckey);
|
group = EC_KEY_get0_group(eckey);
|
||||||
|
|
||||||
if (new_form)
|
if (new_form)
|
||||||
EC_KEY_set_conv_form(eckey, form);
|
EC_KEY_set_conv_form(eckey, form);
|
||||||
|
|
||||||
if (new_asn1_flag)
|
if (new_asn1_flag)
|
||||||
EC_KEY_set_asn1_flag(eckey, asn1_flag);
|
EC_KEY_set_asn1_flag(eckey, asn1_flag);
|
||||||
|
|
||||||
if (text)
|
if (text)
|
||||||
if (!EC_KEY_print(out, eckey, 0)) {
|
if (!EC_KEY_print(out, eckey, 0))
|
||||||
perror(outfile);
|
{
|
||||||
ERR_print_errors(bio_err);
|
perror(outfile);
|
||||||
goto end;
|
ERR_print_errors(bio_err);
|
||||||
}
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
if (noout) {
|
if (noout)
|
||||||
ret = 0;
|
{
|
||||||
goto end;
|
ret = 0;
|
||||||
}
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
BIO_printf(bio_err, "writing EC key\n");
|
BIO_printf(bio_err, "writing EC key\n");
|
||||||
if (outformat == FORMAT_ASN1) {
|
if (outformat == FORMAT_ASN1)
|
||||||
if (param_out)
|
{
|
||||||
i = i2d_ECPKParameters_bio(out, group);
|
if (param_out)
|
||||||
else if (pubin || pubout)
|
i = i2d_ECPKParameters_bio(out, group);
|
||||||
i = i2d_EC_PUBKEY_bio(out, eckey);
|
else if (pubin || pubout)
|
||||||
else
|
i = i2d_EC_PUBKEY_bio(out, eckey);
|
||||||
i = i2d_ECPrivateKey_bio(out, eckey);
|
else
|
||||||
} else if (outformat == FORMAT_PEM) {
|
i = i2d_ECPrivateKey_bio(out, eckey);
|
||||||
if (param_out)
|
}
|
||||||
i = PEM_write_bio_ECPKParameters(out, group);
|
else if (outformat == FORMAT_PEM)
|
||||||
else if (pubin || pubout)
|
{
|
||||||
i = PEM_write_bio_EC_PUBKEY(out, eckey);
|
if (param_out)
|
||||||
else
|
i = PEM_write_bio_ECPKParameters(out, group);
|
||||||
i = PEM_write_bio_ECPrivateKey(out, eckey, enc,
|
else if (pubin || pubout)
|
||||||
NULL, 0, NULL, passout);
|
i = PEM_write_bio_EC_PUBKEY(out, eckey);
|
||||||
} else {
|
else
|
||||||
BIO_printf(bio_err, "bad output format specified for " "outfile\n");
|
i = PEM_write_bio_ECPrivateKey(out, eckey, enc,
|
||||||
goto end;
|
NULL, 0, NULL, passout);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
BIO_printf(bio_err, "bad output format specified for "
|
||||||
|
"outfile\n");
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
if (!i) {
|
if (!i)
|
||||||
BIO_printf(bio_err, "unable to write private key\n");
|
{
|
||||||
ERR_print_errors(bio_err);
|
BIO_printf(bio_err, "unable to write private key\n");
|
||||||
} else
|
ERR_print_errors(bio_err);
|
||||||
ret = 0;
|
}
|
||||||
end:
|
else
|
||||||
if (in)
|
ret=0;
|
||||||
BIO_free(in);
|
end:
|
||||||
if (out)
|
if (in)
|
||||||
BIO_free_all(out);
|
BIO_free(in);
|
||||||
if (eckey)
|
if (out)
|
||||||
EC_KEY_free(eckey);
|
BIO_free_all(out);
|
||||||
if (passin)
|
if (eckey)
|
||||||
OPENSSL_free(passin);
|
EC_KEY_free(eckey);
|
||||||
if (passout)
|
if (passin)
|
||||||
OPENSSL_free(passout);
|
OPENSSL_free(passin);
|
||||||
apps_shutdown();
|
if (passout)
|
||||||
OPENSSL_EXIT(ret);
|
OPENSSL_free(passout);
|
||||||
|
apps_shutdown();
|
||||||
|
OPENSSL_EXIT(ret);
|
||||||
}
|
}
|
||||||
#else /* !OPENSSL_NO_EC */
|
#else /* !OPENSSL_NO_EC */
|
||||||
|
|
||||||
# if PEDANTIC
|
# if PEDANTIC
|
||||||
static void *dummy = &dummy;
|
static void *dummy=&dummy;
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
1065
apps/ecparam.c
1065
apps/ecparam.c
File diff suppressed because it is too large
Load Diff
1137
apps/enc.c
1137
apps/enc.c
File diff suppressed because it is too large
Load Diff
845
apps/engine.c
845
apps/engine.c
@@ -1,7 +1,6 @@
|
|||||||
/* apps/engine.c */
|
/* apps/engine.c -*- mode: C; c-file-style: "eay" -*- */
|
||||||
/*
|
/* Written by Richard Levitte <richard@levitte.org> for the OpenSSL
|
||||||
* Written by Richard Levitte <richard@levitte.org> for the OpenSSL project
|
* project 2000.
|
||||||
* 2000.
|
|
||||||
*/
|
*/
|
||||||
/* ====================================================================
|
/* ====================================================================
|
||||||
* Copyright (c) 2000 The OpenSSL Project. All rights reserved.
|
* Copyright (c) 2000 The OpenSSL Project. All rights reserved.
|
||||||
@@ -57,456 +56,494 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#ifdef OPENSSL_NO_STDIO
|
#ifdef OPENSSL_NO_STDIO
|
||||||
# define APPS_WIN16
|
#define APPS_WIN16
|
||||||
#endif
|
#endif
|
||||||
#include "apps.h"
|
#include "apps.h"
|
||||||
#include <openssl/err.h>
|
#include <openssl/err.h>
|
||||||
#ifndef OPENSSL_NO_ENGINE
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
# include <openssl/engine.h>
|
#include <openssl/engine.h>
|
||||||
# include <openssl/ssl.h>
|
#include <openssl/ssl.h>
|
||||||
|
|
||||||
# undef PROG
|
#undef PROG
|
||||||
# define PROG engine_main
|
#define PROG engine_main
|
||||||
|
|
||||||
static const char *engine_usage[] = {
|
static const char *engine_usage[]={
|
||||||
"usage: engine opts [engine ...]\n",
|
"usage: engine opts [engine ...]\n",
|
||||||
" -v[v[v[v]]] - verbose mode, for each engine, list its 'control commands'\n",
|
" -v[v[v[v]]] - verbose mode, for each engine, list its 'control commands'\n",
|
||||||
" -vv will additionally display each command's description\n",
|
" -vv will additionally display each command's description\n",
|
||||||
" -vvv will also add the input flags for each command\n",
|
" -vvv will also add the input flags for each command\n",
|
||||||
" -vvvv will also show internal input flags\n",
|
" -vvvv will also show internal input flags\n",
|
||||||
" -c - for each engine, also list the capabilities\n",
|
" -c - for each engine, also list the capabilities\n",
|
||||||
" -t[t] - for each engine, check that they are really available\n",
|
" -t[t] - for each engine, check that they are really available\n",
|
||||||
" -tt will display error trace for unavailable engines\n",
|
" -tt will display error trace for unavailable engines\n",
|
||||||
" -pre <cmd> - runs command 'cmd' against the ENGINE before any attempts\n",
|
" -pre <cmd> - runs command 'cmd' against the ENGINE before any attempts\n",
|
||||||
" to load it (if -t is used)\n",
|
" to load it (if -t is used)\n",
|
||||||
" -post <cmd> - runs command 'cmd' against the ENGINE after loading it\n",
|
" -post <cmd> - runs command 'cmd' against the ENGINE after loading it\n",
|
||||||
" (only used if -t is also provided)\n",
|
" (only used if -t is also provided)\n",
|
||||||
" NB: -pre and -post will be applied to all ENGINEs supplied on the command\n",
|
" NB: -pre and -post will be applied to all ENGINEs supplied on the command\n",
|
||||||
" line, or all supported ENGINEs if none are specified.\n",
|
" line, or all supported ENGINEs if none are specified.\n",
|
||||||
" Eg. '-pre \"SO_PATH:/lib/libdriver.so\"' calls command \"SO_PATH\" with\n",
|
" Eg. '-pre \"SO_PATH:/lib/libdriver.so\"' calls command \"SO_PATH\" with\n",
|
||||||
" argument \"/lib/libdriver.so\".\n",
|
" argument \"/lib/libdriver.so\".\n",
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
static void identity(char *ptr)
|
static void identity(char *ptr)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int append_buf(char **buf, const char *s, int *size, int step)
|
static int append_buf(char **buf, const char *s, int *size, int step)
|
||||||
{
|
{
|
||||||
if (*buf == NULL) {
|
int l = strlen(s);
|
||||||
*size = step;
|
|
||||||
*buf = OPENSSL_malloc(*size);
|
|
||||||
if (*buf == NULL)
|
|
||||||
return 0;
|
|
||||||
**buf = '\0';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (strlen(*buf) + strlen(s) >= (unsigned int)*size) {
|
if (*buf == NULL)
|
||||||
*size += step;
|
{
|
||||||
*buf = OPENSSL_realloc(*buf, *size);
|
*size = step;
|
||||||
}
|
*buf = OPENSSL_malloc(*size);
|
||||||
|
if (*buf == NULL)
|
||||||
|
return 0;
|
||||||
|
**buf = '\0';
|
||||||
|
}
|
||||||
|
|
||||||
if (*buf == NULL)
|
if (**buf != '\0')
|
||||||
return 0;
|
l += 2; /* ", " */
|
||||||
|
|
||||||
if (**buf != '\0')
|
if (strlen(*buf) + strlen(s) >= (unsigned int)*size)
|
||||||
BUF_strlcat(*buf, ", ", *size);
|
{
|
||||||
BUF_strlcat(*buf, s, *size);
|
*size += step;
|
||||||
|
*buf = OPENSSL_realloc(*buf, *size);
|
||||||
|
}
|
||||||
|
|
||||||
return 1;
|
if (*buf == NULL)
|
||||||
}
|
return 0;
|
||||||
|
|
||||||
|
if (**buf != '\0')
|
||||||
|
BUF_strlcat(*buf, ", ", *size);
|
||||||
|
BUF_strlcat(*buf, s, *size);
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
static int util_flags(BIO *bio_out, unsigned int flags, const char *indent)
|
static int util_flags(BIO *bio_out, unsigned int flags, const char *indent)
|
||||||
{
|
{
|
||||||
int started = 0, err = 0;
|
int started = 0, err = 0;
|
||||||
/* Indent before displaying input flags */
|
/* Indent before displaying input flags */
|
||||||
BIO_printf(bio_out, "%s%s(input flags): ", indent, indent);
|
BIO_printf(bio_out, "%s%s(input flags): ", indent, indent);
|
||||||
if (flags == 0) {
|
if(flags == 0)
|
||||||
BIO_printf(bio_out, "<no flags>\n");
|
{
|
||||||
return 1;
|
BIO_printf(bio_out, "<no flags>\n");
|
||||||
}
|
return 1;
|
||||||
/*
|
}
|
||||||
* If the object is internal, mark it in a way that shows instead of
|
/* If the object is internal, mark it in a way that shows instead of
|
||||||
* having it part of all the other flags, even if it really is.
|
* having it part of all the other flags, even if it really is. */
|
||||||
*/
|
if(flags & ENGINE_CMD_FLAG_INTERNAL)
|
||||||
if (flags & ENGINE_CMD_FLAG_INTERNAL) {
|
{
|
||||||
BIO_printf(bio_out, "[Internal] ");
|
BIO_printf(bio_out, "[Internal] ");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (flags & ENGINE_CMD_FLAG_NUMERIC) {
|
if(flags & ENGINE_CMD_FLAG_NUMERIC)
|
||||||
BIO_printf(bio_out, "NUMERIC");
|
{
|
||||||
started = 1;
|
BIO_printf(bio_out, "NUMERIC");
|
||||||
}
|
started = 1;
|
||||||
/*
|
}
|
||||||
* Now we check that no combinations of the mutually exclusive NUMERIC,
|
/* Now we check that no combinations of the mutually exclusive NUMERIC,
|
||||||
* STRING, and NO_INPUT flags have been used. Future flags that can be
|
* STRING, and NO_INPUT flags have been used. Future flags that can be
|
||||||
* OR'd together with these would need to added after these to preserve
|
* OR'd together with these would need to added after these to preserve
|
||||||
* the testing logic.
|
* the testing logic. */
|
||||||
*/
|
if(flags & ENGINE_CMD_FLAG_STRING)
|
||||||
if (flags & ENGINE_CMD_FLAG_STRING) {
|
{
|
||||||
if (started) {
|
if(started)
|
||||||
BIO_printf(bio_out, "|");
|
{
|
||||||
err = 1;
|
BIO_printf(bio_out, "|");
|
||||||
}
|
err = 1;
|
||||||
BIO_printf(bio_out, "STRING");
|
}
|
||||||
started = 1;
|
BIO_printf(bio_out, "STRING");
|
||||||
}
|
started = 1;
|
||||||
if (flags & ENGINE_CMD_FLAG_NO_INPUT) {
|
}
|
||||||
if (started) {
|
if(flags & ENGINE_CMD_FLAG_NO_INPUT)
|
||||||
BIO_printf(bio_out, "|");
|
{
|
||||||
err = 1;
|
if(started)
|
||||||
}
|
{
|
||||||
BIO_printf(bio_out, "NO_INPUT");
|
BIO_printf(bio_out, "|");
|
||||||
started = 1;
|
err = 1;
|
||||||
}
|
}
|
||||||
/* Check for unknown flags */
|
BIO_printf(bio_out, "NO_INPUT");
|
||||||
flags = flags & ~ENGINE_CMD_FLAG_NUMERIC &
|
started = 1;
|
||||||
~ENGINE_CMD_FLAG_STRING &
|
}
|
||||||
~ENGINE_CMD_FLAG_NO_INPUT & ~ENGINE_CMD_FLAG_INTERNAL;
|
/* Check for unknown flags */
|
||||||
if (flags) {
|
flags = flags & ~ENGINE_CMD_FLAG_NUMERIC &
|
||||||
if (started)
|
~ENGINE_CMD_FLAG_STRING &
|
||||||
BIO_printf(bio_out, "|");
|
~ENGINE_CMD_FLAG_NO_INPUT &
|
||||||
BIO_printf(bio_out, "<0x%04X>", flags);
|
~ENGINE_CMD_FLAG_INTERNAL;
|
||||||
}
|
if(flags)
|
||||||
if (err)
|
{
|
||||||
BIO_printf(bio_out, " <illegal flags!>");
|
if(started) BIO_printf(bio_out, "|");
|
||||||
BIO_printf(bio_out, "\n");
|
BIO_printf(bio_out, "<0x%04X>", flags);
|
||||||
return 1;
|
}
|
||||||
}
|
if(err)
|
||||||
|
BIO_printf(bio_out, " <illegal flags!>");
|
||||||
|
BIO_printf(bio_out, "\n");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
static int util_verbose(ENGINE *e, int verbose, BIO *bio_out,
|
static int util_verbose(ENGINE *e, int verbose, BIO *bio_out, const char *indent)
|
||||||
const char *indent)
|
{
|
||||||
{
|
static const int line_wrap = 78;
|
||||||
static const int line_wrap = 78;
|
int num;
|
||||||
int num;
|
int ret = 0;
|
||||||
int ret = 0;
|
char *name = NULL;
|
||||||
char *name = NULL;
|
char *desc = NULL;
|
||||||
char *desc = NULL;
|
int flags;
|
||||||
int flags;
|
int xpos = 0;
|
||||||
int xpos = 0;
|
STACK_OF(OPENSSL_STRING) *cmds = NULL;
|
||||||
STACK_OF(OPENSSL_STRING) *cmds = NULL;
|
if(!ENGINE_ctrl(e, ENGINE_CTRL_HAS_CTRL_FUNCTION, 0, NULL, NULL) ||
|
||||||
if (!ENGINE_ctrl(e, ENGINE_CTRL_HAS_CTRL_FUNCTION, 0, NULL, NULL) ||
|
((num = ENGINE_ctrl(e, ENGINE_CTRL_GET_FIRST_CMD_TYPE,
|
||||||
((num = ENGINE_ctrl(e, ENGINE_CTRL_GET_FIRST_CMD_TYPE,
|
0, NULL, NULL)) <= 0))
|
||||||
0, NULL, NULL)) <= 0)) {
|
{
|
||||||
# if 0
|
#if 0
|
||||||
BIO_printf(bio_out, "%s<no control commands>\n", indent);
|
BIO_printf(bio_out, "%s<no control commands>\n", indent);
|
||||||
# endif
|
#endif
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
cmds = sk_OPENSSL_STRING_new_null();
|
cmds = sk_OPENSSL_STRING_new_null();
|
||||||
|
|
||||||
if (!cmds)
|
if(!cmds)
|
||||||
goto err;
|
goto err;
|
||||||
do {
|
do {
|
||||||
int len;
|
int len;
|
||||||
/* Get the command input flags */
|
/* Get the command input flags */
|
||||||
if ((flags = ENGINE_ctrl(e, ENGINE_CTRL_GET_CMD_FLAGS, num,
|
if((flags = ENGINE_ctrl(e, ENGINE_CTRL_GET_CMD_FLAGS, num,
|
||||||
NULL, NULL)) < 0)
|
NULL, NULL)) < 0)
|
||||||
goto err;
|
goto err;
|
||||||
if (!(flags & ENGINE_CMD_FLAG_INTERNAL) || verbose >= 4) {
|
if (!(flags & ENGINE_CMD_FLAG_INTERNAL) || verbose >= 4)
|
||||||
/* Get the command name */
|
{
|
||||||
if ((len = ENGINE_ctrl(e, ENGINE_CTRL_GET_NAME_LEN_FROM_CMD, num,
|
/* Get the command name */
|
||||||
NULL, NULL)) <= 0)
|
if((len = ENGINE_ctrl(e, ENGINE_CTRL_GET_NAME_LEN_FROM_CMD, num,
|
||||||
goto err;
|
NULL, NULL)) <= 0)
|
||||||
if ((name = OPENSSL_malloc(len + 1)) == NULL)
|
goto err;
|
||||||
goto err;
|
if((name = OPENSSL_malloc(len + 1)) == NULL)
|
||||||
if (ENGINE_ctrl(e, ENGINE_CTRL_GET_NAME_FROM_CMD, num, name,
|
goto err;
|
||||||
NULL) <= 0)
|
if(ENGINE_ctrl(e, ENGINE_CTRL_GET_NAME_FROM_CMD, num, name,
|
||||||
goto err;
|
|
||||||
/* Get the command description */
|
|
||||||
if ((len = ENGINE_ctrl(e, ENGINE_CTRL_GET_DESC_LEN_FROM_CMD, num,
|
|
||||||
NULL, NULL)) < 0)
|
|
||||||
goto err;
|
|
||||||
if (len > 0) {
|
|
||||||
if ((desc = OPENSSL_malloc(len + 1)) == NULL)
|
|
||||||
goto err;
|
|
||||||
if (ENGINE_ctrl(e, ENGINE_CTRL_GET_DESC_FROM_CMD, num, desc,
|
|
||||||
NULL) <= 0)
|
NULL) <= 0)
|
||||||
goto err;
|
goto err;
|
||||||
}
|
/* Get the command description */
|
||||||
/* Now decide on the output */
|
if((len = ENGINE_ctrl(e, ENGINE_CTRL_GET_DESC_LEN_FROM_CMD, num,
|
||||||
if (xpos == 0)
|
NULL, NULL)) < 0)
|
||||||
/* Do an indent */
|
goto err;
|
||||||
xpos = BIO_puts(bio_out, indent);
|
if(len > 0)
|
||||||
else
|
{
|
||||||
/* Otherwise prepend a ", " */
|
if((desc = OPENSSL_malloc(len + 1)) == NULL)
|
||||||
xpos += BIO_printf(bio_out, ", ");
|
goto err;
|
||||||
if (verbose == 1) {
|
if(ENGINE_ctrl(e, ENGINE_CTRL_GET_DESC_FROM_CMD, num, desc,
|
||||||
/*
|
NULL) <= 0)
|
||||||
* We're just listing names, comma-delimited
|
goto err;
|
||||||
*/
|
}
|
||||||
if ((xpos > (int)strlen(indent)) &&
|
/* Now decide on the output */
|
||||||
(xpos + (int)strlen(name) > line_wrap)) {
|
if(xpos == 0)
|
||||||
BIO_printf(bio_out, "\n");
|
/* Do an indent */
|
||||||
xpos = BIO_puts(bio_out, indent);
|
xpos = BIO_puts(bio_out, indent);
|
||||||
}
|
else
|
||||||
xpos += BIO_printf(bio_out, "%s", name);
|
/* Otherwise prepend a ", " */
|
||||||
} else {
|
xpos += BIO_printf(bio_out, ", ");
|
||||||
/* We're listing names plus descriptions */
|
if(verbose == 1)
|
||||||
BIO_printf(bio_out, "%s: %s\n", name,
|
{
|
||||||
(desc == NULL) ? "<no description>" : desc);
|
/* We're just listing names, comma-delimited */
|
||||||
/* ... and sometimes input flags */
|
if((xpos > (int)strlen(indent)) &&
|
||||||
if ((verbose >= 3) && !util_flags(bio_out, flags, indent))
|
(xpos + (int)strlen(name) > line_wrap))
|
||||||
goto err;
|
{
|
||||||
xpos = 0;
|
BIO_printf(bio_out, "\n");
|
||||||
}
|
xpos = BIO_puts(bio_out, indent);
|
||||||
}
|
}
|
||||||
OPENSSL_free(name);
|
xpos += BIO_printf(bio_out, "%s", name);
|
||||||
name = NULL;
|
}
|
||||||
if (desc) {
|
else
|
||||||
OPENSSL_free(desc);
|
{
|
||||||
desc = NULL;
|
/* We're listing names plus descriptions */
|
||||||
}
|
BIO_printf(bio_out, "%s: %s\n", name,
|
||||||
/* Move to the next command */
|
(desc == NULL) ? "<no description>" : desc);
|
||||||
num = ENGINE_ctrl(e, ENGINE_CTRL_GET_NEXT_CMD_TYPE, num, NULL, NULL);
|
/* ... and sometimes input flags */
|
||||||
} while (num > 0);
|
if((verbose >= 3) && !util_flags(bio_out, flags,
|
||||||
if (xpos > 0)
|
indent))
|
||||||
BIO_printf(bio_out, "\n");
|
goto err;
|
||||||
ret = 1;
|
xpos = 0;
|
||||||
err:
|
}
|
||||||
if (cmds)
|
}
|
||||||
sk_OPENSSL_STRING_pop_free(cmds, identity);
|
OPENSSL_free(name); name = NULL;
|
||||||
if (name)
|
if(desc) { OPENSSL_free(desc); desc = NULL; }
|
||||||
OPENSSL_free(name);
|
/* Move to the next command */
|
||||||
if (desc)
|
num = ENGINE_ctrl(e, ENGINE_CTRL_GET_NEXT_CMD_TYPE,
|
||||||
OPENSSL_free(desc);
|
num, NULL, NULL);
|
||||||
return ret;
|
} while(num > 0);
|
||||||
}
|
if(xpos > 0)
|
||||||
|
BIO_printf(bio_out, "\n");
|
||||||
|
ret = 1;
|
||||||
|
err:
|
||||||
|
if(cmds) sk_OPENSSL_STRING_pop_free(cmds, identity);
|
||||||
|
if(name) OPENSSL_free(name);
|
||||||
|
if(desc) OPENSSL_free(desc);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
static void util_do_cmds(ENGINE *e, STACK_OF(OPENSSL_STRING) *cmds,
|
static void util_do_cmds(ENGINE *e, STACK_OF(OPENSSL_STRING) *cmds,
|
||||||
BIO *bio_out, const char *indent)
|
BIO *bio_out, const char *indent)
|
||||||
{
|
{
|
||||||
int loop, res, num = sk_OPENSSL_STRING_num(cmds);
|
int loop, res, num = sk_OPENSSL_STRING_num(cmds);
|
||||||
|
|
||||||
if (num < 0) {
|
if(num < 0)
|
||||||
BIO_printf(bio_out, "[Error]: internal stack error\n");
|
{
|
||||||
return;
|
BIO_printf(bio_out, "[Error]: internal stack error\n");
|
||||||
}
|
return;
|
||||||
for (loop = 0; loop < num; loop++) {
|
}
|
||||||
char buf[256];
|
for(loop = 0; loop < num; loop++)
|
||||||
const char *cmd, *arg;
|
{
|
||||||
cmd = sk_OPENSSL_STRING_value(cmds, loop);
|
char buf[256];
|
||||||
res = 1; /* assume success */
|
const char *cmd, *arg;
|
||||||
/* Check if this command has no ":arg" */
|
cmd = sk_OPENSSL_STRING_value(cmds, loop);
|
||||||
if ((arg = strstr(cmd, ":")) == NULL) {
|
res = 1; /* assume success */
|
||||||
if (!ENGINE_ctrl_cmd_string(e, cmd, NULL, 0))
|
/* Check if this command has no ":arg" */
|
||||||
res = 0;
|
if((arg = strstr(cmd, ":")) == NULL)
|
||||||
} else {
|
{
|
||||||
if ((int)(arg - cmd) > 254) {
|
if(!ENGINE_ctrl_cmd_string(e, cmd, NULL, 0))
|
||||||
BIO_printf(bio_out, "[Error]: command name too long\n");
|
res = 0;
|
||||||
return;
|
}
|
||||||
}
|
else
|
||||||
memcpy(buf, cmd, (int)(arg - cmd));
|
{
|
||||||
buf[arg - cmd] = '\0';
|
if((int)(arg - cmd) > 254)
|
||||||
arg++; /* Move past the ":" */
|
{
|
||||||
/* Call the command with the argument */
|
BIO_printf(bio_out,"[Error]: command name too long\n");
|
||||||
if (!ENGINE_ctrl_cmd_string(e, buf, arg, 0))
|
return;
|
||||||
res = 0;
|
}
|
||||||
}
|
memcpy(buf, cmd, (int)(arg - cmd));
|
||||||
if (res)
|
buf[arg-cmd] = '\0';
|
||||||
BIO_printf(bio_out, "[Success]: %s\n", cmd);
|
arg++; /* Move past the ":" */
|
||||||
else {
|
/* Call the command with the argument */
|
||||||
BIO_printf(bio_out, "[Failure]: %s\n", cmd);
|
if(!ENGINE_ctrl_cmd_string(e, buf, arg, 0))
|
||||||
ERR_print_errors(bio_out);
|
res = 0;
|
||||||
}
|
}
|
||||||
}
|
if(res)
|
||||||
}
|
BIO_printf(bio_out, "[Success]: %s\n", cmd);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
BIO_printf(bio_out, "[Failure]: %s\n", cmd);
|
||||||
|
ERR_print_errors(bio_out);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int MAIN(int, char **);
|
int MAIN(int, char **);
|
||||||
|
|
||||||
int MAIN(int argc, char **argv)
|
int MAIN(int argc, char **argv)
|
||||||
{
|
{
|
||||||
int ret = 1, i;
|
int ret=1,i;
|
||||||
const char **pp;
|
const char **pp;
|
||||||
int verbose = 0, list_cap = 0, test_avail = 0, test_avail_noise = 0;
|
int verbose=0, list_cap=0, test_avail=0, test_avail_noise = 0;
|
||||||
ENGINE *e;
|
ENGINE *e;
|
||||||
STACK_OF(OPENSSL_STRING) *engines = sk_OPENSSL_STRING_new_null();
|
STACK_OF(OPENSSL_STRING) *engines = sk_OPENSSL_STRING_new_null();
|
||||||
STACK_OF(OPENSSL_STRING) *pre_cmds = sk_OPENSSL_STRING_new_null();
|
STACK_OF(OPENSSL_STRING) *pre_cmds = sk_OPENSSL_STRING_new_null();
|
||||||
STACK_OF(OPENSSL_STRING) *post_cmds = sk_OPENSSL_STRING_new_null();
|
STACK_OF(OPENSSL_STRING) *post_cmds = sk_OPENSSL_STRING_new_null();
|
||||||
int badops = 1;
|
int badops=1;
|
||||||
BIO *bio_out = NULL;
|
BIO *bio_out=NULL;
|
||||||
const char *indent = " ";
|
const char *indent = " ";
|
||||||
|
|
||||||
apps_startup();
|
apps_startup();
|
||||||
SSL_load_error_strings();
|
SSL_load_error_strings();
|
||||||
|
|
||||||
if (bio_err == NULL)
|
if (bio_err == NULL)
|
||||||
bio_err = BIO_new_fp(stderr, BIO_NOCLOSE);
|
bio_err=BIO_new_fp(stderr,BIO_NOCLOSE);
|
||||||
|
|
||||||
if (!load_config(bio_err, NULL))
|
if (!load_config(bio_err, NULL))
|
||||||
goto end;
|
goto end;
|
||||||
bio_out = BIO_new_fp(stdout, BIO_NOCLOSE);
|
bio_out=BIO_new_fp(stdout,BIO_NOCLOSE);
|
||||||
# ifdef OPENSSL_SYS_VMS
|
#ifdef OPENSSL_SYS_VMS
|
||||||
{
|
{
|
||||||
BIO *tmpbio = BIO_new(BIO_f_linebuffer());
|
BIO *tmpbio = BIO_new(BIO_f_linebuffer());
|
||||||
bio_out = BIO_push(tmpbio, bio_out);
|
bio_out = BIO_push(tmpbio, bio_out);
|
||||||
}
|
}
|
||||||
# endif
|
#endif
|
||||||
|
|
||||||
argc--;
|
argc--;
|
||||||
argv++;
|
argv++;
|
||||||
while (argc >= 1) {
|
while (argc >= 1)
|
||||||
if (strncmp(*argv, "-v", 2) == 0) {
|
{
|
||||||
if (strspn(*argv + 1, "v") < strlen(*argv + 1))
|
if (strncmp(*argv,"-v",2) == 0)
|
||||||
goto skip_arg_loop;
|
{
|
||||||
if ((verbose = strlen(*argv + 1)) > 4)
|
if(strspn(*argv + 1, "v") < strlen(*argv + 1))
|
||||||
goto skip_arg_loop;
|
goto skip_arg_loop;
|
||||||
} else if (strcmp(*argv, "-c") == 0)
|
if((verbose=strlen(*argv + 1)) > 4)
|
||||||
list_cap = 1;
|
goto skip_arg_loop;
|
||||||
else if (strncmp(*argv, "-t", 2) == 0) {
|
}
|
||||||
test_avail = 1;
|
else if (strcmp(*argv,"-c") == 0)
|
||||||
if (strspn(*argv + 1, "t") < strlen(*argv + 1))
|
list_cap=1;
|
||||||
goto skip_arg_loop;
|
else if (strncmp(*argv,"-t",2) == 0)
|
||||||
if ((test_avail_noise = strlen(*argv + 1) - 1) > 1)
|
{
|
||||||
goto skip_arg_loop;
|
test_avail=1;
|
||||||
} else if (strcmp(*argv, "-pre") == 0) {
|
if(strspn(*argv + 1, "t") < strlen(*argv + 1))
|
||||||
argc--;
|
goto skip_arg_loop;
|
||||||
argv++;
|
if((test_avail_noise = strlen(*argv + 1) - 1) > 1)
|
||||||
if (argc == 0)
|
goto skip_arg_loop;
|
||||||
goto skip_arg_loop;
|
}
|
||||||
sk_OPENSSL_STRING_push(pre_cmds, *argv);
|
else if (strcmp(*argv,"-pre") == 0)
|
||||||
} else if (strcmp(*argv, "-post") == 0) {
|
{
|
||||||
argc--;
|
argc--; argv++;
|
||||||
argv++;
|
if (argc == 0)
|
||||||
if (argc == 0)
|
goto skip_arg_loop;
|
||||||
goto skip_arg_loop;
|
sk_OPENSSL_STRING_push(pre_cmds,*argv);
|
||||||
sk_OPENSSL_STRING_push(post_cmds, *argv);
|
}
|
||||||
} else if ((strncmp(*argv, "-h", 2) == 0) ||
|
else if (strcmp(*argv,"-post") == 0)
|
||||||
(strcmp(*argv, "-?") == 0))
|
{
|
||||||
goto skip_arg_loop;
|
argc--; argv++;
|
||||||
else
|
if (argc == 0)
|
||||||
sk_OPENSSL_STRING_push(engines, *argv);
|
goto skip_arg_loop;
|
||||||
argc--;
|
sk_OPENSSL_STRING_push(post_cmds,*argv);
|
||||||
argv++;
|
}
|
||||||
}
|
else if ((strncmp(*argv,"-h",2) == 0) ||
|
||||||
/* Looks like everything went OK */
|
(strcmp(*argv,"-?") == 0))
|
||||||
badops = 0;
|
goto skip_arg_loop;
|
||||||
skip_arg_loop:
|
else
|
||||||
|
sk_OPENSSL_STRING_push(engines,*argv);
|
||||||
|
argc--;
|
||||||
|
argv++;
|
||||||
|
}
|
||||||
|
/* Looks like everything went OK */
|
||||||
|
badops = 0;
|
||||||
|
skip_arg_loop:
|
||||||
|
|
||||||
if (badops) {
|
if (badops)
|
||||||
for (pp = engine_usage; (*pp != NULL); pp++)
|
{
|
||||||
BIO_printf(bio_err, "%s", *pp);
|
for (pp=engine_usage; (*pp != NULL); pp++)
|
||||||
goto end;
|
BIO_printf(bio_err,"%s",*pp);
|
||||||
}
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
if (sk_OPENSSL_STRING_num(engines) == 0) {
|
if (sk_OPENSSL_STRING_num(engines) == 0)
|
||||||
for (e = ENGINE_get_first(); e != NULL; e = ENGINE_get_next(e)) {
|
{
|
||||||
sk_OPENSSL_STRING_push(engines, (char *)ENGINE_get_id(e));
|
for(e = ENGINE_get_first(); e != NULL; e = ENGINE_get_next(e))
|
||||||
}
|
{
|
||||||
}
|
sk_OPENSSL_STRING_push(engines,(char *)ENGINE_get_id(e));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for (i = 0; i < sk_OPENSSL_STRING_num(engines); i++) {
|
for (i=0; i<sk_OPENSSL_STRING_num(engines); i++)
|
||||||
const char *id = sk_OPENSSL_STRING_value(engines, i);
|
{
|
||||||
if ((e = ENGINE_by_id(id)) != NULL) {
|
const char *id = sk_OPENSSL_STRING_value(engines,i);
|
||||||
const char *name = ENGINE_get_name(e);
|
if ((e = ENGINE_by_id(id)) != NULL)
|
||||||
/*
|
{
|
||||||
* Do "id" first, then "name". Easier to auto-parse.
|
const char *name = ENGINE_get_name(e);
|
||||||
*/
|
/* Do "id" first, then "name". Easier to auto-parse. */
|
||||||
BIO_printf(bio_out, "(%s) %s\n", id, name);
|
BIO_printf(bio_out, "(%s) %s\n", id, name);
|
||||||
util_do_cmds(e, pre_cmds, bio_out, indent);
|
util_do_cmds(e, pre_cmds, bio_out, indent);
|
||||||
if (strcmp(ENGINE_get_id(e), id) != 0) {
|
if (strcmp(ENGINE_get_id(e), id) != 0)
|
||||||
BIO_printf(bio_out, "Loaded: (%s) %s\n",
|
{
|
||||||
ENGINE_get_id(e), ENGINE_get_name(e));
|
BIO_printf(bio_out, "Loaded: (%s) %s\n",
|
||||||
}
|
ENGINE_get_id(e), ENGINE_get_name(e));
|
||||||
if (list_cap) {
|
}
|
||||||
int cap_size = 256;
|
if (list_cap)
|
||||||
char *cap_buf = NULL;
|
{
|
||||||
int k, n;
|
int cap_size = 256;
|
||||||
const int *nids;
|
char *cap_buf = NULL;
|
||||||
ENGINE_CIPHERS_PTR fn_c;
|
int k,n;
|
||||||
ENGINE_DIGESTS_PTR fn_d;
|
const int *nids;
|
||||||
ENGINE_PKEY_METHS_PTR fn_pk;
|
ENGINE_CIPHERS_PTR fn_c;
|
||||||
|
ENGINE_DIGESTS_PTR fn_d;
|
||||||
|
ENGINE_PKEY_METHS_PTR fn_pk;
|
||||||
|
|
||||||
if (ENGINE_get_RSA(e) != NULL
|
if (ENGINE_get_RSA(e) != NULL
|
||||||
&& !append_buf(&cap_buf, "RSA", &cap_size, 256))
|
&& !append_buf(&cap_buf, "RSA",
|
||||||
goto end;
|
&cap_size, 256))
|
||||||
if (ENGINE_get_DSA(e) != NULL
|
goto end;
|
||||||
&& !append_buf(&cap_buf, "DSA", &cap_size, 256))
|
if (ENGINE_get_DSA(e) != NULL
|
||||||
goto end;
|
&& !append_buf(&cap_buf, "DSA",
|
||||||
if (ENGINE_get_DH(e) != NULL
|
&cap_size, 256))
|
||||||
&& !append_buf(&cap_buf, "DH", &cap_size, 256))
|
goto end;
|
||||||
goto end;
|
if (ENGINE_get_DH(e) != NULL
|
||||||
if (ENGINE_get_RAND(e) != NULL
|
&& !append_buf(&cap_buf, "DH",
|
||||||
&& !append_buf(&cap_buf, "RAND", &cap_size, 256))
|
&cap_size, 256))
|
||||||
goto end;
|
goto end;
|
||||||
|
if (ENGINE_get_RAND(e) != NULL
|
||||||
|
&& !append_buf(&cap_buf, "RAND",
|
||||||
|
&cap_size, 256))
|
||||||
|
goto end;
|
||||||
|
|
||||||
fn_c = ENGINE_get_ciphers(e);
|
fn_c = ENGINE_get_ciphers(e);
|
||||||
if (!fn_c)
|
if(!fn_c) goto skip_ciphers;
|
||||||
goto skip_ciphers;
|
n = fn_c(e, NULL, &nids, 0);
|
||||||
n = fn_c(e, NULL, &nids, 0);
|
for(k=0 ; k < n ; ++k)
|
||||||
for (k = 0; k < n; ++k)
|
if(!append_buf(&cap_buf,
|
||||||
if (!append_buf(&cap_buf,
|
OBJ_nid2sn(nids[k]),
|
||||||
OBJ_nid2sn(nids[k]), &cap_size, 256))
|
&cap_size, 256))
|
||||||
goto end;
|
goto end;
|
||||||
|
|
||||||
skip_ciphers:
|
skip_ciphers:
|
||||||
fn_d = ENGINE_get_digests(e);
|
fn_d = ENGINE_get_digests(e);
|
||||||
if (!fn_d)
|
if(!fn_d) goto skip_digests;
|
||||||
goto skip_digests;
|
n = fn_d(e, NULL, &nids, 0);
|
||||||
n = fn_d(e, NULL, &nids, 0);
|
for(k=0 ; k < n ; ++k)
|
||||||
for (k = 0; k < n; ++k)
|
if(!append_buf(&cap_buf,
|
||||||
if (!append_buf(&cap_buf,
|
OBJ_nid2sn(nids[k]),
|
||||||
OBJ_nid2sn(nids[k]), &cap_size, 256))
|
&cap_size, 256))
|
||||||
goto end;
|
goto end;
|
||||||
|
|
||||||
skip_digests:
|
skip_digests:
|
||||||
fn_pk = ENGINE_get_pkey_meths(e);
|
fn_pk = ENGINE_get_pkey_meths(e);
|
||||||
if (!fn_pk)
|
if(!fn_pk) goto skip_pmeths;
|
||||||
goto skip_pmeths;
|
n = fn_pk(e, NULL, &nids, 0);
|
||||||
n = fn_pk(e, NULL, &nids, 0);
|
for(k=0 ; k < n ; ++k)
|
||||||
for (k = 0; k < n; ++k)
|
if(!append_buf(&cap_buf,
|
||||||
if (!append_buf(&cap_buf,
|
OBJ_nid2sn(nids[k]),
|
||||||
OBJ_nid2sn(nids[k]), &cap_size, 256))
|
&cap_size, 256))
|
||||||
goto end;
|
goto end;
|
||||||
skip_pmeths:
|
skip_pmeths:
|
||||||
if (cap_buf && (*cap_buf != '\0'))
|
if (cap_buf && (*cap_buf != '\0'))
|
||||||
BIO_printf(bio_out, " [%s]\n", cap_buf);
|
BIO_printf(bio_out, " [%s]\n", cap_buf);
|
||||||
|
|
||||||
OPENSSL_free(cap_buf);
|
OPENSSL_free(cap_buf);
|
||||||
}
|
}
|
||||||
if (test_avail) {
|
if(test_avail)
|
||||||
BIO_printf(bio_out, "%s", indent);
|
{
|
||||||
if (ENGINE_init(e)) {
|
BIO_printf(bio_out, "%s", indent);
|
||||||
BIO_printf(bio_out, "[ available ]\n");
|
if (ENGINE_init(e))
|
||||||
util_do_cmds(e, post_cmds, bio_out, indent);
|
{
|
||||||
ENGINE_finish(e);
|
BIO_printf(bio_out, "[ available ]\n");
|
||||||
} else {
|
util_do_cmds(e, post_cmds, bio_out, indent);
|
||||||
BIO_printf(bio_out, "[ unavailable ]\n");
|
ENGINE_finish(e);
|
||||||
if (test_avail_noise)
|
}
|
||||||
ERR_print_errors_fp(stdout);
|
else
|
||||||
ERR_clear_error();
|
{
|
||||||
}
|
BIO_printf(bio_out, "[ unavailable ]\n");
|
||||||
}
|
if(test_avail_noise)
|
||||||
if ((verbose > 0) && !util_verbose(e, verbose, bio_out, indent))
|
ERR_print_errors_fp(stdout);
|
||||||
goto end;
|
ERR_clear_error();
|
||||||
ENGINE_free(e);
|
}
|
||||||
} else
|
}
|
||||||
ERR_print_errors(bio_err);
|
if((verbose > 0) && !util_verbose(e, verbose, bio_out, indent))
|
||||||
}
|
goto end;
|
||||||
|
ENGINE_free(e);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
ERR_print_errors(bio_err);
|
||||||
|
}
|
||||||
|
|
||||||
ret = 0;
|
ret=0;
|
||||||
end:
|
end:
|
||||||
|
|
||||||
ERR_print_errors(bio_err);
|
ERR_print_errors(bio_err);
|
||||||
sk_OPENSSL_STRING_pop_free(engines, identity);
|
sk_OPENSSL_STRING_pop_free(engines, identity);
|
||||||
sk_OPENSSL_STRING_pop_free(pre_cmds, identity);
|
sk_OPENSSL_STRING_pop_free(pre_cmds, identity);
|
||||||
sk_OPENSSL_STRING_pop_free(post_cmds, identity);
|
sk_OPENSSL_STRING_pop_free(post_cmds, identity);
|
||||||
if (bio_out != NULL)
|
if (bio_out != NULL) BIO_free_all(bio_out);
|
||||||
BIO_free_all(bio_out);
|
apps_shutdown();
|
||||||
apps_shutdown();
|
OPENSSL_EXIT(ret);
|
||||||
OPENSSL_EXIT(ret);
|
}
|
||||||
}
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
# if PEDANTIC
|
# if PEDANTIC
|
||||||
static void *dummy = &dummy;
|
static void *dummy=&dummy;
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -66,56 +66,63 @@
|
|||||||
#include <openssl/ssl.h>
|
#include <openssl/ssl.h>
|
||||||
|
|
||||||
#undef PROG
|
#undef PROG
|
||||||
#define PROG errstr_main
|
#define PROG errstr_main
|
||||||
|
|
||||||
int MAIN(int, char **);
|
int MAIN(int, char **);
|
||||||
|
|
||||||
int MAIN(int argc, char **argv)
|
int MAIN(int argc, char **argv)
|
||||||
{
|
{
|
||||||
int i, ret = 0;
|
int i,ret=0;
|
||||||
char buf[256];
|
char buf[256];
|
||||||
unsigned long l;
|
unsigned long l;
|
||||||
|
|
||||||
apps_startup();
|
apps_startup();
|
||||||
|
|
||||||
if (bio_err == NULL)
|
if (bio_err == NULL)
|
||||||
if ((bio_err = BIO_new(BIO_s_file())) != NULL)
|
if ((bio_err=BIO_new(BIO_s_file())) != NULL)
|
||||||
BIO_set_fp(bio_err, stderr, BIO_NOCLOSE | BIO_FP_TEXT);
|
BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT);
|
||||||
|
|
||||||
SSL_load_error_strings();
|
SSL_load_error_strings();
|
||||||
|
|
||||||
if ((argc > 1) && (strcmp(argv[1], "-stats") == 0)) {
|
if ((argc > 1) && (strcmp(argv[1],"-stats") == 0))
|
||||||
BIO *out = NULL;
|
{
|
||||||
|
BIO *out=NULL;
|
||||||
|
|
||||||
out = BIO_new(BIO_s_file());
|
out=BIO_new(BIO_s_file());
|
||||||
if ((out != NULL) && BIO_set_fp(out, stdout, BIO_NOCLOSE)) {
|
if ((out != NULL) && BIO_set_fp(out,stdout,BIO_NOCLOSE))
|
||||||
|
{
|
||||||
#ifdef OPENSSL_SYS_VMS
|
#ifdef OPENSSL_SYS_VMS
|
||||||
{
|
{
|
||||||
BIO *tmpbio = BIO_new(BIO_f_linebuffer());
|
BIO *tmpbio = BIO_new(BIO_f_linebuffer());
|
||||||
out = BIO_push(tmpbio, out);
|
out = BIO_push(tmpbio, out);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
lh_ERR_STRING_DATA_node_stats_bio(ERR_get_string_table(), out);
|
lh_ERR_STRING_DATA_node_stats_bio(
|
||||||
lh_ERR_STRING_DATA_stats_bio(ERR_get_string_table(), out);
|
ERR_get_string_table(), out);
|
||||||
lh_ERR_STRING_DATA_node_usage_stats_bio(ERR_get_string_table(),
|
lh_ERR_STRING_DATA_stats_bio(ERR_get_string_table(),
|
||||||
out);
|
out);
|
||||||
}
|
lh_ERR_STRING_DATA_node_usage_stats_bio(
|
||||||
if (out != NULL)
|
ERR_get_string_table(),out);
|
||||||
BIO_free_all(out);
|
}
|
||||||
argc--;
|
if (out != NULL) BIO_free_all(out);
|
||||||
argv++;
|
argc--;
|
||||||
}
|
argv++;
|
||||||
|
}
|
||||||
|
|
||||||
for (i = 1; i < argc; i++) {
|
for (i=1; i<argc; i++)
|
||||||
if (sscanf(argv[i], "%lx", &l)) {
|
{
|
||||||
ERR_error_string_n(l, buf, sizeof buf);
|
if (sscanf(argv[i],"%lx",&l))
|
||||||
printf("%s\n", buf);
|
{
|
||||||
} else {
|
ERR_error_string_n(l, buf, sizeof buf);
|
||||||
printf("%s: bad error code\n", argv[i]);
|
printf("%s\n",buf);
|
||||||
printf("usage: errstr [-stats] <errno> ...\n");
|
}
|
||||||
ret++;
|
else
|
||||||
}
|
{
|
||||||
}
|
printf("%s: bad error code\n",argv[i]);
|
||||||
apps_shutdown();
|
printf("usage: errstr [-stats] <errno> ...\n");
|
||||||
OPENSSL_EXIT(ret);
|
ret++;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
apps_shutdown();
|
||||||
|
OPENSSL_EXIT(ret);
|
||||||
|
}
|
||||||
|
|||||||
309
apps/gendh.c
309
apps/gendh.c
@@ -58,191 +58,184 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <openssl/opensslconf.h>
|
#include <openssl/opensslconf.h>
|
||||||
/*
|
/* Until the key-gen callbacks are modified to use newer prototypes, we allow
|
||||||
* Until the key-gen callbacks are modified to use newer prototypes, we allow
|
* deprecated functions for openssl-internal code */
|
||||||
* deprecated functions for openssl-internal code
|
|
||||||
*/
|
|
||||||
#ifdef OPENSSL_NO_DEPRECATED
|
#ifdef OPENSSL_NO_DEPRECATED
|
||||||
# undef OPENSSL_NO_DEPRECATED
|
#undef OPENSSL_NO_DEPRECATED
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef OPENSSL_NO_DH
|
#ifndef OPENSSL_NO_DH
|
||||||
# include <stdio.h>
|
#include <stdio.h>
|
||||||
# include <string.h>
|
#include <string.h>
|
||||||
# include <sys/types.h>
|
#include <sys/types.h>
|
||||||
# include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
# include "apps.h"
|
#include "apps.h"
|
||||||
# include <openssl/bio.h>
|
#include <openssl/bio.h>
|
||||||
# include <openssl/rand.h>
|
#include <openssl/rand.h>
|
||||||
# include <openssl/err.h>
|
#include <openssl/err.h>
|
||||||
# include <openssl/bn.h>
|
#include <openssl/bn.h>
|
||||||
# include <openssl/dh.h>
|
#include <openssl/dh.h>
|
||||||
# include <openssl/x509.h>
|
#include <openssl/x509.h>
|
||||||
# include <openssl/pem.h>
|
#include <openssl/pem.h>
|
||||||
|
|
||||||
# define DEFBITS 2048
|
#define DEFBITS 512
|
||||||
# undef PROG
|
#undef PROG
|
||||||
# define PROG gendh_main
|
#define PROG gendh_main
|
||||||
|
|
||||||
static int MS_CALLBACK dh_cb(int p, int n, BN_GENCB *cb);
|
static int MS_CALLBACK dh_cb(int p, int n, BN_GENCB *cb);
|
||||||
|
|
||||||
int MAIN(int, char **);
|
int MAIN(int, char **);
|
||||||
|
|
||||||
int MAIN(int argc, char **argv)
|
int MAIN(int argc, char **argv)
|
||||||
{
|
{
|
||||||
BN_GENCB cb;
|
BN_GENCB cb;
|
||||||
DH *dh = NULL;
|
DH *dh=NULL;
|
||||||
int ret = 1, num = DEFBITS;
|
int ret=1,num=DEFBITS;
|
||||||
int g = 2;
|
int g=2;
|
||||||
char *outfile = NULL;
|
char *outfile=NULL;
|
||||||
char *inrand = NULL;
|
char *inrand=NULL;
|
||||||
# ifndef OPENSSL_NO_ENGINE
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
char *engine = NULL;
|
char *engine=NULL;
|
||||||
# endif
|
#endif
|
||||||
BIO *out = NULL;
|
BIO *out=NULL;
|
||||||
|
|
||||||
apps_startup();
|
apps_startup();
|
||||||
|
|
||||||
BN_GENCB_set(&cb, dh_cb, bio_err);
|
BN_GENCB_set(&cb, dh_cb, bio_err);
|
||||||
if (bio_err == NULL)
|
if (bio_err == NULL)
|
||||||
if ((bio_err = BIO_new(BIO_s_file())) != NULL)
|
if ((bio_err=BIO_new(BIO_s_file())) != NULL)
|
||||||
BIO_set_fp(bio_err, stderr, BIO_NOCLOSE | BIO_FP_TEXT);
|
BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT);
|
||||||
|
|
||||||
if (!load_config(bio_err, NULL))
|
if (!load_config(bio_err, NULL))
|
||||||
goto end;
|
goto end;
|
||||||
|
|
||||||
argv++;
|
argv++;
|
||||||
argc--;
|
argc--;
|
||||||
for (;;) {
|
for (;;)
|
||||||
if (argc <= 0)
|
{
|
||||||
break;
|
if (argc <= 0) break;
|
||||||
if (strcmp(*argv, "-out") == 0) {
|
if (strcmp(*argv,"-out") == 0)
|
||||||
if (--argc < 1)
|
{
|
||||||
goto bad;
|
if (--argc < 1) goto bad;
|
||||||
outfile = *(++argv);
|
outfile= *(++argv);
|
||||||
} else if (strcmp(*argv, "-2") == 0)
|
}
|
||||||
g = 2;
|
else if (strcmp(*argv,"-2") == 0)
|
||||||
/*- else if (strcmp(*argv,"-3") == 0)
|
g=2;
|
||||||
g=3; */
|
/* else if (strcmp(*argv,"-3") == 0)
|
||||||
else if (strcmp(*argv, "-5") == 0)
|
g=3; */
|
||||||
g = 5;
|
else if (strcmp(*argv,"-5") == 0)
|
||||||
# ifndef OPENSSL_NO_ENGINE
|
g=5;
|
||||||
else if (strcmp(*argv, "-engine") == 0) {
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
if (--argc < 1)
|
else if (strcmp(*argv,"-engine") == 0)
|
||||||
goto bad;
|
{
|
||||||
engine = *(++argv);
|
if (--argc < 1) goto bad;
|
||||||
}
|
engine= *(++argv);
|
||||||
# endif
|
}
|
||||||
else if (strcmp(*argv, "-rand") == 0) {
|
#endif
|
||||||
if (--argc < 1)
|
else if (strcmp(*argv,"-rand") == 0)
|
||||||
goto bad;
|
{
|
||||||
inrand = *(++argv);
|
if (--argc < 1) goto bad;
|
||||||
} else
|
inrand= *(++argv);
|
||||||
break;
|
}
|
||||||
argv++;
|
else
|
||||||
argc--;
|
break;
|
||||||
}
|
argv++;
|
||||||
if ((argc >= 1) && ((sscanf(*argv, "%d", &num) == 0) || (num < 0))) {
|
argc--;
|
||||||
bad:
|
}
|
||||||
BIO_printf(bio_err, "usage: gendh [args] [numbits]\n");
|
if ((argc >= 1) && ((sscanf(*argv,"%d",&num) == 0) || (num < 0)))
|
||||||
BIO_printf(bio_err, " -out file - output the key to 'file\n");
|
{
|
||||||
BIO_printf(bio_err, " -2 - use 2 as the generator value\n");
|
bad:
|
||||||
/*
|
BIO_printf(bio_err,"usage: gendh [args] [numbits]\n");
|
||||||
* BIO_printf(bio_err," -3 - use 3 as the generator value\n");
|
BIO_printf(bio_err," -out file - output the key to 'file\n");
|
||||||
*/
|
BIO_printf(bio_err," -2 - use 2 as the generator value\n");
|
||||||
BIO_printf(bio_err, " -5 - use 5 as the generator value\n");
|
/* BIO_printf(bio_err," -3 - use 3 as the generator value\n"); */
|
||||||
# ifndef OPENSSL_NO_ENGINE
|
BIO_printf(bio_err," -5 - use 5 as the generator value\n");
|
||||||
BIO_printf(bio_err,
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
" -engine e - use engine e, possibly a hardware device.\n");
|
BIO_printf(bio_err," -engine e - use engine e, possibly a hardware device.\n");
|
||||||
# endif
|
#endif
|
||||||
BIO_printf(bio_err, " -rand file%cfile%c...\n", LIST_SEPARATOR_CHAR,
|
BIO_printf(bio_err," -rand file%cfile%c...\n", LIST_SEPARATOR_CHAR, LIST_SEPARATOR_CHAR);
|
||||||
LIST_SEPARATOR_CHAR);
|
BIO_printf(bio_err," - load the file (or the files in the directory) into\n");
|
||||||
BIO_printf(bio_err,
|
BIO_printf(bio_err," the random number generator\n");
|
||||||
" - load the file (or the files in the directory) into\n");
|
goto end;
|
||||||
BIO_printf(bio_err, " the random number generator\n");
|
}
|
||||||
goto end;
|
|
||||||
}
|
|
||||||
# ifndef OPENSSL_NO_ENGINE
|
|
||||||
setup_engine(bio_err, engine, 0);
|
|
||||||
# endif
|
|
||||||
|
|
||||||
out = BIO_new(BIO_s_file());
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
if (out == NULL) {
|
setup_engine(bio_err, engine, 0);
|
||||||
ERR_print_errors(bio_err);
|
#endif
|
||||||
goto end;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (outfile == NULL) {
|
out=BIO_new(BIO_s_file());
|
||||||
BIO_set_fp(out, stdout, BIO_NOCLOSE);
|
if (out == NULL)
|
||||||
# ifdef OPENSSL_SYS_VMS
|
{
|
||||||
{
|
ERR_print_errors(bio_err);
|
||||||
BIO *tmpbio = BIO_new(BIO_f_linebuffer());
|
goto end;
|
||||||
out = BIO_push(tmpbio, out);
|
}
|
||||||
}
|
|
||||||
# endif
|
|
||||||
} else {
|
|
||||||
if (BIO_write_filename(out, outfile) <= 0) {
|
|
||||||
perror(outfile);
|
|
||||||
goto end;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!app_RAND_load_file(NULL, bio_err, 1) && inrand == NULL) {
|
if (outfile == NULL)
|
||||||
BIO_printf(bio_err,
|
{
|
||||||
"warning, not much extra random data, consider using the -rand option\n");
|
BIO_set_fp(out,stdout,BIO_NOCLOSE);
|
||||||
}
|
#ifdef OPENSSL_SYS_VMS
|
||||||
if (inrand != NULL)
|
{
|
||||||
BIO_printf(bio_err, "%ld semi-random bytes loaded\n",
|
BIO *tmpbio = BIO_new(BIO_f_linebuffer());
|
||||||
app_RAND_load_files(inrand));
|
out = BIO_push(tmpbio, out);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (BIO_write_filename(out,outfile) <= 0)
|
||||||
|
{
|
||||||
|
perror(outfile);
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
BIO_printf(bio_err,
|
if (!app_RAND_load_file(NULL, bio_err, 1) && inrand == NULL)
|
||||||
"Generating DH parameters, %d bit long safe prime, generator %d\n",
|
{
|
||||||
num, g);
|
BIO_printf(bio_err,"warning, not much extra random data, consider using the -rand option\n");
|
||||||
BIO_printf(bio_err, "This is going to take a long time\n");
|
}
|
||||||
|
if (inrand != NULL)
|
||||||
|
BIO_printf(bio_err,"%ld semi-random bytes loaded\n",
|
||||||
|
app_RAND_load_files(inrand));
|
||||||
|
|
||||||
if (((dh = DH_new()) == NULL)
|
BIO_printf(bio_err,"Generating DH parameters, %d bit long safe prime, generator %d\n",num,g);
|
||||||
|| !DH_generate_parameters_ex(dh, num, g, &cb))
|
BIO_printf(bio_err,"This is going to take a long time\n");
|
||||||
goto end;
|
|
||||||
|
|
||||||
app_RAND_write_file(NULL, bio_err);
|
if(((dh = DH_new()) == NULL) || !DH_generate_parameters_ex(dh, num, g, &cb))
|
||||||
|
goto end;
|
||||||
|
|
||||||
if (!PEM_write_bio_DHparams(out, dh))
|
app_RAND_write_file(NULL, bio_err);
|
||||||
goto end;
|
|
||||||
ret = 0;
|
if (!PEM_write_bio_DHparams(out,dh))
|
||||||
end:
|
goto end;
|
||||||
if (ret != 0)
|
ret=0;
|
||||||
ERR_print_errors(bio_err);
|
end:
|
||||||
if (out != NULL)
|
if (ret != 0)
|
||||||
BIO_free_all(out);
|
ERR_print_errors(bio_err);
|
||||||
if (dh != NULL)
|
if (out != NULL) BIO_free_all(out);
|
||||||
DH_free(dh);
|
if (dh != NULL) DH_free(dh);
|
||||||
apps_shutdown();
|
apps_shutdown();
|
||||||
OPENSSL_EXIT(ret);
|
OPENSSL_EXIT(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int MS_CALLBACK dh_cb(int p, int n, BN_GENCB *cb)
|
static int MS_CALLBACK dh_cb(int p, int n, BN_GENCB *cb)
|
||||||
{
|
{
|
||||||
char c = '*';
|
char c='*';
|
||||||
|
|
||||||
if (p == 0)
|
if (p == 0) c='.';
|
||||||
c = '.';
|
if (p == 1) c='+';
|
||||||
if (p == 1)
|
if (p == 2) c='*';
|
||||||
c = '+';
|
if (p == 3) c='\n';
|
||||||
if (p == 2)
|
BIO_write(cb->arg,&c,1);
|
||||||
c = '*';
|
(void)BIO_flush(cb->arg);
|
||||||
if (p == 3)
|
#ifdef LINT
|
||||||
c = '\n';
|
p=n;
|
||||||
BIO_write(cb->arg, &c, 1);
|
#endif
|
||||||
(void)BIO_flush(cb->arg);
|
return 1;
|
||||||
# ifdef LINT
|
}
|
||||||
p = n;
|
#else /* !OPENSSL_NO_DH */
|
||||||
# endif
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
#else /* !OPENSSL_NO_DH */
|
|
||||||
|
|
||||||
# if PEDANTIC
|
# if PEDANTIC
|
||||||
static void *dummy = &dummy;
|
static void *dummy=&dummy;
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
406
apps/gendsa.c
406
apps/gendsa.c
@@ -56,232 +56,230 @@
|
|||||||
* [including the GNU Public Licence.]
|
* [including the GNU Public Licence.]
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <openssl/opensslconf.h> /* for OPENSSL_NO_DSA */
|
#include <openssl/opensslconf.h> /* for OPENSSL_NO_DSA */
|
||||||
#ifndef OPENSSL_NO_DSA
|
#ifndef OPENSSL_NO_DSA
|
||||||
# include <stdio.h>
|
#include <stdio.h>
|
||||||
# include <string.h>
|
#include <string.h>
|
||||||
# include <sys/types.h>
|
#include <sys/types.h>
|
||||||
# include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
# include "apps.h"
|
#include "apps.h"
|
||||||
# include <openssl/bio.h>
|
#include <openssl/bio.h>
|
||||||
# include <openssl/err.h>
|
#include <openssl/err.h>
|
||||||
# include <openssl/bn.h>
|
#include <openssl/bn.h>
|
||||||
# include <openssl/dsa.h>
|
#include <openssl/dsa.h>
|
||||||
# include <openssl/x509.h>
|
#include <openssl/x509.h>
|
||||||
# include <openssl/pem.h>
|
#include <openssl/pem.h>
|
||||||
|
|
||||||
# define DEFBITS 512
|
#define DEFBITS 512
|
||||||
# undef PROG
|
#undef PROG
|
||||||
# define PROG gendsa_main
|
#define PROG gendsa_main
|
||||||
|
|
||||||
int MAIN(int, char **);
|
int MAIN(int, char **);
|
||||||
|
|
||||||
int MAIN(int argc, char **argv)
|
int MAIN(int argc, char **argv)
|
||||||
{
|
{
|
||||||
DSA *dsa = NULL;
|
DSA *dsa=NULL;
|
||||||
int ret = 1;
|
int ret=1;
|
||||||
char *outfile = NULL;
|
char *outfile=NULL;
|
||||||
char *inrand = NULL, *dsaparams = NULL;
|
char *inrand=NULL,*dsaparams=NULL;
|
||||||
char *passargout = NULL, *passout = NULL;
|
char *passargout = NULL, *passout = NULL;
|
||||||
BIO *out = NULL, *in = NULL;
|
BIO *out=NULL,*in=NULL;
|
||||||
const EVP_CIPHER *enc = NULL;
|
const EVP_CIPHER *enc=NULL;
|
||||||
# ifndef OPENSSL_NO_ENGINE
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
char *engine = NULL;
|
char *engine=NULL;
|
||||||
# endif
|
#endif
|
||||||
|
|
||||||
apps_startup();
|
apps_startup();
|
||||||
|
|
||||||
if (bio_err == NULL)
|
if (bio_err == NULL)
|
||||||
if ((bio_err = BIO_new(BIO_s_file())) != NULL)
|
if ((bio_err=BIO_new(BIO_s_file())) != NULL)
|
||||||
BIO_set_fp(bio_err, stderr, BIO_NOCLOSE | BIO_FP_TEXT);
|
BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT);
|
||||||
|
|
||||||
if (!load_config(bio_err, NULL))
|
if (!load_config(bio_err, NULL))
|
||||||
goto end;
|
goto end;
|
||||||
|
|
||||||
argv++;
|
argv++;
|
||||||
argc--;
|
argc--;
|
||||||
for (;;) {
|
for (;;)
|
||||||
if (argc <= 0)
|
{
|
||||||
break;
|
if (argc <= 0) break;
|
||||||
if (strcmp(*argv, "-out") == 0) {
|
if (strcmp(*argv,"-out") == 0)
|
||||||
if (--argc < 1)
|
{
|
||||||
goto bad;
|
if (--argc < 1) goto bad;
|
||||||
outfile = *(++argv);
|
outfile= *(++argv);
|
||||||
} else if (strcmp(*argv, "-passout") == 0) {
|
}
|
||||||
if (--argc < 1)
|
else if (strcmp(*argv,"-passout") == 0)
|
||||||
goto bad;
|
{
|
||||||
passargout = *(++argv);
|
if (--argc < 1) goto bad;
|
||||||
}
|
passargout= *(++argv);
|
||||||
# ifndef OPENSSL_NO_ENGINE
|
}
|
||||||
else if (strcmp(*argv, "-engine") == 0) {
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
if (--argc < 1)
|
else if (strcmp(*argv,"-engine") == 0)
|
||||||
goto bad;
|
{
|
||||||
engine = *(++argv);
|
if (--argc < 1) goto bad;
|
||||||
}
|
engine= *(++argv);
|
||||||
# endif
|
}
|
||||||
else if (strcmp(*argv, "-rand") == 0) {
|
#endif
|
||||||
if (--argc < 1)
|
else if (strcmp(*argv,"-rand") == 0)
|
||||||
goto bad;
|
{
|
||||||
inrand = *(++argv);
|
if (--argc < 1) goto bad;
|
||||||
} else if (strcmp(*argv, "-") == 0)
|
inrand= *(++argv);
|
||||||
goto bad;
|
}
|
||||||
# ifndef OPENSSL_NO_DES
|
else if (strcmp(*argv,"-") == 0)
|
||||||
else if (strcmp(*argv, "-des") == 0)
|
goto bad;
|
||||||
enc = EVP_des_cbc();
|
#ifndef OPENSSL_NO_DES
|
||||||
else if (strcmp(*argv, "-des3") == 0)
|
else if (strcmp(*argv,"-des") == 0)
|
||||||
enc = EVP_des_ede3_cbc();
|
enc=EVP_des_cbc();
|
||||||
# endif
|
else if (strcmp(*argv,"-des3") == 0)
|
||||||
# ifndef OPENSSL_NO_IDEA
|
enc=EVP_des_ede3_cbc();
|
||||||
else if (strcmp(*argv, "-idea") == 0)
|
#endif
|
||||||
enc = EVP_idea_cbc();
|
#ifndef OPENSSL_NO_IDEA
|
||||||
# endif
|
else if (strcmp(*argv,"-idea") == 0)
|
||||||
# ifndef OPENSSL_NO_SEED
|
enc=EVP_idea_cbc();
|
||||||
else if (strcmp(*argv, "-seed") == 0)
|
#endif
|
||||||
enc = EVP_seed_cbc();
|
#ifndef OPENSSL_NO_SEED
|
||||||
# endif
|
else if (strcmp(*argv,"-seed") == 0)
|
||||||
# ifndef OPENSSL_NO_AES
|
enc=EVP_seed_cbc();
|
||||||
else if (strcmp(*argv, "-aes128") == 0)
|
#endif
|
||||||
enc = EVP_aes_128_cbc();
|
#ifndef OPENSSL_NO_AES
|
||||||
else if (strcmp(*argv, "-aes192") == 0)
|
else if (strcmp(*argv,"-aes128") == 0)
|
||||||
enc = EVP_aes_192_cbc();
|
enc=EVP_aes_128_cbc();
|
||||||
else if (strcmp(*argv, "-aes256") == 0)
|
else if (strcmp(*argv,"-aes192") == 0)
|
||||||
enc = EVP_aes_256_cbc();
|
enc=EVP_aes_192_cbc();
|
||||||
# endif
|
else if (strcmp(*argv,"-aes256") == 0)
|
||||||
# ifndef OPENSSL_NO_CAMELLIA
|
enc=EVP_aes_256_cbc();
|
||||||
else if (strcmp(*argv, "-camellia128") == 0)
|
#endif
|
||||||
enc = EVP_camellia_128_cbc();
|
#ifndef OPENSSL_NO_CAMELLIA
|
||||||
else if (strcmp(*argv, "-camellia192") == 0)
|
else if (strcmp(*argv,"-camellia128") == 0)
|
||||||
enc = EVP_camellia_192_cbc();
|
enc=EVP_camellia_128_cbc();
|
||||||
else if (strcmp(*argv, "-camellia256") == 0)
|
else if (strcmp(*argv,"-camellia192") == 0)
|
||||||
enc = EVP_camellia_256_cbc();
|
enc=EVP_camellia_192_cbc();
|
||||||
# endif
|
else if (strcmp(*argv,"-camellia256") == 0)
|
||||||
else if (**argv != '-' && dsaparams == NULL) {
|
enc=EVP_camellia_256_cbc();
|
||||||
dsaparams = *argv;
|
#endif
|
||||||
} else
|
else if (**argv != '-' && dsaparams == NULL)
|
||||||
goto bad;
|
{
|
||||||
argv++;
|
dsaparams = *argv;
|
||||||
argc--;
|
}
|
||||||
}
|
else
|
||||||
|
goto bad;
|
||||||
|
argv++;
|
||||||
|
argc--;
|
||||||
|
}
|
||||||
|
|
||||||
if (dsaparams == NULL) {
|
if (dsaparams == NULL)
|
||||||
bad:
|
{
|
||||||
BIO_printf(bio_err, "usage: gendsa [args] dsaparam-file\n");
|
bad:
|
||||||
BIO_printf(bio_err, " -out file - output the key to 'file'\n");
|
BIO_printf(bio_err,"usage: gendsa [args] dsaparam-file\n");
|
||||||
# ifndef OPENSSL_NO_DES
|
BIO_printf(bio_err," -out file - output the key to 'file'\n");
|
||||||
BIO_printf(bio_err,
|
#ifndef OPENSSL_NO_DES
|
||||||
" -des - encrypt the generated key with DES in cbc mode\n");
|
BIO_printf(bio_err," -des - encrypt the generated key with DES in cbc mode\n");
|
||||||
BIO_printf(bio_err,
|
BIO_printf(bio_err," -des3 - encrypt the generated key with DES in ede cbc mode (168 bit key)\n");
|
||||||
" -des3 - encrypt the generated key with DES in ede cbc mode (168 bit key)\n");
|
#endif
|
||||||
# endif
|
#ifndef OPENSSL_NO_IDEA
|
||||||
# ifndef OPENSSL_NO_IDEA
|
BIO_printf(bio_err," -idea - encrypt the generated key with IDEA in cbc mode\n");
|
||||||
BIO_printf(bio_err,
|
#endif
|
||||||
" -idea - encrypt the generated key with IDEA in cbc mode\n");
|
#ifndef OPENSSL_NO_SEED
|
||||||
# endif
|
BIO_printf(bio_err," -seed\n");
|
||||||
# ifndef OPENSSL_NO_SEED
|
BIO_printf(bio_err," encrypt PEM output with cbc seed\n");
|
||||||
BIO_printf(bio_err, " -seed\n");
|
#endif
|
||||||
BIO_printf(bio_err,
|
#ifndef OPENSSL_NO_AES
|
||||||
" encrypt PEM output with cbc seed\n");
|
BIO_printf(bio_err," -aes128, -aes192, -aes256\n");
|
||||||
# endif
|
BIO_printf(bio_err," encrypt PEM output with cbc aes\n");
|
||||||
# ifndef OPENSSL_NO_AES
|
#endif
|
||||||
BIO_printf(bio_err, " -aes128, -aes192, -aes256\n");
|
#ifndef OPENSSL_NO_CAMELLIA
|
||||||
BIO_printf(bio_err,
|
BIO_printf(bio_err," -camellia128, -camellia192, -camellia256\n");
|
||||||
" encrypt PEM output with cbc aes\n");
|
BIO_printf(bio_err," encrypt PEM output with cbc camellia\n");
|
||||||
# endif
|
#endif
|
||||||
# ifndef OPENSSL_NO_CAMELLIA
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
BIO_printf(bio_err, " -camellia128, -camellia192, -camellia256\n");
|
BIO_printf(bio_err," -engine e - use engine e, possibly a hardware device.\n");
|
||||||
BIO_printf(bio_err,
|
#endif
|
||||||
" encrypt PEM output with cbc camellia\n");
|
BIO_printf(bio_err," -rand file%cfile%c...\n", LIST_SEPARATOR_CHAR, LIST_SEPARATOR_CHAR);
|
||||||
# endif
|
BIO_printf(bio_err," - load the file (or the files in the directory) into\n");
|
||||||
# ifndef OPENSSL_NO_ENGINE
|
BIO_printf(bio_err," the random number generator\n");
|
||||||
BIO_printf(bio_err,
|
BIO_printf(bio_err," dsaparam-file\n");
|
||||||
" -engine e - use engine e, possibly a hardware device.\n");
|
BIO_printf(bio_err," - a DSA parameter file as generated by the dsaparam command\n");
|
||||||
# endif
|
goto end;
|
||||||
BIO_printf(bio_err, " -rand file%cfile%c...\n", LIST_SEPARATOR_CHAR,
|
}
|
||||||
LIST_SEPARATOR_CHAR);
|
|
||||||
BIO_printf(bio_err,
|
|
||||||
" - load the file (or the files in the directory) into\n");
|
|
||||||
BIO_printf(bio_err, " the random number generator\n");
|
|
||||||
BIO_printf(bio_err, " dsaparam-file\n");
|
|
||||||
BIO_printf(bio_err,
|
|
||||||
" - a DSA parameter file as generated by the dsaparam command\n");
|
|
||||||
goto end;
|
|
||||||
}
|
|
||||||
# ifndef OPENSSL_NO_ENGINE
|
|
||||||
setup_engine(bio_err, engine, 0);
|
|
||||||
# endif
|
|
||||||
|
|
||||||
if (!app_passwd(bio_err, NULL, passargout, NULL, &passout)) {
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
BIO_printf(bio_err, "Error getting password\n");
|
setup_engine(bio_err, engine, 0);
|
||||||
goto end;
|
#endif
|
||||||
}
|
|
||||||
|
|
||||||
in = BIO_new(BIO_s_file());
|
if(!app_passwd(bio_err, NULL, passargout, NULL, &passout)) {
|
||||||
if (!(BIO_read_filename(in, dsaparams))) {
|
BIO_printf(bio_err, "Error getting password\n");
|
||||||
perror(dsaparams);
|
goto end;
|
||||||
goto end;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if ((dsa = PEM_read_bio_DSAparams(in, NULL, NULL, NULL)) == NULL) {
|
|
||||||
BIO_printf(bio_err, "unable to load DSA parameter file\n");
|
|
||||||
goto end;
|
|
||||||
}
|
|
||||||
BIO_free(in);
|
|
||||||
in = NULL;
|
|
||||||
|
|
||||||
out = BIO_new(BIO_s_file());
|
in=BIO_new(BIO_s_file());
|
||||||
if (out == NULL)
|
if (!(BIO_read_filename(in,dsaparams)))
|
||||||
goto end;
|
{
|
||||||
|
perror(dsaparams);
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
if (outfile == NULL) {
|
if ((dsa=PEM_read_bio_DSAparams(in,NULL,NULL,NULL)) == NULL)
|
||||||
BIO_set_fp(out, stdout, BIO_NOCLOSE);
|
{
|
||||||
# ifdef OPENSSL_SYS_VMS
|
BIO_printf(bio_err,"unable to load DSA parameter file\n");
|
||||||
{
|
goto end;
|
||||||
BIO *tmpbio = BIO_new(BIO_f_linebuffer());
|
}
|
||||||
out = BIO_push(tmpbio, out);
|
BIO_free(in);
|
||||||
}
|
in = NULL;
|
||||||
# endif
|
|
||||||
} else {
|
|
||||||
if (BIO_write_filename(out, outfile) <= 0) {
|
|
||||||
perror(outfile);
|
|
||||||
goto end;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!app_RAND_load_file(NULL, bio_err, 1) && inrand == NULL) {
|
out=BIO_new(BIO_s_file());
|
||||||
BIO_printf(bio_err,
|
if (out == NULL) goto end;
|
||||||
"warning, not much extra random data, consider using the -rand option\n");
|
|
||||||
}
|
|
||||||
if (inrand != NULL)
|
|
||||||
BIO_printf(bio_err, "%ld semi-random bytes loaded\n",
|
|
||||||
app_RAND_load_files(inrand));
|
|
||||||
|
|
||||||
BIO_printf(bio_err, "Generating DSA key, %d bits\n", BN_num_bits(dsa->p));
|
if (outfile == NULL)
|
||||||
if (!DSA_generate_key(dsa))
|
{
|
||||||
goto end;
|
BIO_set_fp(out,stdout,BIO_NOCLOSE);
|
||||||
|
#ifdef OPENSSL_SYS_VMS
|
||||||
|
{
|
||||||
|
BIO *tmpbio = BIO_new(BIO_f_linebuffer());
|
||||||
|
out = BIO_push(tmpbio, out);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (BIO_write_filename(out,outfile) <= 0)
|
||||||
|
{
|
||||||
|
perror(outfile);
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
app_RAND_write_file(NULL, bio_err);
|
if (!app_RAND_load_file(NULL, bio_err, 1) && inrand == NULL)
|
||||||
|
{
|
||||||
|
BIO_printf(bio_err,"warning, not much extra random data, consider using the -rand option\n");
|
||||||
|
}
|
||||||
|
if (inrand != NULL)
|
||||||
|
BIO_printf(bio_err,"%ld semi-random bytes loaded\n",
|
||||||
|
app_RAND_load_files(inrand));
|
||||||
|
|
||||||
if (!PEM_write_bio_DSAPrivateKey(out, dsa, enc, NULL, 0, NULL, passout))
|
BIO_printf(bio_err,"Generating DSA key, %d bits\n",
|
||||||
goto end;
|
BN_num_bits(dsa->p));
|
||||||
ret = 0;
|
if (!DSA_generate_key(dsa)) goto end;
|
||||||
end:
|
|
||||||
if (ret != 0)
|
app_RAND_write_file(NULL, bio_err);
|
||||||
ERR_print_errors(bio_err);
|
|
||||||
if (in != NULL)
|
if (!PEM_write_bio_DSAPrivateKey(out,dsa,enc,NULL,0,NULL, passout))
|
||||||
BIO_free(in);
|
goto end;
|
||||||
if (out != NULL)
|
ret=0;
|
||||||
BIO_free_all(out);
|
end:
|
||||||
if (dsa != NULL)
|
if (ret != 0)
|
||||||
DSA_free(dsa);
|
ERR_print_errors(bio_err);
|
||||||
if (passout)
|
if (in != NULL) BIO_free(in);
|
||||||
OPENSSL_free(passout);
|
if (out != NULL) BIO_free_all(out);
|
||||||
apps_shutdown();
|
if (dsa != NULL) DSA_free(dsa);
|
||||||
OPENSSL_EXIT(ret);
|
if(passout) OPENSSL_free(passout);
|
||||||
}
|
apps_shutdown();
|
||||||
#else /* !OPENSSL_NO_DSA */
|
OPENSSL_EXIT(ret);
|
||||||
|
}
|
||||||
|
#else /* !OPENSSL_NO_DSA */
|
||||||
|
|
||||||
# if PEDANTIC
|
# if PEDANTIC
|
||||||
static void *dummy = &dummy;
|
static void *dummy=&dummy;
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
597
apps/genpkey.c
597
apps/genpkey.c
@@ -1,7 +1,6 @@
|
|||||||
/* apps/genpkey.c */
|
/* apps/genpkey.c */
|
||||||
/*
|
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
|
||||||
* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL project
|
* project 2006
|
||||||
* 2006
|
|
||||||
*/
|
*/
|
||||||
/* ====================================================================
|
/* ====================================================================
|
||||||
* Copyright (c) 2006 The OpenSSL Project. All rights reserved.
|
* Copyright (c) 2006 The OpenSSL Project. All rights reserved.
|
||||||
@@ -63,11 +62,11 @@
|
|||||||
#include <openssl/err.h>
|
#include <openssl/err.h>
|
||||||
#include <openssl/evp.h>
|
#include <openssl/evp.h>
|
||||||
#ifndef OPENSSL_NO_ENGINE
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
# include <openssl/engine.h>
|
#include <openssl/engine.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static int init_keygen_file(BIO *err, EVP_PKEY_CTX **pctx,
|
static int init_keygen_file(BIO *err, EVP_PKEY_CTX **pctx,
|
||||||
const char *file, ENGINE *e);
|
const char *file, ENGINE *e);
|
||||||
static int genpkey_cb(EVP_PKEY_CTX *ctx);
|
static int genpkey_cb(EVP_PKEY_CTX *ctx);
|
||||||
|
|
||||||
#define PROG genpkey_main
|
#define PROG genpkey_main
|
||||||
@@ -75,331 +74,367 @@ static int genpkey_cb(EVP_PKEY_CTX *ctx);
|
|||||||
int MAIN(int, char **);
|
int MAIN(int, char **);
|
||||||
|
|
||||||
int MAIN(int argc, char **argv)
|
int MAIN(int argc, char **argv)
|
||||||
{
|
{
|
||||||
ENGINE *e = NULL;
|
ENGINE *e = NULL;
|
||||||
char **args, *outfile = NULL;
|
char **args, *outfile = NULL;
|
||||||
char *passarg = NULL;
|
char *passarg = NULL;
|
||||||
BIO *in = NULL, *out = NULL;
|
BIO *in = NULL, *out = NULL;
|
||||||
const EVP_CIPHER *cipher = NULL;
|
const EVP_CIPHER *cipher = NULL;
|
||||||
int outformat;
|
int outformat;
|
||||||
int text = 0;
|
int text = 0;
|
||||||
EVP_PKEY *pkey = NULL;
|
EVP_PKEY *pkey=NULL;
|
||||||
EVP_PKEY_CTX *ctx = NULL;
|
EVP_PKEY_CTX *ctx = NULL;
|
||||||
char *pass = NULL;
|
char *pass = NULL;
|
||||||
int badarg = 0;
|
int badarg = 0;
|
||||||
int ret = 1, rv;
|
int ret = 1, rv;
|
||||||
|
|
||||||
int do_param = 0;
|
int do_param = 0;
|
||||||
|
|
||||||
if (bio_err == NULL)
|
if (bio_err == NULL)
|
||||||
bio_err = BIO_new_fp(stderr, BIO_NOCLOSE);
|
bio_err = BIO_new_fp (stderr, BIO_NOCLOSE);
|
||||||
|
|
||||||
if (!load_config(bio_err, NULL))
|
if (!load_config(bio_err, NULL))
|
||||||
goto end;
|
goto end;
|
||||||
|
|
||||||
outformat = FORMAT_PEM;
|
outformat=FORMAT_PEM;
|
||||||
|
|
||||||
ERR_load_crypto_strings();
|
ERR_load_crypto_strings();
|
||||||
OpenSSL_add_all_algorithms();
|
OpenSSL_add_all_algorithms();
|
||||||
args = argv + 1;
|
args = argv + 1;
|
||||||
while (!badarg && *args && *args[0] == '-') {
|
while (!badarg && *args && *args[0] == '-')
|
||||||
if (!strcmp(*args, "-outform")) {
|
{
|
||||||
if (args[1]) {
|
if (!strcmp(*args,"-outform"))
|
||||||
args++;
|
{
|
||||||
outformat = str2fmt(*args);
|
if (args[1])
|
||||||
} else
|
{
|
||||||
badarg = 1;
|
args++;
|
||||||
} else if (!strcmp(*args, "-pass")) {
|
outformat=str2fmt(*args);
|
||||||
if (!args[1])
|
}
|
||||||
goto bad;
|
else badarg = 1;
|
||||||
passarg = *(++args);
|
}
|
||||||
}
|
else if (!strcmp(*args,"-pass"))
|
||||||
|
{
|
||||||
|
if (!args[1]) goto bad;
|
||||||
|
passarg= *(++args);
|
||||||
|
}
|
||||||
#ifndef OPENSSL_NO_ENGINE
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
else if (strcmp(*args, "-engine") == 0) {
|
else if (strcmp(*args,"-engine") == 0)
|
||||||
if (!args[1])
|
{
|
||||||
goto bad;
|
if (!args[1])
|
||||||
e = setup_engine(bio_err, *(++args), 0);
|
goto bad;
|
||||||
}
|
e = setup_engine(bio_err, *(++args), 0);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
else if (!strcmp(*args, "-paramfile")) {
|
else if (!strcmp (*args, "-paramfile"))
|
||||||
if (!args[1])
|
{
|
||||||
goto bad;
|
if (!args[1])
|
||||||
args++;
|
goto bad;
|
||||||
if (do_param == 1)
|
args++;
|
||||||
goto bad;
|
if (do_param == 1)
|
||||||
if (!init_keygen_file(bio_err, &ctx, *args, e))
|
goto bad;
|
||||||
goto end;
|
if (!init_keygen_file(bio_err, &ctx, *args, e))
|
||||||
} else if (!strcmp(*args, "-out")) {
|
goto end;
|
||||||
if (args[1]) {
|
}
|
||||||
args++;
|
else if (!strcmp (*args, "-out"))
|
||||||
outfile = *args;
|
{
|
||||||
} else
|
if (args[1])
|
||||||
badarg = 1;
|
{
|
||||||
} else if (strcmp(*args, "-algorithm") == 0) {
|
args++;
|
||||||
if (!args[1])
|
outfile = *args;
|
||||||
goto bad;
|
}
|
||||||
if (!init_gen_str(bio_err, &ctx, *(++args), e, do_param))
|
else badarg = 1;
|
||||||
goto end;
|
}
|
||||||
} else if (strcmp(*args, "-pkeyopt") == 0) {
|
else if (strcmp(*args,"-algorithm") == 0)
|
||||||
if (!args[1])
|
{
|
||||||
goto bad;
|
if (!args[1])
|
||||||
if (!ctx) {
|
goto bad;
|
||||||
BIO_puts(bio_err, "No keytype specified\n");
|
if (!init_gen_str(bio_err, &ctx, *(++args),e, do_param))
|
||||||
goto bad;
|
goto end;
|
||||||
} else if (pkey_ctrl_string(ctx, *(++args)) <= 0) {
|
}
|
||||||
BIO_puts(bio_err, "parameter setting error\n");
|
else if (strcmp(*args,"-pkeyopt") == 0)
|
||||||
ERR_print_errors(bio_err);
|
{
|
||||||
goto end;
|
if (!args[1])
|
||||||
}
|
goto bad;
|
||||||
} else if (strcmp(*args, "-genparam") == 0) {
|
if (!ctx)
|
||||||
if (ctx)
|
{
|
||||||
goto bad;
|
BIO_puts(bio_err, "No keytype specified\n");
|
||||||
do_param = 1;
|
goto bad;
|
||||||
} else if (strcmp(*args, "-text") == 0)
|
}
|
||||||
text = 1;
|
else if (pkey_ctrl_string(ctx, *(++args)) <= 0)
|
||||||
else {
|
{
|
||||||
cipher = EVP_get_cipherbyname(*args + 1);
|
BIO_puts(bio_err, "parameter setting error\n");
|
||||||
if (!cipher) {
|
ERR_print_errors(bio_err);
|
||||||
BIO_printf(bio_err, "Unknown cipher %s\n", *args + 1);
|
goto end;
|
||||||
badarg = 1;
|
}
|
||||||
}
|
}
|
||||||
if (do_param == 1)
|
else if (strcmp(*args,"-genparam") == 0)
|
||||||
badarg = 1;
|
{
|
||||||
}
|
if (ctx)
|
||||||
args++;
|
goto bad;
|
||||||
}
|
do_param = 1;
|
||||||
|
}
|
||||||
|
else if (strcmp(*args,"-text") == 0)
|
||||||
|
text=1;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
cipher = EVP_get_cipherbyname(*args + 1);
|
||||||
|
if (!cipher)
|
||||||
|
{
|
||||||
|
BIO_printf(bio_err, "Unknown cipher %s\n",
|
||||||
|
*args + 1);
|
||||||
|
badarg = 1;
|
||||||
|
}
|
||||||
|
if (do_param == 1)
|
||||||
|
badarg = 1;
|
||||||
|
}
|
||||||
|
args++;
|
||||||
|
}
|
||||||
|
|
||||||
if (!ctx)
|
if (!ctx)
|
||||||
badarg = 1;
|
badarg = 1;
|
||||||
|
|
||||||
if (badarg) {
|
if (badarg)
|
||||||
bad:
|
{
|
||||||
BIO_printf(bio_err, "Usage: genpkey [options]\n");
|
bad:
|
||||||
BIO_printf(bio_err, "where options may be\n");
|
BIO_printf(bio_err, "Usage: genpkey [options]\n");
|
||||||
BIO_printf(bio_err, "-out file output file\n");
|
BIO_printf(bio_err, "where options may be\n");
|
||||||
BIO_printf(bio_err,
|
BIO_printf(bio_err, "-out file output file\n");
|
||||||
"-outform X output format (DER or PEM)\n");
|
BIO_printf(bio_err, "-outform X output format (DER or PEM)\n");
|
||||||
BIO_printf(bio_err,
|
BIO_printf(bio_err, "-pass arg output file pass phrase source\n");
|
||||||
"-pass arg output file pass phrase source\n");
|
BIO_printf(bio_err, "-<cipher> use cipher <cipher> to encrypt the key\n");
|
||||||
BIO_printf(bio_err,
|
|
||||||
"-<cipher> use cipher <cipher> to encrypt the key\n");
|
|
||||||
#ifndef OPENSSL_NO_ENGINE
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
BIO_printf(bio_err,
|
BIO_printf(bio_err, "-engine e use engine e, possibly a hardware device.\n");
|
||||||
"-engine e use engine e, possibly a hardware device.\n");
|
|
||||||
#endif
|
#endif
|
||||||
BIO_printf(bio_err, "-paramfile file parameters file\n");
|
BIO_printf(bio_err, "-paramfile file parameters file\n");
|
||||||
BIO_printf(bio_err, "-algorithm alg the public key algorithm\n");
|
BIO_printf(bio_err, "-algorithm alg the public key algorithm\n");
|
||||||
BIO_printf(bio_err,
|
BIO_printf(bio_err, "-pkeyopt opt:value set the public key algorithm option <opt>\n"
|
||||||
"-pkeyopt opt:value set the public key algorithm option <opt>\n"
|
" to value <value>\n");
|
||||||
" to value <value>\n");
|
BIO_printf(bio_err, "-genparam generate parameters, not key\n");
|
||||||
BIO_printf(bio_err,
|
BIO_printf(bio_err, "-text print the in text\n");
|
||||||
"-genparam generate parameters, not key\n");
|
BIO_printf(bio_err, "NB: options order may be important! See the manual page.\n");
|
||||||
BIO_printf(bio_err, "-text print the in text\n");
|
goto end;
|
||||||
BIO_printf(bio_err,
|
}
|
||||||
"NB: options order may be important! See the manual page.\n");
|
|
||||||
goto end;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!app_passwd(bio_err, passarg, NULL, &pass, NULL)) {
|
if (!app_passwd(bio_err, passarg, NULL, &pass, NULL))
|
||||||
BIO_puts(bio_err, "Error getting password\n");
|
{
|
||||||
goto end;
|
BIO_puts(bio_err, "Error getting password\n");
|
||||||
}
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
if (outfile) {
|
if (outfile)
|
||||||
if (!(out = BIO_new_file(outfile, "wb"))) {
|
{
|
||||||
BIO_printf(bio_err, "Can't open output file %s\n", outfile);
|
if (!(out = BIO_new_file (outfile, "wb")))
|
||||||
goto end;
|
{
|
||||||
}
|
BIO_printf(bio_err,
|
||||||
} else {
|
"Can't open output file %s\n", outfile);
|
||||||
out = BIO_new_fp(stdout, BIO_NOCLOSE);
|
goto end;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
out = BIO_new_fp (stdout, BIO_NOCLOSE);
|
||||||
#ifdef OPENSSL_SYS_VMS
|
#ifdef OPENSSL_SYS_VMS
|
||||||
{
|
{
|
||||||
BIO *tmpbio = BIO_new(BIO_f_linebuffer());
|
BIO *tmpbio = BIO_new(BIO_f_linebuffer());
|
||||||
out = BIO_push(tmpbio, out);
|
out = BIO_push(tmpbio, out);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
EVP_PKEY_CTX_set_cb(ctx, genpkey_cb);
|
EVP_PKEY_CTX_set_cb(ctx, genpkey_cb);
|
||||||
EVP_PKEY_CTX_set_app_data(ctx, bio_err);
|
EVP_PKEY_CTX_set_app_data(ctx, bio_err);
|
||||||
|
|
||||||
if (do_param) {
|
if (do_param)
|
||||||
if (EVP_PKEY_paramgen(ctx, &pkey) <= 0) {
|
{
|
||||||
BIO_puts(bio_err, "Error generating parameters\n");
|
if (EVP_PKEY_paramgen(ctx, &pkey) <= 0)
|
||||||
ERR_print_errors(bio_err);
|
{
|
||||||
goto end;
|
BIO_puts(bio_err, "Error generating parameters\n");
|
||||||
}
|
ERR_print_errors(bio_err);
|
||||||
} else {
|
goto end;
|
||||||
if (EVP_PKEY_keygen(ctx, &pkey) <= 0) {
|
}
|
||||||
BIO_puts(bio_err, "Error generating key\n");
|
}
|
||||||
ERR_print_errors(bio_err);
|
else
|
||||||
goto end;
|
{
|
||||||
}
|
if (EVP_PKEY_keygen(ctx, &pkey) <= 0)
|
||||||
}
|
{
|
||||||
|
BIO_puts(bio_err, "Error generating key\n");
|
||||||
|
ERR_print_errors(bio_err);
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (do_param)
|
if (do_param)
|
||||||
rv = PEM_write_bio_Parameters(out, pkey);
|
rv = PEM_write_bio_Parameters(out, pkey);
|
||||||
else if (outformat == FORMAT_PEM)
|
else if (outformat == FORMAT_PEM)
|
||||||
rv = PEM_write_bio_PrivateKey(out, pkey, cipher, NULL, 0, NULL, pass);
|
rv = PEM_write_bio_PrivateKey(out, pkey, cipher, NULL, 0,
|
||||||
else if (outformat == FORMAT_ASN1)
|
NULL, pass);
|
||||||
rv = i2d_PrivateKey_bio(out, pkey);
|
else if (outformat == FORMAT_ASN1)
|
||||||
else {
|
rv = i2d_PrivateKey_bio(out, pkey);
|
||||||
BIO_printf(bio_err, "Bad format specified for key\n");
|
else
|
||||||
goto end;
|
{
|
||||||
}
|
BIO_printf(bio_err, "Bad format specified for key\n");
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
if (rv <= 0) {
|
if (rv <= 0)
|
||||||
BIO_puts(bio_err, "Error writing key\n");
|
{
|
||||||
ERR_print_errors(bio_err);
|
BIO_puts(bio_err, "Error writing key\n");
|
||||||
}
|
ERR_print_errors(bio_err);
|
||||||
|
}
|
||||||
|
|
||||||
if (text) {
|
if (text)
|
||||||
if (do_param)
|
{
|
||||||
rv = EVP_PKEY_print_params(out, pkey, 0, NULL);
|
if (do_param)
|
||||||
else
|
rv = EVP_PKEY_print_params(out, pkey, 0, NULL);
|
||||||
rv = EVP_PKEY_print_private(out, pkey, 0, NULL);
|
else
|
||||||
|
rv = EVP_PKEY_print_private(out, pkey, 0, NULL);
|
||||||
|
|
||||||
if (rv <= 0) {
|
if (rv <= 0)
|
||||||
BIO_puts(bio_err, "Error printing key\n");
|
{
|
||||||
ERR_print_errors(bio_err);
|
BIO_puts(bio_err, "Error printing key\n");
|
||||||
}
|
ERR_print_errors(bio_err);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
end:
|
end:
|
||||||
if (pkey)
|
if (pkey)
|
||||||
EVP_PKEY_free(pkey);
|
EVP_PKEY_free(pkey);
|
||||||
if (ctx)
|
if (ctx)
|
||||||
EVP_PKEY_CTX_free(ctx);
|
EVP_PKEY_CTX_free(ctx);
|
||||||
if (out)
|
if (out)
|
||||||
BIO_free_all(out);
|
BIO_free_all(out);
|
||||||
BIO_free(in);
|
BIO_free(in);
|
||||||
if (pass)
|
if (pass)
|
||||||
OPENSSL_free(pass);
|
OPENSSL_free(pass);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int init_keygen_file(BIO *err, EVP_PKEY_CTX **pctx,
|
static int init_keygen_file(BIO *err, EVP_PKEY_CTX **pctx,
|
||||||
const char *file, ENGINE *e)
|
const char *file, ENGINE *e)
|
||||||
{
|
{
|
||||||
BIO *pbio;
|
BIO *pbio;
|
||||||
EVP_PKEY *pkey = NULL;
|
EVP_PKEY *pkey = NULL;
|
||||||
EVP_PKEY_CTX *ctx = NULL;
|
EVP_PKEY_CTX *ctx = NULL;
|
||||||
if (*pctx) {
|
if (*pctx)
|
||||||
BIO_puts(err, "Parameters already set!\n");
|
{
|
||||||
return 0;
|
BIO_puts(err, "Parameters already set!\n");
|
||||||
}
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
pbio = BIO_new_file(file, "r");
|
pbio = BIO_new_file(file, "r");
|
||||||
if (!pbio) {
|
if (!pbio)
|
||||||
BIO_printf(err, "Can't open parameter file %s\n", file);
|
{
|
||||||
return 0;
|
BIO_printf(err, "Can't open parameter file %s\n", file);
|
||||||
}
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
pkey = PEM_read_bio_Parameters(pbio, NULL);
|
pkey = PEM_read_bio_Parameters(pbio, NULL);
|
||||||
BIO_free(pbio);
|
BIO_free(pbio);
|
||||||
|
|
||||||
if (!pkey) {
|
if (!pkey)
|
||||||
BIO_printf(bio_err, "Error reading parameter file %s\n", file);
|
{
|
||||||
return 0;
|
BIO_printf(bio_err, "Error reading parameter file %s\n", file);
|
||||||
}
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
ctx = EVP_PKEY_CTX_new(pkey, e);
|
ctx = EVP_PKEY_CTX_new(pkey, e);
|
||||||
if (!ctx)
|
if (!ctx)
|
||||||
goto err;
|
goto err;
|
||||||
if (EVP_PKEY_keygen_init(ctx) <= 0)
|
if (EVP_PKEY_keygen_init(ctx) <= 0)
|
||||||
goto err;
|
goto err;
|
||||||
EVP_PKEY_free(pkey);
|
EVP_PKEY_free(pkey);
|
||||||
*pctx = ctx;
|
*pctx = ctx;
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
err:
|
err:
|
||||||
BIO_puts(err, "Error initializing context\n");
|
BIO_puts(err, "Error initializing context\n");
|
||||||
ERR_print_errors(err);
|
ERR_print_errors(err);
|
||||||
if (ctx)
|
if (ctx)
|
||||||
EVP_PKEY_CTX_free(ctx);
|
EVP_PKEY_CTX_free(ctx);
|
||||||
if (pkey)
|
if (pkey)
|
||||||
EVP_PKEY_free(pkey);
|
EVP_PKEY_free(pkey);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int init_gen_str(BIO *err, EVP_PKEY_CTX **pctx,
|
int init_gen_str(BIO *err, EVP_PKEY_CTX **pctx,
|
||||||
const char *algname, ENGINE *e, int do_param)
|
const char *algname, ENGINE *e, int do_param)
|
||||||
{
|
{
|
||||||
EVP_PKEY_CTX *ctx = NULL;
|
EVP_PKEY_CTX *ctx = NULL;
|
||||||
const EVP_PKEY_ASN1_METHOD *ameth;
|
const EVP_PKEY_ASN1_METHOD *ameth;
|
||||||
ENGINE *tmpeng = NULL;
|
ENGINE *tmpeng = NULL;
|
||||||
int pkey_id;
|
int pkey_id;
|
||||||
|
|
||||||
if (*pctx) {
|
if (*pctx)
|
||||||
BIO_puts(err, "Algorithm already set!\n");
|
{
|
||||||
return 0;
|
BIO_puts(err, "Algorithm already set!\n");
|
||||||
}
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
ameth = EVP_PKEY_asn1_find_str(&tmpeng, algname, -1);
|
ameth = EVP_PKEY_asn1_find_str(&tmpeng, algname, -1);
|
||||||
|
|
||||||
#ifndef OPENSSL_NO_ENGINE
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
if (!ameth && e)
|
if (!ameth && e)
|
||||||
ameth = ENGINE_get_pkey_asn1_meth_str(e, algname, -1);
|
ameth = ENGINE_get_pkey_asn1_meth_str(e, algname, -1);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (!ameth) {
|
if (!ameth)
|
||||||
BIO_printf(bio_err, "Algorithm %s not found\n", algname);
|
{
|
||||||
return 0;
|
BIO_printf(bio_err, "Algorithm %s not found\n", algname);
|
||||||
}
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
ERR_clear_error();
|
ERR_clear_error();
|
||||||
|
|
||||||
EVP_PKEY_asn1_get0_info(&pkey_id, NULL, NULL, NULL, NULL, ameth);
|
EVP_PKEY_asn1_get0_info(&pkey_id, NULL, NULL, NULL, NULL, ameth);
|
||||||
#ifndef OPENSSL_NO_ENGINE
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
if (tmpeng)
|
if (tmpeng)
|
||||||
ENGINE_finish(tmpeng);
|
ENGINE_finish(tmpeng);
|
||||||
#endif
|
#endif
|
||||||
ctx = EVP_PKEY_CTX_new_id(pkey_id, e);
|
ctx = EVP_PKEY_CTX_new_id(pkey_id, e);
|
||||||
|
|
||||||
if (!ctx)
|
if (!ctx)
|
||||||
goto err;
|
goto err;
|
||||||
if (do_param) {
|
if (do_param)
|
||||||
if (EVP_PKEY_paramgen_init(ctx) <= 0)
|
{
|
||||||
goto err;
|
if (EVP_PKEY_paramgen_init(ctx) <= 0)
|
||||||
} else {
|
goto err;
|
||||||
if (EVP_PKEY_keygen_init(ctx) <= 0)
|
}
|
||||||
goto err;
|
else
|
||||||
}
|
{
|
||||||
|
if (EVP_PKEY_keygen_init(ctx) <= 0)
|
||||||
|
goto err;
|
||||||
|
}
|
||||||
|
|
||||||
*pctx = ctx;
|
*pctx = ctx;
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
err:
|
err:
|
||||||
BIO_printf(err, "Error initializing %s context\n", algname);
|
BIO_printf(err, "Error initializing %s context\n", algname);
|
||||||
ERR_print_errors(err);
|
ERR_print_errors(err);
|
||||||
if (ctx)
|
if (ctx)
|
||||||
EVP_PKEY_CTX_free(ctx);
|
EVP_PKEY_CTX_free(ctx);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int genpkey_cb(EVP_PKEY_CTX *ctx)
|
static int genpkey_cb(EVP_PKEY_CTX *ctx)
|
||||||
{
|
{
|
||||||
char c = '*';
|
char c='*';
|
||||||
BIO *b = EVP_PKEY_CTX_get_app_data(ctx);
|
BIO *b = EVP_PKEY_CTX_get_app_data(ctx);
|
||||||
int p;
|
int p;
|
||||||
p = EVP_PKEY_CTX_get_keygen_info(ctx, 0);
|
p = EVP_PKEY_CTX_get_keygen_info(ctx, 0);
|
||||||
if (p == 0)
|
if (p == 0) c='.';
|
||||||
c = '.';
|
if (p == 1) c='+';
|
||||||
if (p == 1)
|
if (p == 2) c='*';
|
||||||
c = '+';
|
if (p == 3) c='\n';
|
||||||
if (p == 2)
|
BIO_write(b,&c,1);
|
||||||
c = '*';
|
(void)BIO_flush(b);
|
||||||
if (p == 3)
|
|
||||||
c = '\n';
|
|
||||||
BIO_write(b, &c, 1);
|
|
||||||
(void)BIO_flush(b);
|
|
||||||
#ifdef LINT
|
#ifdef LINT
|
||||||
p = n;
|
p=n;
|
||||||
#endif
|
#endif
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|||||||
501
apps/genrsa.c
501
apps/genrsa.c
@@ -57,294 +57,279 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <openssl/opensslconf.h>
|
#include <openssl/opensslconf.h>
|
||||||
/*
|
/* Until the key-gen callbacks are modified to use newer prototypes, we allow
|
||||||
* Until the key-gen callbacks are modified to use newer prototypes, we allow
|
* deprecated functions for openssl-internal code */
|
||||||
* deprecated functions for openssl-internal code
|
|
||||||
*/
|
|
||||||
#ifdef OPENSSL_NO_DEPRECATED
|
#ifdef OPENSSL_NO_DEPRECATED
|
||||||
# undef OPENSSL_NO_DEPRECATED
|
#undef OPENSSL_NO_DEPRECATED
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef OPENSSL_NO_RSA
|
#ifndef OPENSSL_NO_RSA
|
||||||
# include <stdio.h>
|
#include <stdio.h>
|
||||||
# include <string.h>
|
#include <string.h>
|
||||||
# include <sys/types.h>
|
#include <sys/types.h>
|
||||||
# include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
# include "apps.h"
|
#include "apps.h"
|
||||||
# include <openssl/bio.h>
|
#include <openssl/bio.h>
|
||||||
# include <openssl/err.h>
|
#include <openssl/err.h>
|
||||||
# include <openssl/bn.h>
|
#include <openssl/bn.h>
|
||||||
# include <openssl/rsa.h>
|
#include <openssl/rsa.h>
|
||||||
# include <openssl/evp.h>
|
#include <openssl/evp.h>
|
||||||
# include <openssl/x509.h>
|
#include <openssl/x509.h>
|
||||||
# include <openssl/pem.h>
|
#include <openssl/pem.h>
|
||||||
# include <openssl/rand.h>
|
#include <openssl/rand.h>
|
||||||
|
|
||||||
# define DEFBITS 1024
|
#define DEFBITS 512
|
||||||
# undef PROG
|
#undef PROG
|
||||||
# define PROG genrsa_main
|
#define PROG genrsa_main
|
||||||
|
|
||||||
static int MS_CALLBACK genrsa_cb(int p, int n, BN_GENCB *cb);
|
static int MS_CALLBACK genrsa_cb(int p, int n, BN_GENCB *cb);
|
||||||
|
|
||||||
int MAIN(int, char **);
|
int MAIN(int, char **);
|
||||||
|
|
||||||
int MAIN(int argc, char **argv)
|
int MAIN(int argc, char **argv)
|
||||||
{
|
{
|
||||||
BN_GENCB cb;
|
BN_GENCB cb;
|
||||||
# ifndef OPENSSL_NO_ENGINE
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
ENGINE *e = NULL;
|
ENGINE *e = NULL;
|
||||||
# endif
|
#endif
|
||||||
int ret = 1;
|
int ret=1;
|
||||||
int i, num = DEFBITS;
|
int i,num=DEFBITS;
|
||||||
long l;
|
long l;
|
||||||
const EVP_CIPHER *enc = NULL;
|
const EVP_CIPHER *enc=NULL;
|
||||||
unsigned long f4 = RSA_F4;
|
unsigned long f4=RSA_F4;
|
||||||
char *outfile = NULL;
|
char *outfile=NULL;
|
||||||
char *passargout = NULL, *passout = NULL;
|
char *passargout = NULL, *passout = NULL;
|
||||||
# ifndef OPENSSL_NO_ENGINE
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
char *engine = NULL;
|
char *engine=NULL;
|
||||||
# endif
|
#endif
|
||||||
char *inrand = NULL;
|
char *inrand=NULL;
|
||||||
BIO *out = NULL;
|
BIO *out=NULL;
|
||||||
BIGNUM *bn = BN_new();
|
BIGNUM *bn = BN_new();
|
||||||
RSA *rsa = NULL;
|
RSA *rsa = NULL;
|
||||||
|
|
||||||
if (!bn)
|
if(!bn) goto err;
|
||||||
goto err;
|
|
||||||
|
|
||||||
apps_startup();
|
apps_startup();
|
||||||
BN_GENCB_set(&cb, genrsa_cb, bio_err);
|
BN_GENCB_set(&cb, genrsa_cb, bio_err);
|
||||||
|
|
||||||
if (bio_err == NULL)
|
if (bio_err == NULL)
|
||||||
if ((bio_err = BIO_new(BIO_s_file())) != NULL)
|
if ((bio_err=BIO_new(BIO_s_file())) != NULL)
|
||||||
BIO_set_fp(bio_err, stderr, BIO_NOCLOSE | BIO_FP_TEXT);
|
BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT);
|
||||||
|
|
||||||
if (!load_config(bio_err, NULL))
|
if (!load_config(bio_err, NULL))
|
||||||
goto err;
|
goto err;
|
||||||
if ((out = BIO_new(BIO_s_file())) == NULL) {
|
if ((out=BIO_new(BIO_s_file())) == NULL)
|
||||||
BIO_printf(bio_err, "unable to create BIO for output\n");
|
{
|
||||||
goto err;
|
BIO_printf(bio_err,"unable to create BIO for output\n");
|
||||||
}
|
goto err;
|
||||||
|
}
|
||||||
|
|
||||||
argv++;
|
argv++;
|
||||||
argc--;
|
argc--;
|
||||||
for (;;) {
|
for (;;)
|
||||||
if (argc <= 0)
|
{
|
||||||
break;
|
if (argc <= 0) break;
|
||||||
if (strcmp(*argv, "-out") == 0) {
|
if (strcmp(*argv,"-out") == 0)
|
||||||
if (--argc < 1)
|
{
|
||||||
goto bad;
|
if (--argc < 1) goto bad;
|
||||||
outfile = *(++argv);
|
outfile= *(++argv);
|
||||||
} else if (strcmp(*argv, "-3") == 0)
|
}
|
||||||
f4 = 3;
|
else if (strcmp(*argv,"-3") == 0)
|
||||||
else if (strcmp(*argv, "-F4") == 0 || strcmp(*argv, "-f4") == 0)
|
f4=3;
|
||||||
f4 = RSA_F4;
|
else if (strcmp(*argv,"-F4") == 0 || strcmp(*argv,"-f4") == 0)
|
||||||
# ifndef OPENSSL_NO_ENGINE
|
f4=RSA_F4;
|
||||||
else if (strcmp(*argv, "-engine") == 0) {
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
if (--argc < 1)
|
else if (strcmp(*argv,"-engine") == 0)
|
||||||
goto bad;
|
{
|
||||||
engine = *(++argv);
|
if (--argc < 1) goto bad;
|
||||||
}
|
engine= *(++argv);
|
||||||
# endif
|
}
|
||||||
else if (strcmp(*argv, "-rand") == 0) {
|
#endif
|
||||||
if (--argc < 1)
|
else if (strcmp(*argv,"-rand") == 0)
|
||||||
goto bad;
|
{
|
||||||
inrand = *(++argv);
|
if (--argc < 1) goto bad;
|
||||||
}
|
inrand= *(++argv);
|
||||||
# ifndef OPENSSL_NO_DES
|
}
|
||||||
else if (strcmp(*argv, "-des") == 0)
|
#ifndef OPENSSL_NO_DES
|
||||||
enc = EVP_des_cbc();
|
else if (strcmp(*argv,"-des") == 0)
|
||||||
else if (strcmp(*argv, "-des3") == 0)
|
enc=EVP_des_cbc();
|
||||||
enc = EVP_des_ede3_cbc();
|
else if (strcmp(*argv,"-des3") == 0)
|
||||||
# endif
|
enc=EVP_des_ede3_cbc();
|
||||||
# ifndef OPENSSL_NO_IDEA
|
#endif
|
||||||
else if (strcmp(*argv, "-idea") == 0)
|
#ifndef OPENSSL_NO_IDEA
|
||||||
enc = EVP_idea_cbc();
|
else if (strcmp(*argv,"-idea") == 0)
|
||||||
# endif
|
enc=EVP_idea_cbc();
|
||||||
# ifndef OPENSSL_NO_SEED
|
#endif
|
||||||
else if (strcmp(*argv, "-seed") == 0)
|
#ifndef OPENSSL_NO_SEED
|
||||||
enc = EVP_seed_cbc();
|
else if (strcmp(*argv,"-seed") == 0)
|
||||||
# endif
|
enc=EVP_seed_cbc();
|
||||||
# ifndef OPENSSL_NO_AES
|
#endif
|
||||||
else if (strcmp(*argv, "-aes128") == 0)
|
#ifndef OPENSSL_NO_AES
|
||||||
enc = EVP_aes_128_cbc();
|
else if (strcmp(*argv,"-aes128") == 0)
|
||||||
else if (strcmp(*argv, "-aes192") == 0)
|
enc=EVP_aes_128_cbc();
|
||||||
enc = EVP_aes_192_cbc();
|
else if (strcmp(*argv,"-aes192") == 0)
|
||||||
else if (strcmp(*argv, "-aes256") == 0)
|
enc=EVP_aes_192_cbc();
|
||||||
enc = EVP_aes_256_cbc();
|
else if (strcmp(*argv,"-aes256") == 0)
|
||||||
# endif
|
enc=EVP_aes_256_cbc();
|
||||||
# ifndef OPENSSL_NO_CAMELLIA
|
#endif
|
||||||
else if (strcmp(*argv, "-camellia128") == 0)
|
#ifndef OPENSSL_NO_CAMELLIA
|
||||||
enc = EVP_camellia_128_cbc();
|
else if (strcmp(*argv,"-camellia128") == 0)
|
||||||
else if (strcmp(*argv, "-camellia192") == 0)
|
enc=EVP_camellia_128_cbc();
|
||||||
enc = EVP_camellia_192_cbc();
|
else if (strcmp(*argv,"-camellia192") == 0)
|
||||||
else if (strcmp(*argv, "-camellia256") == 0)
|
enc=EVP_camellia_192_cbc();
|
||||||
enc = EVP_camellia_256_cbc();
|
else if (strcmp(*argv,"-camellia256") == 0)
|
||||||
# endif
|
enc=EVP_camellia_256_cbc();
|
||||||
else if (strcmp(*argv, "-passout") == 0) {
|
#endif
|
||||||
if (--argc < 1)
|
else if (strcmp(*argv,"-passout") == 0)
|
||||||
goto bad;
|
{
|
||||||
passargout = *(++argv);
|
if (--argc < 1) goto bad;
|
||||||
} else
|
passargout= *(++argv);
|
||||||
break;
|
}
|
||||||
argv++;
|
else
|
||||||
argc--;
|
break;
|
||||||
}
|
argv++;
|
||||||
if ((argc >= 1) && ((sscanf(*argv, "%d", &num) == 0) || (num < 0))) {
|
argc--;
|
||||||
bad:
|
}
|
||||||
BIO_printf(bio_err, "usage: genrsa [args] [numbits]\n");
|
if ((argc >= 1) && ((sscanf(*argv,"%d",&num) == 0) || (num < 0)))
|
||||||
BIO_printf(bio_err,
|
{
|
||||||
" -des encrypt the generated key with DES in cbc mode\n");
|
bad:
|
||||||
BIO_printf(bio_err,
|
BIO_printf(bio_err,"usage: genrsa [args] [numbits]\n");
|
||||||
" -des3 encrypt the generated key with DES in ede cbc mode (168 bit key)\n");
|
BIO_printf(bio_err," -des encrypt the generated key with DES in cbc mode\n");
|
||||||
# ifndef OPENSSL_NO_IDEA
|
BIO_printf(bio_err," -des3 encrypt the generated key with DES in ede cbc mode (168 bit key)\n");
|
||||||
BIO_printf(bio_err,
|
#ifndef OPENSSL_NO_IDEA
|
||||||
" -idea encrypt the generated key with IDEA in cbc mode\n");
|
BIO_printf(bio_err," -idea encrypt the generated key with IDEA in cbc mode\n");
|
||||||
# endif
|
#endif
|
||||||
# ifndef OPENSSL_NO_SEED
|
#ifndef OPENSSL_NO_SEED
|
||||||
BIO_printf(bio_err, " -seed\n");
|
BIO_printf(bio_err," -seed\n");
|
||||||
BIO_printf(bio_err,
|
BIO_printf(bio_err," encrypt PEM output with cbc seed\n");
|
||||||
" encrypt PEM output with cbc seed\n");
|
#endif
|
||||||
# endif
|
#ifndef OPENSSL_NO_AES
|
||||||
# ifndef OPENSSL_NO_AES
|
BIO_printf(bio_err," -aes128, -aes192, -aes256\n");
|
||||||
BIO_printf(bio_err, " -aes128, -aes192, -aes256\n");
|
BIO_printf(bio_err," encrypt PEM output with cbc aes\n");
|
||||||
BIO_printf(bio_err,
|
#endif
|
||||||
" encrypt PEM output with cbc aes\n");
|
#ifndef OPENSSL_NO_CAMELLIA
|
||||||
# endif
|
BIO_printf(bio_err," -camellia128, -camellia192, -camellia256\n");
|
||||||
# ifndef OPENSSL_NO_CAMELLIA
|
BIO_printf(bio_err," encrypt PEM output with cbc camellia\n");
|
||||||
BIO_printf(bio_err, " -camellia128, -camellia192, -camellia256\n");
|
#endif
|
||||||
BIO_printf(bio_err,
|
BIO_printf(bio_err," -out file output the key to 'file\n");
|
||||||
" encrypt PEM output with cbc camellia\n");
|
BIO_printf(bio_err," -passout arg output file pass phrase source\n");
|
||||||
# endif
|
BIO_printf(bio_err," -f4 use F4 (0x10001) for the E value\n");
|
||||||
BIO_printf(bio_err, " -out file output the key to 'file\n");
|
BIO_printf(bio_err," -3 use 3 for the E value\n");
|
||||||
BIO_printf(bio_err,
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
" -passout arg output file pass phrase source\n");
|
BIO_printf(bio_err," -engine e use engine e, possibly a hardware device.\n");
|
||||||
BIO_printf(bio_err,
|
#endif
|
||||||
" -f4 use F4 (0x10001) for the E value\n");
|
BIO_printf(bio_err," -rand file%cfile%c...\n", LIST_SEPARATOR_CHAR, LIST_SEPARATOR_CHAR);
|
||||||
BIO_printf(bio_err, " -3 use 3 for the E value\n");
|
BIO_printf(bio_err," load the file (or the files in the directory) into\n");
|
||||||
# ifndef OPENSSL_NO_ENGINE
|
BIO_printf(bio_err," the random number generator\n");
|
||||||
BIO_printf(bio_err,
|
goto err;
|
||||||
" -engine e use engine e, possibly a hardware device.\n");
|
}
|
||||||
# endif
|
|
||||||
BIO_printf(bio_err, " -rand file%cfile%c...\n", LIST_SEPARATOR_CHAR,
|
|
||||||
LIST_SEPARATOR_CHAR);
|
|
||||||
BIO_printf(bio_err,
|
|
||||||
" load the file (or the files in the directory) into\n");
|
|
||||||
BIO_printf(bio_err, " the random number generator\n");
|
|
||||||
goto err;
|
|
||||||
}
|
|
||||||
|
|
||||||
ERR_load_crypto_strings();
|
ERR_load_crypto_strings();
|
||||||
|
|
||||||
if (!app_passwd(bio_err, NULL, passargout, NULL, &passout)) {
|
if(!app_passwd(bio_err, NULL, passargout, NULL, &passout)) {
|
||||||
BIO_printf(bio_err, "Error getting password\n");
|
BIO_printf(bio_err, "Error getting password\n");
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
# ifndef OPENSSL_NO_ENGINE
|
|
||||||
e = setup_engine(bio_err, engine, 0);
|
|
||||||
# endif
|
|
||||||
|
|
||||||
if (outfile == NULL) {
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
BIO_set_fp(out, stdout, BIO_NOCLOSE);
|
e = setup_engine(bio_err, engine, 0);
|
||||||
# ifdef OPENSSL_SYS_VMS
|
#endif
|
||||||
{
|
|
||||||
BIO *tmpbio = BIO_new(BIO_f_linebuffer());
|
|
||||||
out = BIO_push(tmpbio, out);
|
|
||||||
}
|
|
||||||
# endif
|
|
||||||
} else {
|
|
||||||
if (BIO_write_filename(out, outfile) <= 0) {
|
|
||||||
perror(outfile);
|
|
||||||
goto err;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!app_RAND_load_file(NULL, bio_err, 1) && inrand == NULL
|
if (outfile == NULL)
|
||||||
&& !RAND_status()) {
|
{
|
||||||
BIO_printf(bio_err,
|
BIO_set_fp(out,stdout,BIO_NOCLOSE);
|
||||||
"warning, not much extra random data, consider using the -rand option\n");
|
#ifdef OPENSSL_SYS_VMS
|
||||||
}
|
{
|
||||||
if (inrand != NULL)
|
BIO *tmpbio = BIO_new(BIO_f_linebuffer());
|
||||||
BIO_printf(bio_err, "%ld semi-random bytes loaded\n",
|
out = BIO_push(tmpbio, out);
|
||||||
app_RAND_load_files(inrand));
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (BIO_write_filename(out,outfile) <= 0)
|
||||||
|
{
|
||||||
|
perror(outfile);
|
||||||
|
goto err;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
BIO_printf(bio_err, "Generating RSA private key, %d bit long modulus\n",
|
if (!app_RAND_load_file(NULL, bio_err, 1) && inrand == NULL
|
||||||
num);
|
&& !RAND_status())
|
||||||
# ifdef OPENSSL_NO_ENGINE
|
{
|
||||||
rsa = RSA_new();
|
BIO_printf(bio_err,"warning, not much extra random data, consider using the -rand option\n");
|
||||||
# else
|
}
|
||||||
rsa = RSA_new_method(e);
|
if (inrand != NULL)
|
||||||
# endif
|
BIO_printf(bio_err,"%ld semi-random bytes loaded\n",
|
||||||
if (!rsa)
|
app_RAND_load_files(inrand));
|
||||||
goto err;
|
|
||||||
|
|
||||||
if (!BN_set_word(bn, f4) || !RSA_generate_key_ex(rsa, num, bn, &cb))
|
BIO_printf(bio_err,"Generating RSA private key, %d bit long modulus\n",
|
||||||
goto err;
|
num);
|
||||||
|
#ifdef OPENSSL_NO_ENGINE
|
||||||
|
rsa = RSA_new();
|
||||||
|
#else
|
||||||
|
rsa = RSA_new_method(e);
|
||||||
|
#endif
|
||||||
|
if (!rsa)
|
||||||
|
goto err;
|
||||||
|
|
||||||
app_RAND_write_file(NULL, bio_err);
|
if(!BN_set_word(bn, f4) || !RSA_generate_key_ex(rsa, num, bn, &cb))
|
||||||
|
goto err;
|
||||||
|
|
||||||
/*
|
app_RAND_write_file(NULL, bio_err);
|
||||||
* We need to do the following for when the base number size is < long,
|
|
||||||
* esp windows 3.1 :-(.
|
|
||||||
*/
|
|
||||||
l = 0L;
|
|
||||||
for (i = 0; i < rsa->e->top; i++) {
|
|
||||||
# ifndef SIXTY_FOUR_BIT
|
|
||||||
l <<= BN_BITS4;
|
|
||||||
l <<= BN_BITS4;
|
|
||||||
# endif
|
|
||||||
l += rsa->e->d[i];
|
|
||||||
}
|
|
||||||
BIO_printf(bio_err, "e is %ld (0x%lX)\n", l, l);
|
|
||||||
{
|
|
||||||
PW_CB_DATA cb_data;
|
|
||||||
cb_data.password = passout;
|
|
||||||
cb_data.prompt_info = outfile;
|
|
||||||
if (!PEM_write_bio_RSAPrivateKey(out, rsa, enc, NULL, 0,
|
|
||||||
(pem_password_cb *)password_callback,
|
|
||||||
&cb_data))
|
|
||||||
goto err;
|
|
||||||
}
|
|
||||||
|
|
||||||
ret = 0;
|
/* We need to do the following for when the base number size is <
|
||||||
err:
|
* long, esp windows 3.1 :-(. */
|
||||||
if (bn)
|
l=0L;
|
||||||
BN_free(bn);
|
for (i=0; i<rsa->e->top; i++)
|
||||||
if (rsa)
|
{
|
||||||
RSA_free(rsa);
|
#ifndef SIXTY_FOUR_BIT
|
||||||
if (out)
|
l<<=BN_BITS4;
|
||||||
BIO_free_all(out);
|
l<<=BN_BITS4;
|
||||||
if (passout)
|
#endif
|
||||||
OPENSSL_free(passout);
|
l+=rsa->e->d[i];
|
||||||
if (ret != 0)
|
}
|
||||||
ERR_print_errors(bio_err);
|
BIO_printf(bio_err,"e is %ld (0x%lX)\n",l,l);
|
||||||
apps_shutdown();
|
{
|
||||||
OPENSSL_EXIT(ret);
|
PW_CB_DATA cb_data;
|
||||||
}
|
cb_data.password = passout;
|
||||||
|
cb_data.prompt_info = outfile;
|
||||||
|
if (!PEM_write_bio_RSAPrivateKey(out,rsa,enc,NULL,0,
|
||||||
|
(pem_password_cb *)password_callback,&cb_data))
|
||||||
|
goto err;
|
||||||
|
}
|
||||||
|
|
||||||
|
ret=0;
|
||||||
|
err:
|
||||||
|
if (bn) BN_free(bn);
|
||||||
|
if (rsa) RSA_free(rsa);
|
||||||
|
if (out) BIO_free_all(out);
|
||||||
|
if(passout) OPENSSL_free(passout);
|
||||||
|
if (ret != 0)
|
||||||
|
ERR_print_errors(bio_err);
|
||||||
|
apps_shutdown();
|
||||||
|
OPENSSL_EXIT(ret);
|
||||||
|
}
|
||||||
|
|
||||||
static int MS_CALLBACK genrsa_cb(int p, int n, BN_GENCB *cb)
|
static int MS_CALLBACK genrsa_cb(int p, int n, BN_GENCB *cb)
|
||||||
{
|
{
|
||||||
char c = '*';
|
char c='*';
|
||||||
|
|
||||||
if (p == 0)
|
if (p == 0) c='.';
|
||||||
c = '.';
|
if (p == 1) c='+';
|
||||||
if (p == 1)
|
if (p == 2) c='*';
|
||||||
c = '+';
|
if (p == 3) c='\n';
|
||||||
if (p == 2)
|
BIO_write(cb->arg,&c,1);
|
||||||
c = '*';
|
(void)BIO_flush(cb->arg);
|
||||||
if (p == 3)
|
#ifdef LINT
|
||||||
c = '\n';
|
p=n;
|
||||||
BIO_write(cb->arg, &c, 1);
|
#endif
|
||||||
(void)BIO_flush(cb->arg);
|
return 1;
|
||||||
# ifdef LINT
|
}
|
||||||
p = n;
|
#else /* !OPENSSL_NO_RSA */
|
||||||
# endif
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
#else /* !OPENSSL_NO_RSA */
|
|
||||||
|
|
||||||
# if PEDANTIC
|
# if PEDANTIC
|
||||||
static void *dummy = &dummy;
|
static void *dummy=&dummy;
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -184,7 +184,7 @@ $ LIB_OPENSSL = "VERIFY,ASN1PARS,REQ,DGST,DH,DHPARAM,ENC,PASSWD,GENDH,ERRSTR,"+-
|
|||||||
"X509,GENRSA,GENDSA,GENPKEY,S_SERVER,S_CLIENT,SPEED,"+-
|
"X509,GENRSA,GENDSA,GENPKEY,S_SERVER,S_CLIENT,SPEED,"+-
|
||||||
"S_TIME,APPS,S_CB,S_SOCKET,APP_RAND,VERSION,SESS_ID,"+-
|
"S_TIME,APPS,S_CB,S_SOCKET,APP_RAND,VERSION,SESS_ID,"+-
|
||||||
"CIPHERS,NSEQ,PKCS12,PKCS8,PKEY,PKEYPARAM,PKEYUTL,"+ -
|
"CIPHERS,NSEQ,PKCS12,PKCS8,PKEY,PKEYPARAM,PKEYUTL,"+ -
|
||||||
"SPKAC,SMIME,CMS,RAND,ENGINE,OCSP,PRIME,TS,SRP"
|
"SPKAC,SMIME,CMS,RAND,ENGINE,OCSP,PRIME,TS"
|
||||||
$!
|
$!
|
||||||
$ LIB_OPENSSL = LIB_OPENSSL+ ",VMS_DECC_INIT"
|
$ LIB_OPENSSL = LIB_OPENSSL+ ",VMS_DECC_INIT"
|
||||||
$!
|
$!
|
||||||
@@ -773,12 +773,9 @@ $ CCDEFS = "MONOLITH"
|
|||||||
$ IF F$TYPE(USER_CCDEFS) .NES. "" THEN CCDEFS = CCDEFS + "," + USER_CCDEFS
|
$ IF F$TYPE(USER_CCDEFS) .NES. "" THEN CCDEFS = CCDEFS + "," + USER_CCDEFS
|
||||||
$ CCEXTRAFLAGS = ""
|
$ CCEXTRAFLAGS = ""
|
||||||
$ IF F$TYPE(USER_CCFLAGS) .NES. "" THEN CCEXTRAFLAGS = USER_CCFLAGS
|
$ IF F$TYPE(USER_CCFLAGS) .NES. "" THEN CCEXTRAFLAGS = USER_CCFLAGS
|
||||||
$ CCDISABLEWARNINGS = "" !!! "MAYLOSEDATA3" !!! "LONGLONGTYPE,LONGLONGSUFX,FOUNDCR"
|
$ CCDISABLEWARNINGS = "" !!! "LONGLONGTYPE,LONGLONGSUFX,FOUNDCR"
|
||||||
$ IF F$TYPE(USER_CCDISABLEWARNINGS) .NES. ""
|
$ IF F$TYPE(USER_CCDISABLEWARNINGS) .NES. "" THEN -
|
||||||
$ THEN
|
CCDISABLEWARNINGS = CCDISABLEWARNINGS + "," + USER_CCDISABLEWARNINGS
|
||||||
$ IF CCDISABLEWARNINGS .NES. "" THEN CCDISABLEWARNINGS = CCDISABLEWARNINGS + ","
|
|
||||||
$ CCDISABLEWARNINGS = CCDISABLEWARNINGS + USER_CCDISABLEWARNINGS
|
|
||||||
$ ENDIF
|
|
||||||
$!
|
$!
|
||||||
$! Check To See If We Have A ZLIB Option.
|
$! Check To See If We Have A ZLIB Option.
|
||||||
$!
|
$!
|
||||||
@@ -1067,18 +1064,6 @@ $! Finish up the definition of CC.
|
|||||||
$!
|
$!
|
||||||
$ IF COMPILER .EQS. "DECC"
|
$ IF COMPILER .EQS. "DECC"
|
||||||
$ THEN
|
$ THEN
|
||||||
$! Not all compiler versions support MAYLOSEDATA3.
|
|
||||||
$ OPT_TEST = "MAYLOSEDATA3"
|
|
||||||
$ DEFINE /USER_MODE SYS$ERROR NL:
|
|
||||||
$ DEFINE /USER_MODE SYS$OUTPUT NL:
|
|
||||||
$ 'CC' /NOCROSS_REFERENCE /NOLIST /NOOBJECT -
|
|
||||||
/WARNINGS = DISABLE = ('OPT_TEST', EMPTYFILE) NL:
|
|
||||||
$ IF ($SEVERITY)
|
|
||||||
$ THEN
|
|
||||||
$ IF CCDISABLEWARNINGS .NES. "" THEN -
|
|
||||||
CCDISABLEWARNINGS = CCDISABLEWARNINGS+ ","
|
|
||||||
$ CCDISABLEWARNINGS = CCDISABLEWARNINGS+ OPT_TEST
|
|
||||||
$ ENDIF
|
|
||||||
$ IF CCDISABLEWARNINGS .NES. ""
|
$ IF CCDISABLEWARNINGS .NES. ""
|
||||||
$ THEN
|
$ THEN
|
||||||
$ CCDISABLEWARNINGS = " /WARNING=(DISABLE=(" + CCDISABLEWARNINGS + "))"
|
$ CCDISABLEWARNINGS = " /WARNING=(DISABLE=(" + CCDISABLEWARNINGS + "))"
|
||||||
|
|||||||
179
apps/nseq.c
179
apps/nseq.c
@@ -1,7 +1,6 @@
|
|||||||
/* nseq.c */
|
/* nseq.c */
|
||||||
/*
|
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
|
||||||
* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL project
|
* project 1999.
|
||||||
* 1999.
|
|
||||||
*/
|
*/
|
||||||
/* ====================================================================
|
/* ====================================================================
|
||||||
* Copyright (c) 1999 The OpenSSL Project. All rights reserved.
|
* Copyright (c) 1999 The OpenSSL Project. All rights reserved.
|
||||||
@@ -70,101 +69,99 @@ int MAIN(int, char **);
|
|||||||
|
|
||||||
int MAIN(int argc, char **argv)
|
int MAIN(int argc, char **argv)
|
||||||
{
|
{
|
||||||
char **args, *infile = NULL, *outfile = NULL;
|
char **args, *infile = NULL, *outfile = NULL;
|
||||||
BIO *in = NULL, *out = NULL;
|
BIO *in = NULL, *out = NULL;
|
||||||
int toseq = 0;
|
int toseq = 0;
|
||||||
X509 *x509 = NULL;
|
X509 *x509 = NULL;
|
||||||
NETSCAPE_CERT_SEQUENCE *seq = NULL;
|
NETSCAPE_CERT_SEQUENCE *seq = NULL;
|
||||||
int i, ret = 1;
|
int i, ret = 1;
|
||||||
int badarg = 0;
|
int badarg = 0;
|
||||||
if (bio_err == NULL)
|
if (bio_err == NULL) bio_err = BIO_new_fp (stderr, BIO_NOCLOSE);
|
||||||
bio_err = BIO_new_fp(stderr, BIO_NOCLOSE);
|
ERR_load_crypto_strings();
|
||||||
ERR_load_crypto_strings();
|
args = argv + 1;
|
||||||
args = argv + 1;
|
while (!badarg && *args && *args[0] == '-') {
|
||||||
while (!badarg && *args && *args[0] == '-') {
|
if (!strcmp (*args, "-toseq")) toseq = 1;
|
||||||
if (!strcmp(*args, "-toseq"))
|
else if (!strcmp (*args, "-in")) {
|
||||||
toseq = 1;
|
if (args[1]) {
|
||||||
else if (!strcmp(*args, "-in")) {
|
args++;
|
||||||
if (args[1]) {
|
infile = *args;
|
||||||
args++;
|
} else badarg = 1;
|
||||||
infile = *args;
|
} else if (!strcmp (*args, "-out")) {
|
||||||
} else
|
if (args[1]) {
|
||||||
badarg = 1;
|
args++;
|
||||||
} else if (!strcmp(*args, "-out")) {
|
outfile = *args;
|
||||||
if (args[1]) {
|
} else badarg = 1;
|
||||||
args++;
|
} else badarg = 1;
|
||||||
outfile = *args;
|
args++;
|
||||||
} else
|
}
|
||||||
badarg = 1;
|
|
||||||
} else
|
|
||||||
badarg = 1;
|
|
||||||
args++;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (badarg) {
|
if (badarg) {
|
||||||
BIO_printf(bio_err, "Netscape certificate sequence utility\n");
|
BIO_printf (bio_err, "Netscape certificate sequence utility\n");
|
||||||
BIO_printf(bio_err, "Usage nseq [options]\n");
|
BIO_printf (bio_err, "Usage nseq [options]\n");
|
||||||
BIO_printf(bio_err, "where options are\n");
|
BIO_printf (bio_err, "where options are\n");
|
||||||
BIO_printf(bio_err, "-in file input file\n");
|
BIO_printf (bio_err, "-in file input file\n");
|
||||||
BIO_printf(bio_err, "-out file output file\n");
|
BIO_printf (bio_err, "-out file output file\n");
|
||||||
BIO_printf(bio_err, "-toseq output NS Sequence file\n");
|
BIO_printf (bio_err, "-toseq output NS Sequence file\n");
|
||||||
OPENSSL_EXIT(1);
|
OPENSSL_EXIT(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (infile) {
|
if (infile) {
|
||||||
if (!(in = BIO_new_file(infile, "r"))) {
|
if (!(in = BIO_new_file (infile, "r"))) {
|
||||||
BIO_printf(bio_err, "Can't open input file %s\n", infile);
|
BIO_printf (bio_err,
|
||||||
goto end;
|
"Can't open input file %s\n", infile);
|
||||||
}
|
goto end;
|
||||||
} else
|
}
|
||||||
in = BIO_new_fp(stdin, BIO_NOCLOSE);
|
} else in = BIO_new_fp(stdin, BIO_NOCLOSE);
|
||||||
|
|
||||||
if (outfile) {
|
if (outfile) {
|
||||||
if (!(out = BIO_new_file(outfile, "w"))) {
|
if (!(out = BIO_new_file (outfile, "w"))) {
|
||||||
BIO_printf(bio_err, "Can't open output file %s\n", outfile);
|
BIO_printf (bio_err,
|
||||||
goto end;
|
"Can't open output file %s\n", outfile);
|
||||||
}
|
goto end;
|
||||||
} else {
|
}
|
||||||
out = BIO_new_fp(stdout, BIO_NOCLOSE);
|
} else {
|
||||||
|
out = BIO_new_fp(stdout, BIO_NOCLOSE);
|
||||||
#ifdef OPENSSL_SYS_VMS
|
#ifdef OPENSSL_SYS_VMS
|
||||||
{
|
{
|
||||||
BIO *tmpbio = BIO_new(BIO_f_linebuffer());
|
BIO *tmpbio = BIO_new(BIO_f_linebuffer());
|
||||||
out = BIO_push(tmpbio, out);
|
out = BIO_push(tmpbio, out);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
if (toseq) {
|
if (toseq) {
|
||||||
seq = NETSCAPE_CERT_SEQUENCE_new();
|
seq = NETSCAPE_CERT_SEQUENCE_new();
|
||||||
seq->certs = sk_X509_new_null();
|
seq->certs = sk_X509_new_null();
|
||||||
while ((x509 = PEM_read_bio_X509(in, NULL, NULL, NULL)))
|
while((x509 = PEM_read_bio_X509(in, NULL, NULL, NULL)))
|
||||||
sk_X509_push(seq->certs, x509);
|
sk_X509_push(seq->certs,x509);
|
||||||
|
|
||||||
if (!sk_X509_num(seq->certs)) {
|
if(!sk_X509_num(seq->certs))
|
||||||
BIO_printf(bio_err, "Error reading certs file %s\n", infile);
|
{
|
||||||
ERR_print_errors(bio_err);
|
BIO_printf (bio_err, "Error reading certs file %s\n", infile);
|
||||||
goto end;
|
ERR_print_errors(bio_err);
|
||||||
}
|
goto end;
|
||||||
PEM_write_bio_NETSCAPE_CERT_SEQUENCE(out, seq);
|
}
|
||||||
ret = 0;
|
PEM_write_bio_NETSCAPE_CERT_SEQUENCE(out, seq);
|
||||||
goto end;
|
ret = 0;
|
||||||
}
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
if (!(seq = PEM_read_bio_NETSCAPE_CERT_SEQUENCE(in, NULL, NULL, NULL))) {
|
if (!(seq = PEM_read_bio_NETSCAPE_CERT_SEQUENCE(in, NULL, NULL, NULL))) {
|
||||||
BIO_printf(bio_err, "Error reading sequence file %s\n", infile);
|
BIO_printf (bio_err, "Error reading sequence file %s\n", infile);
|
||||||
ERR_print_errors(bio_err);
|
ERR_print_errors(bio_err);
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < sk_X509_num(seq->certs); i++) {
|
for(i = 0; i < sk_X509_num(seq->certs); i++) {
|
||||||
x509 = sk_X509_value(seq->certs, i);
|
x509 = sk_X509_value(seq->certs, i);
|
||||||
dump_cert_text(out, x509);
|
dump_cert_text(out, x509);
|
||||||
PEM_write_bio_X509(out, x509);
|
PEM_write_bio_X509(out, x509);
|
||||||
}
|
}
|
||||||
ret = 0;
|
ret = 0;
|
||||||
end:
|
end:
|
||||||
BIO_free(in);
|
BIO_free(in);
|
||||||
BIO_free_all(out);
|
BIO_free_all(out);
|
||||||
NETSCAPE_CERT_SEQUENCE_free(seq);
|
NETSCAPE_CERT_SEQUENCE_free(seq);
|
||||||
|
|
||||||
OPENSSL_EXIT(ret);
|
OPENSSL_EXIT(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
2362
apps/ocsp.c
2362
apps/ocsp.c
File diff suppressed because it is too large
Load Diff
960
apps/openssl.c
960
apps/openssl.c
File diff suppressed because it is too large
Load Diff
844
apps/passwd.c
844
apps/passwd.c
@@ -6,44 +6,44 @@
|
|||||||
|
|
||||||
#if !defined(OPENSSL_NO_DES) || !defined(NO_MD5CRYPT_1)
|
#if !defined(OPENSSL_NO_DES) || !defined(NO_MD5CRYPT_1)
|
||||||
|
|
||||||
# include <assert.h>
|
#include <assert.h>
|
||||||
# include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
# include "apps.h"
|
#include "apps.h"
|
||||||
|
|
||||||
# include <openssl/bio.h>
|
#include <openssl/bio.h>
|
||||||
# include <openssl/err.h>
|
#include <openssl/err.h>
|
||||||
# include <openssl/evp.h>
|
#include <openssl/evp.h>
|
||||||
# include <openssl/rand.h>
|
#include <openssl/rand.h>
|
||||||
# ifndef OPENSSL_NO_DES
|
#ifndef OPENSSL_NO_DES
|
||||||
# include <openssl/des.h>
|
# include <openssl/des.h>
|
||||||
# endif
|
#endif
|
||||||
# ifndef NO_MD5CRYPT_1
|
#ifndef NO_MD5CRYPT_1
|
||||||
# include <openssl/md5.h>
|
# include <openssl/md5.h>
|
||||||
# endif
|
#endif
|
||||||
|
|
||||||
# undef PROG
|
|
||||||
# define PROG passwd_main
|
|
||||||
|
|
||||||
static unsigned const char cov_2char[64] = {
|
#undef PROG
|
||||||
/* from crypto/des/fcrypt.c */
|
#define PROG passwd_main
|
||||||
0x2E, 0x2F, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35,
|
|
||||||
0x36, 0x37, 0x38, 0x39, 0x41, 0x42, 0x43, 0x44,
|
|
||||||
0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x4C,
|
static unsigned const char cov_2char[64]={
|
||||||
0x4D, 0x4E, 0x4F, 0x50, 0x51, 0x52, 0x53, 0x54,
|
/* from crypto/des/fcrypt.c */
|
||||||
0x55, 0x56, 0x57, 0x58, 0x59, 0x5A, 0x61, 0x62,
|
0x2E,0x2F,0x30,0x31,0x32,0x33,0x34,0x35,
|
||||||
0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6A,
|
0x36,0x37,0x38,0x39,0x41,0x42,0x43,0x44,
|
||||||
0x6B, 0x6C, 0x6D, 0x6E, 0x6F, 0x70, 0x71, 0x72,
|
0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,
|
||||||
0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A
|
0x4D,0x4E,0x4F,0x50,0x51,0x52,0x53,0x54,
|
||||||
|
0x55,0x56,0x57,0x58,0x59,0x5A,0x61,0x62,
|
||||||
|
0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,
|
||||||
|
0x6B,0x6C,0x6D,0x6E,0x6F,0x70,0x71,0x72,
|
||||||
|
0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A
|
||||||
};
|
};
|
||||||
|
|
||||||
static int do_passwd(int passed_salt, char **salt_p, char **salt_malloc_p,
|
static int do_passwd(int passed_salt, char **salt_p, char **salt_malloc_p,
|
||||||
char *passwd, BIO *out, int quiet, int table,
|
char *passwd, BIO *out, int quiet, int table, int reverse,
|
||||||
int reverse, size_t pw_maxlen, int usecrypt, int use1,
|
size_t pw_maxlen, int usecrypt, int use1, int useapr1);
|
||||||
int useapr1);
|
|
||||||
|
|
||||||
/*-
|
/* -crypt - standard Unix password algorithm (default)
|
||||||
* -crypt - standard Unix password algorithm (default)
|
|
||||||
* -1 - MD5-based password algorithm
|
* -1 - MD5-based password algorithm
|
||||||
* -apr1 - MD5-based password algorithm, Apache variant
|
* -apr1 - MD5-based password algorithm, Apache variant
|
||||||
* -salt string - salt
|
* -salt string - salt
|
||||||
@@ -58,437 +58,455 @@ static int do_passwd(int passed_salt, char **salt_p, char **salt_malloc_p,
|
|||||||
int MAIN(int, char **);
|
int MAIN(int, char **);
|
||||||
|
|
||||||
int MAIN(int argc, char **argv)
|
int MAIN(int argc, char **argv)
|
||||||
{
|
{
|
||||||
int ret = 1;
|
int ret = 1;
|
||||||
char *infile = NULL;
|
char *infile = NULL;
|
||||||
int in_stdin = 0;
|
int in_stdin = 0;
|
||||||
int in_noverify = 0;
|
int in_noverify = 0;
|
||||||
char *salt = NULL, *passwd = NULL, **passwds = NULL;
|
char *salt = NULL, *passwd = NULL, **passwds = NULL;
|
||||||
char *salt_malloc = NULL, *passwd_malloc = NULL;
|
char *salt_malloc = NULL, *passwd_malloc = NULL;
|
||||||
size_t passwd_malloc_size = 0;
|
size_t passwd_malloc_size = 0;
|
||||||
int pw_source_defined = 0;
|
int pw_source_defined = 0;
|
||||||
BIO *in = NULL, *out = NULL;
|
BIO *in = NULL, *out = NULL;
|
||||||
int i, badopt, opt_done;
|
int i, badopt, opt_done;
|
||||||
int passed_salt = 0, quiet = 0, table = 0, reverse = 0;
|
int passed_salt = 0, quiet = 0, table = 0, reverse = 0;
|
||||||
int usecrypt = 0, use1 = 0, useapr1 = 0;
|
int usecrypt = 0, use1 = 0, useapr1 = 0;
|
||||||
size_t pw_maxlen = 0;
|
size_t pw_maxlen = 0;
|
||||||
|
|
||||||
apps_startup();
|
apps_startup();
|
||||||
|
|
||||||
if (bio_err == NULL)
|
if (bio_err == NULL)
|
||||||
if ((bio_err = BIO_new(BIO_s_file())) != NULL)
|
if ((bio_err=BIO_new(BIO_s_file())) != NULL)
|
||||||
BIO_set_fp(bio_err, stderr, BIO_NOCLOSE | BIO_FP_TEXT);
|
BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT);
|
||||||
|
|
||||||
if (!load_config(bio_err, NULL))
|
if (!load_config(bio_err, NULL))
|
||||||
goto err;
|
goto err;
|
||||||
out = BIO_new(BIO_s_file());
|
out = BIO_new(BIO_s_file());
|
||||||
if (out == NULL)
|
if (out == NULL)
|
||||||
goto err;
|
goto err;
|
||||||
BIO_set_fp(out, stdout, BIO_NOCLOSE | BIO_FP_TEXT);
|
BIO_set_fp(out, stdout, BIO_NOCLOSE | BIO_FP_TEXT);
|
||||||
# ifdef OPENSSL_SYS_VMS
|
#ifdef OPENSSL_SYS_VMS
|
||||||
{
|
{
|
||||||
BIO *tmpbio = BIO_new(BIO_f_linebuffer());
|
BIO *tmpbio = BIO_new(BIO_f_linebuffer());
|
||||||
out = BIO_push(tmpbio, out);
|
out = BIO_push(tmpbio, out);
|
||||||
}
|
}
|
||||||
# endif
|
#endif
|
||||||
|
|
||||||
badopt = 0, opt_done = 0;
|
badopt = 0, opt_done = 0;
|
||||||
i = 0;
|
i = 0;
|
||||||
while (!badopt && !opt_done && argv[++i] != NULL) {
|
while (!badopt && !opt_done && argv[++i] != NULL)
|
||||||
if (strcmp(argv[i], "-crypt") == 0)
|
{
|
||||||
usecrypt = 1;
|
if (strcmp(argv[i], "-crypt") == 0)
|
||||||
else if (strcmp(argv[i], "-1") == 0)
|
usecrypt = 1;
|
||||||
use1 = 1;
|
else if (strcmp(argv[i], "-1") == 0)
|
||||||
else if (strcmp(argv[i], "-apr1") == 0)
|
use1 = 1;
|
||||||
useapr1 = 1;
|
else if (strcmp(argv[i], "-apr1") == 0)
|
||||||
else if (strcmp(argv[i], "-salt") == 0) {
|
useapr1 = 1;
|
||||||
if ((argv[i + 1] != NULL) && (salt == NULL)) {
|
else if (strcmp(argv[i], "-salt") == 0)
|
||||||
passed_salt = 1;
|
{
|
||||||
salt = argv[++i];
|
if ((argv[i+1] != NULL) && (salt == NULL))
|
||||||
} else
|
{
|
||||||
badopt = 1;
|
passed_salt = 1;
|
||||||
} else if (strcmp(argv[i], "-in") == 0) {
|
salt = argv[++i];
|
||||||
if ((argv[i + 1] != NULL) && !pw_source_defined) {
|
}
|
||||||
pw_source_defined = 1;
|
else
|
||||||
infile = argv[++i];
|
badopt = 1;
|
||||||
} else
|
}
|
||||||
badopt = 1;
|
else if (strcmp(argv[i], "-in") == 0)
|
||||||
} else if (strcmp(argv[i], "-stdin") == 0) {
|
{
|
||||||
if (!pw_source_defined) {
|
if ((argv[i+1] != NULL) && !pw_source_defined)
|
||||||
pw_source_defined = 1;
|
{
|
||||||
in_stdin = 1;
|
pw_source_defined = 1;
|
||||||
} else
|
infile = argv[++i];
|
||||||
badopt = 1;
|
}
|
||||||
} else if (strcmp(argv[i], "-noverify") == 0)
|
else
|
||||||
in_noverify = 1;
|
badopt = 1;
|
||||||
else if (strcmp(argv[i], "-quiet") == 0)
|
}
|
||||||
quiet = 1;
|
else if (strcmp(argv[i], "-stdin") == 0)
|
||||||
else if (strcmp(argv[i], "-table") == 0)
|
{
|
||||||
table = 1;
|
if (!pw_source_defined)
|
||||||
else if (strcmp(argv[i], "-reverse") == 0)
|
{
|
||||||
reverse = 1;
|
pw_source_defined = 1;
|
||||||
else if (argv[i][0] == '-')
|
in_stdin = 1;
|
||||||
badopt = 1;
|
}
|
||||||
else if (!pw_source_defined)
|
else
|
||||||
/* non-option arguments, use as passwords */
|
badopt = 1;
|
||||||
{
|
}
|
||||||
pw_source_defined = 1;
|
else if (strcmp(argv[i], "-noverify") == 0)
|
||||||
passwds = &argv[i];
|
in_noverify = 1;
|
||||||
opt_done = 1;
|
else if (strcmp(argv[i], "-quiet") == 0)
|
||||||
} else
|
quiet = 1;
|
||||||
badopt = 1;
|
else if (strcmp(argv[i], "-table") == 0)
|
||||||
}
|
table = 1;
|
||||||
|
else if (strcmp(argv[i], "-reverse") == 0)
|
||||||
|
reverse = 1;
|
||||||
|
else if (argv[i][0] == '-')
|
||||||
|
badopt = 1;
|
||||||
|
else if (!pw_source_defined)
|
||||||
|
/* non-option arguments, use as passwords */
|
||||||
|
{
|
||||||
|
pw_source_defined = 1;
|
||||||
|
passwds = &argv[i];
|
||||||
|
opt_done = 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
badopt = 1;
|
||||||
|
}
|
||||||
|
|
||||||
if (!usecrypt && !use1 && !useapr1) /* use default */
|
if (!usecrypt && !use1 && !useapr1) /* use default */
|
||||||
usecrypt = 1;
|
usecrypt = 1;
|
||||||
if (usecrypt + use1 + useapr1 > 1) /* conflict */
|
if (usecrypt + use1 + useapr1 > 1) /* conflict */
|
||||||
badopt = 1;
|
badopt = 1;
|
||||||
|
|
||||||
/* reject unsupported algorithms */
|
/* reject unsupported algorithms */
|
||||||
# ifdef OPENSSL_NO_DES
|
#ifdef OPENSSL_NO_DES
|
||||||
if (usecrypt)
|
if (usecrypt) badopt = 1;
|
||||||
badopt = 1;
|
#endif
|
||||||
# endif
|
#ifdef NO_MD5CRYPT_1
|
||||||
# ifdef NO_MD5CRYPT_1
|
if (use1 || useapr1) badopt = 1;
|
||||||
if (use1 || useapr1)
|
#endif
|
||||||
badopt = 1;
|
|
||||||
# endif
|
|
||||||
|
|
||||||
if (badopt) {
|
if (badopt)
|
||||||
BIO_printf(bio_err, "Usage: passwd [options] [passwords]\n");
|
{
|
||||||
BIO_printf(bio_err, "where options are\n");
|
BIO_printf(bio_err, "Usage: passwd [options] [passwords]\n");
|
||||||
# ifndef OPENSSL_NO_DES
|
BIO_printf(bio_err, "where options are\n");
|
||||||
BIO_printf(bio_err,
|
#ifndef OPENSSL_NO_DES
|
||||||
"-crypt standard Unix password algorithm (default)\n");
|
BIO_printf(bio_err, "-crypt standard Unix password algorithm (default)\n");
|
||||||
# endif
|
#endif
|
||||||
# ifndef NO_MD5CRYPT_1
|
#ifndef NO_MD5CRYPT_1
|
||||||
BIO_printf(bio_err,
|
BIO_printf(bio_err, "-1 MD5-based password algorithm\n");
|
||||||
"-1 MD5-based password algorithm\n");
|
BIO_printf(bio_err, "-apr1 MD5-based password algorithm, Apache variant\n");
|
||||||
BIO_printf(bio_err,
|
#endif
|
||||||
"-apr1 MD5-based password algorithm, Apache variant\n");
|
BIO_printf(bio_err, "-salt string use provided salt\n");
|
||||||
# endif
|
BIO_printf(bio_err, "-in file read passwords from file\n");
|
||||||
BIO_printf(bio_err, "-salt string use provided salt\n");
|
BIO_printf(bio_err, "-stdin read passwords from stdin\n");
|
||||||
BIO_printf(bio_err, "-in file read passwords from file\n");
|
BIO_printf(bio_err, "-noverify never verify when reading password from terminal\n");
|
||||||
BIO_printf(bio_err, "-stdin read passwords from stdin\n");
|
BIO_printf(bio_err, "-quiet no warnings\n");
|
||||||
BIO_printf(bio_err,
|
BIO_printf(bio_err, "-table format output as table\n");
|
||||||
"-noverify never verify when reading password from terminal\n");
|
BIO_printf(bio_err, "-reverse switch table columns\n");
|
||||||
BIO_printf(bio_err, "-quiet no warnings\n");
|
|
||||||
BIO_printf(bio_err, "-table format output as table\n");
|
|
||||||
BIO_printf(bio_err, "-reverse switch table columns\n");
|
|
||||||
|
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((infile != NULL) || in_stdin) {
|
if ((infile != NULL) || in_stdin)
|
||||||
in = BIO_new(BIO_s_file());
|
{
|
||||||
if (in == NULL)
|
in = BIO_new(BIO_s_file());
|
||||||
goto err;
|
if (in == NULL)
|
||||||
if (infile != NULL) {
|
goto err;
|
||||||
assert(in_stdin == 0);
|
if (infile != NULL)
|
||||||
if (BIO_read_filename(in, infile) <= 0)
|
{
|
||||||
goto err;
|
assert(in_stdin == 0);
|
||||||
} else {
|
if (BIO_read_filename(in, infile) <= 0)
|
||||||
assert(in_stdin);
|
goto err;
|
||||||
BIO_set_fp(in, stdin, BIO_NOCLOSE);
|
}
|
||||||
}
|
else
|
||||||
}
|
{
|
||||||
|
assert(in_stdin);
|
||||||
|
BIO_set_fp(in, stdin, BIO_NOCLOSE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (usecrypt)
|
if (usecrypt)
|
||||||
pw_maxlen = 8;
|
pw_maxlen = 8;
|
||||||
else if (use1 || useapr1)
|
else if (use1 || useapr1)
|
||||||
pw_maxlen = 256; /* arbitrary limit, should be enough for most
|
pw_maxlen = 256; /* arbitrary limit, should be enough for most passwords */
|
||||||
* passwords */
|
|
||||||
|
|
||||||
if (passwds == NULL) {
|
if (passwds == NULL)
|
||||||
/* no passwords on the command line */
|
{
|
||||||
|
/* no passwords on the command line */
|
||||||
|
|
||||||
passwd_malloc_size = pw_maxlen + 2;
|
passwd_malloc_size = pw_maxlen + 2;
|
||||||
/*
|
/* longer than necessary so that we can warn about truncation */
|
||||||
* longer than necessary so that we can warn about truncation
|
passwd = passwd_malloc = OPENSSL_malloc(passwd_malloc_size);
|
||||||
*/
|
if (passwd_malloc == NULL)
|
||||||
passwd = passwd_malloc = OPENSSL_malloc(passwd_malloc_size);
|
goto err;
|
||||||
if (passwd_malloc == NULL)
|
}
|
||||||
goto err;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((in == NULL) && (passwds == NULL)) {
|
if ((in == NULL) && (passwds == NULL))
|
||||||
/* build a null-terminated list */
|
{
|
||||||
static char *passwds_static[2] = { NULL, NULL };
|
/* build a null-terminated list */
|
||||||
|
static char *passwds_static[2] = {NULL, NULL};
|
||||||
|
|
||||||
passwds = passwds_static;
|
passwds = passwds_static;
|
||||||
if (in == NULL)
|
if (in == NULL)
|
||||||
if (EVP_read_pw_string
|
if (EVP_read_pw_string(passwd_malloc, passwd_malloc_size, "Password: ", !(passed_salt || in_noverify)) != 0)
|
||||||
(passwd_malloc, passwd_malloc_size, "Password: ",
|
goto err;
|
||||||
!(passed_salt || in_noverify)) != 0)
|
passwds[0] = passwd_malloc;
|
||||||
goto err;
|
}
|
||||||
passwds[0] = passwd_malloc;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (in == NULL) {
|
if (in == NULL)
|
||||||
assert(passwds != NULL);
|
{
|
||||||
assert(*passwds != NULL);
|
assert(passwds != NULL);
|
||||||
|
assert(*passwds != NULL);
|
||||||
|
|
||||||
do { /* loop over list of passwords */
|
do /* loop over list of passwords */
|
||||||
passwd = *passwds++;
|
{
|
||||||
if (!do_passwd(passed_salt, &salt, &salt_malloc, passwd, out,
|
passwd = *passwds++;
|
||||||
quiet, table, reverse, pw_maxlen, usecrypt, use1,
|
if (!do_passwd(passed_salt, &salt, &salt_malloc, passwd, out,
|
||||||
useapr1))
|
quiet, table, reverse, pw_maxlen, usecrypt, use1, useapr1))
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
while (*passwds != NULL);
|
while (*passwds != NULL);
|
||||||
} else
|
}
|
||||||
/* in != NULL */
|
else
|
||||||
{
|
/* in != NULL */
|
||||||
int done;
|
{
|
||||||
|
int done;
|
||||||
|
|
||||||
assert(passwd != NULL);
|
assert (passwd != NULL);
|
||||||
do {
|
do
|
||||||
int r = BIO_gets(in, passwd, pw_maxlen + 1);
|
{
|
||||||
if (r > 0) {
|
int r = BIO_gets(in, passwd, pw_maxlen + 1);
|
||||||
char *c = (strchr(passwd, '\n'));
|
if (r > 0)
|
||||||
if (c != NULL)
|
{
|
||||||
*c = 0; /* truncate at newline */
|
char *c = (strchr(passwd, '\n')) ;
|
||||||
else {
|
if (c != NULL)
|
||||||
/* ignore rest of line */
|
*c = 0; /* truncate at newline */
|
||||||
char trash[BUFSIZ];
|
else
|
||||||
do
|
{
|
||||||
r = BIO_gets(in, trash, sizeof trash);
|
/* ignore rest of line */
|
||||||
while ((r > 0) && (!strchr(trash, '\n')));
|
char trash[BUFSIZ];
|
||||||
}
|
do
|
||||||
|
r = BIO_gets(in, trash, sizeof trash);
|
||||||
|
while ((r > 0) && (!strchr(trash, '\n')));
|
||||||
|
}
|
||||||
|
|
||||||
if (!do_passwd(passed_salt, &salt, &salt_malloc, passwd, out,
|
if (!do_passwd(passed_salt, &salt, &salt_malloc, passwd, out,
|
||||||
quiet, table, reverse, pw_maxlen, usecrypt,
|
quiet, table, reverse, pw_maxlen, usecrypt, use1, useapr1))
|
||||||
use1, useapr1))
|
goto err;
|
||||||
goto err;
|
}
|
||||||
}
|
done = (r <= 0);
|
||||||
done = (r <= 0);
|
}
|
||||||
}
|
while (!done);
|
||||||
while (!done);
|
}
|
||||||
}
|
ret = 0;
|
||||||
ret = 0;
|
|
||||||
|
|
||||||
err:
|
err:
|
||||||
ERR_print_errors(bio_err);
|
ERR_print_errors(bio_err);
|
||||||
if (salt_malloc)
|
if (salt_malloc)
|
||||||
OPENSSL_free(salt_malloc);
|
OPENSSL_free(salt_malloc);
|
||||||
if (passwd_malloc)
|
if (passwd_malloc)
|
||||||
OPENSSL_free(passwd_malloc);
|
OPENSSL_free(passwd_malloc);
|
||||||
if (in)
|
if (in)
|
||||||
BIO_free(in);
|
BIO_free(in);
|
||||||
if (out)
|
if (out)
|
||||||
BIO_free_all(out);
|
BIO_free_all(out);
|
||||||
apps_shutdown();
|
apps_shutdown();
|
||||||
OPENSSL_EXIT(ret);
|
OPENSSL_EXIT(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
# ifndef NO_MD5CRYPT_1
|
|
||||||
/*
|
#ifndef NO_MD5CRYPT_1
|
||||||
* MD5-based password algorithm (should probably be available as a library
|
/* MD5-based password algorithm (should probably be available as a library
|
||||||
* function; then the static buffer would not be acceptable). For magic
|
* function; then the static buffer would not be acceptable).
|
||||||
* string "1", this should be compatible to the MD5-based BSD password
|
* For magic string "1", this should be compatible to the MD5-based BSD
|
||||||
* algorithm. For 'magic' string "apr1", this is compatible to the MD5-based
|
* password algorithm.
|
||||||
* Apache password algorithm. (Apparently, the Apache password algorithm is
|
* For 'magic' string "apr1", this is compatible to the MD5-based Apache
|
||||||
* identical except that the 'magic' string was changed -- the laziest
|
* password algorithm.
|
||||||
* application of the NIH principle I've ever encountered.)
|
* (Apparently, the Apache password algorithm is identical except that the
|
||||||
|
* 'magic' string was changed -- the laziest application of the NIH principle
|
||||||
|
* I've ever encountered.)
|
||||||
*/
|
*/
|
||||||
static char *md5crypt(const char *passwd, const char *magic, const char *salt)
|
static char *md5crypt(const char *passwd, const char *magic, const char *salt)
|
||||||
{
|
{
|
||||||
/* "$apr1$..salt..$.......md5hash..........\0" */
|
static char out_buf[6 + 9 + 24 + 2]; /* "$apr1$..salt..$.......md5hash..........\0" */
|
||||||
static char out_buf[6 + 9 + 24 + 2];
|
unsigned char buf[MD5_DIGEST_LENGTH];
|
||||||
unsigned char buf[MD5_DIGEST_LENGTH];
|
char *salt_out;
|
||||||
char *salt_out;
|
int n;
|
||||||
int n;
|
unsigned int i;
|
||||||
unsigned int i;
|
EVP_MD_CTX md,md2;
|
||||||
EVP_MD_CTX md, md2;
|
size_t passwd_len, salt_len;
|
||||||
size_t passwd_len, salt_len;
|
|
||||||
|
|
||||||
passwd_len = strlen(passwd);
|
passwd_len = strlen(passwd);
|
||||||
out_buf[0] = '$';
|
out_buf[0] = '$';
|
||||||
out_buf[1] = 0;
|
out_buf[1] = 0;
|
||||||
assert(strlen(magic) <= 4); /* "1" or "apr1" */
|
assert(strlen(magic) <= 4); /* "1" or "apr1" */
|
||||||
strncat(out_buf, magic, 4);
|
strncat(out_buf, magic, 4);
|
||||||
strncat(out_buf, "$", 1);
|
strncat(out_buf, "$", 1);
|
||||||
strncat(out_buf, salt, 8);
|
strncat(out_buf, salt, 8);
|
||||||
assert(strlen(out_buf) <= 6 + 8); /* "$apr1$..salt.." */
|
assert(strlen(out_buf) <= 6 + 8); /* "$apr1$..salt.." */
|
||||||
salt_out = out_buf + 2 + strlen(magic);
|
salt_out = out_buf + 2 + strlen(magic);
|
||||||
salt_len = strlen(salt_out);
|
salt_len = strlen(salt_out);
|
||||||
assert(salt_len <= 8);
|
assert(salt_len <= 8);
|
||||||
|
|
||||||
EVP_MD_CTX_init(&md);
|
EVP_MD_CTX_init(&md);
|
||||||
EVP_DigestInit_ex(&md, EVP_md5(), NULL);
|
EVP_DigestInit_ex(&md,EVP_md5(), NULL);
|
||||||
EVP_DigestUpdate(&md, passwd, passwd_len);
|
EVP_DigestUpdate(&md, passwd, passwd_len);
|
||||||
EVP_DigestUpdate(&md, "$", 1);
|
EVP_DigestUpdate(&md, "$", 1);
|
||||||
EVP_DigestUpdate(&md, magic, strlen(magic));
|
EVP_DigestUpdate(&md, magic, strlen(magic));
|
||||||
EVP_DigestUpdate(&md, "$", 1);
|
EVP_DigestUpdate(&md, "$", 1);
|
||||||
EVP_DigestUpdate(&md, salt_out, salt_len);
|
EVP_DigestUpdate(&md, salt_out, salt_len);
|
||||||
|
|
||||||
EVP_MD_CTX_init(&md2);
|
EVP_MD_CTX_init(&md2);
|
||||||
EVP_DigestInit_ex(&md2, EVP_md5(), NULL);
|
EVP_DigestInit_ex(&md2,EVP_md5(), NULL);
|
||||||
EVP_DigestUpdate(&md2, passwd, passwd_len);
|
EVP_DigestUpdate(&md2, passwd, passwd_len);
|
||||||
EVP_DigestUpdate(&md2, salt_out, salt_len);
|
EVP_DigestUpdate(&md2, salt_out, salt_len);
|
||||||
EVP_DigestUpdate(&md2, passwd, passwd_len);
|
EVP_DigestUpdate(&md2, passwd, passwd_len);
|
||||||
EVP_DigestFinal_ex(&md2, buf, NULL);
|
EVP_DigestFinal_ex(&md2, buf, NULL);
|
||||||
|
|
||||||
for (i = passwd_len; i > sizeof buf; i -= sizeof buf)
|
for (i = passwd_len; i > sizeof buf; i -= sizeof buf)
|
||||||
EVP_DigestUpdate(&md, buf, sizeof buf);
|
EVP_DigestUpdate(&md, buf, sizeof buf);
|
||||||
EVP_DigestUpdate(&md, buf, i);
|
EVP_DigestUpdate(&md, buf, i);
|
||||||
|
|
||||||
n = passwd_len;
|
n = passwd_len;
|
||||||
while (n) {
|
while (n)
|
||||||
EVP_DigestUpdate(&md, (n & 1) ? "\0" : passwd, 1);
|
{
|
||||||
n >>= 1;
|
EVP_DigestUpdate(&md, (n & 1) ? "\0" : passwd, 1);
|
||||||
}
|
n >>= 1;
|
||||||
EVP_DigestFinal_ex(&md, buf, NULL);
|
}
|
||||||
|
EVP_DigestFinal_ex(&md, buf, NULL);
|
||||||
|
|
||||||
for (i = 0; i < 1000; i++) {
|
for (i = 0; i < 1000; i++)
|
||||||
EVP_DigestInit_ex(&md2, EVP_md5(), NULL);
|
{
|
||||||
EVP_DigestUpdate(&md2, (i & 1) ? (unsigned const char *)passwd : buf,
|
EVP_DigestInit_ex(&md2,EVP_md5(), NULL);
|
||||||
(i & 1) ? passwd_len : sizeof buf);
|
EVP_DigestUpdate(&md2, (i & 1) ? (unsigned const char *) passwd : buf,
|
||||||
if (i % 3)
|
(i & 1) ? passwd_len : sizeof buf);
|
||||||
EVP_DigestUpdate(&md2, salt_out, salt_len);
|
if (i % 3)
|
||||||
if (i % 7)
|
EVP_DigestUpdate(&md2, salt_out, salt_len);
|
||||||
EVP_DigestUpdate(&md2, passwd, passwd_len);
|
if (i % 7)
|
||||||
EVP_DigestUpdate(&md2, (i & 1) ? buf : (unsigned const char *)passwd,
|
EVP_DigestUpdate(&md2, passwd, passwd_len);
|
||||||
(i & 1) ? sizeof buf : passwd_len);
|
EVP_DigestUpdate(&md2, (i & 1) ? buf : (unsigned const char *) passwd,
|
||||||
EVP_DigestFinal_ex(&md2, buf, NULL);
|
(i & 1) ? sizeof buf : passwd_len);
|
||||||
}
|
EVP_DigestFinal_ex(&md2, buf, NULL);
|
||||||
EVP_MD_CTX_cleanup(&md2);
|
}
|
||||||
|
EVP_MD_CTX_cleanup(&md2);
|
||||||
|
|
||||||
{
|
{
|
||||||
/* transform buf into output string */
|
/* transform buf into output string */
|
||||||
|
|
||||||
unsigned char buf_perm[sizeof buf];
|
unsigned char buf_perm[sizeof buf];
|
||||||
int dest, source;
|
int dest, source;
|
||||||
char *output;
|
char *output;
|
||||||
|
|
||||||
/* silly output permutation */
|
/* silly output permutation */
|
||||||
for (dest = 0, source = 0; dest < 14;
|
for (dest = 0, source = 0; dest < 14; dest++, source = (source + 6) % 17)
|
||||||
dest++, source = (source + 6) % 17)
|
buf_perm[dest] = buf[source];
|
||||||
buf_perm[dest] = buf[source];
|
buf_perm[14] = buf[5];
|
||||||
buf_perm[14] = buf[5];
|
buf_perm[15] = buf[11];
|
||||||
buf_perm[15] = buf[11];
|
#ifndef PEDANTIC /* Unfortunately, this generates a "no effect" warning */
|
||||||
# ifndef PEDANTIC /* Unfortunately, this generates a "no
|
assert(16 == sizeof buf_perm);
|
||||||
* effect" warning */
|
#endif
|
||||||
assert(16 == sizeof buf_perm);
|
|
||||||
# endif
|
|
||||||
|
|
||||||
output = salt_out + salt_len;
|
output = salt_out + salt_len;
|
||||||
assert(output == out_buf + strlen(out_buf));
|
assert(output == out_buf + strlen(out_buf));
|
||||||
|
|
||||||
*output++ = '$';
|
*output++ = '$';
|
||||||
|
|
||||||
for (i = 0; i < 15; i += 3) {
|
for (i = 0; i < 15; i += 3)
|
||||||
*output++ = cov_2char[buf_perm[i + 2] & 0x3f];
|
{
|
||||||
*output++ = cov_2char[((buf_perm[i + 1] & 0xf) << 2) |
|
*output++ = cov_2char[buf_perm[i+2] & 0x3f];
|
||||||
(buf_perm[i + 2] >> 6)];
|
*output++ = cov_2char[((buf_perm[i+1] & 0xf) << 2) |
|
||||||
*output++ = cov_2char[((buf_perm[i] & 3) << 4) |
|
(buf_perm[i+2] >> 6)];
|
||||||
(buf_perm[i + 1] >> 4)];
|
*output++ = cov_2char[((buf_perm[i] & 3) << 4) |
|
||||||
*output++ = cov_2char[buf_perm[i] >> 2];
|
(buf_perm[i+1] >> 4)];
|
||||||
}
|
*output++ = cov_2char[buf_perm[i] >> 2];
|
||||||
assert(i == 15);
|
}
|
||||||
*output++ = cov_2char[buf_perm[i] & 0x3f];
|
assert(i == 15);
|
||||||
*output++ = cov_2char[buf_perm[i] >> 6];
|
*output++ = cov_2char[buf_perm[i] & 0x3f];
|
||||||
*output = 0;
|
*output++ = cov_2char[buf_perm[i] >> 6];
|
||||||
assert(strlen(out_buf) < sizeof(out_buf));
|
*output = 0;
|
||||||
}
|
assert(strlen(out_buf) < sizeof(out_buf));
|
||||||
EVP_MD_CTX_cleanup(&md);
|
}
|
||||||
|
EVP_MD_CTX_cleanup(&md);
|
||||||
|
|
||||||
|
return out_buf;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
return out_buf;
|
|
||||||
}
|
|
||||||
# endif
|
|
||||||
|
|
||||||
static int do_passwd(int passed_salt, char **salt_p, char **salt_malloc_p,
|
static int do_passwd(int passed_salt, char **salt_p, char **salt_malloc_p,
|
||||||
char *passwd, BIO *out, int quiet, int table,
|
char *passwd, BIO *out, int quiet, int table, int reverse,
|
||||||
int reverse, size_t pw_maxlen, int usecrypt, int use1,
|
size_t pw_maxlen, int usecrypt, int use1, int useapr1)
|
||||||
int useapr1)
|
{
|
||||||
{
|
char *hash = NULL;
|
||||||
char *hash = NULL;
|
|
||||||
|
|
||||||
assert(salt_p != NULL);
|
assert(salt_p != NULL);
|
||||||
assert(salt_malloc_p != NULL);
|
assert(salt_malloc_p != NULL);
|
||||||
|
|
||||||
/* first make sure we have a salt */
|
/* first make sure we have a salt */
|
||||||
if (!passed_salt) {
|
if (!passed_salt)
|
||||||
# ifndef OPENSSL_NO_DES
|
{
|
||||||
if (usecrypt) {
|
#ifndef OPENSSL_NO_DES
|
||||||
if (*salt_malloc_p == NULL) {
|
if (usecrypt)
|
||||||
*salt_p = *salt_malloc_p = OPENSSL_malloc(3);
|
{
|
||||||
if (*salt_malloc_p == NULL)
|
if (*salt_malloc_p == NULL)
|
||||||
goto err;
|
{
|
||||||
}
|
*salt_p = *salt_malloc_p = OPENSSL_malloc(3);
|
||||||
if (RAND_pseudo_bytes((unsigned char *)*salt_p, 2) < 0)
|
if (*salt_malloc_p == NULL)
|
||||||
goto err;
|
goto err;
|
||||||
(*salt_p)[0] = cov_2char[(*salt_p)[0] & 0x3f]; /* 6 bits */
|
}
|
||||||
(*salt_p)[1] = cov_2char[(*salt_p)[1] & 0x3f]; /* 6 bits */
|
if (RAND_pseudo_bytes((unsigned char *)*salt_p, 2) < 0)
|
||||||
(*salt_p)[2] = 0;
|
goto err;
|
||||||
# ifdef CHARSET_EBCDIC
|
(*salt_p)[0] = cov_2char[(*salt_p)[0] & 0x3f]; /* 6 bits */
|
||||||
ascii2ebcdic(*salt_p, *salt_p, 2); /* des_crypt will convert back
|
(*salt_p)[1] = cov_2char[(*salt_p)[1] & 0x3f]; /* 6 bits */
|
||||||
* to ASCII */
|
(*salt_p)[2] = 0;
|
||||||
# endif
|
#ifdef CHARSET_EBCDIC
|
||||||
}
|
ascii2ebcdic(*salt_p, *salt_p, 2); /* des_crypt will convert
|
||||||
# endif /* !OPENSSL_NO_DES */
|
* back to ASCII */
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
#endif /* !OPENSSL_NO_DES */
|
||||||
|
|
||||||
# ifndef NO_MD5CRYPT_1
|
#ifndef NO_MD5CRYPT_1
|
||||||
if (use1 || useapr1) {
|
if (use1 || useapr1)
|
||||||
int i;
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
if (*salt_malloc_p == NULL) {
|
if (*salt_malloc_p == NULL)
|
||||||
*salt_p = *salt_malloc_p = OPENSSL_malloc(9);
|
{
|
||||||
if (*salt_malloc_p == NULL)
|
*salt_p = *salt_malloc_p = OPENSSL_malloc(9);
|
||||||
goto err;
|
if (*salt_malloc_p == NULL)
|
||||||
}
|
goto err;
|
||||||
if (RAND_pseudo_bytes((unsigned char *)*salt_p, 8) < 0)
|
}
|
||||||
goto err;
|
if (RAND_pseudo_bytes((unsigned char *)*salt_p, 8) < 0)
|
||||||
|
goto err;
|
||||||
|
|
||||||
for (i = 0; i < 8; i++)
|
for (i = 0; i < 8; i++)
|
||||||
(*salt_p)[i] = cov_2char[(*salt_p)[i] & 0x3f]; /* 6 bits */
|
(*salt_p)[i] = cov_2char[(*salt_p)[i] & 0x3f]; /* 6 bits */
|
||||||
(*salt_p)[8] = 0;
|
(*salt_p)[8] = 0;
|
||||||
}
|
}
|
||||||
# endif /* !NO_MD5CRYPT_1 */
|
#endif /* !NO_MD5CRYPT_1 */
|
||||||
}
|
}
|
||||||
|
|
||||||
assert(*salt_p != NULL);
|
assert(*salt_p != NULL);
|
||||||
|
|
||||||
/* truncate password if necessary */
|
/* truncate password if necessary */
|
||||||
if ((strlen(passwd) > pw_maxlen)) {
|
if ((strlen(passwd) > pw_maxlen))
|
||||||
if (!quiet)
|
{
|
||||||
/*
|
if (!quiet)
|
||||||
* XXX: really we should know how to print a size_t, not cast it
|
/* XXX: really we should know how to print a size_t, not cast it */
|
||||||
*/
|
BIO_printf(bio_err, "Warning: truncating password to %u characters\n", (unsigned)pw_maxlen);
|
||||||
BIO_printf(bio_err,
|
passwd[pw_maxlen] = 0;
|
||||||
"Warning: truncating password to %u characters\n",
|
}
|
||||||
(unsigned)pw_maxlen);
|
assert(strlen(passwd) <= pw_maxlen);
|
||||||
passwd[pw_maxlen] = 0;
|
|
||||||
}
|
|
||||||
assert(strlen(passwd) <= pw_maxlen);
|
|
||||||
|
|
||||||
/* now compute password hash */
|
/* now compute password hash */
|
||||||
# ifndef OPENSSL_NO_DES
|
#ifndef OPENSSL_NO_DES
|
||||||
if (usecrypt)
|
if (usecrypt)
|
||||||
hash = DES_crypt(passwd, *salt_p);
|
hash = DES_crypt(passwd, *salt_p);
|
||||||
# endif
|
#endif
|
||||||
# ifndef NO_MD5CRYPT_1
|
#ifndef NO_MD5CRYPT_1
|
||||||
if (use1 || useapr1)
|
if (use1 || useapr1)
|
||||||
hash = md5crypt(passwd, (use1 ? "1" : "apr1"), *salt_p);
|
hash = md5crypt(passwd, (use1 ? "1" : "apr1"), *salt_p);
|
||||||
# endif
|
#endif
|
||||||
assert(hash != NULL);
|
assert(hash != NULL);
|
||||||
|
|
||||||
if (table && !reverse)
|
if (table && !reverse)
|
||||||
BIO_printf(out, "%s\t%s\n", passwd, hash);
|
BIO_printf(out, "%s\t%s\n", passwd, hash);
|
||||||
else if (table && reverse)
|
else if (table && reverse)
|
||||||
BIO_printf(out, "%s\t%s\n", hash, passwd);
|
BIO_printf(out, "%s\t%s\n", hash, passwd);
|
||||||
else
|
else
|
||||||
BIO_printf(out, "%s\n", hash);
|
BIO_printf(out, "%s\n", hash);
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
err:
|
err:
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
|
||||||
int MAIN(int argc, char **argv)
|
int MAIN(int argc, char **argv)
|
||||||
{
|
{
|
||||||
fputs("Program not available.\n", stderr)
|
fputs("Program not available.\n", stderr)
|
||||||
OPENSSL_EXIT(1);
|
OPENSSL_EXIT(1);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
1555
apps/pkcs12.c
1555
apps/pkcs12.c
File diff suppressed because it is too large
Load Diff
406
apps/pkcs7.c
406
apps/pkcs7.c
@@ -69,244 +69,252 @@
|
|||||||
#include <openssl/pem.h>
|
#include <openssl/pem.h>
|
||||||
|
|
||||||
#undef PROG
|
#undef PROG
|
||||||
#define PROG pkcs7_main
|
#define PROG pkcs7_main
|
||||||
|
|
||||||
/*-
|
/* -inform arg - input format - default PEM (DER or PEM)
|
||||||
* -inform arg - input format - default PEM (DER or PEM)
|
|
||||||
* -outform arg - output format - default PEM
|
* -outform arg - output format - default PEM
|
||||||
* -in arg - input file - default stdin
|
* -in arg - input file - default stdin
|
||||||
* -out arg - output file - default stdout
|
* -out arg - output file - default stdout
|
||||||
* -print_certs
|
* -print_certs
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int MAIN(int, char **);
|
int MAIN(int, char **);
|
||||||
|
|
||||||
int MAIN(int argc, char **argv)
|
int MAIN(int argc, char **argv)
|
||||||
{
|
{
|
||||||
PKCS7 *p7 = NULL;
|
PKCS7 *p7=NULL;
|
||||||
int i, badops = 0;
|
int i,badops=0;
|
||||||
BIO *in = NULL, *out = NULL;
|
BIO *in=NULL,*out=NULL;
|
||||||
int informat, outformat;
|
int informat,outformat;
|
||||||
char *infile, *outfile, *prog;
|
char *infile,*outfile,*prog;
|
||||||
int print_certs = 0, text = 0, noout = 0, p7_print = 0;
|
int print_certs=0,text=0,noout=0,p7_print=0;
|
||||||
int ret = 1;
|
int ret=1;
|
||||||
#ifndef OPENSSL_NO_ENGINE
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
char *engine = NULL;
|
char *engine=NULL;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
apps_startup();
|
apps_startup();
|
||||||
|
|
||||||
if (bio_err == NULL)
|
if (bio_err == NULL)
|
||||||
if ((bio_err = BIO_new(BIO_s_file())) != NULL)
|
if ((bio_err=BIO_new(BIO_s_file())) != NULL)
|
||||||
BIO_set_fp(bio_err, stderr, BIO_NOCLOSE | BIO_FP_TEXT);
|
BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT);
|
||||||
|
|
||||||
if (!load_config(bio_err, NULL))
|
if (!load_config(bio_err, NULL))
|
||||||
goto end;
|
goto end;
|
||||||
|
|
||||||
infile = NULL;
|
infile=NULL;
|
||||||
outfile = NULL;
|
outfile=NULL;
|
||||||
informat = FORMAT_PEM;
|
informat=FORMAT_PEM;
|
||||||
outformat = FORMAT_PEM;
|
outformat=FORMAT_PEM;
|
||||||
|
|
||||||
prog = argv[0];
|
prog=argv[0];
|
||||||
argc--;
|
argc--;
|
||||||
argv++;
|
argv++;
|
||||||
while (argc >= 1) {
|
while (argc >= 1)
|
||||||
if (strcmp(*argv, "-inform") == 0) {
|
{
|
||||||
if (--argc < 1)
|
if (strcmp(*argv,"-inform") == 0)
|
||||||
goto bad;
|
{
|
||||||
informat = str2fmt(*(++argv));
|
if (--argc < 1) goto bad;
|
||||||
} else if (strcmp(*argv, "-outform") == 0) {
|
informat=str2fmt(*(++argv));
|
||||||
if (--argc < 1)
|
}
|
||||||
goto bad;
|
else if (strcmp(*argv,"-outform") == 0)
|
||||||
outformat = str2fmt(*(++argv));
|
{
|
||||||
} else if (strcmp(*argv, "-in") == 0) {
|
if (--argc < 1) goto bad;
|
||||||
if (--argc < 1)
|
outformat=str2fmt(*(++argv));
|
||||||
goto bad;
|
}
|
||||||
infile = *(++argv);
|
else if (strcmp(*argv,"-in") == 0)
|
||||||
} else if (strcmp(*argv, "-out") == 0) {
|
{
|
||||||
if (--argc < 1)
|
if (--argc < 1) goto bad;
|
||||||
goto bad;
|
infile= *(++argv);
|
||||||
outfile = *(++argv);
|
}
|
||||||
} else if (strcmp(*argv, "-noout") == 0)
|
else if (strcmp(*argv,"-out") == 0)
|
||||||
noout = 1;
|
{
|
||||||
else if (strcmp(*argv, "-text") == 0)
|
if (--argc < 1) goto bad;
|
||||||
text = 1;
|
outfile= *(++argv);
|
||||||
else if (strcmp(*argv, "-print") == 0)
|
}
|
||||||
p7_print = 1;
|
else if (strcmp(*argv,"-noout") == 0)
|
||||||
else if (strcmp(*argv, "-print_certs") == 0)
|
noout=1;
|
||||||
print_certs = 1;
|
else if (strcmp(*argv,"-text") == 0)
|
||||||
|
text=1;
|
||||||
|
else if (strcmp(*argv,"-print") == 0)
|
||||||
|
p7_print=1;
|
||||||
|
else if (strcmp(*argv,"-print_certs") == 0)
|
||||||
|
print_certs=1;
|
||||||
#ifndef OPENSSL_NO_ENGINE
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
else if (strcmp(*argv, "-engine") == 0) {
|
else if (strcmp(*argv,"-engine") == 0)
|
||||||
if (--argc < 1)
|
{
|
||||||
goto bad;
|
if (--argc < 1) goto bad;
|
||||||
engine = *(++argv);
|
engine= *(++argv);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
else {
|
else
|
||||||
BIO_printf(bio_err, "unknown option %s\n", *argv);
|
{
|
||||||
badops = 1;
|
BIO_printf(bio_err,"unknown option %s\n",*argv);
|
||||||
break;
|
badops=1;
|
||||||
}
|
break;
|
||||||
argc--;
|
}
|
||||||
argv++;
|
argc--;
|
||||||
}
|
argv++;
|
||||||
|
}
|
||||||
|
|
||||||
if (badops) {
|
if (badops)
|
||||||
bad:
|
{
|
||||||
BIO_printf(bio_err, "%s [options] <infile >outfile\n", prog);
|
bad:
|
||||||
BIO_printf(bio_err, "where options are\n");
|
BIO_printf(bio_err,"%s [options] <infile >outfile\n",prog);
|
||||||
BIO_printf(bio_err, " -inform arg input format - DER or PEM\n");
|
BIO_printf(bio_err,"where options are\n");
|
||||||
BIO_printf(bio_err, " -outform arg output format - DER or PEM\n");
|
BIO_printf(bio_err," -inform arg input format - DER or PEM\n");
|
||||||
BIO_printf(bio_err, " -in arg input file\n");
|
BIO_printf(bio_err," -outform arg output format - DER or PEM\n");
|
||||||
BIO_printf(bio_err, " -out arg output file\n");
|
BIO_printf(bio_err," -in arg input file\n");
|
||||||
BIO_printf(bio_err,
|
BIO_printf(bio_err," -out arg output file\n");
|
||||||
" -print_certs print any certs or crl in the input\n");
|
BIO_printf(bio_err," -print_certs print any certs or crl in the input\n");
|
||||||
BIO_printf(bio_err,
|
BIO_printf(bio_err," -text print full details of certificates\n");
|
||||||
" -text print full details of certificates\n");
|
BIO_printf(bio_err," -noout don't output encoded data\n");
|
||||||
BIO_printf(bio_err, " -noout don't output encoded data\n");
|
|
||||||
#ifndef OPENSSL_NO_ENGINE
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
BIO_printf(bio_err,
|
BIO_printf(bio_err," -engine e use engine e, possibly a hardware device.\n");
|
||||||
" -engine e use engine e, possibly a hardware device.\n");
|
|
||||||
#endif
|
#endif
|
||||||
ret = 1;
|
ret = 1;
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
ERR_load_crypto_strings();
|
ERR_load_crypto_strings();
|
||||||
|
|
||||||
#ifndef OPENSSL_NO_ENGINE
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
setup_engine(bio_err, engine, 0);
|
setup_engine(bio_err, engine, 0);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
in = BIO_new(BIO_s_file());
|
in=BIO_new(BIO_s_file());
|
||||||
out = BIO_new(BIO_s_file());
|
out=BIO_new(BIO_s_file());
|
||||||
if ((in == NULL) || (out == NULL)) {
|
if ((in == NULL) || (out == NULL))
|
||||||
ERR_print_errors(bio_err);
|
{
|
||||||
goto end;
|
ERR_print_errors(bio_err);
|
||||||
}
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
if (infile == NULL)
|
if (infile == NULL)
|
||||||
BIO_set_fp(in, stdin, BIO_NOCLOSE);
|
BIO_set_fp(in,stdin,BIO_NOCLOSE);
|
||||||
else {
|
else
|
||||||
if (BIO_read_filename(in, infile) <= 0) {
|
{
|
||||||
BIO_printf(bio_err, "unable to load input file\n");
|
if (BIO_read_filename(in,infile) <= 0)
|
||||||
ERR_print_errors(bio_err);
|
if (in == NULL)
|
||||||
goto end;
|
{
|
||||||
}
|
perror(infile);
|
||||||
}
|
goto end;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (informat == FORMAT_ASN1)
|
if (informat == FORMAT_ASN1)
|
||||||
p7 = d2i_PKCS7_bio(in, NULL);
|
p7=d2i_PKCS7_bio(in,NULL);
|
||||||
else if (informat == FORMAT_PEM)
|
else if (informat == FORMAT_PEM)
|
||||||
p7 = PEM_read_bio_PKCS7(in, NULL, NULL, NULL);
|
p7=PEM_read_bio_PKCS7(in,NULL,NULL,NULL);
|
||||||
else {
|
else
|
||||||
BIO_printf(bio_err, "bad input format specified for pkcs7 object\n");
|
{
|
||||||
goto end;
|
BIO_printf(bio_err,"bad input format specified for pkcs7 object\n");
|
||||||
}
|
goto end;
|
||||||
if (p7 == NULL) {
|
}
|
||||||
BIO_printf(bio_err, "unable to load PKCS7 object\n");
|
if (p7 == NULL)
|
||||||
ERR_print_errors(bio_err);
|
{
|
||||||
goto end;
|
BIO_printf(bio_err,"unable to load PKCS7 object\n");
|
||||||
}
|
ERR_print_errors(bio_err);
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
if (outfile == NULL) {
|
if (outfile == NULL)
|
||||||
BIO_set_fp(out, stdout, BIO_NOCLOSE);
|
{
|
||||||
|
BIO_set_fp(out,stdout,BIO_NOCLOSE);
|
||||||
#ifdef OPENSSL_SYS_VMS
|
#ifdef OPENSSL_SYS_VMS
|
||||||
{
|
{
|
||||||
BIO *tmpbio = BIO_new(BIO_f_linebuffer());
|
BIO *tmpbio = BIO_new(BIO_f_linebuffer());
|
||||||
out = BIO_push(tmpbio, out);
|
out = BIO_push(tmpbio, out);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
} else {
|
}
|
||||||
if (BIO_write_filename(out, outfile) <= 0) {
|
else
|
||||||
perror(outfile);
|
{
|
||||||
goto end;
|
if (BIO_write_filename(out,outfile) <= 0)
|
||||||
}
|
{
|
||||||
}
|
perror(outfile);
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (p7_print)
|
if (p7_print)
|
||||||
PKCS7_print_ctx(out, p7, 0, NULL);
|
PKCS7_print_ctx(out, p7, 0, NULL);
|
||||||
|
|
||||||
if (print_certs) {
|
if (print_certs)
|
||||||
STACK_OF(X509) *certs = NULL;
|
{
|
||||||
STACK_OF(X509_CRL) *crls = NULL;
|
STACK_OF(X509) *certs=NULL;
|
||||||
|
STACK_OF(X509_CRL) *crls=NULL;
|
||||||
|
|
||||||
i = OBJ_obj2nid(p7->type);
|
i=OBJ_obj2nid(p7->type);
|
||||||
switch (i) {
|
switch (i)
|
||||||
case NID_pkcs7_signed:
|
{
|
||||||
if (p7->d.sign != NULL) {
|
case NID_pkcs7_signed:
|
||||||
certs = p7->d.sign->cert;
|
certs=p7->d.sign->cert;
|
||||||
crls = p7->d.sign->crl;
|
crls=p7->d.sign->crl;
|
||||||
}
|
break;
|
||||||
break;
|
case NID_pkcs7_signedAndEnveloped:
|
||||||
case NID_pkcs7_signedAndEnveloped:
|
certs=p7->d.signed_and_enveloped->cert;
|
||||||
if (p7->d.signed_and_enveloped != NULL) {
|
crls=p7->d.signed_and_enveloped->crl;
|
||||||
certs = p7->d.signed_and_enveloped->cert;
|
break;
|
||||||
crls = p7->d.signed_and_enveloped->crl;
|
default:
|
||||||
}
|
break;
|
||||||
break;
|
}
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (certs != NULL) {
|
if (certs != NULL)
|
||||||
X509 *x;
|
{
|
||||||
|
X509 *x;
|
||||||
|
|
||||||
for (i = 0; i < sk_X509_num(certs); i++) {
|
for (i=0; i<sk_X509_num(certs); i++)
|
||||||
x = sk_X509_value(certs, i);
|
{
|
||||||
if (text)
|
x=sk_X509_value(certs,i);
|
||||||
X509_print(out, x);
|
if(text) X509_print(out, x);
|
||||||
else
|
else dump_cert_text(out, x);
|
||||||
dump_cert_text(out, x);
|
|
||||||
|
|
||||||
if (!noout)
|
if(!noout) PEM_write_bio_X509(out,x);
|
||||||
PEM_write_bio_X509(out, x);
|
BIO_puts(out,"\n");
|
||||||
BIO_puts(out, "\n");
|
}
|
||||||
}
|
}
|
||||||
}
|
if (crls != NULL)
|
||||||
if (crls != NULL) {
|
{
|
||||||
X509_CRL *crl;
|
X509_CRL *crl;
|
||||||
|
|
||||||
for (i = 0; i < sk_X509_CRL_num(crls); i++) {
|
for (i=0; i<sk_X509_CRL_num(crls); i++)
|
||||||
crl = sk_X509_CRL_value(crls, i);
|
{
|
||||||
|
crl=sk_X509_CRL_value(crls,i);
|
||||||
|
|
||||||
X509_CRL_print(out, crl);
|
X509_CRL_print(out, crl);
|
||||||
|
|
||||||
if (!noout)
|
if(!noout)PEM_write_bio_X509_CRL(out,crl);
|
||||||
PEM_write_bio_X509_CRL(out, crl);
|
BIO_puts(out,"\n");
|
||||||
BIO_puts(out, "\n");
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
ret = 0;
|
ret=0;
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!noout) {
|
if(!noout) {
|
||||||
if (outformat == FORMAT_ASN1)
|
if (outformat == FORMAT_ASN1)
|
||||||
i = i2d_PKCS7_bio(out, p7);
|
i=i2d_PKCS7_bio(out,p7);
|
||||||
else if (outformat == FORMAT_PEM)
|
else if (outformat == FORMAT_PEM)
|
||||||
i = PEM_write_bio_PKCS7(out, p7);
|
i=PEM_write_bio_PKCS7(out,p7);
|
||||||
else {
|
else {
|
||||||
BIO_printf(bio_err, "bad output format specified for outfile\n");
|
BIO_printf(bio_err,"bad output format specified for outfile\n");
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!i) {
|
if (!i)
|
||||||
BIO_printf(bio_err, "unable to write pkcs7 object\n");
|
{
|
||||||
ERR_print_errors(bio_err);
|
BIO_printf(bio_err,"unable to write pkcs7 object\n");
|
||||||
goto end;
|
ERR_print_errors(bio_err);
|
||||||
}
|
goto end;
|
||||||
}
|
}
|
||||||
ret = 0;
|
}
|
||||||
end:
|
ret=0;
|
||||||
if (p7 != NULL)
|
end:
|
||||||
PKCS7_free(p7);
|
if (p7 != NULL) PKCS7_free(p7);
|
||||||
if (in != NULL)
|
if (in != NULL) BIO_free(in);
|
||||||
BIO_free(in);
|
if (out != NULL) BIO_free_all(out);
|
||||||
if (out != NULL)
|
apps_shutdown();
|
||||||
BIO_free_all(out);
|
OPENSSL_EXIT(ret);
|
||||||
apps_shutdown();
|
}
|
||||||
OPENSSL_EXIT(ret);
|
|
||||||
}
|
|
||||||
|
|||||||
631
apps/pkcs8.c
631
apps/pkcs8.c
@@ -1,7 +1,6 @@
|
|||||||
/* pkcs8.c */
|
/* pkcs8.c */
|
||||||
/*
|
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
|
||||||
* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL project
|
* project 1999-2004.
|
||||||
* 1999-2004.
|
|
||||||
*/
|
*/
|
||||||
/* ====================================================================
|
/* ====================================================================
|
||||||
* Copyright (c) 1999 The OpenSSL Project. All rights reserved.
|
* Copyright (c) 1999 The OpenSSL Project. All rights reserved.
|
||||||
@@ -69,324 +68,372 @@
|
|||||||
int MAIN(int, char **);
|
int MAIN(int, char **);
|
||||||
|
|
||||||
int MAIN(int argc, char **argv)
|
int MAIN(int argc, char **argv)
|
||||||
{
|
{
|
||||||
ENGINE *e = NULL;
|
ENGINE *e = NULL;
|
||||||
char **args, *infile = NULL, *outfile = NULL;
|
char **args, *infile = NULL, *outfile = NULL;
|
||||||
char *passargin = NULL, *passargout = NULL;
|
char *passargin = NULL, *passargout = NULL;
|
||||||
BIO *in = NULL, *out = NULL;
|
BIO *in = NULL, *out = NULL;
|
||||||
int topk8 = 0;
|
int topk8 = 0;
|
||||||
int pbe_nid = -1;
|
int pbe_nid = -1;
|
||||||
const EVP_CIPHER *cipher = NULL;
|
const EVP_CIPHER *cipher = NULL;
|
||||||
int iter = PKCS12_DEFAULT_ITER;
|
int iter = PKCS12_DEFAULT_ITER;
|
||||||
int informat, outformat;
|
int informat, outformat;
|
||||||
int p8_broken = PKCS8_OK;
|
int p8_broken = PKCS8_OK;
|
||||||
int nocrypt = 0;
|
int nocrypt = 0;
|
||||||
X509_SIG *p8 = NULL;
|
X509_SIG *p8 = NULL;
|
||||||
PKCS8_PRIV_KEY_INFO *p8inf = NULL;
|
PKCS8_PRIV_KEY_INFO *p8inf = NULL;
|
||||||
EVP_PKEY *pkey = NULL;
|
EVP_PKEY *pkey=NULL;
|
||||||
char pass[50], *passin = NULL, *passout = NULL, *p8pass = NULL;
|
char pass[50], *passin = NULL, *passout = NULL, *p8pass = NULL;
|
||||||
int badarg = 0;
|
int badarg = 0;
|
||||||
int ret = 1;
|
int ret = 1;
|
||||||
#ifndef OPENSSL_NO_ENGINE
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
char *engine = NULL;
|
char *engine=NULL;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (bio_err == NULL)
|
if (bio_err == NULL) bio_err = BIO_new_fp (stderr, BIO_NOCLOSE);
|
||||||
bio_err = BIO_new_fp(stderr, BIO_NOCLOSE);
|
|
||||||
|
|
||||||
if (!load_config(bio_err, NULL))
|
if (!load_config(bio_err, NULL))
|
||||||
goto end;
|
goto end;
|
||||||
|
|
||||||
informat = FORMAT_PEM;
|
informat=FORMAT_PEM;
|
||||||
outformat = FORMAT_PEM;
|
outformat=FORMAT_PEM;
|
||||||
|
|
||||||
ERR_load_crypto_strings();
|
ERR_load_crypto_strings();
|
||||||
OpenSSL_add_all_algorithms();
|
OpenSSL_add_all_algorithms();
|
||||||
args = argv + 1;
|
args = argv + 1;
|
||||||
while (!badarg && *args && *args[0] == '-') {
|
while (!badarg && *args && *args[0] == '-')
|
||||||
if (!strcmp(*args, "-v2")) {
|
{
|
||||||
if (args[1]) {
|
if (!strcmp(*args,"-v2"))
|
||||||
args++;
|
{
|
||||||
cipher = EVP_get_cipherbyname(*args);
|
if (args[1])
|
||||||
if (!cipher) {
|
{
|
||||||
BIO_printf(bio_err, "Unknown cipher %s\n", *args);
|
args++;
|
||||||
badarg = 1;
|
cipher=EVP_get_cipherbyname(*args);
|
||||||
}
|
if (!cipher)
|
||||||
} else
|
{
|
||||||
badarg = 1;
|
BIO_printf(bio_err,
|
||||||
} else if (!strcmp(*args, "-v1")) {
|
"Unknown cipher %s\n", *args);
|
||||||
if (args[1]) {
|
badarg = 1;
|
||||||
args++;
|
}
|
||||||
pbe_nid = OBJ_txt2nid(*args);
|
}
|
||||||
if (pbe_nid == NID_undef) {
|
else
|
||||||
BIO_printf(bio_err, "Unknown PBE algorithm %s\n", *args);
|
badarg = 1;
|
||||||
badarg = 1;
|
}
|
||||||
}
|
else if (!strcmp(*args,"-v1"))
|
||||||
} else
|
{
|
||||||
badarg = 1;
|
if (args[1])
|
||||||
} else if (!strcmp(*args, "-inform")) {
|
{
|
||||||
if (args[1]) {
|
args++;
|
||||||
args++;
|
pbe_nid=OBJ_txt2nid(*args);
|
||||||
informat = str2fmt(*args);
|
if (pbe_nid == NID_undef)
|
||||||
} else
|
{
|
||||||
badarg = 1;
|
BIO_printf(bio_err,
|
||||||
} else if (!strcmp(*args, "-outform")) {
|
"Unknown PBE algorithm %s\n", *args);
|
||||||
if (args[1]) {
|
badarg = 1;
|
||||||
args++;
|
}
|
||||||
outformat = str2fmt(*args);
|
}
|
||||||
} else
|
else
|
||||||
badarg = 1;
|
badarg = 1;
|
||||||
} else if (!strcmp(*args, "-topk8"))
|
}
|
||||||
topk8 = 1;
|
else if (!strcmp(*args,"-inform"))
|
||||||
else if (!strcmp(*args, "-noiter"))
|
{
|
||||||
iter = 1;
|
if (args[1])
|
||||||
else if (!strcmp(*args, "-nocrypt"))
|
{
|
||||||
nocrypt = 1;
|
args++;
|
||||||
else if (!strcmp(*args, "-nooct"))
|
informat=str2fmt(*args);
|
||||||
p8_broken = PKCS8_NO_OCTET;
|
}
|
||||||
else if (!strcmp(*args, "-nsdb"))
|
else badarg = 1;
|
||||||
p8_broken = PKCS8_NS_DB;
|
}
|
||||||
else if (!strcmp(*args, "-embed"))
|
else if (!strcmp(*args,"-outform"))
|
||||||
p8_broken = PKCS8_EMBEDDED_PARAM;
|
{
|
||||||
else if (!strcmp(*args, "-passin")) {
|
if (args[1])
|
||||||
if (!args[1])
|
{
|
||||||
goto bad;
|
args++;
|
||||||
passargin = *(++args);
|
outformat=str2fmt(*args);
|
||||||
} else if (!strcmp(*args, "-passout")) {
|
}
|
||||||
if (!args[1])
|
else badarg = 1;
|
||||||
goto bad;
|
}
|
||||||
passargout = *(++args);
|
else if (!strcmp (*args, "-topk8"))
|
||||||
}
|
topk8 = 1;
|
||||||
|
else if (!strcmp (*args, "-noiter"))
|
||||||
|
iter = 1;
|
||||||
|
else if (!strcmp (*args, "-nocrypt"))
|
||||||
|
nocrypt = 1;
|
||||||
|
else if (!strcmp (*args, "-nooct"))
|
||||||
|
p8_broken = PKCS8_NO_OCTET;
|
||||||
|
else if (!strcmp (*args, "-nsdb"))
|
||||||
|
p8_broken = PKCS8_NS_DB;
|
||||||
|
else if (!strcmp (*args, "-embed"))
|
||||||
|
p8_broken = PKCS8_EMBEDDED_PARAM;
|
||||||
|
else if (!strcmp(*args,"-passin"))
|
||||||
|
{
|
||||||
|
if (!args[1]) goto bad;
|
||||||
|
passargin= *(++args);
|
||||||
|
}
|
||||||
|
else if (!strcmp(*args,"-passout"))
|
||||||
|
{
|
||||||
|
if (!args[1]) goto bad;
|
||||||
|
passargout= *(++args);
|
||||||
|
}
|
||||||
#ifndef OPENSSL_NO_ENGINE
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
else if (strcmp(*args, "-engine") == 0) {
|
else if (strcmp(*args,"-engine") == 0)
|
||||||
if (!args[1])
|
{
|
||||||
goto bad;
|
if (!args[1]) goto bad;
|
||||||
engine = *(++args);
|
engine= *(++args);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
else if (!strcmp(*args, "-in")) {
|
else if (!strcmp (*args, "-in"))
|
||||||
if (args[1]) {
|
{
|
||||||
args++;
|
if (args[1])
|
||||||
infile = *args;
|
{
|
||||||
} else
|
args++;
|
||||||
badarg = 1;
|
infile = *args;
|
||||||
} else if (!strcmp(*args, "-out")) {
|
}
|
||||||
if (args[1]) {
|
else badarg = 1;
|
||||||
args++;
|
}
|
||||||
outfile = *args;
|
else if (!strcmp (*args, "-out"))
|
||||||
} else
|
{
|
||||||
badarg = 1;
|
if (args[1])
|
||||||
} else
|
{
|
||||||
badarg = 1;
|
args++;
|
||||||
args++;
|
outfile = *args;
|
||||||
}
|
}
|
||||||
|
else badarg = 1;
|
||||||
|
}
|
||||||
|
else badarg = 1;
|
||||||
|
args++;
|
||||||
|
}
|
||||||
|
|
||||||
if (badarg) {
|
if (badarg)
|
||||||
bad:
|
{
|
||||||
BIO_printf(bio_err, "Usage pkcs8 [options]\n");
|
bad:
|
||||||
BIO_printf(bio_err, "where options are\n");
|
BIO_printf(bio_err, "Usage pkcs8 [options]\n");
|
||||||
BIO_printf(bio_err, "-in file input file\n");
|
BIO_printf(bio_err, "where options are\n");
|
||||||
BIO_printf(bio_err, "-inform X input format (DER or PEM)\n");
|
BIO_printf(bio_err, "-in file input file\n");
|
||||||
BIO_printf(bio_err,
|
BIO_printf(bio_err, "-inform X input format (DER or PEM)\n");
|
||||||
"-passin arg input file pass phrase source\n");
|
BIO_printf(bio_err, "-passin arg input file pass phrase source\n");
|
||||||
BIO_printf(bio_err, "-outform X output format (DER or PEM)\n");
|
BIO_printf(bio_err, "-outform X output format (DER or PEM)\n");
|
||||||
BIO_printf(bio_err, "-out file output file\n");
|
BIO_printf(bio_err, "-out file output file\n");
|
||||||
BIO_printf(bio_err,
|
BIO_printf(bio_err, "-passout arg output file pass phrase source\n");
|
||||||
"-passout arg output file pass phrase source\n");
|
BIO_printf(bio_err, "-topk8 output PKCS8 file\n");
|
||||||
BIO_printf(bio_err, "-topk8 output PKCS8 file\n");
|
BIO_printf(bio_err, "-nooct use (nonstandard) no octet format\n");
|
||||||
BIO_printf(bio_err,
|
BIO_printf(bio_err, "-embed use (nonstandard) embedded DSA parameters format\n");
|
||||||
"-nooct use (nonstandard) no octet format\n");
|
BIO_printf(bio_err, "-nsdb use (nonstandard) DSA Netscape DB format\n");
|
||||||
BIO_printf(bio_err,
|
BIO_printf(bio_err, "-noiter use 1 as iteration count\n");
|
||||||
"-embed use (nonstandard) embedded DSA parameters format\n");
|
BIO_printf(bio_err, "-nocrypt use or expect unencrypted private key\n");
|
||||||
BIO_printf(bio_err,
|
BIO_printf(bio_err, "-v2 alg use PKCS#5 v2.0 and cipher \"alg\"\n");
|
||||||
"-nsdb use (nonstandard) DSA Netscape DB format\n");
|
BIO_printf(bio_err, "-v1 obj use PKCS#5 v1.5 and cipher \"alg\"\n");
|
||||||
BIO_printf(bio_err, "-noiter use 1 as iteration count\n");
|
|
||||||
BIO_printf(bio_err,
|
|
||||||
"-nocrypt use or expect unencrypted private key\n");
|
|
||||||
BIO_printf(bio_err,
|
|
||||||
"-v2 alg use PKCS#5 v2.0 and cipher \"alg\"\n");
|
|
||||||
BIO_printf(bio_err,
|
|
||||||
"-v1 obj use PKCS#5 v1.5 and cipher \"alg\"\n");
|
|
||||||
#ifndef OPENSSL_NO_ENGINE
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
BIO_printf(bio_err,
|
BIO_printf(bio_err," -engine e use engine e, possibly a hardware device.\n");
|
||||||
" -engine e use engine e, possibly a hardware device.\n");
|
|
||||||
#endif
|
#endif
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef OPENSSL_NO_ENGINE
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
e = setup_engine(bio_err, engine, 0);
|
e = setup_engine(bio_err, engine, 0);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (!app_passwd(bio_err, passargin, passargout, &passin, &passout)) {
|
if (!app_passwd(bio_err, passargin, passargout, &passin, &passout))
|
||||||
BIO_printf(bio_err, "Error getting passwords\n");
|
{
|
||||||
goto end;
|
BIO_printf(bio_err, "Error getting passwords\n");
|
||||||
}
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
if ((pbe_nid == -1) && !cipher)
|
if ((pbe_nid == -1) && !cipher)
|
||||||
pbe_nid = NID_pbeWithMD5AndDES_CBC;
|
pbe_nid = NID_pbeWithMD5AndDES_CBC;
|
||||||
|
|
||||||
if (infile) {
|
if (infile)
|
||||||
if (!(in = BIO_new_file(infile, "rb"))) {
|
{
|
||||||
BIO_printf(bio_err, "Can't open input file %s\n", infile);
|
if (!(in = BIO_new_file(infile, "rb")))
|
||||||
goto end;
|
{
|
||||||
}
|
BIO_printf(bio_err,
|
||||||
} else
|
"Can't open input file %s\n", infile);
|
||||||
in = BIO_new_fp(stdin, BIO_NOCLOSE);
|
goto end;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
in = BIO_new_fp (stdin, BIO_NOCLOSE);
|
||||||
|
|
||||||
if (outfile) {
|
if (outfile)
|
||||||
if (!(out = BIO_new_file(outfile, "wb"))) {
|
{
|
||||||
BIO_printf(bio_err, "Can't open output file %s\n", outfile);
|
if (!(out = BIO_new_file (outfile, "wb")))
|
||||||
goto end;
|
{
|
||||||
}
|
BIO_printf(bio_err,
|
||||||
} else {
|
"Can't open output file %s\n", outfile);
|
||||||
out = BIO_new_fp(stdout, BIO_NOCLOSE);
|
goto end;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
out = BIO_new_fp (stdout, BIO_NOCLOSE);
|
||||||
#ifdef OPENSSL_SYS_VMS
|
#ifdef OPENSSL_SYS_VMS
|
||||||
{
|
{
|
||||||
BIO *tmpbio = BIO_new(BIO_f_linebuffer());
|
BIO *tmpbio = BIO_new(BIO_f_linebuffer());
|
||||||
out = BIO_push(tmpbio, out);
|
out = BIO_push(tmpbio, out);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
if (topk8) {
|
if (topk8)
|
||||||
pkey = load_key(bio_err, infile, informat, 1, passin, e, "key");
|
{
|
||||||
if (!pkey)
|
pkey = load_key(bio_err, infile, informat, 1,
|
||||||
goto end;
|
passin, e, "key");
|
||||||
if (!(p8inf = EVP_PKEY2PKCS8_broken(pkey, p8_broken))) {
|
if (!pkey)
|
||||||
BIO_printf(bio_err, "Error converting key\n");
|
goto end;
|
||||||
ERR_print_errors(bio_err);
|
if (!(p8inf = EVP_PKEY2PKCS8_broken(pkey, p8_broken)))
|
||||||
goto end;
|
{
|
||||||
}
|
BIO_printf(bio_err, "Error converting key\n");
|
||||||
if (nocrypt) {
|
ERR_print_errors(bio_err);
|
||||||
if (outformat == FORMAT_PEM)
|
goto end;
|
||||||
PEM_write_bio_PKCS8_PRIV_KEY_INFO(out, p8inf);
|
}
|
||||||
else if (outformat == FORMAT_ASN1)
|
if (nocrypt)
|
||||||
i2d_PKCS8_PRIV_KEY_INFO_bio(out, p8inf);
|
{
|
||||||
else {
|
if (outformat == FORMAT_PEM)
|
||||||
BIO_printf(bio_err, "Bad format specified for key\n");
|
PEM_write_bio_PKCS8_PRIV_KEY_INFO(out, p8inf);
|
||||||
goto end;
|
else if (outformat == FORMAT_ASN1)
|
||||||
}
|
i2d_PKCS8_PRIV_KEY_INFO_bio(out, p8inf);
|
||||||
} else {
|
else
|
||||||
if (passout)
|
{
|
||||||
p8pass = passout;
|
BIO_printf(bio_err, "Bad format specified for key\n");
|
||||||
else {
|
goto end;
|
||||||
p8pass = pass;
|
}
|
||||||
if (EVP_read_pw_string
|
}
|
||||||
(pass, sizeof pass, "Enter Encryption Password:", 1))
|
else
|
||||||
goto end;
|
{
|
||||||
}
|
if (passout)
|
||||||
app_RAND_load_file(NULL, bio_err, 0);
|
p8pass = passout;
|
||||||
if (!(p8 = PKCS8_encrypt(pbe_nid, cipher,
|
else
|
||||||
p8pass, strlen(p8pass),
|
{
|
||||||
NULL, 0, iter, p8inf))) {
|
p8pass = pass;
|
||||||
BIO_printf(bio_err, "Error encrypting key\n");
|
if (EVP_read_pw_string(pass, sizeof pass, "Enter Encryption Password:", 1))
|
||||||
ERR_print_errors(bio_err);
|
goto end;
|
||||||
goto end;
|
}
|
||||||
}
|
app_RAND_load_file(NULL, bio_err, 0);
|
||||||
app_RAND_write_file(NULL, bio_err);
|
if (!(p8 = PKCS8_encrypt(pbe_nid, cipher,
|
||||||
if (outformat == FORMAT_PEM)
|
p8pass, strlen(p8pass),
|
||||||
PEM_write_bio_PKCS8(out, p8);
|
NULL, 0, iter, p8inf)))
|
||||||
else if (outformat == FORMAT_ASN1)
|
{
|
||||||
i2d_PKCS8_bio(out, p8);
|
BIO_printf(bio_err, "Error encrypting key\n");
|
||||||
else {
|
ERR_print_errors(bio_err);
|
||||||
BIO_printf(bio_err, "Bad format specified for key\n");
|
goto end;
|
||||||
goto end;
|
}
|
||||||
}
|
app_RAND_write_file(NULL, bio_err);
|
||||||
}
|
if (outformat == FORMAT_PEM)
|
||||||
|
PEM_write_bio_PKCS8(out, p8);
|
||||||
|
else if (outformat == FORMAT_ASN1)
|
||||||
|
i2d_PKCS8_bio(out, p8);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
BIO_printf(bio_err, "Bad format specified for key\n");
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nocrypt) {
|
if (nocrypt)
|
||||||
if (informat == FORMAT_PEM)
|
{
|
||||||
p8inf = PEM_read_bio_PKCS8_PRIV_KEY_INFO(in, NULL, NULL, NULL);
|
if (informat == FORMAT_PEM)
|
||||||
else if (informat == FORMAT_ASN1)
|
p8inf = PEM_read_bio_PKCS8_PRIV_KEY_INFO(in,NULL,NULL, NULL);
|
||||||
p8inf = d2i_PKCS8_PRIV_KEY_INFO_bio(in, NULL);
|
else if (informat == FORMAT_ASN1)
|
||||||
else {
|
p8inf = d2i_PKCS8_PRIV_KEY_INFO_bio(in, NULL);
|
||||||
BIO_printf(bio_err, "Bad format specified for key\n");
|
else
|
||||||
goto end;
|
{
|
||||||
}
|
BIO_printf(bio_err, "Bad format specified for key\n");
|
||||||
} else {
|
goto end;
|
||||||
if (informat == FORMAT_PEM)
|
}
|
||||||
p8 = PEM_read_bio_PKCS8(in, NULL, NULL, NULL);
|
}
|
||||||
else if (informat == FORMAT_ASN1)
|
else
|
||||||
p8 = d2i_PKCS8_bio(in, NULL);
|
{
|
||||||
else {
|
if (informat == FORMAT_PEM)
|
||||||
BIO_printf(bio_err, "Bad format specified for key\n");
|
p8 = PEM_read_bio_PKCS8(in, NULL, NULL, NULL);
|
||||||
goto end;
|
else if (informat == FORMAT_ASN1)
|
||||||
}
|
p8 = d2i_PKCS8_bio(in, NULL);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
BIO_printf(bio_err, "Bad format specified for key\n");
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
if (!p8) {
|
if (!p8)
|
||||||
BIO_printf(bio_err, "Error reading key\n");
|
{
|
||||||
ERR_print_errors(bio_err);
|
BIO_printf (bio_err, "Error reading key\n");
|
||||||
goto end;
|
ERR_print_errors(bio_err);
|
||||||
}
|
goto end;
|
||||||
if (passin)
|
}
|
||||||
p8pass = passin;
|
if (passin)
|
||||||
else {
|
p8pass = passin;
|
||||||
p8pass = pass;
|
else
|
||||||
EVP_read_pw_string(pass, sizeof pass, "Enter Password:", 0);
|
{
|
||||||
}
|
p8pass = pass;
|
||||||
p8inf = PKCS8_decrypt(p8, p8pass, strlen(p8pass));
|
EVP_read_pw_string(pass, sizeof pass, "Enter Password:", 0);
|
||||||
}
|
}
|
||||||
|
p8inf = PKCS8_decrypt(p8, p8pass, strlen(p8pass));
|
||||||
|
}
|
||||||
|
|
||||||
if (!p8inf) {
|
if (!p8inf)
|
||||||
BIO_printf(bio_err, "Error decrypting key\n");
|
{
|
||||||
ERR_print_errors(bio_err);
|
BIO_printf(bio_err, "Error decrypting key\n");
|
||||||
goto end;
|
ERR_print_errors(bio_err);
|
||||||
}
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
if (!(pkey = EVP_PKCS82PKEY(p8inf))) {
|
if (!(pkey = EVP_PKCS82PKEY(p8inf)))
|
||||||
BIO_printf(bio_err, "Error converting key\n");
|
{
|
||||||
ERR_print_errors(bio_err);
|
BIO_printf(bio_err, "Error converting key\n");
|
||||||
goto end;
|
ERR_print_errors(bio_err);
|
||||||
}
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
if (p8inf->broken) {
|
if (p8inf->broken)
|
||||||
BIO_printf(bio_err, "Warning: broken key encoding: ");
|
{
|
||||||
switch (p8inf->broken) {
|
BIO_printf(bio_err, "Warning: broken key encoding: ");
|
||||||
case PKCS8_NO_OCTET:
|
switch (p8inf->broken)
|
||||||
BIO_printf(bio_err, "No Octet String in PrivateKey\n");
|
{
|
||||||
break;
|
case PKCS8_NO_OCTET:
|
||||||
|
BIO_printf(bio_err, "No Octet String in PrivateKey\n");
|
||||||
|
break;
|
||||||
|
|
||||||
case PKCS8_EMBEDDED_PARAM:
|
case PKCS8_EMBEDDED_PARAM:
|
||||||
BIO_printf(bio_err, "DSA parameters included in PrivateKey\n");
|
BIO_printf(bio_err, "DSA parameters included in PrivateKey\n");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PKCS8_NS_DB:
|
case PKCS8_NS_DB:
|
||||||
BIO_printf(bio_err, "DSA public key include in PrivateKey\n");
|
BIO_printf(bio_err, "DSA public key include in PrivateKey\n");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PKCS8_NEG_PRIVKEY:
|
case PKCS8_NEG_PRIVKEY:
|
||||||
BIO_printf(bio_err, "DSA private key value is negative\n");
|
BIO_printf(bio_err, "DSA private key value is negative\n");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
BIO_printf(bio_err, "Unknown broken type\n");
|
BIO_printf(bio_err, "Unknown broken type\n");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (outformat == FORMAT_PEM)
|
if (outformat == FORMAT_PEM)
|
||||||
PEM_write_bio_PrivateKey(out, pkey, NULL, NULL, 0, NULL, passout);
|
PEM_write_bio_PrivateKey(out, pkey, NULL, NULL, 0, NULL, passout);
|
||||||
else if (outformat == FORMAT_ASN1)
|
else if (outformat == FORMAT_ASN1)
|
||||||
i2d_PrivateKey_bio(out, pkey);
|
i2d_PrivateKey_bio(out, pkey);
|
||||||
else {
|
else
|
||||||
BIO_printf(bio_err, "Bad format specified for key\n");
|
{
|
||||||
goto end;
|
BIO_printf(bio_err, "Bad format specified for key\n");
|
||||||
}
|
goto end;
|
||||||
ret = 0;
|
}
|
||||||
|
ret = 0;
|
||||||
|
|
||||||
end:
|
end:
|
||||||
X509_SIG_free(p8);
|
X509_SIG_free(p8);
|
||||||
PKCS8_PRIV_KEY_INFO_free(p8inf);
|
PKCS8_PRIV_KEY_INFO_free(p8inf);
|
||||||
EVP_PKEY_free(pkey);
|
EVP_PKEY_free(pkey);
|
||||||
BIO_free_all(out);
|
BIO_free_all(out);
|
||||||
BIO_free(in);
|
BIO_free(in);
|
||||||
if (passin)
|
if (passin)
|
||||||
OPENSSL_free(passin);
|
OPENSSL_free(passin);
|
||||||
if (passout)
|
if (passout)
|
||||||
OPENSSL_free(passout);
|
OPENSSL_free(passout);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|||||||
353
apps/pkey.c
353
apps/pkey.c
@@ -1,7 +1,6 @@
|
|||||||
/* apps/pkey.c */
|
/* apps/pkey.c */
|
||||||
/*
|
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
|
||||||
* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL project
|
* project 2006
|
||||||
* 2006
|
|
||||||
*/
|
*/
|
||||||
/* ====================================================================
|
/* ====================================================================
|
||||||
* Copyright (c) 2006 The OpenSSL Project. All rights reserved.
|
* Copyright (c) 2006 The OpenSSL Project. All rights reserved.
|
||||||
@@ -68,184 +67,218 @@
|
|||||||
int MAIN(int, char **);
|
int MAIN(int, char **);
|
||||||
|
|
||||||
int MAIN(int argc, char **argv)
|
int MAIN(int argc, char **argv)
|
||||||
{
|
{
|
||||||
ENGINE *e = NULL;
|
ENGINE *e = NULL;
|
||||||
char **args, *infile = NULL, *outfile = NULL;
|
char **args, *infile = NULL, *outfile = NULL;
|
||||||
char *passargin = NULL, *passargout = NULL;
|
char *passargin = NULL, *passargout = NULL;
|
||||||
BIO *in = NULL, *out = NULL;
|
BIO *in = NULL, *out = NULL;
|
||||||
const EVP_CIPHER *cipher = NULL;
|
const EVP_CIPHER *cipher = NULL;
|
||||||
int informat, outformat;
|
int informat, outformat;
|
||||||
int pubin = 0, pubout = 0, pubtext = 0, text = 0, noout = 0;
|
int pubin = 0, pubout = 0, pubtext = 0, text = 0, noout = 0;
|
||||||
EVP_PKEY *pkey = NULL;
|
EVP_PKEY *pkey=NULL;
|
||||||
char *passin = NULL, *passout = NULL;
|
char *passin = NULL, *passout = NULL;
|
||||||
int badarg = 0;
|
int badarg = 0;
|
||||||
#ifndef OPENSSL_NO_ENGINE
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
char *engine = NULL;
|
char *engine=NULL;
|
||||||
#endif
|
#endif
|
||||||
int ret = 1;
|
int ret = 1;
|
||||||
|
|
||||||
if (bio_err == NULL)
|
if (bio_err == NULL)
|
||||||
bio_err = BIO_new_fp(stderr, BIO_NOCLOSE);
|
bio_err = BIO_new_fp (stderr, BIO_NOCLOSE);
|
||||||
|
|
||||||
if (!load_config(bio_err, NULL))
|
if (!load_config(bio_err, NULL))
|
||||||
goto end;
|
goto end;
|
||||||
|
|
||||||
informat = FORMAT_PEM;
|
informat=FORMAT_PEM;
|
||||||
outformat = FORMAT_PEM;
|
outformat=FORMAT_PEM;
|
||||||
|
|
||||||
ERR_load_crypto_strings();
|
ERR_load_crypto_strings();
|
||||||
OpenSSL_add_all_algorithms();
|
OpenSSL_add_all_algorithms();
|
||||||
args = argv + 1;
|
args = argv + 1;
|
||||||
while (!badarg && *args && *args[0] == '-') {
|
while (!badarg && *args && *args[0] == '-')
|
||||||
if (!strcmp(*args, "-inform")) {
|
{
|
||||||
if (args[1]) {
|
if (!strcmp(*args,"-inform"))
|
||||||
args++;
|
{
|
||||||
informat = str2fmt(*args);
|
if (args[1])
|
||||||
} else
|
{
|
||||||
badarg = 1;
|
args++;
|
||||||
} else if (!strcmp(*args, "-outform")) {
|
informat=str2fmt(*args);
|
||||||
if (args[1]) {
|
}
|
||||||
args++;
|
else badarg = 1;
|
||||||
outformat = str2fmt(*args);
|
}
|
||||||
} else
|
else if (!strcmp(*args,"-outform"))
|
||||||
badarg = 1;
|
{
|
||||||
} else if (!strcmp(*args, "-passin")) {
|
if (args[1])
|
||||||
if (!args[1])
|
{
|
||||||
goto bad;
|
args++;
|
||||||
passargin = *(++args);
|
outformat=str2fmt(*args);
|
||||||
} else if (!strcmp(*args, "-passout")) {
|
}
|
||||||
if (!args[1])
|
else badarg = 1;
|
||||||
goto bad;
|
}
|
||||||
passargout = *(++args);
|
else if (!strcmp(*args,"-passin"))
|
||||||
}
|
{
|
||||||
|
if (!args[1]) goto bad;
|
||||||
|
passargin= *(++args);
|
||||||
|
}
|
||||||
|
else if (!strcmp(*args,"-passout"))
|
||||||
|
{
|
||||||
|
if (!args[1]) goto bad;
|
||||||
|
passargout= *(++args);
|
||||||
|
}
|
||||||
#ifndef OPENSSL_NO_ENGINE
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
else if (strcmp(*args, "-engine") == 0) {
|
else if (strcmp(*args,"-engine") == 0)
|
||||||
if (!args[1])
|
{
|
||||||
goto bad;
|
if (!args[1]) goto bad;
|
||||||
engine = *(++args);
|
engine= *(++args);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
else if (!strcmp(*args, "-in")) {
|
else if (!strcmp (*args, "-in"))
|
||||||
if (args[1]) {
|
{
|
||||||
args++;
|
if (args[1])
|
||||||
infile = *args;
|
{
|
||||||
} else
|
args++;
|
||||||
badarg = 1;
|
infile = *args;
|
||||||
} else if (!strcmp(*args, "-out")) {
|
}
|
||||||
if (args[1]) {
|
else badarg = 1;
|
||||||
args++;
|
}
|
||||||
outfile = *args;
|
else if (!strcmp (*args, "-out"))
|
||||||
} else
|
{
|
||||||
badarg = 1;
|
if (args[1])
|
||||||
} else if (strcmp(*args, "-pubin") == 0) {
|
{
|
||||||
pubin = 1;
|
args++;
|
||||||
pubout = 1;
|
outfile = *args;
|
||||||
pubtext = 1;
|
}
|
||||||
} else if (strcmp(*args, "-pubout") == 0)
|
else badarg = 1;
|
||||||
pubout = 1;
|
}
|
||||||
else if (strcmp(*args, "-text_pub") == 0) {
|
else if (strcmp(*args,"-pubin") == 0)
|
||||||
pubtext = 1;
|
{
|
||||||
text = 1;
|
pubin=1;
|
||||||
} else if (strcmp(*args, "-text") == 0)
|
pubout=1;
|
||||||
text = 1;
|
pubtext=1;
|
||||||
else if (strcmp(*args, "-noout") == 0)
|
}
|
||||||
noout = 1;
|
else if (strcmp(*args,"-pubout") == 0)
|
||||||
else {
|
pubout=1;
|
||||||
cipher = EVP_get_cipherbyname(*args + 1);
|
else if (strcmp(*args,"-text_pub") == 0)
|
||||||
if (!cipher) {
|
{
|
||||||
BIO_printf(bio_err, "Unknown cipher %s\n", *args + 1);
|
pubtext=1;
|
||||||
badarg = 1;
|
text=1;
|
||||||
}
|
}
|
||||||
}
|
else if (strcmp(*args,"-text") == 0)
|
||||||
args++;
|
text=1;
|
||||||
}
|
else if (strcmp(*args,"-noout") == 0)
|
||||||
|
noout=1;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
cipher = EVP_get_cipherbyname(*args + 1);
|
||||||
|
if (!cipher)
|
||||||
|
{
|
||||||
|
BIO_printf(bio_err, "Unknown cipher %s\n",
|
||||||
|
*args + 1);
|
||||||
|
badarg = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
args++;
|
||||||
|
}
|
||||||
|
|
||||||
if (badarg) {
|
if (badarg)
|
||||||
bad:
|
{
|
||||||
BIO_printf(bio_err, "Usage pkey [options]\n");
|
bad:
|
||||||
BIO_printf(bio_err, "where options are\n");
|
BIO_printf(bio_err, "Usage pkey [options]\n");
|
||||||
BIO_printf(bio_err, "-in file input file\n");
|
BIO_printf(bio_err, "where options are\n");
|
||||||
BIO_printf(bio_err, "-inform X input format (DER or PEM)\n");
|
BIO_printf(bio_err, "-in file input file\n");
|
||||||
BIO_printf(bio_err,
|
BIO_printf(bio_err, "-inform X input format (DER or PEM)\n");
|
||||||
"-passin arg input file pass phrase source\n");
|
BIO_printf(bio_err, "-passin arg input file pass phrase source\n");
|
||||||
BIO_printf(bio_err, "-outform X output format (DER or PEM)\n");
|
BIO_printf(bio_err, "-outform X output format (DER or PEM)\n");
|
||||||
BIO_printf(bio_err, "-out file output file\n");
|
BIO_printf(bio_err, "-out file output file\n");
|
||||||
BIO_printf(bio_err,
|
BIO_printf(bio_err, "-passout arg output file pass phrase source\n");
|
||||||
"-passout arg output file pass phrase source\n");
|
|
||||||
#ifndef OPENSSL_NO_ENGINE
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
BIO_printf(bio_err,
|
BIO_printf(bio_err, "-engine e use engine e, possibly a hardware device.\n");
|
||||||
"-engine e use engine e, possibly a hardware device.\n");
|
|
||||||
#endif
|
#endif
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef OPENSSL_NO_ENGINE
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
e = setup_engine(bio_err, engine, 0);
|
e = setup_engine(bio_err, engine, 0);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (!app_passwd(bio_err, passargin, passargout, &passin, &passout)) {
|
if (!app_passwd(bio_err, passargin, passargout, &passin, &passout))
|
||||||
BIO_printf(bio_err, "Error getting passwords\n");
|
{
|
||||||
goto end;
|
BIO_printf(bio_err, "Error getting passwords\n");
|
||||||
}
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
if (outfile) {
|
if (outfile)
|
||||||
if (!(out = BIO_new_file(outfile, "wb"))) {
|
{
|
||||||
BIO_printf(bio_err, "Can't open output file %s\n", outfile);
|
if (!(out = BIO_new_file (outfile, "wb")))
|
||||||
goto end;
|
{
|
||||||
}
|
BIO_printf(bio_err,
|
||||||
} else {
|
"Can't open output file %s\n", outfile);
|
||||||
out = BIO_new_fp(stdout, BIO_NOCLOSE);
|
goto end;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
out = BIO_new_fp (stdout, BIO_NOCLOSE);
|
||||||
#ifdef OPENSSL_SYS_VMS
|
#ifdef OPENSSL_SYS_VMS
|
||||||
{
|
{
|
||||||
BIO *tmpbio = BIO_new(BIO_f_linebuffer());
|
BIO *tmpbio = BIO_new(BIO_f_linebuffer());
|
||||||
out = BIO_push(tmpbio, out);
|
out = BIO_push(tmpbio, out);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pubin)
|
if (pubin)
|
||||||
pkey = load_pubkey(bio_err, infile, informat, 1,
|
pkey = load_pubkey(bio_err, infile, informat, 1,
|
||||||
passin, e, "Public Key");
|
passin, e, "Public Key");
|
||||||
else
|
else
|
||||||
pkey = load_key(bio_err, infile, informat, 1, passin, e, "key");
|
pkey = load_key(bio_err, infile, informat, 1,
|
||||||
if (!pkey)
|
passin, e, "key");
|
||||||
goto end;
|
if (!pkey)
|
||||||
|
goto end;
|
||||||
|
|
||||||
if (!noout) {
|
if (!noout)
|
||||||
if (outformat == FORMAT_PEM) {
|
{
|
||||||
if (pubout)
|
if (outformat == FORMAT_PEM)
|
||||||
PEM_write_bio_PUBKEY(out, pkey);
|
{
|
||||||
else
|
if (pubout)
|
||||||
PEM_write_bio_PrivateKey(out, pkey, cipher,
|
PEM_write_bio_PUBKEY(out,pkey);
|
||||||
NULL, 0, NULL, passout);
|
else
|
||||||
} else if (outformat == FORMAT_ASN1) {
|
PEM_write_bio_PrivateKey(out, pkey, cipher,
|
||||||
if (pubout)
|
NULL, 0, NULL, passout);
|
||||||
i2d_PUBKEY_bio(out, pkey);
|
}
|
||||||
else
|
else if (outformat == FORMAT_ASN1)
|
||||||
i2d_PrivateKey_bio(out, pkey);
|
{
|
||||||
} else {
|
if (pubout)
|
||||||
BIO_printf(bio_err, "Bad format specified for key\n");
|
i2d_PUBKEY_bio(out, pkey);
|
||||||
goto end;
|
else
|
||||||
}
|
i2d_PrivateKey_bio(out, pkey);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
BIO_printf(bio_err, "Bad format specified for key\n");
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (text) {
|
if (text)
|
||||||
if (pubtext)
|
{
|
||||||
EVP_PKEY_print_public(out, pkey, 0, NULL);
|
if (pubtext)
|
||||||
else
|
EVP_PKEY_print_public(out, pkey, 0, NULL);
|
||||||
EVP_PKEY_print_private(out, pkey, 0, NULL);
|
else
|
||||||
}
|
EVP_PKEY_print_private(out, pkey, 0, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
end:
|
end:
|
||||||
EVP_PKEY_free(pkey);
|
EVP_PKEY_free(pkey);
|
||||||
BIO_free_all(out);
|
BIO_free_all(out);
|
||||||
BIO_free(in);
|
BIO_free(in);
|
||||||
if (passin)
|
if (passin)
|
||||||
OPENSSL_free(passin);
|
OPENSSL_free(passin);
|
||||||
if (passout)
|
if (passout)
|
||||||
OPENSSL_free(passout);
|
OPENSSL_free(passout);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|||||||
201
apps/pkeyparam.c
201
apps/pkeyparam.c
@@ -1,7 +1,6 @@
|
|||||||
/* apps/pkeyparam.c */
|
/* apps/pkeyparam.c */
|
||||||
/*
|
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
|
||||||
* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL project
|
* project 2006
|
||||||
* 2006
|
|
||||||
*/
|
*/
|
||||||
/* ====================================================================
|
/* ====================================================================
|
||||||
* Copyright (c) 2006 The OpenSSL Project. All rights reserved.
|
* Copyright (c) 2006 The OpenSSL Project. All rights reserved.
|
||||||
@@ -68,118 +67,134 @@
|
|||||||
int MAIN(int, char **);
|
int MAIN(int, char **);
|
||||||
|
|
||||||
int MAIN(int argc, char **argv)
|
int MAIN(int argc, char **argv)
|
||||||
{
|
{
|
||||||
char **args, *infile = NULL, *outfile = NULL;
|
char **args, *infile = NULL, *outfile = NULL;
|
||||||
BIO *in = NULL, *out = NULL;
|
BIO *in = NULL, *out = NULL;
|
||||||
int text = 0, noout = 0;
|
int text = 0, noout = 0;
|
||||||
EVP_PKEY *pkey = NULL;
|
EVP_PKEY *pkey=NULL;
|
||||||
int badarg = 0;
|
int badarg = 0;
|
||||||
#ifndef OPENSSL_NO_ENGINE
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
char *engine = NULL;
|
char *engine=NULL;
|
||||||
#endif
|
#endif
|
||||||
int ret = 1;
|
int ret = 1;
|
||||||
|
|
||||||
if (bio_err == NULL)
|
if (bio_err == NULL)
|
||||||
bio_err = BIO_new_fp(stderr, BIO_NOCLOSE);
|
bio_err = BIO_new_fp (stderr, BIO_NOCLOSE);
|
||||||
|
|
||||||
if (!load_config(bio_err, NULL))
|
if (!load_config(bio_err, NULL))
|
||||||
goto end;
|
goto end;
|
||||||
|
|
||||||
ERR_load_crypto_strings();
|
ERR_load_crypto_strings();
|
||||||
OpenSSL_add_all_algorithms();
|
OpenSSL_add_all_algorithms();
|
||||||
args = argv + 1;
|
args = argv + 1;
|
||||||
while (!badarg && *args && *args[0] == '-') {
|
while (!badarg && *args && *args[0] == '-')
|
||||||
if (!strcmp(*args, "-in")) {
|
{
|
||||||
if (args[1]) {
|
if (!strcmp (*args, "-in"))
|
||||||
args++;
|
{
|
||||||
infile = *args;
|
if (args[1])
|
||||||
} else
|
{
|
||||||
badarg = 1;
|
args++;
|
||||||
} else if (!strcmp(*args, "-out")) {
|
infile = *args;
|
||||||
if (args[1]) {
|
}
|
||||||
args++;
|
else badarg = 1;
|
||||||
outfile = *args;
|
}
|
||||||
} else
|
else if (!strcmp (*args, "-out"))
|
||||||
badarg = 1;
|
{
|
||||||
}
|
if (args[1])
|
||||||
|
{
|
||||||
|
args++;
|
||||||
|
outfile = *args;
|
||||||
|
}
|
||||||
|
else badarg = 1;
|
||||||
|
}
|
||||||
#ifndef OPENSSL_NO_ENGINE
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
else if (strcmp(*args, "-engine") == 0) {
|
else if (strcmp(*args,"-engine") == 0)
|
||||||
if (!args[1])
|
{
|
||||||
goto bad;
|
if (!args[1]) goto bad;
|
||||||
engine = *(++args);
|
engine= *(++args);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
else if (strcmp(*args, "-text") == 0)
|
else if (strcmp(*args,"-text") == 0)
|
||||||
text = 1;
|
text=1;
|
||||||
else if (strcmp(*args, "-noout") == 0)
|
else if (strcmp(*args,"-noout") == 0)
|
||||||
noout = 1;
|
noout=1;
|
||||||
args++;
|
args++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (badarg) {
|
if (badarg)
|
||||||
|
{
|
||||||
#ifndef OPENSSL_NO_ENGINE
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
bad:
|
bad:
|
||||||
#endif
|
#endif
|
||||||
BIO_printf(bio_err, "Usage pkeyparam [options]\n");
|
BIO_printf(bio_err, "Usage pkeyparam [options]\n");
|
||||||
BIO_printf(bio_err, "where options are\n");
|
BIO_printf(bio_err, "where options are\n");
|
||||||
BIO_printf(bio_err, "-in file input file\n");
|
BIO_printf(bio_err, "-in file input file\n");
|
||||||
BIO_printf(bio_err, "-out file output file\n");
|
BIO_printf(bio_err, "-out file output file\n");
|
||||||
BIO_printf(bio_err, "-text print parameters as text\n");
|
BIO_printf(bio_err, "-text print parameters as text\n");
|
||||||
BIO_printf(bio_err,
|
BIO_printf(bio_err, "-noout don't output encoded parameters\n");
|
||||||
"-noout don't output encoded parameters\n");
|
|
||||||
#ifndef OPENSSL_NO_ENGINE
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
BIO_printf(bio_err,
|
BIO_printf(bio_err, "-engine e use engine e, possibly a hardware device.\n");
|
||||||
"-engine e use engine e, possibly a hardware device.\n");
|
|
||||||
#endif
|
#endif
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef OPENSSL_NO_ENGINE
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
setup_engine(bio_err, engine, 0);
|
setup_engine(bio_err, engine, 0);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (infile) {
|
if (infile)
|
||||||
if (!(in = BIO_new_file(infile, "r"))) {
|
{
|
||||||
BIO_printf(bio_err, "Can't open input file %s\n", infile);
|
if (!(in = BIO_new_file (infile, "r")))
|
||||||
goto end;
|
{
|
||||||
}
|
BIO_printf(bio_err,
|
||||||
} else
|
"Can't open input file %s\n", infile);
|
||||||
in = BIO_new_fp(stdin, BIO_NOCLOSE);
|
goto end;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
in = BIO_new_fp (stdin, BIO_NOCLOSE);
|
||||||
|
|
||||||
if (outfile) {
|
if (outfile)
|
||||||
if (!(out = BIO_new_file(outfile, "w"))) {
|
{
|
||||||
BIO_printf(bio_err, "Can't open output file %s\n", outfile);
|
if (!(out = BIO_new_file (outfile, "w")))
|
||||||
goto end;
|
{
|
||||||
}
|
BIO_printf(bio_err,
|
||||||
} else {
|
"Can't open output file %s\n", outfile);
|
||||||
out = BIO_new_fp(stdout, BIO_NOCLOSE);
|
goto end;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
out = BIO_new_fp (stdout, BIO_NOCLOSE);
|
||||||
#ifdef OPENSSL_SYS_VMS
|
#ifdef OPENSSL_SYS_VMS
|
||||||
{
|
{
|
||||||
BIO *tmpbio = BIO_new(BIO_f_linebuffer());
|
BIO *tmpbio = BIO_new(BIO_f_linebuffer());
|
||||||
out = BIO_push(tmpbio, out);
|
out = BIO_push(tmpbio, out);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
pkey = PEM_read_bio_Parameters(in, NULL);
|
pkey = PEM_read_bio_Parameters(in, NULL);
|
||||||
if (!pkey) {
|
if (!pkey)
|
||||||
BIO_printf(bio_err, "Error reading parameters\n");
|
{
|
||||||
ERR_print_errors(bio_err);
|
BIO_printf(bio_err, "Error reading parameters\n");
|
||||||
goto end;
|
ERR_print_errors(bio_err);
|
||||||
}
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
if (!noout)
|
if (!noout)
|
||||||
PEM_write_bio_Parameters(out, pkey);
|
PEM_write_bio_Parameters(out,pkey);
|
||||||
|
|
||||||
if (text)
|
if (text)
|
||||||
EVP_PKEY_print_params(out, pkey, 0, NULL);
|
EVP_PKEY_print_params(out, pkey, 0, NULL);
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
end:
|
end:
|
||||||
EVP_PKEY_free(pkey);
|
EVP_PKEY_free(pkey);
|
||||||
BIO_free_all(out);
|
BIO_free_all(out);
|
||||||
BIO_free(in);
|
BIO_free(in);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|||||||
809
apps/pkeyutl.c
809
apps/pkeyutl.c
@@ -1,6 +1,5 @@
|
|||||||
/*
|
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
|
||||||
* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL project
|
* project 2006.
|
||||||
* 2006.
|
|
||||||
*/
|
*/
|
||||||
/* ====================================================================
|
/* ====================================================================
|
||||||
* Copyright (c) 2006 The OpenSSL Project. All rights reserved.
|
* Copyright (c) 2006 The OpenSSL Project. All rights reserved.
|
||||||
@@ -56,15 +55,16 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include "apps.h"
|
#include "apps.h"
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <openssl/err.h>
|
#include <openssl/err.h>
|
||||||
#include <openssl/pem.h>
|
#include <openssl/pem.h>
|
||||||
#include <openssl/evp.h>
|
#include <openssl/evp.h>
|
||||||
|
|
||||||
#define KEY_PRIVKEY 1
|
#define KEY_PRIVKEY 1
|
||||||
#define KEY_PUBKEY 2
|
#define KEY_PUBKEY 2
|
||||||
#define KEY_CERT 3
|
#define KEY_CERT 3
|
||||||
|
|
||||||
static void usage(void);
|
static void usage(void);
|
||||||
|
|
||||||
@@ -73,451 +73,498 @@ static void usage(void);
|
|||||||
#define PROG pkeyutl_main
|
#define PROG pkeyutl_main
|
||||||
|
|
||||||
static EVP_PKEY_CTX *init_ctx(int *pkeysize,
|
static EVP_PKEY_CTX *init_ctx(int *pkeysize,
|
||||||
char *keyfile, int keyform, int key_type,
|
char *keyfile, int keyform, int key_type,
|
||||||
char *passargin, int pkey_op, ENGINE *e);
|
char *passargin, int pkey_op, ENGINE *e);
|
||||||
|
|
||||||
static int setup_peer(BIO *err, EVP_PKEY_CTX *ctx, int peerform,
|
static int setup_peer(BIO *err, EVP_PKEY_CTX *ctx, int peerform,
|
||||||
const char *file);
|
const char *file);
|
||||||
|
|
||||||
static int do_keyop(EVP_PKEY_CTX *ctx, int pkey_op,
|
static int do_keyop(EVP_PKEY_CTX *ctx, int pkey_op,
|
||||||
unsigned char *out, size_t *poutlen,
|
unsigned char *out, size_t *poutlen,
|
||||||
unsigned char *in, size_t inlen);
|
unsigned char *in, size_t inlen);
|
||||||
|
|
||||||
int MAIN(int argc, char **);
|
int MAIN(int argc, char **);
|
||||||
|
|
||||||
int MAIN(int argc, char **argv)
|
int MAIN(int argc, char **argv)
|
||||||
{
|
{
|
||||||
BIO *in = NULL, *out = NULL;
|
BIO *in = NULL, *out = NULL;
|
||||||
char *infile = NULL, *outfile = NULL, *sigfile = NULL;
|
char *infile = NULL, *outfile = NULL, *sigfile = NULL;
|
||||||
ENGINE *e = NULL;
|
ENGINE *e = NULL;
|
||||||
int pkey_op = EVP_PKEY_OP_SIGN, key_type = KEY_PRIVKEY;
|
int pkey_op = EVP_PKEY_OP_SIGN, key_type = KEY_PRIVKEY;
|
||||||
int keyform = FORMAT_PEM, peerform = FORMAT_PEM;
|
int keyform = FORMAT_PEM, peerform = FORMAT_PEM;
|
||||||
char badarg = 0, rev = 0;
|
char badarg = 0, rev = 0;
|
||||||
char hexdump = 0, asn1parse = 0;
|
char hexdump = 0, asn1parse = 0;
|
||||||
EVP_PKEY_CTX *ctx = NULL;
|
EVP_PKEY_CTX *ctx = NULL;
|
||||||
char *passargin = NULL;
|
char *passargin = NULL;
|
||||||
int keysize = -1;
|
int keysize = -1;
|
||||||
|
|
||||||
unsigned char *buf_in = NULL, *buf_out = NULL, *sig = NULL;
|
unsigned char *buf_in = NULL, *buf_out = NULL, *sig = NULL;
|
||||||
size_t buf_outlen;
|
size_t buf_outlen;
|
||||||
int buf_inlen = 0, siglen = -1;
|
int buf_inlen = 0, siglen = -1;
|
||||||
|
|
||||||
int ret = 1, rv = -1;
|
int ret = 1, rv = -1;
|
||||||
|
|
||||||
argc--;
|
argc--;
|
||||||
argv++;
|
argv++;
|
||||||
|
|
||||||
if (!bio_err)
|
if(!bio_err) bio_err = BIO_new_fp(stderr, BIO_NOCLOSE);
|
||||||
bio_err = BIO_new_fp(stderr, BIO_NOCLOSE);
|
|
||||||
|
|
||||||
if (!load_config(bio_err, NULL))
|
if (!load_config(bio_err, NULL))
|
||||||
goto end;
|
goto end;
|
||||||
ERR_load_crypto_strings();
|
ERR_load_crypto_strings();
|
||||||
OpenSSL_add_all_algorithms();
|
OpenSSL_add_all_algorithms();
|
||||||
|
|
||||||
while (argc >= 1) {
|
while(argc >= 1)
|
||||||
if (!strcmp(*argv, "-in")) {
|
{
|
||||||
if (--argc < 1)
|
if (!strcmp(*argv,"-in"))
|
||||||
badarg = 1;
|
{
|
||||||
else
|
if (--argc < 1) badarg = 1;
|
||||||
infile = *(++argv);
|
else infile= *(++argv);
|
||||||
} else if (!strcmp(*argv, "-out")) {
|
}
|
||||||
if (--argc < 1)
|
else if (!strcmp(*argv,"-out"))
|
||||||
badarg = 1;
|
{
|
||||||
else
|
if (--argc < 1) badarg = 1;
|
||||||
outfile = *(++argv);
|
else outfile= *(++argv);
|
||||||
} else if (!strcmp(*argv, "-sigfile")) {
|
}
|
||||||
if (--argc < 1)
|
else if (!strcmp(*argv,"-sigfile"))
|
||||||
badarg = 1;
|
{
|
||||||
else
|
if (--argc < 1) badarg = 1;
|
||||||
sigfile = *(++argv);
|
else sigfile= *(++argv);
|
||||||
} else if (!strcmp(*argv, "-inkey")) {
|
}
|
||||||
if (--argc < 1)
|
else if(!strcmp(*argv, "-inkey"))
|
||||||
badarg = 1;
|
{
|
||||||
else {
|
if (--argc < 1)
|
||||||
ctx = init_ctx(&keysize,
|
badarg = 1;
|
||||||
*(++argv), keyform, key_type,
|
else
|
||||||
passargin, pkey_op, e);
|
{
|
||||||
if (!ctx) {
|
ctx = init_ctx(&keysize,
|
||||||
BIO_puts(bio_err, "Error initializing context\n");
|
*(++argv), keyform, key_type,
|
||||||
ERR_print_errors(bio_err);
|
passargin, pkey_op, e);
|
||||||
badarg = 1;
|
if (!ctx)
|
||||||
}
|
{
|
||||||
}
|
BIO_puts(bio_err,
|
||||||
} else if (!strcmp(*argv, "-peerkey")) {
|
"Error initializing context\n");
|
||||||
if (--argc < 1)
|
ERR_print_errors(bio_err);
|
||||||
badarg = 1;
|
badarg = 1;
|
||||||
else if (!setup_peer(bio_err, ctx, peerform, *(++argv)))
|
}
|
||||||
badarg = 1;
|
}
|
||||||
} else if (!strcmp(*argv, "-passin")) {
|
}
|
||||||
if (--argc < 1)
|
else if (!strcmp(*argv,"-peerkey"))
|
||||||
badarg = 1;
|
{
|
||||||
else
|
if (--argc < 1)
|
||||||
passargin = *(++argv);
|
badarg = 1;
|
||||||
} else if (strcmp(*argv, "-peerform") == 0) {
|
else if (!setup_peer(bio_err, ctx, peerform, *(++argv)))
|
||||||
if (--argc < 1)
|
badarg = 1;
|
||||||
badarg = 1;
|
}
|
||||||
else
|
else if (!strcmp(*argv,"-passin"))
|
||||||
peerform = str2fmt(*(++argv));
|
{
|
||||||
} else if (strcmp(*argv, "-keyform") == 0) {
|
if (--argc < 1) badarg = 1;
|
||||||
if (--argc < 1)
|
else passargin= *(++argv);
|
||||||
badarg = 1;
|
}
|
||||||
else
|
else if (strcmp(*argv,"-peerform") == 0)
|
||||||
keyform = str2fmt(*(++argv));
|
{
|
||||||
}
|
if (--argc < 1) badarg = 1;
|
||||||
|
else peerform=str2fmt(*(++argv));
|
||||||
|
}
|
||||||
|
else if (strcmp(*argv,"-keyform") == 0)
|
||||||
|
{
|
||||||
|
if (--argc < 1) badarg = 1;
|
||||||
|
else keyform=str2fmt(*(++argv));
|
||||||
|
}
|
||||||
#ifndef OPENSSL_NO_ENGINE
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
else if (!strcmp(*argv, "-engine")) {
|
else if(!strcmp(*argv, "-engine"))
|
||||||
if (--argc < 1)
|
{
|
||||||
badarg = 1;
|
if (--argc < 1)
|
||||||
else
|
badarg = 1;
|
||||||
e = setup_engine(bio_err, *(++argv), 0);
|
else
|
||||||
}
|
e = setup_engine(bio_err, *(++argv), 0);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
else if (!strcmp(*argv, "-pubin"))
|
else if(!strcmp(*argv, "-pubin"))
|
||||||
key_type = KEY_PUBKEY;
|
key_type = KEY_PUBKEY;
|
||||||
else if (!strcmp(*argv, "-certin"))
|
else if(!strcmp(*argv, "-certin"))
|
||||||
key_type = KEY_CERT;
|
key_type = KEY_CERT;
|
||||||
else if (!strcmp(*argv, "-asn1parse"))
|
else if(!strcmp(*argv, "-asn1parse"))
|
||||||
asn1parse = 1;
|
asn1parse = 1;
|
||||||
else if (!strcmp(*argv, "-hexdump"))
|
else if(!strcmp(*argv, "-hexdump"))
|
||||||
hexdump = 1;
|
hexdump = 1;
|
||||||
else if (!strcmp(*argv, "-sign"))
|
else if(!strcmp(*argv, "-sign"))
|
||||||
pkey_op = EVP_PKEY_OP_SIGN;
|
pkey_op = EVP_PKEY_OP_SIGN;
|
||||||
else if (!strcmp(*argv, "-verify"))
|
else if(!strcmp(*argv, "-verify"))
|
||||||
pkey_op = EVP_PKEY_OP_VERIFY;
|
pkey_op = EVP_PKEY_OP_VERIFY;
|
||||||
else if (!strcmp(*argv, "-verifyrecover"))
|
else if(!strcmp(*argv, "-verifyrecover"))
|
||||||
pkey_op = EVP_PKEY_OP_VERIFYRECOVER;
|
pkey_op = EVP_PKEY_OP_VERIFYRECOVER;
|
||||||
else if (!strcmp(*argv, "-rev"))
|
else if(!strcmp(*argv, "-rev"))
|
||||||
rev = 1;
|
rev = 1;
|
||||||
else if (!strcmp(*argv, "-encrypt"))
|
else if(!strcmp(*argv, "-encrypt"))
|
||||||
pkey_op = EVP_PKEY_OP_ENCRYPT;
|
pkey_op = EVP_PKEY_OP_ENCRYPT;
|
||||||
else if (!strcmp(*argv, "-decrypt"))
|
else if(!strcmp(*argv, "-decrypt"))
|
||||||
pkey_op = EVP_PKEY_OP_DECRYPT;
|
pkey_op = EVP_PKEY_OP_DECRYPT;
|
||||||
else if (!strcmp(*argv, "-derive"))
|
else if(!strcmp(*argv, "-derive"))
|
||||||
pkey_op = EVP_PKEY_OP_DERIVE;
|
pkey_op = EVP_PKEY_OP_DERIVE;
|
||||||
else if (strcmp(*argv, "-pkeyopt") == 0) {
|
else if (strcmp(*argv,"-pkeyopt") == 0)
|
||||||
if (--argc < 1)
|
{
|
||||||
badarg = 1;
|
if (--argc < 1)
|
||||||
else if (!ctx) {
|
badarg = 1;
|
||||||
BIO_puts(bio_err, "-pkeyopt command before -inkey\n");
|
else if (!ctx)
|
||||||
badarg = 1;
|
{
|
||||||
} else if (pkey_ctrl_string(ctx, *(++argv)) <= 0) {
|
BIO_puts(bio_err,
|
||||||
BIO_puts(bio_err, "parameter setting error\n");
|
"-pkeyopt command before -inkey\n");
|
||||||
ERR_print_errors(bio_err);
|
badarg = 1;
|
||||||
goto end;
|
}
|
||||||
}
|
else if (pkey_ctrl_string(ctx, *(++argv)) <= 0)
|
||||||
} else
|
{
|
||||||
badarg = 1;
|
BIO_puts(bio_err, "parameter setting error\n");
|
||||||
if (badarg) {
|
ERR_print_errors(bio_err);
|
||||||
usage();
|
goto end;
|
||||||
goto end;
|
}
|
||||||
}
|
}
|
||||||
argc--;
|
else badarg = 1;
|
||||||
argv++;
|
if(badarg)
|
||||||
}
|
{
|
||||||
|
usage();
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
argc--;
|
||||||
|
argv++;
|
||||||
|
}
|
||||||
|
|
||||||
if (!ctx) {
|
if (!ctx)
|
||||||
usage();
|
{
|
||||||
goto end;
|
usage();
|
||||||
}
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
if (sigfile && (pkey_op != EVP_PKEY_OP_VERIFY)) {
|
if (sigfile && (pkey_op != EVP_PKEY_OP_VERIFY))
|
||||||
BIO_puts(bio_err, "Signature file specified for non verify\n");
|
{
|
||||||
goto end;
|
BIO_puts(bio_err, "Signature file specified for non verify\n");
|
||||||
}
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
if (!sigfile && (pkey_op == EVP_PKEY_OP_VERIFY)) {
|
if (!sigfile && (pkey_op == EVP_PKEY_OP_VERIFY))
|
||||||
BIO_puts(bio_err, "No signature file specified for verify\n");
|
{
|
||||||
goto end;
|
BIO_puts(bio_err, "No signature file specified for verify\n");
|
||||||
}
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
/* FIXME: seed PRNG only if needed */
|
/* FIXME: seed PRNG only if needed */
|
||||||
app_RAND_load_file(NULL, bio_err, 0);
|
app_RAND_load_file(NULL, bio_err, 0);
|
||||||
|
|
||||||
if (pkey_op != EVP_PKEY_OP_DERIVE) {
|
if (pkey_op != EVP_PKEY_OP_DERIVE)
|
||||||
if (infile) {
|
{
|
||||||
if (!(in = BIO_new_file(infile, "rb"))) {
|
if(infile)
|
||||||
BIO_puts(bio_err, "Error Opening Input File\n");
|
{
|
||||||
ERR_print_errors(bio_err);
|
if(!(in = BIO_new_file(infile, "rb")))
|
||||||
goto end;
|
{
|
||||||
}
|
BIO_puts(bio_err,
|
||||||
} else
|
"Error Opening Input File\n");
|
||||||
in = BIO_new_fp(stdin, BIO_NOCLOSE);
|
ERR_print_errors(bio_err);
|
||||||
}
|
goto end;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
in = BIO_new_fp(stdin, BIO_NOCLOSE);
|
||||||
|
}
|
||||||
|
|
||||||
if (outfile) {
|
if(outfile)
|
||||||
if (!(out = BIO_new_file(outfile, "wb"))) {
|
{
|
||||||
BIO_printf(bio_err, "Error Creating Output File\n");
|
if(!(out = BIO_new_file(outfile, "wb")))
|
||||||
ERR_print_errors(bio_err);
|
{
|
||||||
goto end;
|
BIO_printf(bio_err, "Error Creating Output File\n");
|
||||||
}
|
ERR_print_errors(bio_err);
|
||||||
} else {
|
goto end;
|
||||||
out = BIO_new_fp(stdout, BIO_NOCLOSE);
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
out = BIO_new_fp(stdout, BIO_NOCLOSE);
|
||||||
#ifdef OPENSSL_SYS_VMS
|
#ifdef OPENSSL_SYS_VMS
|
||||||
{
|
{
|
||||||
BIO *tmpbio = BIO_new(BIO_f_linebuffer());
|
BIO *tmpbio = BIO_new(BIO_f_linebuffer());
|
||||||
out = BIO_push(tmpbio, out);
|
out = BIO_push(tmpbio, out);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sigfile) {
|
if (sigfile)
|
||||||
BIO *sigbio = BIO_new_file(sigfile, "rb");
|
{
|
||||||
if (!sigbio) {
|
BIO *sigbio = BIO_new_file(sigfile, "rb");
|
||||||
BIO_printf(bio_err, "Can't open signature file %s\n", sigfile);
|
if (!sigbio)
|
||||||
goto end;
|
{
|
||||||
}
|
BIO_printf(bio_err, "Can't open signature file %s\n",
|
||||||
siglen = bio_to_mem(&sig, keysize * 10, sigbio);
|
sigfile);
|
||||||
BIO_free(sigbio);
|
goto end;
|
||||||
if (siglen <= 0) {
|
}
|
||||||
BIO_printf(bio_err, "Error reading signature data\n");
|
siglen = bio_to_mem(&sig, keysize * 10, sigbio);
|
||||||
goto end;
|
BIO_free(sigbio);
|
||||||
}
|
if (siglen <= 0)
|
||||||
}
|
{
|
||||||
|
BIO_printf(bio_err, "Error reading signature data\n");
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (in) {
|
if (in)
|
||||||
/* Read the input data */
|
{
|
||||||
buf_inlen = bio_to_mem(&buf_in, keysize * 10, in);
|
/* Read the input data */
|
||||||
if (buf_inlen <= 0) {
|
buf_inlen = bio_to_mem(&buf_in, keysize * 10, in);
|
||||||
BIO_printf(bio_err, "Error reading input Data\n");
|
if(buf_inlen <= 0)
|
||||||
exit(1);
|
{
|
||||||
}
|
BIO_printf(bio_err, "Error reading input Data\n");
|
||||||
if (rev) {
|
exit(1);
|
||||||
size_t i;
|
}
|
||||||
unsigned char ctmp;
|
if(rev)
|
||||||
size_t l = (size_t)buf_inlen;
|
{
|
||||||
for (i = 0; i < l / 2; i++) {
|
size_t i;
|
||||||
ctmp = buf_in[i];
|
unsigned char ctmp;
|
||||||
buf_in[i] = buf_in[l - 1 - i];
|
size_t l = (size_t)buf_inlen;
|
||||||
buf_in[l - 1 - i] = ctmp;
|
for(i = 0; i < l/2; i++)
|
||||||
}
|
{
|
||||||
}
|
ctmp = buf_in[i];
|
||||||
}
|
buf_in[i] = buf_in[l - 1 - i];
|
||||||
|
buf_in[l - 1 - i] = ctmp;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (pkey_op == EVP_PKEY_OP_VERIFY) {
|
if(pkey_op == EVP_PKEY_OP_VERIFY)
|
||||||
rv = EVP_PKEY_verify(ctx, sig, (size_t)siglen,
|
{
|
||||||
buf_in, (size_t)buf_inlen);
|
rv = EVP_PKEY_verify(ctx, sig, (size_t)siglen,
|
||||||
if (rv == 0)
|
buf_in, (size_t)buf_inlen);
|
||||||
BIO_puts(out, "Signature Verification Failure\n");
|
if (rv == 0)
|
||||||
else if (rv == 1)
|
BIO_puts(out, "Signature Verification Failure\n");
|
||||||
BIO_puts(out, "Signature Verified Successfully\n");
|
else if (rv == 1)
|
||||||
if (rv >= 0)
|
BIO_puts(out, "Signature Verified Successfully\n");
|
||||||
goto end;
|
if (rv >= 0)
|
||||||
} else {
|
goto end;
|
||||||
rv = do_keyop(ctx, pkey_op, NULL, (size_t *)&buf_outlen,
|
}
|
||||||
buf_in, (size_t)buf_inlen);
|
else
|
||||||
if (rv > 0) {
|
{
|
||||||
buf_out = OPENSSL_malloc(buf_outlen);
|
rv = do_keyop(ctx, pkey_op, NULL, (size_t *)&buf_outlen,
|
||||||
if (!buf_out)
|
buf_in, (size_t)buf_inlen);
|
||||||
rv = -1;
|
if (rv > 0)
|
||||||
else
|
{
|
||||||
rv = do_keyop(ctx, pkey_op,
|
buf_out = OPENSSL_malloc(buf_outlen);
|
||||||
buf_out, (size_t *)&buf_outlen,
|
if (!buf_out)
|
||||||
buf_in, (size_t)buf_inlen);
|
rv = -1;
|
||||||
}
|
else
|
||||||
}
|
rv = do_keyop(ctx, pkey_op,
|
||||||
|
buf_out, (size_t *)&buf_outlen,
|
||||||
|
buf_in, (size_t)buf_inlen);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (rv <= 0) {
|
if(rv <= 0)
|
||||||
BIO_printf(bio_err, "Public Key operation error\n");
|
{
|
||||||
ERR_print_errors(bio_err);
|
BIO_printf(bio_err, "Public Key operation error\n");
|
||||||
goto end;
|
ERR_print_errors(bio_err);
|
||||||
}
|
goto end;
|
||||||
ret = 0;
|
}
|
||||||
if (asn1parse) {
|
ret = 0;
|
||||||
if (!ASN1_parse_dump(out, buf_out, buf_outlen, 1, -1))
|
if(asn1parse)
|
||||||
ERR_print_errors(bio_err);
|
{
|
||||||
} else if (hexdump)
|
if(!ASN1_parse_dump(out, buf_out, buf_outlen, 1, -1))
|
||||||
BIO_dump(out, (char *)buf_out, buf_outlen);
|
ERR_print_errors(bio_err);
|
||||||
else
|
}
|
||||||
BIO_write(out, buf_out, buf_outlen);
|
else if(hexdump)
|
||||||
|
BIO_dump(out, (char *)buf_out, buf_outlen);
|
||||||
|
else
|
||||||
|
BIO_write(out, buf_out, buf_outlen);
|
||||||
|
|
||||||
end:
|
end:
|
||||||
if (ctx)
|
if (ctx)
|
||||||
EVP_PKEY_CTX_free(ctx);
|
EVP_PKEY_CTX_free(ctx);
|
||||||
BIO_free(in);
|
BIO_free(in);
|
||||||
BIO_free_all(out);
|
BIO_free_all(out);
|
||||||
if (buf_in)
|
if (buf_in)
|
||||||
OPENSSL_free(buf_in);
|
OPENSSL_free(buf_in);
|
||||||
if (buf_out)
|
if (buf_out)
|
||||||
OPENSSL_free(buf_out);
|
OPENSSL_free(buf_out);
|
||||||
if (sig)
|
if (sig)
|
||||||
OPENSSL_free(sig);
|
OPENSSL_free(sig);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void usage()
|
static void usage()
|
||||||
{
|
{
|
||||||
BIO_printf(bio_err, "Usage: pkeyutl [options]\n");
|
BIO_printf(bio_err, "Usage: pkeyutl [options]\n");
|
||||||
BIO_printf(bio_err, "-in file input file\n");
|
BIO_printf(bio_err, "-in file input file\n");
|
||||||
BIO_printf(bio_err, "-out file output file\n");
|
BIO_printf(bio_err, "-out file output file\n");
|
||||||
BIO_printf(bio_err,
|
BIO_printf(bio_err, "-sigfile file signature file (verify operation only)\n");
|
||||||
"-sigfile file signature file (verify operation only)\n");
|
BIO_printf(bio_err, "-inkey file input key\n");
|
||||||
BIO_printf(bio_err, "-inkey file input key\n");
|
BIO_printf(bio_err, "-keyform arg private key format - default PEM\n");
|
||||||
BIO_printf(bio_err, "-keyform arg private key format - default PEM\n");
|
BIO_printf(bio_err, "-pubin input is a public key\n");
|
||||||
BIO_printf(bio_err, "-pubin input is a public key\n");
|
BIO_printf(bio_err, "-certin input is a certificate carrying a public key\n");
|
||||||
BIO_printf(bio_err,
|
BIO_printf(bio_err, "-pkeyopt X:Y public key options\n");
|
||||||
"-certin input is a certificate carrying a public key\n");
|
BIO_printf(bio_err, "-sign sign with private key\n");
|
||||||
BIO_printf(bio_err, "-pkeyopt X:Y public key options\n");
|
BIO_printf(bio_err, "-verify verify with public key\n");
|
||||||
BIO_printf(bio_err, "-sign sign with private key\n");
|
BIO_printf(bio_err, "-verifyrecover verify with public key, recover original data\n");
|
||||||
BIO_printf(bio_err, "-verify verify with public key\n");
|
BIO_printf(bio_err, "-encrypt encrypt with public key\n");
|
||||||
BIO_printf(bio_err,
|
BIO_printf(bio_err, "-decrypt decrypt with private key\n");
|
||||||
"-verifyrecover verify with public key, recover original data\n");
|
BIO_printf(bio_err, "-derive derive shared secret\n");
|
||||||
BIO_printf(bio_err, "-encrypt encrypt with public key\n");
|
BIO_printf(bio_err, "-hexdump hex dump output\n");
|
||||||
BIO_printf(bio_err, "-decrypt decrypt with private key\n");
|
|
||||||
BIO_printf(bio_err, "-derive derive shared secret\n");
|
|
||||||
BIO_printf(bio_err, "-hexdump hex dump output\n");
|
|
||||||
#ifndef OPENSSL_NO_ENGINE
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
BIO_printf(bio_err,
|
BIO_printf(bio_err, "-engine e use engine e, possibly a hardware device.\n");
|
||||||
"-engine e use engine e, possibly a hardware device.\n");
|
|
||||||
#endif
|
#endif
|
||||||
BIO_printf(bio_err, "-passin arg pass phrase source\n");
|
BIO_printf(bio_err, "-passin arg pass phrase source\n");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static EVP_PKEY_CTX *init_ctx(int *pkeysize,
|
static EVP_PKEY_CTX *init_ctx(int *pkeysize,
|
||||||
char *keyfile, int keyform, int key_type,
|
char *keyfile, int keyform, int key_type,
|
||||||
char *passargin, int pkey_op, ENGINE *e)
|
char *passargin, int pkey_op, ENGINE *e)
|
||||||
{
|
{
|
||||||
EVP_PKEY *pkey = NULL;
|
EVP_PKEY *pkey = NULL;
|
||||||
EVP_PKEY_CTX *ctx = NULL;
|
EVP_PKEY_CTX *ctx = NULL;
|
||||||
char *passin = NULL;
|
char *passin = NULL;
|
||||||
int rv = -1;
|
int rv = -1;
|
||||||
X509 *x;
|
X509 *x;
|
||||||
if (((pkey_op == EVP_PKEY_OP_SIGN) || (pkey_op == EVP_PKEY_OP_DECRYPT)
|
if(((pkey_op == EVP_PKEY_OP_SIGN) || (pkey_op == EVP_PKEY_OP_DECRYPT)
|
||||||
|| (pkey_op == EVP_PKEY_OP_DERIVE))
|
|| (pkey_op == EVP_PKEY_OP_DERIVE))
|
||||||
&& (key_type != KEY_PRIVKEY)) {
|
&& (key_type != KEY_PRIVKEY))
|
||||||
BIO_printf(bio_err, "A private key is needed for this operation\n");
|
{
|
||||||
goto end;
|
BIO_printf(bio_err, "A private key is needed for this operation\n");
|
||||||
}
|
goto end;
|
||||||
if (!app_passwd(bio_err, passargin, NULL, &passin, NULL)) {
|
}
|
||||||
BIO_printf(bio_err, "Error getting password\n");
|
if(!app_passwd(bio_err, passargin, NULL, &passin, NULL))
|
||||||
goto end;
|
{
|
||||||
}
|
BIO_printf(bio_err, "Error getting password\n");
|
||||||
switch (key_type) {
|
goto end;
|
||||||
case KEY_PRIVKEY:
|
}
|
||||||
pkey = load_key(bio_err, keyfile, keyform, 0,
|
switch(key_type)
|
||||||
passin, e, "Private Key");
|
{
|
||||||
break;
|
case KEY_PRIVKEY:
|
||||||
|
pkey = load_key(bio_err, keyfile, keyform, 0,
|
||||||
|
passin, e, "Private Key");
|
||||||
|
break;
|
||||||
|
|
||||||
case KEY_PUBKEY:
|
case KEY_PUBKEY:
|
||||||
pkey = load_pubkey(bio_err, keyfile, keyform, 0,
|
pkey = load_pubkey(bio_err, keyfile, keyform, 0,
|
||||||
NULL, e, "Public Key");
|
NULL, e, "Public Key");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case KEY_CERT:
|
case KEY_CERT:
|
||||||
x = load_cert(bio_err, keyfile, keyform, NULL, e, "Certificate");
|
x = load_cert(bio_err, keyfile, keyform,
|
||||||
if (x) {
|
NULL, e, "Certificate");
|
||||||
pkey = X509_get_pubkey(x);
|
if(x)
|
||||||
X509_free(x);
|
{
|
||||||
}
|
pkey = X509_get_pubkey(x);
|
||||||
break;
|
X509_free(x);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
*pkeysize = EVP_PKEY_size(pkey);
|
*pkeysize = EVP_PKEY_size(pkey);
|
||||||
|
|
||||||
if (!pkey)
|
if (!pkey)
|
||||||
goto end;
|
goto end;
|
||||||
|
|
||||||
ctx = EVP_PKEY_CTX_new(pkey, e);
|
ctx = EVP_PKEY_CTX_new(pkey, e);
|
||||||
|
|
||||||
EVP_PKEY_free(pkey);
|
EVP_PKEY_free(pkey);
|
||||||
|
|
||||||
if (!ctx)
|
if (!ctx)
|
||||||
goto end;
|
goto end;
|
||||||
|
|
||||||
switch (pkey_op) {
|
switch(pkey_op)
|
||||||
case EVP_PKEY_OP_SIGN:
|
{
|
||||||
rv = EVP_PKEY_sign_init(ctx);
|
case EVP_PKEY_OP_SIGN:
|
||||||
break;
|
rv = EVP_PKEY_sign_init(ctx);
|
||||||
|
break;
|
||||||
|
|
||||||
case EVP_PKEY_OP_VERIFY:
|
case EVP_PKEY_OP_VERIFY:
|
||||||
rv = EVP_PKEY_verify_init(ctx);
|
rv = EVP_PKEY_verify_init(ctx);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EVP_PKEY_OP_VERIFYRECOVER:
|
case EVP_PKEY_OP_VERIFYRECOVER:
|
||||||
rv = EVP_PKEY_verify_recover_init(ctx);
|
rv = EVP_PKEY_verify_recover_init(ctx);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EVP_PKEY_OP_ENCRYPT:
|
case EVP_PKEY_OP_ENCRYPT:
|
||||||
rv = EVP_PKEY_encrypt_init(ctx);
|
rv = EVP_PKEY_encrypt_init(ctx);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EVP_PKEY_OP_DECRYPT:
|
case EVP_PKEY_OP_DECRYPT:
|
||||||
rv = EVP_PKEY_decrypt_init(ctx);
|
rv = EVP_PKEY_decrypt_init(ctx);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EVP_PKEY_OP_DERIVE:
|
case EVP_PKEY_OP_DERIVE:
|
||||||
rv = EVP_PKEY_derive_init(ctx);
|
rv = EVP_PKEY_derive_init(ctx);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rv <= 0) {
|
if (rv <= 0)
|
||||||
EVP_PKEY_CTX_free(ctx);
|
{
|
||||||
ctx = NULL;
|
EVP_PKEY_CTX_free(ctx);
|
||||||
}
|
ctx = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
end:
|
end:
|
||||||
|
|
||||||
if (passin)
|
if (passin)
|
||||||
OPENSSL_free(passin);
|
OPENSSL_free(passin);
|
||||||
|
|
||||||
return ctx;
|
return ctx;
|
||||||
|
|
||||||
}
|
|
||||||
|
}
|
||||||
|
|
||||||
static int setup_peer(BIO *err, EVP_PKEY_CTX *ctx, int peerform,
|
static int setup_peer(BIO *err, EVP_PKEY_CTX *ctx, int peerform,
|
||||||
const char *file)
|
const char *file)
|
||||||
{
|
{
|
||||||
EVP_PKEY *peer = NULL;
|
EVP_PKEY *peer = NULL;
|
||||||
int ret;
|
int ret;
|
||||||
if (!ctx) {
|
if (!ctx)
|
||||||
BIO_puts(err, "-peerkey command before -inkey\n");
|
{
|
||||||
return 0;
|
BIO_puts(err, "-peerkey command before -inkey\n");
|
||||||
}
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
peer = load_pubkey(bio_err, file, peerform, 0, NULL, NULL, "Peer Key");
|
peer = load_pubkey(bio_err, file, peerform, 0, NULL, NULL, "Peer Key");
|
||||||
|
|
||||||
if (!peer) {
|
if (!peer)
|
||||||
BIO_printf(bio_err, "Error reading peer key %s\n", file);
|
{
|
||||||
ERR_print_errors(err);
|
BIO_printf(bio_err, "Error reading peer key %s\n", file);
|
||||||
return 0;
|
ERR_print_errors(err);
|
||||||
}
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
ret = EVP_PKEY_derive_set_peer(ctx, peer);
|
ret = EVP_PKEY_derive_set_peer(ctx, peer);
|
||||||
|
|
||||||
EVP_PKEY_free(peer);
|
EVP_PKEY_free(peer);
|
||||||
if (ret <= 0)
|
if (ret <= 0)
|
||||||
ERR_print_errors(err);
|
ERR_print_errors(err);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int do_keyop(EVP_PKEY_CTX *ctx, int pkey_op,
|
static int do_keyop(EVP_PKEY_CTX *ctx, int pkey_op,
|
||||||
unsigned char *out, size_t *poutlen,
|
unsigned char *out, size_t *poutlen,
|
||||||
unsigned char *in, size_t inlen)
|
unsigned char *in, size_t inlen)
|
||||||
{
|
{
|
||||||
int rv = 0;
|
int rv = 0;
|
||||||
switch (pkey_op) {
|
switch(pkey_op)
|
||||||
case EVP_PKEY_OP_VERIFYRECOVER:
|
{
|
||||||
rv = EVP_PKEY_verify_recover(ctx, out, poutlen, in, inlen);
|
case EVP_PKEY_OP_VERIFYRECOVER:
|
||||||
break;
|
rv = EVP_PKEY_verify_recover(ctx, out, poutlen, in, inlen);
|
||||||
|
break;
|
||||||
|
|
||||||
case EVP_PKEY_OP_SIGN:
|
case EVP_PKEY_OP_SIGN:
|
||||||
rv = EVP_PKEY_sign(ctx, out, poutlen, in, inlen);
|
rv = EVP_PKEY_sign(ctx, out, poutlen, in, inlen);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EVP_PKEY_OP_ENCRYPT:
|
case EVP_PKEY_OP_ENCRYPT:
|
||||||
rv = EVP_PKEY_encrypt(ctx, out, poutlen, in, inlen);
|
rv = EVP_PKEY_encrypt(ctx, out, poutlen, in, inlen);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EVP_PKEY_OP_DECRYPT:
|
case EVP_PKEY_OP_DECRYPT:
|
||||||
rv = EVP_PKEY_decrypt(ctx, out, poutlen, in, inlen);
|
rv = EVP_PKEY_decrypt(ctx, out, poutlen, in, inlen);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EVP_PKEY_OP_DERIVE:
|
case EVP_PKEY_OP_DERIVE:
|
||||||
rv = EVP_PKEY_derive(ctx, out, poutlen);
|
rv = EVP_PKEY_derive(ctx, out, poutlen);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|||||||
147
apps/prime.c
147
apps/prime.c
@@ -52,100 +52,109 @@
|
|||||||
#include "apps.h"
|
#include "apps.h"
|
||||||
#include <openssl/bn.h>
|
#include <openssl/bn.h>
|
||||||
|
|
||||||
|
|
||||||
#undef PROG
|
#undef PROG
|
||||||
#define PROG prime_main
|
#define PROG prime_main
|
||||||
|
|
||||||
int MAIN(int, char **);
|
int MAIN(int, char **);
|
||||||
|
|
||||||
int MAIN(int argc, char **argv)
|
int MAIN(int argc, char **argv)
|
||||||
{
|
{
|
||||||
int hex = 0;
|
int hex=0;
|
||||||
int checks = 20;
|
int checks=20;
|
||||||
int generate = 0;
|
int generate=0;
|
||||||
int bits = 0;
|
int bits=0;
|
||||||
int safe = 0;
|
int safe=0;
|
||||||
BIGNUM *bn = NULL;
|
BIGNUM *bn=NULL;
|
||||||
BIO *bio_out;
|
BIO *bio_out;
|
||||||
|
|
||||||
apps_startup();
|
apps_startup();
|
||||||
|
|
||||||
if (bio_err == NULL)
|
if (bio_err == NULL)
|
||||||
if ((bio_err = BIO_new(BIO_s_file())) != NULL)
|
if ((bio_err=BIO_new(BIO_s_file())) != NULL)
|
||||||
BIO_set_fp(bio_err, stderr, BIO_NOCLOSE | BIO_FP_TEXT);
|
BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT);
|
||||||
|
|
||||||
--argc;
|
--argc;
|
||||||
++argv;
|
++argv;
|
||||||
while (argc >= 1 && **argv == '-') {
|
while (argc >= 1 && **argv == '-')
|
||||||
if (!strcmp(*argv, "-hex"))
|
{
|
||||||
hex = 1;
|
if(!strcmp(*argv,"-hex"))
|
||||||
else if (!strcmp(*argv, "-generate"))
|
hex=1;
|
||||||
generate = 1;
|
else if(!strcmp(*argv,"-generate"))
|
||||||
else if (!strcmp(*argv, "-bits"))
|
generate=1;
|
||||||
if (--argc < 1)
|
else if(!strcmp(*argv,"-bits"))
|
||||||
goto bad;
|
if(--argc < 1)
|
||||||
else
|
goto bad;
|
||||||
bits = atoi(*++argv);
|
else
|
||||||
else if (!strcmp(*argv, "-safe"))
|
bits=atoi(*++argv);
|
||||||
safe = 1;
|
else if(!strcmp(*argv,"-safe"))
|
||||||
else if (!strcmp(*argv, "-checks"))
|
safe=1;
|
||||||
if (--argc < 1)
|
else if(!strcmp(*argv,"-checks"))
|
||||||
goto bad;
|
if(--argc < 1)
|
||||||
else
|
goto bad;
|
||||||
checks = atoi(*++argv);
|
else
|
||||||
else {
|
checks=atoi(*++argv);
|
||||||
BIO_printf(bio_err, "Unknown option '%s'\n", *argv);
|
else
|
||||||
goto bad;
|
{
|
||||||
}
|
BIO_printf(bio_err,"Unknown option '%s'\n",*argv);
|
||||||
--argc;
|
goto bad;
|
||||||
++argv;
|
}
|
||||||
}
|
--argc;
|
||||||
|
++argv;
|
||||||
|
}
|
||||||
|
|
||||||
if (argv[0] == NULL && !generate) {
|
if (argv[0] == NULL && !generate)
|
||||||
BIO_printf(bio_err, "No prime specified\n");
|
{
|
||||||
goto bad;
|
BIO_printf(bio_err,"No prime specified\n");
|
||||||
}
|
goto bad;
|
||||||
|
}
|
||||||
|
|
||||||
if ((bio_out = BIO_new(BIO_s_file())) != NULL) {
|
if ((bio_out=BIO_new(BIO_s_file())) != NULL)
|
||||||
BIO_set_fp(bio_out, stdout, BIO_NOCLOSE);
|
{
|
||||||
|
BIO_set_fp(bio_out,stdout,BIO_NOCLOSE);
|
||||||
#ifdef OPENSSL_SYS_VMS
|
#ifdef OPENSSL_SYS_VMS
|
||||||
{
|
{
|
||||||
BIO *tmpbio = BIO_new(BIO_f_linebuffer());
|
BIO *tmpbio = BIO_new(BIO_f_linebuffer());
|
||||||
bio_out = BIO_push(tmpbio, bio_out);
|
bio_out = BIO_push(tmpbio, bio_out);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
if (generate) {
|
if(generate)
|
||||||
char *s;
|
{
|
||||||
|
char *s;
|
||||||
|
|
||||||
if (!bits) {
|
if(!bits)
|
||||||
BIO_printf(bio_err, "Specifiy the number of bits.\n");
|
{
|
||||||
return 1;
|
BIO_printf(bio_err,"Specifiy the number of bits.\n");
|
||||||
}
|
return 1;
|
||||||
bn = BN_new();
|
}
|
||||||
BN_generate_prime_ex(bn, bits, safe, NULL, NULL, NULL);
|
bn=BN_new();
|
||||||
s = hex ? BN_bn2hex(bn) : BN_bn2dec(bn);
|
BN_generate_prime_ex(bn,bits,safe,NULL,NULL,NULL);
|
||||||
BIO_printf(bio_out, "%s\n", s);
|
s=hex ? BN_bn2hex(bn) : BN_bn2dec(bn);
|
||||||
OPENSSL_free(s);
|
BIO_printf(bio_out,"%s\n",s);
|
||||||
} else {
|
OPENSSL_free(s);
|
||||||
if (hex)
|
}
|
||||||
BN_hex2bn(&bn, argv[0]);
|
else
|
||||||
else
|
{
|
||||||
BN_dec2bn(&bn, argv[0]);
|
if(hex)
|
||||||
|
BN_hex2bn(&bn,argv[0]);
|
||||||
|
else
|
||||||
|
BN_dec2bn(&bn,argv[0]);
|
||||||
|
|
||||||
BN_print(bio_out, bn);
|
BN_print(bio_out,bn);
|
||||||
BIO_printf(bio_out, " is %sprime\n",
|
BIO_printf(bio_out," is %sprime\n",
|
||||||
BN_is_prime_ex(bn, checks, NULL, NULL) ? "" : "not ");
|
BN_is_prime_ex(bn,checks,NULL,NULL) ? "" : "not ");
|
||||||
}
|
}
|
||||||
|
|
||||||
BN_free(bn);
|
BN_free(bn);
|
||||||
BIO_free_all(bio_out);
|
BIO_free_all(bio_out);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
bad:
|
bad:
|
||||||
BIO_printf(bio_err, "options are\n");
|
BIO_printf(bio_err,"options are\n");
|
||||||
BIO_printf(bio_err, "%-14s hex\n", "-hex");
|
BIO_printf(bio_err,"%-14s hex\n","-hex");
|
||||||
BIO_printf(bio_err, "%-14s number of checks\n", "-checks <n>");
|
BIO_printf(bio_err,"%-14s number of checks\n","-checks <n>");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|||||||
358
apps/progs.h
358
apps/progs.h
@@ -1,366 +1,362 @@
|
|||||||
/* apps/progs.h */
|
/* apps/progs.h */
|
||||||
/* automatically generated by progs.pl for openssl.c */
|
/* automatically generated by progs.pl for openssl.c */
|
||||||
|
|
||||||
extern int verify_main(int argc, char *argv[]);
|
extern int verify_main(int argc,char *argv[]);
|
||||||
extern int asn1parse_main(int argc, char *argv[]);
|
extern int asn1parse_main(int argc,char *argv[]);
|
||||||
extern int req_main(int argc, char *argv[]);
|
extern int req_main(int argc,char *argv[]);
|
||||||
extern int dgst_main(int argc, char *argv[]);
|
extern int dgst_main(int argc,char *argv[]);
|
||||||
extern int dh_main(int argc, char *argv[]);
|
extern int dh_main(int argc,char *argv[]);
|
||||||
extern int dhparam_main(int argc, char *argv[]);
|
extern int dhparam_main(int argc,char *argv[]);
|
||||||
extern int enc_main(int argc, char *argv[]);
|
extern int enc_main(int argc,char *argv[]);
|
||||||
extern int passwd_main(int argc, char *argv[]);
|
extern int passwd_main(int argc,char *argv[]);
|
||||||
extern int gendh_main(int argc, char *argv[]);
|
extern int gendh_main(int argc,char *argv[]);
|
||||||
extern int errstr_main(int argc, char *argv[]);
|
extern int errstr_main(int argc,char *argv[]);
|
||||||
extern int ca_main(int argc, char *argv[]);
|
extern int ca_main(int argc,char *argv[]);
|
||||||
extern int crl_main(int argc, char *argv[]);
|
extern int crl_main(int argc,char *argv[]);
|
||||||
extern int rsa_main(int argc, char *argv[]);
|
extern int rsa_main(int argc,char *argv[]);
|
||||||
extern int rsautl_main(int argc, char *argv[]);
|
extern int rsautl_main(int argc,char *argv[]);
|
||||||
extern int dsa_main(int argc, char *argv[]);
|
extern int dsa_main(int argc,char *argv[]);
|
||||||
extern int dsaparam_main(int argc, char *argv[]);
|
extern int dsaparam_main(int argc,char *argv[]);
|
||||||
extern int ec_main(int argc, char *argv[]);
|
extern int ec_main(int argc,char *argv[]);
|
||||||
extern int ecparam_main(int argc, char *argv[]);
|
extern int ecparam_main(int argc,char *argv[]);
|
||||||
extern int x509_main(int argc, char *argv[]);
|
extern int x509_main(int argc,char *argv[]);
|
||||||
extern int genrsa_main(int argc, char *argv[]);
|
extern int genrsa_main(int argc,char *argv[]);
|
||||||
extern int gendsa_main(int argc, char *argv[]);
|
extern int gendsa_main(int argc,char *argv[]);
|
||||||
extern int genpkey_main(int argc, char *argv[]);
|
extern int genpkey_main(int argc,char *argv[]);
|
||||||
extern int s_server_main(int argc, char *argv[]);
|
extern int s_server_main(int argc,char *argv[]);
|
||||||
extern int s_client_main(int argc, char *argv[]);
|
extern int s_client_main(int argc,char *argv[]);
|
||||||
extern int speed_main(int argc, char *argv[]);
|
extern int speed_main(int argc,char *argv[]);
|
||||||
extern int s_time_main(int argc, char *argv[]);
|
extern int s_time_main(int argc,char *argv[]);
|
||||||
extern int version_main(int argc, char *argv[]);
|
extern int version_main(int argc,char *argv[]);
|
||||||
extern int pkcs7_main(int argc, char *argv[]);
|
extern int pkcs7_main(int argc,char *argv[]);
|
||||||
extern int cms_main(int argc, char *argv[]);
|
extern int cms_main(int argc,char *argv[]);
|
||||||
extern int crl2pkcs7_main(int argc, char *argv[]);
|
extern int crl2pkcs7_main(int argc,char *argv[]);
|
||||||
extern int sess_id_main(int argc, char *argv[]);
|
extern int sess_id_main(int argc,char *argv[]);
|
||||||
extern int ciphers_main(int argc, char *argv[]);
|
extern int ciphers_main(int argc,char *argv[]);
|
||||||
extern int nseq_main(int argc, char *argv[]);
|
extern int nseq_main(int argc,char *argv[]);
|
||||||
extern int pkcs12_main(int argc, char *argv[]);
|
extern int pkcs12_main(int argc,char *argv[]);
|
||||||
extern int pkcs8_main(int argc, char *argv[]);
|
extern int pkcs8_main(int argc,char *argv[]);
|
||||||
extern int pkey_main(int argc, char *argv[]);
|
extern int pkey_main(int argc,char *argv[]);
|
||||||
extern int pkeyparam_main(int argc, char *argv[]);
|
extern int pkeyparam_main(int argc,char *argv[]);
|
||||||
extern int pkeyutl_main(int argc, char *argv[]);
|
extern int pkeyutl_main(int argc,char *argv[]);
|
||||||
extern int spkac_main(int argc, char *argv[]);
|
extern int spkac_main(int argc,char *argv[]);
|
||||||
extern int smime_main(int argc, char *argv[]);
|
extern int smime_main(int argc,char *argv[]);
|
||||||
extern int rand_main(int argc, char *argv[]);
|
extern int rand_main(int argc,char *argv[]);
|
||||||
extern int engine_main(int argc, char *argv[]);
|
extern int engine_main(int argc,char *argv[]);
|
||||||
extern int ocsp_main(int argc, char *argv[]);
|
extern int ocsp_main(int argc,char *argv[]);
|
||||||
extern int prime_main(int argc, char *argv[]);
|
extern int prime_main(int argc,char *argv[]);
|
||||||
extern int ts_main(int argc, char *argv[]);
|
extern int ts_main(int argc,char *argv[]);
|
||||||
extern int srp_main(int argc, char *argv[]);
|
|
||||||
|
|
||||||
#define FUNC_TYPE_GENERAL 1
|
#define FUNC_TYPE_GENERAL 1
|
||||||
#define FUNC_TYPE_MD 2
|
#define FUNC_TYPE_MD 2
|
||||||
#define FUNC_TYPE_CIPHER 3
|
#define FUNC_TYPE_CIPHER 3
|
||||||
#define FUNC_TYPE_PKEY 4
|
#define FUNC_TYPE_PKEY 4
|
||||||
#define FUNC_TYPE_MD_ALG 5
|
#define FUNC_TYPE_MD_ALG 5
|
||||||
#define FUNC_TYPE_CIPHER_ALG 6
|
#define FUNC_TYPE_CIPHER_ALG 6
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
int type;
|
int type;
|
||||||
const char *name;
|
const char *name;
|
||||||
int (*func) (int argc, char *argv[]);
|
int (*func)(int argc,char *argv[]);
|
||||||
} FUNCTION;
|
} FUNCTION;
|
||||||
DECLARE_LHASH_OF(FUNCTION);
|
DECLARE_LHASH_OF(FUNCTION);
|
||||||
|
|
||||||
FUNCTION functions[] = {
|
FUNCTION functions[] = {
|
||||||
{FUNC_TYPE_GENERAL, "verify", verify_main},
|
{FUNC_TYPE_GENERAL,"verify",verify_main},
|
||||||
{FUNC_TYPE_GENERAL, "asn1parse", asn1parse_main},
|
{FUNC_TYPE_GENERAL,"asn1parse",asn1parse_main},
|
||||||
{FUNC_TYPE_GENERAL, "req", req_main},
|
{FUNC_TYPE_GENERAL,"req",req_main},
|
||||||
{FUNC_TYPE_GENERAL, "dgst", dgst_main},
|
{FUNC_TYPE_GENERAL,"dgst",dgst_main},
|
||||||
#ifndef OPENSSL_NO_DH
|
#ifndef OPENSSL_NO_DH
|
||||||
{FUNC_TYPE_GENERAL, "dh", dh_main},
|
{FUNC_TYPE_GENERAL,"dh",dh_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef OPENSSL_NO_DH
|
#ifndef OPENSSL_NO_DH
|
||||||
{FUNC_TYPE_GENERAL, "dhparam", dhparam_main},
|
{FUNC_TYPE_GENERAL,"dhparam",dhparam_main},
|
||||||
#endif
|
#endif
|
||||||
{FUNC_TYPE_GENERAL, "enc", enc_main},
|
{FUNC_TYPE_GENERAL,"enc",enc_main},
|
||||||
{FUNC_TYPE_GENERAL, "passwd", passwd_main},
|
{FUNC_TYPE_GENERAL,"passwd",passwd_main},
|
||||||
#ifndef OPENSSL_NO_DH
|
#ifndef OPENSSL_NO_DH
|
||||||
{FUNC_TYPE_GENERAL, "gendh", gendh_main},
|
{FUNC_TYPE_GENERAL,"gendh",gendh_main},
|
||||||
#endif
|
#endif
|
||||||
{FUNC_TYPE_GENERAL, "errstr", errstr_main},
|
{FUNC_TYPE_GENERAL,"errstr",errstr_main},
|
||||||
{FUNC_TYPE_GENERAL, "ca", ca_main},
|
{FUNC_TYPE_GENERAL,"ca",ca_main},
|
||||||
{FUNC_TYPE_GENERAL, "crl", crl_main},
|
{FUNC_TYPE_GENERAL,"crl",crl_main},
|
||||||
#ifndef OPENSSL_NO_RSA
|
#ifndef OPENSSL_NO_RSA
|
||||||
{FUNC_TYPE_GENERAL, "rsa", rsa_main},
|
{FUNC_TYPE_GENERAL,"rsa",rsa_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef OPENSSL_NO_RSA
|
#ifndef OPENSSL_NO_RSA
|
||||||
{FUNC_TYPE_GENERAL, "rsautl", rsautl_main},
|
{FUNC_TYPE_GENERAL,"rsautl",rsautl_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef OPENSSL_NO_DSA
|
#ifndef OPENSSL_NO_DSA
|
||||||
{FUNC_TYPE_GENERAL, "dsa", dsa_main},
|
{FUNC_TYPE_GENERAL,"dsa",dsa_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef OPENSSL_NO_DSA
|
#ifndef OPENSSL_NO_DSA
|
||||||
{FUNC_TYPE_GENERAL, "dsaparam", dsaparam_main},
|
{FUNC_TYPE_GENERAL,"dsaparam",dsaparam_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef OPENSSL_NO_EC
|
#ifndef OPENSSL_NO_EC
|
||||||
{FUNC_TYPE_GENERAL, "ec", ec_main},
|
{FUNC_TYPE_GENERAL,"ec",ec_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef OPENSSL_NO_EC
|
#ifndef OPENSSL_NO_EC
|
||||||
{FUNC_TYPE_GENERAL, "ecparam", ecparam_main},
|
{FUNC_TYPE_GENERAL,"ecparam",ecparam_main},
|
||||||
#endif
|
#endif
|
||||||
{FUNC_TYPE_GENERAL, "x509", x509_main},
|
{FUNC_TYPE_GENERAL,"x509",x509_main},
|
||||||
#ifndef OPENSSL_NO_RSA
|
#ifndef OPENSSL_NO_RSA
|
||||||
{FUNC_TYPE_GENERAL, "genrsa", genrsa_main},
|
{FUNC_TYPE_GENERAL,"genrsa",genrsa_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef OPENSSL_NO_DSA
|
#ifndef OPENSSL_NO_DSA
|
||||||
{FUNC_TYPE_GENERAL, "gendsa", gendsa_main},
|
{FUNC_TYPE_GENERAL,"gendsa",gendsa_main},
|
||||||
#endif
|
#endif
|
||||||
{FUNC_TYPE_GENERAL, "genpkey", genpkey_main},
|
{FUNC_TYPE_GENERAL,"genpkey",genpkey_main},
|
||||||
#if !defined(OPENSSL_NO_SOCK)
|
#if !defined(OPENSSL_NO_SOCK) && !(defined(OPENSSL_NO_SSL2) && defined(OPENSSL_NO_SSL3))
|
||||||
{FUNC_TYPE_GENERAL, "s_server", s_server_main},
|
{FUNC_TYPE_GENERAL,"s_server",s_server_main},
|
||||||
#endif
|
#endif
|
||||||
#if !defined(OPENSSL_NO_SOCK)
|
#if !defined(OPENSSL_NO_SOCK) && !(defined(OPENSSL_NO_SSL2) && defined(OPENSSL_NO_SSL3))
|
||||||
{FUNC_TYPE_GENERAL, "s_client", s_client_main},
|
{FUNC_TYPE_GENERAL,"s_client",s_client_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef OPENSSL_NO_SPEED
|
#ifndef OPENSSL_NO_SPEED
|
||||||
{FUNC_TYPE_GENERAL, "speed", speed_main},
|
{FUNC_TYPE_GENERAL,"speed",speed_main},
|
||||||
#endif
|
#endif
|
||||||
#if !defined(OPENSSL_NO_SOCK)
|
#if !defined(OPENSSL_NO_SOCK) && !(defined(OPENSSL_NO_SSL2) && defined(OPENSSL_NO_SSL3))
|
||||||
{FUNC_TYPE_GENERAL, "s_time", s_time_main},
|
{FUNC_TYPE_GENERAL,"s_time",s_time_main},
|
||||||
#endif
|
#endif
|
||||||
{FUNC_TYPE_GENERAL, "version", version_main},
|
{FUNC_TYPE_GENERAL,"version",version_main},
|
||||||
{FUNC_TYPE_GENERAL, "pkcs7", pkcs7_main},
|
{FUNC_TYPE_GENERAL,"pkcs7",pkcs7_main},
|
||||||
#ifndef OPENSSL_NO_CMS
|
#ifndef OPENSSL_NO_CMS
|
||||||
{FUNC_TYPE_GENERAL, "cms", cms_main},
|
{FUNC_TYPE_GENERAL,"cms",cms_main},
|
||||||
#endif
|
#endif
|
||||||
{FUNC_TYPE_GENERAL, "crl2pkcs7", crl2pkcs7_main},
|
{FUNC_TYPE_GENERAL,"crl2pkcs7",crl2pkcs7_main},
|
||||||
{FUNC_TYPE_GENERAL, "sess_id", sess_id_main},
|
{FUNC_TYPE_GENERAL,"sess_id",sess_id_main},
|
||||||
#if !defined(OPENSSL_NO_SOCK)
|
#if !defined(OPENSSL_NO_SOCK) && !(defined(OPENSSL_NO_SSL2) && defined(OPENSSL_NO_SSL3))
|
||||||
{FUNC_TYPE_GENERAL, "ciphers", ciphers_main},
|
{FUNC_TYPE_GENERAL,"ciphers",ciphers_main},
|
||||||
#endif
|
#endif
|
||||||
{FUNC_TYPE_GENERAL, "nseq", nseq_main},
|
{FUNC_TYPE_GENERAL,"nseq",nseq_main},
|
||||||
#if !defined(OPENSSL_NO_DES) && !defined(OPENSSL_NO_SHA1)
|
#if !defined(OPENSSL_NO_DES) && !defined(OPENSSL_NO_SHA1)
|
||||||
{FUNC_TYPE_GENERAL, "pkcs12", pkcs12_main},
|
{FUNC_TYPE_GENERAL,"pkcs12",pkcs12_main},
|
||||||
#endif
|
#endif
|
||||||
{FUNC_TYPE_GENERAL, "pkcs8", pkcs8_main},
|
{FUNC_TYPE_GENERAL,"pkcs8",pkcs8_main},
|
||||||
{FUNC_TYPE_GENERAL, "pkey", pkey_main},
|
{FUNC_TYPE_GENERAL,"pkey",pkey_main},
|
||||||
{FUNC_TYPE_GENERAL, "pkeyparam", pkeyparam_main},
|
{FUNC_TYPE_GENERAL,"pkeyparam",pkeyparam_main},
|
||||||
{FUNC_TYPE_GENERAL, "pkeyutl", pkeyutl_main},
|
{FUNC_TYPE_GENERAL,"pkeyutl",pkeyutl_main},
|
||||||
{FUNC_TYPE_GENERAL, "spkac", spkac_main},
|
{FUNC_TYPE_GENERAL,"spkac",spkac_main},
|
||||||
{FUNC_TYPE_GENERAL, "smime", smime_main},
|
{FUNC_TYPE_GENERAL,"smime",smime_main},
|
||||||
{FUNC_TYPE_GENERAL, "rand", rand_main},
|
{FUNC_TYPE_GENERAL,"rand",rand_main},
|
||||||
#ifndef OPENSSL_NO_ENGINE
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
{FUNC_TYPE_GENERAL, "engine", engine_main},
|
{FUNC_TYPE_GENERAL,"engine",engine_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef OPENSSL_NO_OCSP
|
#ifndef OPENSSL_NO_OCSP
|
||||||
{FUNC_TYPE_GENERAL, "ocsp", ocsp_main},
|
{FUNC_TYPE_GENERAL,"ocsp",ocsp_main},
|
||||||
#endif
|
|
||||||
{FUNC_TYPE_GENERAL, "prime", prime_main},
|
|
||||||
{FUNC_TYPE_GENERAL, "ts", ts_main},
|
|
||||||
#ifndef OPENSSL_NO_SRP
|
|
||||||
{FUNC_TYPE_GENERAL, "srp", srp_main},
|
|
||||||
#endif
|
#endif
|
||||||
|
{FUNC_TYPE_GENERAL,"prime",prime_main},
|
||||||
|
{FUNC_TYPE_GENERAL,"ts",ts_main},
|
||||||
#ifndef OPENSSL_NO_MD2
|
#ifndef OPENSSL_NO_MD2
|
||||||
{FUNC_TYPE_MD, "md2", dgst_main},
|
{FUNC_TYPE_MD,"md2",dgst_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef OPENSSL_NO_MD4
|
#ifndef OPENSSL_NO_MD4
|
||||||
{FUNC_TYPE_MD, "md4", dgst_main},
|
{FUNC_TYPE_MD,"md4",dgst_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef OPENSSL_NO_MD5
|
#ifndef OPENSSL_NO_MD5
|
||||||
{FUNC_TYPE_MD, "md5", dgst_main},
|
{FUNC_TYPE_MD,"md5",dgst_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef OPENSSL_NO_SHA
|
#ifndef OPENSSL_NO_SHA
|
||||||
{FUNC_TYPE_MD, "sha", dgst_main},
|
{FUNC_TYPE_MD,"sha",dgst_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef OPENSSL_NO_SHA1
|
#ifndef OPENSSL_NO_SHA1
|
||||||
{FUNC_TYPE_MD, "sha1", dgst_main},
|
{FUNC_TYPE_MD,"sha1",dgst_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef OPENSSL_NO_MDC2
|
#ifndef OPENSSL_NO_MDC2
|
||||||
{FUNC_TYPE_MD, "mdc2", dgst_main},
|
{FUNC_TYPE_MD,"mdc2",dgst_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef OPENSSL_NO_RMD160
|
#ifndef OPENSSL_NO_RMD160
|
||||||
{FUNC_TYPE_MD, "rmd160", dgst_main},
|
{FUNC_TYPE_MD,"rmd160",dgst_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef OPENSSL_NO_AES
|
#ifndef OPENSSL_NO_AES
|
||||||
{FUNC_TYPE_CIPHER, "aes-128-cbc", enc_main},
|
{FUNC_TYPE_CIPHER,"aes-128-cbc",enc_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef OPENSSL_NO_AES
|
#ifndef OPENSSL_NO_AES
|
||||||
{FUNC_TYPE_CIPHER, "aes-128-ecb", enc_main},
|
{FUNC_TYPE_CIPHER,"aes-128-ecb",enc_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef OPENSSL_NO_AES
|
#ifndef OPENSSL_NO_AES
|
||||||
{FUNC_TYPE_CIPHER, "aes-192-cbc", enc_main},
|
{FUNC_TYPE_CIPHER,"aes-192-cbc",enc_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef OPENSSL_NO_AES
|
#ifndef OPENSSL_NO_AES
|
||||||
{FUNC_TYPE_CIPHER, "aes-192-ecb", enc_main},
|
{FUNC_TYPE_CIPHER,"aes-192-ecb",enc_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef OPENSSL_NO_AES
|
#ifndef OPENSSL_NO_AES
|
||||||
{FUNC_TYPE_CIPHER, "aes-256-cbc", enc_main},
|
{FUNC_TYPE_CIPHER,"aes-256-cbc",enc_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef OPENSSL_NO_AES
|
#ifndef OPENSSL_NO_AES
|
||||||
{FUNC_TYPE_CIPHER, "aes-256-ecb", enc_main},
|
{FUNC_TYPE_CIPHER,"aes-256-ecb",enc_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef OPENSSL_NO_CAMELLIA
|
#ifndef OPENSSL_NO_CAMELLIA
|
||||||
{FUNC_TYPE_CIPHER, "camellia-128-cbc", enc_main},
|
{FUNC_TYPE_CIPHER,"camellia-128-cbc",enc_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef OPENSSL_NO_CAMELLIA
|
#ifndef OPENSSL_NO_CAMELLIA
|
||||||
{FUNC_TYPE_CIPHER, "camellia-128-ecb", enc_main},
|
{FUNC_TYPE_CIPHER,"camellia-128-ecb",enc_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef OPENSSL_NO_CAMELLIA
|
#ifndef OPENSSL_NO_CAMELLIA
|
||||||
{FUNC_TYPE_CIPHER, "camellia-192-cbc", enc_main},
|
{FUNC_TYPE_CIPHER,"camellia-192-cbc",enc_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef OPENSSL_NO_CAMELLIA
|
#ifndef OPENSSL_NO_CAMELLIA
|
||||||
{FUNC_TYPE_CIPHER, "camellia-192-ecb", enc_main},
|
{FUNC_TYPE_CIPHER,"camellia-192-ecb",enc_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef OPENSSL_NO_CAMELLIA
|
#ifndef OPENSSL_NO_CAMELLIA
|
||||||
{FUNC_TYPE_CIPHER, "camellia-256-cbc", enc_main},
|
{FUNC_TYPE_CIPHER,"camellia-256-cbc",enc_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef OPENSSL_NO_CAMELLIA
|
#ifndef OPENSSL_NO_CAMELLIA
|
||||||
{FUNC_TYPE_CIPHER, "camellia-256-ecb", enc_main},
|
{FUNC_TYPE_CIPHER,"camellia-256-ecb",enc_main},
|
||||||
#endif
|
#endif
|
||||||
{FUNC_TYPE_CIPHER, "base64", enc_main},
|
{FUNC_TYPE_CIPHER,"base64",enc_main},
|
||||||
#ifdef ZLIB
|
#ifdef ZLIB
|
||||||
{FUNC_TYPE_CIPHER, "zlib", enc_main},
|
{FUNC_TYPE_CIPHER,"zlib",enc_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef OPENSSL_NO_DES
|
#ifndef OPENSSL_NO_DES
|
||||||
{FUNC_TYPE_CIPHER, "des", enc_main},
|
{FUNC_TYPE_CIPHER,"des",enc_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef OPENSSL_NO_DES
|
#ifndef OPENSSL_NO_DES
|
||||||
{FUNC_TYPE_CIPHER, "des3", enc_main},
|
{FUNC_TYPE_CIPHER,"des3",enc_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef OPENSSL_NO_DES
|
#ifndef OPENSSL_NO_DES
|
||||||
{FUNC_TYPE_CIPHER, "desx", enc_main},
|
{FUNC_TYPE_CIPHER,"desx",enc_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef OPENSSL_NO_IDEA
|
#ifndef OPENSSL_NO_IDEA
|
||||||
{FUNC_TYPE_CIPHER, "idea", enc_main},
|
{FUNC_TYPE_CIPHER,"idea",enc_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef OPENSSL_NO_SEED
|
#ifndef OPENSSL_NO_SEED
|
||||||
{FUNC_TYPE_CIPHER, "seed", enc_main},
|
{FUNC_TYPE_CIPHER,"seed",enc_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef OPENSSL_NO_RC4
|
#ifndef OPENSSL_NO_RC4
|
||||||
{FUNC_TYPE_CIPHER, "rc4", enc_main},
|
{FUNC_TYPE_CIPHER,"rc4",enc_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef OPENSSL_NO_RC4
|
#ifndef OPENSSL_NO_RC4
|
||||||
{FUNC_TYPE_CIPHER, "rc4-40", enc_main},
|
{FUNC_TYPE_CIPHER,"rc4-40",enc_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef OPENSSL_NO_RC2
|
#ifndef OPENSSL_NO_RC2
|
||||||
{FUNC_TYPE_CIPHER, "rc2", enc_main},
|
{FUNC_TYPE_CIPHER,"rc2",enc_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef OPENSSL_NO_BF
|
#ifndef OPENSSL_NO_BF
|
||||||
{FUNC_TYPE_CIPHER, "bf", enc_main},
|
{FUNC_TYPE_CIPHER,"bf",enc_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef OPENSSL_NO_CAST
|
#ifndef OPENSSL_NO_CAST
|
||||||
{FUNC_TYPE_CIPHER, "cast", enc_main},
|
{FUNC_TYPE_CIPHER,"cast",enc_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef OPENSSL_NO_RC5
|
#ifndef OPENSSL_NO_RC5
|
||||||
{FUNC_TYPE_CIPHER, "rc5", enc_main},
|
{FUNC_TYPE_CIPHER,"rc5",enc_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef OPENSSL_NO_DES
|
#ifndef OPENSSL_NO_DES
|
||||||
{FUNC_TYPE_CIPHER, "des-ecb", enc_main},
|
{FUNC_TYPE_CIPHER,"des-ecb",enc_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef OPENSSL_NO_DES
|
#ifndef OPENSSL_NO_DES
|
||||||
{FUNC_TYPE_CIPHER, "des-ede", enc_main},
|
{FUNC_TYPE_CIPHER,"des-ede",enc_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef OPENSSL_NO_DES
|
#ifndef OPENSSL_NO_DES
|
||||||
{FUNC_TYPE_CIPHER, "des-ede3", enc_main},
|
{FUNC_TYPE_CIPHER,"des-ede3",enc_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef OPENSSL_NO_DES
|
#ifndef OPENSSL_NO_DES
|
||||||
{FUNC_TYPE_CIPHER, "des-cbc", enc_main},
|
{FUNC_TYPE_CIPHER,"des-cbc",enc_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef OPENSSL_NO_DES
|
#ifndef OPENSSL_NO_DES
|
||||||
{FUNC_TYPE_CIPHER, "des-ede-cbc", enc_main},
|
{FUNC_TYPE_CIPHER,"des-ede-cbc",enc_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef OPENSSL_NO_DES
|
#ifndef OPENSSL_NO_DES
|
||||||
{FUNC_TYPE_CIPHER, "des-ede3-cbc", enc_main},
|
{FUNC_TYPE_CIPHER,"des-ede3-cbc",enc_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef OPENSSL_NO_DES
|
#ifndef OPENSSL_NO_DES
|
||||||
{FUNC_TYPE_CIPHER, "des-cfb", enc_main},
|
{FUNC_TYPE_CIPHER,"des-cfb",enc_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef OPENSSL_NO_DES
|
#ifndef OPENSSL_NO_DES
|
||||||
{FUNC_TYPE_CIPHER, "des-ede-cfb", enc_main},
|
{FUNC_TYPE_CIPHER,"des-ede-cfb",enc_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef OPENSSL_NO_DES
|
#ifndef OPENSSL_NO_DES
|
||||||
{FUNC_TYPE_CIPHER, "des-ede3-cfb", enc_main},
|
{FUNC_TYPE_CIPHER,"des-ede3-cfb",enc_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef OPENSSL_NO_DES
|
#ifndef OPENSSL_NO_DES
|
||||||
{FUNC_TYPE_CIPHER, "des-ofb", enc_main},
|
{FUNC_TYPE_CIPHER,"des-ofb",enc_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef OPENSSL_NO_DES
|
#ifndef OPENSSL_NO_DES
|
||||||
{FUNC_TYPE_CIPHER, "des-ede-ofb", enc_main},
|
{FUNC_TYPE_CIPHER,"des-ede-ofb",enc_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef OPENSSL_NO_DES
|
#ifndef OPENSSL_NO_DES
|
||||||
{FUNC_TYPE_CIPHER, "des-ede3-ofb", enc_main},
|
{FUNC_TYPE_CIPHER,"des-ede3-ofb",enc_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef OPENSSL_NO_IDEA
|
#ifndef OPENSSL_NO_IDEA
|
||||||
{FUNC_TYPE_CIPHER, "idea-cbc", enc_main},
|
{FUNC_TYPE_CIPHER,"idea-cbc",enc_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef OPENSSL_NO_IDEA
|
#ifndef OPENSSL_NO_IDEA
|
||||||
{FUNC_TYPE_CIPHER, "idea-ecb", enc_main},
|
{FUNC_TYPE_CIPHER,"idea-ecb",enc_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef OPENSSL_NO_IDEA
|
#ifndef OPENSSL_NO_IDEA
|
||||||
{FUNC_TYPE_CIPHER, "idea-cfb", enc_main},
|
{FUNC_TYPE_CIPHER,"idea-cfb",enc_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef OPENSSL_NO_IDEA
|
#ifndef OPENSSL_NO_IDEA
|
||||||
{FUNC_TYPE_CIPHER, "idea-ofb", enc_main},
|
{FUNC_TYPE_CIPHER,"idea-ofb",enc_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef OPENSSL_NO_SEED
|
#ifndef OPENSSL_NO_SEED
|
||||||
{FUNC_TYPE_CIPHER, "seed-cbc", enc_main},
|
{FUNC_TYPE_CIPHER,"seed-cbc",enc_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef OPENSSL_NO_SEED
|
#ifndef OPENSSL_NO_SEED
|
||||||
{FUNC_TYPE_CIPHER, "seed-ecb", enc_main},
|
{FUNC_TYPE_CIPHER,"seed-ecb",enc_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef OPENSSL_NO_SEED
|
#ifndef OPENSSL_NO_SEED
|
||||||
{FUNC_TYPE_CIPHER, "seed-cfb", enc_main},
|
{FUNC_TYPE_CIPHER,"seed-cfb",enc_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef OPENSSL_NO_SEED
|
#ifndef OPENSSL_NO_SEED
|
||||||
{FUNC_TYPE_CIPHER, "seed-ofb", enc_main},
|
{FUNC_TYPE_CIPHER,"seed-ofb",enc_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef OPENSSL_NO_RC2
|
#ifndef OPENSSL_NO_RC2
|
||||||
{FUNC_TYPE_CIPHER, "rc2-cbc", enc_main},
|
{FUNC_TYPE_CIPHER,"rc2-cbc",enc_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef OPENSSL_NO_RC2
|
#ifndef OPENSSL_NO_RC2
|
||||||
{FUNC_TYPE_CIPHER, "rc2-ecb", enc_main},
|
{FUNC_TYPE_CIPHER,"rc2-ecb",enc_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef OPENSSL_NO_RC2
|
#ifndef OPENSSL_NO_RC2
|
||||||
{FUNC_TYPE_CIPHER, "rc2-cfb", enc_main},
|
{FUNC_TYPE_CIPHER,"rc2-cfb",enc_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef OPENSSL_NO_RC2
|
#ifndef OPENSSL_NO_RC2
|
||||||
{FUNC_TYPE_CIPHER, "rc2-ofb", enc_main},
|
{FUNC_TYPE_CIPHER,"rc2-ofb",enc_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef OPENSSL_NO_RC2
|
#ifndef OPENSSL_NO_RC2
|
||||||
{FUNC_TYPE_CIPHER, "rc2-64-cbc", enc_main},
|
{FUNC_TYPE_CIPHER,"rc2-64-cbc",enc_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef OPENSSL_NO_RC2
|
#ifndef OPENSSL_NO_RC2
|
||||||
{FUNC_TYPE_CIPHER, "rc2-40-cbc", enc_main},
|
{FUNC_TYPE_CIPHER,"rc2-40-cbc",enc_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef OPENSSL_NO_BF
|
#ifndef OPENSSL_NO_BF
|
||||||
{FUNC_TYPE_CIPHER, "bf-cbc", enc_main},
|
{FUNC_TYPE_CIPHER,"bf-cbc",enc_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef OPENSSL_NO_BF
|
#ifndef OPENSSL_NO_BF
|
||||||
{FUNC_TYPE_CIPHER, "bf-ecb", enc_main},
|
{FUNC_TYPE_CIPHER,"bf-ecb",enc_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef OPENSSL_NO_BF
|
#ifndef OPENSSL_NO_BF
|
||||||
{FUNC_TYPE_CIPHER, "bf-cfb", enc_main},
|
{FUNC_TYPE_CIPHER,"bf-cfb",enc_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef OPENSSL_NO_BF
|
#ifndef OPENSSL_NO_BF
|
||||||
{FUNC_TYPE_CIPHER, "bf-ofb", enc_main},
|
{FUNC_TYPE_CIPHER,"bf-ofb",enc_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef OPENSSL_NO_CAST
|
#ifndef OPENSSL_NO_CAST
|
||||||
{FUNC_TYPE_CIPHER, "cast5-cbc", enc_main},
|
{FUNC_TYPE_CIPHER,"cast5-cbc",enc_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef OPENSSL_NO_CAST
|
#ifndef OPENSSL_NO_CAST
|
||||||
{FUNC_TYPE_CIPHER, "cast5-ecb", enc_main},
|
{FUNC_TYPE_CIPHER,"cast5-ecb",enc_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef OPENSSL_NO_CAST
|
#ifndef OPENSSL_NO_CAST
|
||||||
{FUNC_TYPE_CIPHER, "cast5-cfb", enc_main},
|
{FUNC_TYPE_CIPHER,"cast5-cfb",enc_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef OPENSSL_NO_CAST
|
#ifndef OPENSSL_NO_CAST
|
||||||
{FUNC_TYPE_CIPHER, "cast5-ofb", enc_main},
|
{FUNC_TYPE_CIPHER,"cast5-ofb",enc_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef OPENSSL_NO_CAST
|
#ifndef OPENSSL_NO_CAST
|
||||||
{FUNC_TYPE_CIPHER, "cast-cbc", enc_main},
|
{FUNC_TYPE_CIPHER,"cast-cbc",enc_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef OPENSSL_NO_RC5
|
#ifndef OPENSSL_NO_RC5
|
||||||
{FUNC_TYPE_CIPHER, "rc5-cbc", enc_main},
|
{FUNC_TYPE_CIPHER,"rc5-cbc",enc_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef OPENSSL_NO_RC5
|
#ifndef OPENSSL_NO_RC5
|
||||||
{FUNC_TYPE_CIPHER, "rc5-ecb", enc_main},
|
{FUNC_TYPE_CIPHER,"rc5-ecb",enc_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef OPENSSL_NO_RC5
|
#ifndef OPENSSL_NO_RC5
|
||||||
{FUNC_TYPE_CIPHER, "rc5-cfb", enc_main},
|
{FUNC_TYPE_CIPHER,"rc5-cfb",enc_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef OPENSSL_NO_RC5
|
#ifndef OPENSSL_NO_RC5
|
||||||
{FUNC_TYPE_CIPHER, "rc5-ofb", enc_main},
|
{FUNC_TYPE_CIPHER,"rc5-ofb",enc_main},
|
||||||
#endif
|
#endif
|
||||||
{0, NULL, NULL}
|
{0,NULL,NULL}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ foreach (@ARGV)
|
|||||||
push(@files,$_);
|
push(@files,$_);
|
||||||
$str="\t{FUNC_TYPE_GENERAL,\"$_\",${_}_main},\n";
|
$str="\t{FUNC_TYPE_GENERAL,\"$_\",${_}_main},\n";
|
||||||
if (($_ =~ /^s_/) || ($_ =~ /^ciphers$/))
|
if (($_ =~ /^s_/) || ($_ =~ /^ciphers$/))
|
||||||
{ print "#if !defined(OPENSSL_NO_SOCK)\n${str}#endif\n"; }
|
{ print "#if !defined(OPENSSL_NO_SOCK) && !(defined(OPENSSL_NO_SSL2) && defined(OPENSSL_NO_SSL3))\n${str}#endif\n"; }
|
||||||
elsif ( ($_ =~ /^speed$/))
|
elsif ( ($_ =~ /^speed$/))
|
||||||
{ print "#ifndef OPENSSL_NO_SPEED\n${str}#endif\n"; }
|
{ print "#ifndef OPENSSL_NO_SPEED\n${str}#endif\n"; }
|
||||||
elsif ( ($_ =~ /^engine$/))
|
elsif ( ($_ =~ /^engine$/))
|
||||||
@@ -51,8 +51,6 @@ foreach (@ARGV)
|
|||||||
{ print "#ifndef OPENSSL_NO_CMS\n${str}#endif\n"; }
|
{ print "#ifndef OPENSSL_NO_CMS\n${str}#endif\n"; }
|
||||||
elsif ( ($_ =~ /^ocsp$/))
|
elsif ( ($_ =~ /^ocsp$/))
|
||||||
{ print "#ifndef OPENSSL_NO_OCSP\n${str}#endif\n"; }
|
{ print "#ifndef OPENSSL_NO_OCSP\n${str}#endif\n"; }
|
||||||
elsif ( ($_ =~ /^srp$/))
|
|
||||||
{ print "#ifndef OPENSSL_NO_SRP\n${str}#endif\n"; }
|
|
||||||
else
|
else
|
||||||
{ print $str; }
|
{ print $str; }
|
||||||
}
|
}
|
||||||
|
|||||||
272
apps/rand.c
272
apps/rand.c
@@ -66,8 +66,7 @@
|
|||||||
#undef PROG
|
#undef PROG
|
||||||
#define PROG rand_main
|
#define PROG rand_main
|
||||||
|
|
||||||
/*-
|
/* -out file - write to file
|
||||||
* -out file - write to file
|
|
||||||
* -rand file:file - PRNG seed files
|
* -rand file:file - PRNG seed files
|
||||||
* -base64 - base64 encode output
|
* -base64 - base64 encode output
|
||||||
* -hex - hex encode output
|
* -hex - hex encode output
|
||||||
@@ -77,153 +76,170 @@
|
|||||||
int MAIN(int, char **);
|
int MAIN(int, char **);
|
||||||
|
|
||||||
int MAIN(int argc, char **argv)
|
int MAIN(int argc, char **argv)
|
||||||
{
|
{
|
||||||
int i, r, ret = 1;
|
int i, r, ret = 1;
|
||||||
int badopt;
|
int badopt;
|
||||||
char *outfile = NULL;
|
char *outfile = NULL;
|
||||||
char *inrand = NULL;
|
char *inrand = NULL;
|
||||||
int base64 = 0;
|
int base64 = 0;
|
||||||
int hex = 0;
|
int hex = 0;
|
||||||
BIO *out = NULL;
|
BIO *out = NULL;
|
||||||
int num = -1;
|
int num = -1;
|
||||||
#ifndef OPENSSL_NO_ENGINE
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
char *engine = NULL;
|
char *engine=NULL;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
apps_startup();
|
apps_startup();
|
||||||
|
|
||||||
if (bio_err == NULL)
|
if (bio_err == NULL)
|
||||||
if ((bio_err = BIO_new(BIO_s_file())) != NULL)
|
if ((bio_err = BIO_new(BIO_s_file())) != NULL)
|
||||||
BIO_set_fp(bio_err, stderr, BIO_NOCLOSE | BIO_FP_TEXT);
|
BIO_set_fp(bio_err, stderr, BIO_NOCLOSE|BIO_FP_TEXT);
|
||||||
|
|
||||||
if (!load_config(bio_err, NULL))
|
if (!load_config(bio_err, NULL))
|
||||||
goto err;
|
goto err;
|
||||||
|
|
||||||
badopt = 0;
|
badopt = 0;
|
||||||
i = 0;
|
i = 0;
|
||||||
while (!badopt && argv[++i] != NULL) {
|
while (!badopt && argv[++i] != NULL)
|
||||||
if (strcmp(argv[i], "-out") == 0) {
|
{
|
||||||
if ((argv[i + 1] != NULL) && (outfile == NULL))
|
if (strcmp(argv[i], "-out") == 0)
|
||||||
outfile = argv[++i];
|
{
|
||||||
else
|
if ((argv[i+1] != NULL) && (outfile == NULL))
|
||||||
badopt = 1;
|
outfile = argv[++i];
|
||||||
}
|
else
|
||||||
|
badopt = 1;
|
||||||
|
}
|
||||||
#ifndef OPENSSL_NO_ENGINE
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
else if (strcmp(argv[i], "-engine") == 0) {
|
else if (strcmp(argv[i], "-engine") == 0)
|
||||||
if ((argv[i + 1] != NULL) && (engine == NULL))
|
{
|
||||||
engine = argv[++i];
|
if ((argv[i+1] != NULL) && (engine == NULL))
|
||||||
else
|
engine = argv[++i];
|
||||||
badopt = 1;
|
else
|
||||||
}
|
badopt = 1;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
else if (strcmp(argv[i], "-rand") == 0) {
|
else if (strcmp(argv[i], "-rand") == 0)
|
||||||
if ((argv[i + 1] != NULL) && (inrand == NULL))
|
{
|
||||||
inrand = argv[++i];
|
if ((argv[i+1] != NULL) && (inrand == NULL))
|
||||||
else
|
inrand = argv[++i];
|
||||||
badopt = 1;
|
else
|
||||||
} else if (strcmp(argv[i], "-base64") == 0) {
|
badopt = 1;
|
||||||
if (!base64)
|
}
|
||||||
base64 = 1;
|
else if (strcmp(argv[i], "-base64") == 0)
|
||||||
else
|
{
|
||||||
badopt = 1;
|
if (!base64)
|
||||||
} else if (strcmp(argv[i], "-hex") == 0) {
|
base64 = 1;
|
||||||
if (!hex)
|
else
|
||||||
hex = 1;
|
badopt = 1;
|
||||||
else
|
}
|
||||||
badopt = 1;
|
else if (strcmp(argv[i], "-hex") == 0)
|
||||||
} else if (isdigit((unsigned char)argv[i][0])) {
|
{
|
||||||
if (num < 0) {
|
if (!hex)
|
||||||
r = sscanf(argv[i], "%d", &num);
|
hex = 1;
|
||||||
if (r == 0 || num < 0)
|
else
|
||||||
badopt = 1;
|
badopt = 1;
|
||||||
} else
|
}
|
||||||
badopt = 1;
|
else if (isdigit((unsigned char)argv[i][0]))
|
||||||
} else
|
{
|
||||||
badopt = 1;
|
if (num < 0)
|
||||||
}
|
{
|
||||||
|
r = sscanf(argv[i], "%d", &num);
|
||||||
|
if (r == 0 || num < 0)
|
||||||
|
badopt = 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
badopt = 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
badopt = 1;
|
||||||
|
}
|
||||||
|
|
||||||
if (hex && base64)
|
if (hex && base64)
|
||||||
badopt = 1;
|
badopt = 1;
|
||||||
|
|
||||||
if (num < 0)
|
if (num < 0)
|
||||||
badopt = 1;
|
badopt = 1;
|
||||||
|
|
||||||
if (badopt) {
|
if (badopt)
|
||||||
BIO_printf(bio_err, "Usage: rand [options] num\n");
|
{
|
||||||
BIO_printf(bio_err, "where options are\n");
|
BIO_printf(bio_err, "Usage: rand [options] num\n");
|
||||||
BIO_printf(bio_err, "-out file - write to file\n");
|
BIO_printf(bio_err, "where options are\n");
|
||||||
|
BIO_printf(bio_err, "-out file - write to file\n");
|
||||||
#ifndef OPENSSL_NO_ENGINE
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
BIO_printf(bio_err,
|
BIO_printf(bio_err, "-engine e - use engine e, possibly a hardware device.\n");
|
||||||
"-engine e - use engine e, possibly a hardware device.\n");
|
|
||||||
#endif
|
#endif
|
||||||
BIO_printf(bio_err, "-rand file%cfile%c... - seed PRNG from files\n",
|
BIO_printf(bio_err, "-rand file%cfile%c... - seed PRNG from files\n", LIST_SEPARATOR_CHAR, LIST_SEPARATOR_CHAR);
|
||||||
LIST_SEPARATOR_CHAR, LIST_SEPARATOR_CHAR);
|
BIO_printf(bio_err, "-base64 - base64 encode output\n");
|
||||||
BIO_printf(bio_err, "-base64 - base64 encode output\n");
|
BIO_printf(bio_err, "-hex - hex encode output\n");
|
||||||
BIO_printf(bio_err, "-hex - hex encode output\n");
|
goto err;
|
||||||
goto err;
|
}
|
||||||
}
|
|
||||||
#ifndef OPENSSL_NO_ENGINE
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
setup_engine(bio_err, engine, 0);
|
setup_engine(bio_err, engine, 0);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
app_RAND_load_file(NULL, bio_err, (inrand != NULL));
|
app_RAND_load_file(NULL, bio_err, (inrand != NULL));
|
||||||
if (inrand != NULL)
|
if (inrand != NULL)
|
||||||
BIO_printf(bio_err, "%ld semi-random bytes loaded\n",
|
BIO_printf(bio_err,"%ld semi-random bytes loaded\n",
|
||||||
app_RAND_load_files(inrand));
|
app_RAND_load_files(inrand));
|
||||||
|
|
||||||
out = BIO_new(BIO_s_file());
|
out = BIO_new(BIO_s_file());
|
||||||
if (out == NULL)
|
if (out == NULL)
|
||||||
goto err;
|
goto err;
|
||||||
if (outfile != NULL)
|
if (outfile != NULL)
|
||||||
r = BIO_write_filename(out, outfile);
|
r = BIO_write_filename(out, outfile);
|
||||||
else {
|
else
|
||||||
r = BIO_set_fp(out, stdout, BIO_NOCLOSE | BIO_FP_TEXT);
|
{
|
||||||
|
r = BIO_set_fp(out, stdout, BIO_NOCLOSE | BIO_FP_TEXT);
|
||||||
#ifdef OPENSSL_SYS_VMS
|
#ifdef OPENSSL_SYS_VMS
|
||||||
{
|
{
|
||||||
BIO *tmpbio = BIO_new(BIO_f_linebuffer());
|
BIO *tmpbio = BIO_new(BIO_f_linebuffer());
|
||||||
out = BIO_push(tmpbio, out);
|
out = BIO_push(tmpbio, out);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
if (r <= 0)
|
if (r <= 0)
|
||||||
goto err;
|
goto err;
|
||||||
|
|
||||||
if (base64) {
|
if (base64)
|
||||||
BIO *b64 = BIO_new(BIO_f_base64());
|
{
|
||||||
if (b64 == NULL)
|
BIO *b64 = BIO_new(BIO_f_base64());
|
||||||
goto err;
|
if (b64 == NULL)
|
||||||
out = BIO_push(b64, out);
|
goto err;
|
||||||
}
|
out = BIO_push(b64, out);
|
||||||
|
}
|
||||||
|
|
||||||
while (num > 0) {
|
while (num > 0)
|
||||||
unsigned char buf[4096];
|
{
|
||||||
int chunk;
|
unsigned char buf[4096];
|
||||||
|
int chunk;
|
||||||
|
|
||||||
chunk = num;
|
chunk = num;
|
||||||
if (chunk > (int)sizeof(buf))
|
if (chunk > (int)sizeof(buf))
|
||||||
chunk = sizeof buf;
|
chunk = sizeof buf;
|
||||||
r = RAND_bytes(buf, chunk);
|
r = RAND_bytes(buf, chunk);
|
||||||
if (r <= 0)
|
if (r <= 0)
|
||||||
goto err;
|
goto err;
|
||||||
if (!hex)
|
if (!hex)
|
||||||
BIO_write(out, buf, chunk);
|
BIO_write(out, buf, chunk);
|
||||||
else {
|
else
|
||||||
for (i = 0; i < chunk; i++)
|
{
|
||||||
BIO_printf(out, "%02x", buf[i]);
|
for (i = 0; i < chunk; i++)
|
||||||
}
|
BIO_printf(out, "%02x", buf[i]);
|
||||||
num -= chunk;
|
}
|
||||||
}
|
num -= chunk;
|
||||||
if (hex)
|
}
|
||||||
BIO_puts(out, "\n");
|
if (hex)
|
||||||
(void)BIO_flush(out);
|
BIO_puts(out, "\n");
|
||||||
|
(void)BIO_flush(out);
|
||||||
|
|
||||||
app_RAND_write_file(NULL, bio_err);
|
app_RAND_write_file(NULL, bio_err);
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
err:
|
err:
|
||||||
ERR_print_errors(bio_err);
|
ERR_print_errors(bio_err);
|
||||||
if (out)
|
if (out)
|
||||||
BIO_free_all(out);
|
BIO_free_all(out);
|
||||||
apps_shutdown();
|
apps_shutdown();
|
||||||
OPENSSL_EXIT(ret);
|
OPENSSL_EXIT(ret);
|
||||||
}
|
}
|
||||||
|
|||||||
2904
apps/req.c
2904
apps/req.c
File diff suppressed because it is too large
Load Diff
685
apps/rsa.c
685
apps/rsa.c
@@ -58,382 +58,393 @@
|
|||||||
|
|
||||||
#include <openssl/opensslconf.h>
|
#include <openssl/opensslconf.h>
|
||||||
#ifndef OPENSSL_NO_RSA
|
#ifndef OPENSSL_NO_RSA
|
||||||
# include <stdio.h>
|
#include <stdio.h>
|
||||||
# include <stdlib.h>
|
#include <stdlib.h>
|
||||||
# include <string.h>
|
#include <string.h>
|
||||||
# include <time.h>
|
#include <time.h>
|
||||||
# include "apps.h"
|
#include "apps.h"
|
||||||
# include <openssl/bio.h>
|
#include <openssl/bio.h>
|
||||||
# include <openssl/err.h>
|
#include <openssl/err.h>
|
||||||
# include <openssl/rsa.h>
|
#include <openssl/rsa.h>
|
||||||
# include <openssl/evp.h>
|
#include <openssl/evp.h>
|
||||||
# include <openssl/x509.h>
|
#include <openssl/x509.h>
|
||||||
# include <openssl/pem.h>
|
#include <openssl/pem.h>
|
||||||
# include <openssl/bn.h>
|
#include <openssl/bn.h>
|
||||||
|
|
||||||
# undef PROG
|
#undef PROG
|
||||||
# define PROG rsa_main
|
#define PROG rsa_main
|
||||||
|
|
||||||
/*-
|
/* -inform arg - input format - default PEM (one of DER, NET or PEM)
|
||||||
* -inform arg - input format - default PEM (one of DER, NET or PEM)
|
|
||||||
* -outform arg - output format - default PEM
|
* -outform arg - output format - default PEM
|
||||||
* -in arg - input file - default stdin
|
* -in arg - input file - default stdin
|
||||||
* -out arg - output file - default stdout
|
* -out arg - output file - default stdout
|
||||||
* -des - encrypt output if PEM format with DES in cbc mode
|
* -des - encrypt output if PEM format with DES in cbc mode
|
||||||
* -des3 - encrypt output if PEM format
|
* -des3 - encrypt output if PEM format
|
||||||
* -idea - encrypt output if PEM format
|
* -idea - encrypt output if PEM format
|
||||||
* -seed - encrypt output if PEM format
|
* -seed - encrypt output if PEM format
|
||||||
* -aes128 - encrypt output if PEM format
|
* -aes128 - encrypt output if PEM format
|
||||||
* -aes192 - encrypt output if PEM format
|
* -aes192 - encrypt output if PEM format
|
||||||
* -aes256 - encrypt output if PEM format
|
* -aes256 - encrypt output if PEM format
|
||||||
* -camellia128 - encrypt output if PEM format
|
* -camellia128 - encrypt output if PEM format
|
||||||
* -camellia192 - encrypt output if PEM format
|
* -camellia192 - encrypt output if PEM format
|
||||||
* -camellia256 - encrypt output if PEM format
|
* -camellia256 - encrypt output if PEM format
|
||||||
* -text - print a text version
|
* -text - print a text version
|
||||||
* -modulus - print the RSA key modulus
|
* -modulus - print the RSA key modulus
|
||||||
* -check - verify key consistency
|
* -check - verify key consistency
|
||||||
* -pubin - Expect a public key in input file.
|
* -pubin - Expect a public key in input file.
|
||||||
* -pubout - Output a public key.
|
* -pubout - Output a public key.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int MAIN(int, char **);
|
int MAIN(int, char **);
|
||||||
|
|
||||||
int MAIN(int argc, char **argv)
|
int MAIN(int argc, char **argv)
|
||||||
{
|
{
|
||||||
ENGINE *e = NULL;
|
ENGINE *e = NULL;
|
||||||
int ret = 1;
|
int ret=1;
|
||||||
RSA *rsa = NULL;
|
RSA *rsa=NULL;
|
||||||
int i, badops = 0, sgckey = 0;
|
int i,badops=0, sgckey=0;
|
||||||
const EVP_CIPHER *enc = NULL;
|
const EVP_CIPHER *enc=NULL;
|
||||||
BIO *out = NULL;
|
BIO *out=NULL;
|
||||||
int informat, outformat, text = 0, check = 0, noout = 0;
|
int informat,outformat,text=0,check=0,noout=0;
|
||||||
int pubin = 0, pubout = 0;
|
int pubin = 0, pubout = 0;
|
||||||
char *infile, *outfile, *prog;
|
char *infile,*outfile,*prog;
|
||||||
char *passargin = NULL, *passargout = NULL;
|
char *passargin = NULL, *passargout = NULL;
|
||||||
char *passin = NULL, *passout = NULL;
|
char *passin = NULL, *passout = NULL;
|
||||||
# ifndef OPENSSL_NO_ENGINE
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
char *engine = NULL;
|
char *engine=NULL;
|
||||||
# endif
|
#endif
|
||||||
int modulus = 0;
|
int modulus=0;
|
||||||
|
|
||||||
int pvk_encr = 2;
|
int pvk_encr = 2;
|
||||||
|
|
||||||
apps_startup();
|
apps_startup();
|
||||||
|
|
||||||
if (bio_err == NULL)
|
if (bio_err == NULL)
|
||||||
if ((bio_err = BIO_new(BIO_s_file())) != NULL)
|
if ((bio_err=BIO_new(BIO_s_file())) != NULL)
|
||||||
BIO_set_fp(bio_err, stderr, BIO_NOCLOSE | BIO_FP_TEXT);
|
BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT);
|
||||||
|
|
||||||
if (!load_config(bio_err, NULL))
|
if (!load_config(bio_err, NULL))
|
||||||
goto end;
|
goto end;
|
||||||
|
|
||||||
infile = NULL;
|
infile=NULL;
|
||||||
outfile = NULL;
|
outfile=NULL;
|
||||||
informat = FORMAT_PEM;
|
informat=FORMAT_PEM;
|
||||||
outformat = FORMAT_PEM;
|
outformat=FORMAT_PEM;
|
||||||
|
|
||||||
prog = argv[0];
|
prog=argv[0];
|
||||||
argc--;
|
argc--;
|
||||||
argv++;
|
argv++;
|
||||||
while (argc >= 1) {
|
while (argc >= 1)
|
||||||
if (strcmp(*argv, "-inform") == 0) {
|
{
|
||||||
if (--argc < 1)
|
if (strcmp(*argv,"-inform") == 0)
|
||||||
goto bad;
|
{
|
||||||
informat = str2fmt(*(++argv));
|
if (--argc < 1) goto bad;
|
||||||
} else if (strcmp(*argv, "-outform") == 0) {
|
informat=str2fmt(*(++argv));
|
||||||
if (--argc < 1)
|
}
|
||||||
goto bad;
|
else if (strcmp(*argv,"-outform") == 0)
|
||||||
outformat = str2fmt(*(++argv));
|
{
|
||||||
} else if (strcmp(*argv, "-in") == 0) {
|
if (--argc < 1) goto bad;
|
||||||
if (--argc < 1)
|
outformat=str2fmt(*(++argv));
|
||||||
goto bad;
|
}
|
||||||
infile = *(++argv);
|
else if (strcmp(*argv,"-in") == 0)
|
||||||
} else if (strcmp(*argv, "-out") == 0) {
|
{
|
||||||
if (--argc < 1)
|
if (--argc < 1) goto bad;
|
||||||
goto bad;
|
infile= *(++argv);
|
||||||
outfile = *(++argv);
|
}
|
||||||
} else if (strcmp(*argv, "-passin") == 0) {
|
else if (strcmp(*argv,"-out") == 0)
|
||||||
if (--argc < 1)
|
{
|
||||||
goto bad;
|
if (--argc < 1) goto bad;
|
||||||
passargin = *(++argv);
|
outfile= *(++argv);
|
||||||
} else if (strcmp(*argv, "-passout") == 0) {
|
}
|
||||||
if (--argc < 1)
|
else if (strcmp(*argv,"-passin") == 0)
|
||||||
goto bad;
|
{
|
||||||
passargout = *(++argv);
|
if (--argc < 1) goto bad;
|
||||||
}
|
passargin= *(++argv);
|
||||||
# ifndef OPENSSL_NO_ENGINE
|
}
|
||||||
else if (strcmp(*argv, "-engine") == 0) {
|
else if (strcmp(*argv,"-passout") == 0)
|
||||||
if (--argc < 1)
|
{
|
||||||
goto bad;
|
if (--argc < 1) goto bad;
|
||||||
engine = *(++argv);
|
passargout= *(++argv);
|
||||||
}
|
}
|
||||||
# endif
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
else if (strcmp(*argv, "-sgckey") == 0)
|
else if (strcmp(*argv,"-engine") == 0)
|
||||||
sgckey = 1;
|
{
|
||||||
else if (strcmp(*argv, "-pubin") == 0)
|
if (--argc < 1) goto bad;
|
||||||
pubin = 1;
|
engine= *(++argv);
|
||||||
else if (strcmp(*argv, "-pubout") == 0)
|
}
|
||||||
pubout = 1;
|
#endif
|
||||||
else if (strcmp(*argv, "-RSAPublicKey_in") == 0)
|
else if (strcmp(*argv,"-sgckey") == 0)
|
||||||
pubin = 2;
|
sgckey=1;
|
||||||
else if (strcmp(*argv, "-RSAPublicKey_out") == 0)
|
else if (strcmp(*argv,"-pubin") == 0)
|
||||||
pubout = 2;
|
pubin=1;
|
||||||
else if (strcmp(*argv, "-pvk-strong") == 0)
|
else if (strcmp(*argv,"-pubout") == 0)
|
||||||
pvk_encr = 2;
|
pubout=1;
|
||||||
else if (strcmp(*argv, "-pvk-weak") == 0)
|
else if (strcmp(*argv,"-RSAPublicKey_in") == 0)
|
||||||
pvk_encr = 1;
|
pubin = 2;
|
||||||
else if (strcmp(*argv, "-pvk-none") == 0)
|
else if (strcmp(*argv,"-RSAPublicKey_out") == 0)
|
||||||
pvk_encr = 0;
|
pubout = 2;
|
||||||
else if (strcmp(*argv, "-noout") == 0)
|
else if (strcmp(*argv,"-pvk-strong") == 0)
|
||||||
noout = 1;
|
pvk_encr=2;
|
||||||
else if (strcmp(*argv, "-text") == 0)
|
else if (strcmp(*argv,"-pvk-weak") == 0)
|
||||||
text = 1;
|
pvk_encr=1;
|
||||||
else if (strcmp(*argv, "-modulus") == 0)
|
else if (strcmp(*argv,"-pvk-none") == 0)
|
||||||
modulus = 1;
|
pvk_encr=0;
|
||||||
else if (strcmp(*argv, "-check") == 0)
|
else if (strcmp(*argv,"-noout") == 0)
|
||||||
check = 1;
|
noout=1;
|
||||||
else if ((enc = EVP_get_cipherbyname(&(argv[0][1]))) == NULL) {
|
else if (strcmp(*argv,"-text") == 0)
|
||||||
BIO_printf(bio_err, "unknown option %s\n", *argv);
|
text=1;
|
||||||
badops = 1;
|
else if (strcmp(*argv,"-modulus") == 0)
|
||||||
break;
|
modulus=1;
|
||||||
}
|
else if (strcmp(*argv,"-check") == 0)
|
||||||
argc--;
|
check=1;
|
||||||
argv++;
|
else if ((enc=EVP_get_cipherbyname(&(argv[0][1]))) == NULL)
|
||||||
}
|
{
|
||||||
|
BIO_printf(bio_err,"unknown option %s\n",*argv);
|
||||||
|
badops=1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
argc--;
|
||||||
|
argv++;
|
||||||
|
}
|
||||||
|
|
||||||
if (badops) {
|
if (badops)
|
||||||
bad:
|
{
|
||||||
BIO_printf(bio_err, "%s [options] <infile >outfile\n", prog);
|
bad:
|
||||||
BIO_printf(bio_err, "where options are\n");
|
BIO_printf(bio_err,"%s [options] <infile >outfile\n",prog);
|
||||||
BIO_printf(bio_err,
|
BIO_printf(bio_err,"where options are\n");
|
||||||
" -inform arg input format - one of DER NET PEM\n");
|
BIO_printf(bio_err," -inform arg input format - one of DER NET PEM\n");
|
||||||
BIO_printf(bio_err,
|
BIO_printf(bio_err," -outform arg output format - one of DER NET PEM\n");
|
||||||
" -outform arg output format - one of DER NET PEM\n");
|
BIO_printf(bio_err," -in arg input file\n");
|
||||||
BIO_printf(bio_err, " -in arg input file\n");
|
BIO_printf(bio_err," -sgckey Use IIS SGC key format\n");
|
||||||
BIO_printf(bio_err, " -sgckey Use IIS SGC key format\n");
|
BIO_printf(bio_err," -passin arg input file pass phrase source\n");
|
||||||
BIO_printf(bio_err,
|
BIO_printf(bio_err," -out arg output file\n");
|
||||||
" -passin arg input file pass phrase source\n");
|
BIO_printf(bio_err," -passout arg output file pass phrase source\n");
|
||||||
BIO_printf(bio_err, " -out arg output file\n");
|
BIO_printf(bio_err," -des encrypt PEM output with cbc des\n");
|
||||||
BIO_printf(bio_err,
|
BIO_printf(bio_err," -des3 encrypt PEM output with ede cbc des using 168 bit key\n");
|
||||||
" -passout arg output file pass phrase source\n");
|
#ifndef OPENSSL_NO_IDEA
|
||||||
BIO_printf(bio_err,
|
BIO_printf(bio_err," -idea encrypt PEM output with cbc idea\n");
|
||||||
" -des encrypt PEM output with cbc des\n");
|
#endif
|
||||||
BIO_printf(bio_err,
|
#ifndef OPENSSL_NO_SEED
|
||||||
" -des3 encrypt PEM output with ede cbc des using 168 bit key\n");
|
BIO_printf(bio_err," -seed encrypt PEM output with cbc seed\n");
|
||||||
# ifndef OPENSSL_NO_IDEA
|
#endif
|
||||||
BIO_printf(bio_err,
|
#ifndef OPENSSL_NO_AES
|
||||||
" -idea encrypt PEM output with cbc idea\n");
|
BIO_printf(bio_err," -aes128, -aes192, -aes256\n");
|
||||||
# endif
|
BIO_printf(bio_err," encrypt PEM output with cbc aes\n");
|
||||||
# ifndef OPENSSL_NO_SEED
|
#endif
|
||||||
BIO_printf(bio_err,
|
#ifndef OPENSSL_NO_CAMELLIA
|
||||||
" -seed encrypt PEM output with cbc seed\n");
|
BIO_printf(bio_err," -camellia128, -camellia192, -camellia256\n");
|
||||||
# endif
|
BIO_printf(bio_err," encrypt PEM output with cbc camellia\n");
|
||||||
# ifndef OPENSSL_NO_AES
|
#endif
|
||||||
BIO_printf(bio_err, " -aes128, -aes192, -aes256\n");
|
BIO_printf(bio_err," -text print the key in text\n");
|
||||||
BIO_printf(bio_err,
|
BIO_printf(bio_err," -noout don't print key out\n");
|
||||||
" encrypt PEM output with cbc aes\n");
|
BIO_printf(bio_err," -modulus print the RSA key modulus\n");
|
||||||
# endif
|
BIO_printf(bio_err," -check verify key consistency\n");
|
||||||
# ifndef OPENSSL_NO_CAMELLIA
|
BIO_printf(bio_err," -pubin expect a public key in input file\n");
|
||||||
BIO_printf(bio_err, " -camellia128, -camellia192, -camellia256\n");
|
BIO_printf(bio_err," -pubout output a public key\n");
|
||||||
BIO_printf(bio_err,
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
" encrypt PEM output with cbc camellia\n");
|
BIO_printf(bio_err," -engine e use engine e, possibly a hardware device.\n");
|
||||||
# endif
|
#endif
|
||||||
BIO_printf(bio_err, " -text print the key in text\n");
|
goto end;
|
||||||
BIO_printf(bio_err, " -noout don't print key out\n");
|
}
|
||||||
BIO_printf(bio_err, " -modulus print the RSA key modulus\n");
|
|
||||||
BIO_printf(bio_err, " -check verify key consistency\n");
|
|
||||||
BIO_printf(bio_err,
|
|
||||||
" -pubin expect a public key in input file\n");
|
|
||||||
BIO_printf(bio_err, " -pubout output a public key\n");
|
|
||||||
# ifndef OPENSSL_NO_ENGINE
|
|
||||||
BIO_printf(bio_err,
|
|
||||||
" -engine e use engine e, possibly a hardware device.\n");
|
|
||||||
# endif
|
|
||||||
goto end;
|
|
||||||
}
|
|
||||||
|
|
||||||
ERR_load_crypto_strings();
|
ERR_load_crypto_strings();
|
||||||
|
|
||||||
# ifndef OPENSSL_NO_ENGINE
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
e = setup_engine(bio_err, engine, 0);
|
e = setup_engine(bio_err, engine, 0);
|
||||||
# endif
|
#endif
|
||||||
|
|
||||||
if (!app_passwd(bio_err, passargin, passargout, &passin, &passout)) {
|
if(!app_passwd(bio_err, passargin, passargout, &passin, &passout)) {
|
||||||
BIO_printf(bio_err, "Error getting passwords\n");
|
BIO_printf(bio_err, "Error getting passwords\n");
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (check && pubin) {
|
if(check && pubin) {
|
||||||
BIO_printf(bio_err, "Only private keys can be checked\n");
|
BIO_printf(bio_err, "Only private keys can be checked\n");
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
out = BIO_new(BIO_s_file());
|
out=BIO_new(BIO_s_file());
|
||||||
|
|
||||||
{
|
{
|
||||||
EVP_PKEY *pkey;
|
EVP_PKEY *pkey;
|
||||||
|
|
||||||
if (pubin) {
|
if (pubin)
|
||||||
int tmpformat = -1;
|
{
|
||||||
if (pubin == 2) {
|
int tmpformat=-1;
|
||||||
if (informat == FORMAT_PEM)
|
if (pubin == 2)
|
||||||
tmpformat = FORMAT_PEMRSA;
|
{
|
||||||
else if (informat == FORMAT_ASN1)
|
if (informat == FORMAT_PEM)
|
||||||
tmpformat = FORMAT_ASN1RSA;
|
tmpformat = FORMAT_PEMRSA;
|
||||||
} else if (informat == FORMAT_NETSCAPE && sgckey)
|
else if (informat == FORMAT_ASN1)
|
||||||
tmpformat = FORMAT_IISSGC;
|
tmpformat = FORMAT_ASN1RSA;
|
||||||
else
|
}
|
||||||
tmpformat = informat;
|
else if (informat == FORMAT_NETSCAPE && sgckey)
|
||||||
|
tmpformat = FORMAT_IISSGC;
|
||||||
|
else
|
||||||
|
tmpformat = informat;
|
||||||
|
|
||||||
pkey = load_pubkey(bio_err, infile, tmpformat, 1,
|
pkey = load_pubkey(bio_err, infile, tmpformat, 1,
|
||||||
passin, e, "Public Key");
|
passin, e, "Public Key");
|
||||||
} else
|
}
|
||||||
pkey = load_key(bio_err, infile,
|
else
|
||||||
(informat == FORMAT_NETSCAPE && sgckey ?
|
pkey = load_key(bio_err, infile,
|
||||||
FORMAT_IISSGC : informat), 1,
|
(informat == FORMAT_NETSCAPE && sgckey ?
|
||||||
passin, e, "Private Key");
|
FORMAT_IISSGC : informat), 1,
|
||||||
|
passin, e, "Private Key");
|
||||||
|
|
||||||
if (pkey != NULL)
|
if (pkey != NULL)
|
||||||
rsa = EVP_PKEY_get1_RSA(pkey);
|
rsa = EVP_PKEY_get1_RSA(pkey);
|
||||||
EVP_PKEY_free(pkey);
|
EVP_PKEY_free(pkey);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rsa == NULL) {
|
if (rsa == NULL)
|
||||||
ERR_print_errors(bio_err);
|
{
|
||||||
goto end;
|
ERR_print_errors(bio_err);
|
||||||
}
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
if (outfile == NULL) {
|
if (outfile == NULL)
|
||||||
BIO_set_fp(out, stdout, BIO_NOCLOSE);
|
{
|
||||||
# ifdef OPENSSL_SYS_VMS
|
BIO_set_fp(out,stdout,BIO_NOCLOSE);
|
||||||
{
|
#ifdef OPENSSL_SYS_VMS
|
||||||
BIO *tmpbio = BIO_new(BIO_f_linebuffer());
|
{
|
||||||
out = BIO_push(tmpbio, out);
|
BIO *tmpbio = BIO_new(BIO_f_linebuffer());
|
||||||
}
|
out = BIO_push(tmpbio, out);
|
||||||
# endif
|
}
|
||||||
} else {
|
#endif
|
||||||
if (BIO_write_filename(out, outfile) <= 0) {
|
}
|
||||||
perror(outfile);
|
else
|
||||||
goto end;
|
{
|
||||||
}
|
if (BIO_write_filename(out,outfile) <= 0)
|
||||||
}
|
{
|
||||||
|
perror(outfile);
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (text)
|
if (text)
|
||||||
if (!RSA_print(out, rsa, 0)) {
|
if (!RSA_print(out,rsa,0))
|
||||||
perror(outfile);
|
{
|
||||||
ERR_print_errors(bio_err);
|
perror(outfile);
|
||||||
goto end;
|
ERR_print_errors(bio_err);
|
||||||
}
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
if (modulus) {
|
if (modulus)
|
||||||
BIO_printf(out, "Modulus=");
|
{
|
||||||
BN_print(out, rsa->n);
|
BIO_printf(out,"Modulus=");
|
||||||
BIO_printf(out, "\n");
|
BN_print(out,rsa->n);
|
||||||
}
|
BIO_printf(out,"\n");
|
||||||
|
}
|
||||||
|
|
||||||
if (check) {
|
if (check)
|
||||||
int r = RSA_check_key(rsa);
|
{
|
||||||
|
int r = RSA_check_key(rsa);
|
||||||
|
|
||||||
if (r == 1)
|
if (r == 1)
|
||||||
BIO_printf(out, "RSA key ok\n");
|
BIO_printf(out,"RSA key ok\n");
|
||||||
else if (r == 0) {
|
else if (r == 0)
|
||||||
unsigned long err;
|
{
|
||||||
|
unsigned long err;
|
||||||
|
|
||||||
while ((err = ERR_peek_error()) != 0 &&
|
while ((err = ERR_peek_error()) != 0 &&
|
||||||
ERR_GET_LIB(err) == ERR_LIB_RSA &&
|
ERR_GET_LIB(err) == ERR_LIB_RSA &&
|
||||||
ERR_GET_FUNC(err) == RSA_F_RSA_CHECK_KEY &&
|
ERR_GET_FUNC(err) == RSA_F_RSA_CHECK_KEY &&
|
||||||
ERR_GET_REASON(err) != ERR_R_MALLOC_FAILURE) {
|
ERR_GET_REASON(err) != ERR_R_MALLOC_FAILURE)
|
||||||
BIO_printf(out, "RSA key error: %s\n",
|
{
|
||||||
ERR_reason_error_string(err));
|
BIO_printf(out, "RSA key error: %s\n", ERR_reason_error_string(err));
|
||||||
ERR_get_error(); /* remove e from error stack */
|
ERR_get_error(); /* remove e from error stack */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (r == -1 || ERR_peek_error() != 0) { /* should happen only if r ==
|
if (r == -1 || ERR_peek_error() != 0) /* should happen only if r == -1 */
|
||||||
* -1 */
|
{
|
||||||
ERR_print_errors(bio_err);
|
ERR_print_errors(bio_err);
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (noout) {
|
if (noout)
|
||||||
ret = 0;
|
{
|
||||||
goto end;
|
ret = 0;
|
||||||
}
|
goto end;
|
||||||
BIO_printf(bio_err, "writing RSA key\n");
|
}
|
||||||
if (outformat == FORMAT_ASN1) {
|
BIO_printf(bio_err,"writing RSA key\n");
|
||||||
if (pubout || pubin) {
|
if (outformat == FORMAT_ASN1) {
|
||||||
if (pubout == 2)
|
if(pubout || pubin)
|
||||||
i = i2d_RSAPublicKey_bio(out, rsa);
|
{
|
||||||
else
|
if (pubout == 2)
|
||||||
i = i2d_RSA_PUBKEY_bio(out, rsa);
|
i=i2d_RSAPublicKey_bio(out,rsa);
|
||||||
} else
|
else
|
||||||
i = i2d_RSAPrivateKey_bio(out, rsa);
|
i=i2d_RSA_PUBKEY_bio(out,rsa);
|
||||||
}
|
}
|
||||||
# ifndef OPENSSL_NO_RC4
|
else i=i2d_RSAPrivateKey_bio(out,rsa);
|
||||||
else if (outformat == FORMAT_NETSCAPE) {
|
}
|
||||||
unsigned char *p, *pp;
|
#ifndef OPENSSL_NO_RC4
|
||||||
int size;
|
else if (outformat == FORMAT_NETSCAPE)
|
||||||
|
{
|
||||||
|
unsigned char *p,*pp;
|
||||||
|
int size;
|
||||||
|
|
||||||
i = 1;
|
i=1;
|
||||||
size = i2d_RSA_NET(rsa, NULL, NULL, sgckey);
|
size=i2d_RSA_NET(rsa,NULL,NULL, sgckey);
|
||||||
if ((p = (unsigned char *)OPENSSL_malloc(size)) == NULL) {
|
if ((p=(unsigned char *)OPENSSL_malloc(size)) == NULL)
|
||||||
BIO_printf(bio_err, "Memory allocation failure\n");
|
{
|
||||||
goto end;
|
BIO_printf(bio_err,"Memory allocation failure\n");
|
||||||
}
|
goto end;
|
||||||
pp = p;
|
}
|
||||||
i2d_RSA_NET(rsa, &p, NULL, sgckey);
|
pp=p;
|
||||||
BIO_write(out, (char *)pp, size);
|
i2d_RSA_NET(rsa,&p,NULL, sgckey);
|
||||||
OPENSSL_free(pp);
|
BIO_write(out,(char *)pp,size);
|
||||||
}
|
OPENSSL_free(pp);
|
||||||
# endif
|
}
|
||||||
else if (outformat == FORMAT_PEM) {
|
#endif
|
||||||
if (pubout || pubin) {
|
else if (outformat == FORMAT_PEM) {
|
||||||
if (pubout == 2)
|
if(pubout || pubin)
|
||||||
i = PEM_write_bio_RSAPublicKey(out, rsa);
|
{
|
||||||
else
|
if (pubout == 2)
|
||||||
i = PEM_write_bio_RSA_PUBKEY(out, rsa);
|
i=PEM_write_bio_RSAPublicKey(out,rsa);
|
||||||
} else
|
else
|
||||||
i = PEM_write_bio_RSAPrivateKey(out, rsa,
|
i=PEM_write_bio_RSA_PUBKEY(out,rsa);
|
||||||
enc, NULL, 0, NULL, passout);
|
}
|
||||||
# if !defined(OPENSSL_NO_DSA) && !defined(OPENSSL_NO_RC4)
|
else i=PEM_write_bio_RSAPrivateKey(out,rsa,
|
||||||
} else if (outformat == FORMAT_MSBLOB || outformat == FORMAT_PVK) {
|
enc,NULL,0,NULL,passout);
|
||||||
EVP_PKEY *pk;
|
#if !defined(OPENSSL_NO_DSA) && !defined(OPENSSL_NO_RC4)
|
||||||
pk = EVP_PKEY_new();
|
} else if (outformat == FORMAT_MSBLOB || outformat == FORMAT_PVK) {
|
||||||
EVP_PKEY_set1_RSA(pk, rsa);
|
EVP_PKEY *pk;
|
||||||
if (outformat == FORMAT_PVK)
|
pk = EVP_PKEY_new();
|
||||||
i = i2b_PVK_bio(out, pk, pvk_encr, 0, passout);
|
EVP_PKEY_set1_RSA(pk, rsa);
|
||||||
else if (pubin || pubout)
|
if (outformat == FORMAT_PVK)
|
||||||
i = i2b_PublicKey_bio(out, pk);
|
i = i2b_PVK_bio(out, pk, pvk_encr, 0, passout);
|
||||||
else
|
else if (pubin || pubout)
|
||||||
i = i2b_PrivateKey_bio(out, pk);
|
i = i2b_PublicKey_bio(out, pk);
|
||||||
EVP_PKEY_free(pk);
|
else
|
||||||
# endif
|
i = i2b_PrivateKey_bio(out, pk);
|
||||||
} else {
|
EVP_PKEY_free(pk);
|
||||||
BIO_printf(bio_err, "bad output format specified for outfile\n");
|
#endif
|
||||||
goto end;
|
} else {
|
||||||
}
|
BIO_printf(bio_err,"bad output format specified for outfile\n");
|
||||||
if (i <= 0) {
|
goto end;
|
||||||
BIO_printf(bio_err, "unable to write key\n");
|
}
|
||||||
ERR_print_errors(bio_err);
|
if (i <= 0)
|
||||||
} else
|
{
|
||||||
ret = 0;
|
BIO_printf(bio_err,"unable to write key\n");
|
||||||
end:
|
ERR_print_errors(bio_err);
|
||||||
if (out != NULL)
|
}
|
||||||
BIO_free_all(out);
|
else
|
||||||
if (rsa != NULL)
|
ret=0;
|
||||||
RSA_free(rsa);
|
end:
|
||||||
if (passin)
|
if(out != NULL) BIO_free_all(out);
|
||||||
OPENSSL_free(passin);
|
if(rsa != NULL) RSA_free(rsa);
|
||||||
if (passout)
|
if(passin) OPENSSL_free(passin);
|
||||||
OPENSSL_free(passout);
|
if(passout) OPENSSL_free(passout);
|
||||||
apps_shutdown();
|
apps_shutdown();
|
||||||
OPENSSL_EXIT(ret);
|
OPENSSL_EXIT(ret);
|
||||||
}
|
}
|
||||||
#else /* !OPENSSL_NO_RSA */
|
#else /* !OPENSSL_NO_RSA */
|
||||||
|
|
||||||
# if PEDANTIC
|
# if PEDANTIC
|
||||||
static void *dummy = &dummy;
|
static void *dummy=&dummy;
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
512
apps/rsautl.c
512
apps/rsautl.c
@@ -1,7 +1,6 @@
|
|||||||
/* rsautl.c */
|
/* rsautl.c */
|
||||||
/*
|
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
|
||||||
* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL project
|
* project 2000.
|
||||||
* 2000.
|
|
||||||
*/
|
*/
|
||||||
/* ====================================================================
|
/* ====================================================================
|
||||||
* Copyright (c) 2000 The OpenSSL Project. All rights reserved.
|
* Copyright (c) 2000 The OpenSSL Project. All rights reserved.
|
||||||
@@ -60,316 +59,293 @@
|
|||||||
#include <openssl/opensslconf.h>
|
#include <openssl/opensslconf.h>
|
||||||
#ifndef OPENSSL_NO_RSA
|
#ifndef OPENSSL_NO_RSA
|
||||||
|
|
||||||
# include "apps.h"
|
#include "apps.h"
|
||||||
# include <string.h>
|
#include <string.h>
|
||||||
# include <openssl/err.h>
|
#include <openssl/err.h>
|
||||||
# include <openssl/pem.h>
|
#include <openssl/pem.h>
|
||||||
# include <openssl/rsa.h>
|
#include <openssl/rsa.h>
|
||||||
|
|
||||||
# define RSA_SIGN 1
|
#define RSA_SIGN 1
|
||||||
# define RSA_VERIFY 2
|
#define RSA_VERIFY 2
|
||||||
# define RSA_ENCRYPT 3
|
#define RSA_ENCRYPT 3
|
||||||
# define RSA_DECRYPT 4
|
#define RSA_DECRYPT 4
|
||||||
|
|
||||||
# define KEY_PRIVKEY 1
|
#define KEY_PRIVKEY 1
|
||||||
# define KEY_PUBKEY 2
|
#define KEY_PUBKEY 2
|
||||||
# define KEY_CERT 3
|
#define KEY_CERT 3
|
||||||
|
|
||||||
static void usage(void);
|
static void usage(void);
|
||||||
|
|
||||||
# undef PROG
|
#undef PROG
|
||||||
|
|
||||||
# define PROG rsautl_main
|
#define PROG rsautl_main
|
||||||
|
|
||||||
int MAIN(int argc, char **);
|
int MAIN(int argc, char **);
|
||||||
|
|
||||||
int MAIN(int argc, char **argv)
|
int MAIN(int argc, char **argv)
|
||||||
{
|
{
|
||||||
ENGINE *e = NULL;
|
ENGINE *e = NULL;
|
||||||
BIO *in = NULL, *out = NULL;
|
BIO *in = NULL, *out = NULL;
|
||||||
char *infile = NULL, *outfile = NULL;
|
char *infile = NULL, *outfile = NULL;
|
||||||
# ifndef OPENSSL_NO_ENGINE
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
char *engine = NULL;
|
char *engine = NULL;
|
||||||
# endif
|
#endif
|
||||||
char *keyfile = NULL;
|
char *keyfile = NULL;
|
||||||
char rsa_mode = RSA_VERIFY, key_type = KEY_PRIVKEY;
|
char rsa_mode = RSA_VERIFY, key_type = KEY_PRIVKEY;
|
||||||
int keyform = FORMAT_PEM;
|
int keyform = FORMAT_PEM;
|
||||||
char need_priv = 0, badarg = 0, rev = 0;
|
char need_priv = 0, badarg = 0, rev = 0;
|
||||||
char hexdump = 0, asn1parse = 0;
|
char hexdump = 0, asn1parse = 0;
|
||||||
X509 *x;
|
X509 *x;
|
||||||
EVP_PKEY *pkey = NULL;
|
EVP_PKEY *pkey = NULL;
|
||||||
RSA *rsa = NULL;
|
RSA *rsa = NULL;
|
||||||
unsigned char *rsa_in = NULL, *rsa_out = NULL, pad;
|
unsigned char *rsa_in = NULL, *rsa_out = NULL, pad;
|
||||||
char *passargin = NULL, *passin = NULL;
|
char *passargin = NULL, *passin = NULL;
|
||||||
int rsa_inlen, rsa_outlen = 0;
|
int rsa_inlen, rsa_outlen = 0;
|
||||||
int keysize;
|
int keysize;
|
||||||
|
|
||||||
int ret = 1;
|
int ret = 1;
|
||||||
|
|
||||||
argc--;
|
argc--;
|
||||||
argv++;
|
argv++;
|
||||||
|
|
||||||
if (!bio_err)
|
if(!bio_err) bio_err = BIO_new_fp(stderr, BIO_NOCLOSE);
|
||||||
bio_err = BIO_new_fp(stderr, BIO_NOCLOSE);
|
|
||||||
|
|
||||||
if (!load_config(bio_err, NULL))
|
if (!load_config(bio_err, NULL))
|
||||||
goto end;
|
goto end;
|
||||||
ERR_load_crypto_strings();
|
ERR_load_crypto_strings();
|
||||||
OpenSSL_add_all_algorithms();
|
OpenSSL_add_all_algorithms();
|
||||||
pad = RSA_PKCS1_PADDING;
|
pad = RSA_PKCS1_PADDING;
|
||||||
|
|
||||||
while (argc >= 1) {
|
while(argc >= 1)
|
||||||
if (!strcmp(*argv, "-in")) {
|
{
|
||||||
if (--argc < 1)
|
if (!strcmp(*argv,"-in")) {
|
||||||
badarg = 1;
|
if (--argc < 1)
|
||||||
else
|
badarg = 1;
|
||||||
infile = *(++argv);
|
else
|
||||||
} else if (!strcmp(*argv, "-out")) {
|
infile= *(++argv);
|
||||||
if (--argc < 1)
|
} else if (!strcmp(*argv,"-out")) {
|
||||||
badarg = 1;
|
if (--argc < 1)
|
||||||
else
|
badarg = 1;
|
||||||
outfile = *(++argv);
|
else
|
||||||
} else if (!strcmp(*argv, "-inkey")) {
|
outfile= *(++argv);
|
||||||
if (--argc < 1)
|
} else if(!strcmp(*argv, "-inkey")) {
|
||||||
badarg = 1;
|
if (--argc < 1)
|
||||||
else
|
badarg = 1;
|
||||||
keyfile = *(++argv);
|
else
|
||||||
} else if (!strcmp(*argv, "-passin")) {
|
keyfile = *(++argv);
|
||||||
if (--argc < 1)
|
} else if (!strcmp(*argv,"-passin")) {
|
||||||
badarg = 1;
|
if (--argc < 1)
|
||||||
else
|
badarg = 1;
|
||||||
passargin = *(++argv);
|
else
|
||||||
} else if (strcmp(*argv, "-keyform") == 0) {
|
passargin= *(++argv);
|
||||||
if (--argc < 1)
|
} else if (strcmp(*argv,"-keyform") == 0) {
|
||||||
badarg = 1;
|
if (--argc < 1)
|
||||||
else
|
badarg = 1;
|
||||||
keyform = str2fmt(*(++argv));
|
else
|
||||||
# ifndef OPENSSL_NO_ENGINE
|
keyform=str2fmt(*(++argv));
|
||||||
} else if (!strcmp(*argv, "-engine")) {
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
if (--argc < 1)
|
} else if(!strcmp(*argv, "-engine")) {
|
||||||
badarg = 1;
|
if (--argc < 1)
|
||||||
else
|
badarg = 1;
|
||||||
engine = *(++argv);
|
else
|
||||||
# endif
|
engine = *(++argv);
|
||||||
} else if (!strcmp(*argv, "-pubin")) {
|
#endif
|
||||||
key_type = KEY_PUBKEY;
|
} else if(!strcmp(*argv, "-pubin")) {
|
||||||
} else if (!strcmp(*argv, "-certin")) {
|
key_type = KEY_PUBKEY;
|
||||||
key_type = KEY_CERT;
|
} else if(!strcmp(*argv, "-certin")) {
|
||||||
} else if (!strcmp(*argv, "-asn1parse"))
|
key_type = KEY_CERT;
|
||||||
asn1parse = 1;
|
}
|
||||||
else if (!strcmp(*argv, "-hexdump"))
|
else if(!strcmp(*argv, "-asn1parse")) asn1parse = 1;
|
||||||
hexdump = 1;
|
else if(!strcmp(*argv, "-hexdump")) hexdump = 1;
|
||||||
else if (!strcmp(*argv, "-raw"))
|
else if(!strcmp(*argv, "-raw")) pad = RSA_NO_PADDING;
|
||||||
pad = RSA_NO_PADDING;
|
else if(!strcmp(*argv, "-oaep")) pad = RSA_PKCS1_OAEP_PADDING;
|
||||||
else if (!strcmp(*argv, "-oaep"))
|
else if(!strcmp(*argv, "-ssl")) pad = RSA_SSLV23_PADDING;
|
||||||
pad = RSA_PKCS1_OAEP_PADDING;
|
else if(!strcmp(*argv, "-pkcs")) pad = RSA_PKCS1_PADDING;
|
||||||
else if (!strcmp(*argv, "-ssl"))
|
else if(!strcmp(*argv, "-x931")) pad = RSA_X931_PADDING;
|
||||||
pad = RSA_SSLV23_PADDING;
|
else if(!strcmp(*argv, "-sign")) {
|
||||||
else if (!strcmp(*argv, "-pkcs"))
|
rsa_mode = RSA_SIGN;
|
||||||
pad = RSA_PKCS1_PADDING;
|
need_priv = 1;
|
||||||
else if (!strcmp(*argv, "-x931"))
|
} else if(!strcmp(*argv, "-verify")) rsa_mode = RSA_VERIFY;
|
||||||
pad = RSA_X931_PADDING;
|
else if(!strcmp(*argv, "-rev")) rev = 1;
|
||||||
else if (!strcmp(*argv, "-sign")) {
|
else if(!strcmp(*argv, "-encrypt")) rsa_mode = RSA_ENCRYPT;
|
||||||
rsa_mode = RSA_SIGN;
|
else if(!strcmp(*argv, "-decrypt")) {
|
||||||
need_priv = 1;
|
rsa_mode = RSA_DECRYPT;
|
||||||
} else if (!strcmp(*argv, "-verify"))
|
need_priv = 1;
|
||||||
rsa_mode = RSA_VERIFY;
|
} else badarg = 1;
|
||||||
else if (!strcmp(*argv, "-rev"))
|
if(badarg) {
|
||||||
rev = 1;
|
usage();
|
||||||
else if (!strcmp(*argv, "-encrypt"))
|
goto end;
|
||||||
rsa_mode = RSA_ENCRYPT;
|
}
|
||||||
else if (!strcmp(*argv, "-decrypt")) {
|
argc--;
|
||||||
rsa_mode = RSA_DECRYPT;
|
argv++;
|
||||||
need_priv = 1;
|
}
|
||||||
} else
|
|
||||||
badarg = 1;
|
|
||||||
if (badarg) {
|
|
||||||
usage();
|
|
||||||
goto end;
|
|
||||||
}
|
|
||||||
argc--;
|
|
||||||
argv++;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (need_priv && (key_type != KEY_PRIVKEY)) {
|
if(need_priv && (key_type != KEY_PRIVKEY)) {
|
||||||
BIO_printf(bio_err, "A private key is needed for this operation\n");
|
BIO_printf(bio_err, "A private key is needed for this operation\n");
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
# ifndef OPENSSL_NO_ENGINE
|
|
||||||
e = setup_engine(bio_err, engine, 0);
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
# endif
|
e = setup_engine(bio_err, engine, 0);
|
||||||
if (!app_passwd(bio_err, passargin, NULL, &passin, NULL)) {
|
#endif
|
||||||
BIO_printf(bio_err, "Error getting password\n");
|
if(!app_passwd(bio_err, passargin, NULL, &passin, NULL)) {
|
||||||
goto end;
|
BIO_printf(bio_err, "Error getting password\n");
|
||||||
}
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
/* FIXME: seed PRNG only if needed */
|
/* FIXME: seed PRNG only if needed */
|
||||||
app_RAND_load_file(NULL, bio_err, 0);
|
app_RAND_load_file(NULL, bio_err, 0);
|
||||||
|
|
||||||
switch (key_type) {
|
switch(key_type) {
|
||||||
case KEY_PRIVKEY:
|
case KEY_PRIVKEY:
|
||||||
pkey = load_key(bio_err, keyfile, keyform, 0,
|
pkey = load_key(bio_err, keyfile, keyform, 0,
|
||||||
passin, e, "Private Key");
|
passin, e, "Private Key");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case KEY_PUBKEY:
|
case KEY_PUBKEY:
|
||||||
pkey = load_pubkey(bio_err, keyfile, keyform, 0,
|
pkey = load_pubkey(bio_err, keyfile, keyform, 0,
|
||||||
NULL, e, "Public Key");
|
NULL, e, "Public Key");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case KEY_CERT:
|
case KEY_CERT:
|
||||||
x = load_cert(bio_err, keyfile, keyform, NULL, e, "Certificate");
|
x = load_cert(bio_err, keyfile, keyform,
|
||||||
if (x) {
|
NULL, e, "Certificate");
|
||||||
pkey = X509_get_pubkey(x);
|
if(x) {
|
||||||
X509_free(x);
|
pkey = X509_get_pubkey(x);
|
||||||
}
|
X509_free(x);
|
||||||
break;
|
}
|
||||||
}
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
if (!pkey) {
|
if(!pkey) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
rsa = EVP_PKEY_get1_RSA(pkey);
|
rsa = EVP_PKEY_get1_RSA(pkey);
|
||||||
EVP_PKEY_free(pkey);
|
EVP_PKEY_free(pkey);
|
||||||
|
|
||||||
if (!rsa) {
|
if(!rsa) {
|
||||||
BIO_printf(bio_err, "Error getting RSA key\n");
|
BIO_printf(bio_err, "Error getting RSA key\n");
|
||||||
ERR_print_errors(bio_err);
|
ERR_print_errors(bio_err);
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (infile) {
|
|
||||||
if (!(in = BIO_new_file(infile, "rb"))) {
|
|
||||||
BIO_printf(bio_err, "Error Reading Input File\n");
|
|
||||||
ERR_print_errors(bio_err);
|
|
||||||
goto end;
|
|
||||||
}
|
|
||||||
} else
|
|
||||||
in = BIO_new_fp(stdin, BIO_NOCLOSE);
|
|
||||||
|
|
||||||
if (outfile) {
|
if(infile) {
|
||||||
if (!(out = BIO_new_file(outfile, "wb"))) {
|
if(!(in = BIO_new_file(infile, "rb"))) {
|
||||||
BIO_printf(bio_err, "Error Reading Output File\n");
|
BIO_printf(bio_err, "Error Reading Input File\n");
|
||||||
ERR_print_errors(bio_err);
|
ERR_print_errors(bio_err);
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
} else {
|
} else in = BIO_new_fp(stdin, BIO_NOCLOSE);
|
||||||
out = BIO_new_fp(stdout, BIO_NOCLOSE);
|
|
||||||
# ifdef OPENSSL_SYS_VMS
|
|
||||||
{
|
|
||||||
BIO *tmpbio = BIO_new(BIO_f_linebuffer());
|
|
||||||
out = BIO_push(tmpbio, out);
|
|
||||||
}
|
|
||||||
# endif
|
|
||||||
}
|
|
||||||
|
|
||||||
keysize = RSA_size(rsa);
|
if(outfile) {
|
||||||
|
if(!(out = BIO_new_file(outfile, "wb"))) {
|
||||||
|
BIO_printf(bio_err, "Error Reading Output File\n");
|
||||||
|
ERR_print_errors(bio_err);
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
out = BIO_new_fp(stdout, BIO_NOCLOSE);
|
||||||
|
#ifdef OPENSSL_SYS_VMS
|
||||||
|
{
|
||||||
|
BIO *tmpbio = BIO_new(BIO_f_linebuffer());
|
||||||
|
out = BIO_push(tmpbio, out);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
rsa_in = OPENSSL_malloc(keysize * 2);
|
keysize = RSA_size(rsa);
|
||||||
rsa_out = OPENSSL_malloc(keysize);
|
|
||||||
if (!rsa_in || !rsa_out) {
|
|
||||||
BIO_printf(bio_err, "Out of memory\n");
|
|
||||||
ERR_print_errors(bio_err);
|
|
||||||
goto end;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Read the input data */
|
rsa_in = OPENSSL_malloc(keysize * 2);
|
||||||
rsa_inlen = BIO_read(in, rsa_in, keysize * 2);
|
rsa_out = OPENSSL_malloc(keysize);
|
||||||
if (rsa_inlen <= 0) {
|
|
||||||
BIO_printf(bio_err, "Error reading input Data\n");
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
if (rev) {
|
|
||||||
int i;
|
|
||||||
unsigned char ctmp;
|
|
||||||
for (i = 0; i < rsa_inlen / 2; i++) {
|
|
||||||
ctmp = rsa_in[i];
|
|
||||||
rsa_in[i] = rsa_in[rsa_inlen - 1 - i];
|
|
||||||
rsa_in[rsa_inlen - 1 - i] = ctmp;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
switch (rsa_mode) {
|
|
||||||
|
|
||||||
case RSA_VERIFY:
|
/* Read the input data */
|
||||||
rsa_outlen = RSA_public_decrypt(rsa_inlen, rsa_in, rsa_out, rsa, pad);
|
rsa_inlen = BIO_read(in, rsa_in, keysize * 2);
|
||||||
break;
|
if(rsa_inlen <= 0) {
|
||||||
|
BIO_printf(bio_err, "Error reading input Data\n");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
if(rev) {
|
||||||
|
int i;
|
||||||
|
unsigned char ctmp;
|
||||||
|
for(i = 0; i < rsa_inlen/2; i++) {
|
||||||
|
ctmp = rsa_in[i];
|
||||||
|
rsa_in[i] = rsa_in[rsa_inlen - 1 - i];
|
||||||
|
rsa_in[rsa_inlen - 1 - i] = ctmp;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
switch(rsa_mode) {
|
||||||
|
|
||||||
case RSA_SIGN:
|
case RSA_VERIFY:
|
||||||
rsa_outlen =
|
rsa_outlen = RSA_public_decrypt(rsa_inlen, rsa_in, rsa_out, rsa, pad);
|
||||||
RSA_private_encrypt(rsa_inlen, rsa_in, rsa_out, rsa, pad);
|
break;
|
||||||
break;
|
|
||||||
|
|
||||||
case RSA_ENCRYPT:
|
case RSA_SIGN:
|
||||||
rsa_outlen = RSA_public_encrypt(rsa_inlen, rsa_in, rsa_out, rsa, pad);
|
rsa_outlen = RSA_private_encrypt(rsa_inlen, rsa_in, rsa_out, rsa, pad);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RSA_DECRYPT:
|
case RSA_ENCRYPT:
|
||||||
rsa_outlen =
|
rsa_outlen = RSA_public_encrypt(rsa_inlen, rsa_in, rsa_out, rsa, pad);
|
||||||
RSA_private_decrypt(rsa_inlen, rsa_in, rsa_out, rsa, pad);
|
break;
|
||||||
break;
|
|
||||||
|
|
||||||
}
|
case RSA_DECRYPT:
|
||||||
|
rsa_outlen = RSA_private_decrypt(rsa_inlen, rsa_in, rsa_out, rsa, pad);
|
||||||
|
break;
|
||||||
|
|
||||||
if (rsa_outlen <= 0) {
|
}
|
||||||
BIO_printf(bio_err, "RSA operation error\n");
|
|
||||||
ERR_print_errors(bio_err);
|
if(rsa_outlen <= 0) {
|
||||||
goto end;
|
BIO_printf(bio_err, "RSA operation error\n");
|
||||||
}
|
ERR_print_errors(bio_err);
|
||||||
ret = 0;
|
goto end;
|
||||||
if (asn1parse) {
|
}
|
||||||
if (!ASN1_parse_dump(out, rsa_out, rsa_outlen, 1, -1)) {
|
ret = 0;
|
||||||
ERR_print_errors(bio_err);
|
if(asn1parse) {
|
||||||
}
|
if(!ASN1_parse_dump(out, rsa_out, rsa_outlen, 1, -1)) {
|
||||||
} else if (hexdump)
|
ERR_print_errors(bio_err);
|
||||||
BIO_dump(out, (char *)rsa_out, rsa_outlen);
|
}
|
||||||
else
|
} else if(hexdump) BIO_dump(out, (char *)rsa_out, rsa_outlen);
|
||||||
BIO_write(out, rsa_out, rsa_outlen);
|
else BIO_write(out, rsa_out, rsa_outlen);
|
||||||
end:
|
end:
|
||||||
RSA_free(rsa);
|
RSA_free(rsa);
|
||||||
BIO_free(in);
|
BIO_free(in);
|
||||||
BIO_free_all(out);
|
BIO_free_all(out);
|
||||||
if (rsa_in)
|
if(rsa_in) OPENSSL_free(rsa_in);
|
||||||
OPENSSL_free(rsa_in);
|
if(rsa_out) OPENSSL_free(rsa_out);
|
||||||
if (rsa_out)
|
if(passin) OPENSSL_free(passin);
|
||||||
OPENSSL_free(rsa_out);
|
return ret;
|
||||||
if (passin)
|
|
||||||
OPENSSL_free(passin);
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void usage()
|
static void usage()
|
||||||
{
|
{
|
||||||
BIO_printf(bio_err, "Usage: rsautl [options]\n");
|
BIO_printf(bio_err, "Usage: rsautl [options]\n");
|
||||||
BIO_printf(bio_err, "-in file input file\n");
|
BIO_printf(bio_err, "-in file input file\n");
|
||||||
BIO_printf(bio_err, "-out file output file\n");
|
BIO_printf(bio_err, "-out file output file\n");
|
||||||
BIO_printf(bio_err, "-inkey file input key\n");
|
BIO_printf(bio_err, "-inkey file input key\n");
|
||||||
BIO_printf(bio_err, "-keyform arg private key format - default PEM\n");
|
BIO_printf(bio_err, "-keyform arg private key format - default PEM\n");
|
||||||
BIO_printf(bio_err, "-pubin input is an RSA public\n");
|
BIO_printf(bio_err, "-pubin input is an RSA public\n");
|
||||||
BIO_printf(bio_err,
|
BIO_printf(bio_err, "-certin input is a certificate carrying an RSA public key\n");
|
||||||
"-certin input is a certificate carrying an RSA public key\n");
|
BIO_printf(bio_err, "-ssl use SSL v2 padding\n");
|
||||||
BIO_printf(bio_err, "-ssl use SSL v2 padding\n");
|
BIO_printf(bio_err, "-raw use no padding\n");
|
||||||
BIO_printf(bio_err, "-raw use no padding\n");
|
BIO_printf(bio_err, "-pkcs use PKCS#1 v1.5 padding (default)\n");
|
||||||
BIO_printf(bio_err,
|
BIO_printf(bio_err, "-oaep use PKCS#1 OAEP\n");
|
||||||
"-pkcs use PKCS#1 v1.5 padding (default)\n");
|
BIO_printf(bio_err, "-sign sign with private key\n");
|
||||||
BIO_printf(bio_err, "-oaep use PKCS#1 OAEP\n");
|
BIO_printf(bio_err, "-verify verify with public key\n");
|
||||||
BIO_printf(bio_err, "-sign sign with private key\n");
|
BIO_printf(bio_err, "-encrypt encrypt with public key\n");
|
||||||
BIO_printf(bio_err, "-verify verify with public key\n");
|
BIO_printf(bio_err, "-decrypt decrypt with private key\n");
|
||||||
BIO_printf(bio_err, "-encrypt encrypt with public key\n");
|
BIO_printf(bio_err, "-hexdump hex dump output\n");
|
||||||
BIO_printf(bio_err, "-decrypt decrypt with private key\n");
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
BIO_printf(bio_err, "-hexdump hex dump output\n");
|
BIO_printf(bio_err, "-engine e use engine e, possibly a hardware device.\n");
|
||||||
# ifndef OPENSSL_NO_ENGINE
|
BIO_printf (bio_err, "-passin arg pass phrase source\n");
|
||||||
BIO_printf(bio_err,
|
#endif
|
||||||
"-engine e use engine e, possibly a hardware device.\n");
|
|
||||||
BIO_printf(bio_err, "-passin arg pass phrase source\n");
|
|
||||||
# endif
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#else /* !OPENSSL_NO_RSA */
|
#else /* !OPENSSL_NO_RSA */
|
||||||
|
|
||||||
# if PEDANTIC
|
# if PEDANTIC
|
||||||
static void *dummy = &dummy;
|
static void *dummy=&dummy;
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -108,52 +108,47 @@
|
|||||||
* Hudson (tjh@cryptsoft.com).
|
* Hudson (tjh@cryptsoft.com).
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
/* conflicts with winsock2 stuff on netware */
|
#if !defined(OPENSSL_SYS_NETWARE) /* conflicts with winsock2 stuff on netware */
|
||||||
#if !defined(OPENSSL_SYS_NETWARE)
|
#include <sys/types.h>
|
||||||
# include <sys/types.h>
|
|
||||||
#endif
|
#endif
|
||||||
#include <openssl/opensslconf.h>
|
#include <openssl/opensslconf.h>
|
||||||
|
|
||||||
#if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_MSDOS)
|
#if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_MSDOS)
|
||||||
# include <conio.h>
|
#include <conio.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(OPENSSL_SYS_MSDOS) && !defined(_WIN32)
|
#if defined(OPENSSL_SYS_MSDOS) && !defined(_WIN32)
|
||||||
# define _kbhit kbhit
|
#define _kbhit kbhit
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(OPENSSL_SYS_VMS) && !defined(FD_SET)
|
#if defined(OPENSSL_SYS_VMS) && !defined(FD_SET)
|
||||||
/*
|
/* VAX C does not defined fd_set and friends, but it's actually quite simple */
|
||||||
* VAX C does not defined fd_set and friends, but it's actually quite simple
|
/* These definitions are borrowed from SOCKETSHR. /Richard Levitte */
|
||||||
*/
|
#define MAX_NOFILE 32
|
||||||
/* These definitions are borrowed from SOCKETSHR. /Richard Levitte */
|
#define NBBY 8 /* number of bits in a byte */
|
||||||
# define MAX_NOFILE 32
|
|
||||||
# define NBBY 8 /* number of bits in a byte */
|
|
||||||
|
|
||||||
# ifndef FD_SETSIZE
|
#ifndef FD_SETSIZE
|
||||||
# define FD_SETSIZE MAX_NOFILE
|
#define FD_SETSIZE MAX_NOFILE
|
||||||
# endif /* FD_SETSIZE */
|
#endif /* FD_SETSIZE */
|
||||||
|
|
||||||
/* How many things we'll allow select to use. 0 if unlimited */
|
/* How many things we'll allow select to use. 0 if unlimited */
|
||||||
# define MAXSELFD MAX_NOFILE
|
#define MAXSELFD MAX_NOFILE
|
||||||
typedef int fd_mask; /* int here! VMS prototypes int, not long */
|
typedef int fd_mask; /* int here! VMS prototypes int, not long */
|
||||||
# define NFDBITS (sizeof(fd_mask) * NBBY)/* bits per mask (power of 2!) */
|
#define NFDBITS (sizeof(fd_mask) * NBBY) /* bits per mask (power of 2!)*/
|
||||||
# define NFDSHIFT 5 /* Shift based on above */
|
#define NFDSHIFT 5 /* Shift based on above */
|
||||||
|
|
||||||
typedef fd_mask fd_set;
|
typedef fd_mask fd_set;
|
||||||
# define FD_SET(n, p) (*(p) |= (1 << ((n) % NFDBITS)))
|
#define FD_SET(n, p) (*(p) |= (1 << ((n) % NFDBITS)))
|
||||||
# define FD_CLR(n, p) (*(p) &= ~(1 << ((n) % NFDBITS)))
|
#define FD_CLR(n, p) (*(p) &= ~(1 << ((n) % NFDBITS)))
|
||||||
# define FD_ISSET(n, p) (*(p) & (1 << ((n) % NFDBITS)))
|
#define FD_ISSET(n, p) (*(p) & (1 << ((n) % NFDBITS)))
|
||||||
# define FD_ZERO(p) memset((char *)(p), 0, sizeof(*(p)))
|
#define FD_ZERO(p) memset((char *)(p), 0, sizeof(*(p)))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define PORT 4433
|
#define PORT 4433
|
||||||
#define PORT_STR "4433"
|
#define PORT_STR "4433"
|
||||||
#define PROTOCOL "tcp"
|
#define PROTOCOL "tcp"
|
||||||
|
|
||||||
int do_server(int port, int type, int *ret,
|
int do_server(int port, int type, int *ret, int (*cb) (char *hostname, int s, unsigned char *context), unsigned char *context);
|
||||||
int (*cb) (char *hostname, int s, unsigned char *context),
|
|
||||||
unsigned char *context);
|
|
||||||
#ifdef HEADER_X509_H
|
#ifdef HEADER_X509_H
|
||||||
int MS_CALLBACK verify_callback(int ok, X509_STORE_CTX *ctx);
|
int MS_CALLBACK verify_callback(int ok, X509_STORE_CTX *ctx);
|
||||||
#endif
|
#endif
|
||||||
@@ -164,21 +159,18 @@ int set_cert_key_stuff(SSL_CTX *ctx, X509 *cert, EVP_PKEY *key);
|
|||||||
int init_client(int *sock, char *server, int port, int type);
|
int init_client(int *sock, char *server, int port, int type);
|
||||||
int should_retry(int i);
|
int should_retry(int i);
|
||||||
int extract_port(char *str, short *port_ptr);
|
int extract_port(char *str, short *port_ptr);
|
||||||
int extract_host_port(char *str, char **host_ptr, unsigned char *ip,
|
int extract_host_port(char *str,char **host_ptr,unsigned char *ip,short *p);
|
||||||
short *p);
|
|
||||||
|
|
||||||
long MS_CALLBACK bio_dump_callback(BIO *bio, int cmd, const char *argp,
|
long MS_CALLBACK bio_dump_callback(BIO *bio, int cmd, const char *argp,
|
||||||
int argi, long argl, long ret);
|
int argi, long argl, long ret);
|
||||||
|
|
||||||
#ifdef HEADER_SSL_H
|
#ifdef HEADER_SSL_H
|
||||||
void MS_CALLBACK apps_ssl_info_callback(const SSL *s, int where, int ret);
|
void MS_CALLBACK apps_ssl_info_callback(const SSL *s, int where, int ret);
|
||||||
void MS_CALLBACK msg_cb(int write_p, int version, int content_type,
|
void MS_CALLBACK msg_cb(int write_p, int version, int content_type, const void *buf, size_t len, SSL *ssl, void *arg);
|
||||||
const void *buf, size_t len, SSL *ssl, void *arg);
|
|
||||||
void MS_CALLBACK tlsext_cb(SSL *s, int client_server, int type,
|
void MS_CALLBACK tlsext_cb(SSL *s, int client_server, int type,
|
||||||
unsigned char *data, int len, void *arg);
|
unsigned char *data, int len,
|
||||||
|
void *arg);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int MS_CALLBACK generate_cookie_callback(SSL *ssl, unsigned char *cookie,
|
int MS_CALLBACK generate_cookie_callback(SSL *ssl, unsigned char *cookie, unsigned int *cookie_len);
|
||||||
unsigned int *cookie_len);
|
int MS_CALLBACK verify_cookie_callback(SSL *ssl, unsigned char *cookie, unsigned int cookie_len);
|
||||||
int MS_CALLBACK verify_cookie_callback(SSL *ssl, unsigned char *cookie,
|
|
||||||
unsigned int cookie_len);
|
|
||||||
|
|||||||
1314
apps/s_cb.c
1314
apps/s_cb.c
File diff suppressed because it is too large
Load Diff
3126
apps/s_client.c
3126
apps/s_client.c
File diff suppressed because it is too large
Load Diff
4431
apps/s_server.c
4431
apps/s_server.c
File diff suppressed because it is too large
Load Diff
906
apps/s_socket.c
906
apps/s_socket.c
File diff suppressed because it is too large
Load Diff
743
apps/s_time.c
743
apps/s_time.c
@@ -58,7 +58,7 @@
|
|||||||
|
|
||||||
#define NO_SHUTDOWN
|
#define NO_SHUTDOWN
|
||||||
|
|
||||||
/* ----------------------------------------
|
/*-----------------------------------------
|
||||||
s_time - SSL client connection timer program
|
s_time - SSL client connection timer program
|
||||||
Written and donated by Larry Streepy <streepy@healthcare.com>
|
Written and donated by Larry Streepy <streepy@healthcare.com>
|
||||||
-----------------------------------------*/
|
-----------------------------------------*/
|
||||||
@@ -70,7 +70,7 @@
|
|||||||
#define USE_SOCKETS
|
#define USE_SOCKETS
|
||||||
#include "apps.h"
|
#include "apps.h"
|
||||||
#ifdef OPENSSL_NO_STDIO
|
#ifdef OPENSSL_NO_STDIO
|
||||||
# define APPS_WIN16
|
#define APPS_WIN16
|
||||||
#endif
|
#endif
|
||||||
#include <openssl/x509.h>
|
#include <openssl/x509.h>
|
||||||
#include <openssl/ssl.h>
|
#include <openssl/ssl.h>
|
||||||
@@ -78,11 +78,11 @@
|
|||||||
#include "s_apps.h"
|
#include "s_apps.h"
|
||||||
#include <openssl/err.h>
|
#include <openssl/err.h>
|
||||||
#ifdef WIN32_STUFF
|
#ifdef WIN32_STUFF
|
||||||
# include "winmain.h"
|
#include "winmain.h"
|
||||||
# include "wintext.h"
|
#include "wintext.h"
|
||||||
#endif
|
#endif
|
||||||
#if !defined(OPENSSL_SYS_MSDOS)
|
#if !defined(OPENSSL_SYS_MSDOS)
|
||||||
# include OPENSSL_UNISTD
|
#include OPENSSL_UNISTD
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#undef PROG
|
#undef PROG
|
||||||
@@ -91,12 +91,9 @@
|
|||||||
#undef ioctl
|
#undef ioctl
|
||||||
#define ioctl ioctlsocket
|
#define ioctl ioctlsocket
|
||||||
|
|
||||||
#define SSL_CONNECT_NAME "localhost:4433"
|
#define SSL_CONNECT_NAME "localhost:4433"
|
||||||
|
|
||||||
/* no default cert. */
|
/*#define TEST_CERT "client.pem" */ /* no default cert. */
|
||||||
/*
|
|
||||||
* #define TEST_CERT "client.pem"
|
|
||||||
*/
|
|
||||||
|
|
||||||
#undef BUFSIZZ
|
#undef BUFSIZZ
|
||||||
#define BUFSIZZ 1024*10
|
#define BUFSIZZ 1024*10
|
||||||
@@ -109,13 +106,13 @@
|
|||||||
#define max(a,b) (((a) > (b)) ? (a) : (b))
|
#define max(a,b) (((a) > (b)) ? (a) : (b))
|
||||||
|
|
||||||
#undef SECONDS
|
#undef SECONDS
|
||||||
#define SECONDS 30
|
#define SECONDS 30
|
||||||
extern int verify_depth;
|
extern int verify_depth;
|
||||||
extern int verify_error;
|
extern int verify_error;
|
||||||
|
|
||||||
static void s_time_usage(void);
|
static void s_time_usage(void);
|
||||||
static int parseArgs(int argc, char **argv);
|
static int parseArgs( int argc, char **argv );
|
||||||
static SSL *doConnection(SSL *scon);
|
static SSL *doConnection( SSL *scon );
|
||||||
static void s_time_init(void);
|
static void s_time_init(void);
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
@@ -123,58 +120,58 @@ static void s_time_init(void);
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/* static char *port=PORT_STR;*/
|
/* static char *port=PORT_STR;*/
|
||||||
static char *host = SSL_CONNECT_NAME;
|
static char *host=SSL_CONNECT_NAME;
|
||||||
static char *t_cert_file = NULL;
|
static char *t_cert_file=NULL;
|
||||||
static char *t_key_file = NULL;
|
static char *t_key_file=NULL;
|
||||||
static char *CApath = NULL;
|
static char *CApath=NULL;
|
||||||
static char *CAfile = NULL;
|
static char *CAfile=NULL;
|
||||||
static char *tm_cipher = NULL;
|
static char *tm_cipher=NULL;
|
||||||
static int tm_verify = SSL_VERIFY_NONE;
|
static int tm_verify = SSL_VERIFY_NONE;
|
||||||
static int maxTime = SECONDS;
|
static int maxTime = SECONDS;
|
||||||
static SSL_CTX *tm_ctx = NULL;
|
static SSL_CTX *tm_ctx=NULL;
|
||||||
static const SSL_METHOD *s_time_meth = NULL;
|
static const SSL_METHOD *s_time_meth=NULL;
|
||||||
static char *s_www_path = NULL;
|
static char *s_www_path=NULL;
|
||||||
static long bytes_read = 0;
|
static long bytes_read=0;
|
||||||
static int st_bugs = 0;
|
static int st_bugs=0;
|
||||||
static int perform = 0;
|
static int perform=0;
|
||||||
#ifdef FIONBIO
|
#ifdef FIONBIO
|
||||||
static int t_nbio = 0;
|
static int t_nbio=0;
|
||||||
#endif
|
#endif
|
||||||
#ifdef OPENSSL_SYS_WIN32
|
#ifdef OPENSSL_SYS_WIN32
|
||||||
static int exitNow = 0; /* Set when it's time to exit main */
|
static int exitNow = 0; /* Set when it's time to exit main */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void s_time_init(void)
|
static void s_time_init(void)
|
||||||
{
|
{
|
||||||
host = SSL_CONNECT_NAME;
|
host=SSL_CONNECT_NAME;
|
||||||
t_cert_file = NULL;
|
t_cert_file=NULL;
|
||||||
t_key_file = NULL;
|
t_key_file=NULL;
|
||||||
CApath = NULL;
|
CApath=NULL;
|
||||||
CAfile = NULL;
|
CAfile=NULL;
|
||||||
tm_cipher = NULL;
|
tm_cipher=NULL;
|
||||||
tm_verify = SSL_VERIFY_NONE;
|
tm_verify = SSL_VERIFY_NONE;
|
||||||
maxTime = SECONDS;
|
maxTime = SECONDS;
|
||||||
tm_ctx = NULL;
|
tm_ctx=NULL;
|
||||||
s_time_meth = NULL;
|
s_time_meth=NULL;
|
||||||
s_www_path = NULL;
|
s_www_path=NULL;
|
||||||
bytes_read = 0;
|
bytes_read=0;
|
||||||
st_bugs = 0;
|
st_bugs=0;
|
||||||
perform = 0;
|
perform=0;
|
||||||
|
|
||||||
#ifdef FIONBIO
|
#ifdef FIONBIO
|
||||||
t_nbio = 0;
|
t_nbio=0;
|
||||||
#endif
|
#endif
|
||||||
#ifdef OPENSSL_SYS_WIN32
|
#ifdef OPENSSL_SYS_WIN32
|
||||||
exitNow = 0; /* Set when it's time to exit main */
|
exitNow = 0; /* Set when it's time to exit main */
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* usage - display usage message
|
* usage - display usage message
|
||||||
*/
|
*/
|
||||||
static void s_time_usage(void)
|
static void s_time_usage(void)
|
||||||
{
|
{
|
||||||
static char umsg[] = "\
|
static char umsg[] = "\
|
||||||
-time arg - max number of seconds to collect data, default %d\n\
|
-time arg - max number of seconds to collect data, default %d\n\
|
||||||
-verify arg - turn on peer certificate verification, arg == depth\n\
|
-verify arg - turn on peer certificate verification, arg == depth\n\
|
||||||
-cert arg - certificate file to use, PEM format assumed\n\
|
-cert arg - certificate file to use, PEM format assumed\n\
|
||||||
@@ -184,20 +181,19 @@ static void s_time_usage(void)
|
|||||||
-CAfile arg - PEM format file of CA's\n\
|
-CAfile arg - PEM format file of CA's\n\
|
||||||
-cipher - preferred cipher to use, play with 'openssl ciphers'\n\n";
|
-cipher - preferred cipher to use, play with 'openssl ciphers'\n\n";
|
||||||
|
|
||||||
printf("usage: s_time <args>\n\n");
|
printf( "usage: s_time <args>\n\n" );
|
||||||
|
|
||||||
printf("-connect host:port - host:port to connect to (default is %s)\n",
|
printf("-connect host:port - host:port to connect to (default is %s)\n",SSL_CONNECT_NAME);
|
||||||
SSL_CONNECT_NAME);
|
|
||||||
#ifdef FIONBIO
|
#ifdef FIONBIO
|
||||||
printf("-nbio - Run with non-blocking IO\n");
|
printf("-nbio - Run with non-blocking IO\n");
|
||||||
printf("-ssl2 - Just use SSLv2\n");
|
printf("-ssl2 - Just use SSLv2\n");
|
||||||
printf("-ssl3 - Just use SSLv3\n");
|
printf("-ssl3 - Just use SSLv3\n");
|
||||||
printf("-bugs - Turn on SSL bug compatibility\n");
|
printf("-bugs - Turn on SSL bug compatibility\n");
|
||||||
printf("-new - Just time new connections\n");
|
printf("-new - Just time new connections\n");
|
||||||
printf("-reuse - Just time connection reuse\n");
|
printf("-reuse - Just time connection reuse\n");
|
||||||
printf("-www page - Retrieve 'page' from the site\n");
|
printf("-www page - Retrieve 'page' from the site\n");
|
||||||
#endif
|
#endif
|
||||||
printf(umsg, SECONDS);
|
printf( umsg,SECONDS );
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
@@ -209,433 +205,428 @@ static int parseArgs(int argc, char **argv)
|
|||||||
{
|
{
|
||||||
int badop = 0;
|
int badop = 0;
|
||||||
|
|
||||||
verify_depth = 0;
|
verify_depth=0;
|
||||||
verify_error = X509_V_OK;
|
verify_error=X509_V_OK;
|
||||||
|
|
||||||
argc--;
|
argc--;
|
||||||
argv++;
|
argv++;
|
||||||
|
|
||||||
while (argc >= 1) {
|
while (argc >= 1) {
|
||||||
if (strcmp(*argv, "-connect") == 0) {
|
if (strcmp(*argv,"-connect") == 0)
|
||||||
if (--argc < 1)
|
{
|
||||||
goto bad;
|
if (--argc < 1) goto bad;
|
||||||
host = *(++argv);
|
host= *(++argv);
|
||||||
}
|
}
|
||||||
#if 0
|
#if 0
|
||||||
else if (strcmp(*argv, "-host") == 0) {
|
else if( strcmp(*argv,"-host") == 0)
|
||||||
if (--argc < 1)
|
{
|
||||||
goto bad;
|
if (--argc < 1) goto bad;
|
||||||
host = *(++argv);
|
host= *(++argv);
|
||||||
} else if (strcmp(*argv, "-port") == 0) {
|
}
|
||||||
if (--argc < 1)
|
else if( strcmp(*argv,"-port") == 0)
|
||||||
goto bad;
|
{
|
||||||
port = *(++argv);
|
if (--argc < 1) goto bad;
|
||||||
}
|
port= *(++argv);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
else if (strcmp(*argv, "-reuse") == 0)
|
else if (strcmp(*argv,"-reuse") == 0)
|
||||||
perform = 2;
|
perform=2;
|
||||||
else if (strcmp(*argv, "-new") == 0)
|
else if (strcmp(*argv,"-new") == 0)
|
||||||
perform = 1;
|
perform=1;
|
||||||
else if (strcmp(*argv, "-verify") == 0) {
|
else if( strcmp(*argv,"-verify") == 0) {
|
||||||
|
|
||||||
tm_verify = SSL_VERIFY_PEER | SSL_VERIFY_CLIENT_ONCE;
|
tm_verify=SSL_VERIFY_PEER|SSL_VERIFY_CLIENT_ONCE;
|
||||||
if (--argc < 1)
|
if (--argc < 1) goto bad;
|
||||||
goto bad;
|
verify_depth=atoi(*(++argv));
|
||||||
verify_depth = atoi(*(++argv));
|
BIO_printf(bio_err,"verify depth is %d\n",verify_depth);
|
||||||
BIO_printf(bio_err, "verify depth is %d\n", verify_depth);
|
|
||||||
|
|
||||||
} else if (strcmp(*argv, "-cert") == 0) {
|
} else if( strcmp(*argv,"-cert") == 0) {
|
||||||
|
|
||||||
if (--argc < 1)
|
if (--argc < 1) goto bad;
|
||||||
goto bad;
|
t_cert_file= *(++argv);
|
||||||
t_cert_file = *(++argv);
|
|
||||||
|
|
||||||
} else if (strcmp(*argv, "-key") == 0) {
|
} else if( strcmp(*argv,"-key") == 0) {
|
||||||
|
|
||||||
if (--argc < 1)
|
if (--argc < 1) goto bad;
|
||||||
goto bad;
|
t_key_file= *(++argv);
|
||||||
t_key_file = *(++argv);
|
|
||||||
|
|
||||||
} else if (strcmp(*argv, "-CApath") == 0) {
|
} else if( strcmp(*argv,"-CApath") == 0) {
|
||||||
|
|
||||||
if (--argc < 1)
|
if (--argc < 1) goto bad;
|
||||||
goto bad;
|
CApath= *(++argv);
|
||||||
CApath = *(++argv);
|
|
||||||
|
|
||||||
} else if (strcmp(*argv, "-CAfile") == 0) {
|
} else if( strcmp(*argv,"-CAfile") == 0) {
|
||||||
|
|
||||||
if (--argc < 1)
|
if (--argc < 1) goto bad;
|
||||||
goto bad;
|
CAfile= *(++argv);
|
||||||
CAfile = *(++argv);
|
|
||||||
|
|
||||||
} else if (strcmp(*argv, "-cipher") == 0) {
|
} else if( strcmp(*argv,"-cipher") == 0) {
|
||||||
|
|
||||||
if (--argc < 1)
|
if (--argc < 1) goto bad;
|
||||||
goto bad;
|
tm_cipher= *(++argv);
|
||||||
tm_cipher = *(++argv);
|
}
|
||||||
}
|
|
||||||
#ifdef FIONBIO
|
#ifdef FIONBIO
|
||||||
else if (strcmp(*argv, "-nbio") == 0) {
|
else if(strcmp(*argv,"-nbio") == 0) {
|
||||||
t_nbio = 1;
|
t_nbio=1;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
else if (strcmp(*argv, "-www") == 0) {
|
else if(strcmp(*argv,"-www") == 0)
|
||||||
if (--argc < 1)
|
{
|
||||||
goto bad;
|
if (--argc < 1) goto bad;
|
||||||
s_www_path = *(++argv);
|
s_www_path= *(++argv);
|
||||||
if (strlen(s_www_path) > MYBUFSIZ - 100) {
|
if(strlen(s_www_path) > MYBUFSIZ-100)
|
||||||
BIO_printf(bio_err, "-www option too long\n");
|
{
|
||||||
badop = 1;
|
BIO_printf(bio_err,"-www option too long\n");
|
||||||
}
|
badop=1;
|
||||||
} else if (strcmp(*argv, "-bugs") == 0)
|
}
|
||||||
st_bugs = 1;
|
}
|
||||||
|
else if(strcmp(*argv,"-bugs") == 0)
|
||||||
|
st_bugs=1;
|
||||||
#ifndef OPENSSL_NO_SSL2
|
#ifndef OPENSSL_NO_SSL2
|
||||||
else if (strcmp(*argv, "-ssl2") == 0)
|
else if(strcmp(*argv,"-ssl2") == 0)
|
||||||
s_time_meth = SSLv2_client_method();
|
s_time_meth=SSLv2_client_method();
|
||||||
#endif
|
#endif
|
||||||
#ifndef OPENSSL_NO_SSL3
|
#ifndef OPENSSL_NO_SSL3
|
||||||
else if (strcmp(*argv, "-ssl3") == 0)
|
else if(strcmp(*argv,"-ssl3") == 0)
|
||||||
s_time_meth = SSLv3_client_method();
|
s_time_meth=SSLv3_client_method();
|
||||||
#endif
|
#endif
|
||||||
else if (strcmp(*argv, "-time") == 0) {
|
else if( strcmp(*argv,"-time") == 0) {
|
||||||
|
|
||||||
if (--argc < 1)
|
if (--argc < 1) goto bad;
|
||||||
goto bad;
|
maxTime= atoi(*(++argv));
|
||||||
maxTime = atoi(*(++argv));
|
}
|
||||||
if (maxTime <= 0) {
|
else {
|
||||||
BIO_printf(bio_err, "time must be > 0\n");
|
BIO_printf(bio_err,"unknown option %s\n",*argv);
|
||||||
badop = 1;
|
badop=1;
|
||||||
}
|
break;
|
||||||
} else {
|
}
|
||||||
BIO_printf(bio_err, "unknown option %s\n", *argv);
|
|
||||||
badop = 1;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
argc--;
|
argc--;
|
||||||
argv++;
|
argv++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (perform == 0)
|
if (perform == 0) perform=3;
|
||||||
perform = 3;
|
|
||||||
|
|
||||||
if (badop) {
|
if(badop) {
|
||||||
bad:
|
bad:
|
||||||
s_time_usage();
|
s_time_usage();
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0; /* Valid args */
|
return 0; /* Valid args */
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* TIME - time functions
|
* TIME - time functions
|
||||||
*/
|
*/
|
||||||
#define START 0
|
#define START 0
|
||||||
#define STOP 1
|
#define STOP 1
|
||||||
|
|
||||||
static double tm_Time_F(int s)
|
static double tm_Time_F(int s)
|
||||||
{
|
{
|
||||||
return app_tminterval(s, 1);
|
return app_tminterval(s,1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* MAIN - main processing area for client
|
* MAIN - main processing area for client
|
||||||
* real name depends on MONOLITH
|
* real name depends on MONOLITH
|
||||||
*/
|
*/
|
||||||
int MAIN(int, char **);
|
int MAIN(int, char **);
|
||||||
|
|
||||||
int MAIN(int argc, char **argv)
|
int MAIN(int argc, char **argv)
|
||||||
{
|
{
|
||||||
double totalTime = 0.0;
|
double totalTime = 0.0;
|
||||||
int nConn = 0;
|
int nConn = 0;
|
||||||
SSL *scon = NULL;
|
SSL *scon=NULL;
|
||||||
long finishtime = 0;
|
long finishtime=0;
|
||||||
int ret = 1, i;
|
int ret=1,i;
|
||||||
MS_STATIC char buf[1024 * 8];
|
MS_STATIC char buf[1024*8];
|
||||||
int ver;
|
int ver;
|
||||||
|
|
||||||
apps_startup();
|
apps_startup();
|
||||||
s_time_init();
|
s_time_init();
|
||||||
|
|
||||||
if (bio_err == NULL)
|
if (bio_err == NULL)
|
||||||
bio_err = BIO_new_fp(stderr, BIO_NOCLOSE);
|
bio_err=BIO_new_fp(stderr,BIO_NOCLOSE);
|
||||||
|
|
||||||
s_time_meth = SSLv23_client_method();
|
#if !defined(OPENSSL_NO_SSL2) && !defined(OPENSSL_NO_SSL3)
|
||||||
|
s_time_meth=SSLv23_client_method();
|
||||||
|
#elif !defined(OPENSSL_NO_SSL3)
|
||||||
|
s_time_meth=SSLv3_client_method();
|
||||||
|
#elif !defined(OPENSSL_NO_SSL2)
|
||||||
|
s_time_meth=SSLv2_client_method();
|
||||||
|
#endif
|
||||||
|
|
||||||
/* parse the command line arguments */
|
/* parse the command line arguments */
|
||||||
if (parseArgs(argc, argv) < 0)
|
if( parseArgs( argc, argv ) < 0 )
|
||||||
goto end;
|
goto end;
|
||||||
|
|
||||||
OpenSSL_add_ssl_algorithms();
|
OpenSSL_add_ssl_algorithms();
|
||||||
if ((tm_ctx = SSL_CTX_new(s_time_meth)) == NULL)
|
if ((tm_ctx=SSL_CTX_new(s_time_meth)) == NULL) return(1);
|
||||||
return (1);
|
|
||||||
|
|
||||||
SSL_CTX_set_quiet_shutdown(tm_ctx, 1);
|
SSL_CTX_set_quiet_shutdown(tm_ctx,1);
|
||||||
|
|
||||||
if (st_bugs)
|
if (st_bugs) SSL_CTX_set_options(tm_ctx,SSL_OP_ALL);
|
||||||
SSL_CTX_set_options(tm_ctx, SSL_OP_ALL);
|
SSL_CTX_set_cipher_list(tm_ctx,tm_cipher);
|
||||||
SSL_CTX_set_cipher_list(tm_ctx, tm_cipher);
|
if(!set_cert_stuff(tm_ctx,t_cert_file,t_key_file))
|
||||||
if (!set_cert_stuff(tm_ctx, t_cert_file, t_key_file))
|
goto end;
|
||||||
goto end;
|
|
||||||
|
|
||||||
SSL_load_error_strings();
|
SSL_load_error_strings();
|
||||||
|
|
||||||
if ((!SSL_CTX_load_verify_locations(tm_ctx, CAfile, CApath)) ||
|
if ((!SSL_CTX_load_verify_locations(tm_ctx,CAfile,CApath)) ||
|
||||||
(!SSL_CTX_set_default_verify_paths(tm_ctx))) {
|
(!SSL_CTX_set_default_verify_paths(tm_ctx)))
|
||||||
/*
|
{
|
||||||
* BIO_printf(bio_err,"error setting default verify locations\n");
|
/* BIO_printf(bio_err,"error setting default verify locations\n"); */
|
||||||
*/
|
ERR_print_errors(bio_err);
|
||||||
ERR_print_errors(bio_err);
|
/* goto end; */
|
||||||
/* goto end; */
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (tm_cipher == NULL)
|
if (tm_cipher == NULL)
|
||||||
tm_cipher = getenv("SSL_CIPHER");
|
tm_cipher = getenv("SSL_CIPHER");
|
||||||
|
|
||||||
if (tm_cipher == NULL) {
|
if (tm_cipher == NULL ) {
|
||||||
fprintf(stderr, "No CIPHER specified\n");
|
fprintf( stderr, "No CIPHER specified\n" );
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(perform & 1))
|
if (!(perform & 1)) goto next;
|
||||||
goto next;
|
printf( "Collecting connection statistics for %d seconds\n", maxTime );
|
||||||
printf("Collecting connection statistics for %d seconds\n", maxTime);
|
|
||||||
|
|
||||||
/* Loop and time how long it takes to make connections */
|
/* Loop and time how long it takes to make connections */
|
||||||
|
|
||||||
bytes_read = 0;
|
bytes_read=0;
|
||||||
finishtime = (long)time(NULL) + maxTime;
|
finishtime=(long)time(NULL)+maxTime;
|
||||||
tm_Time_F(START);
|
tm_Time_F(START);
|
||||||
for (;;) {
|
for (;;)
|
||||||
if (finishtime < (long)time(NULL))
|
{
|
||||||
break;
|
if (finishtime < (long)time(NULL)) break;
|
||||||
#ifdef WIN32_STUFF
|
#ifdef WIN32_STUFF
|
||||||
|
|
||||||
if (flushWinMsgs(0) == -1)
|
if( flushWinMsgs(0) == -1 )
|
||||||
goto end;
|
goto end;
|
||||||
|
|
||||||
if (waitingToDie || exitNow) /* we're dead */
|
if( waitingToDie || exitNow ) /* we're dead */
|
||||||
goto end;
|
goto end;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if ((scon = doConnection(NULL)) == NULL)
|
if( (scon = doConnection( NULL )) == NULL )
|
||||||
goto end;
|
goto end;
|
||||||
|
|
||||||
|
if (s_www_path != NULL)
|
||||||
|
{
|
||||||
|
BIO_snprintf(buf,sizeof buf,"GET %s HTTP/1.0\r\n\r\n",s_www_path);
|
||||||
|
SSL_write(scon,buf,strlen(buf));
|
||||||
|
while ((i=SSL_read(scon,buf,sizeof(buf))) > 0)
|
||||||
|
bytes_read+=i;
|
||||||
|
}
|
||||||
|
|
||||||
if (s_www_path != NULL) {
|
|
||||||
BIO_snprintf(buf, sizeof buf, "GET %s HTTP/1.0\r\n\r\n",
|
|
||||||
s_www_path);
|
|
||||||
SSL_write(scon, buf, strlen(buf));
|
|
||||||
while ((i = SSL_read(scon, buf, sizeof(buf))) > 0)
|
|
||||||
bytes_read += i;
|
|
||||||
}
|
|
||||||
#ifdef NO_SHUTDOWN
|
#ifdef NO_SHUTDOWN
|
||||||
SSL_set_shutdown(scon, SSL_SENT_SHUTDOWN | SSL_RECEIVED_SHUTDOWN);
|
SSL_set_shutdown(scon,SSL_SENT_SHUTDOWN|SSL_RECEIVED_SHUTDOWN);
|
||||||
#else
|
#else
|
||||||
SSL_shutdown(scon);
|
SSL_shutdown(scon);
|
||||||
#endif
|
#endif
|
||||||
SHUTDOWN2(SSL_get_fd(scon));
|
SHUTDOWN2(SSL_get_fd(scon));
|
||||||
|
|
||||||
nConn += 1;
|
nConn += 1;
|
||||||
if (SSL_session_reused(scon))
|
if (SSL_session_reused(scon))
|
||||||
ver = 'r';
|
ver='r';
|
||||||
else {
|
else
|
||||||
ver = SSL_version(scon);
|
{
|
||||||
if (ver == TLS1_VERSION)
|
ver=SSL_version(scon);
|
||||||
ver = 't';
|
if (ver == TLS1_VERSION)
|
||||||
else if (ver == SSL3_VERSION)
|
ver='t';
|
||||||
ver = '3';
|
else if (ver == SSL3_VERSION)
|
||||||
else if (ver == SSL2_VERSION)
|
ver='3';
|
||||||
ver = '2';
|
else if (ver == SSL2_VERSION)
|
||||||
else
|
ver='2';
|
||||||
ver = '*';
|
else
|
||||||
}
|
ver='*';
|
||||||
fputc(ver, stdout);
|
}
|
||||||
fflush(stdout);
|
fputc(ver,stdout);
|
||||||
|
fflush(stdout);
|
||||||
|
|
||||||
SSL_free(scon);
|
SSL_free( scon );
|
||||||
scon = NULL;
|
scon=NULL;
|
||||||
}
|
}
|
||||||
totalTime += tm_Time_F(STOP); /* Add the time for this iteration */
|
totalTime += tm_Time_F(STOP); /* Add the time for this iteration */
|
||||||
|
|
||||||
i = (int)((long)time(NULL) - finishtime + maxTime);
|
i=(int)((long)time(NULL)-finishtime+maxTime);
|
||||||
printf
|
printf( "\n\n%d connections in %.2fs; %.2f connections/user sec, bytes read %ld\n", nConn, totalTime, ((double)nConn/totalTime),bytes_read);
|
||||||
("\n\n%d connections in %.2fs; %.2f connections/user sec, bytes read %ld\n",
|
printf( "%d connections in %ld real seconds, %ld bytes read per connection\n",nConn,(long)time(NULL)-finishtime+maxTime,bytes_read/nConn);
|
||||||
nConn, totalTime, ((double)nConn / totalTime), bytes_read);
|
|
||||||
printf
|
|
||||||
("%d connections in %ld real seconds, %ld bytes read per connection\n",
|
|
||||||
nConn, (long)time(NULL) - finishtime + maxTime, bytes_read / nConn);
|
|
||||||
|
|
||||||
/*
|
/* Now loop and time connections using the same session id over and over */
|
||||||
* Now loop and time connections using the same session id over and over
|
|
||||||
*/
|
|
||||||
|
|
||||||
next:
|
next:
|
||||||
if (!(perform & 2))
|
if (!(perform & 2)) goto end;
|
||||||
goto end;
|
printf( "\n\nNow timing with session id reuse.\n" );
|
||||||
printf("\n\nNow timing with session id reuse.\n");
|
|
||||||
|
|
||||||
/* Get an SSL object so we can reuse the session id */
|
/* Get an SSL object so we can reuse the session id */
|
||||||
if ((scon = doConnection(NULL)) == NULL) {
|
if( (scon = doConnection( NULL )) == NULL )
|
||||||
fprintf(stderr, "Unable to get connection\n");
|
{
|
||||||
goto end;
|
fprintf( stderr, "Unable to get connection\n" );
|
||||||
}
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
if (s_www_path != NULL) {
|
if (s_www_path != NULL)
|
||||||
BIO_snprintf(buf, sizeof buf, "GET %s HTTP/1.0\r\n\r\n", s_www_path);
|
{
|
||||||
SSL_write(scon, buf, strlen(buf));
|
BIO_snprintf(buf,sizeof buf,"GET %s HTTP/1.0\r\n\r\n",s_www_path);
|
||||||
while (SSL_read(scon, buf, sizeof(buf)) > 0) ;
|
SSL_write(scon,buf,strlen(buf));
|
||||||
}
|
while (SSL_read(scon,buf,sizeof(buf)) > 0)
|
||||||
|
;
|
||||||
|
}
|
||||||
#ifdef NO_SHUTDOWN
|
#ifdef NO_SHUTDOWN
|
||||||
SSL_set_shutdown(scon, SSL_SENT_SHUTDOWN | SSL_RECEIVED_SHUTDOWN);
|
SSL_set_shutdown(scon,SSL_SENT_SHUTDOWN|SSL_RECEIVED_SHUTDOWN);
|
||||||
#else
|
#else
|
||||||
SSL_shutdown(scon);
|
SSL_shutdown(scon);
|
||||||
#endif
|
#endif
|
||||||
SHUTDOWN2(SSL_get_fd(scon));
|
SHUTDOWN2(SSL_get_fd(scon));
|
||||||
|
|
||||||
nConn = 0;
|
nConn = 0;
|
||||||
totalTime = 0.0;
|
totalTime = 0.0;
|
||||||
|
|
||||||
finishtime = (long)time(NULL) + maxTime;
|
finishtime=(long)time(NULL)+maxTime;
|
||||||
|
|
||||||
printf("starting\n");
|
printf( "starting\n" );
|
||||||
bytes_read = 0;
|
bytes_read=0;
|
||||||
tm_Time_F(START);
|
tm_Time_F(START);
|
||||||
|
|
||||||
for (;;) {
|
for (;;)
|
||||||
if (finishtime < (long)time(NULL))
|
{
|
||||||
break;
|
if (finishtime < (long)time(NULL)) break;
|
||||||
|
|
||||||
#ifdef WIN32_STUFF
|
#ifdef WIN32_STUFF
|
||||||
if (flushWinMsgs(0) == -1)
|
if( flushWinMsgs(0) == -1 )
|
||||||
goto end;
|
goto end;
|
||||||
|
|
||||||
if (waitingToDie || exitNow) /* we're dead */
|
if( waitingToDie || exitNow ) /* we're dead */
|
||||||
goto end;
|
goto end;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if ((doConnection(scon)) == NULL)
|
if( (doConnection( scon )) == NULL )
|
||||||
goto end;
|
goto end;
|
||||||
|
|
||||||
|
if (s_www_path)
|
||||||
|
{
|
||||||
|
BIO_snprintf(buf,sizeof buf,"GET %s HTTP/1.0\r\n\r\n",s_www_path);
|
||||||
|
SSL_write(scon,buf,strlen(buf));
|
||||||
|
while ((i=SSL_read(scon,buf,sizeof(buf))) > 0)
|
||||||
|
bytes_read+=i;
|
||||||
|
}
|
||||||
|
|
||||||
if (s_www_path) {
|
|
||||||
BIO_snprintf(buf, sizeof buf, "GET %s HTTP/1.0\r\n\r\n",
|
|
||||||
s_www_path);
|
|
||||||
SSL_write(scon, buf, strlen(buf));
|
|
||||||
while ((i = SSL_read(scon, buf, sizeof(buf))) > 0)
|
|
||||||
bytes_read += i;
|
|
||||||
}
|
|
||||||
#ifdef NO_SHUTDOWN
|
#ifdef NO_SHUTDOWN
|
||||||
SSL_set_shutdown(scon, SSL_SENT_SHUTDOWN | SSL_RECEIVED_SHUTDOWN);
|
SSL_set_shutdown(scon,SSL_SENT_SHUTDOWN|SSL_RECEIVED_SHUTDOWN);
|
||||||
#else
|
#else
|
||||||
SSL_shutdown(scon);
|
SSL_shutdown(scon);
|
||||||
#endif
|
#endif
|
||||||
SHUTDOWN2(SSL_get_fd(scon));
|
SHUTDOWN2(SSL_get_fd(scon));
|
||||||
|
|
||||||
nConn += 1;
|
nConn += 1;
|
||||||
if (SSL_session_reused(scon))
|
if (SSL_session_reused(scon))
|
||||||
ver = 'r';
|
ver='r';
|
||||||
else {
|
else
|
||||||
ver = SSL_version(scon);
|
{
|
||||||
if (ver == TLS1_VERSION)
|
ver=SSL_version(scon);
|
||||||
ver = 't';
|
if (ver == TLS1_VERSION)
|
||||||
else if (ver == SSL3_VERSION)
|
ver='t';
|
||||||
ver = '3';
|
else if (ver == SSL3_VERSION)
|
||||||
else if (ver == SSL2_VERSION)
|
ver='3';
|
||||||
ver = '2';
|
else if (ver == SSL2_VERSION)
|
||||||
else
|
ver='2';
|
||||||
ver = '*';
|
else
|
||||||
}
|
ver='*';
|
||||||
fputc(ver, stdout);
|
}
|
||||||
fflush(stdout);
|
fputc(ver,stdout);
|
||||||
}
|
fflush(stdout);
|
||||||
totalTime += tm_Time_F(STOP); /* Add the time for this iteration */
|
}
|
||||||
|
totalTime += tm_Time_F(STOP); /* Add the time for this iteration*/
|
||||||
|
|
||||||
printf
|
|
||||||
("\n\n%d connections in %.2fs; %.2f connections/user sec, bytes read %ld\n",
|
|
||||||
nConn, totalTime, ((double)nConn / totalTime), bytes_read);
|
|
||||||
printf
|
|
||||||
("%d connections in %ld real seconds, %ld bytes read per connection\n",
|
|
||||||
nConn, (long)time(NULL) - finishtime + maxTime,
|
|
||||||
bytes_read / (nConn?nConn:1));
|
|
||||||
|
|
||||||
ret = 0;
|
printf( "\n\n%d connections in %.2fs; %.2f connections/user sec, bytes read %ld\n", nConn, totalTime, ((double)nConn/totalTime),bytes_read);
|
||||||
end:
|
printf( "%d connections in %ld real seconds, %ld bytes read per connection\n",nConn,(long)time(NULL)-finishtime+maxTime,bytes_read/nConn);
|
||||||
if (scon != NULL)
|
|
||||||
SSL_free(scon);
|
|
||||||
|
|
||||||
if (tm_ctx != NULL) {
|
ret=0;
|
||||||
SSL_CTX_free(tm_ctx);
|
end:
|
||||||
tm_ctx = NULL;
|
if (scon != NULL) SSL_free(scon);
|
||||||
}
|
|
||||||
apps_shutdown();
|
|
||||||
OPENSSL_EXIT(ret);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*-
|
if (tm_ctx != NULL)
|
||||||
|
{
|
||||||
|
SSL_CTX_free(tm_ctx);
|
||||||
|
tm_ctx=NULL;
|
||||||
|
}
|
||||||
|
apps_shutdown();
|
||||||
|
OPENSSL_EXIT(ret);
|
||||||
|
}
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
* doConnection - make a connection
|
* doConnection - make a connection
|
||||||
* Args:
|
* Args:
|
||||||
* scon = earlier ssl connection for session id, or NULL
|
* scon = earlier ssl connection for session id, or NULL
|
||||||
* Returns:
|
* Returns:
|
||||||
* SSL * = the connection pointer.
|
* SSL * = the connection pointer.
|
||||||
*/
|
*/
|
||||||
static SSL *doConnection(SSL *scon)
|
static SSL *doConnection(SSL *scon)
|
||||||
{
|
{
|
||||||
BIO *conn;
|
BIO *conn;
|
||||||
SSL *serverCon;
|
SSL *serverCon;
|
||||||
int width, i;
|
int width, i;
|
||||||
fd_set readfds;
|
fd_set readfds;
|
||||||
|
|
||||||
if ((conn = BIO_new(BIO_s_connect())) == NULL)
|
if ((conn=BIO_new(BIO_s_connect())) == NULL)
|
||||||
return (NULL);
|
return(NULL);
|
||||||
|
|
||||||
/* BIO_set_conn_port(conn,port);*/
|
/* BIO_set_conn_port(conn,port);*/
|
||||||
BIO_set_conn_hostname(conn, host);
|
BIO_set_conn_hostname(conn,host);
|
||||||
|
|
||||||
if (scon == NULL)
|
if (scon == NULL)
|
||||||
serverCon = SSL_new(tm_ctx);
|
serverCon=SSL_new(tm_ctx);
|
||||||
else {
|
else
|
||||||
serverCon = scon;
|
{
|
||||||
SSL_set_connect_state(serverCon);
|
serverCon=scon;
|
||||||
}
|
SSL_set_connect_state(serverCon);
|
||||||
|
}
|
||||||
|
|
||||||
SSL_set_bio(serverCon, conn, conn);
|
SSL_set_bio(serverCon,conn,conn);
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
if (scon != NULL)
|
if( scon != NULL )
|
||||||
SSL_set_session(serverCon, SSL_get_session(scon));
|
SSL_set_session(serverCon,SSL_get_session(scon));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* ok, lets connect */
|
/* ok, lets connect */
|
||||||
for (;;) {
|
for(;;) {
|
||||||
i = SSL_connect(serverCon);
|
i=SSL_connect(serverCon);
|
||||||
if (BIO_sock_should_retry(i)) {
|
if (BIO_sock_should_retry(i))
|
||||||
BIO_printf(bio_err, "DELAY\n");
|
{
|
||||||
|
BIO_printf(bio_err,"DELAY\n");
|
||||||
|
|
||||||
|
i=SSL_get_fd(serverCon);
|
||||||
|
width=i+1;
|
||||||
|
FD_ZERO(&readfds);
|
||||||
|
openssl_fdset(i,&readfds);
|
||||||
|
/* Note: under VMS with SOCKETSHR the 2nd parameter
|
||||||
|
* is currently of type (int *) whereas under other
|
||||||
|
* systems it is (void *) if you don't have a cast it
|
||||||
|
* will choke the compiler: if you do have a cast then
|
||||||
|
* you can either go for (int *) or (void *).
|
||||||
|
*/
|
||||||
|
select(width,(void *)&readfds,NULL,NULL,NULL);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if(i <= 0)
|
||||||
|
{
|
||||||
|
BIO_printf(bio_err,"ERROR\n");
|
||||||
|
if (verify_error != X509_V_OK)
|
||||||
|
BIO_printf(bio_err,"verify error:%s\n",
|
||||||
|
X509_verify_cert_error_string(verify_error));
|
||||||
|
else
|
||||||
|
ERR_print_errors(bio_err);
|
||||||
|
if (scon == NULL)
|
||||||
|
SSL_free(serverCon);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
return serverCon;
|
||||||
|
}
|
||||||
|
|
||||||
i = SSL_get_fd(serverCon);
|
|
||||||
width = i + 1;
|
|
||||||
FD_ZERO(&readfds);
|
|
||||||
openssl_fdset(i, &readfds);
|
|
||||||
/*
|
|
||||||
* Note: under VMS with SOCKETSHR the 2nd parameter is currently
|
|
||||||
* of type (int *) whereas under other systems it is (void *) if
|
|
||||||
* you don't have a cast it will choke the compiler: if you do
|
|
||||||
* have a cast then you can either go for (int *) or (void *).
|
|
||||||
*/
|
|
||||||
select(width, (void *)&readfds, NULL, NULL, NULL);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (i <= 0) {
|
|
||||||
BIO_printf(bio_err, "ERROR\n");
|
|
||||||
if (verify_error != X509_V_OK)
|
|
||||||
BIO_printf(bio_err, "verify error:%s\n",
|
|
||||||
X509_verify_cert_error_string(verify_error));
|
|
||||||
else
|
|
||||||
ERR_print_errors(bio_err);
|
|
||||||
if (scon == NULL)
|
|
||||||
SSL_free(serverCon);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
return serverCon;
|
|
||||||
}
|
|
||||||
|
|||||||
413
apps/server.pem
413
apps/server.pem
@@ -1,52 +1,369 @@
|
|||||||
subject= C = UK, O = OpenSSL Group, OU = FOR TESTING PURPOSES ONLY, CN = Test Server Cert
|
issuer= /C=AU/ST=Queensland/O=CryptSoft Pty Ltd/CN=Test CA (1024 bit)
|
||||||
issuer= C = UK, O = OpenSSL Group, OU = FOR TESTING PURPOSES ONLY, CN = OpenSSL Test Intermediate CA
|
subject= /C=AU/ST=Queensland/O=CryptSoft Pty Ltd/CN=Server test cert (512 bit)
|
||||||
-----BEGIN CERTIFICATE-----
|
-----BEGIN CERTIFICATE-----
|
||||||
MIID5zCCAs+gAwIBAgIJALnu1NlVpZ6zMA0GCSqGSIb3DQEBBQUAMHAxCzAJBgNV
|
MIIB6TCCAVICAQYwDQYJKoZIhvcNAQEEBQAwWzELMAkGA1UEBhMCQVUxEzARBgNV
|
||||||
BAYTAlVLMRYwFAYDVQQKDA1PcGVuU1NMIEdyb3VwMSIwIAYDVQQLDBlGT1IgVEVT
|
BAgTClF1ZWVuc2xhbmQxGjAYBgNVBAoTEUNyeXB0U29mdCBQdHkgTHRkMRswGQYD
|
||||||
VElORyBQVVJQT1NFUyBPTkxZMSUwIwYDVQQDDBxPcGVuU1NMIFRlc3QgSW50ZXJt
|
VQQDExJUZXN0IENBICgxMDI0IGJpdCkwHhcNMDAxMDE2MjIzMTAzWhcNMDMwMTE0
|
||||||
ZWRpYXRlIENBMB4XDTExMTIwODE0MDE0OFoXDTIxMTAxNjE0MDE0OFowZDELMAkG
|
MjIzMTAzWjBjMQswCQYDVQQGEwJBVTETMBEGA1UECBMKUXVlZW5zbGFuZDEaMBgG
|
||||||
A1UEBhMCVUsxFjAUBgNVBAoMDU9wZW5TU0wgR3JvdXAxIjAgBgNVBAsMGUZPUiBU
|
A1UEChMRQ3J5cHRTb2Z0IFB0eSBMdGQxIzAhBgNVBAMTGlNlcnZlciB0ZXN0IGNl
|
||||||
RVNUSU5HIFBVUlBPU0VTIE9OTFkxGTAXBgNVBAMMEFRlc3QgU2VydmVyIENlcnQw
|
cnQgKDUxMiBiaXQpMFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAJ+zw4Qnlf8SMVIP
|
||||||
ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDzhPOSNtyyRspmeuUpxfNJ
|
Fe9GEcStgOY2Ww/dgNdhjeD8ckUJNP5VZkVDTGiXav6ooKXfX3j/7tdkuD8Ey2//
|
||||||
KCLTuf7g3uQ4zu4iHOmRO5TQci+HhVlLZrHF9XqFXcIP0y4pWDbMSGuiorUmzmfi
|
Kv7+ue0CAwEAATANBgkqhkiG9w0BAQQFAAOBgQCT0grFQeZaqYb5EYfk20XixZV4
|
||||||
R7bfSdI/+qIQt8KXRH6HNG1t8ou0VSvWId5TS5Dq/er5ODUr9OaaDva7EquHIcMv
|
GmyAbXMftG1Eo7qGiMhYzRwGNWxEYojf5PZkYZXvSqZ/ZXHXa4g59jK/rJNnaVGM
|
||||||
vPQGuI+OEAcnleVCy9HVEIySrO4P3CNIicnGkwwiAud05yUAq/gPXBC1hTtmlPD7
|
k+xIX8mxQvlV0n5O9PIha5BX5teZnkHKgL8aKKLKW1BK7YTngsfSzzaeame5iKfz
|
||||||
TVcGVSEiJdvzqqlgv02qedGrkki6GY4S7GjZxrrf7Foc2EP+51LJzwLQx3/JfrCU
|
itAE+OjGF+PFKbwX8Q==
|
||||||
41NEWAsu/Sl0tQabXESN+zJ1pDqoZ3uHMgpQjeGiE0olr+YcsSW/tJmiU9OiAr8R
|
|
||||||
AgMBAAGjgY8wgYwwDAYDVR0TAQH/BAIwADAOBgNVHQ8BAf8EBAMCBeAwLAYJYIZI
|
|
||||||
AYb4QgENBB8WHU9wZW5TU0wgR2VuZXJhdGVkIENlcnRpZmljYXRlMB0GA1UdDgQW
|
|
||||||
BBSCvM8AABPR9zklmifnr9LvIBturDAfBgNVHSMEGDAWgBQ2w2yI55X+sL3szj49
|
|
||||||
hqshgYfa2jANBgkqhkiG9w0BAQUFAAOCAQEAqb1NV0B0/pbpK9Z4/bNjzPQLTRLK
|
|
||||||
WnSNm/Jh5v0GEUOE/Beg7GNjNrmeNmqxAlpqWz9qoeoFZax+QBpIZYjROU3TS3fp
|
|
||||||
yLsrnlr0CDQ5R7kCCDGa8dkXxemmpZZLbUCpW2Uoy8sAA4JjN9OtsZY7dvUXFgJ7
|
|
||||||
vVNTRnI01ghknbtD+2SxSQd3CWF6QhcRMAzZJ1z1cbbwGDDzfvGFPzJ+Sq+zEPds
|
|
||||||
xoVLLSetCiBc+40ZcDS5dV98h9XD7JMTQfxzA7mNGv73JoZJA6nFgj+ADSlJsY/t
|
|
||||||
JBv+z1iQRueoh9Qeee+ZbRifPouCB8FDx+AltvHTANdAq0t/K3o+pplMVA==
|
|
||||||
-----END CERTIFICATE-----
|
-----END CERTIFICATE-----
|
||||||
-----BEGIN RSA PRIVATE KEY-----
|
-----BEGIN RSA PRIVATE KEY-----
|
||||||
MIIEpAIBAAKCAQEA84TzkjbcskbKZnrlKcXzSSgi07n+4N7kOM7uIhzpkTuU0HIv
|
MIIBPAIBAAJBAJ+zw4Qnlf8SMVIPFe9GEcStgOY2Ww/dgNdhjeD8ckUJNP5VZkVD
|
||||||
h4VZS2axxfV6hV3CD9MuKVg2zEhroqK1Js5n4ke230nSP/qiELfCl0R+hzRtbfKL
|
TGiXav6ooKXfX3j/7tdkuD8Ey2//Kv7+ue0CAwEAAQJAN6W31vDEP2DjdqhzCDDu
|
||||||
tFUr1iHeU0uQ6v3q+Tg1K/Tmmg72uxKrhyHDL7z0BriPjhAHJ5XlQsvR1RCMkqzu
|
OA4NACqoiFqyblo7yc2tM4h4xMbC3Yx5UKMN9ZkCtX0gzrz6DyF47bdKcWBzNWCj
|
||||||
D9wjSInJxpMMIgLndOclAKv4D1wQtYU7ZpTw+01XBlUhIiXb86qpYL9NqnnRq5JI
|
gQIhANEoojVt7hq+SQ6MCN6FTAysGgQf56Q3TYoJMoWvdiXVAiEAw3e3rc+VJpOz
|
||||||
uhmOEuxo2ca63+xaHNhD/udSyc8C0Md/yX6wlONTRFgLLv0pdLUGm1xEjfsydaQ6
|
rHuDo6bgpjUAAXM+v3fcpsfZSNO6V7kCIQCtbVjanpUwvZkMI9by02oUk9taki3b
|
||||||
qGd7hzIKUI3hohNKJa/mHLElv7SZolPTogK/EQIDAQABAoIBAADq9FwNtuE5IRQn
|
PzPfAfNPYAbCJQIhAJXNQDWyqwn/lGmR11cqY2y9nZ1+5w3yHGatLrcDnQHxAiEA
|
||||||
zGtO4q7Y5uCzZ8GDNYr9RKp+P2cbuWDbvVAecYq2NV9QoIiWJOAYZKklOvekIju3
|
vnlEGo8K85u+KwIOimM48ZG8oTk7iFdkqLJR1utT3aU=
|
||||||
r0UZLA0PRiIrTg6NrESx3JrjWDK8QNlUO7CPTZ39/K+FrmMkV9lem9yxjJjyC34D
|
|
||||||
AQB+YRTx+l14HppjdxNwHjAVQpIx/uO2F5xAMuk32+3K+pq9CZUtrofe1q4Agj9R
|
|
||||||
5s8mSy9pbRo9kW9wl5xdEotz1LivFOEiqPUJTUq5J5PeMKao3vdK726XI4Z455Nm
|
|
||||||
W2/MA0YV0ug2FYinHcZdvKM6dimH8GLfa3X8xKRfzjGjTiMSwsdjgMa4awY3tEHH
|
|
||||||
674jhAECgYEA/zqMrc0zsbNk83sjgaYIug5kzEpN4ic020rSZsmQxSCerJTgNhmg
|
|
||||||
utKSCt0Re09Jt3LqG48msahX8ycqDsHNvlEGPQSbMu9IYeO3Wr3fAm75GEtFWePY
|
|
||||||
BhM73I7gkRt4s8bUiUepMG/wY45c5tRF23xi8foReHFFe9MDzh8fJFECgYEA9EFX
|
|
||||||
4qAik1pOJGNei9BMwmx0I0gfVEIgu0tzeVqT45vcxbxr7RkTEaDoAG6PlbWP6D9a
|
|
||||||
WQNLp4gsgRM90ZXOJ4up5DsAWDluvaF4/omabMA+MJJ5kGZ0gCj5rbZbKqUws7x8
|
|
||||||
bp+6iBfUPJUbcqNqFmi/08Yt7vrDnMnyMw2A/sECgYEAiiuRMxnuzVm34hQcsbhH
|
|
||||||
6ymVqf7j0PW2qK0F4H1ocT9qhzWFd+RB3kHWrCjnqODQoI6GbGr/4JepHUpre1ex
|
|
||||||
4UEN5oSS3G0ru0rC3U4C59dZ5KwDHFm7ffZ1pr52ljfQDUsrjjIMRtuiwNK2OoRa
|
|
||||||
WSsqiaL+SDzSB+nBmpnAizECgYBdt/y6rerWUx4MhDwwtTnel7JwHyo2MDFS6/5g
|
|
||||||
n8qC2Lj6/fMDRE22w+CA2esp7EJNQJGv+b27iFpbJEDh+/Lf5YzIT4MwVskQ5bYB
|
|
||||||
JFcmRxUVmf4e09D7o705U/DjCgMH09iCsbLmqQ38ONIRSHZaJtMDtNTHD1yi+jF+
|
|
||||||
OT43gQKBgQC/2OHZoko6iRlNOAQ/tMVFNq7fL81GivoQ9F1U0Qr+DH3ZfaH8eIkX
|
|
||||||
xT0ToMPJUzWAn8pZv0snA0um6SIgvkCuxO84OkANCVbttzXImIsL7pFzfcwV/ERK
|
|
||||||
UM6j0ZuSMFOCr/lGPAoOQU0fskidGEHi1/kW+suSr28TqsyYZpwBDQ==
|
|
||||||
-----END RSA PRIVATE KEY-----
|
-----END RSA PRIVATE KEY-----
|
||||||
|
subject=/C=US/O=AT&T Bell Laboratories/OU=Prototype Research CA
|
||||||
|
issuer= /C=US/O=AT&T Bell Laboratories/OU=Prototype Research CA
|
||||||
|
notBefore=950413210656Z
|
||||||
|
notAfter =970412210656Z
|
||||||
|
-----BEGIN X509 CERTIFICATE-----
|
||||||
|
|
||||||
|
MIICCDCCAXECAQAwDQYJKoZIhvcNAQEEBQAwTjELMAkGA1UEBhMCVVMxHzAdBgNV
|
||||||
|
BAoUFkFUJlQgQmVsbCBMYWJvcmF0b3JpZXMxHjAcBgNVBAsUFVByb3RvdHlwZSBS
|
||||||
|
ZXNlYXJjaCBDQTAeFw05NTA0MTMyMTA2NTZaFw05NzA0MTIyMTA2NTZaME4xCzAJ
|
||||||
|
BgNVBAYTAlVTMR8wHQYDVQQKFBZBVCZUIEJlbGwgTGFib3JhdG9yaWVzMR4wHAYD
|
||||||
|
VQQLFBVQcm90b3R5cGUgUmVzZWFyY2ggQ0EwgZwwDQYJKoZIhvcNAQEBBQADgYoA
|
||||||
|
MIGGAoGAebOmgtSCl+wCYZc86UGYeTLY8cjmW2P0FN8ToT/u2pECCoFdrlycX0OR
|
||||||
|
3wt0ZhpFXLVNeDnHwEE9veNUih7pCL2ZBFqoIoQkB1lZmXRiVtjGonz8BLm/qrFM
|
||||||
|
YHb0lme/Ol+s118mwKVxnn6bSAeI/OXKhLaVdYZWk+aEaxEDkVkCAQ8wDQYJKoZI
|
||||||
|
hvcNAQEEBQADgYEAAZMG14lZmZ8bahkaHaTV9dQf4p2FZiQTFwHP9ZyGsXPC+LT5
|
||||||
|
dG5iTaRmyjNIJdPWohZDl97kAci79aBndvuEvRKOjLHs3WRGBIwERnAcnY9Mz8u/
|
||||||
|
zIHK23PjYVxGGaZd669OJwD0CYyqH22HH9nFUGaoJdsv39ChW0NRdLE9+y8=
|
||||||
|
-----END X509 CERTIFICATE-----
|
||||||
|
issuer= /C=AU/ST=Queensland/O=CryptSoft Pty Ltd/CN=Test PCA (1024 bit)
|
||||||
|
subject=/C=AU/ST=Queensland/O=CryptSoft Pty Ltd/CN=Test CA (1024 bit)
|
||||||
|
-----BEGIN CERTIFICATE-----
|
||||||
|
MIICJjCCAY8CAQAwDQYJKoZIhvcNAQEEBQAwXDELMAkGA1UEBhMCQVUxEzARBgNV
|
||||||
|
BAgTClF1ZWVuc2xhbmQxGjAYBgNVBAoTEUNyeXB0U29mdCBQdHkgTHRkMRwwGgYD
|
||||||
|
VQQDExNUZXN0IFBDQSAoMTAyNCBiaXQpMB4XDTk3MDYwOTEzNTc0M1oXDTAxMDYw
|
||||||
|
OTEzNTc0M1owWzELMAkGA1UEBhMCQVUxEzARBgNVBAgTClF1ZWVuc2xhbmQxGjAY
|
||||||
|
BgNVBAoTEUNyeXB0U29mdCBQdHkgTHRkMRswGQYDVQQDExJUZXN0IENBICgxMDI0
|
||||||
|
IGJpdCkwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAKO7o8t116VP6cgybTsZ
|
||||||
|
DCZhr95nYlZuya3aCi1IKoztqwWnjbmDFIriOqGFPrZQ+moMETC9D59iRW/dFXSv
|
||||||
|
1F65ka/XY2hLh9exCCo7XuUcDs53Qp3bI3AmMqHjgzE8oO3ajyJAzJkTTOUecQU2
|
||||||
|
mw/gI4tMM0LqWMQS7luTy4+xAgMBAAEwDQYJKoZIhvcNAQEEBQADgYEAM7achv3v
|
||||||
|
hLQJcv/65eGEpBXM40ZDVoFQFFJWaY5p883HTqLB1x4FdzsXHH0QKBTcKpWwqyu4
|
||||||
|
YDm3fb8oDugw72bCzfyZK/zVZPR/hVlqI/fvU109Qoc+7oPvIXWky71HfcK6ZBCA
|
||||||
|
q30KIqGM/uoM60INq97qjDmCJapagcNBGQs=
|
||||||
|
-----END CERTIFICATE-----
|
||||||
|
-----BEGIN RSA PRIVATE KEY-----
|
||||||
|
MIICXQIBAAKBgQCju6PLddelT+nIMm07GQwmYa/eZ2JWbsmt2gotSCqM7asFp425
|
||||||
|
gxSK4jqhhT62UPpqDBEwvQ+fYkVv3RV0r9ReuZGv12NoS4fXsQgqO17lHA7Od0Kd
|
||||||
|
2yNwJjKh44MxPKDt2o8iQMyZE0zlHnEFNpsP4COLTDNC6ljEEu5bk8uPsQIDAQAB
|
||||||
|
AoGAVZmpFZsDZfr0l2S9tLLwpjRWNOlKATQkno6q2WesT0eGLQufTciY+c8ypfU6
|
||||||
|
hyio8r5iUl/VhhdjhAtKx1mRpiotftHo/eYf8rtsrnprOnWG0bWjLjtIoMbcxGn2
|
||||||
|
J3bN6LJmbJMjDs0eJ3KnTu646F3nDUw2oGAwmpzKXA1KAP0CQQDRvQhxk2D3Pehs
|
||||||
|
HvG665u2pB5ipYQngEFlZO7RHJZzJOZEWSLuuMqaF/7pTfA5jiBvWqCgJeCRRInL
|
||||||
|
21ru4dlPAkEAx9jj7BgKn5TYnMoBSSe0afjsV9oApVpN1Nacb1YDtCwy+scp3++s
|
||||||
|
nFxlv98wxIlSdpwMUn+AUWfjiWR7Tu/G/wJBAJ/KjwZIrFVxewP0x2ILYsTRYLzz
|
||||||
|
MS4PDsO7FB+I0i7DbBOifXS2oNSpd3I0CNMwrxFnUHzynpbOStVfN3ZL5w0CQQCa
|
||||||
|
pwFahxBRhkJKsxhjoFJBX9yl75JoY4Wvm5Tbo9ih6UJaRx3kqfkN14L2BKYcsZgb
|
||||||
|
KY9vmDOYy6iNfjDeWTfJAkBkfPUb8oTJ/nSP5zN6sqGxSY4krc4xLxpRmxoJ8HL2
|
||||||
|
XfhqXkTzbU13RX9JJ/NZ8vQN9Vm2NhxRGJocQkmcdVtJ
|
||||||
|
-----END RSA PRIVATE KEY-----
|
||||||
|
-----BEGIN X509 CERTIFICATE-----
|
||||||
|
MIICYDCCAiACAgEoMAkGBSsOAwINBQAwfDELMAkGA1UEBhMCVVMxNjA0BgNVBAoT
|
||||||
|
LU5hdGlvbmFsIEFlcm9uYXV0aWNzIGFuZCBTcGFjZSBBZG1pbmlzdHJhdGlvbjEZ
|
||||||
|
MBcGA1UECxMQVGVzdCBFbnZpcm9ubWVudDEaMBgGA1UECxMRRFNTLU5BU0EtUGls
|
||||||
|
b3QtQ0EwHhcNOTYwMjI2MTYzMjQ1WhcNOTcwMjI1MTYzMjQ1WjB8MQswCQYDVQQG
|
||||||
|
EwJVUzE2MDQGA1UEChMtTmF0aW9uYWwgQWVyb25hdXRpY3MgYW5kIFNwYWNlIEFk
|
||||||
|
bWluaXN0cmF0aW9uMRkwFwYDVQQLExBUZXN0IEVudmlyb25tZW50MRowGAYDVQQL
|
||||||
|
ExFEU1MtTkFTQS1QaWxvdC1DQTCB8jAJBgUrDgMCDAUAA4HkADCB4AJBAMA/ssKb
|
||||||
|
hPNUG7ZlASfVwEJU21O5OyF/iyBzgHI1O8eOhJGUYO8cc8wDMjR508Mr9cp6Uhl/
|
||||||
|
ZB7FV5GkLNEnRHYCQQDUEaSg45P2qrDwixTRhFhmWz5Nvc4lRFQ/42XPcchiJBLb
|
||||||
|
bn3QK74T2IxY1yY+kCNq8XrIqf5fJJzIH0J/xUP3AhUAsg2wsQHfDGYk/BOSulX3
|
||||||
|
fVd0geUCQQCzCFUQAh+ZkEmp5804cs6ZWBhrUAfnra8lJItYo9xPcXgdIfLfibcX
|
||||||
|
R71UsyO77MRD7B0+Ag2tq794IleCVcEEMAkGBSsOAwINBQADLwAwLAIUUayDfreR
|
||||||
|
Yh2WeU86/pHNdkUC1IgCFEfxe1f0oMpxJyrJ5XIxTi7vGdoK
|
||||||
|
-----END X509 CERTIFICATE-----
|
||||||
|
-----BEGIN X509 CERTIFICATE-----
|
||||||
|
|
||||||
|
MIICGTCCAdgCAwCqTDAJBgUrDgMCDQUAMHwxCzAJBgNVBAYTAlVTMTYwNAYDVQQK
|
||||||
|
Ey1OYXRpb25hbCBBZXJvbmF1dGljcyBhbmQgU3BhY2UgQWRtaW5pc3RyYXRpb24x
|
||||||
|
GTAXBgNVBAsTEFRlc3QgRW52aXJvbm1lbnQxGjAYBgNVBAsTEURTUy1OQVNBLVBp
|
||||||
|
bG90LUNBMB4XDTk2MDUxNDE3MDE0MVoXDTk3MDUxNDE3MDE0MVowMzELMAkGA1UE
|
||||||
|
BhMCQVUxDzANBgNVBAoTBk1pbmNvbTETMBEGA1UEAxMKRXJpYyBZb3VuZzCB8jAJ
|
||||||
|
BgUrDgMCDAUAA4HkADCB4AJBAKbfHz6vE6pXXMTpswtGUec2tvnfLJUsoxE9qs4+
|
||||||
|
ObZX7LmLvragNPUeiTJx7UOWZ5DfBj6bXLc8eYne0lP1g3ACQQDUEaSg45P2qrDw
|
||||||
|
ixTRhFhmWz5Nvc4lRFQ/42XPcchiJBLbbn3QK74T2IxY1yY+kCNq8XrIqf5fJJzI
|
||||||
|
H0J/xUP3AhUAsg2wsQHfDGYk/BOSulX3fVd0geUCQQCzCFUQAh+ZkEmp5804cs6Z
|
||||||
|
WBhrUAfnra8lJItYo9xPcXgdIfLfibcXR71UsyO77MRD7B0+Ag2tq794IleCVcEE
|
||||||
|
MAkGBSsOAwINBQADMAAwLQIUWsuuJRE3VT4ueWkWMAJMJaZjj1ECFQCYY0zX4bzM
|
||||||
|
LC7obsrHD8XAHG+ZRG==
|
||||||
|
-----END X509 CERTIFICATE-----
|
||||||
|
-----BEGIN CERTIFICATE-----
|
||||||
|
MIICTTCCAbagAwIBAgIBADANBgkqhkiG9w0BAQQFADBMMQswCQYDVQQGEwJHQjEM
|
||||||
|
MAoGA1UEChMDVUNMMRgwFgYDVQQLEw9JQ0UtVEVMIFByb2plY3QxFTATBgNVBAMT
|
||||||
|
DFRydXN0RmFjdG9yeTAeFw05NzA0MjIxNDM5MTRaFw05ODA0MjIxNDM5MTRaMEwx
|
||||||
|
CzAJBgNVBAYTAkdCMQwwCgYDVQQKEwNVQ0wxGDAWBgNVBAsTD0lDRS1URUwgUHJv
|
||||||
|
amVjdDEVMBMGA1UEAxMMVHJ1c3RGYWN0b3J5MIGcMAoGBFUIAQECAgQAA4GNADCB
|
||||||
|
iQKBgQCEieR8NcXkUW1f0G6aC6u0i8q/98JqS6RxK5YmHIGKCkuTWAUjzLfUa4dt
|
||||||
|
U9igGCjTuxaDqlzEim+t/02pmiBZT9HaX++35MjQPUWmsChcYU5WyzGErXi+rQaw
|
||||||
|
zlwS73zM8qiPj/97lXYycWhgL0VaiDSPxRXEUdWoaGruom4mNQIDAQABo0IwQDAd
|
||||||
|
BgNVHQ4EFgQUHal1LZr7oVg5z6lYzrhTgZRCmcUwDgYDVR0PAQH/BAQDAgH2MA8G
|
||||||
|
A1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEEBQADgYEAfaggfl6FZoioecjv0dq8
|
||||||
|
/DXo/u11iMZvXn08gjX/zl2b4wtPbShOSY5FhkSm8GeySasz+/Nwb/uzfnIhokWi
|
||||||
|
lfPZHtlCWtXbIy/TN51eJyq04ceDCQDWvLC2enVg9KB+GJ34b5c5VaPRzq8MBxsA
|
||||||
|
S7ELuYGtmYgYm9NZOIr7yU0=
|
||||||
|
-----END CERTIFICATE-----
|
||||||
|
-----BEGIN CERTIFICATE-----
|
||||||
|
MIIB6jCCAZQCAgEtMA0GCSqGSIb3DQEBBAUAMIGAMQswCQYDVQQGEwJVUzE2MDQG
|
||||||
|
A1UEChMtTmF0aW9uYWwgQWVyb25hdXRpY3MgYW5kIFNwYWNlIEFkbWluaXN0cmF0
|
||||||
|
aW9uMRkwFwYDVQQLExBUZXN0IEVudmlyb25tZW50MR4wHAYDVQQLExVNRDUtUlNB
|
||||||
|
LU5BU0EtUGlsb3QtQ0EwHhcNOTYwNDMwMjIwNTAwWhcNOTcwNDMwMjIwNTAwWjCB
|
||||||
|
gDELMAkGA1UEBhMCVVMxNjA0BgNVBAoTLU5hdGlvbmFsIEFlcm9uYXV0aWNzIGFu
|
||||||
|
ZCBTcGFjZSBBZG1pbmlzdHJhdGlvbjEZMBcGA1UECxMQVGVzdCBFbnZpcm9ubWVu
|
||||||
|
dDEeMBwGA1UECxMVTUQ1LVJTQS1OQVNBLVBpbG90LUNBMFkwCgYEVQgBAQICAgAD
|
||||||
|
SwAwSAJBALmmX5+GqAvcrWK13rfDrNX9UfeA7f+ijyBgeFQjYUoDpFqapw4nzQBL
|
||||||
|
bAXug8pKkRwa2Zh8YODhXsRWu2F/UckCAwEAATANBgkqhkiG9w0BAQQFAANBAH9a
|
||||||
|
OBA+QCsjxXgnSqHx04gcU8S49DVUb1f2XVoLnHlIb8RnX0k5O6mpHT5eti9bLkiW
|
||||||
|
GJNMJ4L0AJ/ac+SmHZc=
|
||||||
|
-----END CERTIFICATE-----
|
||||||
|
-----BEGIN CERTIFICATE-----
|
||||||
|
MIICajCCAdMCBDGA0QUwDQYJKoZIhvcNAQEEBQAwfTELMAkGA1UEBhMCQ2ExDzAN
|
||||||
|
BgNVBAcTBk5lcGVhbjEeMBwGA1UECxMVTm8gTGlhYmlsaXR5IEFjY2VwdGVkMR8w
|
||||||
|
HQYDVQQKExZGb3IgRGVtbyBQdXJwb3NlcyBPbmx5MRwwGgYDVQQDExNFbnRydXN0
|
||||||
|
IERlbW8gV2ViIENBMB4XDTk2MDQyNjEzMzUwMVoXDTA2MDQyNjEzMzUwMVowfTEL
|
||||||
|
MAkGA1UEBhMCQ2ExDzANBgNVBAcTBk5lcGVhbjEeMBwGA1UECxMVTm8gTGlhYmls
|
||||||
|
aXR5IEFjY2VwdGVkMR8wHQYDVQQKExZGb3IgRGVtbyBQdXJwb3NlcyBPbmx5MRww
|
||||||
|
GgYDVQQDExNFbnRydXN0IERlbW8gV2ViIENBMIGdMA0GCSqGSIb3DQEBAQUAA4GL
|
||||||
|
ADCBhwKBgQCaroS7O1DA0hm4IefNYU1cx/nqOmzEnk291d1XqznDeF4wEgakbkCc
|
||||||
|
zTKxK791yNpXG5RmngqH7cygDRTHZJ6mfCRn0wGC+AI00F2vYTGqPGRQL1N3lZT0
|
||||||
|
YDKFC0SQeMMjFIZ1aeQigroFQnHo0VB3zWIMpNkka8PY9lxHZAmWwQIBAzANBgkq
|
||||||
|
hkiG9w0BAQQFAAOBgQBAx0UMVA1s54lMQyXjMX5kj99FJN5itb8bK1Rk+cegPQPF
|
||||||
|
cWO9SEWyEjjBjIkjjzAwBkaEszFsNGxemxtXvwjIm1xEUMTVlPEWTs2qnDvAUA9W
|
||||||
|
YqhWbhH0toGT36236QAsqCZ76rbTRVSSX2BHyJwJMG2tCRv7kRJ//NIgxj3H4w==
|
||||||
|
-----END CERTIFICATE-----
|
||||||
|
|
||||||
|
issuer= /C=AU/ST=Queensland/O=CryptSoft Pty Ltd/CN=Test PCA (1024 bit)
|
||||||
|
subject=/C=AU/ST=Queensland/O=CryptSoft Pty Ltd/CN=Test PCA (1024 bit)
|
||||||
|
-----BEGIN CERTIFICATE-----
|
||||||
|
MIICJzCCAZACAQAwDQYJKoZIhvcNAQEEBQAwXDELMAkGA1UEBhMCQVUxEzARBgNV
|
||||||
|
BAgTClF1ZWVuc2xhbmQxGjAYBgNVBAoTEUNyeXB0U29mdCBQdHkgTHRkMRwwGgYD
|
||||||
|
VQQDExNUZXN0IFBDQSAoMTAyNCBiaXQpMB4XDTk3MDYwOTEzNTczN1oXDTAxMDYw
|
||||||
|
OTEzNTczN1owXDELMAkGA1UEBhMCQVUxEzARBgNVBAgTClF1ZWVuc2xhbmQxGjAY
|
||||||
|
BgNVBAoTEUNyeXB0U29mdCBQdHkgTHRkMRwwGgYDVQQDExNUZXN0IFBDQSAoMTAy
|
||||||
|
NCBiaXQpMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCdoWk/3+WcMlfjIrkg
|
||||||
|
40ketmnQaEogQe1LLcuOJV6rKfUSAsPgwgsabJ/wn8TxA1yy3eKJbFl3OiUXMRsp
|
||||||
|
22Jp85PmemiDzyUIStwk72qhp1imbANZvlmlCFKiQrjUyuDfu4TABmn+kkt3vR1Y
|
||||||
|
BEOGt+IFye1UBVSATVdRJ2UVhwIDAQABMA0GCSqGSIb3DQEBBAUAA4GBABNA1u/S
|
||||||
|
Cg/LJZWb7GliiKJsvuhxlE4E5JxQF2zMub/CSNbF97//tYSyj96sxeFQxZXbcjm9
|
||||||
|
xt6mr/xNLA4szNQMJ4P+L7b5e/jC5DSqlwS+CUYJgaFs/SP+qJoCSu1bR3IM9XWO
|
||||||
|
cRBpDmcBbYLkSyB92WURvsZ1LtjEcn+cdQVI
|
||||||
|
-----END CERTIFICATE-----
|
||||||
|
-----BEGIN RSA PRIVATE KEY-----
|
||||||
|
MIICXAIBAAKBgQCdoWk/3+WcMlfjIrkg40ketmnQaEogQe1LLcuOJV6rKfUSAsPg
|
||||||
|
wgsabJ/wn8TxA1yy3eKJbFl3OiUXMRsp22Jp85PmemiDzyUIStwk72qhp1imbANZ
|
||||||
|
vlmlCFKiQrjUyuDfu4TABmn+kkt3vR1YBEOGt+IFye1UBVSATVdRJ2UVhwIDAQAB
|
||||||
|
AoGAba4fTtuap5l7/8ZsbE7Z1O32KJY4ZcOZukLOLUUhXxXduT+FTgGWujc0/rgc
|
||||||
|
z9qYCLlNZHOouMYTgtSfYvuMuLZ11VIt0GYH+nRioLShE59Yy+zCRyC+gPigS1kz
|
||||||
|
xvo14AsOIPYV14Tk/SsHyq6E0eTk7VzaIE197giiINUERPECQQDSKmtPTh/lRKw7
|
||||||
|
HSZSM0I1mFWn/1zqrAbontRQY5w98QWIOe5qmzYyFbPXYT3d9BzlsMyhgiRNoBbD
|
||||||
|
yvohSHXJAkEAwAHx6ezAZeWWzD5yXD36nyjpkVCw7Tk7TSmOceLJMWt1QcrCfqlS
|
||||||
|
xA5jjpQ6Z8suU5DdtWAryM2sAir1WisYzwJAd6Zcx56jvAQ3xcPXsE6scBTVFzrj
|
||||||
|
7FqZ6E+cclPzfLQ+QQsyOBE7bpI6e/FJppY26XGZXo3YGzV8IGXrt40oOQJALETG
|
||||||
|
h86EFXo3qGOFbmsDy4pdP5nBERCu8X1xUCSfintiD4c2DInxgS5oGclnJeMcjTvL
|
||||||
|
QjQoJCX3UJCi/OUO1QJBAKgcDHWjMvt+l1pjJBsSEZ0HX9AAIIVx0RQmbFGS+F2Q
|
||||||
|
hhu5l77WnnZOQ9vvhV5u7NPCUF9nhU3jh60qWWO8mkc=
|
||||||
|
-----END RSA PRIVATE KEY-----
|
||||||
|
subject=/C=US/O=RSA Data Security, Inc./OU=Commercial Certification Authority
|
||||||
|
issuer= /C=US/O=RSA Data Security, Inc./OU=Commercial Certification Authority
|
||||||
|
notBefore=941104185834Z
|
||||||
|
notAfter =991103185834Z
|
||||||
|
-----BEGIN X509 CERTIFICATE-----
|
||||||
|
|
||||||
|
MIICIzCCAZACBQJBAAAWMA0GCSqGSIb3DQEBAgUAMFwxCzAJBgNVBAYTAlVTMSAw
|
||||||
|
HgYDVQQKExdSU0EgRGF0YSBTZWN1cml0eSwgSW5jLjErMCkGA1UECxMiQ29tbWVy
|
||||||
|
Y2lhbCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw05NDExMDQxODU4MzRaFw05
|
||||||
|
OTExMDMxODU4MzRaMFwxCzAJBgNVBAYTAlVTMSAwHgYDVQQKExdSU0EgRGF0YSBT
|
||||||
|
ZWN1cml0eSwgSW5jLjErMCkGA1UECxMiQ29tbWVyY2lhbCBDZXJ0aWZpY2F0aW9u
|
||||||
|
IEF1dGhvcml0eTCBmzANBgkqhkiG9w0BAQEFAAOBiQAwgYUCfgCk+4Fie84QJ93o
|
||||||
|
975sbsZwmdu41QUDaSiCnHJ/lj+O7Kwpkj+KFPhCdr69XQO5kNTQvAayUTNfxMK/
|
||||||
|
touPmbZiImDd298ggrTKoi8tUO2UMt7gVY3UaOLgTNLNBRYulWZcYVI4HlGogqHE
|
||||||
|
7yXpCuaLK44xZtn42f29O2nZ6wIDAQABMA0GCSqGSIb3DQEBAgUAA34AdrW2EP4j
|
||||||
|
9/dZYkuwX5zBaLxJu7NJbyFHXSudVMQAKD+YufKKg5tgf+tQx6sFEC097TgCwaVI
|
||||||
|
0v5loMC86qYjFmZsGySp8+x5NRhPJsjjr1BKx6cxa9B8GJ1Qv6km+iYrRpwUqbtb
|
||||||
|
MJhCKLVLU7tDCZJAuqiqWqTGtotXTcU=
|
||||||
|
-----END X509 CERTIFICATE-----
|
||||||
|
subject=/C=US/O=RSA Data Security, Inc./OU=Secure Server Certification Authority
|
||||||
|
issuer= /C=US/O=RSA Data Security, Inc./OU=Secure Server Certification Authority
|
||||||
|
notBefore=941109235417Z
|
||||||
|
notAfter =991231235417Z
|
||||||
|
-----BEGIN X509 CERTIFICATE-----
|
||||||
|
|
||||||
|
MIICKTCCAZYCBQJBAAABMA0GCSqGSIb3DQEBAgUAMF8xCzAJBgNVBAYTAlVTMSAw
|
||||||
|
HgYDVQQKExdSU0EgRGF0YSBTZWN1cml0eSwgSW5jLjEuMCwGA1UECxMlU2VjdXJl
|
||||||
|
IFNlcnZlciBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw05NDExMDkyMzU0MTda
|
||||||
|
Fw05OTEyMzEyMzU0MTdaMF8xCzAJBgNVBAYTAlVTMSAwHgYDVQQKExdSU0EgRGF0
|
||||||
|
YSBTZWN1cml0eSwgSW5jLjEuMCwGA1UECxMlU2VjdXJlIFNlcnZlciBDZXJ0aWZp
|
||||||
|
Y2F0aW9uIEF1dGhvcml0eTCBmzANBgkqhkiG9w0BAQEFAAOBiQAwgYUCfgCSznrB
|
||||||
|
roM+WqqJg1esJQF2DK2ujiw3zus1eGRUA+WEQFHJv48I4oqCCNIWhjdV6bEhAq12
|
||||||
|
aIGaBaJLyUslZiJWbIgHj/eBWW2EB2VwE3F2Ppt3TONQiVaYSLkdpykaEy5KEVmc
|
||||||
|
HhXVSVQsczppgrGXOZxtcGdI5d0t1sgeewIDAQABMA0GCSqGSIb3DQEBAgUAA34A
|
||||||
|
iNHReSHO4ovo+MF9NFM/YYPZtgs4F7boviGNjwC4i1N+RGceIr2XJ+CchcxK9oU7
|
||||||
|
suK+ktPlDemvXA4MRpX/oRxePug2WHpzpgr4IhFrwwk4fia7c+8AvQKk8xQNMD9h
|
||||||
|
cHsg/jKjn7P0Z1LctO6EjJY2IN6BCINxIYoPnqk=
|
||||||
|
-----END X509 CERTIFICATE-----
|
||||||
|
subject=/C=ZA/SP=Western Cape/L=Cape Town/O=Thawte Consulting cc
|
||||||
|
/OU=Certification Services Division/CN=Thawte Server CA
|
||||||
|
/Email=server-certs@thawte.com
|
||||||
|
issuer= /C=ZA/SP=Western Cape/L=Cape Town/O=Thawte Consulting cc
|
||||||
|
/OU=Certification Services Division/CN=Thawte Server CA
|
||||||
|
/Email=server-certs@thawte.com
|
||||||
|
-----BEGIN CERTIFICATE-----
|
||||||
|
MIIC+TCCAmICAQAwDQYJKoZIhvcNAQEEBQAwgcQxCzAJBgNVBAYTAlpBMRUwEwYD
|
||||||
|
VQQIEwxXZXN0ZXJuIENhcGUxEjAQBgNVBAcTCUNhcGUgVG93bjEdMBsGA1UEChMU
|
||||||
|
VGhhd3RlIENvbnN1bHRpbmcgY2MxKDAmBgNVBAsTH0NlcnRpZmljYXRpb24gU2Vy
|
||||||
|
dmljZXMgRGl2aXNpb24xGTAXBgNVBAMTEFRoYXd0ZSBTZXJ2ZXIgQ0ExJjAkBgkq
|
||||||
|
hkiG9w0BCQEWF3NlcnZlci1jZXJ0c0B0aGF3dGUuY29tMB4XDTk2MDcyNzE4MDc1
|
||||||
|
N1oXDTk4MDcyNzE4MDc1N1owgcQxCzAJBgNVBAYTAlpBMRUwEwYDVQQIEwxXZXN0
|
||||||
|
ZXJuIENhcGUxEjAQBgNVBAcTCUNhcGUgVG93bjEdMBsGA1UEChMUVGhhd3RlIENv
|
||||||
|
bnN1bHRpbmcgY2MxKDAmBgNVBAsTH0NlcnRpZmljYXRpb24gU2VydmljZXMgRGl2
|
||||||
|
aXNpb24xGTAXBgNVBAMTEFRoYXd0ZSBTZXJ2ZXIgQ0ExJjAkBgkqhkiG9w0BCQEW
|
||||||
|
F3NlcnZlci1jZXJ0c0B0aGF3dGUuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCB
|
||||||
|
iQKBgQDTpFBuyP9Wa+bPXbbqDGh1R6KqwtqEJfyo9EdR2oW1IHSUhh4PdcnpCGH1
|
||||||
|
Bm0wbhUZAulSwGLbTZme4moMRDjN/r7jZAlwxf6xaym2L0nIO9QnBCUQly/nkG3A
|
||||||
|
KEKZ10xD3sP1IW1Un13DWOHA5NlbsLjctHvfNjrCtWYiEtaHDQIDAQABMA0GCSqG
|
||||||
|
SIb3DQEBBAUAA4GBAIsvn7ifX3RUIrvYXtpI4DOfARkTogwm6o7OwVdl93yFhDcX
|
||||||
|
7h5t0XZ11MUAMziKdde3rmTvzUYIUCYoY5b032IwGMTvdiclK+STN6NP2m5nvFAM
|
||||||
|
qJT5gC5O+j/jBuZRQ4i0AMYQr5F4lT8oBJnhgafw6PL8aDY2vMHGSPl9+7uf
|
||||||
|
-----END CERTIFICATE-----
|
||||||
|
|
||||||
|
-----BEGIN CERTIFICATE-----
|
||||||
|
MIIDDTCCAnYCAQAwDQYJKoZIhvcNAQEEBQAwgc4xCzAJBgNVBAYTAlpBMRUwEwYD
|
||||||
|
VQQIEwxXZXN0ZXJuIENhcGUxEjAQBgNVBAcTCUNhcGUgVG93bjEdMBsGA1UEChMU
|
||||||
|
VGhhd3RlIENvbnN1bHRpbmcgY2MxKDAmBgNVBAsTH0NlcnRpZmljYXRpb24gU2Vy
|
||||||
|
dmljZXMgRGl2aXNpb24xITAfBgNVBAMTGFRoYXd0ZSBQcmVtaXVtIFNlcnZlciBD
|
||||||
|
QTEoMCYGCSqGSIb3DQEJARYZcHJlbWl1bS1zZXJ2ZXJAdGhhd3RlLmNvbTAeFw05
|
||||||
|
NjA3MjcxODA3MTRaFw05ODA3MjcxODA3MTRaMIHOMQswCQYDVQQGEwJaQTEVMBMG
|
||||||
|
A1UECBMMV2VzdGVybiBDYXBlMRIwEAYDVQQHEwlDYXBlIFRvd24xHTAbBgNVBAoT
|
||||||
|
FFRoYXd0ZSBDb25zdWx0aW5nIGNjMSgwJgYDVQQLEx9DZXJ0aWZpY2F0aW9uIFNl
|
||||||
|
cnZpY2VzIERpdmlzaW9uMSEwHwYDVQQDExhUaGF3dGUgUHJlbWl1bSBTZXJ2ZXIg
|
||||||
|
Q0ExKDAmBgkqhkiG9w0BCQEWGXByZW1pdW0tc2VydmVyQHRoYXd0ZS5jb20wgZ8w
|
||||||
|
DQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBANI2NmqL18JbntqBQWKPOO5JBFXW0O8c
|
||||||
|
G5UWR+8YSDU6UvQragaPOy/qVuOvho2eF/eetGV1Ak3vywmiIVHYm9Bn0LoNkgYU
|
||||||
|
c9STy5cqAJxcTgy8+hVS/PJEbtoRSm4Iny8t4/mqOoZztkZTWMiJBb2DEbhzP6oH
|
||||||
|
jfRCTedAnRw3AgMBAAEwDQYJKoZIhvcNAQEEBQADgYEAutFIgTRZVYerIZfL9lvR
|
||||||
|
w9Eifvvo5KTZ3h+Bj+VzNnyw4Qc/IyXkPOu6SIiH9LQ3sCmWBdxpe+qr4l77rLj2
|
||||||
|
GYuMtESFfn1XVALzkYgC7JcPuTOjMfIiMByt+uFf8AV8x0IW/Qkuv+hEQcyM9vxK
|
||||||
|
3VZdLbCVIhNoEsysrxCpxcI=
|
||||||
|
-----END CERTIFICATE-----
|
||||||
|
Tims test GCI CA
|
||||||
|
|
||||||
|
-----BEGIN CERTIFICATE-----
|
||||||
|
MIIB8DCCAZoCAQAwDQYJKoZIhvcNAQEEBQAwgYIxCzAJBgNVBAYTAkFVMRMwEQYD
|
||||||
|
VQQIEwpRdWVlbnNsYW5kMREwDwYDVQQHEwhCcmlzYmFuZTEaMBgGA1UEChMRQ3J5
|
||||||
|
cHRTb2Z0IFB0eSBMdGQxFDASBgNVBAsTC2RldmVsb3BtZW50MRkwFwYDVQQDExBD
|
||||||
|
cnlwdFNvZnQgRGV2IENBMB4XDTk3MDMyMjEzMzQwNFoXDTk4MDMyMjEzMzQwNFow
|
||||||
|
gYIxCzAJBgNVBAYTAkFVMRMwEQYDVQQIEwpRdWVlbnNsYW5kMREwDwYDVQQHEwhC
|
||||||
|
cmlzYmFuZTEaMBgGA1UEChMRQ3J5cHRTb2Z0IFB0eSBMdGQxFDASBgNVBAsTC2Rl
|
||||||
|
dmVsb3BtZW50MRkwFwYDVQQDExBDcnlwdFNvZnQgRGV2IENBMFwwDQYJKoZIhvcN
|
||||||
|
AQEBBQADSwAwSAJBAOAOAqogG5QwAmLhzyO4CoRnx/wVy4NZP4dxJy83O1EnL0rw
|
||||||
|
OdsamJKvPOLHgSXo3gDu9uVyvCf/QJmZAmC5ml8CAwEAATANBgkqhkiG9w0BAQQF
|
||||||
|
AANBADRRS/GVdd7rAqRW6SdmgLJduOU2yq3avBu99kRqbp9A/dLu6r6jU+eP4oOA
|
||||||
|
TfdbFZtAAD2Hx9jUtY3tfdrJOb8=
|
||||||
|
-----END CERTIFICATE-----
|
||||||
|
|
||||||
|
-----BEGIN CERTIFICATE-----
|
||||||
|
MIICVjCCAgACAQAwDQYJKoZIhvcNAQEEBQAwgbUxCzAJBgNVBAYTAkFVMRMwEQYD
|
||||||
|
VQQIEwpRdWVlbnNsYW5kMREwDwYDVQQHEwhCcmlzYmFuZTEaMBgGA1UEChMRQ3J5
|
||||||
|
cHRTb2Z0IFB0eSBMdGQxLDAqBgNVBAsTI1dPUlRITEVTUyBDRVJUSUZJQ0FUSU9O
|
||||||
|
IEFVVEhPUklUSUVTMTQwMgYDVQQDEytaRVJPIFZBTFVFIENBIC0gREVNT05TVFJB
|
||||||
|
VElPTiBQVVJQT1NFUyBPTkxZMB4XDTk3MDQwMzEzMjI1NFoXDTk4MDQwMzEzMjI1
|
||||||
|
NFowgbUxCzAJBgNVBAYTAkFVMRMwEQYDVQQIEwpRdWVlbnNsYW5kMREwDwYDVQQH
|
||||||
|
EwhCcmlzYmFuZTEaMBgGA1UEChMRQ3J5cHRTb2Z0IFB0eSBMdGQxLDAqBgNVBAsT
|
||||||
|
I1dPUlRITEVTUyBDRVJUSUZJQ0FUSU9OIEFVVEhPUklUSUVTMTQwMgYDVQQDEyta
|
||||||
|
RVJPIFZBTFVFIENBIC0gREVNT05TVFJBVElPTiBQVVJQT1NFUyBPTkxZMFwwDQYJ
|
||||||
|
KoZIhvcNAQEBBQADSwAwSAJBAOZ7T7yqP/tyspcko3yPY1y0Cm2EmwNvzW4QgVXR
|
||||||
|
Fjs3HmJ4xtSpXdo6mwcGezL3Abt/aQXaxv9PU8xt+Jr0OFUCAwEAATANBgkqhkiG
|
||||||
|
9w0BAQQFAANBAOQpYmGgyCqCy1OljgJhCqQOu627oVlHzK1L+t9vBaMfn40AVUR4
|
||||||
|
WzQVWO31KTgi5vTK1U+3h46fgUWqQ0h+6rU=
|
||||||
|
-----END CERTIFICATE-----
|
||||||
|
-----BEGIN CERTIFICATE-----
|
||||||
|
MIAwgKADAgECAgEAMA0GCSqGSIb3DQEBBAUAMGIxETAPBgNVBAcTCEludGVybmV0
|
||||||
|
MRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE0MDIGA1UECxMrVmVyaVNpZ24gQ2xh
|
||||||
|
c3MgMSBDQSAtIEluZGl2aWR1YWwgU3Vic2NyaWJlcjAeFw05NjA0MDgxMDIwMjda
|
||||||
|
Fw05NzA0MDgxMDIwMjdaMGIxETAPBgNVBAcTCEludGVybmV0MRcwFQYDVQQKEw5W
|
||||||
|
ZXJpU2lnbiwgSW5jLjE0MDIGA1UECxMrVmVyaVNpZ24gQ2xhc3MgMSBDQSAtIElu
|
||||||
|
ZGl2aWR1YWwgU3Vic2NyaWJlcjCAMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC2
|
||||||
|
FKbPTdAFDdjKI9BvqrQpkmOOLPhvltcunXZLEbE2jVfJw/0cxrr+Hgi6M8qV6r7j
|
||||||
|
W80GqLd5HUQq7XPysVKDaBBwZJHXPmv5912dFEObbpdFmIFH0S3L3bty10w/cari
|
||||||
|
QPJUObwW7s987LrbP2wqsxaxhhKdrpM01bjV0Pc+qQIDAQABAAAAADANBgkqhkiG
|
||||||
|
9w0BAQQFAAOBgQA+1nJryNt8VBRjRr07ArDAV/3jAH7GjDc9jsrxZS68ost9v06C
|
||||||
|
TvTNKGL+LISNmFLXl+JXhgGB0JZ9fvyYzNgHQ46HBUng1H6voalfJgS2KdEo50wW
|
||||||
|
8EFZYMDkT1k4uynwJqkVN2QJK/2q4/A/VCov5h6SlM8Affg2W+1TLqvqkwAA
|
||||||
|
-----END CERTIFICATE-----
|
||||||
|
|
||||||
|
subject=/L=Internet/O=VeriSign, Inc./OU=VeriSign Class 2 CA - Individual Subscriber
|
||||||
|
issuer= /L=Internet/O=VeriSign, Inc./OU=VeriSign Class 2 CA - Individual Subscriber
|
||||||
|
|
||||||
|
-----BEGIN CERTIFICATE-----
|
||||||
|
MIIEkzCCA/ygAwIBAgIRANDTUpSRL3nTFeMrMayFSPAwDQYJKoZIhvcNAQECBQAw
|
||||||
|
YjERMA8GA1UEBxMISW50ZXJuZXQxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTQw
|
||||||
|
MgYDVQQLEytWZXJpU2lnbiBDbGFzcyAyIENBIC0gSW5kaXZpZHVhbCBTdWJzY3Jp
|
||||||
|
YmVyMB4XDTk2MDYwNDAwMDAwMFoXDTk4MDYwNDIzNTk1OVowYjERMA8GA1UEBxMI
|
||||||
|
SW50ZXJuZXQxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTQwMgYDVQQLEytWZXJp
|
||||||
|
U2lnbiBDbGFzcyAyIENBIC0gSW5kaXZpZHVhbCBTdWJzY3JpYmVyMIGfMA0GCSqG
|
||||||
|
SIb3DQEBAQUAA4GNADCBiQKBgQC6A+2czKGRcYMfm8gdnk+0de99TDDzsqo0v5nb
|
||||||
|
RsbUmMcdRQ7nsMbRWe0SAb/9QoLTZ/cJ0iOBqdrkz7UpqqKarVoTSdlSMVM92tWp
|
||||||
|
3bJncZHQD1t4xd6lQVdI1/T6R+5J0T1ukOdsI9Jmf+F28S6g3R3L1SFwiHKeZKZv
|
||||||
|
z+793wIDAQABo4ICRzCCAkMwggIpBgNVHQMBAf8EggIdMIICGTCCAhUwggIRBgtg
|
||||||
|
hkgBhvhFAQcBATCCAgAWggGrVGhpcyBjZXJ0aWZpY2F0ZSBpbmNvcnBvcmF0ZXMg
|
||||||
|
YnkgcmVmZXJlbmNlLCBhbmQgaXRzIHVzZSBpcyBzdHJpY3RseSBzdWJqZWN0IHRv
|
||||||
|
LCB0aGUgVmVyaVNpZ24gQ2VydGlmaWNhdGlvbiBQcmFjdGljZSBTdGF0ZW1lbnQg
|
||||||
|
KENQUyksIGF2YWlsYWJsZSBhdDogaHR0cHM6Ly93d3cudmVyaXNpZ24uY29tL0NQ
|
||||||
|
Uy0xLjA7IGJ5IEUtbWFpbCBhdCBDUFMtcmVxdWVzdHNAdmVyaXNpZ24uY29tOyBv
|
||||||
|
ciBieSBtYWlsIGF0IFZlcmlTaWduLCBJbmMuLCAyNTkzIENvYXN0IEF2ZS4sIE1v
|
||||||
|
dW50YWluIFZpZXcsIENBIDk0MDQzIFVTQSBUZWwuICsxICg0MTUpIDk2MS04ODMw
|
||||||
|
IENvcHlyaWdodCAoYykgMTk5NiBWZXJpU2lnbiwgSW5jLiAgQWxsIFJpZ2h0cyBS
|
||||||
|
ZXNlcnZlZC4gQ0VSVEFJTiBXQVJSQU5USUVTIERJU0NMQUlNRUQgYW5kIExJQUJJ
|
||||||
|
TElUWSBMSU1JVEVELqAOBgxghkgBhvhFAQcBAQGhDgYMYIZIAYb4RQEHAQECMC8w
|
||||||
|
LRYraHR0cHM6Ly93d3cudmVyaXNpZ24uY29tL3JlcG9zaXRvcnkvQ1BTLTEuMDAU
|
||||||
|
BglghkgBhvhCAQEBAf8EBAMCAgQwDQYJKoZIhvcNAQECBQADgYEApRJRkNBqLLgs
|
||||||
|
53IR/d18ODdLOWMTZ+QOOxBrq460iBEdUwgF8vmPRX1ku7UiDeNzaLlurE6eFqHq
|
||||||
|
2zPyK5j60zfTLVJMWKcQWwTJLjHtXrW8pxhNtFc6Fdvy5ZkHnC/9NIl7/t4U6WqB
|
||||||
|
p4y+p7SdMIkEwIZfds0VbnQyX5MRUJY=
|
||||||
|
-----END CERTIFICATE-----
|
||||||
|
|
||||||
|
subject=/C=US/O=VeriSign, Inc./OU=Class 3 Public Primary Certification Authority
|
||||||
|
issuer= /C=US/O=VeriSign, Inc./OU=Class 3 Public Primary Certification Authority
|
||||||
|
-----BEGIN CERTIFICATE-----
|
||||||
|
MIICMTCCAZoCBQKhAAABMA0GCSqGSIb3DQEBAgUAMF8xCzAJBgNVBAYTAlVTMRcw
|
||||||
|
FQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE3MDUGA1UECxMuQ2xhc3MgMyBQdWJsaWMg
|
||||||
|
UHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw05NjAxMjkwMDAwMDBa
|
||||||
|
Fw05OTEyMzEyMzU5NTlaMF8xCzAJBgNVBAYTAlVTMRcwFQYDVQQKEw5WZXJpU2ln
|
||||||
|
biwgSW5jLjE3MDUGA1UECxMuQ2xhc3MgMyBQdWJsaWMgUHJpbWFyeSBDZXJ0aWZp
|
||||||
|
Y2F0aW9uIEF1dGhvcml0eTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAyVxZ
|
||||||
|
nvIbigEUtBDfBEDb41evakVAj4QMC9Ez2dkRz+4CWB8l9yqoRAWq7AMfeH+ek7ma
|
||||||
|
AKojfdashaJjRcdyJ8z0TMZ1cdI5709C8HXfCpDGjiBvmA/4rCNfcCk2pMmG57Ga
|
||||||
|
IMtTpYXnPb59mv4kRTPcdhXtD6JxZExlLoFoRacCAwEAATANBgkqhkiG9w0BAQIF
|
||||||
|
AAOBgQB1Zmw+0c2B27X4LzZRtvdCvM1Cr9wO+hVs+GeTVzrrtpLotgHKjLeOQ7RJ
|
||||||
|
Zfk+7r11Ri7J/CVdqMcvi5uPaM+0nJcYwE3vH9mvgrPmZLiEXIqaB1JDYft0nls6
|
||||||
|
NvxMsvwaPxUupVs8G5DsiCnkWRb5zget7Ond2tIxik/W2O8XjQ==
|
||||||
|
-----END CERTIFICATE-----
|
||||||
|
subject=/C=US/O=VeriSign, Inc./OU=Class 4 Public Primary Certification Authority
|
||||||
|
issuer= /C=US/O=VeriSign, Inc./OU=Class 4 Public Primary Certification Authority
|
||||||
|
-----BEGIN CERTIFICATE-----
|
||||||
|
MIICMTCCAZoCBQKmAAABMA0GCSqGSIb3DQEBAgUAMF8xCzAJBgNVBAYTAlVTMRcw
|
||||||
|
FQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE3MDUGA1UECxMuQ2xhc3MgNCBQdWJsaWMg
|
||||||
|
UHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw05NjAxMjkwMDAwMDBa
|
||||||
|
Fw05OTEyMzEyMzU5NTlaMF8xCzAJBgNVBAYTAlVTMRcwFQYDVQQKEw5WZXJpU2ln
|
||||||
|
biwgSW5jLjE3MDUGA1UECxMuQ2xhc3MgNCBQdWJsaWMgUHJpbWFyeSBDZXJ0aWZp
|
||||||
|
Y2F0aW9uIEF1dGhvcml0eTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA0LJ1
|
||||||
|
9njQrlpQ9OlQqZ+M1++RlHDo0iSQdomF1t+s5gEXMoDwnZNHvJplnR+Xrr/phnVj
|
||||||
|
IIm9gFidBAydqMEk6QvlMXi9/C0MN2qeeIDpRnX57aP7E3vIwUzSo+/1PLBij0pd
|
||||||
|
O92VZ48TucE81qcmm+zDO3rZTbxtm+gVAePwR6kCAwEAATANBgkqhkiG9w0BAQIF
|
||||||
|
AAOBgQBT3dPwnCR+QKri/AAa19oM/DJhuBUNlvP6Vxt/M3yv6ZiaYch6s7f/sdyZ
|
||||||
|
g9ysEvxwyR84Qu1E9oAuW2szaayc01znX1oYx7EteQSWQZGZQbE8DbqEOcY7l/Am
|
||||||
|
yY7uvcxClf8exwI/VAx49byqYHwCaejcrOICdmHEPgPq0ook0Q==
|
||||||
|
-----END CERTIFICATE-----
|
||||||
|
|||||||
420
apps/server2.pem
420
apps/server2.pem
@@ -1,52 +1,376 @@
|
|||||||
subject= C = UK, O = OpenSSL Group, OU = FOR TESTING PURPOSES ONLY, CN = Test Server Cert #2
|
issuer= /C=AU/ST=Queensland/O=CryptSoft Pty Ltd/CN=Test CA (1024 bit)
|
||||||
issuer= C = UK, O = OpenSSL Group, OU = FOR TESTING PURPOSES ONLY, CN = OpenSSL Test Intermediate CA
|
subject=/C=AU/ST=Queensland/O=CryptSoft Pty Ltd/CN=Server test cert (1024 bit)
|
||||||
-----BEGIN CERTIFICATE-----
|
-----BEGIN CERTIFICATE-----
|
||||||
MIID6jCCAtKgAwIBAgIJALnu1NlVpZ60MA0GCSqGSIb3DQEBBQUAMHAxCzAJBgNV
|
MIICLjCCAZcCAQEwDQYJKoZIhvcNAQEEBQAwWzELMAkGA1UEBhMCQVUxEzARBgNV
|
||||||
BAYTAlVLMRYwFAYDVQQKDA1PcGVuU1NMIEdyb3VwMSIwIAYDVQQLDBlGT1IgVEVT
|
BAgTClF1ZWVuc2xhbmQxGjAYBgNVBAoTEUNyeXB0U29mdCBQdHkgTHRkMRswGQYD
|
||||||
VElORyBQVVJQT1NFUyBPTkxZMSUwIwYDVQQDDBxPcGVuU1NMIFRlc3QgSW50ZXJt
|
VQQDExJUZXN0IENBICgxMDI0IGJpdCkwHhcNOTcwNjA5MTM1NzU0WhcNOTgwNjA5
|
||||||
ZWRpYXRlIENBMB4XDTExMTIwODE0MDE0OFoXDTIxMTAxNjE0MDE0OFowZzELMAkG
|
MTM1NzU0WjBkMQswCQYDVQQGEwJBVTETMBEGA1UECBMKUXVlZW5zbGFuZDEaMBgG
|
||||||
A1UEBhMCVUsxFjAUBgNVBAoMDU9wZW5TU0wgR3JvdXAxIjAgBgNVBAsMGUZPUiBU
|
A1UEChMRQ3J5cHRTb2Z0IFB0eSBMdGQxJDAiBgNVBAMTG1NlcnZlciB0ZXN0IGNl
|
||||||
RVNUSU5HIFBVUlBPU0VTIE9OTFkxHDAaBgNVBAMME1Rlc3QgU2VydmVyIENlcnQg
|
cnQgKDEwMjQgYml0KTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAsxH1PBPm
|
||||||
IzIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDrdi7j9yctG+L4EjBy
|
RkxrR11eV4bzNi4N9n11CI8nV29+ARlT1+qDe/mjVUvXlmsr1v/vf71G9GgqopSa
|
||||||
gjPmEqZzOJEQba26MoQGzglU7e5Xf59Rb/hgVQuKAoiZe7/R8rK4zJ4W7iXdXw0L
|
6RXrICLVdk/FYYYzhPvl1M+OrjaXDFO8BzBAF1Lnz6c7aRZvGRJNrRSr2nZEkqDf
|
||||||
qBpyG8B5aGKeI32w+A9TcBApoXXL2CrYQEQjZwUIpLlYBIi2NkJj3nVkq5dgl1gO
|
JW9dY7r2VZEpD5QeuaRYUnuECkqeieB65GMCAwEAATANBgkqhkiG9w0BAQQFAAOB
|
||||||
ALiQ+W8jg3kzg5Ec9rimp9r93N8wsSL3awsafurmYCvOf7leHaMP1WJ/zDRGUNHG
|
gQCWsOta6C0wiVzXz8wPmJKyTrurMlgUss2iSuW9366iwofZddsNg7FXniMzkIf6
|
||||||
/WtDjXc8ZUG1+6EXU9Jc2Fs+2Omf7fcN0l00AK/wPg8OaNS0rKyGq9JdIT9FRGV1
|
dp7jnmWZwKZ9cXsNUS2o4OL07qOk2HOywC0YsNZQsOBu1CBTYYkIefDiKFL1zQHh
|
||||||
bXe/rx58FaE5CItdwCSYhJvF/O95LWQoxJXye5bCFLmvDTEyVq9FMSCptfsmbXjE
|
8lwwNd4NP+OE3NzUNkCfh4DnFfg9WHkXUlD5UpxNRJ4gJA==
|
||||||
ZGsXAgMBAAGjgY8wgYwwDAYDVR0TAQH/BAIwADAOBgNVHQ8BAf8EBAMCBeAwLAYJ
|
|
||||||
YIZIAYb4QgENBB8WHU9wZW5TU0wgR2VuZXJhdGVkIENlcnRpZmljYXRlMB0GA1Ud
|
|
||||||
DgQWBBR52UaWWTKzZGDH/X4mWNcuqeQVazAfBgNVHSMEGDAWgBQ2w2yI55X+sL3s
|
|
||||||
zj49hqshgYfa2jANBgkqhkiG9w0BAQUFAAOCAQEANBW+XYLlHBqVY/31ie+3gRlS
|
|
||||||
LPfy4SIqn0t3RJjagT29MXprblBO2cbMO8VGjkQdKGpmMXjxbht2arOOUXRHX4n/
|
|
||||||
XTyn/QHEf0bcwIITMReO3DZUPAEw8hSjn9xEOM0IRVOCP+mH5fi74QzzQaZVCyYg
|
|
||||||
5VtLKdww/+sc0nCbKl2KWgDluriH0nfVx95qgW3mg9dhXRr0zmf1w2zkBHYpARYL
|
|
||||||
Dew6Z8EE4tS3HJu8/qM6meWzNtrfonQ3eiiMxjZBxzV46jchBwa2z9XYhP6AmpPb
|
|
||||||
oeTSzcQNbWsxaGYzWo46oLDUZmJOwSBawbS31bZNMCoPIY6ukoesCzFSsUKZww==
|
|
||||||
-----END CERTIFICATE-----
|
-----END CERTIFICATE-----
|
||||||
-----BEGIN RSA PRIVATE KEY-----
|
-----BEGIN RSA PRIVATE KEY-----
|
||||||
MIIEowIBAAKCAQEA63Yu4/cnLRvi+BIwcoIz5hKmcziREG2tujKEBs4JVO3uV3+f
|
MIICXgIBAAKBgQCzEfU8E+ZGTGtHXV5XhvM2Lg32fXUIjydXb34BGVPX6oN7+aNV
|
||||||
UW/4YFULigKImXu/0fKyuMyeFu4l3V8NC6gachvAeWhiniN9sPgPU3AQKaF1y9gq
|
S9eWayvW/+9/vUb0aCqilJrpFesgItV2T8VhhjOE++XUz46uNpcMU7wHMEAXUufP
|
||||||
2EBEI2cFCKS5WASItjZCY951ZKuXYJdYDgC4kPlvI4N5M4ORHPa4pqfa/dzfMLEi
|
pztpFm8ZEk2tFKvadkSSoN8lb11juvZVkSkPlB65pFhSe4QKSp6J4HrkYwIDAQAB
|
||||||
92sLGn7q5mArzn+5Xh2jD9Vif8w0RlDRxv1rQ413PGVBtfuhF1PSXNhbPtjpn+33
|
AoGBAKy8jvb0Lzby8q11yNLf7+78wCVdYi7ugMHcYA1JVFK8+zb1WfSm44FLQo/0
|
||||||
DdJdNACv8D4PDmjUtKyshqvSXSE/RURldW13v68efBWhOQiLXcAkmISbxfzveS1k
|
dSChAjgz36TTexeLODPYxleJndjVcOMVzsLJjSM8dLpXsTS4FCeMbhw2s2u+xqKY
|
||||||
KMSV8nuWwhS5rw0xMlavRTEgqbX7Jm14xGRrFwIDAQABAoIBAHLsTPihIfLnYIE5
|
bbPWfk+HOTyJjfnkcC5Nbg44eOmruq0gSmBeUXVM5UntlTnxAkEA7TGCA3h7kx5E
|
||||||
x4GsQQ5zXeBw5ITDM37ktwHnQDC+rIzyUl1aLD1AZRBoKinXd4lOTqLZ4/NHKx4A
|
Bl4zl2pc3gPAGt+dyfk5Po9mGJUUXhF5p2zueGmYWW74TmOWB1kzt4QRdYMzFePq
|
||||||
DYr58mZtWyUmqLOMmQVuHXTZBlp7XtYuXMMNovQwjQlp9LicBeoBU6gQ5PVMtubD
|
zfDNXEa1CwJBAMFErdY0xp0UJ13WwBbUTk8rujqQdHtjw0klhpbuKkjxu2hN0wwM
|
||||||
F4xGF89Sn0cTHW3iMkqTtQ5KcR1j57OcJO0FEb1vPvk2MXI5ZyAatUYE7YacbEzd
|
6p0D9qxF7JHaghqVRI0fAW/EE0OzdHMR9QkCQQDNR26dMFXKsoPu+vItljj/UEGf
|
||||||
rg02uIwx3FqNSkuSI79uz4hMdV5TPtuhxx9nTwj9aLUhXFeZ0mn2PVgVzEnnMoJb
|
QG7gERiQ4yxaFBPHgdpGo0kT31eh9x9hQGDkxTe0GNG/YSgCRvm8+C3TMcKXAkBD
|
||||||
+znlsZDgzDlJqdaD744YGWh8Z3OEssB35KfzFcdOeO6yH8lmv2Zfznk7pNPT7LTb
|
dhGn36wkUFCddMSAM4NSJ1VN8/Z0y5HzCmI8dM3VwGtGMUQlxKxwOl30LEQzdS5M
|
||||||
Lae9VgkCgYEA92p1qnAB3NtJtNcaW53i0S5WJgS1hxWKvUDx3lTB9s8X9fHpqL1a
|
0SWojNYXiT2gOBfBwtbhAkEAhafl5QEOIgUz+XazS/IlZ8goNKdDVfYgK3mHHjvv
|
||||||
E94fDfWzp/hax6FefUKIvBOukPLQ6bYjTMiFoOHzVirghAIuIUoMI5VtLhwD1hKs
|
nY5G+AuGebdNkXJr4KSWxDcN+C2i47zuj4QXA16MAOandA==
|
||||||
Lr7l/dptMgKb1nZHyXoKHRBthsy3K4+udsPi8TzMvYElgEqyQIe/Rk0CgYEA86GL
|
|
||||||
8HC6zLszzKERDPBxrboRmoFvVUCTQDhsfj1M8aR3nQ8V5LkdIJc7Wqm/Ggfk9QRf
|
|
||||||
rJ8M2WUMlU5CNnCn/KCrKzCNZIReze3fV+HnKdbcXGLvgbHPrhnz8yYehUFG+RGq
|
|
||||||
bVyDWRU94T38izy2s5qMYrMJWZEYyXncSPbfcPMCgYAtaXfxcZ+V5xYPQFARMtiX
|
|
||||||
5nZfggvDoJuXgx0h3tK/N2HBfcaSdzbaYLG4gTmZggc/jwnl2dl5E++9oSPhUdIG
|
|
||||||
3ONSFUbxsOsGr9PBvnKd8WZZyUCXAVRjPBzAzF+whzQNWCZy/5htnz9LN7YDI9s0
|
|
||||||
5113Q96cheDZPFydZY0hHQKBgQDVbEhNukM5xCiNcu+f2SaMnLp9EjQ4h5g3IvaP
|
|
||||||
5B16daw/Dw8LzcohWboqIxeAsze0GD/D1ZUJAEd0qBjC3g+a9BjefervCjKOzXng
|
|
||||||
38mEUm+6EwVjJSQcjSmycEs+Sr/kwr/8i5WYvU32+jk4tFgMoC+o6tQe/Uesf68k
|
|
||||||
z/dPVwKBgGbF7Vv1/3SmhlOy+zYyvJ0CrWtKxH9QP6tLIEgEpd8x7YTSuCH94yok
|
|
||||||
kToMXYA3sWNPt22GbRDZ+rcp4c7HkDx6I6vpdP9aQEwJTp0EPy0sgWr2XwYmreIQ
|
|
||||||
NFmkk8Itn9EY2R9VBaP7GLv5kvwxDdLAnmwGmzVtbmaVdxCaBwUk
|
|
||||||
-----END RSA PRIVATE KEY-----
|
-----END RSA PRIVATE KEY-----
|
||||||
|
subject=/C=US/O=AT&T Bell Laboratories/OU=Prototype Research CA
|
||||||
|
issuer= /C=US/O=AT&T Bell Laboratories/OU=Prototype Research CA
|
||||||
|
notBefore=950413210656Z
|
||||||
|
notAfter =970412210656Z
|
||||||
|
-----BEGIN X509 CERTIFICATE-----
|
||||||
|
|
||||||
|
MIICCDCCAXECAQAwDQYJKoZIhvcNAQEEBQAwTjELMAkGA1UEBhMCVVMxHzAdBgNV
|
||||||
|
BAoUFkFUJlQgQmVsbCBMYWJvcmF0b3JpZXMxHjAcBgNVBAsUFVByb3RvdHlwZSBS
|
||||||
|
ZXNlYXJjaCBDQTAeFw05NTA0MTMyMTA2NTZaFw05NzA0MTIyMTA2NTZaME4xCzAJ
|
||||||
|
BgNVBAYTAlVTMR8wHQYDVQQKFBZBVCZUIEJlbGwgTGFib3JhdG9yaWVzMR4wHAYD
|
||||||
|
VQQLFBVQcm90b3R5cGUgUmVzZWFyY2ggQ0EwgZwwDQYJKoZIhvcNAQEBBQADgYoA
|
||||||
|
MIGGAoGAebOmgtSCl+wCYZc86UGYeTLY8cjmW2P0FN8ToT/u2pECCoFdrlycX0OR
|
||||||
|
3wt0ZhpFXLVNeDnHwEE9veNUih7pCL2ZBFqoIoQkB1lZmXRiVtjGonz8BLm/qrFM
|
||||||
|
YHb0lme/Ol+s118mwKVxnn6bSAeI/OXKhLaVdYZWk+aEaxEDkVkCAQ8wDQYJKoZI
|
||||||
|
hvcNAQEEBQADgYEAAZMG14lZmZ8bahkaHaTV9dQf4p2FZiQTFwHP9ZyGsXPC+LT5
|
||||||
|
dG5iTaRmyjNIJdPWohZDl97kAci79aBndvuEvRKOjLHs3WRGBIwERnAcnY9Mz8u/
|
||||||
|
zIHK23PjYVxGGaZd669OJwD0CYyqH22HH9nFUGaoJdsv39ChW0NRdLE9+y8=
|
||||||
|
-----END X509 CERTIFICATE-----
|
||||||
|
issuer= /C=AU/ST=Queensland/O=CryptSoft Pty Ltd/CN=Test PCA (1024 bit)
|
||||||
|
subject=/C=AU/ST=Queensland/O=CryptSoft Pty Ltd/CN=Test CA (1024 bit)
|
||||||
|
-----BEGIN CERTIFICATE-----
|
||||||
|
MIICJjCCAY8CAQAwDQYJKoZIhvcNAQEEBQAwXDELMAkGA1UEBhMCQVUxEzARBgNV
|
||||||
|
BAgTClF1ZWVuc2xhbmQxGjAYBgNVBAoTEUNyeXB0U29mdCBQdHkgTHRkMRwwGgYD
|
||||||
|
VQQDExNUZXN0IFBDQSAoMTAyNCBiaXQpMB4XDTk3MDYwOTEzNTc0M1oXDTAxMDYw
|
||||||
|
OTEzNTc0M1owWzELMAkGA1UEBhMCQVUxEzARBgNVBAgTClF1ZWVuc2xhbmQxGjAY
|
||||||
|
BgNVBAoTEUNyeXB0U29mdCBQdHkgTHRkMRswGQYDVQQDExJUZXN0IENBICgxMDI0
|
||||||
|
IGJpdCkwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAKO7o8t116VP6cgybTsZ
|
||||||
|
DCZhr95nYlZuya3aCi1IKoztqwWnjbmDFIriOqGFPrZQ+moMETC9D59iRW/dFXSv
|
||||||
|
1F65ka/XY2hLh9exCCo7XuUcDs53Qp3bI3AmMqHjgzE8oO3ajyJAzJkTTOUecQU2
|
||||||
|
mw/gI4tMM0LqWMQS7luTy4+xAgMBAAEwDQYJKoZIhvcNAQEEBQADgYEAM7achv3v
|
||||||
|
hLQJcv/65eGEpBXM40ZDVoFQFFJWaY5p883HTqLB1x4FdzsXHH0QKBTcKpWwqyu4
|
||||||
|
YDm3fb8oDugw72bCzfyZK/zVZPR/hVlqI/fvU109Qoc+7oPvIXWky71HfcK6ZBCA
|
||||||
|
q30KIqGM/uoM60INq97qjDmCJapagcNBGQs=
|
||||||
|
-----END CERTIFICATE-----
|
||||||
|
-----BEGIN RSA PRIVATE KEY-----
|
||||||
|
MIICXQIBAAKBgQCju6PLddelT+nIMm07GQwmYa/eZ2JWbsmt2gotSCqM7asFp425
|
||||||
|
gxSK4jqhhT62UPpqDBEwvQ+fYkVv3RV0r9ReuZGv12NoS4fXsQgqO17lHA7Od0Kd
|
||||||
|
2yNwJjKh44MxPKDt2o8iQMyZE0zlHnEFNpsP4COLTDNC6ljEEu5bk8uPsQIDAQAB
|
||||||
|
AoGAVZmpFZsDZfr0l2S9tLLwpjRWNOlKATQkno6q2WesT0eGLQufTciY+c8ypfU6
|
||||||
|
hyio8r5iUl/VhhdjhAtKx1mRpiotftHo/eYf8rtsrnprOnWG0bWjLjtIoMbcxGn2
|
||||||
|
J3bN6LJmbJMjDs0eJ3KnTu646F3nDUw2oGAwmpzKXA1KAP0CQQDRvQhxk2D3Pehs
|
||||||
|
HvG665u2pB5ipYQngEFlZO7RHJZzJOZEWSLuuMqaF/7pTfA5jiBvWqCgJeCRRInL
|
||||||
|
21ru4dlPAkEAx9jj7BgKn5TYnMoBSSe0afjsV9oApVpN1Nacb1YDtCwy+scp3++s
|
||||||
|
nFxlv98wxIlSdpwMUn+AUWfjiWR7Tu/G/wJBAJ/KjwZIrFVxewP0x2ILYsTRYLzz
|
||||||
|
MS4PDsO7FB+I0i7DbBOifXS2oNSpd3I0CNMwrxFnUHzynpbOStVfN3ZL5w0CQQCa
|
||||||
|
pwFahxBRhkJKsxhjoFJBX9yl75JoY4Wvm5Tbo9ih6UJaRx3kqfkN14L2BKYcsZgb
|
||||||
|
KY9vmDOYy6iNfjDeWTfJAkBkfPUb8oTJ/nSP5zN6sqGxSY4krc4xLxpRmxoJ8HL2
|
||||||
|
XfhqXkTzbU13RX9JJ/NZ8vQN9Vm2NhxRGJocQkmcdVtJ
|
||||||
|
-----END RSA PRIVATE KEY-----
|
||||||
|
-----BEGIN X509 CERTIFICATE-----
|
||||||
|
MIICYDCCAiACAgEoMAkGBSsOAwINBQAwfDELMAkGA1UEBhMCVVMxNjA0BgNVBAoT
|
||||||
|
LU5hdGlvbmFsIEFlcm9uYXV0aWNzIGFuZCBTcGFjZSBBZG1pbmlzdHJhdGlvbjEZ
|
||||||
|
MBcGA1UECxMQVGVzdCBFbnZpcm9ubWVudDEaMBgGA1UECxMRRFNTLU5BU0EtUGls
|
||||||
|
b3QtQ0EwHhcNOTYwMjI2MTYzMjQ1WhcNOTcwMjI1MTYzMjQ1WjB8MQswCQYDVQQG
|
||||||
|
EwJVUzE2MDQGA1UEChMtTmF0aW9uYWwgQWVyb25hdXRpY3MgYW5kIFNwYWNlIEFk
|
||||||
|
bWluaXN0cmF0aW9uMRkwFwYDVQQLExBUZXN0IEVudmlyb25tZW50MRowGAYDVQQL
|
||||||
|
ExFEU1MtTkFTQS1QaWxvdC1DQTCB8jAJBgUrDgMCDAUAA4HkADCB4AJBAMA/ssKb
|
||||||
|
hPNUG7ZlASfVwEJU21O5OyF/iyBzgHI1O8eOhJGUYO8cc8wDMjR508Mr9cp6Uhl/
|
||||||
|
ZB7FV5GkLNEnRHYCQQDUEaSg45P2qrDwixTRhFhmWz5Nvc4lRFQ/42XPcchiJBLb
|
||||||
|
bn3QK74T2IxY1yY+kCNq8XrIqf5fJJzIH0J/xUP3AhUAsg2wsQHfDGYk/BOSulX3
|
||||||
|
fVd0geUCQQCzCFUQAh+ZkEmp5804cs6ZWBhrUAfnra8lJItYo9xPcXgdIfLfibcX
|
||||||
|
R71UsyO77MRD7B0+Ag2tq794IleCVcEEMAkGBSsOAwINBQADLwAwLAIUUayDfreR
|
||||||
|
Yh2WeU86/pHNdkUC1IgCFEfxe1f0oMpxJyrJ5XIxTi7vGdoK
|
||||||
|
-----END X509 CERTIFICATE-----
|
||||||
|
-----BEGIN X509 CERTIFICATE-----
|
||||||
|
|
||||||
|
MIICGTCCAdgCAwCqTDAJBgUrDgMCDQUAMHwxCzAJBgNVBAYTAlVTMTYwNAYDVQQK
|
||||||
|
Ey1OYXRpb25hbCBBZXJvbmF1dGljcyBhbmQgU3BhY2UgQWRtaW5pc3RyYXRpb24x
|
||||||
|
GTAXBgNVBAsTEFRlc3QgRW52aXJvbm1lbnQxGjAYBgNVBAsTEURTUy1OQVNBLVBp
|
||||||
|
bG90LUNBMB4XDTk2MDUxNDE3MDE0MVoXDTk3MDUxNDE3MDE0MVowMzELMAkGA1UE
|
||||||
|
BhMCQVUxDzANBgNVBAoTBk1pbmNvbTETMBEGA1UEAxMKRXJpYyBZb3VuZzCB8jAJ
|
||||||
|
BgUrDgMCDAUAA4HkADCB4AJBAKbfHz6vE6pXXMTpswtGUec2tvnfLJUsoxE9qs4+
|
||||||
|
ObZX7LmLvragNPUeiTJx7UOWZ5DfBj6bXLc8eYne0lP1g3ACQQDUEaSg45P2qrDw
|
||||||
|
ixTRhFhmWz5Nvc4lRFQ/42XPcchiJBLbbn3QK74T2IxY1yY+kCNq8XrIqf5fJJzI
|
||||||
|
H0J/xUP3AhUAsg2wsQHfDGYk/BOSulX3fVd0geUCQQCzCFUQAh+ZkEmp5804cs6Z
|
||||||
|
WBhrUAfnra8lJItYo9xPcXgdIfLfibcXR71UsyO77MRD7B0+Ag2tq794IleCVcEE
|
||||||
|
MAkGBSsOAwINBQADMAAwLQIUWsuuJRE3VT4ueWkWMAJMJaZjj1ECFQCYY0zX4bzM
|
||||||
|
LC7obsrHD8XAHG+ZRG==
|
||||||
|
-----END X509 CERTIFICATE-----
|
||||||
|
-----BEGIN CERTIFICATE-----
|
||||||
|
MIICTTCCAbagAwIBAgIBADANBgkqhkiG9w0BAQQFADBMMQswCQYDVQQGEwJHQjEM
|
||||||
|
MAoGA1UEChMDVUNMMRgwFgYDVQQLEw9JQ0UtVEVMIFByb2plY3QxFTATBgNVBAMT
|
||||||
|
DFRydXN0RmFjdG9yeTAeFw05NzA0MjIxNDM5MTRaFw05ODA0MjIxNDM5MTRaMEwx
|
||||||
|
CzAJBgNVBAYTAkdCMQwwCgYDVQQKEwNVQ0wxGDAWBgNVBAsTD0lDRS1URUwgUHJv
|
||||||
|
amVjdDEVMBMGA1UEAxMMVHJ1c3RGYWN0b3J5MIGcMAoGBFUIAQECAgQAA4GNADCB
|
||||||
|
iQKBgQCEieR8NcXkUW1f0G6aC6u0i8q/98JqS6RxK5YmHIGKCkuTWAUjzLfUa4dt
|
||||||
|
U9igGCjTuxaDqlzEim+t/02pmiBZT9HaX++35MjQPUWmsChcYU5WyzGErXi+rQaw
|
||||||
|
zlwS73zM8qiPj/97lXYycWhgL0VaiDSPxRXEUdWoaGruom4mNQIDAQABo0IwQDAd
|
||||||
|
BgNVHQ4EFgQUHal1LZr7oVg5z6lYzrhTgZRCmcUwDgYDVR0PAQH/BAQDAgH2MA8G
|
||||||
|
A1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEEBQADgYEAfaggfl6FZoioecjv0dq8
|
||||||
|
/DXo/u11iMZvXn08gjX/zl2b4wtPbShOSY5FhkSm8GeySasz+/Nwb/uzfnIhokWi
|
||||||
|
lfPZHtlCWtXbIy/TN51eJyq04ceDCQDWvLC2enVg9KB+GJ34b5c5VaPRzq8MBxsA
|
||||||
|
S7ELuYGtmYgYm9NZOIr7yU0=
|
||||||
|
-----END CERTIFICATE-----
|
||||||
|
-----BEGIN CERTIFICATE-----
|
||||||
|
MIIB6jCCAZQCAgEtMA0GCSqGSIb3DQEBBAUAMIGAMQswCQYDVQQGEwJVUzE2MDQG
|
||||||
|
A1UEChMtTmF0aW9uYWwgQWVyb25hdXRpY3MgYW5kIFNwYWNlIEFkbWluaXN0cmF0
|
||||||
|
aW9uMRkwFwYDVQQLExBUZXN0IEVudmlyb25tZW50MR4wHAYDVQQLExVNRDUtUlNB
|
||||||
|
LU5BU0EtUGlsb3QtQ0EwHhcNOTYwNDMwMjIwNTAwWhcNOTcwNDMwMjIwNTAwWjCB
|
||||||
|
gDELMAkGA1UEBhMCVVMxNjA0BgNVBAoTLU5hdGlvbmFsIEFlcm9uYXV0aWNzIGFu
|
||||||
|
ZCBTcGFjZSBBZG1pbmlzdHJhdGlvbjEZMBcGA1UECxMQVGVzdCBFbnZpcm9ubWVu
|
||||||
|
dDEeMBwGA1UECxMVTUQ1LVJTQS1OQVNBLVBpbG90LUNBMFkwCgYEVQgBAQICAgAD
|
||||||
|
SwAwSAJBALmmX5+GqAvcrWK13rfDrNX9UfeA7f+ijyBgeFQjYUoDpFqapw4nzQBL
|
||||||
|
bAXug8pKkRwa2Zh8YODhXsRWu2F/UckCAwEAATANBgkqhkiG9w0BAQQFAANBAH9a
|
||||||
|
OBA+QCsjxXgnSqHx04gcU8S49DVUb1f2XVoLnHlIb8RnX0k5O6mpHT5eti9bLkiW
|
||||||
|
GJNMJ4L0AJ/ac+SmHZc=
|
||||||
|
-----END CERTIFICATE-----
|
||||||
|
-----BEGIN CERTIFICATE-----
|
||||||
|
MIICajCCAdMCBDGA0QUwDQYJKoZIhvcNAQEEBQAwfTELMAkGA1UEBhMCQ2ExDzAN
|
||||||
|
BgNVBAcTBk5lcGVhbjEeMBwGA1UECxMVTm8gTGlhYmlsaXR5IEFjY2VwdGVkMR8w
|
||||||
|
HQYDVQQKExZGb3IgRGVtbyBQdXJwb3NlcyBPbmx5MRwwGgYDVQQDExNFbnRydXN0
|
||||||
|
IERlbW8gV2ViIENBMB4XDTk2MDQyNjEzMzUwMVoXDTA2MDQyNjEzMzUwMVowfTEL
|
||||||
|
MAkGA1UEBhMCQ2ExDzANBgNVBAcTBk5lcGVhbjEeMBwGA1UECxMVTm8gTGlhYmls
|
||||||
|
aXR5IEFjY2VwdGVkMR8wHQYDVQQKExZGb3IgRGVtbyBQdXJwb3NlcyBPbmx5MRww
|
||||||
|
GgYDVQQDExNFbnRydXN0IERlbW8gV2ViIENBMIGdMA0GCSqGSIb3DQEBAQUAA4GL
|
||||||
|
ADCBhwKBgQCaroS7O1DA0hm4IefNYU1cx/nqOmzEnk291d1XqznDeF4wEgakbkCc
|
||||||
|
zTKxK791yNpXG5RmngqH7cygDRTHZJ6mfCRn0wGC+AI00F2vYTGqPGRQL1N3lZT0
|
||||||
|
YDKFC0SQeMMjFIZ1aeQigroFQnHo0VB3zWIMpNkka8PY9lxHZAmWwQIBAzANBgkq
|
||||||
|
hkiG9w0BAQQFAAOBgQBAx0UMVA1s54lMQyXjMX5kj99FJN5itb8bK1Rk+cegPQPF
|
||||||
|
cWO9SEWyEjjBjIkjjzAwBkaEszFsNGxemxtXvwjIm1xEUMTVlPEWTs2qnDvAUA9W
|
||||||
|
YqhWbhH0toGT36236QAsqCZ76rbTRVSSX2BHyJwJMG2tCRv7kRJ//NIgxj3H4w==
|
||||||
|
-----END CERTIFICATE-----
|
||||||
|
|
||||||
|
issuer= /C=AU/ST=Queensland/O=CryptSoft Pty Ltd/CN=Test PCA (1024 bit)
|
||||||
|
subject=/C=AU/ST=Queensland/O=CryptSoft Pty Ltd/CN=Test PCA (1024 bit)
|
||||||
|
-----BEGIN CERTIFICATE-----
|
||||||
|
MIICJzCCAZACAQAwDQYJKoZIhvcNAQEEBQAwXDELMAkGA1UEBhMCQVUxEzARBgNV
|
||||||
|
BAgTClF1ZWVuc2xhbmQxGjAYBgNVBAoTEUNyeXB0U29mdCBQdHkgTHRkMRwwGgYD
|
||||||
|
VQQDExNUZXN0IFBDQSAoMTAyNCBiaXQpMB4XDTk3MDYwOTEzNTczN1oXDTAxMDYw
|
||||||
|
OTEzNTczN1owXDELMAkGA1UEBhMCQVUxEzARBgNVBAgTClF1ZWVuc2xhbmQxGjAY
|
||||||
|
BgNVBAoTEUNyeXB0U29mdCBQdHkgTHRkMRwwGgYDVQQDExNUZXN0IFBDQSAoMTAy
|
||||||
|
NCBiaXQpMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCdoWk/3+WcMlfjIrkg
|
||||||
|
40ketmnQaEogQe1LLcuOJV6rKfUSAsPgwgsabJ/wn8TxA1yy3eKJbFl3OiUXMRsp
|
||||||
|
22Jp85PmemiDzyUIStwk72qhp1imbANZvlmlCFKiQrjUyuDfu4TABmn+kkt3vR1Y
|
||||||
|
BEOGt+IFye1UBVSATVdRJ2UVhwIDAQABMA0GCSqGSIb3DQEBBAUAA4GBABNA1u/S
|
||||||
|
Cg/LJZWb7GliiKJsvuhxlE4E5JxQF2zMub/CSNbF97//tYSyj96sxeFQxZXbcjm9
|
||||||
|
xt6mr/xNLA4szNQMJ4P+L7b5e/jC5DSqlwS+CUYJgaFs/SP+qJoCSu1bR3IM9XWO
|
||||||
|
cRBpDmcBbYLkSyB92WURvsZ1LtjEcn+cdQVI
|
||||||
|
-----END CERTIFICATE-----
|
||||||
|
-----BEGIN RSA PRIVATE KEY-----
|
||||||
|
MIICXAIBAAKBgQCdoWk/3+WcMlfjIrkg40ketmnQaEogQe1LLcuOJV6rKfUSAsPg
|
||||||
|
wgsabJ/wn8TxA1yy3eKJbFl3OiUXMRsp22Jp85PmemiDzyUIStwk72qhp1imbANZ
|
||||||
|
vlmlCFKiQrjUyuDfu4TABmn+kkt3vR1YBEOGt+IFye1UBVSATVdRJ2UVhwIDAQAB
|
||||||
|
AoGAba4fTtuap5l7/8ZsbE7Z1O32KJY4ZcOZukLOLUUhXxXduT+FTgGWujc0/rgc
|
||||||
|
z9qYCLlNZHOouMYTgtSfYvuMuLZ11VIt0GYH+nRioLShE59Yy+zCRyC+gPigS1kz
|
||||||
|
xvo14AsOIPYV14Tk/SsHyq6E0eTk7VzaIE197giiINUERPECQQDSKmtPTh/lRKw7
|
||||||
|
HSZSM0I1mFWn/1zqrAbontRQY5w98QWIOe5qmzYyFbPXYT3d9BzlsMyhgiRNoBbD
|
||||||
|
yvohSHXJAkEAwAHx6ezAZeWWzD5yXD36nyjpkVCw7Tk7TSmOceLJMWt1QcrCfqlS
|
||||||
|
xA5jjpQ6Z8suU5DdtWAryM2sAir1WisYzwJAd6Zcx56jvAQ3xcPXsE6scBTVFzrj
|
||||||
|
7FqZ6E+cclPzfLQ+QQsyOBE7bpI6e/FJppY26XGZXo3YGzV8IGXrt40oOQJALETG
|
||||||
|
h86EFXo3qGOFbmsDy4pdP5nBERCu8X1xUCSfintiD4c2DInxgS5oGclnJeMcjTvL
|
||||||
|
QjQoJCX3UJCi/OUO1QJBAKgcDHWjMvt+l1pjJBsSEZ0HX9AAIIVx0RQmbFGS+F2Q
|
||||||
|
hhu5l77WnnZOQ9vvhV5u7NPCUF9nhU3jh60qWWO8mkc=
|
||||||
|
-----END RSA PRIVATE KEY-----
|
||||||
|
subject=/C=US/O=RSA Data Security, Inc./OU=Commercial Certification Authority
|
||||||
|
issuer= /C=US/O=RSA Data Security, Inc./OU=Commercial Certification Authority
|
||||||
|
notBefore=941104185834Z
|
||||||
|
notAfter =991103185834Z
|
||||||
|
-----BEGIN X509 CERTIFICATE-----
|
||||||
|
|
||||||
|
MIICIzCCAZACBQJBAAAWMA0GCSqGSIb3DQEBAgUAMFwxCzAJBgNVBAYTAlVTMSAw
|
||||||
|
HgYDVQQKExdSU0EgRGF0YSBTZWN1cml0eSwgSW5jLjErMCkGA1UECxMiQ29tbWVy
|
||||||
|
Y2lhbCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw05NDExMDQxODU4MzRaFw05
|
||||||
|
OTExMDMxODU4MzRaMFwxCzAJBgNVBAYTAlVTMSAwHgYDVQQKExdSU0EgRGF0YSBT
|
||||||
|
ZWN1cml0eSwgSW5jLjErMCkGA1UECxMiQ29tbWVyY2lhbCBDZXJ0aWZpY2F0aW9u
|
||||||
|
IEF1dGhvcml0eTCBmzANBgkqhkiG9w0BAQEFAAOBiQAwgYUCfgCk+4Fie84QJ93o
|
||||||
|
975sbsZwmdu41QUDaSiCnHJ/lj+O7Kwpkj+KFPhCdr69XQO5kNTQvAayUTNfxMK/
|
||||||
|
touPmbZiImDd298ggrTKoi8tUO2UMt7gVY3UaOLgTNLNBRYulWZcYVI4HlGogqHE
|
||||||
|
7yXpCuaLK44xZtn42f29O2nZ6wIDAQABMA0GCSqGSIb3DQEBAgUAA34AdrW2EP4j
|
||||||
|
9/dZYkuwX5zBaLxJu7NJbyFHXSudVMQAKD+YufKKg5tgf+tQx6sFEC097TgCwaVI
|
||||||
|
0v5loMC86qYjFmZsGySp8+x5NRhPJsjjr1BKx6cxa9B8GJ1Qv6km+iYrRpwUqbtb
|
||||||
|
MJhCKLVLU7tDCZJAuqiqWqTGtotXTcU=
|
||||||
|
-----END X509 CERTIFICATE-----
|
||||||
|
subject=/C=US/O=RSA Data Security, Inc./OU=Secure Server Certification Authority
|
||||||
|
issuer= /C=US/O=RSA Data Security, Inc./OU=Secure Server Certification Authority
|
||||||
|
notBefore=941109235417Z
|
||||||
|
notAfter =991231235417Z
|
||||||
|
-----BEGIN X509 CERTIFICATE-----
|
||||||
|
|
||||||
|
MIICKTCCAZYCBQJBAAABMA0GCSqGSIb3DQEBAgUAMF8xCzAJBgNVBAYTAlVTMSAw
|
||||||
|
HgYDVQQKExdSU0EgRGF0YSBTZWN1cml0eSwgSW5jLjEuMCwGA1UECxMlU2VjdXJl
|
||||||
|
IFNlcnZlciBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw05NDExMDkyMzU0MTda
|
||||||
|
Fw05OTEyMzEyMzU0MTdaMF8xCzAJBgNVBAYTAlVTMSAwHgYDVQQKExdSU0EgRGF0
|
||||||
|
YSBTZWN1cml0eSwgSW5jLjEuMCwGA1UECxMlU2VjdXJlIFNlcnZlciBDZXJ0aWZp
|
||||||
|
Y2F0aW9uIEF1dGhvcml0eTCBmzANBgkqhkiG9w0BAQEFAAOBiQAwgYUCfgCSznrB
|
||||||
|
roM+WqqJg1esJQF2DK2ujiw3zus1eGRUA+WEQFHJv48I4oqCCNIWhjdV6bEhAq12
|
||||||
|
aIGaBaJLyUslZiJWbIgHj/eBWW2EB2VwE3F2Ppt3TONQiVaYSLkdpykaEy5KEVmc
|
||||||
|
HhXVSVQsczppgrGXOZxtcGdI5d0t1sgeewIDAQABMA0GCSqGSIb3DQEBAgUAA34A
|
||||||
|
iNHReSHO4ovo+MF9NFM/YYPZtgs4F7boviGNjwC4i1N+RGceIr2XJ+CchcxK9oU7
|
||||||
|
suK+ktPlDemvXA4MRpX/oRxePug2WHpzpgr4IhFrwwk4fia7c+8AvQKk8xQNMD9h
|
||||||
|
cHsg/jKjn7P0Z1LctO6EjJY2IN6BCINxIYoPnqk=
|
||||||
|
-----END X509 CERTIFICATE-----
|
||||||
|
subject=/C=ZA/SP=Western Cape/L=Cape Town/O=Thawte Consulting cc
|
||||||
|
/OU=Certification Services Division/CN=Thawte Server CA
|
||||||
|
/Email=server-certs@thawte.com
|
||||||
|
issuer= /C=ZA/SP=Western Cape/L=Cape Town/O=Thawte Consulting cc
|
||||||
|
/OU=Certification Services Division/CN=Thawte Server CA
|
||||||
|
/Email=server-certs@thawte.com
|
||||||
|
-----BEGIN CERTIFICATE-----
|
||||||
|
MIIC+TCCAmICAQAwDQYJKoZIhvcNAQEEBQAwgcQxCzAJBgNVBAYTAlpBMRUwEwYD
|
||||||
|
VQQIEwxXZXN0ZXJuIENhcGUxEjAQBgNVBAcTCUNhcGUgVG93bjEdMBsGA1UEChMU
|
||||||
|
VGhhd3RlIENvbnN1bHRpbmcgY2MxKDAmBgNVBAsTH0NlcnRpZmljYXRpb24gU2Vy
|
||||||
|
dmljZXMgRGl2aXNpb24xGTAXBgNVBAMTEFRoYXd0ZSBTZXJ2ZXIgQ0ExJjAkBgkq
|
||||||
|
hkiG9w0BCQEWF3NlcnZlci1jZXJ0c0B0aGF3dGUuY29tMB4XDTk2MDcyNzE4MDc1
|
||||||
|
N1oXDTk4MDcyNzE4MDc1N1owgcQxCzAJBgNVBAYTAlpBMRUwEwYDVQQIEwxXZXN0
|
||||||
|
ZXJuIENhcGUxEjAQBgNVBAcTCUNhcGUgVG93bjEdMBsGA1UEChMUVGhhd3RlIENv
|
||||||
|
bnN1bHRpbmcgY2MxKDAmBgNVBAsTH0NlcnRpZmljYXRpb24gU2VydmljZXMgRGl2
|
||||||
|
aXNpb24xGTAXBgNVBAMTEFRoYXd0ZSBTZXJ2ZXIgQ0ExJjAkBgkqhkiG9w0BCQEW
|
||||||
|
F3NlcnZlci1jZXJ0c0B0aGF3dGUuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCB
|
||||||
|
iQKBgQDTpFBuyP9Wa+bPXbbqDGh1R6KqwtqEJfyo9EdR2oW1IHSUhh4PdcnpCGH1
|
||||||
|
Bm0wbhUZAulSwGLbTZme4moMRDjN/r7jZAlwxf6xaym2L0nIO9QnBCUQly/nkG3A
|
||||||
|
KEKZ10xD3sP1IW1Un13DWOHA5NlbsLjctHvfNjrCtWYiEtaHDQIDAQABMA0GCSqG
|
||||||
|
SIb3DQEBBAUAA4GBAIsvn7ifX3RUIrvYXtpI4DOfARkTogwm6o7OwVdl93yFhDcX
|
||||||
|
7h5t0XZ11MUAMziKdde3rmTvzUYIUCYoY5b032IwGMTvdiclK+STN6NP2m5nvFAM
|
||||||
|
qJT5gC5O+j/jBuZRQ4i0AMYQr5F4lT8oBJnhgafw6PL8aDY2vMHGSPl9+7uf
|
||||||
|
-----END CERTIFICATE-----
|
||||||
|
|
||||||
|
-----BEGIN CERTIFICATE-----
|
||||||
|
MIIDDTCCAnYCAQAwDQYJKoZIhvcNAQEEBQAwgc4xCzAJBgNVBAYTAlpBMRUwEwYD
|
||||||
|
VQQIEwxXZXN0ZXJuIENhcGUxEjAQBgNVBAcTCUNhcGUgVG93bjEdMBsGA1UEChMU
|
||||||
|
VGhhd3RlIENvbnN1bHRpbmcgY2MxKDAmBgNVBAsTH0NlcnRpZmljYXRpb24gU2Vy
|
||||||
|
dmljZXMgRGl2aXNpb24xITAfBgNVBAMTGFRoYXd0ZSBQcmVtaXVtIFNlcnZlciBD
|
||||||
|
QTEoMCYGCSqGSIb3DQEJARYZcHJlbWl1bS1zZXJ2ZXJAdGhhd3RlLmNvbTAeFw05
|
||||||
|
NjA3MjcxODA3MTRaFw05ODA3MjcxODA3MTRaMIHOMQswCQYDVQQGEwJaQTEVMBMG
|
||||||
|
A1UECBMMV2VzdGVybiBDYXBlMRIwEAYDVQQHEwlDYXBlIFRvd24xHTAbBgNVBAoT
|
||||||
|
FFRoYXd0ZSBDb25zdWx0aW5nIGNjMSgwJgYDVQQLEx9DZXJ0aWZpY2F0aW9uIFNl
|
||||||
|
cnZpY2VzIERpdmlzaW9uMSEwHwYDVQQDExhUaGF3dGUgUHJlbWl1bSBTZXJ2ZXIg
|
||||||
|
Q0ExKDAmBgkqhkiG9w0BCQEWGXByZW1pdW0tc2VydmVyQHRoYXd0ZS5jb20wgZ8w
|
||||||
|
DQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBANI2NmqL18JbntqBQWKPOO5JBFXW0O8c
|
||||||
|
G5UWR+8YSDU6UvQragaPOy/qVuOvho2eF/eetGV1Ak3vywmiIVHYm9Bn0LoNkgYU
|
||||||
|
c9STy5cqAJxcTgy8+hVS/PJEbtoRSm4Iny8t4/mqOoZztkZTWMiJBb2DEbhzP6oH
|
||||||
|
jfRCTedAnRw3AgMBAAEwDQYJKoZIhvcNAQEEBQADgYEAutFIgTRZVYerIZfL9lvR
|
||||||
|
w9Eifvvo5KTZ3h+Bj+VzNnyw4Qc/IyXkPOu6SIiH9LQ3sCmWBdxpe+qr4l77rLj2
|
||||||
|
GYuMtESFfn1XVALzkYgC7JcPuTOjMfIiMByt+uFf8AV8x0IW/Qkuv+hEQcyM9vxK
|
||||||
|
3VZdLbCVIhNoEsysrxCpxcI=
|
||||||
|
-----END CERTIFICATE-----
|
||||||
|
Tims test GCI CA
|
||||||
|
|
||||||
|
-----BEGIN CERTIFICATE-----
|
||||||
|
MIIB8DCCAZoCAQAwDQYJKoZIhvcNAQEEBQAwgYIxCzAJBgNVBAYTAkFVMRMwEQYD
|
||||||
|
VQQIEwpRdWVlbnNsYW5kMREwDwYDVQQHEwhCcmlzYmFuZTEaMBgGA1UEChMRQ3J5
|
||||||
|
cHRTb2Z0IFB0eSBMdGQxFDASBgNVBAsTC2RldmVsb3BtZW50MRkwFwYDVQQDExBD
|
||||||
|
cnlwdFNvZnQgRGV2IENBMB4XDTk3MDMyMjEzMzQwNFoXDTk4MDMyMjEzMzQwNFow
|
||||||
|
gYIxCzAJBgNVBAYTAkFVMRMwEQYDVQQIEwpRdWVlbnNsYW5kMREwDwYDVQQHEwhC
|
||||||
|
cmlzYmFuZTEaMBgGA1UEChMRQ3J5cHRTb2Z0IFB0eSBMdGQxFDASBgNVBAsTC2Rl
|
||||||
|
dmVsb3BtZW50MRkwFwYDVQQDExBDcnlwdFNvZnQgRGV2IENBMFwwDQYJKoZIhvcN
|
||||||
|
AQEBBQADSwAwSAJBAOAOAqogG5QwAmLhzyO4CoRnx/wVy4NZP4dxJy83O1EnL0rw
|
||||||
|
OdsamJKvPOLHgSXo3gDu9uVyvCf/QJmZAmC5ml8CAwEAATANBgkqhkiG9w0BAQQF
|
||||||
|
AANBADRRS/GVdd7rAqRW6SdmgLJduOU2yq3avBu99kRqbp9A/dLu6r6jU+eP4oOA
|
||||||
|
TfdbFZtAAD2Hx9jUtY3tfdrJOb8=
|
||||||
|
-----END CERTIFICATE-----
|
||||||
|
|
||||||
|
-----BEGIN CERTIFICATE-----
|
||||||
|
MIICVjCCAgACAQAwDQYJKoZIhvcNAQEEBQAwgbUxCzAJBgNVBAYTAkFVMRMwEQYD
|
||||||
|
VQQIEwpRdWVlbnNsYW5kMREwDwYDVQQHEwhCcmlzYmFuZTEaMBgGA1UEChMRQ3J5
|
||||||
|
cHRTb2Z0IFB0eSBMdGQxLDAqBgNVBAsTI1dPUlRITEVTUyBDRVJUSUZJQ0FUSU9O
|
||||||
|
IEFVVEhPUklUSUVTMTQwMgYDVQQDEytaRVJPIFZBTFVFIENBIC0gREVNT05TVFJB
|
||||||
|
VElPTiBQVVJQT1NFUyBPTkxZMB4XDTk3MDQwMzEzMjI1NFoXDTk4MDQwMzEzMjI1
|
||||||
|
NFowgbUxCzAJBgNVBAYTAkFVMRMwEQYDVQQIEwpRdWVlbnNsYW5kMREwDwYDVQQH
|
||||||
|
EwhCcmlzYmFuZTEaMBgGA1UEChMRQ3J5cHRTb2Z0IFB0eSBMdGQxLDAqBgNVBAsT
|
||||||
|
I1dPUlRITEVTUyBDRVJUSUZJQ0FUSU9OIEFVVEhPUklUSUVTMTQwMgYDVQQDEyta
|
||||||
|
RVJPIFZBTFVFIENBIC0gREVNT05TVFJBVElPTiBQVVJQT1NFUyBPTkxZMFwwDQYJ
|
||||||
|
KoZIhvcNAQEBBQADSwAwSAJBAOZ7T7yqP/tyspcko3yPY1y0Cm2EmwNvzW4QgVXR
|
||||||
|
Fjs3HmJ4xtSpXdo6mwcGezL3Abt/aQXaxv9PU8xt+Jr0OFUCAwEAATANBgkqhkiG
|
||||||
|
9w0BAQQFAANBAOQpYmGgyCqCy1OljgJhCqQOu627oVlHzK1L+t9vBaMfn40AVUR4
|
||||||
|
WzQVWO31KTgi5vTK1U+3h46fgUWqQ0h+6rU=
|
||||||
|
-----END CERTIFICATE-----
|
||||||
|
-----BEGIN CERTIFICATE-----
|
||||||
|
MIAwgKADAgECAgEAMA0GCSqGSIb3DQEBBAUAMGIxETAPBgNVBAcTCEludGVybmV0
|
||||||
|
MRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE0MDIGA1UECxMrVmVyaVNpZ24gQ2xh
|
||||||
|
c3MgMSBDQSAtIEluZGl2aWR1YWwgU3Vic2NyaWJlcjAeFw05NjA0MDgxMDIwMjda
|
||||||
|
Fw05NzA0MDgxMDIwMjdaMGIxETAPBgNVBAcTCEludGVybmV0MRcwFQYDVQQKEw5W
|
||||||
|
ZXJpU2lnbiwgSW5jLjE0MDIGA1UECxMrVmVyaVNpZ24gQ2xhc3MgMSBDQSAtIElu
|
||||||
|
ZGl2aWR1YWwgU3Vic2NyaWJlcjCAMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC2
|
||||||
|
FKbPTdAFDdjKI9BvqrQpkmOOLPhvltcunXZLEbE2jVfJw/0cxrr+Hgi6M8qV6r7j
|
||||||
|
W80GqLd5HUQq7XPysVKDaBBwZJHXPmv5912dFEObbpdFmIFH0S3L3bty10w/cari
|
||||||
|
QPJUObwW7s987LrbP2wqsxaxhhKdrpM01bjV0Pc+qQIDAQABAAAAADANBgkqhkiG
|
||||||
|
9w0BAQQFAAOBgQA+1nJryNt8VBRjRr07ArDAV/3jAH7GjDc9jsrxZS68ost9v06C
|
||||||
|
TvTNKGL+LISNmFLXl+JXhgGB0JZ9fvyYzNgHQ46HBUng1H6voalfJgS2KdEo50wW
|
||||||
|
8EFZYMDkT1k4uynwJqkVN2QJK/2q4/A/VCov5h6SlM8Affg2W+1TLqvqkwAA
|
||||||
|
-----END CERTIFICATE-----
|
||||||
|
|
||||||
|
subject=/L=Internet/O=VeriSign, Inc./OU=VeriSign Class 2 CA - Individual Subscriber
|
||||||
|
issuer= /L=Internet/O=VeriSign, Inc./OU=VeriSign Class 2 CA - Individual Subscriber
|
||||||
|
|
||||||
|
-----BEGIN CERTIFICATE-----
|
||||||
|
MIIEkzCCA/ygAwIBAgIRANDTUpSRL3nTFeMrMayFSPAwDQYJKoZIhvcNAQECBQAw
|
||||||
|
YjERMA8GA1UEBxMISW50ZXJuZXQxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTQw
|
||||||
|
MgYDVQQLEytWZXJpU2lnbiBDbGFzcyAyIENBIC0gSW5kaXZpZHVhbCBTdWJzY3Jp
|
||||||
|
YmVyMB4XDTk2MDYwNDAwMDAwMFoXDTk4MDYwNDIzNTk1OVowYjERMA8GA1UEBxMI
|
||||||
|
SW50ZXJuZXQxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTQwMgYDVQQLEytWZXJp
|
||||||
|
U2lnbiBDbGFzcyAyIENBIC0gSW5kaXZpZHVhbCBTdWJzY3JpYmVyMIGfMA0GCSqG
|
||||||
|
SIb3DQEBAQUAA4GNADCBiQKBgQC6A+2czKGRcYMfm8gdnk+0de99TDDzsqo0v5nb
|
||||||
|
RsbUmMcdRQ7nsMbRWe0SAb/9QoLTZ/cJ0iOBqdrkz7UpqqKarVoTSdlSMVM92tWp
|
||||||
|
3bJncZHQD1t4xd6lQVdI1/T6R+5J0T1ukOdsI9Jmf+F28S6g3R3L1SFwiHKeZKZv
|
||||||
|
z+793wIDAQABo4ICRzCCAkMwggIpBgNVHQMBAf8EggIdMIICGTCCAhUwggIRBgtg
|
||||||
|
hkgBhvhFAQcBATCCAgAWggGrVGhpcyBjZXJ0aWZpY2F0ZSBpbmNvcnBvcmF0ZXMg
|
||||||
|
YnkgcmVmZXJlbmNlLCBhbmQgaXRzIHVzZSBpcyBzdHJpY3RseSBzdWJqZWN0IHRv
|
||||||
|
LCB0aGUgVmVyaVNpZ24gQ2VydGlmaWNhdGlvbiBQcmFjdGljZSBTdGF0ZW1lbnQg
|
||||||
|
KENQUyksIGF2YWlsYWJsZSBhdDogaHR0cHM6Ly93d3cudmVyaXNpZ24uY29tL0NQ
|
||||||
|
Uy0xLjA7IGJ5IEUtbWFpbCBhdCBDUFMtcmVxdWVzdHNAdmVyaXNpZ24uY29tOyBv
|
||||||
|
ciBieSBtYWlsIGF0IFZlcmlTaWduLCBJbmMuLCAyNTkzIENvYXN0IEF2ZS4sIE1v
|
||||||
|
dW50YWluIFZpZXcsIENBIDk0MDQzIFVTQSBUZWwuICsxICg0MTUpIDk2MS04ODMw
|
||||||
|
IENvcHlyaWdodCAoYykgMTk5NiBWZXJpU2lnbiwgSW5jLiAgQWxsIFJpZ2h0cyBS
|
||||||
|
ZXNlcnZlZC4gQ0VSVEFJTiBXQVJSQU5USUVTIERJU0NMQUlNRUQgYW5kIExJQUJJ
|
||||||
|
TElUWSBMSU1JVEVELqAOBgxghkgBhvhFAQcBAQGhDgYMYIZIAYb4RQEHAQECMC8w
|
||||||
|
LRYraHR0cHM6Ly93d3cudmVyaXNpZ24uY29tL3JlcG9zaXRvcnkvQ1BTLTEuMDAU
|
||||||
|
BglghkgBhvhCAQEBAf8EBAMCAgQwDQYJKoZIhvcNAQECBQADgYEApRJRkNBqLLgs
|
||||||
|
53IR/d18ODdLOWMTZ+QOOxBrq460iBEdUwgF8vmPRX1ku7UiDeNzaLlurE6eFqHq
|
||||||
|
2zPyK5j60zfTLVJMWKcQWwTJLjHtXrW8pxhNtFc6Fdvy5ZkHnC/9NIl7/t4U6WqB
|
||||||
|
p4y+p7SdMIkEwIZfds0VbnQyX5MRUJY=
|
||||||
|
-----END CERTIFICATE-----
|
||||||
|
|
||||||
|
subject=/C=US/O=VeriSign, Inc./OU=Class 3 Public Primary Certification Authority
|
||||||
|
issuer= /C=US/O=VeriSign, Inc./OU=Class 3 Public Primary Certification Authority
|
||||||
|
-----BEGIN CERTIFICATE-----
|
||||||
|
MIICMTCCAZoCBQKhAAABMA0GCSqGSIb3DQEBAgUAMF8xCzAJBgNVBAYTAlVTMRcw
|
||||||
|
FQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE3MDUGA1UECxMuQ2xhc3MgMyBQdWJsaWMg
|
||||||
|
UHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw05NjAxMjkwMDAwMDBa
|
||||||
|
Fw05OTEyMzEyMzU5NTlaMF8xCzAJBgNVBAYTAlVTMRcwFQYDVQQKEw5WZXJpU2ln
|
||||||
|
biwgSW5jLjE3MDUGA1UECxMuQ2xhc3MgMyBQdWJsaWMgUHJpbWFyeSBDZXJ0aWZp
|
||||||
|
Y2F0aW9uIEF1dGhvcml0eTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAyVxZ
|
||||||
|
nvIbigEUtBDfBEDb41evakVAj4QMC9Ez2dkRz+4CWB8l9yqoRAWq7AMfeH+ek7ma
|
||||||
|
AKojfdashaJjRcdyJ8z0TMZ1cdI5709C8HXfCpDGjiBvmA/4rCNfcCk2pMmG57Ga
|
||||||
|
IMtTpYXnPb59mv4kRTPcdhXtD6JxZExlLoFoRacCAwEAATANBgkqhkiG9w0BAQIF
|
||||||
|
AAOBgQB1Zmw+0c2B27X4LzZRtvdCvM1Cr9wO+hVs+GeTVzrrtpLotgHKjLeOQ7RJ
|
||||||
|
Zfk+7r11Ri7J/CVdqMcvi5uPaM+0nJcYwE3vH9mvgrPmZLiEXIqaB1JDYft0nls6
|
||||||
|
NvxMsvwaPxUupVs8G5DsiCnkWRb5zget7Ond2tIxik/W2O8XjQ==
|
||||||
|
-----END CERTIFICATE-----
|
||||||
|
subject=/C=US/O=VeriSign, Inc./OU=Class 4 Public Primary Certification Authority
|
||||||
|
issuer= /C=US/O=VeriSign, Inc./OU=Class 4 Public Primary Certification Authority
|
||||||
|
-----BEGIN CERTIFICATE-----
|
||||||
|
MIICMTCCAZoCBQKmAAABMA0GCSqGSIb3DQEBAgUAMF8xCzAJBgNVBAYTAlVTMRcw
|
||||||
|
FQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE3MDUGA1UECxMuQ2xhc3MgNCBQdWJsaWMg
|
||||||
|
UHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw05NjAxMjkwMDAwMDBa
|
||||||
|
Fw05OTEyMzEyMzU5NTlaMF8xCzAJBgNVBAYTAlVTMRcwFQYDVQQKEw5WZXJpU2ln
|
||||||
|
biwgSW5jLjE3MDUGA1UECxMuQ2xhc3MgNCBQdWJsaWMgUHJpbWFyeSBDZXJ0aWZp
|
||||||
|
Y2F0aW9uIEF1dGhvcml0eTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA0LJ1
|
||||||
|
9njQrlpQ9OlQqZ+M1++RlHDo0iSQdomF1t+s5gEXMoDwnZNHvJplnR+Xrr/phnVj
|
||||||
|
IIm9gFidBAydqMEk6QvlMXi9/C0MN2qeeIDpRnX57aP7E3vIwUzSo+/1PLBij0pd
|
||||||
|
O92VZ48TucE81qcmm+zDO3rZTbxtm+gVAePwR6kCAwEAATANBgkqhkiG9w0BAQIF
|
||||||
|
AAOBgQBT3dPwnCR+QKri/AAa19oM/DJhuBUNlvP6Vxt/M3yv6ZiaYch6s7f/sdyZ
|
||||||
|
g9ysEvxwyR84Qu1E9oAuW2szaayc01znX1oYx7EteQSWQZGZQbE8DbqEOcY7l/Am
|
||||||
|
yY7uvcxClf8exwI/VAx49byqYHwCaejcrOICdmHEPgPq0ook0Q==
|
||||||
|
-----END CERTIFICATE-----
|
||||||
|
|||||||
420
apps/sess_id.c
420
apps/sess_id.c
@@ -67,20 +67,20 @@
|
|||||||
#include <openssl/ssl.h>
|
#include <openssl/ssl.h>
|
||||||
|
|
||||||
#undef PROG
|
#undef PROG
|
||||||
#define PROG sess_id_main
|
#define PROG sess_id_main
|
||||||
|
|
||||||
static const char *sess_id_usage[] = {
|
static const char *sess_id_usage[]={
|
||||||
"usage: sess_id args\n",
|
"usage: sess_id args\n",
|
||||||
"\n",
|
"\n",
|
||||||
" -inform arg - input format - default PEM (DER or PEM)\n",
|
" -inform arg - input format - default PEM (DER or PEM)\n",
|
||||||
" -outform arg - output format - default PEM\n",
|
" -outform arg - output format - default PEM\n",
|
||||||
" -in arg - input file - default stdin\n",
|
" -in arg - input file - default stdin\n",
|
||||||
" -out arg - output file - default stdout\n",
|
" -out arg - output file - default stdout\n",
|
||||||
" -text - print ssl session id details\n",
|
" -text - print ssl session id details\n",
|
||||||
" -cert - output certificate \n",
|
" -cert - output certificate \n",
|
||||||
" -noout - no CRL output\n",
|
" -noout - no CRL output\n",
|
||||||
" -context arg - set the session ID context\n",
|
" -context arg - set the session ID context\n",
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
static SSL_SESSION *load_sess_id(char *file, int format);
|
static SSL_SESSION *load_sess_id(char *file, int format);
|
||||||
@@ -88,213 +88,233 @@ static SSL_SESSION *load_sess_id(char *file, int format);
|
|||||||
int MAIN(int, char **);
|
int MAIN(int, char **);
|
||||||
|
|
||||||
int MAIN(int argc, char **argv)
|
int MAIN(int argc, char **argv)
|
||||||
{
|
{
|
||||||
SSL_SESSION *x = NULL;
|
SSL_SESSION *x=NULL;
|
||||||
X509 *peer = NULL;
|
int ret=1,i,num,badops=0;
|
||||||
int ret = 1, i, num, badops = 0;
|
BIO *out=NULL;
|
||||||
BIO *out = NULL;
|
int informat,outformat;
|
||||||
int informat, outformat;
|
char *infile=NULL,*outfile=NULL,*context=NULL;
|
||||||
char *infile = NULL, *outfile = NULL, *context = NULL;
|
int cert=0,noout=0,text=0;
|
||||||
int cert = 0, noout = 0, text = 0;
|
const char **pp;
|
||||||
const char **pp;
|
|
||||||
|
|
||||||
apps_startup();
|
apps_startup();
|
||||||
|
|
||||||
if (bio_err == NULL)
|
if (bio_err == NULL)
|
||||||
if ((bio_err = BIO_new(BIO_s_file())) != NULL)
|
if ((bio_err=BIO_new(BIO_s_file())) != NULL)
|
||||||
BIO_set_fp(bio_err, stderr, BIO_NOCLOSE | BIO_FP_TEXT);
|
BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT);
|
||||||
|
|
||||||
informat = FORMAT_PEM;
|
informat=FORMAT_PEM;
|
||||||
outformat = FORMAT_PEM;
|
outformat=FORMAT_PEM;
|
||||||
|
|
||||||
argc--;
|
argc--;
|
||||||
argv++;
|
argv++;
|
||||||
num = 0;
|
num=0;
|
||||||
while (argc >= 1) {
|
while (argc >= 1)
|
||||||
if (strcmp(*argv, "-inform") == 0) {
|
{
|
||||||
if (--argc < 1)
|
if (strcmp(*argv,"-inform") == 0)
|
||||||
goto bad;
|
{
|
||||||
informat = str2fmt(*(++argv));
|
if (--argc < 1) goto bad;
|
||||||
} else if (strcmp(*argv, "-outform") == 0) {
|
informat=str2fmt(*(++argv));
|
||||||
if (--argc < 1)
|
}
|
||||||
goto bad;
|
else if (strcmp(*argv,"-outform") == 0)
|
||||||
outformat = str2fmt(*(++argv));
|
{
|
||||||
} else if (strcmp(*argv, "-in") == 0) {
|
if (--argc < 1) goto bad;
|
||||||
if (--argc < 1)
|
outformat=str2fmt(*(++argv));
|
||||||
goto bad;
|
}
|
||||||
infile = *(++argv);
|
else if (strcmp(*argv,"-in") == 0)
|
||||||
} else if (strcmp(*argv, "-out") == 0) {
|
{
|
||||||
if (--argc < 1)
|
if (--argc < 1) goto bad;
|
||||||
goto bad;
|
infile= *(++argv);
|
||||||
outfile = *(++argv);
|
}
|
||||||
} else if (strcmp(*argv, "-text") == 0)
|
else if (strcmp(*argv,"-out") == 0)
|
||||||
text = ++num;
|
{
|
||||||
else if (strcmp(*argv, "-cert") == 0)
|
if (--argc < 1) goto bad;
|
||||||
cert = ++num;
|
outfile= *(++argv);
|
||||||
else if (strcmp(*argv, "-noout") == 0)
|
}
|
||||||
noout = ++num;
|
else if (strcmp(*argv,"-text") == 0)
|
||||||
else if (strcmp(*argv, "-context") == 0) {
|
text= ++num;
|
||||||
if (--argc < 1)
|
else if (strcmp(*argv,"-cert") == 0)
|
||||||
goto bad;
|
cert= ++num;
|
||||||
context = *++argv;
|
else if (strcmp(*argv,"-noout") == 0)
|
||||||
} else {
|
noout= ++num;
|
||||||
BIO_printf(bio_err, "unknown option %s\n", *argv);
|
else if (strcmp(*argv,"-context") == 0)
|
||||||
badops = 1;
|
{
|
||||||
break;
|
if(--argc < 1) goto bad;
|
||||||
}
|
context=*++argv;
|
||||||
argc--;
|
}
|
||||||
argv++;
|
else
|
||||||
}
|
{
|
||||||
|
BIO_printf(bio_err,"unknown option %s\n",*argv);
|
||||||
|
badops=1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
argc--;
|
||||||
|
argv++;
|
||||||
|
}
|
||||||
|
|
||||||
if (badops) {
|
if (badops)
|
||||||
bad:
|
{
|
||||||
for (pp = sess_id_usage; (*pp != NULL); pp++)
|
bad:
|
||||||
BIO_printf(bio_err, "%s", *pp);
|
for (pp=sess_id_usage; (*pp != NULL); pp++)
|
||||||
goto end;
|
BIO_printf(bio_err,"%s",*pp);
|
||||||
}
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
ERR_load_crypto_strings();
|
ERR_load_crypto_strings();
|
||||||
x = load_sess_id(infile, informat);
|
x=load_sess_id(infile,informat);
|
||||||
if (x == NULL) {
|
if (x == NULL) { goto end; }
|
||||||
goto end;
|
|
||||||
}
|
if(context)
|
||||||
peer = SSL_SESSION_get0_peer(x);
|
{
|
||||||
|
x->sid_ctx_length=strlen(context);
|
||||||
|
if(x->sid_ctx_length > SSL_MAX_SID_CTX_LENGTH)
|
||||||
|
{
|
||||||
|
BIO_printf(bio_err,"Context too long\n");
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
memcpy(x->sid_ctx,context,x->sid_ctx_length);
|
||||||
|
}
|
||||||
|
|
||||||
if (context) {
|
|
||||||
size_t ctx_len = strlen(context);
|
|
||||||
if (ctx_len > SSL_MAX_SID_CTX_LENGTH) {
|
|
||||||
BIO_printf(bio_err, "Context too long\n");
|
|
||||||
goto end;
|
|
||||||
}
|
|
||||||
SSL_SESSION_set1_id_context(x, (unsigned char *)context, ctx_len);
|
|
||||||
}
|
|
||||||
#ifdef undef
|
#ifdef undef
|
||||||
/* just testing for memory leaks :-) */
|
/* just testing for memory leaks :-) */
|
||||||
{
|
{
|
||||||
SSL_SESSION *s;
|
SSL_SESSION *s;
|
||||||
char buf[1024 * 10], *p;
|
char buf[1024*10],*p;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
s = SSL_SESSION_new();
|
s=SSL_SESSION_new();
|
||||||
|
|
||||||
p = &buf;
|
p= &buf;
|
||||||
i = i2d_SSL_SESSION(x, &p);
|
i=i2d_SSL_SESSION(x,&p);
|
||||||
p = &buf;
|
p= &buf;
|
||||||
d2i_SSL_SESSION(&s, &p, (long)i);
|
d2i_SSL_SESSION(&s,&p,(long)i);
|
||||||
p = &buf;
|
p= &buf;
|
||||||
d2i_SSL_SESSION(&s, &p, (long)i);
|
d2i_SSL_SESSION(&s,&p,(long)i);
|
||||||
p = &buf;
|
p= &buf;
|
||||||
d2i_SSL_SESSION(&s, &p, (long)i);
|
d2i_SSL_SESSION(&s,&p,(long)i);
|
||||||
SSL_SESSION_free(s);
|
SSL_SESSION_free(s);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (!noout || text) {
|
if (!noout || text)
|
||||||
out = BIO_new(BIO_s_file());
|
{
|
||||||
if (out == NULL) {
|
out=BIO_new(BIO_s_file());
|
||||||
ERR_print_errors(bio_err);
|
if (out == NULL)
|
||||||
goto end;
|
{
|
||||||
}
|
ERR_print_errors(bio_err);
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
if (outfile == NULL) {
|
if (outfile == NULL)
|
||||||
BIO_set_fp(out, stdout, BIO_NOCLOSE);
|
{
|
||||||
|
BIO_set_fp(out,stdout,BIO_NOCLOSE);
|
||||||
#ifdef OPENSSL_SYS_VMS
|
#ifdef OPENSSL_SYS_VMS
|
||||||
{
|
{
|
||||||
BIO *tmpbio = BIO_new(BIO_f_linebuffer());
|
BIO *tmpbio = BIO_new(BIO_f_linebuffer());
|
||||||
out = BIO_push(tmpbio, out);
|
out = BIO_push(tmpbio, out);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
} else {
|
}
|
||||||
if (BIO_write_filename(out, outfile) <= 0) {
|
else
|
||||||
perror(outfile);
|
{
|
||||||
goto end;
|
if (BIO_write_filename(out,outfile) <= 0)
|
||||||
}
|
{
|
||||||
}
|
perror(outfile);
|
||||||
}
|
goto end;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (text) {
|
if (text)
|
||||||
SSL_SESSION_print(out, x);
|
{
|
||||||
|
SSL_SESSION_print(out,x);
|
||||||
|
|
||||||
if (cert) {
|
if (cert)
|
||||||
if (peer == NULL)
|
{
|
||||||
BIO_puts(out, "No certificate present\n");
|
if (x->peer == NULL)
|
||||||
else
|
BIO_puts(out,"No certificate present\n");
|
||||||
X509_print(out, peer);
|
else
|
||||||
}
|
X509_print(out,x->peer);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!noout && !cert) {
|
if (!noout && !cert)
|
||||||
if (outformat == FORMAT_ASN1)
|
{
|
||||||
i = i2d_SSL_SESSION_bio(out, x);
|
if (outformat == FORMAT_ASN1)
|
||||||
else if (outformat == FORMAT_PEM)
|
i=i2d_SSL_SESSION_bio(out,x);
|
||||||
i = PEM_write_bio_SSL_SESSION(out, x);
|
else if (outformat == FORMAT_PEM)
|
||||||
else {
|
i=PEM_write_bio_SSL_SESSION(out,x);
|
||||||
BIO_printf(bio_err, "bad output format specified for outfile\n");
|
else {
|
||||||
goto end;
|
BIO_printf(bio_err,"bad output format specified for outfile\n");
|
||||||
}
|
goto end;
|
||||||
if (!i) {
|
}
|
||||||
BIO_printf(bio_err, "unable to write SSL_SESSION\n");
|
if (!i) {
|
||||||
goto end;
|
BIO_printf(bio_err,"unable to write SSL_SESSION\n");
|
||||||
}
|
goto end;
|
||||||
} else if (!noout && (peer != NULL)) { /* just print the certificate */
|
}
|
||||||
if (outformat == FORMAT_ASN1)
|
}
|
||||||
i = (int)i2d_X509_bio(out, peer);
|
else if (!noout && (x->peer != NULL)) /* just print the certificate */
|
||||||
else if (outformat == FORMAT_PEM)
|
{
|
||||||
i = PEM_write_bio_X509(out, peer);
|
if (outformat == FORMAT_ASN1)
|
||||||
else {
|
i=(int)i2d_X509_bio(out,x->peer);
|
||||||
BIO_printf(bio_err, "bad output format specified for outfile\n");
|
else if (outformat == FORMAT_PEM)
|
||||||
goto end;
|
i=PEM_write_bio_X509(out,x->peer);
|
||||||
}
|
else {
|
||||||
if (!i) {
|
BIO_printf(bio_err,"bad output format specified for outfile\n");
|
||||||
BIO_printf(bio_err, "unable to write X509\n");
|
goto end;
|
||||||
goto end;
|
}
|
||||||
}
|
if (!i) {
|
||||||
}
|
BIO_printf(bio_err,"unable to write X509\n");
|
||||||
ret = 0;
|
goto end;
|
||||||
end:
|
}
|
||||||
if (out != NULL)
|
}
|
||||||
BIO_free_all(out);
|
ret=0;
|
||||||
if (x != NULL)
|
end:
|
||||||
SSL_SESSION_free(x);
|
if (out != NULL) BIO_free_all(out);
|
||||||
apps_shutdown();
|
if (x != NULL) SSL_SESSION_free(x);
|
||||||
OPENSSL_EXIT(ret);
|
apps_shutdown();
|
||||||
}
|
OPENSSL_EXIT(ret);
|
||||||
|
}
|
||||||
|
|
||||||
static SSL_SESSION *load_sess_id(char *infile, int format)
|
static SSL_SESSION *load_sess_id(char *infile, int format)
|
||||||
{
|
{
|
||||||
SSL_SESSION *x = NULL;
|
SSL_SESSION *x=NULL;
|
||||||
BIO *in = NULL;
|
BIO *in=NULL;
|
||||||
|
|
||||||
in = BIO_new(BIO_s_file());
|
in=BIO_new(BIO_s_file());
|
||||||
if (in == NULL) {
|
if (in == NULL)
|
||||||
ERR_print_errors(bio_err);
|
{
|
||||||
goto end;
|
ERR_print_errors(bio_err);
|
||||||
}
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
if (infile == NULL)
|
if (infile == NULL)
|
||||||
BIO_set_fp(in, stdin, BIO_NOCLOSE);
|
BIO_set_fp(in,stdin,BIO_NOCLOSE);
|
||||||
else {
|
else
|
||||||
if (BIO_read_filename(in, infile) <= 0) {
|
{
|
||||||
perror(infile);
|
if (BIO_read_filename(in,infile) <= 0)
|
||||||
goto end;
|
{
|
||||||
}
|
perror(infile);
|
||||||
}
|
goto end;
|
||||||
if (format == FORMAT_ASN1)
|
}
|
||||||
x = d2i_SSL_SESSION_bio(in, NULL);
|
}
|
||||||
else if (format == FORMAT_PEM)
|
if (format == FORMAT_ASN1)
|
||||||
x = PEM_read_bio_SSL_SESSION(in, NULL, NULL, NULL);
|
x=d2i_SSL_SESSION_bio(in,NULL);
|
||||||
else {
|
else if (format == FORMAT_PEM)
|
||||||
BIO_printf(bio_err, "bad input format specified for input crl\n");
|
x=PEM_read_bio_SSL_SESSION(in,NULL,NULL,NULL);
|
||||||
goto end;
|
else {
|
||||||
}
|
BIO_printf(bio_err,"bad input format specified for input crl\n");
|
||||||
if (x == NULL) {
|
goto end;
|
||||||
BIO_printf(bio_err, "unable to load SSL_SESSION\n");
|
}
|
||||||
ERR_print_errors(bio_err);
|
if (x == NULL)
|
||||||
goto end;
|
{
|
||||||
}
|
BIO_printf(bio_err,"unable to load SSL_SESSION\n");
|
||||||
|
ERR_print_errors(bio_err);
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
|
end:
|
||||||
|
if (in != NULL) BIO_free(in);
|
||||||
|
return(x);
|
||||||
|
}
|
||||||
|
|
||||||
end:
|
|
||||||
if (in != NULL)
|
|
||||||
BIO_free(in);
|
|
||||||
return (x);
|
|
||||||
}
|
|
||||||
|
|||||||
1325
apps/smime.c
1325
apps/smime.c
File diff suppressed because it is too large
Load Diff
5026
apps/speed.c
5026
apps/speed.c
File diff suppressed because it is too large
Load Diff
400
apps/spkac.c
400
apps/spkac.c
@@ -1,8 +1,8 @@
|
|||||||
/* apps/spkac.c */
|
/* apps/spkac.c */
|
||||||
|
|
||||||
/*
|
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
|
||||||
* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL project
|
* project 1999. Based on an original idea by Massimiliano Pala
|
||||||
* 1999. Based on an original idea by Massimiliano Pala (madwolf@openca.org).
|
* (madwolf@openca.org).
|
||||||
*/
|
*/
|
||||||
/* ====================================================================
|
/* ====================================================================
|
||||||
* Copyright (c) 1999 The OpenSSL Project. All rights reserved.
|
* Copyright (c) 1999 The OpenSSL Project. All rights reserved.
|
||||||
@@ -71,242 +71,238 @@
|
|||||||
#include <openssl/pem.h>
|
#include <openssl/pem.h>
|
||||||
|
|
||||||
#undef PROG
|
#undef PROG
|
||||||
#define PROG spkac_main
|
#define PROG spkac_main
|
||||||
|
|
||||||
/*-
|
/* -in arg - input file - default stdin
|
||||||
* -in arg - input file - default stdin
|
* -out arg - output file - default stdout
|
||||||
* -out arg - output file - default stdout
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int MAIN(int, char **);
|
int MAIN(int, char **);
|
||||||
|
|
||||||
int MAIN(int argc, char **argv)
|
int MAIN(int argc, char **argv)
|
||||||
{
|
{
|
||||||
ENGINE *e = NULL;
|
ENGINE *e = NULL;
|
||||||
int i, badops = 0, ret = 1;
|
int i,badops=0, ret = 1;
|
||||||
BIO *in = NULL, *out = NULL;
|
BIO *in = NULL,*out = NULL;
|
||||||
int verify = 0, noout = 0, pubkey = 0;
|
int verify=0,noout=0,pubkey=0;
|
||||||
char *infile = NULL, *outfile = NULL, *prog;
|
char *infile = NULL,*outfile = NULL,*prog;
|
||||||
char *passargin = NULL, *passin = NULL;
|
char *passargin = NULL, *passin = NULL;
|
||||||
const char *spkac = "SPKAC", *spksect = "default";
|
const char *spkac = "SPKAC", *spksect = "default";
|
||||||
char *spkstr = NULL;
|
char *spkstr = NULL;
|
||||||
char *challenge = NULL, *keyfile = NULL;
|
char *challenge = NULL, *keyfile = NULL;
|
||||||
CONF *conf = NULL;
|
CONF *conf = NULL;
|
||||||
NETSCAPE_SPKI *spki = NULL;
|
NETSCAPE_SPKI *spki = NULL;
|
||||||
EVP_PKEY *pkey = NULL;
|
EVP_PKEY *pkey = NULL;
|
||||||
#ifndef OPENSSL_NO_ENGINE
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
char *engine = NULL;
|
char *engine=NULL;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
apps_startup();
|
apps_startup();
|
||||||
|
|
||||||
if (!bio_err)
|
if (!bio_err) bio_err = BIO_new_fp(stderr, BIO_NOCLOSE);
|
||||||
bio_err = BIO_new_fp(stderr, BIO_NOCLOSE);
|
|
||||||
|
|
||||||
if (!load_config(bio_err, NULL))
|
if (!load_config(bio_err, NULL))
|
||||||
goto end;
|
goto end;
|
||||||
|
|
||||||
prog = argv[0];
|
prog=argv[0];
|
||||||
argc--;
|
argc--;
|
||||||
argv++;
|
argv++;
|
||||||
while (argc >= 1) {
|
while (argc >= 1)
|
||||||
if (strcmp(*argv, "-in") == 0) {
|
{
|
||||||
if (--argc < 1)
|
if (strcmp(*argv,"-in") == 0)
|
||||||
goto bad;
|
{
|
||||||
infile = *(++argv);
|
if (--argc < 1) goto bad;
|
||||||
} else if (strcmp(*argv, "-out") == 0) {
|
infile= *(++argv);
|
||||||
if (--argc < 1)
|
}
|
||||||
goto bad;
|
else if (strcmp(*argv,"-out") == 0)
|
||||||
outfile = *(++argv);
|
{
|
||||||
} else if (strcmp(*argv, "-passin") == 0) {
|
if (--argc < 1) goto bad;
|
||||||
if (--argc < 1)
|
outfile= *(++argv);
|
||||||
goto bad;
|
}
|
||||||
passargin = *(++argv);
|
else if (strcmp(*argv,"-passin") == 0)
|
||||||
} else if (strcmp(*argv, "-key") == 0) {
|
{
|
||||||
if (--argc < 1)
|
if (--argc < 1) goto bad;
|
||||||
goto bad;
|
passargin= *(++argv);
|
||||||
keyfile = *(++argv);
|
}
|
||||||
} else if (strcmp(*argv, "-challenge") == 0) {
|
else if (strcmp(*argv,"-key") == 0)
|
||||||
if (--argc < 1)
|
{
|
||||||
goto bad;
|
if (--argc < 1) goto bad;
|
||||||
challenge = *(++argv);
|
keyfile= *(++argv);
|
||||||
} else if (strcmp(*argv, "-spkac") == 0) {
|
}
|
||||||
if (--argc < 1)
|
else if (strcmp(*argv,"-challenge") == 0)
|
||||||
goto bad;
|
{
|
||||||
spkac = *(++argv);
|
if (--argc < 1) goto bad;
|
||||||
} else if (strcmp(*argv, "-spksect") == 0) {
|
challenge= *(++argv);
|
||||||
if (--argc < 1)
|
}
|
||||||
goto bad;
|
else if (strcmp(*argv,"-spkac") == 0)
|
||||||
spksect = *(++argv);
|
{
|
||||||
}
|
if (--argc < 1) goto bad;
|
||||||
|
spkac= *(++argv);
|
||||||
|
}
|
||||||
|
else if (strcmp(*argv,"-spksect") == 0)
|
||||||
|
{
|
||||||
|
if (--argc < 1) goto bad;
|
||||||
|
spksect= *(++argv);
|
||||||
|
}
|
||||||
#ifndef OPENSSL_NO_ENGINE
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
else if (strcmp(*argv, "-engine") == 0) {
|
else if (strcmp(*argv,"-engine") == 0)
|
||||||
if (--argc < 1)
|
{
|
||||||
goto bad;
|
if (--argc < 1) goto bad;
|
||||||
engine = *(++argv);
|
engine= *(++argv);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
else if (strcmp(*argv, "-noout") == 0)
|
else if (strcmp(*argv,"-noout") == 0)
|
||||||
noout = 1;
|
noout=1;
|
||||||
else if (strcmp(*argv, "-pubkey") == 0)
|
else if (strcmp(*argv,"-pubkey") == 0)
|
||||||
pubkey = 1;
|
pubkey=1;
|
||||||
else if (strcmp(*argv, "-verify") == 0)
|
else if (strcmp(*argv,"-verify") == 0)
|
||||||
verify = 1;
|
verify=1;
|
||||||
else
|
else badops = 1;
|
||||||
badops = 1;
|
argc--;
|
||||||
argc--;
|
argv++;
|
||||||
argv++;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (badops) {
|
if (badops)
|
||||||
bad:
|
{
|
||||||
BIO_printf(bio_err, "%s [options]\n", prog);
|
bad:
|
||||||
BIO_printf(bio_err, "where options are\n");
|
BIO_printf(bio_err,"%s [options]\n",prog);
|
||||||
BIO_printf(bio_err, " -in arg input file\n");
|
BIO_printf(bio_err,"where options are\n");
|
||||||
BIO_printf(bio_err, " -out arg output file\n");
|
BIO_printf(bio_err," -in arg input file\n");
|
||||||
BIO_printf(bio_err,
|
BIO_printf(bio_err," -out arg output file\n");
|
||||||
" -key arg create SPKAC using private key\n");
|
BIO_printf(bio_err," -key arg create SPKAC using private key\n");
|
||||||
BIO_printf(bio_err,
|
BIO_printf(bio_err," -passin arg input file pass phrase source\n");
|
||||||
" -passin arg input file pass phrase source\n");
|
BIO_printf(bio_err," -challenge arg challenge string\n");
|
||||||
BIO_printf(bio_err, " -challenge arg challenge string\n");
|
BIO_printf(bio_err," -spkac arg alternative SPKAC name\n");
|
||||||
BIO_printf(bio_err, " -spkac arg alternative SPKAC name\n");
|
BIO_printf(bio_err," -noout don't print SPKAC\n");
|
||||||
BIO_printf(bio_err, " -noout don't print SPKAC\n");
|
BIO_printf(bio_err," -pubkey output public key\n");
|
||||||
BIO_printf(bio_err, " -pubkey output public key\n");
|
BIO_printf(bio_err," -verify verify SPKAC signature\n");
|
||||||
BIO_printf(bio_err, " -verify verify SPKAC signature\n");
|
|
||||||
#ifndef OPENSSL_NO_ENGINE
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
BIO_printf(bio_err,
|
BIO_printf(bio_err," -engine e use engine e, possibly a hardware device.\n");
|
||||||
" -engine e use engine e, possibly a hardware device.\n");
|
|
||||||
#endif
|
#endif
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ERR_load_crypto_strings();
|
||||||
|
if(!app_passwd(bio_err, passargin, NULL, &passin, NULL)) {
|
||||||
|
BIO_printf(bio_err, "Error getting password\n");
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
ERR_load_crypto_strings();
|
|
||||||
if (!app_passwd(bio_err, passargin, NULL, &passin, NULL)) {
|
|
||||||
BIO_printf(bio_err, "Error getting password\n");
|
|
||||||
goto end;
|
|
||||||
}
|
|
||||||
#ifndef OPENSSL_NO_ENGINE
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
e = setup_engine(bio_err, engine, 0);
|
e = setup_engine(bio_err, engine, 0);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (keyfile) {
|
if(keyfile) {
|
||||||
pkey = load_key(bio_err,
|
pkey = load_key(bio_err,
|
||||||
strcmp(keyfile, "-") ? keyfile : NULL,
|
strcmp(keyfile, "-") ? keyfile : NULL,
|
||||||
FORMAT_PEM, 1, passin, e, "private key");
|
FORMAT_PEM, 1, passin, e, "private key");
|
||||||
if (!pkey) {
|
if(!pkey) {
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
spki = NETSCAPE_SPKI_new();
|
spki = NETSCAPE_SPKI_new();
|
||||||
if (challenge)
|
if(challenge) ASN1_STRING_set(spki->spkac->challenge,
|
||||||
ASN1_STRING_set(spki->spkac->challenge,
|
challenge, (int)strlen(challenge));
|
||||||
challenge, (int)strlen(challenge));
|
NETSCAPE_SPKI_set_pubkey(spki, pkey);
|
||||||
NETSCAPE_SPKI_set_pubkey(spki, pkey);
|
NETSCAPE_SPKI_sign(spki, pkey, EVP_md5());
|
||||||
NETSCAPE_SPKI_sign(spki, pkey, EVP_md5());
|
spkstr = NETSCAPE_SPKI_b64_encode(spki);
|
||||||
spkstr = NETSCAPE_SPKI_b64_encode(spki);
|
|
||||||
|
|
||||||
if (outfile)
|
if (outfile) out = BIO_new_file(outfile, "w");
|
||||||
out = BIO_new_file(outfile, "w");
|
else {
|
||||||
else {
|
out = BIO_new_fp(stdout, BIO_NOCLOSE);
|
||||||
out = BIO_new_fp(stdout, BIO_NOCLOSE);
|
|
||||||
#ifdef OPENSSL_SYS_VMS
|
#ifdef OPENSSL_SYS_VMS
|
||||||
{
|
{
|
||||||
BIO *tmpbio = BIO_new(BIO_f_linebuffer());
|
BIO *tmpbio = BIO_new(BIO_f_linebuffer());
|
||||||
out = BIO_push(tmpbio, out);
|
out = BIO_push(tmpbio, out);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!out) {
|
if(!out) {
|
||||||
BIO_printf(bio_err, "Error opening output file\n");
|
BIO_printf(bio_err, "Error opening output file\n");
|
||||||
ERR_print_errors(bio_err);
|
ERR_print_errors(bio_err);
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
BIO_printf(out, "SPKAC=%s\n", spkstr);
|
BIO_printf(out, "SPKAC=%s\n", spkstr);
|
||||||
OPENSSL_free(spkstr);
|
OPENSSL_free(spkstr);
|
||||||
ret = 0;
|
ret = 0;
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (infile)
|
|
||||||
in = BIO_new_file(infile, "r");
|
|
||||||
else
|
|
||||||
in = BIO_new_fp(stdin, BIO_NOCLOSE);
|
|
||||||
|
|
||||||
if (!in) {
|
|
||||||
BIO_printf(bio_err, "Error opening input file\n");
|
|
||||||
ERR_print_errors(bio_err);
|
|
||||||
goto end;
|
|
||||||
}
|
|
||||||
|
|
||||||
conf = NCONF_new(NULL);
|
if (infile) in = BIO_new_file(infile, "r");
|
||||||
i = NCONF_load_bio(conf, in, NULL);
|
else in = BIO_new_fp(stdin, BIO_NOCLOSE);
|
||||||
|
|
||||||
if (!i) {
|
if(!in) {
|
||||||
BIO_printf(bio_err, "Error parsing config file\n");
|
BIO_printf(bio_err, "Error opening input file\n");
|
||||||
ERR_print_errors(bio_err);
|
ERR_print_errors(bio_err);
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
spkstr = NCONF_get_string(conf, spksect, spkac);
|
conf = NCONF_new(NULL);
|
||||||
|
i = NCONF_load_bio(conf, in, NULL);
|
||||||
|
|
||||||
if (!spkstr) {
|
if(!i) {
|
||||||
BIO_printf(bio_err, "Can't find SPKAC called \"%s\"\n", spkac);
|
BIO_printf(bio_err, "Error parsing config file\n");
|
||||||
ERR_print_errors(bio_err);
|
ERR_print_errors(bio_err);
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
spki = NETSCAPE_SPKI_b64_decode(spkstr, -1);
|
spkstr = NCONF_get_string(conf, spksect, spkac);
|
||||||
|
|
||||||
if (!spki) {
|
if(!spkstr) {
|
||||||
BIO_printf(bio_err, "Error loading SPKAC\n");
|
BIO_printf(bio_err, "Can't find SPKAC called \"%s\"\n", spkac);
|
||||||
ERR_print_errors(bio_err);
|
ERR_print_errors(bio_err);
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (outfile)
|
spki = NETSCAPE_SPKI_b64_decode(spkstr, -1);
|
||||||
out = BIO_new_file(outfile, "w");
|
|
||||||
else {
|
if(!spki) {
|
||||||
out = BIO_new_fp(stdout, BIO_NOCLOSE);
|
BIO_printf(bio_err, "Error loading SPKAC\n");
|
||||||
|
ERR_print_errors(bio_err);
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (outfile) out = BIO_new_file(outfile, "w");
|
||||||
|
else {
|
||||||
|
out = BIO_new_fp(stdout, BIO_NOCLOSE);
|
||||||
#ifdef OPENSSL_SYS_VMS
|
#ifdef OPENSSL_SYS_VMS
|
||||||
{
|
{
|
||||||
BIO *tmpbio = BIO_new(BIO_f_linebuffer());
|
BIO *tmpbio = BIO_new(BIO_f_linebuffer());
|
||||||
out = BIO_push(tmpbio, out);
|
out = BIO_push(tmpbio, out);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!out) {
|
if(!out) {
|
||||||
BIO_printf(bio_err, "Error opening output file\n");
|
BIO_printf(bio_err, "Error opening output file\n");
|
||||||
ERR_print_errors(bio_err);
|
ERR_print_errors(bio_err);
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!noout)
|
if(!noout) NETSCAPE_SPKI_print(out, spki);
|
||||||
NETSCAPE_SPKI_print(out, spki);
|
pkey = NETSCAPE_SPKI_get_pubkey(spki);
|
||||||
pkey = NETSCAPE_SPKI_get_pubkey(spki);
|
if(verify) {
|
||||||
if (verify) {
|
i = NETSCAPE_SPKI_verify(spki, pkey);
|
||||||
i = NETSCAPE_SPKI_verify(spki, pkey);
|
if (i > 0) BIO_printf(bio_err, "Signature OK\n");
|
||||||
if (i > 0)
|
else {
|
||||||
BIO_printf(bio_err, "Signature OK\n");
|
BIO_printf(bio_err, "Signature Failure\n");
|
||||||
else {
|
ERR_print_errors(bio_err);
|
||||||
BIO_printf(bio_err, "Signature Failure\n");
|
goto end;
|
||||||
ERR_print_errors(bio_err);
|
}
|
||||||
goto end;
|
}
|
||||||
}
|
if(pubkey) PEM_write_bio_PUBKEY(out, pkey);
|
||||||
}
|
|
||||||
if (pubkey)
|
|
||||||
PEM_write_bio_PUBKEY(out, pkey);
|
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
end:
|
end:
|
||||||
NCONF_free(conf);
|
NCONF_free(conf);
|
||||||
NETSCAPE_SPKI_free(spki);
|
NETSCAPE_SPKI_free(spki);
|
||||||
BIO_free(in);
|
BIO_free(in);
|
||||||
BIO_free_all(out);
|
BIO_free_all(out);
|
||||||
EVP_PKEY_free(pkey);
|
EVP_PKEY_free(pkey);
|
||||||
if (passin)
|
if(passin) OPENSSL_free(passin);
|
||||||
OPENSSL_free(passin);
|
apps_shutdown();
|
||||||
apps_shutdown();
|
OPENSSL_EXIT(ret);
|
||||||
OPENSSL_EXIT(ret);
|
}
|
||||||
}
|
|
||||||
|
|||||||
768
apps/srp.c
768
apps/srp.c
@@ -1,768 +0,0 @@
|
|||||||
/* apps/srp.c */
|
|
||||||
/*
|
|
||||||
* Written by Peter Sylvester (peter.sylvester@edelweb.fr) for the EdelKey
|
|
||||||
* project and contributed to the OpenSSL project 2004.
|
|
||||||
*/
|
|
||||||
/* ====================================================================
|
|
||||||
* Copyright (c) 2004 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 <openssl/opensslconf.h>
|
|
||||||
|
|
||||||
#ifndef OPENSSL_NO_SRP
|
|
||||||
# include <stdio.h>
|
|
||||||
# include <stdlib.h>
|
|
||||||
# include <string.h>
|
|
||||||
# include <openssl/conf.h>
|
|
||||||
# include <openssl/bio.h>
|
|
||||||
# include <openssl/err.h>
|
|
||||||
# include <openssl/txt_db.h>
|
|
||||||
# include <openssl/buffer.h>
|
|
||||||
# include <openssl/srp.h>
|
|
||||||
|
|
||||||
# include "apps.h"
|
|
||||||
|
|
||||||
# undef PROG
|
|
||||||
# define PROG srp_main
|
|
||||||
|
|
||||||
# define BASE_SECTION "srp"
|
|
||||||
# define CONFIG_FILE "openssl.cnf"
|
|
||||||
|
|
||||||
# define ENV_RANDFILE "RANDFILE"
|
|
||||||
|
|
||||||
# define ENV_DATABASE "srpvfile"
|
|
||||||
# define ENV_DEFAULT_SRP "default_srp"
|
|
||||||
|
|
||||||
static char *srp_usage[] = {
|
|
||||||
"usage: srp [args] [user] \n",
|
|
||||||
"\n",
|
|
||||||
" -verbose Talk alot while doing things\n",
|
|
||||||
" -config file A config file\n",
|
|
||||||
" -name arg The particular srp definition to use\n",
|
|
||||||
" -srpvfile arg The srp verifier file name\n",
|
|
||||||
" -add add an user and srp verifier\n",
|
|
||||||
" -modify modify the srp verifier of an existing user\n",
|
|
||||||
" -delete delete user from verifier file\n",
|
|
||||||
" -list list user\n",
|
|
||||||
" -gn arg g and N values to be used for new verifier\n",
|
|
||||||
" -userinfo arg additional info to be set for user\n",
|
|
||||||
" -passin arg input file pass phrase source\n",
|
|
||||||
" -passout arg output file pass phrase source\n",
|
|
||||||
# ifndef OPENSSL_NO_ENGINE
|
|
||||||
" -engine e - use engine e, possibly a hardware device.\n",
|
|
||||||
# endif
|
|
||||||
NULL
|
|
||||||
};
|
|
||||||
|
|
||||||
# ifdef EFENCE
|
|
||||||
extern int EF_PROTECT_FREE;
|
|
||||||
extern int EF_PROTECT_BELOW;
|
|
||||||
extern int EF_ALIGNMENT;
|
|
||||||
# endif
|
|
||||||
|
|
||||||
static CONF *conf = NULL;
|
|
||||||
static char *section = NULL;
|
|
||||||
|
|
||||||
# define VERBOSE if (verbose)
|
|
||||||
# define VVERBOSE if (verbose>1)
|
|
||||||
|
|
||||||
int MAIN(int, char **);
|
|
||||||
|
|
||||||
static int get_index(CA_DB *db, char *id, char type)
|
|
||||||
{
|
|
||||||
char **pp;
|
|
||||||
int i;
|
|
||||||
if (id == NULL)
|
|
||||||
return -1;
|
|
||||||
if (type == DB_SRP_INDEX)
|
|
||||||
for (i = 0; i < sk_OPENSSL_PSTRING_num(db->db->data); i++) {
|
|
||||||
pp = sk_OPENSSL_PSTRING_value(db->db->data, i);
|
|
||||||
if (pp[DB_srptype][0] == DB_SRP_INDEX
|
|
||||||
&& !strcmp(id, pp[DB_srpid]))
|
|
||||||
return i;
|
|
||||||
} else
|
|
||||||
for (i = 0; i < sk_OPENSSL_PSTRING_num(db->db->data); i++) {
|
|
||||||
pp = sk_OPENSSL_PSTRING_value(db->db->data, i);
|
|
||||||
|
|
||||||
if (pp[DB_srptype][0] != DB_SRP_INDEX
|
|
||||||
&& !strcmp(id, pp[DB_srpid]))
|
|
||||||
return i;
|
|
||||||
}
|
|
||||||
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void print_entry(CA_DB *db, BIO *bio, int indx, int verbose, char *s)
|
|
||||||
{
|
|
||||||
if (indx >= 0 && verbose) {
|
|
||||||
int j;
|
|
||||||
char **pp = sk_OPENSSL_PSTRING_value(db->db->data, indx);
|
|
||||||
BIO_printf(bio, "%s \"%s\"\n", s, pp[DB_srpid]);
|
|
||||||
for (j = 0; j < DB_NUMBER; j++) {
|
|
||||||
BIO_printf(bio_err, " %d = \"%s\"\n", j, pp[j]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void print_index(CA_DB *db, BIO *bio, int indexindex, int verbose)
|
|
||||||
{
|
|
||||||
print_entry(db, bio, indexindex, verbose, "g N entry");
|
|
||||||
}
|
|
||||||
|
|
||||||
static void print_user(CA_DB *db, BIO *bio, int userindex, int verbose)
|
|
||||||
{
|
|
||||||
if (verbose > 0) {
|
|
||||||
char **pp = sk_OPENSSL_PSTRING_value(db->db->data, userindex);
|
|
||||||
|
|
||||||
if (pp[DB_srptype][0] != 'I') {
|
|
||||||
print_entry(db, bio, userindex, verbose, "User entry");
|
|
||||||
print_entry(db, bio, get_index(db, pp[DB_srpgN], 'I'), verbose,
|
|
||||||
"g N entry");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static int update_index(CA_DB *db, BIO *bio, char **row)
|
|
||||||
{
|
|
||||||
char **irow;
|
|
||||||
int i;
|
|
||||||
|
|
||||||
if ((irow =
|
|
||||||
(char **)OPENSSL_malloc(sizeof(char *) * (DB_NUMBER + 1))) == NULL) {
|
|
||||||
BIO_printf(bio_err, "Memory allocation failure\n");
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (i = 0; i < DB_NUMBER; i++) {
|
|
||||||
irow[i] = row[i];
|
|
||||||
row[i] = NULL;
|
|
||||||
}
|
|
||||||
irow[DB_NUMBER] = NULL;
|
|
||||||
|
|
||||||
if (!TXT_DB_insert(db->db, irow)) {
|
|
||||||
BIO_printf(bio, "failed to update srpvfile\n");
|
|
||||||
BIO_printf(bio, "TXT_DB error number %ld\n", db->db->error);
|
|
||||||
OPENSSL_free(irow);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void lookup_fail(const char *name, char *tag)
|
|
||||||
{
|
|
||||||
BIO_printf(bio_err, "variable lookup failed for %s::%s\n", name, tag);
|
|
||||||
}
|
|
||||||
|
|
||||||
static char *srp_verify_user(const char *user, const char *srp_verifier,
|
|
||||||
char *srp_usersalt, const char *g, const char *N,
|
|
||||||
const char *passin, BIO *bio, int verbose)
|
|
||||||
{
|
|
||||||
char password[1024];
|
|
||||||
PW_CB_DATA cb_tmp;
|
|
||||||
char *verifier = NULL;
|
|
||||||
char *gNid = NULL;
|
|
||||||
|
|
||||||
cb_tmp.prompt_info = user;
|
|
||||||
cb_tmp.password = passin;
|
|
||||||
|
|
||||||
if (password_callback(password, 1024, 0, &cb_tmp) > 0) {
|
|
||||||
VERBOSE BIO_printf(bio,
|
|
||||||
"Validating\n user=\"%s\"\n srp_verifier=\"%s\"\n srp_usersalt=\"%s\"\n g=\"%s\"\n N=\"%s\"\n",
|
|
||||||
user, srp_verifier, srp_usersalt, g, N);
|
|
||||||
BIO_printf(bio, "Pass %s\n", password);
|
|
||||||
|
|
||||||
if (!
|
|
||||||
(gNid =
|
|
||||||
SRP_create_verifier(user, password, &srp_usersalt, &verifier, N,
|
|
||||||
g))) {
|
|
||||||
BIO_printf(bio, "Internal error validating SRP verifier\n");
|
|
||||||
} else {
|
|
||||||
if (strcmp(verifier, srp_verifier))
|
|
||||||
gNid = NULL;
|
|
||||||
OPENSSL_free(verifier);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return gNid;
|
|
||||||
}
|
|
||||||
|
|
||||||
static char *srp_create_user(char *user, char **srp_verifier,
|
|
||||||
char **srp_usersalt, char *g, char *N,
|
|
||||||
char *passout, BIO *bio, int verbose)
|
|
||||||
{
|
|
||||||
char password[1024];
|
|
||||||
PW_CB_DATA cb_tmp;
|
|
||||||
char *gNid = NULL;
|
|
||||||
char *salt = NULL;
|
|
||||||
cb_tmp.prompt_info = user;
|
|
||||||
cb_tmp.password = passout;
|
|
||||||
|
|
||||||
if (password_callback(password, 1024, 1, &cb_tmp) > 0) {
|
|
||||||
VERBOSE BIO_printf(bio,
|
|
||||||
"Creating\n user=\"%s\"\n g=\"%s\"\n N=\"%s\"\n",
|
|
||||||
user, g, N);
|
|
||||||
if (!
|
|
||||||
(gNid =
|
|
||||||
SRP_create_verifier(user, password, &salt, srp_verifier, N,
|
|
||||||
g))) {
|
|
||||||
BIO_printf(bio, "Internal error creating SRP verifier\n");
|
|
||||||
} else
|
|
||||||
*srp_usersalt = salt;
|
|
||||||
VVERBOSE BIO_printf(bio, "gNid=%s salt =\"%s\"\n verifier =\"%s\"\n",
|
|
||||||
gNid, salt, *srp_verifier);
|
|
||||||
|
|
||||||
}
|
|
||||||
return gNid;
|
|
||||||
}
|
|
||||||
|
|
||||||
int MAIN(int argc, char **argv)
|
|
||||||
{
|
|
||||||
int add_user = 0;
|
|
||||||
int list_user = 0;
|
|
||||||
int delete_user = 0;
|
|
||||||
int modify_user = 0;
|
|
||||||
char *user = NULL;
|
|
||||||
|
|
||||||
char *passargin = NULL, *passargout = NULL;
|
|
||||||
char *passin = NULL, *passout = NULL;
|
|
||||||
char *gN = NULL;
|
|
||||||
int gNindex = -1;
|
|
||||||
char **gNrow = NULL;
|
|
||||||
int maxgN = -1;
|
|
||||||
|
|
||||||
char *userinfo = NULL;
|
|
||||||
|
|
||||||
int badops = 0;
|
|
||||||
int ret = 1;
|
|
||||||
int errors = 0;
|
|
||||||
int verbose = 0;
|
|
||||||
int doupdatedb = 0;
|
|
||||||
char *configfile = NULL;
|
|
||||||
char *dbfile = NULL;
|
|
||||||
CA_DB *db = NULL;
|
|
||||||
char **pp;
|
|
||||||
int i;
|
|
||||||
long errorline = -1;
|
|
||||||
char *randfile = NULL;
|
|
||||||
# ifndef OPENSSL_NO_ENGINE
|
|
||||||
char *engine = NULL;
|
|
||||||
# endif
|
|
||||||
char *tofree = NULL;
|
|
||||||
DB_ATTR db_attr;
|
|
||||||
|
|
||||||
# ifdef EFENCE
|
|
||||||
EF_PROTECT_FREE = 1;
|
|
||||||
EF_PROTECT_BELOW = 1;
|
|
||||||
EF_ALIGNMENT = 0;
|
|
||||||
# endif
|
|
||||||
|
|
||||||
apps_startup();
|
|
||||||
|
|
||||||
conf = NULL;
|
|
||||||
section = NULL;
|
|
||||||
|
|
||||||
if (bio_err == NULL)
|
|
||||||
if ((bio_err = BIO_new(BIO_s_file())) != NULL)
|
|
||||||
BIO_set_fp(bio_err, stderr, BIO_NOCLOSE | BIO_FP_TEXT);
|
|
||||||
|
|
||||||
argc--;
|
|
||||||
argv++;
|
|
||||||
while (argc >= 1 && badops == 0) {
|
|
||||||
if (strcmp(*argv, "-verbose") == 0)
|
|
||||||
verbose++;
|
|
||||||
else if (strcmp(*argv, "-config") == 0) {
|
|
||||||
if (--argc < 1)
|
|
||||||
goto bad;
|
|
||||||
configfile = *(++argv);
|
|
||||||
} else if (strcmp(*argv, "-name") == 0) {
|
|
||||||
if (--argc < 1)
|
|
||||||
goto bad;
|
|
||||||
section = *(++argv);
|
|
||||||
} else if (strcmp(*argv, "-srpvfile") == 0) {
|
|
||||||
if (--argc < 1)
|
|
||||||
goto bad;
|
|
||||||
dbfile = *(++argv);
|
|
||||||
} else if (strcmp(*argv, "-add") == 0)
|
|
||||||
add_user = 1;
|
|
||||||
else if (strcmp(*argv, "-delete") == 0)
|
|
||||||
delete_user = 1;
|
|
||||||
else if (strcmp(*argv, "-modify") == 0)
|
|
||||||
modify_user = 1;
|
|
||||||
else if (strcmp(*argv, "-list") == 0)
|
|
||||||
list_user = 1;
|
|
||||||
else if (strcmp(*argv, "-gn") == 0) {
|
|
||||||
if (--argc < 1)
|
|
||||||
goto bad;
|
|
||||||
gN = *(++argv);
|
|
||||||
} else if (strcmp(*argv, "-userinfo") == 0) {
|
|
||||||
if (--argc < 1)
|
|
||||||
goto bad;
|
|
||||||
userinfo = *(++argv);
|
|
||||||
} else if (strcmp(*argv, "-passin") == 0) {
|
|
||||||
if (--argc < 1)
|
|
||||||
goto bad;
|
|
||||||
passargin = *(++argv);
|
|
||||||
} else if (strcmp(*argv, "-passout") == 0) {
|
|
||||||
if (--argc < 1)
|
|
||||||
goto bad;
|
|
||||||
passargout = *(++argv);
|
|
||||||
}
|
|
||||||
# ifndef OPENSSL_NO_ENGINE
|
|
||||||
else if (strcmp(*argv, "-engine") == 0) {
|
|
||||||
if (--argc < 1)
|
|
||||||
goto bad;
|
|
||||||
engine = *(++argv);
|
|
||||||
}
|
|
||||||
# endif
|
|
||||||
|
|
||||||
else if (**argv == '-') {
|
|
||||||
bad:
|
|
||||||
BIO_printf(bio_err, "unknown option %s\n", *argv);
|
|
||||||
badops = 1;
|
|
||||||
break;
|
|
||||||
} else
|
|
||||||
break;
|
|
||||||
|
|
||||||
argc--;
|
|
||||||
argv++;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (dbfile && configfile) {
|
|
||||||
BIO_printf(bio_err,
|
|
||||||
"-dbfile and -configfile cannot be specified together.\n");
|
|
||||||
badops = 1;
|
|
||||||
}
|
|
||||||
if (add_user + delete_user + modify_user + list_user != 1) {
|
|
||||||
BIO_printf(bio_err,
|
|
||||||
"Exactly one of the options -add, -delete, -modify -list must be specified.\n");
|
|
||||||
badops = 1;
|
|
||||||
}
|
|
||||||
if (delete_user + modify_user + delete_user == 1 && argc <= 0) {
|
|
||||||
BIO_printf(bio_err,
|
|
||||||
"Need at least one user for options -add, -delete, -modify. \n");
|
|
||||||
badops = 1;
|
|
||||||
}
|
|
||||||
if ((passin || passout) && argc != 1) {
|
|
||||||
BIO_printf(bio_err,
|
|
||||||
"-passin, -passout arguments only valid with one user.\n");
|
|
||||||
badops = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (badops) {
|
|
||||||
for (pp = srp_usage; (*pp != NULL); pp++)
|
|
||||||
BIO_printf(bio_err, "%s", *pp);
|
|
||||||
|
|
||||||
BIO_printf(bio_err, " -rand file%cfile%c...\n", LIST_SEPARATOR_CHAR,
|
|
||||||
LIST_SEPARATOR_CHAR);
|
|
||||||
BIO_printf(bio_err,
|
|
||||||
" load the file (or the files in the directory) into\n");
|
|
||||||
BIO_printf(bio_err, " the random number generator\n");
|
|
||||||
goto err;
|
|
||||||
}
|
|
||||||
|
|
||||||
ERR_load_crypto_strings();
|
|
||||||
|
|
||||||
# ifndef OPENSSL_NO_ENGINE
|
|
||||||
setup_engine(bio_err, engine, 0);
|
|
||||||
# endif
|
|
||||||
|
|
||||||
if (!app_passwd(bio_err, passargin, passargout, &passin, &passout)) {
|
|
||||||
BIO_printf(bio_err, "Error getting passwords\n");
|
|
||||||
goto err;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!dbfile) {
|
|
||||||
|
|
||||||
/*****************************************************************/
|
|
||||||
tofree = NULL;
|
|
||||||
if (configfile == NULL)
|
|
||||||
configfile = getenv("OPENSSL_CONF");
|
|
||||||
if (configfile == NULL)
|
|
||||||
configfile = getenv("SSLEAY_CONF");
|
|
||||||
if (configfile == NULL) {
|
|
||||||
const char *s = X509_get_default_cert_area();
|
|
||||||
size_t len;
|
|
||||||
|
|
||||||
# ifdef OPENSSL_SYS_VMS
|
|
||||||
len = strlen(s) + sizeof(CONFIG_FILE);
|
|
||||||
tofree = OPENSSL_malloc(len);
|
|
||||||
if (!tofree) {
|
|
||||||
BIO_printf(bio_err, "Out of memory\n");
|
|
||||||
goto err;
|
|
||||||
}
|
|
||||||
strcpy(tofree, s);
|
|
||||||
# else
|
|
||||||
len = strlen(s) + sizeof(CONFIG_FILE) + 1;
|
|
||||||
tofree = OPENSSL_malloc(len);
|
|
||||||
if (!tofree) {
|
|
||||||
BIO_printf(bio_err, "Out of memory\n");
|
|
||||||
goto err;
|
|
||||||
}
|
|
||||||
BUF_strlcpy(tofree, s, len);
|
|
||||||
BUF_strlcat(tofree, "/", len);
|
|
||||||
# endif
|
|
||||||
BUF_strlcat(tofree, CONFIG_FILE, len);
|
|
||||||
configfile = tofree;
|
|
||||||
}
|
|
||||||
|
|
||||||
VERBOSE BIO_printf(bio_err, "Using configuration from %s\n",
|
|
||||||
configfile);
|
|
||||||
conf = NCONF_new(NULL);
|
|
||||||
if (NCONF_load(conf, configfile, &errorline) <= 0) {
|
|
||||||
if (errorline <= 0)
|
|
||||||
BIO_printf(bio_err, "error loading the config file '%s'\n",
|
|
||||||
configfile);
|
|
||||||
else
|
|
||||||
BIO_printf(bio_err, "error on line %ld of config file '%s'\n",
|
|
||||||
errorline, configfile);
|
|
||||||
goto err;
|
|
||||||
}
|
|
||||||
if (tofree) {
|
|
||||||
OPENSSL_free(tofree);
|
|
||||||
tofree = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!load_config(bio_err, conf))
|
|
||||||
goto err;
|
|
||||||
|
|
||||||
/* Lets get the config section we are using */
|
|
||||||
if (section == NULL) {
|
|
||||||
VERBOSE BIO_printf(bio_err,
|
|
||||||
"trying to read " ENV_DEFAULT_SRP
|
|
||||||
" in \" BASE_SECTION \"\n");
|
|
||||||
|
|
||||||
section = NCONF_get_string(conf, BASE_SECTION, ENV_DEFAULT_SRP);
|
|
||||||
if (section == NULL) {
|
|
||||||
lookup_fail(BASE_SECTION, ENV_DEFAULT_SRP);
|
|
||||||
goto err;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (randfile == NULL && conf)
|
|
||||||
randfile = NCONF_get_string(conf, BASE_SECTION, "RANDFILE");
|
|
||||||
|
|
||||||
VERBOSE BIO_printf(bio_err,
|
|
||||||
"trying to read " ENV_DATABASE
|
|
||||||
" in section \"%s\"\n", section);
|
|
||||||
|
|
||||||
if ((dbfile = NCONF_get_string(conf, section, ENV_DATABASE)) == NULL) {
|
|
||||||
lookup_fail(section, ENV_DATABASE);
|
|
||||||
goto err;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
if (randfile == NULL)
|
|
||||||
ERR_clear_error();
|
|
||||||
else
|
|
||||||
app_RAND_load_file(randfile, bio_err, 0);
|
|
||||||
|
|
||||||
VERBOSE BIO_printf(bio_err, "Trying to read SRP verifier file \"%s\"\n",
|
|
||||||
dbfile);
|
|
||||||
|
|
||||||
db = load_index(dbfile, &db_attr);
|
|
||||||
if (db == NULL)
|
|
||||||
goto err;
|
|
||||||
|
|
||||||
/* Lets check some fields */
|
|
||||||
for (i = 0; i < sk_OPENSSL_PSTRING_num(db->db->data); i++) {
|
|
||||||
pp = sk_OPENSSL_PSTRING_value(db->db->data, i);
|
|
||||||
|
|
||||||
if (pp[DB_srptype][0] == DB_SRP_INDEX) {
|
|
||||||
maxgN = i;
|
|
||||||
if (gNindex < 0 && gN != NULL && !strcmp(gN, pp[DB_srpid]))
|
|
||||||
gNindex = i;
|
|
||||||
|
|
||||||
print_index(db, bio_err, i, verbose > 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
VERBOSE BIO_printf(bio_err, "Database initialised\n");
|
|
||||||
|
|
||||||
if (gNindex >= 0) {
|
|
||||||
gNrow = sk_OPENSSL_PSTRING_value(db->db->data, gNindex);
|
|
||||||
print_entry(db, bio_err, gNindex, verbose > 1, "Default g and N");
|
|
||||||
} else if (maxgN > 0 && !SRP_get_default_gN(gN)) {
|
|
||||||
BIO_printf(bio_err, "No g and N value for index \"%s\"\n", gN);
|
|
||||||
goto err;
|
|
||||||
} else {
|
|
||||||
VERBOSE BIO_printf(bio_err, "Database has no g N information.\n");
|
|
||||||
gNrow = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
VVERBOSE BIO_printf(bio_err, "Starting user processing\n");
|
|
||||||
|
|
||||||
if (argc > 0)
|
|
||||||
user = *(argv++);
|
|
||||||
|
|
||||||
while (list_user || user) {
|
|
||||||
int userindex = -1;
|
|
||||||
if (user)
|
|
||||||
VVERBOSE BIO_printf(bio_err, "Processing user \"%s\"\n", user);
|
|
||||||
if ((userindex = get_index(db, user, 'U')) >= 0) {
|
|
||||||
print_user(db, bio_err, userindex, (verbose > 0) || list_user);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (list_user) {
|
|
||||||
if (user == NULL) {
|
|
||||||
BIO_printf(bio_err, "List all users\n");
|
|
||||||
|
|
||||||
for (i = 0; i < sk_OPENSSL_PSTRING_num(db->db->data); i++) {
|
|
||||||
print_user(db, bio_err, i, 1);
|
|
||||||
}
|
|
||||||
list_user = 0;
|
|
||||||
} else if (userindex < 0) {
|
|
||||||
BIO_printf(bio_err,
|
|
||||||
"user \"%s\" does not exist, ignored. t\n", user);
|
|
||||||
errors++;
|
|
||||||
}
|
|
||||||
} else if (add_user) {
|
|
||||||
if (userindex >= 0) {
|
|
||||||
/* reactivation of a new user */
|
|
||||||
char **row =
|
|
||||||
sk_OPENSSL_PSTRING_value(db->db->data, userindex);
|
|
||||||
BIO_printf(bio_err, "user \"%s\" reactivated.\n", user);
|
|
||||||
row[DB_srptype][0] = 'V';
|
|
||||||
|
|
||||||
doupdatedb = 1;
|
|
||||||
} else {
|
|
||||||
char *row[DB_NUMBER];
|
|
||||||
char *gNid;
|
|
||||||
row[DB_srpverifier] = NULL;
|
|
||||||
row[DB_srpsalt] = NULL;
|
|
||||||
row[DB_srpinfo] = NULL;
|
|
||||||
if (!
|
|
||||||
(gNid =
|
|
||||||
srp_create_user(user, &(row[DB_srpverifier]),
|
|
||||||
&(row[DB_srpsalt]),
|
|
||||||
gNrow ? gNrow[DB_srpsalt] : gN,
|
|
||||||
gNrow ? gNrow[DB_srpverifier] : NULL,
|
|
||||||
passout, bio_err, verbose))) {
|
|
||||||
BIO_printf(bio_err,
|
|
||||||
"Cannot create srp verifier for user \"%s\", operation abandoned .\n",
|
|
||||||
user);
|
|
||||||
errors++;
|
|
||||||
goto err;
|
|
||||||
}
|
|
||||||
row[DB_srpid] = BUF_strdup(user);
|
|
||||||
row[DB_srptype] = BUF_strdup("v");
|
|
||||||
row[DB_srpgN] = BUF_strdup(gNid);
|
|
||||||
|
|
||||||
if (!row[DB_srpid] || !row[DB_srpgN] || !row[DB_srptype]
|
|
||||||
|| !row[DB_srpverifier] || !row[DB_srpsalt] || (userinfo
|
|
||||||
&&
|
|
||||||
(!(row
|
|
||||||
[DB_srpinfo]
|
|
||||||
=
|
|
||||||
BUF_strdup
|
|
||||||
(userinfo))))
|
|
||||||
|| !update_index(db, bio_err, row)) {
|
|
||||||
if (row[DB_srpid])
|
|
||||||
OPENSSL_free(row[DB_srpid]);
|
|
||||||
if (row[DB_srpgN])
|
|
||||||
OPENSSL_free(row[DB_srpgN]);
|
|
||||||
if (row[DB_srpinfo])
|
|
||||||
OPENSSL_free(row[DB_srpinfo]);
|
|
||||||
if (row[DB_srptype])
|
|
||||||
OPENSSL_free(row[DB_srptype]);
|
|
||||||
if (row[DB_srpverifier])
|
|
||||||
OPENSSL_free(row[DB_srpverifier]);
|
|
||||||
if (row[DB_srpsalt])
|
|
||||||
OPENSSL_free(row[DB_srpsalt]);
|
|
||||||
goto err;
|
|
||||||
}
|
|
||||||
doupdatedb = 1;
|
|
||||||
}
|
|
||||||
} else if (modify_user) {
|
|
||||||
if (userindex < 0) {
|
|
||||||
BIO_printf(bio_err,
|
|
||||||
"user \"%s\" does not exist, operation ignored.\n",
|
|
||||||
user);
|
|
||||||
errors++;
|
|
||||||
} else {
|
|
||||||
|
|
||||||
char **row =
|
|
||||||
sk_OPENSSL_PSTRING_value(db->db->data, userindex);
|
|
||||||
char type = row[DB_srptype][0];
|
|
||||||
if (type == 'v') {
|
|
||||||
BIO_printf(bio_err,
|
|
||||||
"user \"%s\" already updated, operation ignored.\n",
|
|
||||||
user);
|
|
||||||
errors++;
|
|
||||||
} else {
|
|
||||||
char *gNid;
|
|
||||||
|
|
||||||
if (row[DB_srptype][0] == 'V') {
|
|
||||||
int user_gN;
|
|
||||||
char **irow = NULL;
|
|
||||||
VERBOSE BIO_printf(bio_err,
|
|
||||||
"Verifying password for user \"%s\"\n",
|
|
||||||
user);
|
|
||||||
if ((user_gN =
|
|
||||||
get_index(db, row[DB_srpgN], DB_SRP_INDEX)) >= 0)
|
|
||||||
irow =
|
|
||||||
(char **)sk_OPENSSL_PSTRING_value(db->
|
|
||||||
db->data,
|
|
||||||
userindex);
|
|
||||||
|
|
||||||
if (!srp_verify_user
|
|
||||||
(user, row[DB_srpverifier], row[DB_srpsalt],
|
|
||||||
irow ? irow[DB_srpsalt] : row[DB_srpgN],
|
|
||||||
irow ? irow[DB_srpverifier] : NULL, passin,
|
|
||||||
bio_err, verbose)) {
|
|
||||||
BIO_printf(bio_err,
|
|
||||||
"Invalid password for user \"%s\", operation abandoned.\n",
|
|
||||||
user);
|
|
||||||
errors++;
|
|
||||||
goto err;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
VERBOSE BIO_printf(bio_err,
|
|
||||||
"Password for user \"%s\" ok.\n",
|
|
||||||
user);
|
|
||||||
|
|
||||||
if (!
|
|
||||||
(gNid =
|
|
||||||
srp_create_user(user, &(row[DB_srpverifier]),
|
|
||||||
&(row[DB_srpsalt]),
|
|
||||||
gNrow ? gNrow[DB_srpsalt] : NULL,
|
|
||||||
gNrow ? gNrow[DB_srpverifier] : NULL,
|
|
||||||
passout, bio_err, verbose))) {
|
|
||||||
BIO_printf(bio_err,
|
|
||||||
"Cannot create srp verifier for user \"%s\", operation abandoned.\n",
|
|
||||||
user);
|
|
||||||
errors++;
|
|
||||||
goto err;
|
|
||||||
}
|
|
||||||
|
|
||||||
row[DB_srptype][0] = 'v';
|
|
||||||
row[DB_srpgN] = BUF_strdup(gNid);
|
|
||||||
|
|
||||||
if (!row[DB_srpid] || !row[DB_srpgN] || !row[DB_srptype]
|
|
||||||
|| !row[DB_srpverifier] || !row[DB_srpsalt]
|
|
||||||
|| (userinfo
|
|
||||||
&& (!(row[DB_srpinfo] = BUF_strdup(userinfo)))))
|
|
||||||
goto err;
|
|
||||||
|
|
||||||
doupdatedb = 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if (delete_user) {
|
|
||||||
if (userindex < 0) {
|
|
||||||
BIO_printf(bio_err,
|
|
||||||
"user \"%s\" does not exist, operation ignored. t\n",
|
|
||||||
user);
|
|
||||||
errors++;
|
|
||||||
} else {
|
|
||||||
char **xpp =
|
|
||||||
sk_OPENSSL_PSTRING_value(db->db->data, userindex);
|
|
||||||
BIO_printf(bio_err, "user \"%s\" revoked. t\n", user);
|
|
||||||
|
|
||||||
xpp[DB_srptype][0] = 'R';
|
|
||||||
|
|
||||||
doupdatedb = 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (--argc > 0)
|
|
||||||
user = *(argv++);
|
|
||||||
else {
|
|
||||||
user = NULL;
|
|
||||||
list_user = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
VERBOSE BIO_printf(bio_err, "User procession done.\n");
|
|
||||||
|
|
||||||
if (doupdatedb) {
|
|
||||||
/* Lets check some fields */
|
|
||||||
for (i = 0; i < sk_OPENSSL_PSTRING_num(db->db->data); i++) {
|
|
||||||
pp = sk_OPENSSL_PSTRING_value(db->db->data, i);
|
|
||||||
|
|
||||||
if (pp[DB_srptype][0] == 'v') {
|
|
||||||
pp[DB_srptype][0] = 'V';
|
|
||||||
print_user(db, bio_err, i, verbose);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
VERBOSE BIO_printf(bio_err, "Trying to update srpvfile.\n");
|
|
||||||
if (!save_index(dbfile, "new", db))
|
|
||||||
goto err;
|
|
||||||
|
|
||||||
VERBOSE BIO_printf(bio_err, "Temporary srpvfile created.\n");
|
|
||||||
if (!rotate_index(dbfile, "new", "old"))
|
|
||||||
goto err;
|
|
||||||
|
|
||||||
VERBOSE BIO_printf(bio_err, "srpvfile updated.\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
ret = (errors != 0);
|
|
||||||
err:
|
|
||||||
if (errors != 0)
|
|
||||||
VERBOSE BIO_printf(bio_err, "User errors %d.\n", errors);
|
|
||||||
|
|
||||||
VERBOSE BIO_printf(bio_err, "SRP terminating with code %d.\n", ret);
|
|
||||||
if (tofree)
|
|
||||||
OPENSSL_free(tofree);
|
|
||||||
if (ret)
|
|
||||||
ERR_print_errors(bio_err);
|
|
||||||
if (randfile)
|
|
||||||
app_RAND_write_file(randfile, bio_err);
|
|
||||||
if (conf)
|
|
||||||
NCONF_free(conf);
|
|
||||||
if (db)
|
|
||||||
free_index(db);
|
|
||||||
|
|
||||||
OBJ_cleanup();
|
|
||||||
apps_shutdown();
|
|
||||||
OPENSSL_EXIT(ret);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
416
apps/testdsa.h
416
apps/testdsa.h
@@ -1,233 +1,217 @@
|
|||||||
/* NOCW */
|
/* NOCW */
|
||||||
/* used by apps/speed.c */
|
/* used by apps/speed.c */
|
||||||
DSA *get_dsa512(void);
|
DSA *get_dsa512(void );
|
||||||
DSA *get_dsa1024(void);
|
DSA *get_dsa1024(void );
|
||||||
DSA *get_dsa2048(void);
|
DSA *get_dsa2048(void );
|
||||||
static unsigned char dsa512_priv[] = {
|
static unsigned char dsa512_priv[] = {
|
||||||
0x65, 0xe5, 0xc7, 0x38, 0x60, 0x24, 0xb5, 0x89, 0xd4, 0x9c, 0xeb, 0x4c,
|
0x65,0xe5,0xc7,0x38,0x60,0x24,0xb5,0x89,0xd4,0x9c,0xeb,0x4c,
|
||||||
0x9c, 0x1d, 0x7a, 0x22, 0xbd, 0xd1, 0xc2, 0xd2,
|
0x9c,0x1d,0x7a,0x22,0xbd,0xd1,0xc2,0xd2,
|
||||||
};
|
};
|
||||||
|
|
||||||
static unsigned char dsa512_pub[] = {
|
static unsigned char dsa512_pub[] = {
|
||||||
0x00, 0x95, 0xa7, 0x0d, 0xec, 0x93, 0x68, 0xba, 0x5f, 0xf7, 0x5f, 0x07,
|
0x00,0x95,0xa7,0x0d,0xec,0x93,0x68,0xba,0x5f,0xf7,0x5f,0x07,
|
||||||
0xf2, 0x3b, 0xad, 0x6b, 0x01, 0xdc, 0xbe, 0xec, 0xde, 0x04, 0x7a, 0x3a,
|
0xf2,0x3b,0xad,0x6b,0x01,0xdc,0xbe,0xec,0xde,0x04,0x7a,0x3a,
|
||||||
0x27, 0xb3, 0xec, 0x49, 0xfd, 0x08, 0x43, 0x3d, 0x7e, 0xa8, 0x2c, 0x5e,
|
0x27,0xb3,0xec,0x49,0xfd,0x08,0x43,0x3d,0x7e,0xa8,0x2c,0x5e,
|
||||||
0x7b, 0xbb, 0xfc, 0xf4, 0x6e, 0xeb, 0x6c, 0xb0, 0x6e, 0xf8, 0x02, 0x12,
|
0x7b,0xbb,0xfc,0xf4,0x6e,0xeb,0x6c,0xb0,0x6e,0xf8,0x02,0x12,
|
||||||
0x8c, 0x38, 0x5d, 0x83, 0x56, 0x7d, 0xee, 0x53, 0x05, 0x3e, 0x24, 0x84,
|
0x8c,0x38,0x5d,0x83,0x56,0x7d,0xee,0x53,0x05,0x3e,0x24,0x84,
|
||||||
0xbe, 0xba, 0x0a, 0x6b, 0xc8,
|
0xbe,0xba,0x0a,0x6b,0xc8,
|
||||||
};
|
};
|
||||||
|
static unsigned char dsa512_p[]={
|
||||||
static unsigned char dsa512_p[] = {
|
0x9D,0x1B,0x69,0x8E,0x26,0xDB,0xF2,0x2B,0x11,0x70,0x19,0x86,
|
||||||
0x9D, 0x1B, 0x69, 0x8E, 0x26, 0xDB, 0xF2, 0x2B, 0x11, 0x70, 0x19, 0x86,
|
0xF6,0x19,0xC8,0xF8,0x19,0xF2,0x18,0x53,0x94,0x46,0x06,0xD0,
|
||||||
0xF6, 0x19, 0xC8, 0xF8, 0x19, 0xF2, 0x18, 0x53, 0x94, 0x46, 0x06, 0xD0,
|
0x62,0x50,0x33,0x4B,0x02,0x3C,0x52,0x30,0x03,0x8B,0x3B,0xF9,
|
||||||
0x62, 0x50, 0x33, 0x4B, 0x02, 0x3C, 0x52, 0x30, 0x03, 0x8B, 0x3B, 0xF9,
|
0x5F,0xD1,0x24,0x06,0x4F,0x7B,0x4C,0xBA,0xAA,0x40,0x9B,0xFD,
|
||||||
0x5F, 0xD1, 0x24, 0x06, 0x4F, 0x7B, 0x4C, 0xBA, 0xAA, 0x40, 0x9B, 0xFD,
|
0x96,0xE4,0x37,0x33,0xBB,0x2D,0x5A,0xD7,0x5A,0x11,0x40,0x66,
|
||||||
0x96, 0xE4, 0x37, 0x33, 0xBB, 0x2D, 0x5A, 0xD7, 0x5A, 0x11, 0x40, 0x66,
|
0xA2,0x76,0x7D,0x31,
|
||||||
0xA2, 0x76, 0x7D, 0x31,
|
};
|
||||||
};
|
static unsigned char dsa512_q[]={
|
||||||
|
0xFB,0x53,0xEF,0x50,0xB4,0x40,0x92,0x31,0x56,0x86,0x53,0x7A,
|
||||||
static unsigned char dsa512_q[] = {
|
0xE8,0x8B,0x22,0x9A,0x49,0xFB,0x71,0x8F,
|
||||||
0xFB, 0x53, 0xEF, 0x50, 0xB4, 0x40, 0x92, 0x31, 0x56, 0x86, 0x53, 0x7A,
|
};
|
||||||
0xE8, 0x8B, 0x22, 0x9A, 0x49, 0xFB, 0x71, 0x8F,
|
static unsigned char dsa512_g[]={
|
||||||
};
|
0x83,0x3E,0x88,0xE5,0xC5,0x89,0x73,0xCE,0x3B,0x6C,0x01,0x49,
|
||||||
|
0xBF,0xB3,0xC7,0x9F,0x0A,0xEA,0x44,0x91,0xE5,0x30,0xAA,0xD9,
|
||||||
static unsigned char dsa512_g[] = {
|
0xBE,0x5B,0x5F,0xB7,0x10,0xD7,0x89,0xB7,0x8E,0x74,0xFB,0xCF,
|
||||||
0x83, 0x3E, 0x88, 0xE5, 0xC5, 0x89, 0x73, 0xCE, 0x3B, 0x6C, 0x01, 0x49,
|
0x29,0x1E,0xEB,0xA8,0x2C,0x54,0x51,0xB8,0x10,0xDE,0xA0,0xCE,
|
||||||
0xBF, 0xB3, 0xC7, 0x9F, 0x0A, 0xEA, 0x44, 0x91, 0xE5, 0x30, 0xAA, 0xD9,
|
0x2F,0xCC,0x24,0x6B,0x90,0x77,0xDE,0xA2,0x68,0xA6,0x52,0x12,
|
||||||
0xBE, 0x5B, 0x5F, 0xB7, 0x10, 0xD7, 0x89, 0xB7, 0x8E, 0x74, 0xFB, 0xCF,
|
0xA2,0x03,0x9D,0x20,
|
||||||
0x29, 0x1E, 0xEB, 0xA8, 0x2C, 0x54, 0x51, 0xB8, 0x10, 0xDE, 0xA0, 0xCE,
|
};
|
||||||
0x2F, 0xCC, 0x24, 0x6B, 0x90, 0x77, 0xDE, 0xA2, 0x68, 0xA6, 0x52, 0x12,
|
|
||||||
0xA2, 0x03, 0x9D, 0x20,
|
|
||||||
};
|
|
||||||
|
|
||||||
DSA *get_dsa512()
|
DSA *get_dsa512()
|
||||||
{
|
{
|
||||||
DSA *dsa;
|
DSA *dsa;
|
||||||
|
|
||||||
if ((dsa = DSA_new()) == NULL)
|
if ((dsa=DSA_new()) == NULL) return(NULL);
|
||||||
return (NULL);
|
dsa->priv_key=BN_bin2bn(dsa512_priv,sizeof(dsa512_priv),NULL);
|
||||||
dsa->priv_key = BN_bin2bn(dsa512_priv, sizeof(dsa512_priv), NULL);
|
dsa->pub_key=BN_bin2bn(dsa512_pub,sizeof(dsa512_pub),NULL);
|
||||||
dsa->pub_key = BN_bin2bn(dsa512_pub, sizeof(dsa512_pub), NULL);
|
dsa->p=BN_bin2bn(dsa512_p,sizeof(dsa512_p),NULL);
|
||||||
dsa->p = BN_bin2bn(dsa512_p, sizeof(dsa512_p), NULL);
|
dsa->q=BN_bin2bn(dsa512_q,sizeof(dsa512_q),NULL);
|
||||||
dsa->q = BN_bin2bn(dsa512_q, sizeof(dsa512_q), NULL);
|
dsa->g=BN_bin2bn(dsa512_g,sizeof(dsa512_g),NULL);
|
||||||
dsa->g = BN_bin2bn(dsa512_g, sizeof(dsa512_g), NULL);
|
if ((dsa->priv_key == NULL) || (dsa->pub_key == NULL) || (dsa->p == NULL) ||
|
||||||
if ((dsa->priv_key == NULL) || (dsa->pub_key == NULL) || (dsa->p == NULL)
|
(dsa->q == NULL) || (dsa->g == NULL))
|
||||||
|| (dsa->q == NULL) || (dsa->g == NULL))
|
return(NULL);
|
||||||
return (NULL);
|
return(dsa);
|
||||||
return (dsa);
|
}
|
||||||
}
|
|
||||||
|
|
||||||
static unsigned char dsa1024_priv[] = {
|
static unsigned char dsa1024_priv[]={
|
||||||
0x7d, 0x21, 0xda, 0xbb, 0x62, 0x15, 0x47, 0x36, 0x07, 0x67, 0x12, 0xe8,
|
0x7d,0x21,0xda,0xbb,0x62,0x15,0x47,0x36,0x07,0x67,0x12,0xe8,
|
||||||
0x8c, 0xaa, 0x1c, 0xcd, 0x38, 0x12, 0x61, 0x18,
|
0x8c,0xaa,0x1c,0xcd,0x38,0x12,0x61,0x18,
|
||||||
};
|
};
|
||||||
|
static unsigned char dsa1024_pub[]={
|
||||||
static unsigned char dsa1024_pub[] = {
|
0x3c,0x4e,0x9c,0x2a,0x7f,0x16,0xc1,0x25,0xeb,0xac,0x78,0x63,
|
||||||
0x3c, 0x4e, 0x9c, 0x2a, 0x7f, 0x16, 0xc1, 0x25, 0xeb, 0xac, 0x78, 0x63,
|
0x90,0x14,0x8c,0x8b,0xf4,0x68,0x43,0x3c,0x2d,0xee,0x65,0x50,
|
||||||
0x90, 0x14, 0x8c, 0x8b, 0xf4, 0x68, 0x43, 0x3c, 0x2d, 0xee, 0x65, 0x50,
|
0x7d,0x9c,0x8f,0x8c,0x8a,0x51,0xd6,0x11,0x2b,0x99,0xaf,0x1e,
|
||||||
0x7d, 0x9c, 0x8f, 0x8c, 0x8a, 0x51, 0xd6, 0x11, 0x2b, 0x99, 0xaf, 0x1e,
|
0x90,0x97,0xb5,0xd3,0xa6,0x20,0x25,0xd6,0xfe,0x43,0x02,0xd5,
|
||||||
0x90, 0x97, 0xb5, 0xd3, 0xa6, 0x20, 0x25, 0xd6, 0xfe, 0x43, 0x02, 0xd5,
|
0x91,0x7d,0xa7,0x8c,0xdb,0xc9,0x85,0xa3,0x36,0x48,0xf7,0x68,
|
||||||
0x91, 0x7d, 0xa7, 0x8c, 0xdb, 0xc9, 0x85, 0xa3, 0x36, 0x48, 0xf7, 0x68,
|
0xaa,0x60,0xb1,0xf7,0x05,0x68,0x3a,0xa3,0x3f,0xd3,0x19,0x82,
|
||||||
0xaa, 0x60, 0xb1, 0xf7, 0x05, 0x68, 0x3a, 0xa3, 0x3f, 0xd3, 0x19, 0x82,
|
0xd8,0x82,0x7a,0x77,0xfb,0xef,0xf4,0x15,0x0a,0xeb,0x06,0x04,
|
||||||
0xd8, 0x82, 0x7a, 0x77, 0xfb, 0xef, 0xf4, 0x15, 0x0a, 0xeb, 0x06, 0x04,
|
0x7f,0x53,0x07,0x0c,0xbc,0xcb,0x2d,0x83,0xdb,0x3e,0xd1,0x28,
|
||||||
0x7f, 0x53, 0x07, 0x0c, 0xbc, 0xcb, 0x2d, 0x83, 0xdb, 0x3e, 0xd1, 0x28,
|
0xa5,0xa1,0x31,0xe0,0x67,0xfa,0x50,0xde,0x9b,0x07,0x83,0x7e,
|
||||||
0xa5, 0xa1, 0x31, 0xe0, 0x67, 0xfa, 0x50, 0xde, 0x9b, 0x07, 0x83, 0x7e,
|
0x2c,0x0b,0xc3,0x13,0x50,0x61,0xe5,0xad,0xbd,0x36,0xb8,0x97,
|
||||||
0x2c, 0x0b, 0xc3, 0x13, 0x50, 0x61, 0xe5, 0xad, 0xbd, 0x36, 0xb8, 0x97,
|
0x4e,0x40,0x7d,0xe8,0x83,0x0d,0xbc,0x4b
|
||||||
0x4e, 0x40, 0x7d, 0xe8, 0x83, 0x0d, 0xbc, 0x4b
|
};
|
||||||
};
|
static unsigned char dsa1024_p[]={
|
||||||
|
0xA7,0x3F,0x6E,0x85,0xBF,0x41,0x6A,0x29,0x7D,0xF0,0x9F,0x47,
|
||||||
static unsigned char dsa1024_p[] = {
|
0x19,0x30,0x90,0x9A,0x09,0x1D,0xDA,0x6A,0x33,0x1E,0xC5,0x3D,
|
||||||
0xA7, 0x3F, 0x6E, 0x85, 0xBF, 0x41, 0x6A, 0x29, 0x7D, 0xF0, 0x9F, 0x47,
|
0x86,0x96,0xB3,0x15,0xE0,0x53,0x2E,0x8F,0xE0,0x59,0x82,0x73,
|
||||||
0x19, 0x30, 0x90, 0x9A, 0x09, 0x1D, 0xDA, 0x6A, 0x33, 0x1E, 0xC5, 0x3D,
|
0x90,0x3E,0x75,0x31,0x99,0x47,0x7A,0x52,0xFB,0x85,0xE4,0xD9,
|
||||||
0x86, 0x96, 0xB3, 0x15, 0xE0, 0x53, 0x2E, 0x8F, 0xE0, 0x59, 0x82, 0x73,
|
0xA6,0x7B,0x38,0x9B,0x68,0x8A,0x84,0x9B,0x87,0xC6,0x1E,0xB5,
|
||||||
0x90, 0x3E, 0x75, 0x31, 0x99, 0x47, 0x7A, 0x52, 0xFB, 0x85, 0xE4, 0xD9,
|
0x7E,0x86,0x4B,0x53,0x5B,0x59,0xCF,0x71,0x65,0x19,0x88,0x6E,
|
||||||
0xA6, 0x7B, 0x38, 0x9B, 0x68, 0x8A, 0x84, 0x9B, 0x87, 0xC6, 0x1E, 0xB5,
|
0xCE,0x66,0xAE,0x6B,0x88,0x36,0xFB,0xEC,0x28,0xDC,0xC2,0xD7,
|
||||||
0x7E, 0x86, 0x4B, 0x53, 0x5B, 0x59, 0xCF, 0x71, 0x65, 0x19, 0x88, 0x6E,
|
0xA5,0xBB,0xE5,0x2C,0x39,0x26,0x4B,0xDA,0x9A,0x70,0x18,0x95,
|
||||||
0xCE, 0x66, 0xAE, 0x6B, 0x88, 0x36, 0xFB, 0xEC, 0x28, 0xDC, 0xC2, 0xD7,
|
0x37,0x95,0x10,0x56,0x23,0xF6,0x15,0xED,0xBA,0x04,0x5E,0xDE,
|
||||||
0xA5, 0xBB, 0xE5, 0x2C, 0x39, 0x26, 0x4B, 0xDA, 0x9A, 0x70, 0x18, 0x95,
|
0x39,0x4F,0xFD,0xB7,0x43,0x1F,0xB5,0xA4,0x65,0x6F,0xCD,0x80,
|
||||||
0x37, 0x95, 0x10, 0x56, 0x23, 0xF6, 0x15, 0xED, 0xBA, 0x04, 0x5E, 0xDE,
|
0x11,0xE4,0x70,0x95,0x5B,0x50,0xCD,0x49,
|
||||||
0x39, 0x4F, 0xFD, 0xB7, 0x43, 0x1F, 0xB5, 0xA4, 0x65, 0x6F, 0xCD, 0x80,
|
};
|
||||||
0x11, 0xE4, 0x70, 0x95, 0x5B, 0x50, 0xCD, 0x49,
|
static unsigned char dsa1024_q[]={
|
||||||
};
|
0xF7,0x07,0x31,0xED,0xFA,0x6C,0x06,0x03,0xD5,0x85,0x8A,0x1C,
|
||||||
|
0xAC,0x9C,0x65,0xE7,0x50,0x66,0x65,0x6F,
|
||||||
static unsigned char dsa1024_q[] = {
|
};
|
||||||
0xF7, 0x07, 0x31, 0xED, 0xFA, 0x6C, 0x06, 0x03, 0xD5, 0x85, 0x8A, 0x1C,
|
static unsigned char dsa1024_g[]={
|
||||||
0xAC, 0x9C, 0x65, 0xE7, 0x50, 0x66, 0x65, 0x6F,
|
0x4D,0xDF,0x4C,0x03,0xA6,0x91,0x8A,0xF5,0x19,0x6F,0x50,0x46,
|
||||||
};
|
0x25,0x99,0xE5,0x68,0x6F,0x30,0xE3,0x69,0xE1,0xE5,0xB3,0x5D,
|
||||||
|
0x98,0xBB,0x28,0x86,0x48,0xFC,0xDE,0x99,0x04,0x3F,0x5F,0x88,
|
||||||
static unsigned char dsa1024_g[] = {
|
0x0C,0x9C,0x73,0x24,0x0D,0x20,0x5D,0xB9,0x2A,0x9A,0x3F,0x18,
|
||||||
0x4D, 0xDF, 0x4C, 0x03, 0xA6, 0x91, 0x8A, 0xF5, 0x19, 0x6F, 0x50, 0x46,
|
0x96,0x27,0xE4,0x62,0x87,0xC1,0x7B,0x74,0x62,0x53,0xFC,0x61,
|
||||||
0x25, 0x99, 0xE5, 0x68, 0x6F, 0x30, 0xE3, 0x69, 0xE1, 0xE5, 0xB3, 0x5D,
|
0x27,0xA8,0x7A,0x91,0x09,0x9D,0xB6,0xF1,0x4D,0x9C,0x54,0x0F,
|
||||||
0x98, 0xBB, 0x28, 0x86, 0x48, 0xFC, 0xDE, 0x99, 0x04, 0x3F, 0x5F, 0x88,
|
0x58,0x06,0xEE,0x49,0x74,0x07,0xCE,0x55,0x7E,0x23,0xCE,0x16,
|
||||||
0x0C, 0x9C, 0x73, 0x24, 0x0D, 0x20, 0x5D, 0xB9, 0x2A, 0x9A, 0x3F, 0x18,
|
0xF6,0xCA,0xDC,0x5A,0x61,0x01,0x7E,0xC9,0x71,0xB5,0x4D,0xF6,
|
||||||
0x96, 0x27, 0xE4, 0x62, 0x87, 0xC1, 0x7B, 0x74, 0x62, 0x53, 0xFC, 0x61,
|
0xDC,0x34,0x29,0x87,0x68,0xF6,0x5E,0x20,0x93,0xB3,0xDB,0xF5,
|
||||||
0x27, 0xA8, 0x7A, 0x91, 0x09, 0x9D, 0xB6, 0xF1, 0x4D, 0x9C, 0x54, 0x0F,
|
0xE4,0x09,0x6C,0x41,0x17,0x95,0x92,0xEB,0x01,0xB5,0x73,0xA5,
|
||||||
0x58, 0x06, 0xEE, 0x49, 0x74, 0x07, 0xCE, 0x55, 0x7E, 0x23, 0xCE, 0x16,
|
0x6A,0x7E,0xD8,0x32,0xED,0x0E,0x02,0xB8,
|
||||||
0xF6, 0xCA, 0xDC, 0x5A, 0x61, 0x01, 0x7E, 0xC9, 0x71, 0xB5, 0x4D, 0xF6,
|
};
|
||||||
0xDC, 0x34, 0x29, 0x87, 0x68, 0xF6, 0x5E, 0x20, 0x93, 0xB3, 0xDB, 0xF5,
|
|
||||||
0xE4, 0x09, 0x6C, 0x41, 0x17, 0x95, 0x92, 0xEB, 0x01, 0xB5, 0x73, 0xA5,
|
|
||||||
0x6A, 0x7E, 0xD8, 0x32, 0xED, 0x0E, 0x02, 0xB8,
|
|
||||||
};
|
|
||||||
|
|
||||||
DSA *get_dsa1024()
|
DSA *get_dsa1024()
|
||||||
{
|
{
|
||||||
DSA *dsa;
|
DSA *dsa;
|
||||||
|
|
||||||
if ((dsa = DSA_new()) == NULL)
|
if ((dsa=DSA_new()) == NULL) return(NULL);
|
||||||
return (NULL);
|
dsa->priv_key=BN_bin2bn(dsa1024_priv,sizeof(dsa1024_priv),NULL);
|
||||||
dsa->priv_key = BN_bin2bn(dsa1024_priv, sizeof(dsa1024_priv), NULL);
|
dsa->pub_key=BN_bin2bn(dsa1024_pub,sizeof(dsa1024_pub),NULL);
|
||||||
dsa->pub_key = BN_bin2bn(dsa1024_pub, sizeof(dsa1024_pub), NULL);
|
dsa->p=BN_bin2bn(dsa1024_p,sizeof(dsa1024_p),NULL);
|
||||||
dsa->p = BN_bin2bn(dsa1024_p, sizeof(dsa1024_p), NULL);
|
dsa->q=BN_bin2bn(dsa1024_q,sizeof(dsa1024_q),NULL);
|
||||||
dsa->q = BN_bin2bn(dsa1024_q, sizeof(dsa1024_q), NULL);
|
dsa->g=BN_bin2bn(dsa1024_g,sizeof(dsa1024_g),NULL);
|
||||||
dsa->g = BN_bin2bn(dsa1024_g, sizeof(dsa1024_g), NULL);
|
if ((dsa->priv_key == NULL) || (dsa->pub_key == NULL) || (dsa->p == NULL) ||
|
||||||
if ((dsa->priv_key == NULL) || (dsa->pub_key == NULL) || (dsa->p == NULL)
|
(dsa->q == NULL) || (dsa->g == NULL))
|
||||||
|| (dsa->q == NULL) || (dsa->g == NULL))
|
return(NULL);
|
||||||
return (NULL);
|
return(dsa);
|
||||||
return (dsa);
|
}
|
||||||
}
|
|
||||||
|
|
||||||
static unsigned char dsa2048_priv[] = {
|
static unsigned char dsa2048_priv[]={
|
||||||
0x32, 0x67, 0x92, 0xf6, 0xc4, 0xe2, 0xe2, 0xe8, 0xa0, 0x8b, 0x6b, 0x45,
|
0x32,0x67,0x92,0xf6,0xc4,0xe2,0xe2,0xe8,0xa0,0x8b,0x6b,0x45,
|
||||||
0x0c, 0x8a, 0x76, 0xb0, 0xee, 0xcf, 0x91, 0xa7,
|
0x0c,0x8a,0x76,0xb0,0xee,0xcf,0x91,0xa7,
|
||||||
};
|
};
|
||||||
|
static unsigned char dsa2048_pub[]={
|
||||||
static unsigned char dsa2048_pub[] = {
|
0x17,0x8f,0xa8,0x11,0x84,0x92,0xec,0x83,0x47,0xc7,0x6a,0xb0,
|
||||||
0x17, 0x8f, 0xa8, 0x11, 0x84, 0x92, 0xec, 0x83, 0x47, 0xc7, 0x6a, 0xb0,
|
0x92,0xaf,0x5a,0x20,0x37,0xa3,0x64,0x79,0xd2,0xd0,0x3d,0xcd,
|
||||||
0x92, 0xaf, 0x5a, 0x20, 0x37, 0xa3, 0x64, 0x79, 0xd2, 0xd0, 0x3d, 0xcd,
|
0xe0,0x61,0x88,0x88,0x21,0xcc,0x74,0x5d,0xce,0x4c,0x51,0x47,
|
||||||
0xe0, 0x61, 0x88, 0x88, 0x21, 0xcc, 0x74, 0x5d, 0xce, 0x4c, 0x51, 0x47,
|
0xf0,0xc5,0x5c,0x4c,0x82,0x7a,0xaf,0x72,0xad,0xb9,0xe0,0x53,
|
||||||
0xf0, 0xc5, 0x5c, 0x4c, 0x82, 0x7a, 0xaf, 0x72, 0xad, 0xb9, 0xe0, 0x53,
|
0xf2,0x78,0xb7,0xf0,0xb5,0x48,0x7f,0x8a,0x3a,0x18,0xd1,0x9f,
|
||||||
0xf2, 0x78, 0xb7, 0xf0, 0xb5, 0x48, 0x7f, 0x8a, 0x3a, 0x18, 0xd1, 0x9f,
|
0x8b,0x7d,0xa5,0x47,0xb7,0x95,0xab,0x98,0xf8,0x7b,0x74,0x50,
|
||||||
0x8b, 0x7d, 0xa5, 0x47, 0xb7, 0x95, 0xab, 0x98, 0xf8, 0x7b, 0x74, 0x50,
|
0x56,0x8e,0x57,0xf0,0xee,0xf5,0xb7,0xba,0xab,0x85,0x86,0xf9,
|
||||||
0x56, 0x8e, 0x57, 0xf0, 0xee, 0xf5, 0xb7, 0xba, 0xab, 0x85, 0x86, 0xf9,
|
0x2b,0xef,0x41,0x56,0xa0,0xa4,0x9f,0xb7,0x38,0x00,0x46,0x0a,
|
||||||
0x2b, 0xef, 0x41, 0x56, 0xa0, 0xa4, 0x9f, 0xb7, 0x38, 0x00, 0x46, 0x0a,
|
0xa6,0xf1,0xfc,0x1f,0xd8,0x4e,0x85,0x44,0x92,0x43,0x21,0x5d,
|
||||||
0xa6, 0xf1, 0xfc, 0x1f, 0xd8, 0x4e, 0x85, 0x44, 0x92, 0x43, 0x21, 0x5d,
|
0x6e,0xcc,0xc2,0xcb,0x26,0x31,0x0d,0x21,0xc4,0xbd,0x8d,0x24,
|
||||||
0x6e, 0xcc, 0xc2, 0xcb, 0x26, 0x31, 0x0d, 0x21, 0xc4, 0xbd, 0x8d, 0x24,
|
0xbc,0xd9,0x18,0x19,0xd7,0xdc,0xf1,0xe7,0x93,0x50,0x48,0x03,
|
||||||
0xbc, 0xd9, 0x18, 0x19, 0xd7, 0xdc, 0xf1, 0xe7, 0x93, 0x50, 0x48, 0x03,
|
0x2c,0xae,0x2e,0xe7,0x49,0x88,0x5f,0x93,0x57,0x27,0x99,0x36,
|
||||||
0x2c, 0xae, 0x2e, 0xe7, 0x49, 0x88, 0x5f, 0x93, 0x57, 0x27, 0x99, 0x36,
|
0xb4,0x20,0xab,0xfc,0xa7,0x2b,0xf2,0xd9,0x98,0xd7,0xd4,0x34,
|
||||||
0xb4, 0x20, 0xab, 0xfc, 0xa7, 0x2b, 0xf2, 0xd9, 0x98, 0xd7, 0xd4, 0x34,
|
0x9d,0x96,0x50,0x58,0x9a,0xea,0x54,0xf3,0xee,0xf5,0x63,0x14,
|
||||||
0x9d, 0x96, 0x50, 0x58, 0x9a, 0xea, 0x54, 0xf3, 0xee, 0xf5, 0x63, 0x14,
|
0xee,0x85,0x83,0x74,0x76,0xe1,0x52,0x95,0xc3,0xf7,0xeb,0x04,
|
||||||
0xee, 0x85, 0x83, 0x74, 0x76, 0xe1, 0x52, 0x95, 0xc3, 0xf7, 0xeb, 0x04,
|
0x04,0x7b,0xa7,0x28,0x1b,0xcc,0xea,0x4a,0x4e,0x84,0xda,0xd8,
|
||||||
0x04, 0x7b, 0xa7, 0x28, 0x1b, 0xcc, 0xea, 0x4a, 0x4e, 0x84, 0xda, 0xd8,
|
0x9c,0x79,0xd8,0x9b,0x66,0x89,0x2f,0xcf,0xac,0xd7,0x79,0xf9,
|
||||||
0x9c, 0x79, 0xd8, 0x9b, 0x66, 0x89, 0x2f, 0xcf, 0xac, 0xd7, 0x79, 0xf9,
|
0xa9,0xd8,0x45,0x13,0x78,0xb9,0x00,0x14,0xc9,0x7e,0x22,0x51,
|
||||||
0xa9, 0xd8, 0x45, 0x13, 0x78, 0xb9, 0x00, 0x14, 0xc9, 0x7e, 0x22, 0x51,
|
0x86,0x67,0xb0,0x9f,0x26,0x11,0x23,0xc8,0x38,0xd7,0x70,0x1d,
|
||||||
0x86, 0x67, 0xb0, 0x9f, 0x26, 0x11, 0x23, 0xc8, 0x38, 0xd7, 0x70, 0x1d,
|
0x15,0x8e,0x4d,0x4f,0x95,0x97,0x40,0xa1,0xc2,0x7e,0x01,0x18,
|
||||||
0x15, 0x8e, 0x4d, 0x4f, 0x95, 0x97, 0x40, 0xa1, 0xc2, 0x7e, 0x01, 0x18,
|
0x72,0xf4,0x10,0xe6,0x8d,0x52,0x16,0x7f,0xf2,0xc9,0xf8,0x33,
|
||||||
0x72, 0xf4, 0x10, 0xe6, 0x8d, 0x52, 0x16, 0x7f, 0xf2, 0xc9, 0xf8, 0x33,
|
0x8b,0x33,0xb7,0xce,
|
||||||
0x8b, 0x33, 0xb7, 0xce,
|
};
|
||||||
};
|
static unsigned char dsa2048_p[]={
|
||||||
|
0xA0,0x25,0xFA,0xAD,0xF4,0x8E,0xB9,0xE5,0x99,0xF3,0x5D,0x6F,
|
||||||
static unsigned char dsa2048_p[] = {
|
0x4F,0x83,0x34,0xE2,0x7E,0xCF,0x6F,0xBF,0x30,0xAF,0x6F,0x81,
|
||||||
0xA0, 0x25, 0xFA, 0xAD, 0xF4, 0x8E, 0xB9, 0xE5, 0x99, 0xF3, 0x5D, 0x6F,
|
0xEB,0xF8,0xC4,0x13,0xD9,0xA0,0x5D,0x8B,0x5C,0x8E,0xDC,0xC2,
|
||||||
0x4F, 0x83, 0x34, 0xE2, 0x7E, 0xCF, 0x6F, 0xBF, 0x30, 0xAF, 0x6F, 0x81,
|
0x1D,0x0B,0x41,0x32,0xB0,0x1F,0xFE,0xEF,0x0C,0xC2,0xA2,0x7E,
|
||||||
0xEB, 0xF8, 0xC4, 0x13, 0xD9, 0xA0, 0x5D, 0x8B, 0x5C, 0x8E, 0xDC, 0xC2,
|
0x68,0x5C,0x28,0x21,0xE9,0xF5,0xB1,0x58,0x12,0x63,0x4C,0x19,
|
||||||
0x1D, 0x0B, 0x41, 0x32, 0xB0, 0x1F, 0xFE, 0xEF, 0x0C, 0xC2, 0xA2, 0x7E,
|
0x4E,0xFF,0x02,0x4B,0x92,0xED,0xD2,0x07,0x11,0x4D,0x8C,0x58,
|
||||||
0x68, 0x5C, 0x28, 0x21, 0xE9, 0xF5, 0xB1, 0x58, 0x12, 0x63, 0x4C, 0x19,
|
0x16,0x5C,0x55,0x8E,0xAD,0xA3,0x67,0x7D,0xB9,0x86,0x6E,0x0B,
|
||||||
0x4E, 0xFF, 0x02, 0x4B, 0x92, 0xED, 0xD2, 0x07, 0x11, 0x4D, 0x8C, 0x58,
|
0xE6,0x54,0x6F,0x40,0xAE,0x0E,0x67,0x4C,0xF9,0x12,0x5B,0x3C,
|
||||||
0x16, 0x5C, 0x55, 0x8E, 0xAD, 0xA3, 0x67, 0x7D, 0xB9, 0x86, 0x6E, 0x0B,
|
0x08,0x7A,0xF7,0xFC,0x67,0x86,0x69,0xE7,0x0A,0x94,0x40,0xBF,
|
||||||
0xE6, 0x54, 0x6F, 0x40, 0xAE, 0x0E, 0x67, 0x4C, 0xF9, 0x12, 0x5B, 0x3C,
|
0x8B,0x76,0xFE,0x26,0xD1,0xF2,0xA1,0x1A,0x84,0xA1,0x43,0x56,
|
||||||
0x08, 0x7A, 0xF7, 0xFC, 0x67, 0x86, 0x69, 0xE7, 0x0A, 0x94, 0x40, 0xBF,
|
0x28,0xBC,0x9A,0x5F,0xD7,0x3B,0x69,0x89,0x8A,0x36,0x2C,0x51,
|
||||||
0x8B, 0x76, 0xFE, 0x26, 0xD1, 0xF2, 0xA1, 0x1A, 0x84, 0xA1, 0x43, 0x56,
|
0xDF,0x12,0x77,0x2F,0x57,0x7B,0xA0,0xAA,0xDD,0x7F,0xA1,0x62,
|
||||||
0x28, 0xBC, 0x9A, 0x5F, 0xD7, 0x3B, 0x69, 0x89, 0x8A, 0x36, 0x2C, 0x51,
|
0x3B,0x40,0x7B,0x68,0x1A,0x8F,0x0D,0x38,0xBB,0x21,0x5D,0x18,
|
||||||
0xDF, 0x12, 0x77, 0x2F, 0x57, 0x7B, 0xA0, 0xAA, 0xDD, 0x7F, 0xA1, 0x62,
|
0xFC,0x0F,0x46,0xF7,0xA3,0xB0,0x1D,0x23,0xC3,0xD2,0xC7,0x72,
|
||||||
0x3B, 0x40, 0x7B, 0x68, 0x1A, 0x8F, 0x0D, 0x38, 0xBB, 0x21, 0x5D, 0x18,
|
0x51,0x18,0xDF,0x46,0x95,0x79,0xD9,0xBD,0xB5,0x19,0x02,0x2C,
|
||||||
0xFC, 0x0F, 0x46, 0xF7, 0xA3, 0xB0, 0x1D, 0x23, 0xC3, 0xD2, 0xC7, 0x72,
|
0x87,0xDC,0xE7,0x57,0x82,0x7E,0xF1,0x8B,0x06,0x3D,0x00,0xA5,
|
||||||
0x51, 0x18, 0xDF, 0x46, 0x95, 0x79, 0xD9, 0xBD, 0xB5, 0x19, 0x02, 0x2C,
|
0x7B,0x6B,0x26,0x27,0x91,0x0F,0x6A,0x77,0xE4,0xD5,0x04,0xE4,
|
||||||
0x87, 0xDC, 0xE7, 0x57, 0x82, 0x7E, 0xF1, 0x8B, 0x06, 0x3D, 0x00, 0xA5,
|
0x12,0x2C,0x42,0xFF,0xD2,0x88,0xBB,0xD3,0x92,0xA0,0xF9,0xC8,
|
||||||
0x7B, 0x6B, 0x26, 0x27, 0x91, 0x0F, 0x6A, 0x77, 0xE4, 0xD5, 0x04, 0xE4,
|
0x51,0x64,0x14,0x5C,0xD8,0xF9,0x6C,0x47,0x82,0xB4,0x1C,0x7F,
|
||||||
0x12, 0x2C, 0x42, 0xFF, 0xD2, 0x88, 0xBB, 0xD3, 0x92, 0xA0, 0xF9, 0xC8,
|
0x09,0xB8,0xF0,0x25,0x83,0x1D,0x3F,0x3F,0x05,0xB3,0x21,0x0A,
|
||||||
0x51, 0x64, 0x14, 0x5C, 0xD8, 0xF9, 0x6C, 0x47, 0x82, 0xB4, 0x1C, 0x7F,
|
0x5D,0xA7,0xD8,0x54,0xC3,0x65,0x7D,0xC3,0xB0,0x1D,0xBF,0xAE,
|
||||||
0x09, 0xB8, 0xF0, 0x25, 0x83, 0x1D, 0x3F, 0x3F, 0x05, 0xB3, 0x21, 0x0A,
|
0xF8,0x68,0xCF,0x9B,
|
||||||
0x5D, 0xA7, 0xD8, 0x54, 0xC3, 0x65, 0x7D, 0xC3, 0xB0, 0x1D, 0xBF, 0xAE,
|
};
|
||||||
0xF8, 0x68, 0xCF, 0x9B,
|
static unsigned char dsa2048_q[]={
|
||||||
};
|
0x97,0xE7,0x33,0x4D,0xD3,0x94,0x3E,0x0B,0xDB,0x62,0x74,0xC6,
|
||||||
|
0xA1,0x08,0xDD,0x19,0xA3,0x75,0x17,0x1B,
|
||||||
static unsigned char dsa2048_q[] = {
|
};
|
||||||
0x97, 0xE7, 0x33, 0x4D, 0xD3, 0x94, 0x3E, 0x0B, 0xDB, 0x62, 0x74, 0xC6,
|
static unsigned char dsa2048_g[]={
|
||||||
0xA1, 0x08, 0xDD, 0x19, 0xA3, 0x75, 0x17, 0x1B,
|
0x2C,0x78,0x16,0x59,0x34,0x63,0xF4,0xF3,0x92,0xFC,0xB5,0xA5,
|
||||||
};
|
0x4F,0x13,0xDE,0x2F,0x1C,0xA4,0x3C,0xAE,0xAD,0x38,0x3F,0x7E,
|
||||||
|
0x90,0xBF,0x96,0xA6,0xAE,0x25,0x90,0x72,0xF5,0x8E,0x80,0x0C,
|
||||||
static unsigned char dsa2048_g[] = {
|
0x39,0x1C,0xD9,0xEC,0xBA,0x90,0x5B,0x3A,0xE8,0x58,0x6C,0x9E,
|
||||||
0x2C, 0x78, 0x16, 0x59, 0x34, 0x63, 0xF4, 0xF3, 0x92, 0xFC, 0xB5, 0xA5,
|
0x30,0x42,0x37,0x02,0x31,0x82,0xBC,0x6A,0xDF,0x6A,0x09,0x29,
|
||||||
0x4F, 0x13, 0xDE, 0x2F, 0x1C, 0xA4, 0x3C, 0xAE, 0xAD, 0x38, 0x3F, 0x7E,
|
0xE3,0xC0,0x46,0xD1,0xCB,0x85,0xEC,0x0C,0x30,0x5E,0xEA,0xC8,
|
||||||
0x90, 0xBF, 0x96, 0xA6, 0xAE, 0x25, 0x90, 0x72, 0xF5, 0x8E, 0x80, 0x0C,
|
0x39,0x8E,0x22,0x9F,0x22,0x10,0xD2,0x34,0x61,0x68,0x37,0x3D,
|
||||||
0x39, 0x1C, 0xD9, 0xEC, 0xBA, 0x90, 0x5B, 0x3A, 0xE8, 0x58, 0x6C, 0x9E,
|
0x2E,0x4A,0x5B,0x9A,0xF5,0xC1,0x48,0xC6,0xF6,0xDC,0x63,0x1A,
|
||||||
0x30, 0x42, 0x37, 0x02, 0x31, 0x82, 0xBC, 0x6A, 0xDF, 0x6A, 0x09, 0x29,
|
0xD3,0x96,0x64,0xBA,0x34,0xC9,0xD1,0xA0,0xD1,0xAE,0x6C,0x2F,
|
||||||
0xE3, 0xC0, 0x46, 0xD1, 0xCB, 0x85, 0xEC, 0x0C, 0x30, 0x5E, 0xEA, 0xC8,
|
0x48,0x17,0x93,0x14,0x43,0xED,0xF0,0x21,0x30,0x19,0xC3,0x1B,
|
||||||
0x39, 0x8E, 0x22, 0x9F, 0x22, 0x10, 0xD2, 0x34, 0x61, 0x68, 0x37, 0x3D,
|
0x5F,0xDE,0xA3,0xF0,0x70,0x78,0x18,0xE1,0xA8,0xE4,0xEE,0x2E,
|
||||||
0x2E, 0x4A, 0x5B, 0x9A, 0xF5, 0xC1, 0x48, 0xC6, 0xF6, 0xDC, 0x63, 0x1A,
|
0x00,0xA5,0xE4,0xB3,0x17,0xC8,0x0C,0x7D,0x6E,0x42,0xDC,0xB7,
|
||||||
0xD3, 0x96, 0x64, 0xBA, 0x34, 0xC9, 0xD1, 0xA0, 0xD1, 0xAE, 0x6C, 0x2F,
|
0x46,0x00,0x36,0x4D,0xD4,0x46,0xAA,0x3D,0x3C,0x46,0x89,0x40,
|
||||||
0x48, 0x17, 0x93, 0x14, 0x43, 0xED, 0xF0, 0x21, 0x30, 0x19, 0xC3, 0x1B,
|
0xBF,0x1D,0x84,0x77,0x0A,0x75,0xF3,0x87,0x1D,0x08,0x4C,0xA6,
|
||||||
0x5F, 0xDE, 0xA3, 0xF0, 0x70, 0x78, 0x18, 0xE1, 0xA8, 0xE4, 0xEE, 0x2E,
|
0xD1,0xA9,0x1C,0x1E,0x12,0x1E,0xE1,0xC7,0x30,0x28,0x76,0xA5,
|
||||||
0x00, 0xA5, 0xE4, 0xB3, 0x17, 0xC8, 0x0C, 0x7D, 0x6E, 0x42, 0xDC, 0xB7,
|
0x7F,0x6C,0x85,0x96,0x2B,0x6F,0xDB,0x80,0x66,0x26,0xAE,0xF5,
|
||||||
0x46, 0x00, 0x36, 0x4D, 0xD4, 0x46, 0xAA, 0x3D, 0x3C, 0x46, 0x89, 0x40,
|
0x93,0xC7,0x8E,0xAE,0x9A,0xED,0xE4,0xCA,0x04,0xEA,0x3B,0x72,
|
||||||
0xBF, 0x1D, 0x84, 0x77, 0x0A, 0x75, 0xF3, 0x87, 0x1D, 0x08, 0x4C, 0xA6,
|
0xEF,0xDC,0x87,0xED,0x0D,0xA5,0x4C,0x4A,0xDD,0x71,0x22,0x64,
|
||||||
0xD1, 0xA9, 0x1C, 0x1E, 0x12, 0x1E, 0xE1, 0xC7, 0x30, 0x28, 0x76, 0xA5,
|
0x59,0x69,0x4E,0x8E,0xBF,0x43,0xDC,0xAB,0x8E,0x66,0xBB,0x01,
|
||||||
0x7F, 0x6C, 0x85, 0x96, 0x2B, 0x6F, 0xDB, 0x80, 0x66, 0x26, 0xAE, 0xF5,
|
0xB6,0xF4,0xE7,0xFD,0xD2,0xAD,0x9F,0x36,0xC1,0xA0,0x29,0x99,
|
||||||
0x93, 0xC7, 0x8E, 0xAE, 0x9A, 0xED, 0xE4, 0xCA, 0x04, 0xEA, 0x3B, 0x72,
|
0xD1,0x96,0x70,0x59,0x06,0x78,0x35,0xBD,0x65,0x55,0x52,0x9E,
|
||||||
0xEF, 0xDC, 0x87, 0xED, 0x0D, 0xA5, 0x4C, 0x4A, 0xDD, 0x71, 0x22, 0x64,
|
0xF8,0xB2,0xE5,0x38,
|
||||||
0x59, 0x69, 0x4E, 0x8E, 0xBF, 0x43, 0xDC, 0xAB, 0x8E, 0x66, 0xBB, 0x01,
|
};
|
||||||
0xB6, 0xF4, 0xE7, 0xFD, 0xD2, 0xAD, 0x9F, 0x36, 0xC1, 0xA0, 0x29, 0x99,
|
|
||||||
0xD1, 0x96, 0x70, 0x59, 0x06, 0x78, 0x35, 0xBD, 0x65, 0x55, 0x52, 0x9E,
|
|
||||||
0xF8, 0xB2, 0xE5, 0x38,
|
|
||||||
};
|
|
||||||
|
|
||||||
DSA *get_dsa2048()
|
DSA *get_dsa2048()
|
||||||
{
|
{
|
||||||
DSA *dsa;
|
DSA *dsa;
|
||||||
|
|
||||||
if ((dsa = DSA_new()) == NULL)
|
if ((dsa=DSA_new()) == NULL) return(NULL);
|
||||||
return (NULL);
|
dsa->priv_key=BN_bin2bn(dsa2048_priv,sizeof(dsa2048_priv),NULL);
|
||||||
dsa->priv_key = BN_bin2bn(dsa2048_priv, sizeof(dsa2048_priv), NULL);
|
dsa->pub_key=BN_bin2bn(dsa2048_pub,sizeof(dsa2048_pub),NULL);
|
||||||
dsa->pub_key = BN_bin2bn(dsa2048_pub, sizeof(dsa2048_pub), NULL);
|
dsa->p=BN_bin2bn(dsa2048_p,sizeof(dsa2048_p),NULL);
|
||||||
dsa->p = BN_bin2bn(dsa2048_p, sizeof(dsa2048_p), NULL);
|
dsa->q=BN_bin2bn(dsa2048_q,sizeof(dsa2048_q),NULL);
|
||||||
dsa->q = BN_bin2bn(dsa2048_q, sizeof(dsa2048_q), NULL);
|
dsa->g=BN_bin2bn(dsa2048_g,sizeof(dsa2048_g),NULL);
|
||||||
dsa->g = BN_bin2bn(dsa2048_g, sizeof(dsa2048_g), NULL);
|
if ((dsa->priv_key == NULL) || (dsa->pub_key == NULL) || (dsa->p == NULL) ||
|
||||||
if ((dsa->priv_key == NULL) || (dsa->pub_key == NULL) || (dsa->p == NULL)
|
(dsa->q == NULL) || (dsa->g == NULL))
|
||||||
|| (dsa->q == NULL) || (dsa->g == NULL))
|
return(NULL);
|
||||||
return (NULL);
|
return(dsa);
|
||||||
return (dsa);
|
}
|
||||||
}
|
|
||||||
|
|
||||||
static const char rnd_seed[] =
|
static const char rnd_seed[] = "string to make the random number generator think it has entropy";
|
||||||
"string to make the random number generator think it has entropy";
|
|
||||||
static int rnd_fake = 0;
|
static int rnd_fake = 0;
|
||||||
|
|||||||
912
apps/testrsa.h
912
apps/testrsa.h
@@ -57,462 +57,462 @@
|
|||||||
* [including the GNU Public Licence.]
|
* [including the GNU Public Licence.]
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static unsigned char test512[] = {
|
static unsigned char test512[]={
|
||||||
0x30, 0x82, 0x01, 0x3a, 0x02, 0x01, 0x00, 0x02, 0x41, 0x00,
|
0x30,0x82,0x01,0x3a,0x02,0x01,0x00,0x02,0x41,0x00,
|
||||||
0xd6, 0x33, 0xb9, 0xc8, 0xfb, 0x4f, 0x3c, 0x7d, 0xc0, 0x01,
|
0xd6,0x33,0xb9,0xc8,0xfb,0x4f,0x3c,0x7d,0xc0,0x01,
|
||||||
0x86, 0xd0, 0xe7, 0xa0, 0x55, 0xf2, 0x95, 0x93, 0xcc, 0x4f,
|
0x86,0xd0,0xe7,0xa0,0x55,0xf2,0x95,0x93,0xcc,0x4f,
|
||||||
0xb7, 0x5b, 0x67, 0x5b, 0x94, 0x68, 0xc9, 0x34, 0x15, 0xde,
|
0xb7,0x5b,0x67,0x5b,0x94,0x68,0xc9,0x34,0x15,0xde,
|
||||||
0xa5, 0x2e, 0x1c, 0x33, 0xc2, 0x6e, 0xfc, 0x34, 0x5e, 0x71,
|
0xa5,0x2e,0x1c,0x33,0xc2,0x6e,0xfc,0x34,0x5e,0x71,
|
||||||
0x13, 0xb7, 0xd6, 0xee, 0xd8, 0xa5, 0x65, 0x05, 0x72, 0x87,
|
0x13,0xb7,0xd6,0xee,0xd8,0xa5,0x65,0x05,0x72,0x87,
|
||||||
0xa8, 0xb0, 0x77, 0xfe, 0x57, 0xf5, 0xfc, 0x5f, 0x55, 0x83,
|
0xa8,0xb0,0x77,0xfe,0x57,0xf5,0xfc,0x5f,0x55,0x83,
|
||||||
0x87, 0xdd, 0x57, 0x49, 0x02, 0x03, 0x01, 0x00, 0x01, 0x02,
|
0x87,0xdd,0x57,0x49,0x02,0x03,0x01,0x00,0x01,0x02,
|
||||||
0x41, 0x00, 0xa7, 0xf7, 0x91, 0xc5, 0x0f, 0x84, 0x57, 0xdc,
|
0x41,0x00,0xa7,0xf7,0x91,0xc5,0x0f,0x84,0x57,0xdc,
|
||||||
0x07, 0xf7, 0x6a, 0x7f, 0x60, 0x52, 0xb3, 0x72, 0xf1, 0x66,
|
0x07,0xf7,0x6a,0x7f,0x60,0x52,0xb3,0x72,0xf1,0x66,
|
||||||
0x1f, 0x7d, 0x97, 0x3b, 0x9e, 0xb6, 0x0a, 0x8f, 0x8c, 0xcf,
|
0x1f,0x7d,0x97,0x3b,0x9e,0xb6,0x0a,0x8f,0x8c,0xcf,
|
||||||
0x42, 0x23, 0x00, 0x04, 0xd4, 0x28, 0x0e, 0x1c, 0x90, 0xc4,
|
0x42,0x23,0x00,0x04,0xd4,0x28,0x0e,0x1c,0x90,0xc4,
|
||||||
0x11, 0x25, 0x25, 0xa5, 0x93, 0xa5, 0x2f, 0x70, 0x02, 0xdf,
|
0x11,0x25,0x25,0xa5,0x93,0xa5,0x2f,0x70,0x02,0xdf,
|
||||||
0x81, 0x9c, 0x49, 0x03, 0xa0, 0xf8, 0x6d, 0x54, 0x2e, 0x26,
|
0x81,0x9c,0x49,0x03,0xa0,0xf8,0x6d,0x54,0x2e,0x26,
|
||||||
0xde, 0xaa, 0x85, 0x59, 0xa8, 0x31, 0x02, 0x21, 0x00, 0xeb,
|
0xde,0xaa,0x85,0x59,0xa8,0x31,0x02,0x21,0x00,0xeb,
|
||||||
0x47, 0xd7, 0x3b, 0xf6, 0xc3, 0xdd, 0x5a, 0x46, 0xc5, 0xb9,
|
0x47,0xd7,0x3b,0xf6,0xc3,0xdd,0x5a,0x46,0xc5,0xb9,
|
||||||
0x2b, 0x9a, 0xa0, 0x09, 0x8f, 0xa6, 0xfb, 0xf3, 0x78, 0x7a,
|
0x2b,0x9a,0xa0,0x09,0x8f,0xa6,0xfb,0xf3,0x78,0x7a,
|
||||||
0x33, 0x70, 0x9d, 0x0f, 0x42, 0x6b, 0x13, 0x68, 0x24, 0xd3,
|
0x33,0x70,0x9d,0x0f,0x42,0x6b,0x13,0x68,0x24,0xd3,
|
||||||
0x15, 0x02, 0x21, 0x00, 0xe9, 0x10, 0xb0, 0xb3, 0x0d, 0xe2,
|
0x15,0x02,0x21,0x00,0xe9,0x10,0xb0,0xb3,0x0d,0xe2,
|
||||||
0x82, 0x68, 0x77, 0x8a, 0x6e, 0x7c, 0xda, 0xbc, 0x3e, 0x53,
|
0x82,0x68,0x77,0x8a,0x6e,0x7c,0xda,0xbc,0x3e,0x53,
|
||||||
0x83, 0xfb, 0xd6, 0x22, 0xe7, 0xb5, 0xae, 0x6e, 0x80, 0xda,
|
0x83,0xfb,0xd6,0x22,0xe7,0xb5,0xae,0x6e,0x80,0xda,
|
||||||
0x00, 0x55, 0x97, 0xc1, 0xd0, 0x65, 0x02, 0x20, 0x4c, 0xf8,
|
0x00,0x55,0x97,0xc1,0xd0,0x65,0x02,0x20,0x4c,0xf8,
|
||||||
0x73, 0xb1, 0x6a, 0x49, 0x29, 0x61, 0x1f, 0x46, 0x10, 0x0d,
|
0x73,0xb1,0x6a,0x49,0x29,0x61,0x1f,0x46,0x10,0x0d,
|
||||||
0xf3, 0xc7, 0xe7, 0x58, 0xd7, 0x88, 0x15, 0x5e, 0x94, 0x9b,
|
0xf3,0xc7,0xe7,0x58,0xd7,0x88,0x15,0x5e,0x94,0x9b,
|
||||||
0xbf, 0x7b, 0xa2, 0x42, 0x58, 0x45, 0x41, 0x0c, 0xcb, 0x01,
|
0xbf,0x7b,0xa2,0x42,0x58,0x45,0x41,0x0c,0xcb,0x01,
|
||||||
0x02, 0x20, 0x12, 0x11, 0xba, 0x31, 0x57, 0x9d, 0x3d, 0x11,
|
0x02,0x20,0x12,0x11,0xba,0x31,0x57,0x9d,0x3d,0x11,
|
||||||
0x0e, 0x5b, 0x8c, 0x2f, 0x5f, 0xe2, 0x02, 0x4f, 0x05, 0x47,
|
0x0e,0x5b,0x8c,0x2f,0x5f,0xe2,0x02,0x4f,0x05,0x47,
|
||||||
0x8c, 0x15, 0x8e, 0xb3, 0x56, 0x3f, 0xb8, 0xfb, 0xad, 0xd4,
|
0x8c,0x15,0x8e,0xb3,0x56,0x3f,0xb8,0xfb,0xad,0xd4,
|
||||||
0xf4, 0xfc, 0x10, 0xc5, 0x02, 0x20, 0x18, 0xa1, 0x29, 0x99,
|
0xf4,0xfc,0x10,0xc5,0x02,0x20,0x18,0xa1,0x29,0x99,
|
||||||
0x5b, 0xd9, 0xc8, 0xd4, 0xfc, 0x49, 0x7a, 0x2a, 0x21, 0x2c,
|
0x5b,0xd9,0xc8,0xd4,0xfc,0x49,0x7a,0x2a,0x21,0x2c,
|
||||||
0x49, 0xe4, 0x4f, 0xeb, 0xef, 0x51, 0xf1, 0xab, 0x6d, 0xfb,
|
0x49,0xe4,0x4f,0xeb,0xef,0x51,0xf1,0xab,0x6d,0xfb,
|
||||||
0x4b, 0x14, 0xe9, 0x4b, 0x52, 0xb5, 0x82, 0x2c,
|
0x4b,0x14,0xe9,0x4b,0x52,0xb5,0x82,0x2c,
|
||||||
};
|
};
|
||||||
|
|
||||||
static unsigned char test1024[] = {
|
static unsigned char test1024[]={
|
||||||
0x30, 0x82, 0x02, 0x5c, 0x02, 0x01, 0x00, 0x02, 0x81, 0x81,
|
0x30,0x82,0x02,0x5c,0x02,0x01,0x00,0x02,0x81,0x81,
|
||||||
0x00, 0xdc, 0x98, 0x43, 0xe8, 0x3d, 0x43, 0x5b, 0xe4, 0x05,
|
0x00,0xdc,0x98,0x43,0xe8,0x3d,0x43,0x5b,0xe4,0x05,
|
||||||
0xcd, 0xd0, 0xa9, 0x3e, 0xcb, 0x83, 0x75, 0xf6, 0xb5, 0xa5,
|
0xcd,0xd0,0xa9,0x3e,0xcb,0x83,0x75,0xf6,0xb5,0xa5,
|
||||||
0x9f, 0x6b, 0xe9, 0x34, 0x41, 0x29, 0x18, 0xfa, 0x6a, 0x55,
|
0x9f,0x6b,0xe9,0x34,0x41,0x29,0x18,0xfa,0x6a,0x55,
|
||||||
0x4d, 0x70, 0xfc, 0xec, 0xae, 0x87, 0x38, 0x0a, 0x20, 0xa9,
|
0x4d,0x70,0xfc,0xec,0xae,0x87,0x38,0x0a,0x20,0xa9,
|
||||||
0xc0, 0x45, 0x77, 0x6e, 0x57, 0x60, 0x57, 0xf4, 0xed, 0x96,
|
0xc0,0x45,0x77,0x6e,0x57,0x60,0x57,0xf4,0xed,0x96,
|
||||||
0x22, 0xcb, 0x8f, 0xe1, 0x33, 0x3a, 0x17, 0x1f, 0xed, 0x37,
|
0x22,0xcb,0x8f,0xe1,0x33,0x3a,0x17,0x1f,0xed,0x37,
|
||||||
0xa5, 0x6f, 0xeb, 0xa6, 0xbc, 0x12, 0x80, 0x1d, 0x53, 0xbd,
|
0xa5,0x6f,0xeb,0xa6,0xbc,0x12,0x80,0x1d,0x53,0xbd,
|
||||||
0x70, 0xeb, 0x21, 0x76, 0x3e, 0xc9, 0x2f, 0x1a, 0x45, 0x24,
|
0x70,0xeb,0x21,0x76,0x3e,0xc9,0x2f,0x1a,0x45,0x24,
|
||||||
0x82, 0xff, 0xcd, 0x59, 0x32, 0x06, 0x2e, 0x12, 0x3b, 0x23,
|
0x82,0xff,0xcd,0x59,0x32,0x06,0x2e,0x12,0x3b,0x23,
|
||||||
0x78, 0xed, 0x12, 0x3d, 0xe0, 0x8d, 0xf9, 0x67, 0x4f, 0x37,
|
0x78,0xed,0x12,0x3d,0xe0,0x8d,0xf9,0x67,0x4f,0x37,
|
||||||
0x4e, 0x47, 0x02, 0x4c, 0x2d, 0xc0, 0x4f, 0x1f, 0xb3, 0x94,
|
0x4e,0x47,0x02,0x4c,0x2d,0xc0,0x4f,0x1f,0xb3,0x94,
|
||||||
0xe1, 0x41, 0x2e, 0x2d, 0x90, 0x10, 0xfc, 0x82, 0x91, 0x8b,
|
0xe1,0x41,0x2e,0x2d,0x90,0x10,0xfc,0x82,0x91,0x8b,
|
||||||
0x0f, 0x22, 0xd4, 0xf2, 0xfc, 0x2c, 0xab, 0x53, 0x55, 0x02,
|
0x0f,0x22,0xd4,0xf2,0xfc,0x2c,0xab,0x53,0x55,0x02,
|
||||||
0x03, 0x01, 0x00, 0x01, 0x02, 0x81, 0x80, 0x2b, 0xcc, 0x3f,
|
0x03,0x01,0x00,0x01,0x02,0x81,0x80,0x2b,0xcc,0x3f,
|
||||||
0x8f, 0x58, 0xba, 0x8b, 0x00, 0x16, 0xf6, 0xea, 0x3a, 0xf0,
|
0x8f,0x58,0xba,0x8b,0x00,0x16,0xf6,0xea,0x3a,0xf0,
|
||||||
0x30, 0xd0, 0x05, 0x17, 0xda, 0xb0, 0xeb, 0x9a, 0x2d, 0x4f,
|
0x30,0xd0,0x05,0x17,0xda,0xb0,0xeb,0x9a,0x2d,0x4f,
|
||||||
0x26, 0xb0, 0xd6, 0x38, 0xc1, 0xeb, 0xf5, 0xd8, 0x3d, 0x1f,
|
0x26,0xb0,0xd6,0x38,0xc1,0xeb,0xf5,0xd8,0x3d,0x1f,
|
||||||
0x70, 0xf7, 0x7f, 0xf4, 0xe2, 0xcf, 0x51, 0x51, 0x79, 0x88,
|
0x70,0xf7,0x7f,0xf4,0xe2,0xcf,0x51,0x51,0x79,0x88,
|
||||||
0xfa, 0xe8, 0x32, 0x0e, 0x7b, 0x2d, 0x97, 0xf2, 0xfa, 0xba,
|
0xfa,0xe8,0x32,0x0e,0x7b,0x2d,0x97,0xf2,0xfa,0xba,
|
||||||
0x27, 0xc5, 0x9c, 0xd9, 0xc5, 0xeb, 0x8a, 0x79, 0x52, 0x3c,
|
0x27,0xc5,0x9c,0xd9,0xc5,0xeb,0x8a,0x79,0x52,0x3c,
|
||||||
0x64, 0x34, 0x7d, 0xc2, 0xcf, 0x28, 0xc7, 0x4e, 0xd5, 0x43,
|
0x64,0x34,0x7d,0xc2,0xcf,0x28,0xc7,0x4e,0xd5,0x43,
|
||||||
0x0b, 0xd1, 0xa6, 0xca, 0x6d, 0x03, 0x2d, 0x72, 0x23, 0xbc,
|
0x0b,0xd1,0xa6,0xca,0x6d,0x03,0x2d,0x72,0x23,0xbc,
|
||||||
0x6d, 0x05, 0xfa, 0x16, 0x09, 0x2f, 0x2e, 0x5c, 0xb6, 0xee,
|
0x6d,0x05,0xfa,0x16,0x09,0x2f,0x2e,0x5c,0xb6,0xee,
|
||||||
0x74, 0xdd, 0xd2, 0x48, 0x8e, 0x36, 0x0c, 0x06, 0x3d, 0x4d,
|
0x74,0xdd,0xd2,0x48,0x8e,0x36,0x0c,0x06,0x3d,0x4d,
|
||||||
0xe5, 0x10, 0x82, 0xeb, 0x6a, 0xf3, 0x4b, 0x9f, 0xd6, 0xed,
|
0xe5,0x10,0x82,0xeb,0x6a,0xf3,0x4b,0x9f,0xd6,0xed,
|
||||||
0x11, 0xb1, 0x6e, 0xec, 0xf4, 0xfe, 0x8e, 0x75, 0x94, 0x20,
|
0x11,0xb1,0x6e,0xec,0xf4,0xfe,0x8e,0x75,0x94,0x20,
|
||||||
0x2f, 0xcb, 0xac, 0x46, 0xf1, 0x02, 0x41, 0x00, 0xf9, 0x8c,
|
0x2f,0xcb,0xac,0x46,0xf1,0x02,0x41,0x00,0xf9,0x8c,
|
||||||
0xa3, 0x85, 0xb1, 0xdd, 0x29, 0xaf, 0x65, 0xc1, 0x33, 0xf3,
|
0xa3,0x85,0xb1,0xdd,0x29,0xaf,0x65,0xc1,0x33,0xf3,
|
||||||
0x95, 0xc5, 0x52, 0x68, 0x0b, 0xd4, 0xf1, 0xe5, 0x0e, 0x02,
|
0x95,0xc5,0x52,0x68,0x0b,0xd4,0xf1,0xe5,0x0e,0x02,
|
||||||
0x9f, 0x4f, 0xfa, 0x77, 0xdc, 0x46, 0x9e, 0xc7, 0xa6, 0xe4,
|
0x9f,0x4f,0xfa,0x77,0xdc,0x46,0x9e,0xc7,0xa6,0xe4,
|
||||||
0x16, 0x29, 0xda, 0xb0, 0x07, 0xcf, 0x5b, 0xa9, 0x12, 0x8a,
|
0x16,0x29,0xda,0xb0,0x07,0xcf,0x5b,0xa9,0x12,0x8a,
|
||||||
0xdd, 0x63, 0x0a, 0xde, 0x2e, 0x8c, 0x66, 0x8b, 0x8c, 0xdc,
|
0xdd,0x63,0x0a,0xde,0x2e,0x8c,0x66,0x8b,0x8c,0xdc,
|
||||||
0x19, 0xa3, 0x7e, 0xf4, 0x3b, 0xd0, 0x1a, 0x8c, 0xa4, 0xc2,
|
0x19,0xa3,0x7e,0xf4,0x3b,0xd0,0x1a,0x8c,0xa4,0xc2,
|
||||||
0xe1, 0xd3, 0x02, 0x41, 0x00, 0xe2, 0x4c, 0x05, 0xf2, 0x04,
|
0xe1,0xd3,0x02,0x41,0x00,0xe2,0x4c,0x05,0xf2,0x04,
|
||||||
0x86, 0x4e, 0x61, 0x43, 0xdb, 0xb0, 0xb9, 0x96, 0x86, 0x52,
|
0x86,0x4e,0x61,0x43,0xdb,0xb0,0xb9,0x96,0x86,0x52,
|
||||||
0x2c, 0xca, 0x8d, 0x7b, 0xab, 0x0b, 0x13, 0x0d, 0x7e, 0x38,
|
0x2c,0xca,0x8d,0x7b,0xab,0x0b,0x13,0x0d,0x7e,0x38,
|
||||||
0x5b, 0xe2, 0x2e, 0x7b, 0x0e, 0xe7, 0x19, 0x99, 0x38, 0xe7,
|
0x5b,0xe2,0x2e,0x7b,0x0e,0xe7,0x19,0x99,0x38,0xe7,
|
||||||
0xf2, 0x21, 0xbd, 0x85, 0x85, 0xe3, 0xfd, 0x28, 0x77, 0x20,
|
0xf2,0x21,0xbd,0x85,0x85,0xe3,0xfd,0x28,0x77,0x20,
|
||||||
0x31, 0x71, 0x2c, 0xd0, 0xff, 0xfb, 0x2e, 0xaf, 0x85, 0xb4,
|
0x31,0x71,0x2c,0xd0,0xff,0xfb,0x2e,0xaf,0x85,0xb4,
|
||||||
0x86, 0xca, 0xf3, 0xbb, 0xca, 0xaa, 0x0f, 0x95, 0x37, 0x02,
|
0x86,0xca,0xf3,0xbb,0xca,0xaa,0x0f,0x95,0x37,0x02,
|
||||||
0x40, 0x0e, 0x41, 0x9a, 0x95, 0xe8, 0xb3, 0x59, 0xce, 0x4b,
|
0x40,0x0e,0x41,0x9a,0x95,0xe8,0xb3,0x59,0xce,0x4b,
|
||||||
0x61, 0xde, 0x35, 0xec, 0x38, 0x79, 0x9c, 0xb8, 0x10, 0x52,
|
0x61,0xde,0x35,0xec,0x38,0x79,0x9c,0xb8,0x10,0x52,
|
||||||
0x41, 0x63, 0xab, 0x82, 0xae, 0x6f, 0x00, 0xa9, 0xf4, 0xde,
|
0x41,0x63,0xab,0x82,0xae,0x6f,0x00,0xa9,0xf4,0xde,
|
||||||
0xdd, 0x49, 0x0b, 0x7e, 0xb8, 0xa5, 0x65, 0xa9, 0x0c, 0x8f,
|
0xdd,0x49,0x0b,0x7e,0xb8,0xa5,0x65,0xa9,0x0c,0x8f,
|
||||||
0x8f, 0xf9, 0x1f, 0x35, 0xc6, 0x92, 0xb8, 0x5e, 0xb0, 0x66,
|
0x8f,0xf9,0x1f,0x35,0xc6,0x92,0xb8,0x5e,0xb0,0x66,
|
||||||
0xab, 0x52, 0x40, 0xc0, 0xb6, 0x36, 0x6a, 0x7d, 0x80, 0x46,
|
0xab,0x52,0x40,0xc0,0xb6,0x36,0x6a,0x7d,0x80,0x46,
|
||||||
0x04, 0x02, 0xe5, 0x9f, 0x41, 0x02, 0x41, 0x00, 0xc0, 0xad,
|
0x04,0x02,0xe5,0x9f,0x41,0x02,0x41,0x00,0xc0,0xad,
|
||||||
0xcc, 0x4e, 0x21, 0xee, 0x1d, 0x24, 0x91, 0xfb, 0xa7, 0x80,
|
0xcc,0x4e,0x21,0xee,0x1d,0x24,0x91,0xfb,0xa7,0x80,
|
||||||
0x8d, 0x9a, 0xb6, 0xb3, 0x2e, 0x8f, 0xc2, 0xe1, 0x82, 0xdf,
|
0x8d,0x9a,0xb6,0xb3,0x2e,0x8f,0xc2,0xe1,0x82,0xdf,
|
||||||
0x69, 0x18, 0xb4, 0x71, 0xff, 0xa6, 0x65, 0xde, 0xed, 0x84,
|
0x69,0x18,0xb4,0x71,0xff,0xa6,0x65,0xde,0xed,0x84,
|
||||||
0x8d, 0x42, 0xb7, 0xb3, 0x21, 0x69, 0x56, 0x1c, 0x07, 0x60,
|
0x8d,0x42,0xb7,0xb3,0x21,0x69,0x56,0x1c,0x07,0x60,
|
||||||
0x51, 0x29, 0x04, 0xff, 0x34, 0x06, 0xdd, 0xb9, 0x67, 0x2c,
|
0x51,0x29,0x04,0xff,0x34,0x06,0xdd,0xb9,0x67,0x2c,
|
||||||
0x7c, 0x04, 0x93, 0x0e, 0x46, 0x15, 0xbb, 0x2a, 0xb7, 0x1b,
|
0x7c,0x04,0x93,0x0e,0x46,0x15,0xbb,0x2a,0xb7,0x1b,
|
||||||
0xe7, 0x87, 0x02, 0x40, 0x78, 0xda, 0x5d, 0x07, 0x51, 0x0c,
|
0xe7,0x87,0x02,0x40,0x78,0xda,0x5d,0x07,0x51,0x0c,
|
||||||
0x16, 0x7a, 0x9f, 0x29, 0x20, 0x84, 0x0d, 0x42, 0xfa, 0xd7,
|
0x16,0x7a,0x9f,0x29,0x20,0x84,0x0d,0x42,0xfa,0xd7,
|
||||||
0x00, 0xd8, 0x77, 0x7e, 0xb0, 0xb0, 0x6b, 0xd6, 0x5b, 0x53,
|
0x00,0xd8,0x77,0x7e,0xb0,0xb0,0x6b,0xd6,0x5b,0x53,
|
||||||
0xb8, 0x9b, 0x7a, 0xcd, 0xc7, 0x2b, 0xb8, 0x6a, 0x63, 0xa9,
|
0xb8,0x9b,0x7a,0xcd,0xc7,0x2b,0xb8,0x6a,0x63,0xa9,
|
||||||
0xfb, 0x6f, 0xa4, 0x72, 0xbf, 0x4c, 0x5d, 0x00, 0x14, 0xba,
|
0xfb,0x6f,0xa4,0x72,0xbf,0x4c,0x5d,0x00,0x14,0xba,
|
||||||
0xfa, 0x59, 0x88, 0xed, 0xe4, 0xe0, 0x8c, 0xa2, 0xec, 0x14,
|
0xfa,0x59,0x88,0xed,0xe4,0xe0,0x8c,0xa2,0xec,0x14,
|
||||||
0x7e, 0x2d, 0xe2, 0xf0, 0x46, 0x49, 0x95, 0x45,
|
0x7e,0x2d,0xe2,0xf0,0x46,0x49,0x95,0x45,
|
||||||
};
|
};
|
||||||
|
|
||||||
static unsigned char test2048[] = {
|
static unsigned char test2048[]={
|
||||||
0x30, 0x82, 0x04, 0xa3, 0x02, 0x01, 0x00, 0x02, 0x82, 0x01,
|
0x30,0x82,0x04,0xa3,0x02,0x01,0x00,0x02,0x82,0x01,
|
||||||
0x01, 0x00, 0xc0, 0xc0, 0xce, 0x3e, 0x3c, 0x53, 0x67, 0x3f,
|
0x01,0x00,0xc0,0xc0,0xce,0x3e,0x3c,0x53,0x67,0x3f,
|
||||||
0x4f, 0xc5, 0x2f, 0xa4, 0xc2, 0x5a, 0x2f, 0x58, 0xfd, 0x27,
|
0x4f,0xc5,0x2f,0xa4,0xc2,0x5a,0x2f,0x58,0xfd,0x27,
|
||||||
0x52, 0x6a, 0xe8, 0xcf, 0x4a, 0x73, 0x47, 0x8d, 0x25, 0x0f,
|
0x52,0x6a,0xe8,0xcf,0x4a,0x73,0x47,0x8d,0x25,0x0f,
|
||||||
0x5f, 0x03, 0x26, 0x78, 0xef, 0xf0, 0x22, 0x12, 0xd3, 0xde,
|
0x5f,0x03,0x26,0x78,0xef,0xf0,0x22,0x12,0xd3,0xde,
|
||||||
0x47, 0xb2, 0x1c, 0x0b, 0x38, 0x63, 0x1a, 0x6c, 0x85, 0x7a,
|
0x47,0xb2,0x1c,0x0b,0x38,0x63,0x1a,0x6c,0x85,0x7a,
|
||||||
0x80, 0xc6, 0x8f, 0xa0, 0x41, 0xaf, 0x62, 0xc4, 0x67, 0x32,
|
0x80,0xc6,0x8f,0xa0,0x41,0xaf,0x62,0xc4,0x67,0x32,
|
||||||
0x88, 0xf8, 0xa6, 0x9c, 0xf5, 0x23, 0x1d, 0xe4, 0xac, 0x3f,
|
0x88,0xf8,0xa6,0x9c,0xf5,0x23,0x1d,0xe4,0xac,0x3f,
|
||||||
0x29, 0xf9, 0xec, 0xe1, 0x8b, 0x26, 0x03, 0x2c, 0xb2, 0xab,
|
0x29,0xf9,0xec,0xe1,0x8b,0x26,0x03,0x2c,0xb2,0xab,
|
||||||
0xf3, 0x7d, 0xb5, 0xca, 0x49, 0xc0, 0x8f, 0x1c, 0xdf, 0x33,
|
0xf3,0x7d,0xb5,0xca,0x49,0xc0,0x8f,0x1c,0xdf,0x33,
|
||||||
0x3a, 0x60, 0xda, 0x3c, 0xb0, 0x16, 0xf8, 0xa9, 0x12, 0x8f,
|
0x3a,0x60,0xda,0x3c,0xb0,0x16,0xf8,0xa9,0x12,0x8f,
|
||||||
0x64, 0xac, 0x23, 0x0c, 0x69, 0x64, 0x97, 0x5d, 0x99, 0xd4,
|
0x64,0xac,0x23,0x0c,0x69,0x64,0x97,0x5d,0x99,0xd4,
|
||||||
0x09, 0x83, 0x9b, 0x61, 0xd3, 0xac, 0xf0, 0xde, 0xdd, 0x5e,
|
0x09,0x83,0x9b,0x61,0xd3,0xac,0xf0,0xde,0xdd,0x5e,
|
||||||
0x9f, 0x44, 0x94, 0xdb, 0x3a, 0x4d, 0x97, 0xe8, 0x52, 0x29,
|
0x9f,0x44,0x94,0xdb,0x3a,0x4d,0x97,0xe8,0x52,0x29,
|
||||||
0xf7, 0xdb, 0x94, 0x07, 0x45, 0x90, 0x78, 0x1e, 0x31, 0x0b,
|
0xf7,0xdb,0x94,0x07,0x45,0x90,0x78,0x1e,0x31,0x0b,
|
||||||
0x80, 0xf7, 0x57, 0xad, 0x1c, 0x79, 0xc5, 0xcb, 0x32, 0xb0,
|
0x80,0xf7,0x57,0xad,0x1c,0x79,0xc5,0xcb,0x32,0xb0,
|
||||||
0xce, 0xcd, 0x74, 0xb3, 0xe2, 0x94, 0xc5, 0x78, 0x2f, 0x34,
|
0xce,0xcd,0x74,0xb3,0xe2,0x94,0xc5,0x78,0x2f,0x34,
|
||||||
0x1a, 0x45, 0xf7, 0x8c, 0x52, 0xa5, 0xbc, 0x8d, 0xec, 0xd1,
|
0x1a,0x45,0xf7,0x8c,0x52,0xa5,0xbc,0x8d,0xec,0xd1,
|
||||||
0x2f, 0x31, 0x3b, 0xf0, 0x49, 0x59, 0x5e, 0x88, 0x9d, 0x15,
|
0x2f,0x31,0x3b,0xf0,0x49,0x59,0x5e,0x88,0x9d,0x15,
|
||||||
0x92, 0x35, 0x32, 0xc1, 0xe7, 0x61, 0xec, 0x50, 0x48, 0x7c,
|
0x92,0x35,0x32,0xc1,0xe7,0x61,0xec,0x50,0x48,0x7c,
|
||||||
0xba, 0x05, 0xf9, 0xf8, 0xf8, 0xa7, 0x8c, 0x83, 0xe8, 0x66,
|
0xba,0x05,0xf9,0xf8,0xf8,0xa7,0x8c,0x83,0xe8,0x66,
|
||||||
0x5b, 0xeb, 0xfe, 0xd8, 0x4f, 0xdd, 0x6d, 0x36, 0xc0, 0xb2,
|
0x5b,0xeb,0xfe,0xd8,0x4f,0xdd,0x6d,0x36,0xc0,0xb2,
|
||||||
0x90, 0x0f, 0xb8, 0x52, 0xf9, 0x04, 0x9b, 0x40, 0x2c, 0x27,
|
0x90,0x0f,0xb8,0x52,0xf9,0x04,0x9b,0x40,0x2c,0x27,
|
||||||
0xd6, 0x36, 0x8e, 0xc2, 0x1b, 0x44, 0xf3, 0x92, 0xd5, 0x15,
|
0xd6,0x36,0x8e,0xc2,0x1b,0x44,0xf3,0x92,0xd5,0x15,
|
||||||
0x9e, 0x9a, 0xbc, 0xf3, 0x7d, 0x03, 0xd7, 0x02, 0x14, 0x20,
|
0x9e,0x9a,0xbc,0xf3,0x7d,0x03,0xd7,0x02,0x14,0x20,
|
||||||
0xe9, 0x10, 0x92, 0xfd, 0xf9, 0xfc, 0x8f, 0xe5, 0x18, 0xe1,
|
0xe9,0x10,0x92,0xfd,0xf9,0xfc,0x8f,0xe5,0x18,0xe1,
|
||||||
0x95, 0xcc, 0x9e, 0x60, 0xa6, 0xfa, 0x38, 0x4d, 0x02, 0x03,
|
0x95,0xcc,0x9e,0x60,0xa6,0xfa,0x38,0x4d,0x02,0x03,
|
||||||
0x01, 0x00, 0x01, 0x02, 0x82, 0x01, 0x00, 0x00, 0xc3, 0xc3,
|
0x01,0x00,0x01,0x02,0x82,0x01,0x00,0x00,0xc3,0xc3,
|
||||||
0x0d, 0xb4, 0x27, 0x90, 0x8d, 0x4b, 0xbf, 0xb8, 0x84, 0xaa,
|
0x0d,0xb4,0x27,0x90,0x8d,0x4b,0xbf,0xb8,0x84,0xaa,
|
||||||
0xd0, 0xb8, 0xc7, 0x5d, 0x99, 0xbe, 0x55, 0xf6, 0x3e, 0x7c,
|
0xd0,0xb8,0xc7,0x5d,0x99,0xbe,0x55,0xf6,0x3e,0x7c,
|
||||||
0x49, 0x20, 0xcb, 0x8a, 0x8e, 0x19, 0x0e, 0x66, 0x24, 0xac,
|
0x49,0x20,0xcb,0x8a,0x8e,0x19,0x0e,0x66,0x24,0xac,
|
||||||
0xaf, 0x03, 0x33, 0x97, 0xeb, 0x95, 0xd5, 0x3b, 0x0f, 0x40,
|
0xaf,0x03,0x33,0x97,0xeb,0x95,0xd5,0x3b,0x0f,0x40,
|
||||||
0x56, 0x04, 0x50, 0xd1, 0xe6, 0xbe, 0x84, 0x0b, 0x25, 0xd3,
|
0x56,0x04,0x50,0xd1,0xe6,0xbe,0x84,0x0b,0x25,0xd3,
|
||||||
0x9c, 0xe2, 0x83, 0x6c, 0xf5, 0x62, 0x5d, 0xba, 0x2b, 0x7d,
|
0x9c,0xe2,0x83,0x6c,0xf5,0x62,0x5d,0xba,0x2b,0x7d,
|
||||||
0x3d, 0x7a, 0x6c, 0xe1, 0xd2, 0x0e, 0x54, 0x93, 0x80, 0x01,
|
0x3d,0x7a,0x6c,0xe1,0xd2,0x0e,0x54,0x93,0x80,0x01,
|
||||||
0x91, 0x51, 0x09, 0xe8, 0x5b, 0x8e, 0x47, 0xbd, 0x64, 0xe4,
|
0x91,0x51,0x09,0xe8,0x5b,0x8e,0x47,0xbd,0x64,0xe4,
|
||||||
0x0e, 0x03, 0x83, 0x55, 0xcf, 0x5a, 0x37, 0xf0, 0x25, 0xb5,
|
0x0e,0x03,0x83,0x55,0xcf,0x5a,0x37,0xf0,0x25,0xb5,
|
||||||
0x7d, 0x21, 0xd7, 0x69, 0xdf, 0x6f, 0xc2, 0xcf, 0x10, 0xc9,
|
0x7d,0x21,0xd7,0x69,0xdf,0x6f,0xc2,0xcf,0x10,0xc9,
|
||||||
0x8a, 0x40, 0x9f, 0x7a, 0x70, 0xc0, 0xe8, 0xe8, 0xc0, 0xe6,
|
0x8a,0x40,0x9f,0x7a,0x70,0xc0,0xe8,0xe8,0xc0,0xe6,
|
||||||
0x9a, 0x15, 0x0a, 0x8d, 0x4e, 0x46, 0xcb, 0x7a, 0xdb, 0xb3,
|
0x9a,0x15,0x0a,0x8d,0x4e,0x46,0xcb,0x7a,0xdb,0xb3,
|
||||||
0xcb, 0x83, 0x02, 0xc4, 0xf0, 0xab, 0xeb, 0x02, 0x01, 0x0e,
|
0xcb,0x83,0x02,0xc4,0xf0,0xab,0xeb,0x02,0x01,0x0e,
|
||||||
0x23, 0xfc, 0x1d, 0xc4, 0xbd, 0xd4, 0xaa, 0x5d, 0x31, 0x46,
|
0x23,0xfc,0x1d,0xc4,0xbd,0xd4,0xaa,0x5d,0x31,0x46,
|
||||||
0x99, 0xce, 0x9e, 0xf8, 0x04, 0x75, 0x10, 0x67, 0xc4, 0x53,
|
0x99,0xce,0x9e,0xf8,0x04,0x75,0x10,0x67,0xc4,0x53,
|
||||||
0x47, 0x44, 0xfa, 0xc2, 0x25, 0x73, 0x7e, 0xd0, 0x8e, 0x59,
|
0x47,0x44,0xfa,0xc2,0x25,0x73,0x7e,0xd0,0x8e,0x59,
|
||||||
0xd1, 0xb2, 0x5a, 0xf4, 0xc7, 0x18, 0x92, 0x2f, 0x39, 0xab,
|
0xd1,0xb2,0x5a,0xf4,0xc7,0x18,0x92,0x2f,0x39,0xab,
|
||||||
0xcd, 0xa3, 0xb5, 0xc2, 0xb9, 0xc7, 0xb9, 0x1b, 0x9f, 0x48,
|
0xcd,0xa3,0xb5,0xc2,0xb9,0xc7,0xb9,0x1b,0x9f,0x48,
|
||||||
0xfa, 0x13, 0xc6, 0x98, 0x4d, 0xca, 0x84, 0x9c, 0x06, 0xca,
|
0xfa,0x13,0xc6,0x98,0x4d,0xca,0x84,0x9c,0x06,0xca,
|
||||||
0xe7, 0x89, 0x01, 0x04, 0xc4, 0x6c, 0xfd, 0x29, 0x59, 0x35,
|
0xe7,0x89,0x01,0x04,0xc4,0x6c,0xfd,0x29,0x59,0x35,
|
||||||
0xe7, 0xf3, 0xdd, 0xce, 0x64, 0x59, 0xbf, 0x21, 0x13, 0xa9,
|
0xe7,0xf3,0xdd,0xce,0x64,0x59,0xbf,0x21,0x13,0xa9,
|
||||||
0x9f, 0x0e, 0xc5, 0xff, 0xbd, 0x33, 0x00, 0xec, 0xac, 0x6b,
|
0x9f,0x0e,0xc5,0xff,0xbd,0x33,0x00,0xec,0xac,0x6b,
|
||||||
0x11, 0xef, 0x51, 0x5e, 0xad, 0x07, 0x15, 0xde, 0xb8, 0x5f,
|
0x11,0xef,0x51,0x5e,0xad,0x07,0x15,0xde,0xb8,0x5f,
|
||||||
0xc6, 0xb9, 0xa3, 0x22, 0x65, 0x46, 0x83, 0x14, 0xdf, 0xd0,
|
0xc6,0xb9,0xa3,0x22,0x65,0x46,0x83,0x14,0xdf,0xd0,
|
||||||
0xf1, 0x44, 0x8a, 0xe1, 0x9c, 0x23, 0x33, 0xb4, 0x97, 0x33,
|
0xf1,0x44,0x8a,0xe1,0x9c,0x23,0x33,0xb4,0x97,0x33,
|
||||||
0xe6, 0x6b, 0x81, 0x02, 0x81, 0x81, 0x00, 0xec, 0x12, 0xa7,
|
0xe6,0x6b,0x81,0x02,0x81,0x81,0x00,0xec,0x12,0xa7,
|
||||||
0x59, 0x74, 0x6a, 0xde, 0x3e, 0xad, 0xd8, 0x36, 0x80, 0x50,
|
0x59,0x74,0x6a,0xde,0x3e,0xad,0xd8,0x36,0x80,0x50,
|
||||||
0xa2, 0xd5, 0x21, 0x81, 0x07, 0xf1, 0xd0, 0x91, 0xf2, 0x6c,
|
0xa2,0xd5,0x21,0x81,0x07,0xf1,0xd0,0x91,0xf2,0x6c,
|
||||||
0x12, 0x2f, 0x9d, 0x1a, 0x26, 0xf8, 0x30, 0x65, 0xdf, 0xe8,
|
0x12,0x2f,0x9d,0x1a,0x26,0xf8,0x30,0x65,0xdf,0xe8,
|
||||||
0xc0, 0x9b, 0x6a, 0x30, 0x98, 0x82, 0x87, 0xec, 0xa2, 0x56,
|
0xc0,0x9b,0x6a,0x30,0x98,0x82,0x87,0xec,0xa2,0x56,
|
||||||
0x87, 0x62, 0x6f, 0xe7, 0x9f, 0xf6, 0x56, 0xe6, 0x71, 0x8f,
|
0x87,0x62,0x6f,0xe7,0x9f,0xf6,0x56,0xe6,0x71,0x8f,
|
||||||
0x49, 0x86, 0x93, 0x5a, 0x4d, 0x34, 0x58, 0xfe, 0xd9, 0x04,
|
0x49,0x86,0x93,0x5a,0x4d,0x34,0x58,0xfe,0xd9,0x04,
|
||||||
0x13, 0xaf, 0x79, 0xb7, 0xad, 0x11, 0xd1, 0x30, 0x9a, 0x14,
|
0x13,0xaf,0x79,0xb7,0xad,0x11,0xd1,0x30,0x9a,0x14,
|
||||||
0x06, 0xa0, 0xfa, 0xb7, 0x55, 0xdc, 0x6c, 0x5a, 0x4c, 0x2c,
|
0x06,0xa0,0xfa,0xb7,0x55,0xdc,0x6c,0x5a,0x4c,0x2c,
|
||||||
0x59, 0x56, 0xf6, 0xe8, 0x9d, 0xaf, 0x0a, 0x78, 0x99, 0x06,
|
0x59,0x56,0xf6,0xe8,0x9d,0xaf,0x0a,0x78,0x99,0x06,
|
||||||
0x06, 0x9e, 0xe7, 0x9c, 0x51, 0x55, 0x43, 0xfc, 0x3b, 0x6c,
|
0x06,0x9e,0xe7,0x9c,0x51,0x55,0x43,0xfc,0x3b,0x6c,
|
||||||
0x0b, 0xbf, 0x2d, 0x41, 0xa7, 0xaf, 0xb7, 0xe0, 0xe8, 0x28,
|
0x0b,0xbf,0x2d,0x41,0xa7,0xaf,0xb7,0xe0,0xe8,0x28,
|
||||||
0x18, 0xb4, 0x13, 0xd1, 0xe6, 0x97, 0xd0, 0x9f, 0x6a, 0x80,
|
0x18,0xb4,0x13,0xd1,0xe6,0x97,0xd0,0x9f,0x6a,0x80,
|
||||||
0xca, 0xdd, 0x1a, 0x7e, 0x15, 0x02, 0x81, 0x81, 0x00, 0xd1,
|
0xca,0xdd,0x1a,0x7e,0x15,0x02,0x81,0x81,0x00,0xd1,
|
||||||
0x06, 0x0c, 0x1f, 0xe3, 0xd0, 0xab, 0xd6, 0xca, 0x7c, 0xbc,
|
0x06,0x0c,0x1f,0xe3,0xd0,0xab,0xd6,0xca,0x7c,0xbc,
|
||||||
0x7d, 0x13, 0x35, 0xce, 0x27, 0xcd, 0xd8, 0x49, 0x51, 0x63,
|
0x7d,0x13,0x35,0xce,0x27,0xcd,0xd8,0x49,0x51,0x63,
|
||||||
0x64, 0x0f, 0xca, 0x06, 0x12, 0xfc, 0x07, 0x3e, 0xaf, 0x61,
|
0x64,0x0f,0xca,0x06,0x12,0xfc,0x07,0x3e,0xaf,0x61,
|
||||||
0x6d, 0xe2, 0x53, 0x39, 0x27, 0xae, 0xc3, 0x11, 0x9e, 0x94,
|
0x6d,0xe2,0x53,0x39,0x27,0xae,0xc3,0x11,0x9e,0x94,
|
||||||
0x01, 0x4f, 0xe3, 0xf3, 0x67, 0xf9, 0x77, 0xf9, 0xe7, 0x95,
|
0x01,0x4f,0xe3,0xf3,0x67,0xf9,0x77,0xf9,0xe7,0x95,
|
||||||
0x3a, 0x6f, 0xe2, 0x20, 0x73, 0x3e, 0xa4, 0x7a, 0x28, 0xd4,
|
0x3a,0x6f,0xe2,0x20,0x73,0x3e,0xa4,0x7a,0x28,0xd4,
|
||||||
0x61, 0x97, 0xf6, 0x17, 0xa0, 0x23, 0x10, 0x2b, 0xce, 0x84,
|
0x61,0x97,0xf6,0x17,0xa0,0x23,0x10,0x2b,0xce,0x84,
|
||||||
0x57, 0x7e, 0x25, 0x1f, 0xf4, 0xa8, 0x54, 0xd2, 0x65, 0x94,
|
0x57,0x7e,0x25,0x1f,0xf4,0xa8,0x54,0xd2,0x65,0x94,
|
||||||
0xcc, 0x95, 0x0a, 0xab, 0x30, 0xc1, 0x59, 0x1f, 0x61, 0x8e,
|
0xcc,0x95,0x0a,0xab,0x30,0xc1,0x59,0x1f,0x61,0x8e,
|
||||||
0xb9, 0x6b, 0xd7, 0x4e, 0xb9, 0x83, 0x43, 0x79, 0x85, 0x11,
|
0xb9,0x6b,0xd7,0x4e,0xb9,0x83,0x43,0x79,0x85,0x11,
|
||||||
0xbc, 0x0f, 0xae, 0x25, 0x20, 0x05, 0xbc, 0xd2, 0x48, 0xa1,
|
0xbc,0x0f,0xae,0x25,0x20,0x05,0xbc,0xd2,0x48,0xa1,
|
||||||
0x68, 0x09, 0x84, 0xf6, 0x12, 0x9a, 0x66, 0xb9, 0x2b, 0xbb,
|
0x68,0x09,0x84,0xf6,0x12,0x9a,0x66,0xb9,0x2b,0xbb,
|
||||||
0x76, 0x03, 0x17, 0x46, 0x4e, 0x97, 0x59, 0x02, 0x81, 0x80,
|
0x76,0x03,0x17,0x46,0x4e,0x97,0x59,0x02,0x81,0x80,
|
||||||
0x09, 0x4c, 0xfa, 0xd6, 0xe5, 0x65, 0x48, 0x78, 0x43, 0xb5,
|
0x09,0x4c,0xfa,0xd6,0xe5,0x65,0x48,0x78,0x43,0xb5,
|
||||||
0x1f, 0x00, 0x93, 0x2c, 0xb7, 0x24, 0xe8, 0xc6, 0x7d, 0x5a,
|
0x1f,0x00,0x93,0x2c,0xb7,0x24,0xe8,0xc6,0x7d,0x5a,
|
||||||
0x70, 0x45, 0x92, 0xc8, 0x6c, 0xa3, 0xcd, 0xe1, 0xf7, 0x29,
|
0x70,0x45,0x92,0xc8,0x6c,0xa3,0xcd,0xe1,0xf7,0x29,
|
||||||
0x40, 0xfa, 0x3f, 0x5b, 0x47, 0x44, 0x39, 0xc1, 0xe8, 0x72,
|
0x40,0xfa,0x3f,0x5b,0x47,0x44,0x39,0xc1,0xe8,0x72,
|
||||||
0x9e, 0x7a, 0x0e, 0xda, 0xaa, 0xa0, 0x2a, 0x09, 0xfd, 0x54,
|
0x9e,0x7a,0x0e,0xda,0xaa,0xa0,0x2a,0x09,0xfd,0x54,
|
||||||
0x93, 0x23, 0xaa, 0x37, 0x85, 0x5b, 0xcc, 0xd4, 0xf9, 0xd8,
|
0x93,0x23,0xaa,0x37,0x85,0x5b,0xcc,0xd4,0xf9,0xd8,
|
||||||
0xff, 0xc1, 0x61, 0x0d, 0xbd, 0x7e, 0x18, 0x24, 0x73, 0x6d,
|
0xff,0xc1,0x61,0x0d,0xbd,0x7e,0x18,0x24,0x73,0x6d,
|
||||||
0x40, 0x72, 0xf1, 0x93, 0x09, 0x48, 0x97, 0x6c, 0x84, 0x90,
|
0x40,0x72,0xf1,0x93,0x09,0x48,0x97,0x6c,0x84,0x90,
|
||||||
0xa8, 0x46, 0x14, 0x01, 0x39, 0x11, 0xe5, 0x3c, 0x41, 0x27,
|
0xa8,0x46,0x14,0x01,0x39,0x11,0xe5,0x3c,0x41,0x27,
|
||||||
0x32, 0x75, 0x24, 0xed, 0xa1, 0xd9, 0x12, 0x29, 0x8a, 0x28,
|
0x32,0x75,0x24,0xed,0xa1,0xd9,0x12,0x29,0x8a,0x28,
|
||||||
0x71, 0x89, 0x8d, 0xca, 0x30, 0xb0, 0x01, 0xc4, 0x2f, 0x82,
|
0x71,0x89,0x8d,0xca,0x30,0xb0,0x01,0xc4,0x2f,0x82,
|
||||||
0x19, 0x14, 0x4c, 0x70, 0x1c, 0xb8, 0x23, 0x2e, 0xe8, 0x90,
|
0x19,0x14,0x4c,0x70,0x1c,0xb8,0x23,0x2e,0xe8,0x90,
|
||||||
0x49, 0x97, 0x92, 0x97, 0x6b, 0x7a, 0x9d, 0xb9, 0x02, 0x81,
|
0x49,0x97,0x92,0x97,0x6b,0x7a,0x9d,0xb9,0x02,0x81,
|
||||||
0x80, 0x0f, 0x0e, 0xa1, 0x76, 0xf6, 0xa1, 0x44, 0x8f, 0xaf,
|
0x80,0x0f,0x0e,0xa1,0x76,0xf6,0xa1,0x44,0x8f,0xaf,
|
||||||
0x7c, 0x76, 0xd3, 0x87, 0xbb, 0xbb, 0x83, 0x10, 0x88, 0x01,
|
0x7c,0x76,0xd3,0x87,0xbb,0xbb,0x83,0x10,0x88,0x01,
|
||||||
0x18, 0x14, 0xd1, 0xd3, 0x75, 0x59, 0x24, 0xaa, 0xf5, 0x16,
|
0x18,0x14,0xd1,0xd3,0x75,0x59,0x24,0xaa,0xf5,0x16,
|
||||||
0xa5, 0xe9, 0x9d, 0xd1, 0xcc, 0xee, 0xf4, 0x15, 0xd9, 0xc5,
|
0xa5,0xe9,0x9d,0xd1,0xcc,0xee,0xf4,0x15,0xd9,0xc5,
|
||||||
0x7e, 0x27, 0xe9, 0x44, 0x49, 0x06, 0x72, 0xb9, 0xfc, 0xd3,
|
0x7e,0x27,0xe9,0x44,0x49,0x06,0x72,0xb9,0xfc,0xd3,
|
||||||
0x8a, 0xc4, 0x2c, 0x36, 0x7d, 0x12, 0x9b, 0x5a, 0xaa, 0xdc,
|
0x8a,0xc4,0x2c,0x36,0x7d,0x12,0x9b,0x5a,0xaa,0xdc,
|
||||||
0x85, 0xee, 0x6e, 0xad, 0x54, 0xb3, 0xf4, 0xfc, 0x31, 0xa1,
|
0x85,0xee,0x6e,0xad,0x54,0xb3,0xf4,0xfc,0x31,0xa1,
|
||||||
0x06, 0x3a, 0x70, 0x57, 0x0c, 0xf3, 0x95, 0x5b, 0x3e, 0xe8,
|
0x06,0x3a,0x70,0x57,0x0c,0xf3,0x95,0x5b,0x3e,0xe8,
|
||||||
0xfd, 0x1a, 0x4f, 0xf6, 0x78, 0x93, 0x46, 0x6a, 0xd7, 0x31,
|
0xfd,0x1a,0x4f,0xf6,0x78,0x93,0x46,0x6a,0xd7,0x31,
|
||||||
0xb4, 0x84, 0x64, 0x85, 0x09, 0x38, 0x89, 0x92, 0x94, 0x1c,
|
0xb4,0x84,0x64,0x85,0x09,0x38,0x89,0x92,0x94,0x1c,
|
||||||
0xbf, 0xe2, 0x3c, 0x2a, 0xe0, 0xff, 0x99, 0xa3, 0xf0, 0x2b,
|
0xbf,0xe2,0x3c,0x2a,0xe0,0xff,0x99,0xa3,0xf0,0x2b,
|
||||||
0x31, 0xc2, 0x36, 0xcd, 0x60, 0xbf, 0x9d, 0x2d, 0x74, 0x32,
|
0x31,0xc2,0x36,0xcd,0x60,0xbf,0x9d,0x2d,0x74,0x32,
|
||||||
0xe8, 0x9c, 0x93, 0x6e, 0xbb, 0x91, 0x7b, 0xfd, 0xd9, 0x02,
|
0xe8,0x9c,0x93,0x6e,0xbb,0x91,0x7b,0xfd,0xd9,0x02,
|
||||||
0x81, 0x81, 0x00, 0xa2, 0x71, 0x25, 0x38, 0xeb, 0x2a, 0xe9,
|
0x81,0x81,0x00,0xa2,0x71,0x25,0x38,0xeb,0x2a,0xe9,
|
||||||
0x37, 0xcd, 0xfe, 0x44, 0xce, 0x90, 0x3f, 0x52, 0x87, 0x84,
|
0x37,0xcd,0xfe,0x44,0xce,0x90,0x3f,0x52,0x87,0x84,
|
||||||
0x52, 0x1b, 0xae, 0x8d, 0x22, 0x94, 0xce, 0x38, 0xe6, 0x04,
|
0x52,0x1b,0xae,0x8d,0x22,0x94,0xce,0x38,0xe6,0x04,
|
||||||
0x88, 0x76, 0x85, 0x9a, 0xd3, 0x14, 0x09, 0xe5, 0x69, 0x9a,
|
0x88,0x76,0x85,0x9a,0xd3,0x14,0x09,0xe5,0x69,0x9a,
|
||||||
0xff, 0x58, 0x92, 0x02, 0x6a, 0x7d, 0x7c, 0x1e, 0x2c, 0xfd,
|
0xff,0x58,0x92,0x02,0x6a,0x7d,0x7c,0x1e,0x2c,0xfd,
|
||||||
0xa8, 0xca, 0x32, 0x14, 0x4f, 0x0d, 0x84, 0x0d, 0x37, 0x43,
|
0xa8,0xca,0x32,0x14,0x4f,0x0d,0x84,0x0d,0x37,0x43,
|
||||||
0xbf, 0xe4, 0x5d, 0x12, 0xc8, 0x24, 0x91, 0x27, 0x8d, 0x46,
|
0xbf,0xe4,0x5d,0x12,0xc8,0x24,0x91,0x27,0x8d,0x46,
|
||||||
0xd9, 0x54, 0x53, 0xe7, 0x62, 0x71, 0xa8, 0x2b, 0x71, 0x41,
|
0xd9,0x54,0x53,0xe7,0x62,0x71,0xa8,0x2b,0x71,0x41,
|
||||||
0x8d, 0x75, 0xf8, 0x3a, 0xa0, 0x61, 0x29, 0x46, 0xa6, 0xe5,
|
0x8d,0x75,0xf8,0x3a,0xa0,0x61,0x29,0x46,0xa6,0xe5,
|
||||||
0x82, 0xfa, 0x3a, 0xd9, 0x08, 0xfa, 0xfc, 0x63, 0xfd, 0x6b,
|
0x82,0xfa,0x3a,0xd9,0x08,0xfa,0xfc,0x63,0xfd,0x6b,
|
||||||
0x30, 0xbc, 0xf4, 0x4e, 0x9e, 0x8c, 0x25, 0x0c, 0xb6, 0x55,
|
0x30,0xbc,0xf4,0x4e,0x9e,0x8c,0x25,0x0c,0xb6,0x55,
|
||||||
0xe7, 0x3c, 0xd4, 0x4e, 0x0b, 0xfd, 0x8b, 0xc3, 0x0e, 0x1d,
|
0xe7,0x3c,0xd4,0x4e,0x0b,0xfd,0x8b,0xc3,0x0e,0x1d,
|
||||||
0x9c, 0x44, 0x57, 0x8f, 0x1f, 0x86, 0xf7, 0xd5, 0x1b, 0xe4,
|
0x9c,0x44,0x57,0x8f,0x1f,0x86,0xf7,0xd5,0x1b,0xe4,
|
||||||
0x95,
|
0x95,
|
||||||
};
|
};
|
||||||
|
|
||||||
static unsigned char test4096[] = {
|
static unsigned char test4096[]={
|
||||||
0x30, 0x82, 0x09, 0x29, 0x02, 0x01, 0x00, 0x02, 0x82, 0x02,
|
0x30,0x82,0x09,0x29,0x02,0x01,0x00,0x02,0x82,0x02,
|
||||||
0x01, 0x00, 0xc0, 0x71, 0xac, 0x1a, 0x13, 0x88, 0x82, 0x43,
|
0x01,0x00,0xc0,0x71,0xac,0x1a,0x13,0x88,0x82,0x43,
|
||||||
0x3b, 0x51, 0x57, 0x71, 0x8d, 0xb6, 0x2b, 0x82, 0x65, 0x21,
|
0x3b,0x51,0x57,0x71,0x8d,0xb6,0x2b,0x82,0x65,0x21,
|
||||||
0x53, 0x5f, 0x28, 0x29, 0x4f, 0x8d, 0x7c, 0x8a, 0xb9, 0x44,
|
0x53,0x5f,0x28,0x29,0x4f,0x8d,0x7c,0x8a,0xb9,0x44,
|
||||||
0xb3, 0x28, 0x41, 0x4f, 0xd3, 0xfa, 0x6a, 0xf8, 0xb9, 0x28,
|
0xb3,0x28,0x41,0x4f,0xd3,0xfa,0x6a,0xf8,0xb9,0x28,
|
||||||
0x50, 0x39, 0x67, 0x53, 0x2c, 0x3c, 0xd7, 0xcb, 0x96, 0x41,
|
0x50,0x39,0x67,0x53,0x2c,0x3c,0xd7,0xcb,0x96,0x41,
|
||||||
0x40, 0x32, 0xbb, 0xeb, 0x70, 0xae, 0x1f, 0xb0, 0x65, 0xf7,
|
0x40,0x32,0xbb,0xeb,0x70,0xae,0x1f,0xb0,0x65,0xf7,
|
||||||
0x3a, 0xd9, 0x22, 0xfd, 0x10, 0xae, 0xbd, 0x02, 0xe2, 0xdd,
|
0x3a,0xd9,0x22,0xfd,0x10,0xae,0xbd,0x02,0xe2,0xdd,
|
||||||
0xf3, 0xc2, 0x79, 0x3c, 0xc6, 0xfc, 0x75, 0xbb, 0xaf, 0x4e,
|
0xf3,0xc2,0x79,0x3c,0xc6,0xfc,0x75,0xbb,0xaf,0x4e,
|
||||||
0x3a, 0x36, 0xc2, 0x4f, 0xea, 0x25, 0xdf, 0x13, 0x16, 0x4b,
|
0x3a,0x36,0xc2,0x4f,0xea,0x25,0xdf,0x13,0x16,0x4b,
|
||||||
0x20, 0xfe, 0x4b, 0x69, 0x16, 0xc4, 0x7f, 0x1a, 0x43, 0xa6,
|
0x20,0xfe,0x4b,0x69,0x16,0xc4,0x7f,0x1a,0x43,0xa6,
|
||||||
0x17, 0x1b, 0xb9, 0x0a, 0xf3, 0x09, 0x86, 0x28, 0x89, 0xcf,
|
0x17,0x1b,0xb9,0x0a,0xf3,0x09,0x86,0x28,0x89,0xcf,
|
||||||
0x2c, 0xd0, 0xd4, 0x81, 0xaf, 0xc6, 0x6d, 0xe6, 0x21, 0x8d,
|
0x2c,0xd0,0xd4,0x81,0xaf,0xc6,0x6d,0xe6,0x21,0x8d,
|
||||||
0xee, 0xef, 0xea, 0xdc, 0xb7, 0xc6, 0x3b, 0x63, 0x9f, 0x0e,
|
0xee,0xef,0xea,0xdc,0xb7,0xc6,0x3b,0x63,0x9f,0x0e,
|
||||||
0xad, 0x89, 0x78, 0x23, 0x18, 0xbf, 0x70, 0x7e, 0x84, 0xe0,
|
0xad,0x89,0x78,0x23,0x18,0xbf,0x70,0x7e,0x84,0xe0,
|
||||||
0x37, 0xec, 0xdb, 0x8e, 0x9c, 0x3e, 0x6a, 0x19, 0xcc, 0x99,
|
0x37,0xec,0xdb,0x8e,0x9c,0x3e,0x6a,0x19,0xcc,0x99,
|
||||||
0x72, 0xe6, 0xb5, 0x7d, 0x6d, 0xfa, 0xe5, 0xd3, 0xe4, 0x90,
|
0x72,0xe6,0xb5,0x7d,0x6d,0xfa,0xe5,0xd3,0xe4,0x90,
|
||||||
0xb5, 0xb2, 0xb2, 0x12, 0x70, 0x4e, 0xca, 0xf8, 0x10, 0xf8,
|
0xb5,0xb2,0xb2,0x12,0x70,0x4e,0xca,0xf8,0x10,0xf8,
|
||||||
0xa3, 0x14, 0xc2, 0x48, 0x19, 0xeb, 0x60, 0x99, 0xbb, 0x2a,
|
0xa3,0x14,0xc2,0x48,0x19,0xeb,0x60,0x99,0xbb,0x2a,
|
||||||
0x1f, 0xb1, 0x7a, 0xb1, 0x3d, 0x24, 0xfb, 0xa0, 0x29, 0xda,
|
0x1f,0xb1,0x7a,0xb1,0x3d,0x24,0xfb,0xa0,0x29,0xda,
|
||||||
0xbd, 0x1b, 0xd7, 0xa4, 0xbf, 0xef, 0x60, 0x2d, 0x22, 0xca,
|
0xbd,0x1b,0xd7,0xa4,0xbf,0xef,0x60,0x2d,0x22,0xca,
|
||||||
0x65, 0x98, 0xf1, 0xc4, 0xe1, 0xc9, 0x02, 0x6b, 0x16, 0x28,
|
0x65,0x98,0xf1,0xc4,0xe1,0xc9,0x02,0x6b,0x16,0x28,
|
||||||
0x2f, 0xa1, 0xaa, 0x79, 0x00, 0xda, 0xdc, 0x7c, 0x43, 0xf7,
|
0x2f,0xa1,0xaa,0x79,0x00,0xda,0xdc,0x7c,0x43,0xf7,
|
||||||
0x42, 0x3c, 0xa0, 0xef, 0x68, 0xf7, 0xdf, 0xb9, 0x69, 0xfb,
|
0x42,0x3c,0xa0,0xef,0x68,0xf7,0xdf,0xb9,0x69,0xfb,
|
||||||
0x8e, 0x01, 0xed, 0x01, 0x42, 0xb5, 0x4e, 0x57, 0xa6, 0x26,
|
0x8e,0x01,0xed,0x01,0x42,0xb5,0x4e,0x57,0xa6,0x26,
|
||||||
0xb8, 0xd0, 0x7b, 0x56, 0x6d, 0x03, 0xc6, 0x40, 0x8c, 0x8c,
|
0xb8,0xd0,0x7b,0x56,0x6d,0x03,0xc6,0x40,0x8c,0x8c,
|
||||||
0x2a, 0x55, 0xd7, 0x9c, 0x35, 0x00, 0x94, 0x93, 0xec, 0x03,
|
0x2a,0x55,0xd7,0x9c,0x35,0x00,0x94,0x93,0xec,0x03,
|
||||||
0xeb, 0x22, 0xef, 0x77, 0xbb, 0x79, 0x13, 0x3f, 0x15, 0xa1,
|
0xeb,0x22,0xef,0x77,0xbb,0x79,0x13,0x3f,0x15,0xa1,
|
||||||
0x8f, 0xca, 0xdf, 0xfd, 0xd3, 0xb8, 0xe1, 0xd4, 0xcc, 0x09,
|
0x8f,0xca,0xdf,0xfd,0xd3,0xb8,0xe1,0xd4,0xcc,0x09,
|
||||||
0x3f, 0x3c, 0x2c, 0xdb, 0xd1, 0x49, 0x7f, 0x38, 0x07, 0x83,
|
0x3f,0x3c,0x2c,0xdb,0xd1,0x49,0x7f,0x38,0x07,0x83,
|
||||||
0x6d, 0xeb, 0x08, 0x66, 0xe9, 0x06, 0x44, 0x12, 0xac, 0x95,
|
0x6d,0xeb,0x08,0x66,0xe9,0x06,0x44,0x12,0xac,0x95,
|
||||||
0x22, 0x90, 0x23, 0x67, 0xd4, 0x08, 0xcc, 0xf4, 0xb7, 0xdc,
|
0x22,0x90,0x23,0x67,0xd4,0x08,0xcc,0xf4,0xb7,0xdc,
|
||||||
0xcc, 0x87, 0xd4, 0xac, 0x69, 0x35, 0x4c, 0xb5, 0x39, 0x36,
|
0xcc,0x87,0xd4,0xac,0x69,0x35,0x4c,0xb5,0x39,0x36,
|
||||||
0xcd, 0xa4, 0xd2, 0x95, 0xca, 0x0d, 0xc5, 0xda, 0xc2, 0xc5,
|
0xcd,0xa4,0xd2,0x95,0xca,0x0d,0xc5,0xda,0xc2,0xc5,
|
||||||
0x22, 0x32, 0x28, 0x08, 0xe3, 0xd2, 0x8b, 0x38, 0x30, 0xdc,
|
0x22,0x32,0x28,0x08,0xe3,0xd2,0x8b,0x38,0x30,0xdc,
|
||||||
0x8c, 0x75, 0x4f, 0x6a, 0xec, 0x7a, 0xac, 0x16, 0x3e, 0xa8,
|
0x8c,0x75,0x4f,0x6a,0xec,0x7a,0xac,0x16,0x3e,0xa8,
|
||||||
0xd4, 0x6a, 0x45, 0xe1, 0xa8, 0x4f, 0x2e, 0x80, 0x34, 0xaa,
|
0xd4,0x6a,0x45,0xe1,0xa8,0x4f,0x2e,0x80,0x34,0xaa,
|
||||||
0x54, 0x1b, 0x02, 0x95, 0x7d, 0x8a, 0x6d, 0xcc, 0x79, 0xca,
|
0x54,0x1b,0x02,0x95,0x7d,0x8a,0x6d,0xcc,0x79,0xca,
|
||||||
0xf2, 0xa4, 0x2e, 0x8d, 0xfb, 0xfe, 0x15, 0x51, 0x10, 0x0e,
|
0xf2,0xa4,0x2e,0x8d,0xfb,0xfe,0x15,0x51,0x10,0x0e,
|
||||||
0x4d, 0x88, 0xb1, 0xc7, 0xf4, 0x79, 0xdb, 0xf0, 0xb4, 0x56,
|
0x4d,0x88,0xb1,0xc7,0xf4,0x79,0xdb,0xf0,0xb4,0x56,
|
||||||
0x44, 0x37, 0xca, 0x5a, 0xc1, 0x8c, 0x48, 0xac, 0xae, 0x48,
|
0x44,0x37,0xca,0x5a,0xc1,0x8c,0x48,0xac,0xae,0x48,
|
||||||
0x80, 0x83, 0x01, 0x3f, 0xde, 0xd9, 0xd3, 0x2c, 0x51, 0x46,
|
0x80,0x83,0x01,0x3f,0xde,0xd9,0xd3,0x2c,0x51,0x46,
|
||||||
0xb1, 0x41, 0xb6, 0xc6, 0x91, 0x72, 0xf9, 0x83, 0x55, 0x1b,
|
0xb1,0x41,0xb6,0xc6,0x91,0x72,0xf9,0x83,0x55,0x1b,
|
||||||
0x8c, 0xba, 0xf3, 0x73, 0xe5, 0x2c, 0x74, 0x50, 0x3a, 0xbe,
|
0x8c,0xba,0xf3,0x73,0xe5,0x2c,0x74,0x50,0x3a,0xbe,
|
||||||
0xc5, 0x2f, 0xa7, 0xb2, 0x6d, 0x8c, 0x9e, 0x13, 0x77, 0xa3,
|
0xc5,0x2f,0xa7,0xb2,0x6d,0x8c,0x9e,0x13,0x77,0xa3,
|
||||||
0x13, 0xcd, 0x6d, 0x8c, 0x45, 0xe1, 0xfc, 0x0b, 0xb7, 0x69,
|
0x13,0xcd,0x6d,0x8c,0x45,0xe1,0xfc,0x0b,0xb7,0x69,
|
||||||
0xe9, 0x27, 0xbc, 0x65, 0xc3, 0xfa, 0x9b, 0xd0, 0xef, 0xfe,
|
0xe9,0x27,0xbc,0x65,0xc3,0xfa,0x9b,0xd0,0xef,0xfe,
|
||||||
0xe8, 0x1f, 0xb3, 0x5e, 0x34, 0xf4, 0x8c, 0xea, 0xfc, 0xd3,
|
0xe8,0x1f,0xb3,0x5e,0x34,0xf4,0x8c,0xea,0xfc,0xd3,
|
||||||
0x81, 0xbf, 0x3d, 0x30, 0xb2, 0xb4, 0x01, 0xe8, 0x43, 0x0f,
|
0x81,0xbf,0x3d,0x30,0xb2,0xb4,0x01,0xe8,0x43,0x0f,
|
||||||
0xba, 0x02, 0x23, 0x42, 0x76, 0x82, 0x31, 0x73, 0x91, 0xed,
|
0xba,0x02,0x23,0x42,0x76,0x82,0x31,0x73,0x91,0xed,
|
||||||
0x07, 0x46, 0x61, 0x0d, 0x39, 0x83, 0x40, 0xce, 0x7a, 0xd4,
|
0x07,0x46,0x61,0x0d,0x39,0x83,0x40,0xce,0x7a,0xd4,
|
||||||
0xdb, 0x80, 0x2c, 0x1f, 0x0d, 0xd1, 0x34, 0xd4, 0x92, 0xe3,
|
0xdb,0x80,0x2c,0x1f,0x0d,0xd1,0x34,0xd4,0x92,0xe3,
|
||||||
0xd4, 0xf1, 0xc2, 0x01, 0x02, 0x03, 0x01, 0x00, 0x01, 0x02,
|
0xd4,0xf1,0xc2,0x01,0x02,0x03,0x01,0x00,0x01,0x02,
|
||||||
0x82, 0x02, 0x01, 0x00, 0x97, 0x6c, 0xda, 0x6e, 0xea, 0x4f,
|
0x82,0x02,0x01,0x00,0x97,0x6c,0xda,0x6e,0xea,0x4f,
|
||||||
0xcf, 0xaf, 0xf7, 0x4c, 0xd9, 0xf1, 0x90, 0x00, 0x77, 0xdb,
|
0xcf,0xaf,0xf7,0x4c,0xd9,0xf1,0x90,0x00,0x77,0xdb,
|
||||||
0xf2, 0x97, 0x76, 0x72, 0xb9, 0xb7, 0x47, 0xd1, 0x9c, 0xdd,
|
0xf2,0x97,0x76,0x72,0xb9,0xb7,0x47,0xd1,0x9c,0xdd,
|
||||||
0xcb, 0x4a, 0x33, 0x6e, 0xc9, 0x75, 0x76, 0xe6, 0xe4, 0xa5,
|
0xcb,0x4a,0x33,0x6e,0xc9,0x75,0x76,0xe6,0xe4,0xa5,
|
||||||
0x31, 0x8c, 0x77, 0x13, 0xb4, 0x29, 0xcd, 0xf5, 0x52, 0x17,
|
0x31,0x8c,0x77,0x13,0xb4,0x29,0xcd,0xf5,0x52,0x17,
|
||||||
0xef, 0xf3, 0x08, 0x00, 0xe3, 0xbd, 0x2e, 0xbc, 0xd4, 0x52,
|
0xef,0xf3,0x08,0x00,0xe3,0xbd,0x2e,0xbc,0xd4,0x52,
|
||||||
0x88, 0xe9, 0x30, 0x75, 0x0b, 0x02, 0xf5, 0xcd, 0x89, 0x0c,
|
0x88,0xe9,0x30,0x75,0x0b,0x02,0xf5,0xcd,0x89,0x0c,
|
||||||
0x6c, 0x57, 0x19, 0x27, 0x3d, 0x1e, 0x85, 0xb4, 0xc1, 0x2f,
|
0x6c,0x57,0x19,0x27,0x3d,0x1e,0x85,0xb4,0xc1,0x2f,
|
||||||
0x1d, 0x92, 0x00, 0x5c, 0x76, 0x29, 0x4b, 0xa4, 0xe1, 0x12,
|
0x1d,0x92,0x00,0x5c,0x76,0x29,0x4b,0xa4,0xe1,0x12,
|
||||||
0xb3, 0xc8, 0x09, 0xfe, 0x0e, 0x78, 0x72, 0x61, 0xcb, 0x61,
|
0xb3,0xc8,0x09,0xfe,0x0e,0x78,0x72,0x61,0xcb,0x61,
|
||||||
0x6f, 0x39, 0x91, 0x95, 0x4e, 0xd5, 0x3e, 0xc7, 0x8f, 0xb8,
|
0x6f,0x39,0x91,0x95,0x4e,0xd5,0x3e,0xc7,0x8f,0xb8,
|
||||||
0xf6, 0x36, 0xfe, 0x9c, 0x93, 0x9a, 0x38, 0x25, 0x7a, 0xf4,
|
0xf6,0x36,0xfe,0x9c,0x93,0x9a,0x38,0x25,0x7a,0xf4,
|
||||||
0x4a, 0x12, 0xd4, 0xa0, 0x13, 0xbd, 0xf9, 0x1d, 0x12, 0x3e,
|
0x4a,0x12,0xd4,0xa0,0x13,0xbd,0xf9,0x1d,0x12,0x3e,
|
||||||
0x21, 0x39, 0xfb, 0x72, 0xe0, 0x05, 0x3d, 0xc3, 0xe5, 0x50,
|
0x21,0x39,0xfb,0x72,0xe0,0x05,0x3d,0xc3,0xe5,0x50,
|
||||||
0xa8, 0x5d, 0x85, 0xa3, 0xea, 0x5f, 0x1c, 0xb2, 0x3f, 0xea,
|
0xa8,0x5d,0x85,0xa3,0xea,0x5f,0x1c,0xb2,0x3f,0xea,
|
||||||
0x6d, 0x03, 0x91, 0x55, 0xd8, 0x19, 0x0a, 0x21, 0x12, 0x16,
|
0x6d,0x03,0x91,0x55,0xd8,0x19,0x0a,0x21,0x12,0x16,
|
||||||
0xd9, 0x12, 0xc4, 0xe6, 0x07, 0x18, 0x5b, 0x26, 0xa4, 0xae,
|
0xd9,0x12,0xc4,0xe6,0x07,0x18,0x5b,0x26,0xa4,0xae,
|
||||||
0xed, 0x2b, 0xb7, 0xa6, 0xed, 0xf8, 0xad, 0xec, 0x77, 0xe6,
|
0xed,0x2b,0xb7,0xa6,0xed,0xf8,0xad,0xec,0x77,0xe6,
|
||||||
0x7f, 0x4f, 0x76, 0x00, 0xc0, 0xfa, 0x15, 0x92, 0xb4, 0x2c,
|
0x7f,0x4f,0x76,0x00,0xc0,0xfa,0x15,0x92,0xb4,0x2c,
|
||||||
0x22, 0xc2, 0xeb, 0x6a, 0xad, 0x14, 0x05, 0xb2, 0xe5, 0x8a,
|
0x22,0xc2,0xeb,0x6a,0xad,0x14,0x05,0xb2,0xe5,0x8a,
|
||||||
0x9e, 0x85, 0x83, 0xcc, 0x04, 0xf1, 0x56, 0x78, 0x44, 0x5e,
|
0x9e,0x85,0x83,0xcc,0x04,0xf1,0x56,0x78,0x44,0x5e,
|
||||||
0xde, 0xe0, 0x60, 0x1a, 0x65, 0x79, 0x31, 0x23, 0x05, 0xbb,
|
0xde,0xe0,0x60,0x1a,0x65,0x79,0x31,0x23,0x05,0xbb,
|
||||||
0x01, 0xff, 0xdd, 0x2e, 0xb7, 0xb3, 0xaa, 0x74, 0xe0, 0xa5,
|
0x01,0xff,0xdd,0x2e,0xb7,0xb3,0xaa,0x74,0xe0,0xa5,
|
||||||
0x94, 0xaf, 0x4b, 0xde, 0x58, 0x0f, 0x55, 0xde, 0x33, 0xf6,
|
0x94,0xaf,0x4b,0xde,0x58,0x0f,0x55,0xde,0x33,0xf6,
|
||||||
0xe3, 0xd6, 0x34, 0x36, 0x57, 0xd6, 0x79, 0x91, 0x2e, 0xbe,
|
0xe3,0xd6,0x34,0x36,0x57,0xd6,0x79,0x91,0x2e,0xbe,
|
||||||
0x3b, 0xd9, 0x4e, 0xb6, 0x9d, 0x21, 0x5c, 0xd3, 0x48, 0x14,
|
0x3b,0xd9,0x4e,0xb6,0x9d,0x21,0x5c,0xd3,0x48,0x14,
|
||||||
0x7f, 0x4a, 0xc4, 0x60, 0xa9, 0x29, 0xf8, 0x53, 0x7f, 0x88,
|
0x7f,0x4a,0xc4,0x60,0xa9,0x29,0xf8,0x53,0x7f,0x88,
|
||||||
0x11, 0x2d, 0xb5, 0xc5, 0x2d, 0x6f, 0xee, 0x85, 0x0b, 0xf7,
|
0x11,0x2d,0xb5,0xc5,0x2d,0x6f,0xee,0x85,0x0b,0xf7,
|
||||||
0x8d, 0x9a, 0xbe, 0xb0, 0x42, 0xf2, 0x2e, 0x71, 0xaf, 0x19,
|
0x8d,0x9a,0xbe,0xb0,0x42,0xf2,0x2e,0x71,0xaf,0x19,
|
||||||
0x31, 0x6d, 0xec, 0xcd, 0x6f, 0x2b, 0x23, 0xdf, 0xb4, 0x40,
|
0x31,0x6d,0xec,0xcd,0x6f,0x2b,0x23,0xdf,0xb4,0x40,
|
||||||
0xaf, 0x2c, 0x0a, 0xc3, 0x1b, 0x7d, 0x7d, 0x03, 0x1d, 0x4b,
|
0xaf,0x2c,0x0a,0xc3,0x1b,0x7d,0x7d,0x03,0x1d,0x4b,
|
||||||
0xf3, 0xb5, 0xe0, 0x85, 0xd8, 0xdf, 0x91, 0x6b, 0x0a, 0x69,
|
0xf3,0xb5,0xe0,0x85,0xd8,0xdf,0x91,0x6b,0x0a,0x69,
|
||||||
0xf7, 0xf2, 0x69, 0x66, 0x5b, 0xf1, 0xcf, 0x46, 0x7d, 0xe9,
|
0xf7,0xf2,0x69,0x66,0x5b,0xf1,0xcf,0x46,0x7d,0xe9,
|
||||||
0x70, 0xfa, 0x6d, 0x7e, 0x75, 0x4e, 0xa9, 0x77, 0xe6, 0x8c,
|
0x70,0xfa,0x6d,0x7e,0x75,0x4e,0xa9,0x77,0xe6,0x8c,
|
||||||
0x02, 0xf7, 0x14, 0x4d, 0xa5, 0x41, 0x8f, 0x3f, 0xc1, 0x62,
|
0x02,0xf7,0x14,0x4d,0xa5,0x41,0x8f,0x3f,0xc1,0x62,
|
||||||
0x1e, 0x71, 0x5e, 0x38, 0xb4, 0xd6, 0xe6, 0xe1, 0x4b, 0xc2,
|
0x1e,0x71,0x5e,0x38,0xb4,0xd6,0xe6,0xe1,0x4b,0xc2,
|
||||||
0x2c, 0x30, 0x83, 0x81, 0x6f, 0x49, 0x2e, 0x96, 0xe6, 0xc9,
|
0x2c,0x30,0x83,0x81,0x6f,0x49,0x2e,0x96,0xe6,0xc9,
|
||||||
0x9a, 0xf7, 0x5d, 0x09, 0xa0, 0x55, 0x02, 0xa5, 0x3a, 0x25,
|
0x9a,0xf7,0x5d,0x09,0xa0,0x55,0x02,0xa5,0x3a,0x25,
|
||||||
0x23, 0xd0, 0x92, 0xc3, 0xa3, 0xe3, 0x0e, 0x12, 0x2f, 0x4d,
|
0x23,0xd0,0x92,0xc3,0xa3,0xe3,0x0e,0x12,0x2f,0x4d,
|
||||||
0xef, 0xf3, 0x55, 0x5a, 0xbe, 0xe6, 0x19, 0x86, 0x31, 0xab,
|
0xef,0xf3,0x55,0x5a,0xbe,0xe6,0x19,0x86,0x31,0xab,
|
||||||
0x75, 0x9a, 0xd3, 0xf0, 0x2c, 0xc5, 0x41, 0x92, 0xd9, 0x1f,
|
0x75,0x9a,0xd3,0xf0,0x2c,0xc5,0x41,0x92,0xd9,0x1f,
|
||||||
0x5f, 0x11, 0x8c, 0x75, 0x1c, 0x63, 0xd0, 0x02, 0x80, 0x2c,
|
0x5f,0x11,0x8c,0x75,0x1c,0x63,0xd0,0x02,0x80,0x2c,
|
||||||
0x68, 0xcb, 0x93, 0xfb, 0x51, 0x73, 0x49, 0xb4, 0x60, 0xda,
|
0x68,0xcb,0x93,0xfb,0x51,0x73,0x49,0xb4,0x60,0xda,
|
||||||
0xe2, 0x26, 0xaf, 0xa9, 0x46, 0x12, 0xb8, 0xec, 0x50, 0xdd,
|
0xe2,0x26,0xaf,0xa9,0x46,0x12,0xb8,0xec,0x50,0xdd,
|
||||||
0x12, 0x06, 0x5f, 0xce, 0x59, 0xe6, 0xf6, 0x1c, 0xe0, 0x54,
|
0x12,0x06,0x5f,0xce,0x59,0xe6,0xf6,0x1c,0xe0,0x54,
|
||||||
0x10, 0xad, 0xf6, 0xcd, 0x98, 0xcc, 0x0f, 0xfb, 0xcb, 0x41,
|
0x10,0xad,0xf6,0xcd,0x98,0xcc,0x0f,0xfb,0xcb,0x41,
|
||||||
0x14, 0x9d, 0xed, 0xe4, 0xb4, 0x74, 0x5f, 0x09, 0x60, 0xc7,
|
0x14,0x9d,0xed,0xe4,0xb4,0x74,0x5f,0x09,0x60,0xc7,
|
||||||
0x12, 0xf6, 0x7b, 0x3c, 0x8f, 0xa7, 0x20, 0xbc, 0xe4, 0xb1,
|
0x12,0xf6,0x7b,0x3c,0x8f,0xa7,0x20,0xbc,0xe4,0xb1,
|
||||||
0xef, 0xeb, 0xa4, 0x93, 0xc5, 0x06, 0xca, 0x9a, 0x27, 0x9d,
|
0xef,0xeb,0xa4,0x93,0xc5,0x06,0xca,0x9a,0x27,0x9d,
|
||||||
0x87, 0xf3, 0xde, 0xca, 0xe5, 0xe7, 0xf6, 0x1c, 0x01, 0x65,
|
0x87,0xf3,0xde,0xca,0xe5,0xe7,0xf6,0x1c,0x01,0x65,
|
||||||
0x5b, 0xfb, 0x19, 0x79, 0x6e, 0x08, 0x26, 0xc5, 0xc8, 0x28,
|
0x5b,0xfb,0x19,0x79,0x6e,0x08,0x26,0xc5,0xc8,0x28,
|
||||||
0x0e, 0xb6, 0x3b, 0x07, 0x08, 0xc1, 0x02, 0x82, 0x01, 0x01,
|
0x0e,0xb6,0x3b,0x07,0x08,0xc1,0x02,0x82,0x01,0x01,
|
||||||
0x00, 0xe8, 0x1c, 0x73, 0xa6, 0xb8, 0xe0, 0x0e, 0x6d, 0x8d,
|
0x00,0xe8,0x1c,0x73,0xa6,0xb8,0xe0,0x0e,0x6d,0x8d,
|
||||||
0x1b, 0xb9, 0x53, 0xed, 0x58, 0x94, 0xe6, 0x1d, 0x60, 0x14,
|
0x1b,0xb9,0x53,0xed,0x58,0x94,0xe6,0x1d,0x60,0x14,
|
||||||
0x5c, 0x76, 0x43, 0xc4, 0x58, 0x19, 0xc4, 0x24, 0xe8, 0xbc,
|
0x5c,0x76,0x43,0xc4,0x58,0x19,0xc4,0x24,0xe8,0xbc,
|
||||||
0x1b, 0x3b, 0x0b, 0x13, 0x24, 0x45, 0x54, 0x0e, 0xcc, 0x37,
|
0x1b,0x3b,0x0b,0x13,0x24,0x45,0x54,0x0e,0xcc,0x37,
|
||||||
0xf0, 0xe0, 0x63, 0x7d, 0xc3, 0xf7, 0xfb, 0x81, 0x74, 0x81,
|
0xf0,0xe0,0x63,0x7d,0xc3,0xf7,0xfb,0x81,0x74,0x81,
|
||||||
0xc4, 0x0f, 0x1a, 0x21, 0x48, 0xaf, 0xce, 0xc1, 0xc4, 0x94,
|
0xc4,0x0f,0x1a,0x21,0x48,0xaf,0xce,0xc1,0xc4,0x94,
|
||||||
0x18, 0x06, 0x44, 0x8d, 0xd3, 0xd2, 0x22, 0x2d, 0x2d, 0x3e,
|
0x18,0x06,0x44,0x8d,0xd3,0xd2,0x22,0x2d,0x2d,0x3e,
|
||||||
0x5a, 0x31, 0xdc, 0x95, 0x8e, 0xf4, 0x41, 0xfc, 0x58, 0xc9,
|
0x5a,0x31,0xdc,0x95,0x8e,0xf4,0x41,0xfc,0x58,0xc9,
|
||||||
0x40, 0x92, 0x17, 0x5f, 0xe3, 0xda, 0xac, 0x9e, 0x3f, 0x1c,
|
0x40,0x92,0x17,0x5f,0xe3,0xda,0xac,0x9e,0x3f,0x1c,
|
||||||
0x2a, 0x6b, 0x58, 0x5f, 0x48, 0x78, 0x20, 0xb1, 0xaf, 0x24,
|
0x2a,0x6b,0x58,0x5f,0x48,0x78,0x20,0xb1,0xaf,0x24,
|
||||||
0x9b, 0x3c, 0x20, 0x8b, 0x93, 0x25, 0x9e, 0xe6, 0x6b, 0xbc,
|
0x9b,0x3c,0x20,0x8b,0x93,0x25,0x9e,0xe6,0x6b,0xbc,
|
||||||
0x13, 0x42, 0x14, 0x6c, 0x36, 0x31, 0xff, 0x7a, 0xd1, 0xc1,
|
0x13,0x42,0x14,0x6c,0x36,0x31,0xff,0x7a,0xd1,0xc1,
|
||||||
0x1a, 0x26, 0x14, 0x7f, 0xa9, 0x76, 0xa7, 0x0c, 0xf8, 0xcc,
|
0x1a,0x26,0x14,0x7f,0xa9,0x76,0xa7,0x0c,0xf8,0xcc,
|
||||||
0xed, 0x07, 0x6a, 0xd2, 0xdf, 0x62, 0xee, 0x0a, 0x7c, 0x84,
|
0xed,0x07,0x6a,0xd2,0xdf,0x62,0xee,0x0a,0x7c,0x84,
|
||||||
0xcb, 0x49, 0x90, 0xb2, 0x03, 0x0d, 0xa2, 0x82, 0x06, 0x77,
|
0xcb,0x49,0x90,0xb2,0x03,0x0d,0xa2,0x82,0x06,0x77,
|
||||||
0xf1, 0xcd, 0x67, 0xf2, 0x47, 0x21, 0x02, 0x3f, 0x43, 0x21,
|
0xf1,0xcd,0x67,0xf2,0x47,0x21,0x02,0x3f,0x43,0x21,
|
||||||
0xf0, 0x46, 0x30, 0x62, 0x51, 0x72, 0xb1, 0xe7, 0x48, 0xc6,
|
0xf0,0x46,0x30,0x62,0x51,0x72,0xb1,0xe7,0x48,0xc6,
|
||||||
0x67, 0x12, 0xcd, 0x9e, 0xd6, 0x15, 0xe5, 0x21, 0xed, 0xfa,
|
0x67,0x12,0xcd,0x9e,0xd6,0x15,0xe5,0x21,0xed,0xfa,
|
||||||
0x8f, 0x30, 0xa6, 0x41, 0xfe, 0xb6, 0xfa, 0x8f, 0x34, 0x14,
|
0x8f,0x30,0xa6,0x41,0xfe,0xb6,0xfa,0x8f,0x34,0x14,
|
||||||
0x19, 0xe8, 0x11, 0xf7, 0xa5, 0x77, 0x3e, 0xb7, 0xf9, 0x39,
|
0x19,0xe8,0x11,0xf7,0xa5,0x77,0x3e,0xb7,0xf9,0x39,
|
||||||
0x07, 0x8c, 0x67, 0x2a, 0xab, 0x7b, 0x08, 0xf8, 0xb0, 0x06,
|
0x07,0x8c,0x67,0x2a,0xab,0x7b,0x08,0xf8,0xb0,0x06,
|
||||||
0xa8, 0xea, 0x2f, 0x8f, 0xfa, 0xcc, 0xcc, 0x40, 0xce, 0xf3,
|
0xa8,0xea,0x2f,0x8f,0xfa,0xcc,0xcc,0x40,0xce,0xf3,
|
||||||
0x70, 0x4f, 0x3f, 0x7f, 0xe2, 0x0c, 0xea, 0x76, 0x4a, 0x35,
|
0x70,0x4f,0x3f,0x7f,0xe2,0x0c,0xea,0x76,0x4a,0x35,
|
||||||
0x4e, 0x47, 0xad, 0x2b, 0xa7, 0x97, 0x5d, 0x74, 0x43, 0x97,
|
0x4e,0x47,0xad,0x2b,0xa7,0x97,0x5d,0x74,0x43,0x97,
|
||||||
0x90, 0xd2, 0xfb, 0xd9, 0xf9, 0x96, 0x01, 0x33, 0x05, 0xed,
|
0x90,0xd2,0xfb,0xd9,0xf9,0x96,0x01,0x33,0x05,0xed,
|
||||||
0x7b, 0x03, 0x05, 0xad, 0xf8, 0x49, 0x03, 0x02, 0x82, 0x01,
|
0x7b,0x03,0x05,0xad,0xf8,0x49,0x03,0x02,0x82,0x01,
|
||||||
0x01, 0x00, 0xd4, 0x40, 0x17, 0x66, 0x10, 0x92, 0x95, 0xc8,
|
0x01,0x00,0xd4,0x40,0x17,0x66,0x10,0x92,0x95,0xc8,
|
||||||
0xec, 0x62, 0xa9, 0x7a, 0xcb, 0x93, 0x8e, 0xe6, 0x53, 0xd4,
|
0xec,0x62,0xa9,0x7a,0xcb,0x93,0x8e,0xe6,0x53,0xd4,
|
||||||
0x80, 0x48, 0x27, 0x4b, 0x41, 0xce, 0x61, 0xdf, 0xbf, 0x94,
|
0x80,0x48,0x27,0x4b,0x41,0xce,0x61,0xdf,0xbf,0x94,
|
||||||
0xa4, 0x3d, 0x71, 0x03, 0x0b, 0xed, 0x25, 0x71, 0x98, 0xa4,
|
0xa4,0x3d,0x71,0x03,0x0b,0xed,0x25,0x71,0x98,0xa4,
|
||||||
0xd6, 0xd5, 0x4a, 0x57, 0xf5, 0x6c, 0x1b, 0xda, 0x21, 0x7d,
|
0xd6,0xd5,0x4a,0x57,0xf5,0x6c,0x1b,0xda,0x21,0x7d,
|
||||||
0x35, 0x45, 0xb3, 0xf3, 0x6a, 0xd9, 0xd3, 0x43, 0xe8, 0x5c,
|
0x35,0x45,0xb3,0xf3,0x6a,0xd9,0xd3,0x43,0xe8,0x5c,
|
||||||
0x54, 0x1c, 0x83, 0x1b, 0xb4, 0x5f, 0xf2, 0x97, 0x24, 0x2e,
|
0x54,0x1c,0x83,0x1b,0xb4,0x5f,0xf2,0x97,0x24,0x2e,
|
||||||
0xdc, 0x40, 0xde, 0x92, 0x23, 0x59, 0x8e, 0xbc, 0xd2, 0xa1,
|
0xdc,0x40,0xde,0x92,0x23,0x59,0x8e,0xbc,0xd2,0xa1,
|
||||||
0xf2, 0xe0, 0x4c, 0xdd, 0x0b, 0xd1, 0xe7, 0xae, 0x65, 0xbc,
|
0xf2,0xe0,0x4c,0xdd,0x0b,0xd1,0xe7,0xae,0x65,0xbc,
|
||||||
0xb5, 0xf5, 0x5b, 0x98, 0xe9, 0xd7, 0xc2, 0xb7, 0x0e, 0x55,
|
0xb5,0xf5,0x5b,0x98,0xe9,0xd7,0xc2,0xb7,0x0e,0x55,
|
||||||
0x71, 0x0e, 0x3c, 0x0a, 0x24, 0x6b, 0xa6, 0xe6, 0x14, 0x61,
|
0x71,0x0e,0x3c,0x0a,0x24,0x6b,0xa6,0xe6,0x14,0x61,
|
||||||
0x11, 0xfd, 0x33, 0x42, 0x99, 0x2b, 0x84, 0x77, 0x74, 0x92,
|
0x11,0xfd,0x33,0x42,0x99,0x2b,0x84,0x77,0x74,0x92,
|
||||||
0x91, 0xf5, 0x79, 0x79, 0xcf, 0xad, 0x8e, 0x04, 0xef, 0x80,
|
0x91,0xf5,0x79,0x79,0xcf,0xad,0x8e,0x04,0xef,0x80,
|
||||||
0x1e, 0x57, 0xf4, 0x14, 0xf5, 0x35, 0x09, 0x74, 0xb2, 0x13,
|
0x1e,0x57,0xf4,0x14,0xf5,0x35,0x09,0x74,0xb2,0x13,
|
||||||
0x71, 0x58, 0x6b, 0xea, 0x32, 0x5d, 0xf3, 0xd3, 0x76, 0x48,
|
0x71,0x58,0x6b,0xea,0x32,0x5d,0xf3,0xd3,0x76,0x48,
|
||||||
0x39, 0x10, 0x23, 0x84, 0x9d, 0xbe, 0x92, 0x77, 0x4a, 0xed,
|
0x39,0x10,0x23,0x84,0x9d,0xbe,0x92,0x77,0x4a,0xed,
|
||||||
0x70, 0x3e, 0x1a, 0xa2, 0x6c, 0xb3, 0x81, 0x00, 0xc3, 0xc9,
|
0x70,0x3e,0x1a,0xa2,0x6c,0xb3,0x81,0x00,0xc3,0xc9,
|
||||||
0xe4, 0x52, 0xc8, 0x24, 0x88, 0x0c, 0x41, 0xad, 0x87, 0x5a,
|
0xe4,0x52,0xc8,0x24,0x88,0x0c,0x41,0xad,0x87,0x5a,
|
||||||
0xea, 0xa3, 0x7a, 0x85, 0x1c, 0x5e, 0x31, 0x7f, 0xc3, 0x35,
|
0xea,0xa3,0x7a,0x85,0x1c,0x5e,0x31,0x7f,0xc3,0x35,
|
||||||
0xc6, 0xfa, 0x10, 0xc8, 0x75, 0x10, 0xc4, 0x96, 0x99, 0xe7,
|
0xc6,0xfa,0x10,0xc8,0x75,0x10,0xc4,0x96,0x99,0xe7,
|
||||||
0xfe, 0x01, 0xb4, 0x74, 0xdb, 0xb4, 0x11, 0xc3, 0xc8, 0x8c,
|
0xfe,0x01,0xb4,0x74,0xdb,0xb4,0x11,0xc3,0xc8,0x8c,
|
||||||
0xf6, 0xf7, 0x3b, 0x66, 0x50, 0xfc, 0xdb, 0xeb, 0xca, 0x47,
|
0xf6,0xf7,0x3b,0x66,0x50,0xfc,0xdb,0xeb,0xca,0x47,
|
||||||
0x85, 0x89, 0xe1, 0x65, 0xd9, 0x62, 0x34, 0x3c, 0x70, 0xd8,
|
0x85,0x89,0xe1,0x65,0xd9,0x62,0x34,0x3c,0x70,0xd8,
|
||||||
0x2e, 0xb4, 0x2f, 0x65, 0x3c, 0x4a, 0xa6, 0x2a, 0xe7, 0xc7,
|
0x2e,0xb4,0x2f,0x65,0x3c,0x4a,0xa6,0x2a,0xe7,0xc7,
|
||||||
0xd8, 0x41, 0x8f, 0x8a, 0x43, 0xbf, 0x42, 0xf2, 0x4d, 0xbc,
|
0xd8,0x41,0x8f,0x8a,0x43,0xbf,0x42,0xf2,0x4d,0xbc,
|
||||||
0xfc, 0x9e, 0x27, 0x95, 0xfb, 0x75, 0xff, 0xab, 0x02, 0x82,
|
0xfc,0x9e,0x27,0x95,0xfb,0x75,0xff,0xab,0x02,0x82,
|
||||||
0x01, 0x00, 0x41, 0x2f, 0x44, 0x57, 0x6d, 0x12, 0x17, 0x5b,
|
0x01,0x00,0x41,0x2f,0x44,0x57,0x6d,0x12,0x17,0x5b,
|
||||||
0x32, 0xc6, 0xb7, 0x6c, 0x57, 0x7a, 0x8a, 0x0e, 0x79, 0xef,
|
0x32,0xc6,0xb7,0x6c,0x57,0x7a,0x8a,0x0e,0x79,0xef,
|
||||||
0x72, 0xa8, 0x68, 0xda, 0x2d, 0x38, 0xe4, 0xbb, 0x8d, 0xf6,
|
0x72,0xa8,0x68,0xda,0x2d,0x38,0xe4,0xbb,0x8d,0xf6,
|
||||||
0x02, 0x65, 0xcf, 0x56, 0x13, 0xe1, 0x1a, 0xcb, 0x39, 0x80,
|
0x02,0x65,0xcf,0x56,0x13,0xe1,0x1a,0xcb,0x39,0x80,
|
||||||
0xa6, 0xb1, 0x32, 0x03, 0x1e, 0xdd, 0xbb, 0x35, 0xd9, 0xac,
|
0xa6,0xb1,0x32,0x03,0x1e,0xdd,0xbb,0x35,0xd9,0xac,
|
||||||
0x43, 0x89, 0x31, 0x08, 0x90, 0x92, 0x5e, 0x35, 0x3d, 0x7b,
|
0x43,0x89,0x31,0x08,0x90,0x92,0x5e,0x35,0x3d,0x7b,
|
||||||
0x9c, 0x6f, 0x86, 0xcb, 0x17, 0xdd, 0x85, 0xe4, 0xed, 0x35,
|
0x9c,0x6f,0x86,0xcb,0x17,0xdd,0x85,0xe4,0xed,0x35,
|
||||||
0x08, 0x8e, 0xc1, 0xf4, 0x05, 0xd8, 0x68, 0xc6, 0x63, 0x3c,
|
0x08,0x8e,0xc1,0xf4,0x05,0xd8,0x68,0xc6,0x63,0x3c,
|
||||||
0xf7, 0xff, 0xf7, 0x47, 0x33, 0x39, 0xc5, 0x3e, 0xb7, 0x0e,
|
0xf7,0xff,0xf7,0x47,0x33,0x39,0xc5,0x3e,0xb7,0x0e,
|
||||||
0x58, 0x35, 0x9d, 0x81, 0xea, 0xf8, 0x6a, 0x2c, 0x1c, 0x5a,
|
0x58,0x35,0x9d,0x81,0xea,0xf8,0x6a,0x2c,0x1c,0x5a,
|
||||||
0x68, 0x78, 0x64, 0x11, 0x6b, 0xc1, 0x3e, 0x4e, 0x7a, 0xbd,
|
0x68,0x78,0x64,0x11,0x6b,0xc1,0x3e,0x4e,0x7a,0xbd,
|
||||||
0x84, 0xcb, 0x0f, 0xc2, 0xb6, 0x85, 0x1d, 0xd3, 0x76, 0xc5,
|
0x84,0xcb,0x0f,0xc2,0xb6,0x85,0x1d,0xd3,0x76,0xc5,
|
||||||
0x93, 0x6a, 0x69, 0x89, 0x56, 0x34, 0xdc, 0x4a, 0x9b, 0xbc,
|
0x93,0x6a,0x69,0x89,0x56,0x34,0xdc,0x4a,0x9b,0xbc,
|
||||||
0xff, 0xa8, 0x0d, 0x6e, 0x35, 0x9c, 0x60, 0xa7, 0x23, 0x30,
|
0xff,0xa8,0x0d,0x6e,0x35,0x9c,0x60,0xa7,0x23,0x30,
|
||||||
0xc7, 0x06, 0x64, 0x39, 0x8b, 0x94, 0x89, 0xee, 0xba, 0x7f,
|
0xc7,0x06,0x64,0x39,0x8b,0x94,0x89,0xee,0xba,0x7f,
|
||||||
0x60, 0x8d, 0xfa, 0xb6, 0x97, 0x76, 0xdc, 0x51, 0x4a, 0x3c,
|
0x60,0x8d,0xfa,0xb6,0x97,0x76,0xdc,0x51,0x4a,0x3c,
|
||||||
0xeb, 0x3a, 0x14, 0x2c, 0x20, 0x60, 0x69, 0x4a, 0x86, 0xfe,
|
0xeb,0x3a,0x14,0x2c,0x20,0x60,0x69,0x4a,0x86,0xfe,
|
||||||
0x8c, 0x21, 0x84, 0x49, 0x54, 0xb3, 0x20, 0xe1, 0x01, 0x7f,
|
0x8c,0x21,0x84,0x49,0x54,0xb3,0x20,0xe1,0x01,0x7f,
|
||||||
0x58, 0xdf, 0x7f, 0xb5, 0x21, 0x51, 0x8c, 0x47, 0x9f, 0x91,
|
0x58,0xdf,0x7f,0xb5,0x21,0x51,0x8c,0x47,0x9f,0x91,
|
||||||
0xeb, 0x97, 0x3e, 0xf2, 0x54, 0xcf, 0x16, 0x46, 0xf9, 0xd9,
|
0xeb,0x97,0x3e,0xf2,0x54,0xcf,0x16,0x46,0xf9,0xd9,
|
||||||
0xb6, 0xe7, 0x64, 0xc9, 0xd0, 0x54, 0xea, 0x2f, 0xa1, 0xcf,
|
0xb6,0xe7,0x64,0xc9,0xd0,0x54,0xea,0x2f,0xa1,0xcf,
|
||||||
0xa5, 0x7f, 0x28, 0x8d, 0x84, 0xec, 0xd5, 0x39, 0x03, 0x76,
|
0xa5,0x7f,0x28,0x8d,0x84,0xec,0xd5,0x39,0x03,0x76,
|
||||||
0x5b, 0x2d, 0x8e, 0x43, 0xf2, 0x01, 0x24, 0xc9, 0x6f, 0xc0,
|
0x5b,0x2d,0x8e,0x43,0xf2,0x01,0x24,0xc9,0x6f,0xc0,
|
||||||
0xf5, 0x69, 0x6f, 0x7d, 0xb5, 0x85, 0xd2, 0x5f, 0x7f, 0x78,
|
0xf5,0x69,0x6f,0x7d,0xb5,0x85,0xd2,0x5f,0x7f,0x78,
|
||||||
0x40, 0x07, 0x7f, 0x09, 0x15, 0xb5, 0x1f, 0x28, 0x65, 0x10,
|
0x40,0x07,0x7f,0x09,0x15,0xb5,0x1f,0x28,0x65,0x10,
|
||||||
0xe4, 0x19, 0xa8, 0xc6, 0x9e, 0x8d, 0xdc, 0xcb, 0x02, 0x82,
|
0xe4,0x19,0xa8,0xc6,0x9e,0x8d,0xdc,0xcb,0x02,0x82,
|
||||||
0x01, 0x00, 0x13, 0x01, 0xee, 0x56, 0x80, 0x93, 0x70, 0x00,
|
0x01,0x00,0x13,0x01,0xee,0x56,0x80,0x93,0x70,0x00,
|
||||||
0x7f, 0x52, 0xd2, 0x94, 0xa1, 0x98, 0x84, 0x4a, 0x92, 0x25,
|
0x7f,0x52,0xd2,0x94,0xa1,0x98,0x84,0x4a,0x92,0x25,
|
||||||
0x4c, 0x9b, 0xa9, 0x91, 0x2e, 0xc2, 0x79, 0xb7, 0x5c, 0xe3,
|
0x4c,0x9b,0xa9,0x91,0x2e,0xc2,0x79,0xb7,0x5c,0xe3,
|
||||||
0xc5, 0xd5, 0x8e, 0xc2, 0x54, 0x16, 0x17, 0xad, 0x55, 0x9b,
|
0xc5,0xd5,0x8e,0xc2,0x54,0x16,0x17,0xad,0x55,0x9b,
|
||||||
0x25, 0x76, 0x12, 0x63, 0x50, 0x22, 0x2f, 0x58, 0x58, 0x79,
|
0x25,0x76,0x12,0x63,0x50,0x22,0x2f,0x58,0x58,0x79,
|
||||||
0x6b, 0x04, 0xe3, 0xf9, 0x9f, 0x8f, 0x04, 0x41, 0x67, 0x94,
|
0x6b,0x04,0xe3,0xf9,0x9f,0x8f,0x04,0x41,0x67,0x94,
|
||||||
0xa5, 0x1f, 0xac, 0x8a, 0x15, 0x9c, 0x26, 0x10, 0x6c, 0xf8,
|
0xa5,0x1f,0xac,0x8a,0x15,0x9c,0x26,0x10,0x6c,0xf8,
|
||||||
0x19, 0x57, 0x61, 0xd7, 0x3a, 0x7d, 0x31, 0xb0, 0x2d, 0x38,
|
0x19,0x57,0x61,0xd7,0x3a,0x7d,0x31,0xb0,0x2d,0x38,
|
||||||
0xbd, 0x94, 0x62, 0xad, 0xc4, 0xfa, 0x36, 0x42, 0x42, 0xf0,
|
0xbd,0x94,0x62,0xad,0xc4,0xfa,0x36,0x42,0x42,0xf0,
|
||||||
0x24, 0x67, 0x65, 0x9d, 0x8b, 0x0b, 0x7c, 0x6f, 0x82, 0x44,
|
0x24,0x67,0x65,0x9d,0x8b,0x0b,0x7c,0x6f,0x82,0x44,
|
||||||
0x1a, 0x8c, 0xc8, 0xc9, 0xab, 0xbb, 0x4c, 0x45, 0xfc, 0x7b,
|
0x1a,0x8c,0xc8,0xc9,0xab,0xbb,0x4c,0x45,0xfc,0x7b,
|
||||||
0x38, 0xee, 0x30, 0xe1, 0xfc, 0xef, 0x8d, 0xbc, 0x58, 0xdf,
|
0x38,0xee,0x30,0xe1,0xfc,0xef,0x8d,0xbc,0x58,0xdf,
|
||||||
0x2b, 0x5d, 0x0d, 0x54, 0xe0, 0x49, 0x4d, 0x97, 0x99, 0x8f,
|
0x2b,0x5d,0x0d,0x54,0xe0,0x49,0x4d,0x97,0x99,0x8f,
|
||||||
0x22, 0xa8, 0x83, 0xbe, 0x40, 0xbb, 0x50, 0x2e, 0x78, 0x28,
|
0x22,0xa8,0x83,0xbe,0x40,0xbb,0x50,0x2e,0x78,0x28,
|
||||||
0x0f, 0x95, 0x78, 0x8c, 0x8f, 0x98, 0x24, 0x56, 0xc2, 0x97,
|
0x0f,0x95,0x78,0x8c,0x8f,0x98,0x24,0x56,0xc2,0x97,
|
||||||
0xf3, 0x2c, 0x43, 0xd2, 0x03, 0x82, 0x66, 0x81, 0x72, 0x5f,
|
0xf3,0x2c,0x43,0xd2,0x03,0x82,0x66,0x81,0x72,0x5f,
|
||||||
0x53, 0x16, 0xec, 0xb1, 0xb1, 0x04, 0x5e, 0x40, 0x20, 0x48,
|
0x53,0x16,0xec,0xb1,0xb1,0x04,0x5e,0x40,0x20,0x48,
|
||||||
0x7b, 0x3f, 0x02, 0x97, 0x6a, 0xeb, 0x96, 0x12, 0x21, 0x35,
|
0x7b,0x3f,0x02,0x97,0x6a,0xeb,0x96,0x12,0x21,0x35,
|
||||||
0xfe, 0x1f, 0x47, 0xc0, 0x95, 0xea, 0xc5, 0x8a, 0x08, 0x84,
|
0xfe,0x1f,0x47,0xc0,0x95,0xea,0xc5,0x8a,0x08,0x84,
|
||||||
0x4f, 0x5e, 0x63, 0x94, 0x60, 0x0f, 0x71, 0x5b, 0x7f, 0x4a,
|
0x4f,0x5e,0x63,0x94,0x60,0x0f,0x71,0x5b,0x7f,0x4a,
|
||||||
0xec, 0x4f, 0x60, 0xc6, 0xba, 0x4a, 0x24, 0xf1, 0x20, 0x8b,
|
0xec,0x4f,0x60,0xc6,0xba,0x4a,0x24,0xf1,0x20,0x8b,
|
||||||
0xa7, 0x2e, 0x3a, 0xce, 0x8d, 0xe0, 0x27, 0x1d, 0xb5, 0x8e,
|
0xa7,0x2e,0x3a,0xce,0x8d,0xe0,0x27,0x1d,0xb5,0x8e,
|
||||||
0xb4, 0x21, 0xc5, 0xe2, 0xa6, 0x16, 0x0a, 0x51, 0x83, 0x55,
|
0xb4,0x21,0xc5,0xe2,0xa6,0x16,0x0a,0x51,0x83,0x55,
|
||||||
0x88, 0xd1, 0x30, 0x11, 0x63, 0xd5, 0xd7, 0x8d, 0xae, 0x16,
|
0x88,0xd1,0x30,0x11,0x63,0xd5,0xd7,0x8d,0xae,0x16,
|
||||||
0x12, 0x82, 0xc4, 0x85, 0x00, 0x4e, 0x27, 0x83, 0xa5, 0x7c,
|
0x12,0x82,0xc4,0x85,0x00,0x4e,0x27,0x83,0xa5,0x7c,
|
||||||
0x90, 0x2e, 0xe5, 0xa2, 0xa3, 0xd3, 0x4c, 0x63, 0x02, 0x82,
|
0x90,0x2e,0xe5,0xa2,0xa3,0xd3,0x4c,0x63,0x02,0x82,
|
||||||
0x01, 0x01, 0x00, 0x86, 0x08, 0x98, 0x98, 0xa5, 0x00, 0x05,
|
0x01,0x01,0x00,0x86,0x08,0x98,0x98,0xa5,0x00,0x05,
|
||||||
0x39, 0x77, 0xd9, 0x66, 0xb3, 0xcf, 0xca, 0xa0, 0x71, 0xb3,
|
0x39,0x77,0xd9,0x66,0xb3,0xcf,0xca,0xa0,0x71,0xb3,
|
||||||
0x50, 0xce, 0x3d, 0xb1, 0x93, 0x95, 0x35, 0xc4, 0xd4, 0x2e,
|
0x50,0xce,0x3d,0xb1,0x93,0x95,0x35,0xc4,0xd4,0x2e,
|
||||||
0x90, 0xdf, 0x0f, 0xfc, 0x60, 0xc1, 0x94, 0x68, 0x61, 0x43,
|
0x90,0xdf,0x0f,0xfc,0x60,0xc1,0x94,0x68,0x61,0x43,
|
||||||
0xca, 0x9a, 0x23, 0x4a, 0x1e, 0x45, 0x72, 0x99, 0xb5, 0x1e,
|
0xca,0x9a,0x23,0x4a,0x1e,0x45,0x72,0x99,0xb5,0x1e,
|
||||||
0x61, 0x8d, 0x77, 0x0f, 0xa0, 0xbb, 0xd7, 0x77, 0xb4, 0x2a,
|
0x61,0x8d,0x77,0x0f,0xa0,0xbb,0xd7,0x77,0xb4,0x2a,
|
||||||
0x15, 0x11, 0x88, 0x2d, 0xb3, 0x56, 0x61, 0x5e, 0x6a, 0xed,
|
0x15,0x11,0x88,0x2d,0xb3,0x56,0x61,0x5e,0x6a,0xed,
|
||||||
0xa4, 0x46, 0x4a, 0x3f, 0x50, 0x11, 0xd6, 0xba, 0xb6, 0xd7,
|
0xa4,0x46,0x4a,0x3f,0x50,0x11,0xd6,0xba,0xb6,0xd7,
|
||||||
0x95, 0x65, 0x53, 0xc3, 0xa1, 0x8f, 0xe0, 0xa3, 0xf5, 0x1c,
|
0x95,0x65,0x53,0xc3,0xa1,0x8f,0xe0,0xa3,0xf5,0x1c,
|
||||||
0xfd, 0xaf, 0x6e, 0x43, 0xd7, 0x17, 0xa7, 0xd3, 0x81, 0x1b,
|
0xfd,0xaf,0x6e,0x43,0xd7,0x17,0xa7,0xd3,0x81,0x1b,
|
||||||
0xa4, 0xdf, 0xe0, 0x97, 0x8a, 0x46, 0x03, 0xd3, 0x46, 0x0e,
|
0xa4,0xdf,0xe0,0x97,0x8a,0x46,0x03,0xd3,0x46,0x0e,
|
||||||
0x83, 0x48, 0x4e, 0xd2, 0x02, 0xcb, 0xc0, 0xad, 0x79, 0x95,
|
0x83,0x48,0x4e,0xd2,0x02,0xcb,0xc0,0xad,0x79,0x95,
|
||||||
0x8c, 0x96, 0xba, 0x40, 0x34, 0x11, 0x71, 0x5e, 0xe9, 0x11,
|
0x8c,0x96,0xba,0x40,0x34,0x11,0x71,0x5e,0xe9,0x11,
|
||||||
0xf9, 0xc5, 0x4a, 0x5e, 0x91, 0x9d, 0xf5, 0x92, 0x4f, 0xeb,
|
0xf9,0xc5,0x4a,0x5e,0x91,0x9d,0xf5,0x92,0x4f,0xeb,
|
||||||
0xc6, 0x70, 0x02, 0x2d, 0x3d, 0x04, 0xaa, 0xe9, 0x3a, 0x8e,
|
0xc6,0x70,0x02,0x2d,0x3d,0x04,0xaa,0xe9,0x3a,0x8e,
|
||||||
0xd5, 0xa8, 0xad, 0xf7, 0xce, 0x0d, 0x16, 0xb2, 0xec, 0x0a,
|
0xd5,0xa8,0xad,0xf7,0xce,0x0d,0x16,0xb2,0xec,0x0a,
|
||||||
0x9c, 0xf5, 0x94, 0x39, 0xb9, 0x8a, 0xfc, 0x1e, 0xf9, 0xcc,
|
0x9c,0xf5,0x94,0x39,0xb9,0x8a,0xfc,0x1e,0xf9,0xcc,
|
||||||
0xf2, 0x5f, 0x21, 0x31, 0x74, 0x72, 0x6b, 0x64, 0xae, 0x35,
|
0xf2,0x5f,0x21,0x31,0x74,0x72,0x6b,0x64,0xae,0x35,
|
||||||
0x61, 0x8d, 0x0d, 0xcb, 0xe7, 0xda, 0x39, 0xca, 0xf3, 0x21,
|
0x61,0x8d,0x0d,0xcb,0xe7,0xda,0x39,0xca,0xf3,0x21,
|
||||||
0x66, 0x0b, 0x95, 0xd7, 0x0a, 0x7c, 0xca, 0xa1, 0xa9, 0x5a,
|
0x66,0x0b,0x95,0xd7,0x0a,0x7c,0xca,0xa1,0xa9,0x5a,
|
||||||
0xe8, 0xac, 0xe0, 0x71, 0x54, 0xaf, 0x28, 0xcf, 0xd5, 0x70,
|
0xe8,0xac,0xe0,0x71,0x54,0xaf,0x28,0xcf,0xd5,0x70,
|
||||||
0x89, 0xe0, 0xf3, 0x9e, 0x43, 0x6c, 0x8d, 0x7b, 0x99, 0x01,
|
0x89,0xe0,0xf3,0x9e,0x43,0x6c,0x8d,0x7b,0x99,0x01,
|
||||||
0x68, 0x4d, 0xa1, 0x45, 0x46, 0x0c, 0x43, 0xbc, 0xcc, 0x2c,
|
0x68,0x4d,0xa1,0x45,0x46,0x0c,0x43,0xbc,0xcc,0x2c,
|
||||||
0xdd, 0xc5, 0x46, 0xc8, 0x4e, 0x0e, 0xbe, 0xed, 0xb9, 0x26,
|
0xdd,0xc5,0x46,0xc8,0x4e,0x0e,0xbe,0xed,0xb9,0x26,
|
||||||
0xab, 0x2e, 0xdb, 0xeb, 0x8f, 0xff, 0xdb, 0xb0, 0xc6, 0x55,
|
0xab,0x2e,0xdb,0xeb,0x8f,0xff,0xdb,0xb0,0xc6,0x55,
|
||||||
0xaf, 0xf8, 0x2a, 0x91, 0x9d, 0x50, 0x44, 0x21, 0x17,
|
0xaf,0xf8,0x2a,0x91,0x9d,0x50,0x44,0x21,0x17,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -58,10 +58,10 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef INCLUDED_TIMEOUTS_H
|
#ifndef INCLUDED_TIMEOUTS_H
|
||||||
# define INCLUDED_TIMEOUTS_H
|
#define INCLUDED_TIMEOUTS_H
|
||||||
|
|
||||||
/* numbers in us */
|
/* numbers in us */
|
||||||
# define DGRAM_RCV_TIMEOUT 250000
|
#define DGRAM_RCV_TIMEOUT 250000
|
||||||
# define DGRAM_SND_TIMEOUT 250000
|
#define DGRAM_SND_TIMEOUT 250000
|
||||||
|
|
||||||
#endif /* ! INCLUDED_TIMEOUTS_H */
|
#endif /* ! INCLUDED_TIMEOUTS_H */
|
||||||
|
|||||||
471
apps/verify.c
471
apps/verify.c
@@ -67,281 +67,284 @@
|
|||||||
#include <openssl/pem.h>
|
#include <openssl/pem.h>
|
||||||
|
|
||||||
#undef PROG
|
#undef PROG
|
||||||
#define PROG verify_main
|
#define PROG verify_main
|
||||||
|
|
||||||
static int MS_CALLBACK cb(int ok, X509_STORE_CTX *ctx);
|
static int MS_CALLBACK cb(int ok, X509_STORE_CTX *ctx);
|
||||||
static int check(X509_STORE *ctx, char *file,
|
static int check(X509_STORE *ctx, char *file,
|
||||||
STACK_OF(X509) *uchain, STACK_OF(X509) *tchain,
|
STACK_OF(X509) *uchain, STACK_OF(X509) *tchain,
|
||||||
STACK_OF(X509_CRL) *crls, ENGINE *e);
|
STACK_OF(X509_CRL) *crls, ENGINE *e);
|
||||||
static int v_verbose = 0, vflags = 0;
|
static int v_verbose=0, vflags = 0;
|
||||||
|
|
||||||
int MAIN(int, char **);
|
int MAIN(int, char **);
|
||||||
|
|
||||||
int MAIN(int argc, char **argv)
|
int MAIN(int argc, char **argv)
|
||||||
{
|
{
|
||||||
ENGINE *e = NULL;
|
ENGINE *e = NULL;
|
||||||
int i, ret = 1, badarg = 0;
|
int i,ret=1, badarg = 0;
|
||||||
char *CApath = NULL, *CAfile = NULL;
|
char *CApath=NULL,*CAfile=NULL;
|
||||||
char *untfile = NULL, *trustfile = NULL, *crlfile = NULL;
|
char *untfile = NULL, *trustfile = NULL, *crlfile = NULL;
|
||||||
STACK_OF(X509) *untrusted = NULL, *trusted = NULL;
|
STACK_OF(X509) *untrusted = NULL, *trusted = NULL;
|
||||||
STACK_OF(X509_CRL) *crls = NULL;
|
STACK_OF(X509_CRL) *crls = NULL;
|
||||||
X509_STORE *cert_ctx = NULL;
|
X509_STORE *cert_ctx=NULL;
|
||||||
X509_LOOKUP *lookup = NULL;
|
X509_LOOKUP *lookup=NULL;
|
||||||
X509_VERIFY_PARAM *vpm = NULL;
|
X509_VERIFY_PARAM *vpm = NULL;
|
||||||
#ifndef OPENSSL_NO_ENGINE
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
char *engine = NULL;
|
char *engine=NULL;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
cert_ctx = X509_STORE_new();
|
cert_ctx=X509_STORE_new();
|
||||||
if (cert_ctx == NULL)
|
if (cert_ctx == NULL) goto end;
|
||||||
goto end;
|
X509_STORE_set_verify_cb(cert_ctx,cb);
|
||||||
X509_STORE_set_verify_cb(cert_ctx, cb);
|
|
||||||
|
|
||||||
ERR_load_crypto_strings();
|
ERR_load_crypto_strings();
|
||||||
|
|
||||||
apps_startup();
|
apps_startup();
|
||||||
|
|
||||||
if (bio_err == NULL)
|
if (bio_err == NULL)
|
||||||
if ((bio_err = BIO_new(BIO_s_file())) != NULL)
|
if ((bio_err=BIO_new(BIO_s_file())) != NULL)
|
||||||
BIO_set_fp(bio_err, stderr, BIO_NOCLOSE | BIO_FP_TEXT);
|
BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT);
|
||||||
|
|
||||||
if (!load_config(bio_err, NULL))
|
if (!load_config(bio_err, NULL))
|
||||||
goto end;
|
goto end;
|
||||||
|
|
||||||
argc--;
|
argc--;
|
||||||
argv++;
|
argv++;
|
||||||
for (;;) {
|
for (;;)
|
||||||
if (argc >= 1) {
|
{
|
||||||
if (strcmp(*argv, "-CApath") == 0) {
|
if (argc >= 1)
|
||||||
if (argc-- < 1)
|
{
|
||||||
goto end;
|
if (strcmp(*argv,"-CApath") == 0)
|
||||||
CApath = *(++argv);
|
{
|
||||||
} else if (strcmp(*argv, "-CAfile") == 0) {
|
if (argc-- < 1) goto end;
|
||||||
if (argc-- < 1)
|
CApath= *(++argv);
|
||||||
goto end;
|
}
|
||||||
CAfile = *(++argv);
|
else if (strcmp(*argv,"-CAfile") == 0)
|
||||||
} else if (args_verify(&argv, &argc, &badarg, bio_err, &vpm)) {
|
{
|
||||||
if (badarg)
|
if (argc-- < 1) goto end;
|
||||||
goto end;
|
CAfile= *(++argv);
|
||||||
continue;
|
}
|
||||||
} else if (strcmp(*argv, "-untrusted") == 0) {
|
else if (args_verify(&argv, &argc, &badarg, bio_err,
|
||||||
if (argc-- < 1)
|
&vpm))
|
||||||
goto end;
|
{
|
||||||
untfile = *(++argv);
|
if (badarg)
|
||||||
} else if (strcmp(*argv, "-trusted") == 0) {
|
goto end;
|
||||||
if (argc-- < 1)
|
continue;
|
||||||
goto end;
|
}
|
||||||
trustfile = *(++argv);
|
else if (strcmp(*argv,"-untrusted") == 0)
|
||||||
} else if (strcmp(*argv, "-CRLfile") == 0) {
|
{
|
||||||
if (argc-- < 1)
|
if (argc-- < 1) goto end;
|
||||||
goto end;
|
untfile= *(++argv);
|
||||||
crlfile = *(++argv);
|
}
|
||||||
}
|
else if (strcmp(*argv,"-trusted") == 0)
|
||||||
|
{
|
||||||
|
if (argc-- < 1) goto end;
|
||||||
|
trustfile= *(++argv);
|
||||||
|
}
|
||||||
|
else if (strcmp(*argv,"-CRLfile") == 0)
|
||||||
|
{
|
||||||
|
if (argc-- < 1) goto end;
|
||||||
|
crlfile= *(++argv);
|
||||||
|
}
|
||||||
#ifndef OPENSSL_NO_ENGINE
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
else if (strcmp(*argv, "-engine") == 0) {
|
else if (strcmp(*argv,"-engine") == 0)
|
||||||
if (--argc < 1)
|
{
|
||||||
goto end;
|
if (--argc < 1) goto end;
|
||||||
engine = *(++argv);
|
engine= *(++argv);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
else if (strcmp(*argv, "-help") == 0)
|
else if (strcmp(*argv,"-help") == 0)
|
||||||
goto end;
|
goto end;
|
||||||
else if (strcmp(*argv, "-verbose") == 0)
|
else if (strcmp(*argv,"-verbose") == 0)
|
||||||
v_verbose = 1;
|
v_verbose=1;
|
||||||
else if (argv[0][0] == '-')
|
else if (argv[0][0] == '-')
|
||||||
goto end;
|
goto end;
|
||||||
else
|
else
|
||||||
break;
|
break;
|
||||||
argc--;
|
argc--;
|
||||||
argv++;
|
argv++;
|
||||||
} else
|
}
|
||||||
break;
|
else
|
||||||
}
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
#ifndef OPENSSL_NO_ENGINE
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
e = setup_engine(bio_err, engine, 0);
|
e = setup_engine(bio_err, engine, 0);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (vpm)
|
if (vpm)
|
||||||
X509_STORE_set1_param(cert_ctx, vpm);
|
X509_STORE_set1_param(cert_ctx, vpm);
|
||||||
|
|
||||||
lookup = X509_STORE_add_lookup(cert_ctx, X509_LOOKUP_file());
|
lookup=X509_STORE_add_lookup(cert_ctx,X509_LOOKUP_file());
|
||||||
if (lookup == NULL)
|
if (lookup == NULL) abort();
|
||||||
abort();
|
if (CAfile) {
|
||||||
if (CAfile) {
|
i=X509_LOOKUP_load_file(lookup,CAfile,X509_FILETYPE_PEM);
|
||||||
i = X509_LOOKUP_load_file(lookup, CAfile, X509_FILETYPE_PEM);
|
if(!i) {
|
||||||
if (!i) {
|
BIO_printf(bio_err, "Error loading file %s\n", CAfile);
|
||||||
BIO_printf(bio_err, "Error loading file %s\n", CAfile);
|
ERR_print_errors(bio_err);
|
||||||
ERR_print_errors(bio_err);
|
goto end;
|
||||||
goto end;
|
}
|
||||||
}
|
} else X509_LOOKUP_load_file(lookup,NULL,X509_FILETYPE_DEFAULT);
|
||||||
} else
|
|
||||||
X509_LOOKUP_load_file(lookup, NULL, X509_FILETYPE_DEFAULT);
|
|
||||||
|
|
||||||
lookup = X509_STORE_add_lookup(cert_ctx, X509_LOOKUP_hash_dir());
|
lookup=X509_STORE_add_lookup(cert_ctx,X509_LOOKUP_hash_dir());
|
||||||
if (lookup == NULL)
|
if (lookup == NULL) abort();
|
||||||
abort();
|
if (CApath) {
|
||||||
if (CApath) {
|
i=X509_LOOKUP_add_dir(lookup,CApath,X509_FILETYPE_PEM);
|
||||||
i = X509_LOOKUP_add_dir(lookup, CApath, X509_FILETYPE_PEM);
|
if(!i) {
|
||||||
if (!i) {
|
BIO_printf(bio_err, "Error loading directory %s\n", CApath);
|
||||||
BIO_printf(bio_err, "Error loading directory %s\n", CApath);
|
ERR_print_errors(bio_err);
|
||||||
ERR_print_errors(bio_err);
|
goto end;
|
||||||
goto end;
|
}
|
||||||
}
|
} else X509_LOOKUP_add_dir(lookup,NULL,X509_FILETYPE_DEFAULT);
|
||||||
} else
|
|
||||||
X509_LOOKUP_add_dir(lookup, NULL, X509_FILETYPE_DEFAULT);
|
|
||||||
|
|
||||||
ERR_clear_error();
|
ERR_clear_error();
|
||||||
|
|
||||||
if (untfile) {
|
if(untfile)
|
||||||
untrusted = load_certs(bio_err, untfile, FORMAT_PEM,
|
{
|
||||||
NULL, e, "untrusted certificates");
|
untrusted = load_certs(bio_err, untfile, FORMAT_PEM,
|
||||||
if (!untrusted)
|
NULL, e, "untrusted certificates");
|
||||||
goto end;
|
if(!untrusted)
|
||||||
}
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
if (trustfile) {
|
if(trustfile)
|
||||||
trusted = load_certs(bio_err, trustfile, FORMAT_PEM,
|
{
|
||||||
NULL, e, "trusted certificates");
|
trusted = load_certs(bio_err, trustfile, FORMAT_PEM,
|
||||||
if (!trusted)
|
NULL, e, "trusted certificates");
|
||||||
goto end;
|
if(!trusted)
|
||||||
}
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
if (crlfile) {
|
if(crlfile)
|
||||||
crls = load_crls(bio_err, crlfile, FORMAT_PEM, NULL, e, "other CRLs");
|
{
|
||||||
if (!crls)
|
crls = load_crls(bio_err, crlfile, FORMAT_PEM,
|
||||||
goto end;
|
NULL, e, "other CRLs");
|
||||||
}
|
if(!crls)
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
ret = 0;
|
if (argc < 1) check(cert_ctx, NULL, untrusted, trusted, crls, e);
|
||||||
if (argc < 1) {
|
else
|
||||||
if (1 != check(cert_ctx, NULL, untrusted, trusted, crls, e))
|
for (i=0; i<argc; i++)
|
||||||
ret = -1;
|
check(cert_ctx,argv[i], untrusted, trusted, crls, e);
|
||||||
} else {
|
ret=0;
|
||||||
for (i = 0; i < argc; i++)
|
end:
|
||||||
if (1 != check(cert_ctx, argv[i], untrusted, trusted, crls, e))
|
if (ret == 1) {
|
||||||
ret = -1;
|
BIO_printf(bio_err,"usage: verify [-verbose] [-CApath path] [-CAfile file] [-purpose purpose] [-crl_check]");
|
||||||
}
|
|
||||||
|
|
||||||
end:
|
|
||||||
if (ret == 1) {
|
|
||||||
BIO_printf(bio_err,
|
|
||||||
"usage: verify [-verbose] [-CApath path] [-CAfile file] [-purpose purpose] [-crl_check]");
|
|
||||||
BIO_printf(bio_err, " [-no_alt_chains] [-attime timestamp]");
|
|
||||||
#ifndef OPENSSL_NO_ENGINE
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
BIO_printf(bio_err, " [-engine e]");
|
BIO_printf(bio_err," [-engine e]");
|
||||||
#endif
|
#endif
|
||||||
BIO_printf(bio_err, " cert1 cert2 ...\n");
|
BIO_printf(bio_err," cert1 cert2 ...\n");
|
||||||
|
BIO_printf(bio_err,"recognized usages:\n");
|
||||||
BIO_printf(bio_err, "recognized usages:\n");
|
for(i = 0; i < X509_PURPOSE_get_count(); i++) {
|
||||||
for (i = 0; i < X509_PURPOSE_get_count(); i++) {
|
X509_PURPOSE *ptmp;
|
||||||
X509_PURPOSE *ptmp;
|
ptmp = X509_PURPOSE_get0(i);
|
||||||
ptmp = X509_PURPOSE_get0(i);
|
BIO_printf(bio_err, "\t%-10s\t%s\n", X509_PURPOSE_get0_sname(ptmp),
|
||||||
BIO_printf(bio_err, "\t%-10s\t%s\n",
|
X509_PURPOSE_get0_name(ptmp));
|
||||||
X509_PURPOSE_get0_sname(ptmp),
|
}
|
||||||
X509_PURPOSE_get0_name(ptmp));
|
}
|
||||||
}
|
if (vpm) X509_VERIFY_PARAM_free(vpm);
|
||||||
}
|
if (cert_ctx != NULL) X509_STORE_free(cert_ctx);
|
||||||
if (vpm)
|
sk_X509_pop_free(untrusted, X509_free);
|
||||||
X509_VERIFY_PARAM_free(vpm);
|
sk_X509_pop_free(trusted, X509_free);
|
||||||
if (cert_ctx != NULL)
|
sk_X509_CRL_pop_free(crls, X509_CRL_free);
|
||||||
X509_STORE_free(cert_ctx);
|
apps_shutdown();
|
||||||
sk_X509_pop_free(untrusted, X509_free);
|
OPENSSL_EXIT(ret);
|
||||||
sk_X509_pop_free(trusted, X509_free);
|
}
|
||||||
sk_X509_CRL_pop_free(crls, X509_CRL_free);
|
|
||||||
apps_shutdown();
|
|
||||||
OPENSSL_EXIT(ret < 0 ? 2 : ret);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int check(X509_STORE *ctx, char *file,
|
static int check(X509_STORE *ctx, char *file,
|
||||||
STACK_OF(X509) *uchain, STACK_OF(X509) *tchain,
|
STACK_OF(X509) *uchain, STACK_OF(X509) *tchain,
|
||||||
STACK_OF(X509_CRL) *crls, ENGINE *e)
|
STACK_OF(X509_CRL) *crls, ENGINE *e)
|
||||||
{
|
{
|
||||||
X509 *x = NULL;
|
X509 *x=NULL;
|
||||||
int i = 0, ret = 0;
|
int i=0,ret=0;
|
||||||
X509_STORE_CTX *csc;
|
X509_STORE_CTX *csc;
|
||||||
|
|
||||||
x = load_cert(bio_err, file, FORMAT_PEM, NULL, e, "certificate file");
|
x = load_cert(bio_err, file, FORMAT_PEM, NULL, e, "certificate file");
|
||||||
if (x == NULL)
|
if (x == NULL)
|
||||||
goto end;
|
goto end;
|
||||||
fprintf(stdout, "%s: ", (file == NULL) ? "stdin" : file);
|
fprintf(stdout,"%s: ",(file == NULL)?"stdin":file);
|
||||||
|
|
||||||
csc = X509_STORE_CTX_new();
|
csc = X509_STORE_CTX_new();
|
||||||
if (csc == NULL) {
|
if (csc == NULL)
|
||||||
ERR_print_errors(bio_err);
|
{
|
||||||
goto end;
|
ERR_print_errors(bio_err);
|
||||||
}
|
goto end;
|
||||||
X509_STORE_set_flags(ctx, vflags);
|
}
|
||||||
if (!X509_STORE_CTX_init(csc, ctx, x, uchain)) {
|
X509_STORE_set_flags(ctx, vflags);
|
||||||
ERR_print_errors(bio_err);
|
if(!X509_STORE_CTX_init(csc,ctx,x,uchain))
|
||||||
goto end;
|
{
|
||||||
}
|
ERR_print_errors(bio_err);
|
||||||
if (tchain)
|
goto end;
|
||||||
X509_STORE_CTX_trusted_stack(csc, tchain);
|
}
|
||||||
if (crls)
|
if(tchain) X509_STORE_CTX_trusted_stack(csc, tchain);
|
||||||
X509_STORE_CTX_set0_crls(csc, crls);
|
if (crls)
|
||||||
i = X509_verify_cert(csc);
|
X509_STORE_CTX_set0_crls(csc, crls);
|
||||||
X509_STORE_CTX_free(csc);
|
i=X509_verify_cert(csc);
|
||||||
|
X509_STORE_CTX_free(csc);
|
||||||
|
|
||||||
ret = 0;
|
ret=0;
|
||||||
end:
|
end:
|
||||||
if (i > 0) {
|
if (i > 0)
|
||||||
fprintf(stdout, "OK\n");
|
{
|
||||||
ret = 1;
|
fprintf(stdout,"OK\n");
|
||||||
} else
|
ret=1;
|
||||||
ERR_print_errors(bio_err);
|
}
|
||||||
if (x != NULL)
|
else
|
||||||
X509_free(x);
|
ERR_print_errors(bio_err);
|
||||||
|
if (x != NULL) X509_free(x);
|
||||||
|
|
||||||
return (ret);
|
return(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int MS_CALLBACK cb(int ok, X509_STORE_CTX *ctx)
|
static int MS_CALLBACK cb(int ok, X509_STORE_CTX *ctx)
|
||||||
{
|
{
|
||||||
int cert_error = X509_STORE_CTX_get_error(ctx);
|
int cert_error = X509_STORE_CTX_get_error(ctx);
|
||||||
X509 *current_cert = X509_STORE_CTX_get_current_cert(ctx);
|
X509 *current_cert = X509_STORE_CTX_get_current_cert(ctx);
|
||||||
|
|
||||||
if (!ok) {
|
if (!ok)
|
||||||
if (current_cert) {
|
{
|
||||||
X509_NAME_print_ex_fp(stdout,
|
if (current_cert)
|
||||||
X509_get_subject_name(current_cert),
|
{
|
||||||
0, XN_FLAG_ONELINE);
|
X509_NAME_print_ex_fp(stdout,
|
||||||
printf("\n");
|
X509_get_subject_name(current_cert),
|
||||||
}
|
0, XN_FLAG_ONELINE);
|
||||||
printf("%serror %d at %d depth lookup:%s\n",
|
printf("\n");
|
||||||
X509_STORE_CTX_get0_parent_ctx(ctx) ? "[CRL path]" : "",
|
}
|
||||||
cert_error,
|
printf("%serror %d at %d depth lookup:%s\n",
|
||||||
X509_STORE_CTX_get_error_depth(ctx),
|
X509_STORE_CTX_get0_parent_ctx(ctx) ? "[CRL path]" : "",
|
||||||
X509_verify_cert_error_string(cert_error));
|
cert_error,
|
||||||
switch (cert_error) {
|
X509_STORE_CTX_get_error_depth(ctx),
|
||||||
case X509_V_ERR_NO_EXPLICIT_POLICY:
|
X509_verify_cert_error_string(cert_error));
|
||||||
policies_print(NULL, ctx);
|
switch(cert_error)
|
||||||
case X509_V_ERR_CERT_HAS_EXPIRED:
|
{
|
||||||
|
case X509_V_ERR_NO_EXPLICIT_POLICY:
|
||||||
|
policies_print(NULL, ctx);
|
||||||
|
case X509_V_ERR_CERT_HAS_EXPIRED:
|
||||||
|
|
||||||
/*
|
/* since we are just checking the certificates, it is
|
||||||
* since we are just checking the certificates, it is ok if they
|
* ok if they are self signed. But we should still warn
|
||||||
* are self signed. But we should still warn the user.
|
* the user.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
case X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT:
|
case X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT:
|
||||||
/* Continue after extension errors too */
|
/* Continue after extension errors too */
|
||||||
case X509_V_ERR_INVALID_CA:
|
case X509_V_ERR_INVALID_CA:
|
||||||
case X509_V_ERR_INVALID_NON_CA:
|
case X509_V_ERR_INVALID_NON_CA:
|
||||||
case X509_V_ERR_PATH_LENGTH_EXCEEDED:
|
case X509_V_ERR_PATH_LENGTH_EXCEEDED:
|
||||||
case X509_V_ERR_INVALID_PURPOSE:
|
case X509_V_ERR_INVALID_PURPOSE:
|
||||||
case X509_V_ERR_CRL_HAS_EXPIRED:
|
case X509_V_ERR_CRL_HAS_EXPIRED:
|
||||||
case X509_V_ERR_CRL_NOT_YET_VALID:
|
case X509_V_ERR_CRL_NOT_YET_VALID:
|
||||||
case X509_V_ERR_UNHANDLED_CRITICAL_EXTENSION:
|
case X509_V_ERR_UNHANDLED_CRITICAL_EXTENSION:
|
||||||
ok = 1;
|
ok = 1;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return ok;
|
return ok;
|
||||||
|
|
||||||
}
|
}
|
||||||
if (cert_error == X509_V_OK && ok == 2)
|
if (cert_error == X509_V_OK && ok == 2)
|
||||||
policies_print(NULL, ctx);
|
policies_print(NULL, ctx);
|
||||||
if (!v_verbose)
|
if (!v_verbose)
|
||||||
ERR_clear_error();
|
ERR_clear_error();
|
||||||
return (ok);
|
return(ok);
|
||||||
}
|
}
|
||||||
|
|||||||
125
apps/version.c
125
apps/version.c
@@ -133,82 +133,85 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#undef PROG
|
#undef PROG
|
||||||
#define PROG version_main
|
#define PROG version_main
|
||||||
|
|
||||||
int MAIN(int, char **);
|
int MAIN(int, char **);
|
||||||
|
|
||||||
int MAIN(int argc, char **argv)
|
int MAIN(int argc, char **argv)
|
||||||
{
|
{
|
||||||
int i, ret = 0;
|
int i,ret=0;
|
||||||
int cflags = 0, version = 0, date = 0, options = 0, platform = 0, dir = 0;
|
int cflags=0,version=0,date=0,options=0,platform=0,dir=0;
|
||||||
|
|
||||||
apps_startup();
|
apps_startup();
|
||||||
|
|
||||||
if (bio_err == NULL)
|
if (bio_err == NULL)
|
||||||
if ((bio_err = BIO_new(BIO_s_file())) != NULL)
|
if ((bio_err=BIO_new(BIO_s_file())) != NULL)
|
||||||
BIO_set_fp(bio_err, stderr, BIO_NOCLOSE | BIO_FP_TEXT);
|
BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT);
|
||||||
|
|
||||||
if (argc == 1)
|
if (argc == 1) version=1;
|
||||||
version = 1;
|
for (i=1; i<argc; i++)
|
||||||
for (i = 1; i < argc; i++) {
|
{
|
||||||
if (strcmp(argv[i], "-v") == 0)
|
if (strcmp(argv[i],"-v") == 0)
|
||||||
version = 1;
|
version=1;
|
||||||
else if (strcmp(argv[i], "-b") == 0)
|
else if (strcmp(argv[i],"-b") == 0)
|
||||||
date = 1;
|
date=1;
|
||||||
else if (strcmp(argv[i], "-f") == 0)
|
else if (strcmp(argv[i],"-f") == 0)
|
||||||
cflags = 1;
|
cflags=1;
|
||||||
else if (strcmp(argv[i], "-o") == 0)
|
else if (strcmp(argv[i],"-o") == 0)
|
||||||
options = 1;
|
options=1;
|
||||||
else if (strcmp(argv[i], "-p") == 0)
|
else if (strcmp(argv[i],"-p") == 0)
|
||||||
platform = 1;
|
platform=1;
|
||||||
else if (strcmp(argv[i], "-d") == 0)
|
else if (strcmp(argv[i],"-d") == 0)
|
||||||
dir = 1;
|
dir=1;
|
||||||
else if (strcmp(argv[i], "-a") == 0)
|
else if (strcmp(argv[i],"-a") == 0)
|
||||||
date = version = cflags = options = platform = dir = 1;
|
date=version=cflags=options=platform=dir=1;
|
||||||
else {
|
else
|
||||||
BIO_printf(bio_err, "usage:version -[avbofpd]\n");
|
{
|
||||||
ret = 1;
|
BIO_printf(bio_err,"usage:version -[avbofpd]\n");
|
||||||
goto end;
|
ret=1;
|
||||||
}
|
goto end;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (version) {
|
if (version)
|
||||||
if (SSLeay() == SSLEAY_VERSION_NUMBER) {
|
{
|
||||||
printf("%s\n", SSLeay_version(SSLEAY_VERSION));
|
if (SSLeay() == SSLEAY_VERSION_NUMBER)
|
||||||
} else {
|
{
|
||||||
printf("%s (Library: %s)\n",
|
printf("%s\n",SSLeay_version(SSLEAY_VERSION));
|
||||||
OPENSSL_VERSION_TEXT, SSLeay_version(SSLEAY_VERSION));
|
}
|
||||||
}
|
else
|
||||||
}
|
{
|
||||||
if (date)
|
printf("%s (Library: %s)\n",
|
||||||
printf("%s\n", SSLeay_version(SSLEAY_BUILT_ON));
|
OPENSSL_VERSION_TEXT,
|
||||||
if (platform)
|
SSLeay_version(SSLEAY_VERSION));
|
||||||
printf("%s\n", SSLeay_version(SSLEAY_PLATFORM));
|
}
|
||||||
if (options) {
|
}
|
||||||
printf("options: ");
|
if (date) printf("%s\n",SSLeay_version(SSLEAY_BUILT_ON));
|
||||||
printf("%s ", BN_options());
|
if (platform) printf("%s\n",SSLeay_version(SSLEAY_PLATFORM));
|
||||||
|
if (options)
|
||||||
|
{
|
||||||
|
printf("options: ");
|
||||||
|
printf("%s ",BN_options());
|
||||||
#ifndef OPENSSL_NO_MD2
|
#ifndef OPENSSL_NO_MD2
|
||||||
printf("%s ", MD2_options());
|
printf("%s ",MD2_options());
|
||||||
#endif
|
#endif
|
||||||
#ifndef OPENSSL_NO_RC4
|
#ifndef OPENSSL_NO_RC4
|
||||||
printf("%s ", RC4_options());
|
printf("%s ",RC4_options());
|
||||||
#endif
|
#endif
|
||||||
#ifndef OPENSSL_NO_DES
|
#ifndef OPENSSL_NO_DES
|
||||||
printf("%s ", DES_options());
|
printf("%s ",DES_options());
|
||||||
#endif
|
#endif
|
||||||
#ifndef OPENSSL_NO_IDEA
|
#ifndef OPENSSL_NO_IDEA
|
||||||
printf("%s ", idea_options());
|
printf("%s ",idea_options());
|
||||||
#endif
|
#endif
|
||||||
#ifndef OPENSSL_NO_BF
|
#ifndef OPENSSL_NO_BF
|
||||||
printf("%s ", BF_options());
|
printf("%s ",BF_options());
|
||||||
#endif
|
#endif
|
||||||
printf("\n");
|
printf("\n");
|
||||||
}
|
}
|
||||||
if (cflags)
|
if (cflags) printf("%s\n",SSLeay_version(SSLEAY_CFLAGS));
|
||||||
printf("%s\n", SSLeay_version(SSLEAY_CFLAGS));
|
if (dir) printf("%s\n",SSLeay_version(SSLEAY_DIR));
|
||||||
if (dir)
|
end:
|
||||||
printf("%s\n", SSLeay_version(SSLEAY_DIR));
|
apps_shutdown();
|
||||||
end:
|
OPENSSL_EXIT(ret);
|
||||||
apps_shutdown();
|
}
|
||||||
OPENSSL_EXIT(ret);
|
|
||||||
}
|
|
||||||
|
|||||||
170
apps/vms_decc_init.c
Normal file → Executable file
170
apps/vms_decc_init.c
Normal file → Executable file
@@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
#ifdef USE_DECC_INIT
|
#ifdef USE_DECC_INIT
|
||||||
|
|
||||||
/*-
|
/*
|
||||||
* 2010-04-26 SMS.
|
* 2010-04-26 SMS.
|
||||||
*
|
*
|
||||||
*----------------------------------------------------------------------
|
*----------------------------------------------------------------------
|
||||||
@@ -18,9 +18,10 @@
|
|||||||
*----------------------------------------------------------------------
|
*----------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
# include <stdio.h>
|
#include <stdio.h>
|
||||||
# include <stdlib.h>
|
#include <stdlib.h>
|
||||||
# include <unixlib.h>
|
#include <unixlib.h>
|
||||||
|
|
||||||
|
|
||||||
/* Global storage. */
|
/* Global storage. */
|
||||||
|
|
||||||
@@ -28,38 +29,41 @@
|
|||||||
|
|
||||||
int decc_init_done = -1;
|
int decc_init_done = -1;
|
||||||
|
|
||||||
|
|
||||||
/* Structure to hold a DECC$* feature name and its desired value. */
|
/* Structure to hold a DECC$* feature name and its desired value. */
|
||||||
|
|
||||||
typedef struct {
|
typedef struct
|
||||||
|
{
|
||||||
char *name;
|
char *name;
|
||||||
int value;
|
int value;
|
||||||
} decc_feat_t;
|
} decc_feat_t;
|
||||||
|
|
||||||
/*
|
|
||||||
* Array of DECC$* feature names and their desired values. Note:
|
/* Array of DECC$* feature names and their desired values.
|
||||||
* DECC$ARGV_PARSE_STYLE is the urgent one.
|
* Note: DECC$ARGV_PARSE_STYLE is the urgent one.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
decc_feat_t decc_feat_array[] = {
|
decc_feat_t decc_feat_array[] =
|
||||||
/* Preserve command-line case with SET PROCESS/PARSE_STYLE=EXTENDED */
|
{
|
||||||
{"DECC$ARGV_PARSE_STYLE", 1},
|
/* Preserve command-line case with SET PROCESS/PARSE_STYLE=EXTENDED */
|
||||||
|
{ "DECC$ARGV_PARSE_STYLE", 1 },
|
||||||
|
|
||||||
/* Preserve case for file names on ODS5 disks. */
|
/* Preserve case for file names on ODS5 disks. */
|
||||||
{"DECC$EFS_CASE_PRESERVE", 1},
|
{ "DECC$EFS_CASE_PRESERVE", 1 },
|
||||||
|
|
||||||
/*
|
/* Enable multiple dots (and most characters) in ODS5 file names,
|
||||||
* Enable multiple dots (and most characters) in ODS5 file names, while
|
* while preserving VMS-ness of ";version".
|
||||||
* preserving VMS-ness of ";version".
|
*/
|
||||||
*/
|
{ "DECC$EFS_CHARSET", 1 },
|
||||||
{"DECC$EFS_CHARSET", 1},
|
|
||||||
|
|
||||||
/* List terminator. */
|
/* List terminator. */
|
||||||
{(char *)NULL, 0}
|
{ (char *)NULL, 0 }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/* LIB$INITIALIZE initialization function. */
|
/* LIB$INITIALIZE initialization function. */
|
||||||
|
|
||||||
static void decc_init(void)
|
static void decc_init( void)
|
||||||
{
|
{
|
||||||
char *openssl_debug_decc_init;
|
char *openssl_debug_decc_init;
|
||||||
int verbose = 0;
|
int verbose = 0;
|
||||||
@@ -71,10 +75,12 @@ static void decc_init(void)
|
|||||||
int sts;
|
int sts;
|
||||||
|
|
||||||
/* Get debug option. */
|
/* Get debug option. */
|
||||||
openssl_debug_decc_init = getenv("OPENSSL_DEBUG_DECC_INIT");
|
openssl_debug_decc_init = getenv( "OPENSSL_DEBUG_DECC_INIT");
|
||||||
if (openssl_debug_decc_init != NULL) {
|
if (openssl_debug_decc_init != NULL)
|
||||||
verbose = strtol(openssl_debug_decc_init, NULL, 10);
|
{
|
||||||
if (verbose <= 0) {
|
verbose = strtol( openssl_debug_decc_init, NULL, 10);
|
||||||
|
if (verbose <= 0)
|
||||||
|
{
|
||||||
verbose = 1;
|
verbose = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -84,89 +90,99 @@ static void decc_init(void)
|
|||||||
|
|
||||||
/* Loop through all items in the decc_feat_array[]. */
|
/* Loop through all items in the decc_feat_array[]. */
|
||||||
|
|
||||||
for (i = 0; decc_feat_array[i].name != NULL; i++) {
|
for (i = 0; decc_feat_array[ i].name != NULL; i++)
|
||||||
|
{
|
||||||
/* Get the feature index. */
|
/* Get the feature index. */
|
||||||
feat_index = decc$feature_get_index(decc_feat_array[i].name);
|
feat_index = decc$feature_get_index( decc_feat_array[ i].name);
|
||||||
if (feat_index >= 0) {
|
if (feat_index >= 0)
|
||||||
|
{
|
||||||
/* Valid item. Collect its properties. */
|
/* Valid item. Collect its properties. */
|
||||||
feat_value = decc$feature_get_value(feat_index, 1);
|
feat_value = decc$feature_get_value( feat_index, 1);
|
||||||
feat_value_min = decc$feature_get_value(feat_index, 2);
|
feat_value_min = decc$feature_get_value( feat_index, 2);
|
||||||
feat_value_max = decc$feature_get_value(feat_index, 3);
|
feat_value_max = decc$feature_get_value( feat_index, 3);
|
||||||
|
|
||||||
/* Check the validity of our desired value. */
|
/* Check the validity of our desired value. */
|
||||||
if ((decc_feat_array[i].value >= feat_value_min) &&
|
if ((decc_feat_array[ i].value >= feat_value_min) &&
|
||||||
(decc_feat_array[i].value <= feat_value_max)) {
|
(decc_feat_array[ i].value <= feat_value_max))
|
||||||
|
{
|
||||||
/* Valid value. Set it if necessary. */
|
/* Valid value. Set it if necessary. */
|
||||||
if (feat_value != decc_feat_array[i].value) {
|
if (feat_value != decc_feat_array[ i].value)
|
||||||
sts = decc$feature_set_value(feat_index,
|
{
|
||||||
1, decc_feat_array[i].value);
|
sts = decc$feature_set_value( feat_index,
|
||||||
|
1,
|
||||||
|
decc_feat_array[ i].value);
|
||||||
|
|
||||||
if (verbose > 1) {
|
if (verbose > 1)
|
||||||
fprintf(stderr, " %s = %d, sts = %d.\n",
|
{
|
||||||
decc_feat_array[i].name,
|
fprintf( stderr, " %s = %d, sts = %d.\n",
|
||||||
decc_feat_array[i].value, sts);
|
decc_feat_array[ i].name,
|
||||||
}
|
decc_feat_array[ i].value,
|
||||||
|
sts);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
/* Invalid DECC feature value. */
|
|
||||||
fprintf(stderr,
|
|
||||||
" INVALID DECC$FEATURE VALUE, %d: %d <= %s <= %d.\n",
|
|
||||||
feat_value,
|
|
||||||
feat_value_min, decc_feat_array[i].name,
|
|
||||||
feat_value_max);
|
|
||||||
}
|
}
|
||||||
} else {
|
else
|
||||||
|
{
|
||||||
|
/* Invalid DECC feature value. */
|
||||||
|
fprintf( stderr,
|
||||||
|
" INVALID DECC$FEATURE VALUE, %d: %d <= %s <= %d.\n",
|
||||||
|
feat_value,
|
||||||
|
feat_value_min, decc_feat_array[ i].name, feat_value_max);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
/* Invalid DECC feature name. */
|
/* Invalid DECC feature name. */
|
||||||
fprintf(stderr,
|
fprintf( stderr,
|
||||||
" UNKNOWN DECC$FEATURE: %s.\n", decc_feat_array[i].name);
|
" UNKNOWN DECC$FEATURE: %s.\n", decc_feat_array[ i].name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (verbose > 0) {
|
if (verbose > 0)
|
||||||
fprintf(stderr, " DECC_INIT complete.\n");
|
{
|
||||||
|
fprintf( stderr, " DECC_INIT complete.\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Get "decc_init()" into a valid, loaded LIB$INITIALIZE PSECT. */
|
/* Get "decc_init()" into a valid, loaded LIB$INITIALIZE PSECT. */
|
||||||
|
|
||||||
# pragma nostandard
|
#pragma nostandard
|
||||||
|
|
||||||
/*
|
/* Establish the LIB$INITIALIZE PSECTs, with proper alignment and
|
||||||
* Establish the LIB$INITIALIZE PSECTs, with proper alignment and other
|
* other attributes. Note that "nopic" is significant only on VAX.
|
||||||
* attributes. Note that "nopic" is significant only on VAX.
|
|
||||||
*/
|
*/
|
||||||
# pragma extern_model save
|
#pragma extern_model save
|
||||||
|
|
||||||
# if __INITIAL_POINTER_SIZE == 64
|
#if __INITIAL_POINTER_SIZE == 64
|
||||||
# define PSECT_ALIGN 3
|
# define PSECT_ALIGN 3
|
||||||
# else
|
#else
|
||||||
# define PSECT_ALIGN 2
|
# define PSECT_ALIGN 2
|
||||||
# endif
|
#endif
|
||||||
|
|
||||||
# pragma extern_model strict_refdef "LIB$INITIALIZ" PSECT_ALIGN, nopic, nowrt
|
#pragma extern_model strict_refdef "LIB$INITIALIZ" PSECT_ALIGN, nopic, nowrt
|
||||||
const int spare[8] = { 0 };
|
const int spare[ 8] = { 0 };
|
||||||
|
|
||||||
# pragma extern_model strict_refdef "LIB$INITIALIZE" PSECT_ALIGN, nopic, nowrt
|
#pragma extern_model strict_refdef "LIB$INITIALIZE" PSECT_ALIGN, nopic, nowrt
|
||||||
void (*const x_decc_init) () = decc_init;
|
void (*const x_decc_init)() = decc_init;
|
||||||
|
|
||||||
# pragma extern_model restore
|
#pragma extern_model restore
|
||||||
|
|
||||||
/* Fake reference to ensure loading the LIB$INITIALIZE PSECT. */
|
/* Fake reference to ensure loading the LIB$INITIALIZE PSECT. */
|
||||||
|
|
||||||
# pragma extern_model save
|
#pragma extern_model save
|
||||||
|
|
||||||
int LIB$INITIALIZE(void);
|
int LIB$INITIALIZE( void);
|
||||||
|
|
||||||
# pragma extern_model strict_refdef
|
#pragma extern_model strict_refdef
|
||||||
int dmy_lib$initialize = (int)LIB$INITIALIZE;
|
int dmy_lib$initialize = (int) LIB$INITIALIZE;
|
||||||
|
|
||||||
# pragma extern_model restore
|
#pragma extern_model restore
|
||||||
|
|
||||||
# pragma standard
|
#pragma standard
|
||||||
|
|
||||||
#else /* def USE_DECC_INIT */
|
#else /* def USE_DECC_INIT */
|
||||||
|
|
||||||
/* Dummy code to avoid a %CC-W-EMPTYFILE complaint. */
|
/* Dummy code to avoid a %CC-W-EMPTYFILE complaint. */
|
||||||
int decc_init_dummy(void);
|
int decc_init_dummy( void);
|
||||||
|
|
||||||
#endif /* def USE_DECC_INIT */
|
#endif /* def USE_DECC_INIT */
|
||||||
|
|||||||
132
apps/winrand.c
132
apps/winrand.c
@@ -53,8 +53,7 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*-
|
/* Usage: winrand [filename]
|
||||||
* Usage: winrand [filename]
|
|
||||||
*
|
*
|
||||||
* Collects entropy from mouse movements and other events and writes
|
* Collects entropy from mouse movements and other events and writes
|
||||||
* random data to filename or .rnd
|
* random data to filename or .rnd
|
||||||
@@ -68,79 +67,82 @@ LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
|
|||||||
const char *filename;
|
const char *filename;
|
||||||
|
|
||||||
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
|
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
|
||||||
PSTR cmdline, int iCmdShow)
|
PSTR cmdline, int iCmdShow)
|
||||||
{
|
{
|
||||||
static char appname[] = "OpenSSL";
|
static char appname[] = "OpenSSL";
|
||||||
HWND hwnd;
|
HWND hwnd;
|
||||||
MSG msg;
|
MSG msg;
|
||||||
WNDCLASSEX wndclass;
|
WNDCLASSEX wndclass;
|
||||||
char buffer[200];
|
char buffer[200];
|
||||||
|
|
||||||
if (cmdline[0] == '\0')
|
if (cmdline[0] == '\0')
|
||||||
filename = RAND_file_name(buffer, sizeof buffer);
|
filename = RAND_file_name(buffer, sizeof buffer);
|
||||||
else
|
else
|
||||||
filename = cmdline;
|
filename = cmdline;
|
||||||
|
|
||||||
RAND_load_file(filename, -1);
|
RAND_load_file(filename, -1);
|
||||||
|
|
||||||
wndclass.cbSize = sizeof(wndclass);
|
wndclass.cbSize = sizeof(wndclass);
|
||||||
wndclass.style = CS_HREDRAW | CS_VREDRAW;
|
wndclass.style = CS_HREDRAW | CS_VREDRAW;
|
||||||
wndclass.lpfnWndProc = WndProc;
|
wndclass.lpfnWndProc = WndProc;
|
||||||
wndclass.cbClsExtra = 0;
|
wndclass.cbClsExtra = 0;
|
||||||
wndclass.cbWndExtra = 0;
|
wndclass.cbWndExtra = 0;
|
||||||
wndclass.hInstance = hInstance;
|
wndclass.hInstance = hInstance;
|
||||||
wndclass.hIcon = LoadIcon(NULL, IDI_APPLICATION);
|
wndclass.hIcon = LoadIcon(NULL, IDI_APPLICATION);
|
||||||
wndclass.hCursor = LoadCursor(NULL, IDC_ARROW);
|
wndclass.hCursor = LoadCursor(NULL, IDC_ARROW);
|
||||||
wndclass.hbrBackground = (HBRUSH) GetStockObject(WHITE_BRUSH);
|
wndclass.hbrBackground = (HBRUSH) GetStockObject(WHITE_BRUSH);
|
||||||
wndclass.lpszMenuName = NULL;
|
wndclass.lpszMenuName = NULL;
|
||||||
wndclass.lpszClassName = appname;
|
wndclass.lpszClassName = appname;
|
||||||
wndclass.hIconSm = LoadIcon(NULL, IDI_APPLICATION);
|
wndclass.hIconSm = LoadIcon(NULL, IDI_APPLICATION);
|
||||||
RegisterClassEx(&wndclass);
|
RegisterClassEx(&wndclass);
|
||||||
|
|
||||||
hwnd = CreateWindow(appname, OPENSSL_VERSION_TEXT,
|
hwnd = CreateWindow(appname, OPENSSL_VERSION_TEXT,
|
||||||
WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT,
|
WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT,
|
||||||
CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, hInstance,
|
CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, hInstance, NULL);
|
||||||
NULL);
|
|
||||||
|
|
||||||
ShowWindow(hwnd, iCmdShow);
|
ShowWindow(hwnd, iCmdShow);
|
||||||
UpdateWindow(hwnd);
|
UpdateWindow(hwnd);
|
||||||
|
|
||||||
while (GetMessage(&msg, NULL, 0, 0)) {
|
|
||||||
TranslateMessage(&msg);
|
|
||||||
DispatchMessage(&msg);
|
|
||||||
}
|
|
||||||
|
|
||||||
return msg.wParam;
|
while (GetMessage(&msg, NULL, 0, 0))
|
||||||
}
|
{
|
||||||
|
TranslateMessage(&msg);
|
||||||
|
DispatchMessage(&msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
return msg.wParam;
|
||||||
|
}
|
||||||
|
|
||||||
LRESULT CALLBACK WndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
|
LRESULT CALLBACK WndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
|
||||||
{
|
{
|
||||||
HDC hdc;
|
HDC hdc;
|
||||||
PAINTSTRUCT ps;
|
PAINTSTRUCT ps;
|
||||||
RECT rect;
|
RECT rect;
|
||||||
static int seeded = 0;
|
static int seeded = 0;
|
||||||
|
|
||||||
switch (iMsg) {
|
switch (iMsg)
|
||||||
case WM_PAINT:
|
{
|
||||||
hdc = BeginPaint(hwnd, &ps);
|
case WM_PAINT:
|
||||||
GetClientRect(hwnd, &rect);
|
hdc = BeginPaint(hwnd, &ps);
|
||||||
DrawText(hdc, "Seeding the PRNG. Please move the mouse!", -1,
|
GetClientRect(hwnd, &rect);
|
||||||
&rect, DT_SINGLELINE | DT_CENTER | DT_VCENTER);
|
DrawText(hdc, "Seeding the PRNG. Please move the mouse!", -1,
|
||||||
EndPaint(hwnd, &ps);
|
&rect, DT_SINGLELINE | DT_CENTER | DT_VCENTER);
|
||||||
return 0;
|
EndPaint(hwnd, &ps);
|
||||||
|
return 0;
|
||||||
|
|
||||||
case WM_DESTROY:
|
case WM_DESTROY:
|
||||||
PostQuitMessage(0);
|
PostQuitMessage(0);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (RAND_event(iMsg, wParam, lParam) == 1 && seeded == 0) {
|
if (RAND_event(iMsg, wParam, lParam) == 1 && seeded == 0)
|
||||||
seeded = 1;
|
{
|
||||||
if (RAND_write_file(filename) <= 0)
|
seeded = 1;
|
||||||
MessageBox(hwnd, "Couldn't write random file!",
|
if (RAND_write_file(filename) <= 0)
|
||||||
"OpenSSL", MB_OK | MB_ICONERROR);
|
MessageBox(hwnd, "Couldn't write random file!",
|
||||||
PostQuitMessage(0);
|
"OpenSSL", MB_OK | MB_ICONERROR);
|
||||||
}
|
PostQuitMessage(0);
|
||||||
|
}
|
||||||
|
|
||||||
return DefWindowProc(hwnd, iMsg, wParam, lParam);
|
return DefWindowProc(hwnd, iMsg, wParam, lParam);
|
||||||
}
|
}
|
||||||
|
|||||||
2081
apps/x509.c
2081
apps/x509.c
File diff suppressed because it is too large
Load Diff
60
appveyor.yml
60
appveyor.yml
@@ -1,60 +0,0 @@
|
|||||||
platform:
|
|
||||||
- x86
|
|
||||||
- x64
|
|
||||||
|
|
||||||
environment:
|
|
||||||
matrix:
|
|
||||||
- VSVER: 9
|
|
||||||
- VSVER: 10
|
|
||||||
- VSVER: 11
|
|
||||||
- VSVER: 12
|
|
||||||
- VSVER: 14
|
|
||||||
|
|
||||||
configuration:
|
|
||||||
- plain
|
|
||||||
- shared
|
|
||||||
|
|
||||||
matrix:
|
|
||||||
allow_failures:
|
|
||||||
- platform: x64
|
|
||||||
VSVER: 9
|
|
||||||
- platform: x64
|
|
||||||
VSVER: 10
|
|
||||||
- platform: x64
|
|
||||||
VSVER: 11
|
|
||||||
|
|
||||||
before_build:
|
|
||||||
- ps: >-
|
|
||||||
If ($env:Platform -Match "x86") {
|
|
||||||
$env:VCVARS_PLATFORM="x86"
|
|
||||||
$env:TARGET="VC-WIN32"
|
|
||||||
$env:DO="do_ms"
|
|
||||||
} Else {
|
|
||||||
$env:VCVARS_PLATFORM="amd64"
|
|
||||||
$env:TARGET="VC-WIN64A"
|
|
||||||
$env:DO="do_win64a"
|
|
||||||
}
|
|
||||||
- ps: >-
|
|
||||||
If ($env:Configuration -Like "*shared*") {
|
|
||||||
$env:MAK="ntdll.mak"
|
|
||||||
} Else {
|
|
||||||
$env:MAK="nt.mak"
|
|
||||||
}
|
|
||||||
- ps: $env:VSCOMNTOOLS=(Get-Content ("env:VS" + "$env:VSVER" + "0COMNTOOLS"))
|
|
||||||
- call "%VSCOMNTOOLS%\..\..\VC\vcvarsall.bat" %VCVARS_PLATFORM%
|
|
||||||
- perl Configure %TARGET% no-asm
|
|
||||||
- call ms\%DO%
|
|
||||||
|
|
||||||
build_script:
|
|
||||||
- nmake /f ms\%MAK%
|
|
||||||
|
|
||||||
test_script:
|
|
||||||
- nmake /f ms\%MAK% test
|
|
||||||
|
|
||||||
notifications:
|
|
||||||
- provider: Email
|
|
||||||
to:
|
|
||||||
- openssl-commits@openssl.org
|
|
||||||
on_build_success: false
|
|
||||||
on_build_failure: true
|
|
||||||
on_build_status_changed: true
|
|
||||||
37
bugs/alpha.c
37
bugs/alpha.c
@@ -56,13 +56,11 @@
|
|||||||
* [including the GNU Public Licence.]
|
* [including the GNU Public Licence.]
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/* while not exactly a bug (ASN1 C leaves this undefined) it is
|
||||||
* while not exactly a bug (ASN1 C leaves this undefined) it is something to
|
* something to watch out for. This was fine on linux/NT/Solaris but not
|
||||||
* watch out for. This was fine on linux/NT/Solaris but not Alpha
|
* Alpha */
|
||||||
*/
|
|
||||||
|
|
||||||
/*-
|
/* it is basically an example of
|
||||||
* it is basically an example of
|
|
||||||
* func(*(a++),*(a++))
|
* func(*(a++),*(a++))
|
||||||
* which parameter is evaluated first? It is not defined in ASN1 C.
|
* which parameter is evaluated first? It is not defined in ASN1 C.
|
||||||
*/
|
*/
|
||||||
@@ -71,22 +69,23 @@
|
|||||||
|
|
||||||
#define TYPE unsigned int
|
#define TYPE unsigned int
|
||||||
|
|
||||||
void func(a, b)
|
void func(a,b)
|
||||||
TYPE *a;
|
TYPE *a;
|
||||||
TYPE b;
|
TYPE b;
|
||||||
{
|
{
|
||||||
printf("%ld -1 == %ld\n", a[0], b);
|
printf("%ld -1 == %ld\n",a[0],b);
|
||||||
}
|
}
|
||||||
|
|
||||||
main()
|
main()
|
||||||
{
|
{
|
||||||
TYPE data[5] = { 1L, 2L, 3L, 4L, 5L };
|
TYPE data[5]={1L,2L,3L,4L,5L};
|
||||||
TYPE *p;
|
TYPE *p;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
p = data;
|
p=data;
|
||||||
|
|
||||||
for (i = 0; i < 4; i++) {
|
for (i=0; i<4; i++)
|
||||||
func(p, *(p++));
|
{
|
||||||
}
|
func(p,*(p++));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -4,18 +4,17 @@
|
|||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
/*
|
/* There is a bug in
|
||||||
* There is a bug in gcc version 2.5.8 (88open OCS/BCS, DG-2.5.8.3, Oct 14
|
* gcc version 2.5.8 (88open OCS/BCS, DG-2.5.8.3, Oct 14 1994)
|
||||||
* 1994) as shipped with DGUX 5.4R3.10 that can be bypassed by defining
|
* as shipped with DGUX 5.4R3.10 that can be bypassed by defining
|
||||||
* DG_GCC_BUG in my code. The bug manifests itself by the vaule of a pointer
|
* DG_GCC_BUG in my code.
|
||||||
* that is used only by reference, not having it's value change when it is
|
* The bug manifests itself by the vaule of a pointer that is
|
||||||
* used to check for exiting the loop. Probably caused by there being 2
|
* used only by reference, not having it's value change when it is used
|
||||||
* copies of the valiable, one in a register and one being an address that is
|
* to check for exiting the loop. Probably caused by there being 2
|
||||||
* passed.
|
* copies of the valiable, one in a register and one being an address
|
||||||
*/
|
* that is passed. */
|
||||||
|
|
||||||
/*-
|
/* compare the out put from
|
||||||
* compare the out put from
|
|
||||||
* gcc dggccbug.c; ./a.out
|
* gcc dggccbug.c; ./a.out
|
||||||
* and
|
* and
|
||||||
* gcc -O dggccbug.c; ./a.out
|
* gcc -O dggccbug.c; ./a.out
|
||||||
@@ -24,22 +23,23 @@
|
|||||||
|
|
||||||
void inc(a)
|
void inc(a)
|
||||||
int *a;
|
int *a;
|
||||||
{
|
{
|
||||||
(*a)++;
|
(*a)++;
|
||||||
}
|
}
|
||||||
|
|
||||||
main()
|
main()
|
||||||
{
|
{
|
||||||
int p = 0;
|
int p=0;
|
||||||
#ifdef FIXBUG
|
#ifdef FIXBUG
|
||||||
int dummy;
|
int dummy;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
while (p < 3) {
|
while (p<3)
|
||||||
fprintf(stderr, "%08X\n", p);
|
{
|
||||||
inc(&p);
|
fprintf(stderr,"%08X\n",p);
|
||||||
|
inc(&p);
|
||||||
#ifdef FIXBUG
|
#ifdef FIXBUG
|
||||||
dummy += p;
|
dummy+=p;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,57 +4,54 @@
|
|||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
/*
|
/* This compiler bug it present on IRIX 5.3, 5.1 and 4.0.5 (these are
|
||||||
* This compiler bug it present on IRIX 5.3, 5.1 and 4.0.5 (these are the
|
* the only versions of IRIX I have access to.
|
||||||
* only versions of IRIX I have access to. defining FIXBUG removes the bug.
|
* defining FIXBUG removes the bug.
|
||||||
* (bug is still present in IRIX 6.3 according to Gage
|
* (bug is still present in IRIX 6.3 according to
|
||||||
* <agage@forgetmenot.Mines.EDU>
|
* Gage <agage@forgetmenot.Mines.EDU>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*-
|
/* Compare the output from
|
||||||
* Compare the output from
|
|
||||||
* cc sgiccbug.c; ./a.out
|
* cc sgiccbug.c; ./a.out
|
||||||
* and
|
* and
|
||||||
* cc -O sgiccbug.c; ./a.out
|
* cc -O sgiccbug.c; ./a.out
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static unsigned long a[4] =
|
static unsigned long a[4]={0x01234567,0x89ABCDEF,0xFEDCBA98,0x76543210};
|
||||||
{ 0x01234567, 0x89ABCDEF, 0xFEDCBA98, 0x76543210 };
|
static unsigned long b[4]={0x89ABCDEF,0xFEDCBA98,0x76543210,0x01234567};
|
||||||
static unsigned long b[4] =
|
static unsigned long c[4]={0x77777778,0x8ACF1357,0x88888888,0x7530ECA9};
|
||||||
{ 0x89ABCDEF, 0xFEDCBA98, 0x76543210, 0x01234567 };
|
|
||||||
static unsigned long c[4] =
|
|
||||||
{ 0x77777778, 0x8ACF1357, 0x88888888, 0x7530ECA9 };
|
|
||||||
|
|
||||||
main()
|
main()
|
||||||
{
|
{
|
||||||
unsigned long r[4];
|
unsigned long r[4];
|
||||||
sub(r, a, b);
|
sub(r,a,b);
|
||||||
fprintf(stderr, "input a= %08X %08X %08X %08X\n", a[3], a[2], a[1], a[0]);
|
fprintf(stderr,"input a= %08X %08X %08X %08X\n",a[3],a[2],a[1],a[0]);
|
||||||
fprintf(stderr, "input b= %08X %08X %08X %08X\n", b[3], b[2], b[1], b[0]);
|
fprintf(stderr,"input b= %08X %08X %08X %08X\n",b[3],b[2],b[1],b[0]);
|
||||||
fprintf(stderr, "output = %08X %08X %08X %08X\n", r[3], r[2], r[1], r[0]);
|
fprintf(stderr,"output = %08X %08X %08X %08X\n",r[3],r[2],r[1],r[0]);
|
||||||
fprintf(stderr, "correct= %08X %08X %08X %08X\n", c[3], c[2], c[1], c[0]);
|
fprintf(stderr,"correct= %08X %08X %08X %08X\n",c[3],c[2],c[1],c[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
int sub(r, a, b)
|
int sub(r,a,b)
|
||||||
unsigned long *r, *a, *b;
|
unsigned long *r,*a,*b;
|
||||||
{
|
{
|
||||||
register unsigned long t1, t2, *ap, *bp, *rp;
|
register unsigned long t1,t2,*ap,*bp,*rp;
|
||||||
int i, carry;
|
int i,carry;
|
||||||
#ifdef FIXBUG
|
#ifdef FIXBUG
|
||||||
unsigned long dummy;
|
unsigned long dummy;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
ap = a;
|
ap=a;
|
||||||
bp = b;
|
bp=b;
|
||||||
rp = r;
|
rp=r;
|
||||||
carry = 0;
|
carry=0;
|
||||||
for (i = 0; i < 4; i++) {
|
for (i=0; i<4; i++)
|
||||||
t1 = *(ap++);
|
{
|
||||||
t2 = *(bp++);
|
t1= *(ap++);
|
||||||
t1 = (t1 - t2);
|
t2= *(bp++);
|
||||||
|
t1=(t1-t2);
|
||||||
#ifdef FIXBUG
|
#ifdef FIXBUG
|
||||||
dummy = t1;
|
dummy=t1;
|
||||||
#endif
|
#endif
|
||||||
*(rp++) = t1 & 0xffffffff;
|
*(rp++)=t1&0xffffffff;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
107
bugs/stream.c
107
bugs/stream.c
@@ -59,74 +59,73 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <openssl/rc4.h>
|
#include <openssl/rc4.h>
|
||||||
#ifdef OPENSSL_NO_DES
|
#ifdef OPENSSL_NO_DES
|
||||||
# include <des.h>
|
#include <des.h>
|
||||||
#else
|
#else
|
||||||
# include <openssl/des.h>
|
#include <openssl/des.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/* show how stream ciphers are not very good. The mac has no affect
|
||||||
* show how stream ciphers are not very good. The mac has no affect on RC4
|
* on RC4 while it does for cfb DES
|
||||||
* while it does for cfb DES
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
main()
|
main()
|
||||||
{
|
{
|
||||||
fprintf(stderr, "rc4\n");
|
fprintf(stderr,"rc4\n");
|
||||||
rc4();
|
rc4();
|
||||||
fprintf(stderr, "cfb des\n");
|
fprintf(stderr,"cfb des\n");
|
||||||
des();
|
des();
|
||||||
}
|
}
|
||||||
|
|
||||||
int des()
|
int des()
|
||||||
{
|
{
|
||||||
des_key_schedule ks;
|
des_key_schedule ks;
|
||||||
des_cblock iv, key;
|
des_cblock iv,key;
|
||||||
int num;
|
int num;
|
||||||
static char *keystr = "01234567";
|
static char *keystr="01234567";
|
||||||
static char *in1 = "0123456789ABCEDFdata 12345";
|
static char *in1="0123456789ABCEDFdata 12345";
|
||||||
static char *in2 = "9876543210abcdefdata 12345";
|
static char *in2="9876543210abcdefdata 12345";
|
||||||
unsigned char out[100];
|
unsigned char out[100];
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
des_set_key((des_cblock *)keystr, ks);
|
des_set_key((des_cblock *)keystr,ks);
|
||||||
|
|
||||||
num = 0;
|
num=0;
|
||||||
memset(iv, 0, 8);
|
memset(iv,0,8);
|
||||||
des_cfb64_encrypt(in1, out, 26, ks, (des_cblock *)iv, &num, 1);
|
des_cfb64_encrypt(in1,out,26,ks,(des_cblock *)iv,&num,1);
|
||||||
for (i = 0; i < 26; i++)
|
for (i=0; i<26; i++)
|
||||||
fprintf(stderr, "%02X ", out[i]);
|
fprintf(stderr,"%02X ",out[i]);
|
||||||
fprintf(stderr, "\n");
|
fprintf(stderr,"\n");
|
||||||
|
|
||||||
num = 0;
|
num=0;
|
||||||
memset(iv, 0, 8);
|
memset(iv,0,8);
|
||||||
des_cfb64_encrypt(in2, out, 26, ks, (des_cblock *)iv, &num, 1);
|
des_cfb64_encrypt(in2,out,26,ks,(des_cblock *)iv,&num,1);
|
||||||
for (i = 0; i < 26; i++)
|
for (i=0; i<26; i++)
|
||||||
fprintf(stderr, "%02X ", out[i]);
|
fprintf(stderr,"%02X ",out[i]);
|
||||||
fprintf(stderr, "\n");
|
fprintf(stderr,"\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
int rc4()
|
int rc4()
|
||||||
{
|
{
|
||||||
static char *keystr = "0123456789abcdef";
|
static char *keystr="0123456789abcdef";
|
||||||
RC4_KEY key;
|
RC4_KEY key;
|
||||||
unsigned char in[100], out[100];
|
unsigned char in[100],out[100];
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
RC4_set_key(&key, 16, keystr);
|
RC4_set_key(&key,16,keystr);
|
||||||
in[0] = '\0';
|
in[0]='\0';
|
||||||
strcpy(in, "0123456789ABCEDFdata 12345");
|
strcpy(in,"0123456789ABCEDFdata 12345");
|
||||||
RC4(key, 26, in, out);
|
RC4(key,26,in,out);
|
||||||
|
|
||||||
for (i = 0; i < 26; i++)
|
for (i=0; i<26; i++)
|
||||||
fprintf(stderr, "%02X ", out[i]);
|
fprintf(stderr,"%02X ",out[i]);
|
||||||
fprintf(stderr, "\n");
|
fprintf(stderr,"\n");
|
||||||
|
|
||||||
RC4_set_key(&key, 16, keystr);
|
RC4_set_key(&key,16,keystr);
|
||||||
in[0] = '\0';
|
in[0]='\0';
|
||||||
strcpy(in, "9876543210abcdefdata 12345");
|
strcpy(in,"9876543210abcdefdata 12345");
|
||||||
RC4(key, 26, in, out);
|
RC4(key,26,in,out);
|
||||||
|
|
||||||
for (i = 0; i < 26; i++)
|
for (i=0; i<26; i++)
|
||||||
fprintf(stderr, "%02X ", out[i]);
|
fprintf(stderr,"%02X ",out[i]);
|
||||||
fprintf(stderr, "\n");
|
fprintf(stderr,"\n");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
/*-
|
/* This is a cc optimiser bug for ultrix 4.3, mips CPU.
|
||||||
* This is a cc optimiser bug for ultrix 4.3, mips CPU.
|
|
||||||
* What happens is that the compiler, due to the (a)&7,
|
* What happens is that the compiler, due to the (a)&7,
|
||||||
* does
|
* does
|
||||||
* i=a&7;
|
* i=a&7;
|
||||||
@@ -13,32 +12,34 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
main()
|
main()
|
||||||
{
|
{
|
||||||
f(5);
|
f(5);
|
||||||
f(0);
|
f(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
int f(a)
|
int f(a)
|
||||||
int a;
|
int a;
|
||||||
{
|
{
|
||||||
switch (a & 7) {
|
switch(a&7)
|
||||||
case 7:
|
{
|
||||||
printf("7\n");
|
case 7:
|
||||||
case 6:
|
printf("7\n");
|
||||||
printf("6\n");
|
case 6:
|
||||||
case 5:
|
printf("6\n");
|
||||||
printf("5\n");
|
case 5:
|
||||||
case 4:
|
printf("5\n");
|
||||||
printf("4\n");
|
case 4:
|
||||||
case 3:
|
printf("4\n");
|
||||||
printf("3\n");
|
case 3:
|
||||||
case 2:
|
printf("3\n");
|
||||||
printf("2\n");
|
case 2:
|
||||||
case 1:
|
printf("2\n");
|
||||||
printf("1\n");
|
case 1:
|
||||||
|
printf("1\n");
|
||||||
#ifdef FIX_BUG
|
#ifdef FIX_BUG
|
||||||
case 0:
|
case 0:
|
||||||
;
|
;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
104
config
104
config
@@ -370,10 +370,6 @@ case "${SYSTEM}:${RELEASE}:${VERSION}:${MACHINE}" in
|
|||||||
NONSTOP_KERNEL*)
|
NONSTOP_KERNEL*)
|
||||||
echo "nsr-tandem-nsk"; exit 0;
|
echo "nsr-tandem-nsk"; exit 0;
|
||||||
;;
|
;;
|
||||||
|
|
||||||
vxworks*)
|
|
||||||
echo "${MACHINE}-whatever-vxworks"; exit 0;
|
|
||||||
;;
|
|
||||||
esac
|
esac
|
||||||
|
|
||||||
#
|
#
|
||||||
@@ -411,18 +407,23 @@ exit 0
|
|||||||
# this is where the translation occurs into SSLeay terms
|
# this is where the translation occurs into SSLeay terms
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
GCCVER=`(gcc -dumpversion) 2>/dev/null`
|
||||||
|
if [ "$GCCVER" != "" ]; then
|
||||||
|
# then strip off whatever prefix egcs prepends the number with...
|
||||||
|
# Hopefully, this will work for any future prefixes as well.
|
||||||
|
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.
|
||||||
|
# peak single digit before and after first dot, e.g. 2.95.1 gives 29
|
||||||
|
GCCVER=`echo $GCCVER | sed 's/\([0-9]\)\.\([0-9]\).*/\1\2/'`
|
||||||
|
fi
|
||||||
|
|
||||||
# Only set CC if not supplied already
|
# Only set CC if not supplied already
|
||||||
if [ -z "$CROSS_COMPILE$CC" ]; then
|
if [ -z "$CC" ]; then
|
||||||
GCCVER=`sh -c "gcc -dumpversion" 2>/dev/null`
|
# figure out if gcc is available and if so we use it otherwise
|
||||||
|
# we fallback to whatever cc does on the system
|
||||||
if [ "$GCCVER" != "" ]; then
|
if [ "$GCCVER" != "" ]; then
|
||||||
# then strip off whatever prefix egcs prepends the number with...
|
|
||||||
# Hopefully, this will work for any future prefixes as well.
|
|
||||||
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.
|
|
||||||
# peak single digit before and after first dot, e.g. 2.95.1 gives 29
|
|
||||||
GCCVER=`echo $GCCVER | sed 's/\([0-9]\)\.\([0-9]\).*/\1\2/'`
|
|
||||||
CC=gcc
|
CC=gcc
|
||||||
else
|
else
|
||||||
CC=cc
|
CC=cc
|
||||||
@@ -538,7 +539,7 @@ case "$GUESSOS" in
|
|||||||
ppc-apple-rhapsody) OUT="rhapsody-ppc-cc" ;;
|
ppc-apple-rhapsody) OUT="rhapsody-ppc-cc" ;;
|
||||||
ppc-apple-darwin*)
|
ppc-apple-darwin*)
|
||||||
ISA64=`(sysctl -n hw.optional.64bitops) 2>/dev/null`
|
ISA64=`(sysctl -n hw.optional.64bitops) 2>/dev/null`
|
||||||
if [ "$ISA64" = "1" -a -z "$KERNEL_BITS" ]; then
|
if [ "$ISA64" = "1" ]; then
|
||||||
echo "WARNING! If you wish to build 64-bit library, then you have to"
|
echo "WARNING! If you wish to build 64-bit library, then you have to"
|
||||||
echo " invoke './Configure darwin64-ppc-cc' *manually*."
|
echo " invoke './Configure darwin64-ppc-cc' *manually*."
|
||||||
if [ "$TEST" = "false" -a -t 1 ]; then
|
if [ "$TEST" = "false" -a -t 1 ]; then
|
||||||
@@ -546,14 +547,10 @@ case "$GUESSOS" in
|
|||||||
(trap "stty `stty -g`" 2 0; stty -icanon min 0 time 50; read waste) <&1
|
(trap "stty `stty -g`" 2 0; stty -icanon min 0 time 50; read waste) <&1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
if [ "$ISA64" = "1" -a "$KERNEL_BITS" = "64" ]; then
|
OUT="darwin-ppc-cc" ;;
|
||||||
OUT="darwin64-ppc-cc"
|
|
||||||
else
|
|
||||||
OUT="darwin-ppc-cc"
|
|
||||||
fi ;;
|
|
||||||
i?86-apple-darwin*)
|
i?86-apple-darwin*)
|
||||||
ISA64=`(sysctl -n hw.optional.x86_64) 2>/dev/null`
|
ISA64=`(sysctl -n hw.optional.x86_64) 2>/dev/null`
|
||||||
if [ "$ISA64" = "1" -a -z "$KERNEL_BITS" ]; then
|
if [ "$ISA64" = "1" ]; then
|
||||||
echo "WARNING! If you wish to build 64-bit library, then you have to"
|
echo "WARNING! If you wish to build 64-bit library, then you have to"
|
||||||
echo " invoke './Configure darwin64-x86_64-cc' *manually*."
|
echo " invoke './Configure darwin64-x86_64-cc' *manually*."
|
||||||
if [ "$TEST" = "false" -a -t 1 ]; then
|
if [ "$TEST" = "false" -a -t 1 ]; then
|
||||||
@@ -561,17 +558,7 @@ case "$GUESSOS" in
|
|||||||
(trap "stty `stty -g`" 2 0; stty -icanon min 0 time 50; read waste) <&1
|
(trap "stty `stty -g`" 2 0; stty -icanon min 0 time 50; read waste) <&1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
if [ "$ISA64" = "1" -a "$KERNEL_BITS" = "64" ]; then
|
OUT="darwin-i386-cc" ;;
|
||||||
OUT="darwin64-x86_64-cc"
|
|
||||||
else
|
|
||||||
OUT="darwin-i386-cc"
|
|
||||||
fi ;;
|
|
||||||
armv6+7-*-iphoneos)
|
|
||||||
options="$options -arch%20armv6 -arch%20armv7"
|
|
||||||
OUT="iphoneos-cross" ;;
|
|
||||||
*-*-iphoneos)
|
|
||||||
options="$options -arch%20${MACHINE}"
|
|
||||||
OUT="iphoneos-cross" ;;
|
|
||||||
alpha-*-linux2)
|
alpha-*-linux2)
|
||||||
ISA=`awk '/cpu model/{print$4;exit(0);}' /proc/cpuinfo`
|
ISA=`awk '/cpu model/{print$4;exit(0);}' /proc/cpuinfo`
|
||||||
case ${ISA:-generic} in
|
case ${ISA:-generic} in
|
||||||
@@ -596,11 +583,6 @@ case "$GUESSOS" in
|
|||||||
OUT="linux-ppc"
|
OUT="linux-ppc"
|
||||||
;;
|
;;
|
||||||
ppc-*-linux2) OUT="linux-ppc" ;;
|
ppc-*-linux2) OUT="linux-ppc" ;;
|
||||||
ppc60x-*-vxworks*) OUT="vxworks-ppc60x" ;;
|
|
||||||
ppcgen-*-vxworks*) OUT="vxworks-ppcgen" ;;
|
|
||||||
pentium-*-vxworks*) OUT="vxworks-pentium" ;;
|
|
||||||
simlinux-*-vxworks*) OUT="vxworks-simlinux" ;;
|
|
||||||
mips-*-vxworks*) OUT="vxworks-mips";;
|
|
||||||
ia64-*-linux?) OUT="linux-ia64" ;;
|
ia64-*-linux?) OUT="linux-ia64" ;;
|
||||||
sparc64-*-linux2)
|
sparc64-*-linux2)
|
||||||
echo "WARNING! If you *know* that your GNU C supports 64-bit/V9 ABI"
|
echo "WARNING! If you *know* that your GNU C supports 64-bit/V9 ABI"
|
||||||
@@ -642,24 +624,12 @@ case "$GUESSOS" in
|
|||||||
options="$options -DB_ENDIAN -mschedule=$CPUSCHEDULE -march=$CPUARCH"
|
options="$options -DB_ENDIAN -mschedule=$CPUSCHEDULE -march=$CPUARCH"
|
||||||
OUT="linux-generic32" ;;
|
OUT="linux-generic32" ;;
|
||||||
armv[1-3]*-*-linux2) OUT="linux-generic32" ;;
|
armv[1-3]*-*-linux2) OUT="linux-generic32" ;;
|
||||||
armv[7-9]*-*-linux2) OUT="linux-armv4"; options="$options -march=armv7-a" ;;
|
|
||||||
arm*-*-linux2) OUT="linux-armv4" ;;
|
arm*-*-linux2) OUT="linux-armv4" ;;
|
||||||
sh*b-*-linux2) OUT="linux-generic32"; options="$options -DB_ENDIAN" ;;
|
sh*b-*-linux2) OUT="linux-generic32"; options="$options -DB_ENDIAN" ;;
|
||||||
sh*-*-linux2) OUT="linux-generic32"; options="$options -DL_ENDIAN" ;;
|
sh*-*-linux2) OUT="linux-generic32"; options="$options -DL_ENDIAN" ;;
|
||||||
m68k*-*-linux2) OUT="linux-generic32"; options="$options -DB_ENDIAN" ;;
|
m68k*-*-linux2) OUT="linux-generic32"; options="$options -DB_ENDIAN" ;;
|
||||||
s390-*-linux2) OUT="linux-generic32"; options="$options -DB_ENDIAN" ;;
|
s390-*-linux2) OUT="linux-generic32"; options="$options -DB_ENDIAN" ;;
|
||||||
s390x-*-linux2)
|
s390x-*-linux2) OUT="linux-s390x" ;;
|
||||||
# To be uncommented when glibc bug is fixed, see Configure...
|
|
||||||
#if egrep -e '^features.* highgprs' /proc/cpuinfo >/dev/null ; then
|
|
||||||
# echo "WARNING! If you wish to build \"highgprs\" 32-bit library, then you"
|
|
||||||
# echo " have to invoke './Configure linux32-s390x' *manually*."
|
|
||||||
# if [ "$TEST" = "false" -a -t -1 ]; then
|
|
||||||
# echo " You have about 5 seconds to press Ctrl-C to abort."
|
|
||||||
# (trap "stty `stty -g`" 2 0; stty -icanon min 0 time 50; read waste) <&1
|
|
||||||
# fi
|
|
||||||
#fi
|
|
||||||
OUT="linux64-s390x"
|
|
||||||
;;
|
|
||||||
x86_64-*-linux?) OUT="linux-x86_64" ;;
|
x86_64-*-linux?) OUT="linux-x86_64" ;;
|
||||||
*86-*-linux2) OUT="linux-elf"
|
*86-*-linux2) OUT="linux-elf"
|
||||||
if [ "$GCCVER" -gt 28 ]; then
|
if [ "$GCCVER" -gt 28 ]; then
|
||||||
@@ -678,7 +648,7 @@ case "$GUESSOS" in
|
|||||||
sun4[uv]*-*-solaris2)
|
sun4[uv]*-*-solaris2)
|
||||||
OUT="solaris-sparcv9-$CC"
|
OUT="solaris-sparcv9-$CC"
|
||||||
ISA64=`(isalist) 2>/dev/null | grep sparcv9`
|
ISA64=`(isalist) 2>/dev/null | grep sparcv9`
|
||||||
if [ "$ISA64" != "" -a "$KERNEL_BITS" = "" ]; then
|
if [ "$ISA64" != "" ]; then
|
||||||
if [ "$CC" = "cc" -a $CCVER -ge 50 ]; then
|
if [ "$CC" = "cc" -a $CCVER -ge 50 ]; then
|
||||||
echo "WARNING! If you wish to build 64-bit library, then you have to"
|
echo "WARNING! If you wish to build 64-bit library, then you have to"
|
||||||
echo " invoke './Configure solaris64-sparcv9-cc' *manually*."
|
echo " invoke './Configure solaris64-sparcv9-cc' *manually*."
|
||||||
@@ -708,16 +678,13 @@ case "$GUESSOS" in
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
if [ "$ISA64" != "" -a "$KERNEL_BITS" = "64" ]; then
|
|
||||||
OUT="solaris64-sparcv9-$CC"
|
|
||||||
fi
|
|
||||||
;;
|
;;
|
||||||
sun4m-*-solaris2) OUT="solaris-sparcv8-$CC" ;;
|
sun4m-*-solaris2) OUT="solaris-sparcv8-$CC" ;;
|
||||||
sun4d-*-solaris2) OUT="solaris-sparcv8-$CC" ;;
|
sun4d-*-solaris2) OUT="solaris-sparcv8-$CC" ;;
|
||||||
sun4*-*-solaris2) OUT="solaris-sparcv7-$CC" ;;
|
sun4*-*-solaris2) OUT="solaris-sparcv7-$CC" ;;
|
||||||
*86*-*-solaris2)
|
*86*-*-solaris2)
|
||||||
ISA64=`(isalist) 2>/dev/null | grep amd64`
|
ISA64=`(isalist) 2>/dev/null | grep amd64`
|
||||||
if [ "$ISA64" != "" -a ${KERNEL_BITS:-64} -eq 64 ]; then
|
if [ "$ISA64" != "" ]; then
|
||||||
OUT="solaris64-x86_64-$CC"
|
OUT="solaris64-x86_64-$CC"
|
||||||
else
|
else
|
||||||
OUT="solaris-x86-$CC"
|
OUT="solaris-x86-$CC"
|
||||||
@@ -739,7 +706,7 @@ case "$GUESSOS" in
|
|||||||
libc=/usr/lib/libc.so
|
libc=/usr/lib/libc.so
|
||||||
else # OpenBSD
|
else # OpenBSD
|
||||||
# ld searches for highest libc.so.* and so do we
|
# ld searches for highest libc.so.* and so do we
|
||||||
libc=`(ls /usr/lib/libc.so.* /lib/libc.so.* | tail -1) 2>/dev/null`
|
libc=`(ls /usr/lib/libc.so.* | tail -1) 2>/dev/null`
|
||||||
fi
|
fi
|
||||||
case "`(file -L $libc) 2>/dev/null`" in
|
case "`(file -L $libc) 2>/dev/null`" in
|
||||||
*ELF*) OUT="BSD-x86-elf" ;;
|
*ELF*) OUT="BSD-x86-elf" ;;
|
||||||
@@ -769,17 +736,20 @@ case "$GUESSOS" in
|
|||||||
if [ $CC = "gcc" -a $GCC_BITS = "64" ]; then
|
if [ $CC = "gcc" -a $GCC_BITS = "64" ]; then
|
||||||
OUT="hpux64-parisc2-gcc"
|
OUT="hpux64-parisc2-gcc"
|
||||||
fi
|
fi
|
||||||
[ "$KERNEL_BITS" ] || KERNEL_BITS=`(getconf KERNEL_BITS) 2>/dev/null`
|
KERNEL_BITS=`(getconf KERNEL_BITS) 2>/dev/null`
|
||||||
KERNEL_BITS=${KERNEL_BITS:-32}
|
KERNEL_BITS=${KERNEL_BITS:-32}
|
||||||
CPU_VERSION=`(getconf CPU_VERSION) 2>/dev/null`
|
CPU_VERSION=`(getconf CPU_VERSION) 2>/dev/null`
|
||||||
CPU_VERSION=${CPU_VERSION:-0}
|
CPU_VERSION=${CPU_VERSION:-0}
|
||||||
# See <sys/unistd.h> for further info on CPU_VERSION.
|
# See <sys/unistd.h> for further info on CPU_VERSION.
|
||||||
if [ $CPU_VERSION -ge 768 ]; then # IA-64 CPU
|
if [ $CPU_VERSION -ge 768 ]; then # IA-64 CPU
|
||||||
if [ $KERNEL_BITS -eq 64 -a "$CC" = "cc" ]; then
|
echo "WARNING! 64-bit ABI is the default configured ABI on HP-UXi."
|
||||||
OUT="hpux64-ia64-cc"
|
echo " If you wish to build 32-bit library, the you have to"
|
||||||
else
|
echo " invoke './Configure hpux-ia64-cc' *manually*."
|
||||||
OUT="hpux-ia64-cc"
|
if [ "$TEST" = "false" -a -t 1 ]; then
|
||||||
fi
|
echo " You have about 5 seconds to press Ctrl-C to abort."
|
||||||
|
(trap "stty `stty -g`" 2 0; stty -icanon min 0 time 50; read waste) <&1
|
||||||
|
fi
|
||||||
|
OUT="hpux64-ia64-cc"
|
||||||
elif [ $CPU_VERSION -ge 532 ]; then # PA-RISC 2.x CPU
|
elif [ $CPU_VERSION -ge 532 ]; then # PA-RISC 2.x CPU
|
||||||
OUT=${OUT:-"hpux-parisc2-${CC}"}
|
OUT=${OUT:-"hpux-parisc2-${CC}"}
|
||||||
if [ $KERNEL_BITS -eq 64 -a "$CC" = "cc" ]; then
|
if [ $KERNEL_BITS -eq 64 -a "$CC" = "cc" ]; then
|
||||||
@@ -800,7 +770,7 @@ case "$GUESSOS" in
|
|||||||
options="$options -D_REENTRANT" ;;
|
options="$options -D_REENTRANT" ;;
|
||||||
*-hpux) OUT="hpux-parisc-$CC" ;;
|
*-hpux) OUT="hpux-parisc-$CC" ;;
|
||||||
*-aix)
|
*-aix)
|
||||||
[ "$KERNEL_BITS" ] || KERNEL_BITS=`(getconf KERNEL_BITMODE) 2>/dev/null`
|
KERNEL_BITS=`(getconf KERNEL_BITMODE) 2>/dev/null`
|
||||||
KERNEL_BITS=${KERNEL_BITS:-32}
|
KERNEL_BITS=${KERNEL_BITS:-32}
|
||||||
OBJECT_MODE=${OBJECT_MODE:-32}
|
OBJECT_MODE=${OBJECT_MODE:-32}
|
||||||
if [ "$CC" = "gcc" ]; then
|
if [ "$CC" = "gcc" ]; then
|
||||||
@@ -840,8 +810,6 @@ case "$GUESSOS" in
|
|||||||
beos-*) OUT="$GUESSOS" ;;
|
beos-*) OUT="$GUESSOS" ;;
|
||||||
x86pc-*-qnx6) OUT="QNX6-i386" ;;
|
x86pc-*-qnx6) OUT="QNX6-i386" ;;
|
||||||
*-*-qnx6) OUT="QNX6" ;;
|
*-*-qnx6) OUT="QNX6" ;;
|
||||||
x86-*-android|i?86-*-android) OUT="android-x86" ;;
|
|
||||||
armv[7-9]*-*-android) OUT="android-armv7" ;;
|
|
||||||
*) OUT=`echo $GUESSOS | awk -F- '{print $3}'`;;
|
*) OUT=`echo $GUESSOS | awk -F- '{print $3}'`;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
@@ -857,11 +825,9 @@ esac
|
|||||||
# options="$options -DATALLA"
|
# options="$options -DATALLA"
|
||||||
#fi
|
#fi
|
||||||
|
|
||||||
if expr "$options" : '.*no\-asm' > /dev/null; then :; else
|
($CC -Wa,--help -c -o /dev/null -x assembler /dev/null 2>&1 | \
|
||||||
sh -c "$CROSS_COMPILE${CC:-gcc} -Wa,--help -c -o /tmp/null.$$.o -x assembler /dev/null && rm /tmp/null.$$.o" 2>&1 | \
|
grep \\--noexecstack) 2>&1 > /dev/null && \
|
||||||
grep \\--noexecstack >/dev/null && \
|
|
||||||
options="$options -Wa,--noexecstack"
|
options="$options -Wa,--noexecstack"
|
||||||
fi
|
|
||||||
|
|
||||||
# gcc < 2.8 does not support -march=ultrasparc
|
# gcc < 2.8 does not support -march=ultrasparc
|
||||||
if [ "$OUT" = solaris-sparcv9-gcc -a $GCCVER -lt 28 ]
|
if [ "$OUT" = solaris-sparcv9-gcc -a $GCCVER -lt 28 ]
|
||||||
|
|||||||
8
crypto/.cvsignore
Normal file
8
crypto/.cvsignore
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
lib
|
||||||
|
buildinf.h
|
||||||
|
opensslconf.h
|
||||||
|
Makefile.save
|
||||||
|
*.flc
|
||||||
|
semantic.cache
|
||||||
|
*cpuid.s
|
||||||
|
uplink-cof.s
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user