Compare commits
407 Commits
BEN_FIPS_T
...
OpenSSL-fi
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
55e81315dc | ||
|
|
9227a5912f | ||
|
|
f7376e8ebc | ||
|
|
75fb38c7eb | ||
|
|
ccabc6f49a | ||
|
|
8343bcfb2b | ||
|
|
8435dc4e8d | ||
|
|
50c3727624 | ||
|
|
15c6cbd464 | ||
|
|
a6b8e925bc | ||
|
|
d2fca2c59a | ||
|
|
7028b83a35 | ||
|
|
f0ad625606 | ||
|
|
6bce1a8dca | ||
|
|
9e9f48f0b1 | ||
|
|
0cd83fa586 | ||
|
|
1d8f39c144 | ||
|
|
e523b0ab4d | ||
|
|
f54026eb9d | ||
|
|
f718b2f489 | ||
|
|
9fb37ebe00 | ||
|
|
88780bcdc7 | ||
|
|
c1b971d5b2 | ||
|
|
640d212a4c | ||
|
|
9e8473347a | ||
|
|
874d408909 | ||
|
|
8dc3253141 | ||
|
|
83a542996c | ||
|
|
93dcdddbfd | ||
|
|
f291e0eb32 | ||
|
|
7f71a94cc5 | ||
|
|
0ae9a77679 | ||
|
|
1e4ae04e79 | ||
|
|
54f581d3c7 | ||
|
|
5d4558d1eb | ||
|
|
343e6a4950 | ||
|
|
0c0bba9776 | ||
|
|
459379296a | ||
|
|
1d3c933a32 | ||
|
|
462a286eeb | ||
|
|
28722cf212 | ||
|
|
e68eff1465 | ||
|
|
43a6d78bcc | ||
|
|
364f6fb504 | ||
|
|
21b9c11e99 | ||
|
|
dee67db36c | ||
|
|
aba2163a06 | ||
|
|
bedc89e7af | ||
|
|
d46359842f | ||
|
|
b452e706e3 | ||
|
|
08198b1b5c | ||
|
|
16d5c926de | ||
|
|
f27846cc2c | ||
|
|
dcd44b5121 | ||
|
|
75dca32a6c | ||
|
|
0c337a0254 | ||
|
|
a110d01771 | ||
|
|
7ef7a1b3de | ||
|
|
2749276b95 | ||
|
|
b6a5fdb8a7 | ||
|
|
bf5773fa2d | ||
|
|
ecf139917d | ||
|
|
8797be2dce | ||
|
|
ab23d5ffda | ||
|
|
1a979201d5 | ||
|
|
216659eb87 | ||
|
|
5d6383c83f | ||
|
|
48e1c0c012 | ||
|
|
f36f469430 | ||
|
|
e07d3a021d | ||
|
|
e1a27eb34a | ||
|
|
6446e0c3c8 | ||
|
|
beedea2fef | ||
|
|
34be34fdd0 | ||
|
|
0020502a07 | ||
|
|
5cf7908a86 | ||
|
|
d530017c00 | ||
|
|
b7e3c73d7c | ||
|
|
fd9fa844e2 | ||
|
|
e6784a47e9 | ||
|
|
c2dc3ee8d9 | ||
|
|
482c2acf02 | ||
|
|
a481b4b52c | ||
|
|
a87228031f | ||
|
|
b79c82eaab | ||
|
|
69d1d5e6ce | ||
|
|
c86f2054f3 | ||
|
|
5c98b2caf5 | ||
|
|
5148710994 | ||
|
|
ea77fc3380 | ||
|
|
46ef873f0b | ||
|
|
2d2a5ba32a | ||
|
|
2bd4e3379f | ||
|
|
032c3ecb18 | ||
|
|
d0344d06a8 | ||
|
|
a0cac0ff75 | ||
|
|
817089b66d | ||
|
|
e703b46598 | ||
|
|
0fa793bc7b | ||
|
|
ba5477eb1a | ||
|
|
5c42f62e48 | ||
|
|
a08e05d1be | ||
|
|
d342ec3335 | ||
|
|
3d8b8860cf | ||
|
|
a0b5ebeac6 | ||
|
|
8ee18dd520 | ||
|
|
50f482374d | ||
|
|
f46e76ef50 | ||
|
|
ff60944b28 | ||
|
|
d349b2fffe | ||
|
|
6906a81215 | ||
|
|
81dd23e65d | ||
|
|
e725a9660b | ||
|
|
2fb2e00d94 | ||
|
|
d7eed1929b | ||
|
|
4acc3e907d | ||
|
|
00294d0df7 | ||
|
|
9449e38504 | ||
|
|
fba03c479f | ||
|
|
b8b0b5d856 | ||
|
|
27bf518087 | ||
|
|
ec5d8a54e9 | ||
|
|
96a99d63c2 | ||
|
|
18a6333180 | ||
|
|
a9d9b07167 | ||
|
|
7f663ce430 | ||
|
|
e042540f6b | ||
|
|
494593845c | ||
|
|
82d63d3028 | ||
|
|
4e8172d6da | ||
|
|
8e6a84e730 | ||
|
|
875a644a90 | ||
|
|
95475b1c7a | ||
|
|
ec37635c94 | ||
|
|
fd836aeee0 | ||
|
|
560f7abb7e | ||
|
|
b6358c89a1 | ||
|
|
5d735465d1 | ||
|
|
9e051bac13 | ||
|
|
e51f113ad8 | ||
|
|
839032c34d | ||
|
|
30fbcaa213 | ||
|
|
a2cfc0d50c | ||
|
|
86f941c936 | ||
|
|
387fd00c47 | ||
|
|
766519fc12 | ||
|
|
6e07f8a4ba | ||
|
|
a82d1527c4 | ||
|
|
93825dddad | ||
|
|
a8aa764d3c | ||
|
|
e7716b7a19 | ||
|
|
a4e3150f00 | ||
|
|
5a8fe26720 | ||
|
|
edec614efd | ||
|
|
00b9c1be7d | ||
|
|
3f7067e3b6 | ||
|
|
051bb5c457 | ||
|
|
2457c19df1 | ||
|
|
5fa5eb71a4 | ||
|
|
931a031916 | ||
|
|
3f39976da3 | ||
|
|
be21fe59aa | ||
|
|
216ad9ef58 | ||
|
|
ef3565aed2 | ||
|
|
bc50157010 | ||
|
|
01fc051e8a | ||
|
|
09773532ed | ||
|
|
ae43f344af | ||
|
|
cc77f7c595 | ||
|
|
91180d45f9 | ||
|
|
0902c559fb | ||
|
|
58b6a165a5 | ||
|
|
d9f40bbe55 | ||
|
|
0f0e53db43 | ||
|
|
60ace8f3fc | ||
|
|
ec7c9ee8b8 | ||
|
|
9d4e2f891b | ||
|
|
be187e32c9 | ||
|
|
f82bb9cb9c | ||
|
|
641c55342b | ||
|
|
811756e644 | ||
|
|
8c496048b7 | ||
|
|
51212a7a40 | ||
|
|
5a8922aed5 | ||
|
|
e390f5d684 | ||
|
|
ce974305c4 | ||
|
|
078a97791d | ||
|
|
f2c1812560 | ||
|
|
4d6b383680 | ||
|
|
4cfa4ae820 | ||
|
|
3b7dd6d34c | ||
|
|
489885cf84 | ||
|
|
d60425034f | ||
|
|
254700b1d6 | ||
|
|
850be8f18d | ||
|
|
a30af36c77 | ||
|
|
5713956f61 | ||
|
|
5075521e75 | ||
|
|
a22d40dde2 | ||
|
|
ee3a47a994 | ||
|
|
ee121033dc | ||
|
|
f727266ae8 | ||
|
|
4090b56b4d | ||
|
|
8bb0c8522a | ||
|
|
c6700d2746 | ||
|
|
1b06804491 | ||
|
|
33ad6eca7a | ||
|
|
dc90f64d56 | ||
|
|
a5ad942b70 | ||
|
|
0ae3ca9ec4 | ||
|
|
33dd54d4b0 | ||
|
|
0f7ff5b809 | ||
|
|
6c43032121 | ||
|
|
820fb35a21 | ||
|
|
dd10343e75 | ||
|
|
37ead9be0b | ||
|
|
1751034669 | ||
|
|
b47178f0ed | ||
|
|
ad55502092 | ||
|
|
e6738d4be8 | ||
|
|
d4575825f1 | ||
|
|
31edde3edc | ||
|
|
4c6d0b7069 | ||
|
|
135891a9d5 | ||
|
|
bcb0a64421 | ||
|
|
7575c7e3bb | ||
|
|
d04b1b4656 | ||
|
|
1247092776 | ||
|
|
7e22a1df55 | ||
|
|
bb5810d21d | ||
|
|
381a693c39 | ||
|
|
6a0fc3b6e1 | ||
|
|
86cb571e28 | ||
|
|
ee2cffeb56 | ||
|
|
319a2c5f65 | ||
|
|
61a88c31c0 | ||
|
|
9d0e895120 | ||
|
|
b86ed8d18f | ||
|
|
44ee32ed30 | ||
|
|
5922128732 | ||
|
|
e5886a2388 | ||
|
|
8d1ebe0bd1 | ||
|
|
1fb724449d | ||
|
|
cb37947a71 | ||
|
|
721a5e83f9 | ||
|
|
6df617a59d | ||
|
|
8c6336b0aa | ||
|
|
4668056fc9 | ||
|
|
87203dc99a | ||
|
|
de23af982a | ||
|
|
3a5a176ea0 | ||
|
|
4de65cbc06 | ||
|
|
27b2b78f90 | ||
|
|
3a160f1dc6 | ||
|
|
7f24b1c3e9 | ||
|
|
326e02b260 | ||
|
|
50f40631d0 | ||
|
|
a5e8bcfb7b | ||
|
|
370d5a72db | ||
|
|
a1d37a96df | ||
|
|
9d5c3c1939 | ||
|
|
de56817c9c | ||
|
|
83d1298fa0 | ||
|
|
815d7057be | ||
|
|
6bff79629e | ||
|
|
db452cdba0 | ||
|
|
d435752b0a | ||
|
|
c8b14ca177 | ||
|
|
30cb9ec715 | ||
|
|
8b79f2051d | ||
|
|
af6dab9b00 | ||
|
|
8ba5c63de9 | ||
|
|
cdb42bcf0c | ||
|
|
3a0ede0ffd | ||
|
|
9cde81c2dd | ||
|
|
7995627040 | ||
|
|
fc56b52924 | ||
|
|
62bd487421 | ||
|
|
4ef740a632 | ||
|
|
7f36acd8fe | ||
|
|
a32fc687de | ||
|
|
09d7c42a7c | ||
|
|
c0017a5a65 | ||
|
|
3fbbd1e1d7 | ||
|
|
344e86645d | ||
|
|
075521725d | ||
|
|
faa9c5cbdc | ||
|
|
5fdf06666c | ||
|
|
d2c786db37 | ||
|
|
f28e8bd300 | ||
|
|
3e786f4b0d | ||
|
|
de02ec2767 | ||
|
|
4b66e713de | ||
|
|
90dd4d34bb | ||
|
|
112341031b | ||
|
|
7cf803230b | ||
|
|
2d6452cdf9 | ||
|
|
cc056d6395 | ||
|
|
79b42e7654 | ||
|
|
f0c5db92f7 | ||
|
|
394178c94c | ||
|
|
d420ac2c7d | ||
|
|
61590d8945 | ||
|
|
b79aa47a0c | ||
|
|
ec2a595627 | ||
|
|
8f5c833f3c | ||
|
|
e88c577738 | ||
|
|
ffe966b0fa | ||
|
|
a2b0de98af | ||
|
|
bb3de147b3 | ||
|
|
4775944f81 | ||
|
|
95ec1a717b | ||
|
|
2abd5b7aa0 | ||
|
|
380e145daf | ||
|
|
a9f2330f43 | ||
|
|
ce38bb1a8c | ||
|
|
919f8bcd21 | ||
|
|
325829a9bc | ||
|
|
2bfd2c74d2 | ||
|
|
82b2f57e30 | ||
|
|
2ae1ea3788 | ||
|
|
34066d741a | ||
|
|
b74cc0776b | ||
|
|
e7e5fe4705 | ||
|
|
998ae048e7 | ||
|
|
e65c2b9872 | ||
|
|
b0ea8b160c | ||
|
|
2fe9ab8e20 | ||
|
|
bb569f97b9 | ||
|
|
1145e03870 | ||
|
|
31670c94bc | ||
|
|
6781efb92f | ||
|
|
0bf1c1d80d | ||
|
|
67e5d33dd7 | ||
|
|
6ed474ca66 | ||
|
|
46cb8d3689 | ||
|
|
23fc5ac646 | ||
|
|
5734bebe05 | ||
|
|
657a919598 | ||
|
|
da17495b65 | ||
|
|
6859bb1a22 | ||
|
|
b64614adfe | ||
|
|
3822740ce3 | ||
|
|
0d78bc3356 | ||
|
|
d87b79bf31 | ||
|
|
6a6a08cbea | ||
|
|
70ef9c5a3d | ||
|
|
753cbc2857 | ||
|
|
b727907ae8 | ||
|
|
444c3a8492 | ||
|
|
9d68b289a0 | ||
|
|
eb5f555ffb | ||
|
|
04dc4edb44 | ||
|
|
d161f5a9b2 | ||
|
|
28474e26f4 | ||
|
|
85421c7148 | ||
|
|
77cc150b61 | ||
|
|
890b2abf19 | ||
|
|
6b051c4ebc | ||
|
|
a601df36f3 | ||
|
|
2d4b834926 | ||
|
|
c22e6753ef | ||
|
|
db5b10fab5 | ||
|
|
fa5846e58b | ||
|
|
79e4022a33 | ||
|
|
80986c9ced | ||
|
|
ede7c28eb7 | ||
|
|
c9d3957986 | ||
|
|
05e962ddf8 | ||
|
|
d680c13060 | ||
|
|
a510e9e4fc | ||
|
|
1a9e663b20 | ||
|
|
0dd675509c | ||
|
|
144aa3c56e | ||
|
|
202892dfd6 | ||
|
|
0c6fa13fee | ||
|
|
68f0bcfbc3 | ||
|
|
662ede2370 | ||
|
|
d0edf6e593 | ||
|
|
c93f908f7f | ||
|
|
16d2a7caef | ||
|
|
b7b5cd6132 | ||
|
|
71583fb0d7 | ||
|
|
058f86e9e0 | ||
|
|
4509102cb9 | ||
|
|
87c99c59bd | ||
|
|
732d1bf43a | ||
|
|
88fd7424f6 | ||
|
|
30a452ab32 | ||
|
|
9c90f27dac | ||
|
|
ec4e600da6 | ||
|
|
4097dce455 | ||
|
|
c9b552534e | ||
|
|
f0ad5fc2ab | ||
|
|
5f444c8fcd | ||
|
|
62afa8bd58 | ||
|
|
2689b8f326 | ||
|
|
bd69ac5c93 | ||
|
|
33ed371ec9 | ||
|
|
3b07c32fe7 | ||
|
|
9cc513a000 | ||
|
|
cac32e5acd | ||
|
|
0e9edc98d4 | ||
|
|
27bd937cc0 | ||
|
|
f56c451143 | ||
|
|
05a1f76093 | ||
|
|
4ed9388e5d |
@@ -1,5 +1,5 @@
|
||||
openssl.pc
|
||||
Makefile.ssl
|
||||
Makefile
|
||||
MINFO
|
||||
makefile.one
|
||||
tmp
|
||||
|
||||
70
CHANGES
70
CHANGES
@@ -2,9 +2,61 @@
|
||||
OpenSSL CHANGES
|
||||
_______________
|
||||
|
||||
Changes between 0.9.7c and 0.9.7d [xx XXX XXXX]
|
||||
Changes between 0.9.7d and 0.9.7e [XX xxx XXXX]
|
||||
|
||||
*)
|
||||
*) Reduce the chances of duplicate issuer name and serial numbers (in
|
||||
violation of RFC3280) using the OpenSSL certificate creation utilities.
|
||||
This is done by creating a random 64 bit value for the initial serial
|
||||
number when a serial number file is created or when a self signed
|
||||
certificate is created using 'openssl req -x509'. The initial serial
|
||||
number file is created using 'openssl x509 -next_serial' in CA.pl
|
||||
rather than being initialized to 1.
|
||||
[Steve Henson]
|
||||
|
||||
Changes between 0.9.7c and 0.9.7d [17 Mar 2004]
|
||||
|
||||
*) Fix null-pointer assignment in do_change_cipher_spec() revealed
|
||||
by using the Codenomicon TLS Test Tool (CAN-2004-0079)
|
||||
[Joe Orton, Steve Henson]
|
||||
|
||||
*) Fix flaw in SSL/TLS handshaking when using Kerberos ciphersuites
|
||||
(CAN-2004-0112)
|
||||
[Joe Orton, Steve Henson]
|
||||
|
||||
*) Make it possible to have multiple active certificates with the same
|
||||
subject in the CA index file. This is done only if the keyword
|
||||
'unique_subject' is set to 'no' in the main CA section (default
|
||||
if 'CA_default') of the configuration file. The value is saved
|
||||
with the database itself in a separate index attribute file,
|
||||
named like the index file with '.attr' appended to the name.
|
||||
[Richard Levitte]
|
||||
|
||||
*) X509 verify fixes. Disable broken certificate workarounds when
|
||||
X509_V_FLAGS_X509_STRICT is set. Check CRL issuer has cRLSign set if
|
||||
keyUsage extension present. Don't accept CRLs with unhandled critical
|
||||
extensions: since verify currently doesn't process CRL extensions this
|
||||
rejects a CRL with *any* critical extensions. Add new verify error codes
|
||||
for these cases.
|
||||
[Steve Henson]
|
||||
|
||||
*) When creating an OCSP nonce use an OCTET STRING inside the extnValue.
|
||||
A clarification of RFC2560 will require the use of OCTET STRINGs and
|
||||
some implementations cannot handle the current raw format. Since OpenSSL
|
||||
copies and compares OCSP nonces as opaque blobs without any attempt at
|
||||
parsing them this should not create any compatibility issues.
|
||||
[Steve Henson]
|
||||
|
||||
*) New md flag EVP_MD_CTX_FLAG_REUSE this allows md_data to be reused when
|
||||
calling EVP_MD_CTX_copy_ex() to avoid calling OPENSSL_malloc(). Without
|
||||
this HMAC (and other) operations are several times slower than OpenSSL
|
||||
< 0.9.7.
|
||||
[Steve Henson]
|
||||
|
||||
*) Print out GeneralizedTime and UTCTime in ASN1_STRING_print_ex().
|
||||
[Peter Sylvester <Peter.Sylvester@EdelWeb.fr>]
|
||||
|
||||
*) Use the correct content when signing type "other".
|
||||
[Steve Henson]
|
||||
|
||||
Changes between 0.9.7b and 0.9.7c [30 Sep 2003]
|
||||
|
||||
@@ -1996,6 +2048,20 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
|
||||
*) Clean old EAY MD5 hack from e_os.h.
|
||||
[Richard Levitte]
|
||||
|
||||
Changes between 0.9.6l and 0.9.6m [17 Mar 2004]
|
||||
|
||||
*) Fix null-pointer assignment in do_change_cipher_spec() revealed
|
||||
by using the Codenomicon TLS Test Tool (CAN-2004-0079)
|
||||
[Joe Orton, Steve Henson]
|
||||
|
||||
Changes between 0.9.6k and 0.9.6l [04 Nov 2003]
|
||||
|
||||
*) Fix additional bug revealed by the NISCC test suite:
|
||||
|
||||
Stop bug triggering large recursion when presented with
|
||||
certain ASN.1 tags (CAN-2003-0851)
|
||||
[Steve Henson]
|
||||
|
||||
Changes between 0.9.6j and 0.9.6k [30 Sep 2003]
|
||||
|
||||
*) Fix various bugs revealed by running the NISCC test suite:
|
||||
|
||||
41
Configure
41
Configure
@@ -10,7 +10,7 @@ use strict;
|
||||
|
||||
# see INSTALL for instructions.
|
||||
|
||||
my $usage="Usage: Configure [no-<cipher> ...] [-Dxxx] [-lxxx] [-Lxxx] [-fxxx] [-Kxxx] [no-engine] [no-hw-xxx|no-hw] [[no-]threads] [[no-]shared] [[no-]zlib|zlib-dynamic] [no-asm] [no-dso] [no-krb5] [386] [fips] [debug] [--prefix=DIR] [--openssldir=OPENSSLDIR] [--with-xxx[=vvv]] [--test-sanity] os/compiler[:flags]\n";
|
||||
my $usage="Usage: Configure [no-<cipher> ...] [-Dxxx] [-lxxx] [-Lxxx] [-fxxx] [-Kxxx] [no-engine] [no-hw-xxx|no-hw] [[no-]threads] [[no-]shared] [[no-]zlib|zlib-dynamic] [no-asm] [no-dso] [no-krb5] [386] [[no-]fips] [debug] [--prefix=DIR] [--openssldir=OPENSSLDIR] [--with-xxx[=vvv]] [--test-sanity] os/compiler[:flags]\n";
|
||||
|
||||
# Options:
|
||||
#
|
||||
@@ -140,16 +140,16 @@ my %table=(
|
||||
"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", "gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DPEDANTIC -DDEBUG_SAFESTACK -g3 -O2 -Wall -Wshadow -Werror -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-ben-fips-debug","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DPEDANTIC -DDEBUG_SAFESTACK -DFIPS -g3 -O2 -pedantic -Wall -Wshadow -Werror -pipe::(unknown)::::asm/bn86-elf.o asm/co86-elf.o",
|
||||
"debug-ben-fips-debug","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DPEDANTIC -DDEBUG_SAFESTACK -DOPENSSL_FIPS -g3 -O2 -pedantic -Wall -Wshadow -Werror -pipe::(unknown)::::asm/bn86-elf.o asm/co86-elf.o",
|
||||
"debug-rse","cc:-DTERMIOS -DL_ENDIAN -pipe -O -g -ggdb3 -Wall::(unknown):::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}",
|
||||
"debug-bodo", "gcc:-DL_ENDIAN -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DBIO_PAIR_DEBUG -DPEDANTIC -g -m486 -pedantic -Wshadow -Wall::-D_REENTRANT:::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}",
|
||||
"debug-ulf", "gcc:-DL_ENDIAN -DREF_CHECK -DCONF_DEBUG -DBN_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -g -O2 -m486 -Wall -Werror -Wshadow -pipe::-D_REENTRANT:::${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}",
|
||||
"debug-steve", "gcc:-DL_ENDIAN -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DDEBUG_SAFESTACK -DCRYPTO_MDEBUG_ALL -DPEDANTIC -g -mcpu=i486 -pedantic -Wall -Werror -Wshadow -pipe::-D_REENTRANT::-rdynamic -ldl:${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn",
|
||||
"debug-steve-linux-pseudo64", "gcc:-DL_ENDIAN -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DDEBUG_SAFESTACK -DCRYPTO_MDEBUG_ALL -DOPENSSL_NO_ASM -g -mcpu=i486 -Wall -Werror -Wshadow -pipe::-D_REENTRANT::-rdynamic -ldl:SIXTY_FOUR_BIT::dlfcn",
|
||||
"debug-levitte-linux-elf","gcc:-DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -DTERMIO -D_POSIX_SOURCE -DPEDANTIC -ggdb -g3 -mcpu=i486 -pedantic -ansi -Wall -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -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 -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -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 -pipe::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"debug-levitte-linux-elf-extreme","gcc:-DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -DTERMIO -D_POSIX_SOURCE -DPEDANTIC -ggdb -g3 -mcpu=i486 -pedantic -ansi -Wall -W -Wundef -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wconversion -Wno-long-long -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_CTX_DEBUG -DCRYPTO_MDEBUG -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 -Wconversion -Wno-long-long -pipe::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"debug-levitte-linux-elf","gcc:-DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -DTERMIO -D_POSIX_SOURCE -DPEDANTIC -ggdb -g3 -mcpu=i486 -pedantic -ansi -Wall -Wshadow -Wcast-align -Wmissing-prototypes -Wno-long-long -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 -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DOPENSSL_NO_ASM -DL_ENDIAN -DTERMIO -D_POSIX_SOURCE -DPEDANTIC -ggdb -g3 -mcpu=i486 -pedantic -ansi -Wall -Wshadow -Wcast-align -Wmissing-prototypes -Wno-long-long -pipe::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"debug-levitte-linux-elf-extreme","gcc:-DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -DTERMIO -D_POSIX_SOURCE -DPEDANTIC -ggdb -g3 -mcpu=i486 -pedantic -ansi -Wall -W -Wundef -Wshadow -Wcast-align -Wmissing-prototypes -Wconversion -Wno-long-long -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_CTX_DEBUG -DCRYPTO_MDEBUG -DOPENSSL_NO_ASM -DL_ENDIAN -DTERMIO -D_POSIX_SOURCE -DPEDANTIC -ggdb -g3 -mcpu=i486 -pedantic -ansi -Wall -W -Wundef -Wshadow -Wcast-align -Wmissing-prototypes -Wconversion -Wno-long-long -pipe::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"dist", "cc:-O::(unknown)::::::",
|
||||
|
||||
# Basic configs that should work on any (32 and less bit) box
|
||||
@@ -217,13 +217,13 @@ my %table=(
|
||||
"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::::::::::dlfcn:irix-shared:::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
#### IRIX 6.x configs
|
||||
# Only N32 and N64 ABIs are supported. If you need O32 ABI build, invoke
|
||||
# './Configure irix-[g]cc' manually.
|
||||
# './Configure irix-cc -o32' manually.
|
||||
# -mips4 flag is added by ./config when appropriate.
|
||||
"irix-mips3-gcc","gcc:-mabi=n32 -mmips-as -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_irix_asm}:dlfcn:irix-shared:::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"irix-mips3-cc", "cc:-n32 -mips3 -O2 -use_readonly_const -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_irix_asm}:dlfcn:irix-shared:::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"irix-mips3-gcc","gcc:-mabi=n32 -mmips-as -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_irix_asm}:dlfcn:irix-shared::-mabi=n32:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"irix-mips3-cc", "cc:-n32 -mips3 -O2 -use_readonly_const -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_irix_asm}:dlfcn:irix-shared::-n32:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
# N64 ABI builds.
|
||||
"irix64-mips4-gcc","gcc:-mabi=64 -mips4 -mmips-as -O3 -DTERMIOS -DB_ENDIAN -DBN_DIV3W::-D_SGI_MP_SOURCE:::RC4_CHAR RC4_CHUNK DES_RISC2 DES_UNROLL SIXTY_FOUR_BIT_LONG:${mips3_irix_asm}:dlfcn:irix-shared:::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"irix64-mips4-cc", "cc:-64 -mips4 -O2 -use_readonly_const -DTERMIOS -DB_ENDIAN -DBN_DIV3W::-D_SGI_MP_SOURCE:::RC4_CHAR RC4_CHUNK DES_RISC2 DES_UNROLL SIXTY_FOUR_BIT_LONG:${mips3_irix_asm}:dlfcn:irix-shared:::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"irix64-mips4-gcc","gcc:-mabi=64 -mips4 -mmips-as -O3 -DTERMIOS -DB_ENDIAN -DBN_DIV3W::-D_SGI_MP_SOURCE:::RC4_CHAR RC4_CHUNK DES_RISC2 DES_UNROLL SIXTY_FOUR_BIT_LONG:${mips3_irix_asm}:dlfcn:irix-shared::-mabi=64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"irix64-mips4-cc", "cc:-64 -mips4 -O2 -use_readonly_const -DTERMIOS -DB_ENDIAN -DBN_DIV3W::-D_SGI_MP_SOURCE:::RC4_CHAR RC4_CHUNK DES_RISC2 DES_UNROLL SIXTY_FOUR_BIT_LONG:${mips3_irix_asm}:dlfcn:irix-shared::-64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
|
||||
#### Unified HP-UX ANSI C configs.
|
||||
# Special notes:
|
||||
@@ -261,6 +261,7 @@ my %table=(
|
||||
# 64bit PARISC for GCC without optimization, which seems to make problems.
|
||||
# Submitted by <ross.alexander@uk.neceur.com>
|
||||
"hpux64-parisc-gcc","gcc:-DB_ENDIAN -DMD32_XARRAY::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT::::::::::dlfcn:hpux64-shared:-fpic::.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"hpux64-parisc2-gcc","gcc:-O3 -DB_ENDIAN -DMD32_XARRAY::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT:asm/pa-risc2W.o:::::::::dlfcn:hpux64-shared:-fpic::.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
|
||||
# IA-64 targets
|
||||
"hpux-ia64-cc","cc:-Ae +DD32 +O3 +Olit=all -z -DB_ENDIAN::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT:asm/ia64-cpp.o:::::::::dlfcn:hpux-shared:+Z::.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
@@ -609,7 +610,7 @@ my $threads=0;
|
||||
my $no_asm=0;
|
||||
my $no_dso=0;
|
||||
my @skip=();
|
||||
my $Makefile="Makefile.ssl";
|
||||
my $Makefile="Makefile";
|
||||
my $des_locl="crypto/des/des_locl.h";
|
||||
my $des ="crypto/des/des.h";
|
||||
my $bn ="crypto/bn/bn.h";
|
||||
@@ -621,6 +622,7 @@ my $rc2 ="crypto/rc2/rc2.h";
|
||||
my $bf ="crypto/bf/bf_locl.h";
|
||||
my $bn_asm ="bn_asm.o";
|
||||
my $des_enc="des_enc.o fcrypt_b.o";
|
||||
my $fips_des_enc="fips_des_enc.o";
|
||||
my $bf_enc ="bf_enc.o";
|
||||
my $cast_enc="c_enc.o";
|
||||
my $rc4_enc="rc4_enc.o";
|
||||
@@ -741,6 +743,8 @@ PROCESS_ARGS:
|
||||
{ $no_ssl3 = 1; }
|
||||
elsif (/^no-tls1?$/)
|
||||
{ $no_tls1 = 1; }
|
||||
elsif (/^no-fips$/)
|
||||
{ $fips = 0; }
|
||||
elsif (/^no-(.+)$/)
|
||||
{
|
||||
my $algo=$1;
|
||||
@@ -809,7 +813,6 @@ PROCESS_ARGS:
|
||||
elsif (/^fips$/)
|
||||
{
|
||||
$fips=1;
|
||||
$openssl_other_defines.="#define OPENSSL_FIPS\n";
|
||||
}
|
||||
elsif (/^debug$/)
|
||||
{
|
||||
@@ -1153,13 +1156,17 @@ $bn_obj = $bn_asm unless $bn_obj ne "";
|
||||
if ($fips)
|
||||
{
|
||||
$des_obj=$sha1_obj="";
|
||||
$openssl_other_defines.="#define OPENSSL_FIPS\n";
|
||||
}
|
||||
$des_obj=$des_enc unless (!$fips && $des_obj =~ /\.o$/);
|
||||
my $fips_des_obj='asm/fips-dx86-elf.o';
|
||||
$fips_des_obj=$fips_des_enc unless $processor eq '386';
|
||||
my $fips_sha1_obj='asm/sx86-elf.o' if $processor eq '386';
|
||||
$bf_obj=$bf_enc unless ($bf_obj =~ /\.o$/);
|
||||
$cast_obj=$cast_enc unless ($cast_obj =~ /\.o$/);
|
||||
$rc4_obj=$rc4_enc unless ($rc4_obj =~ /\.o$/);
|
||||
$rc5_obj=$rc5_enc unless ($rc5_obj =~ /\.o$/);
|
||||
if ($sha1_obj =~ /\.o$/)
|
||||
if ($sha1_obj =~ /\.o$/ || $fips_sha1_obj =~ /\.o$/)
|
||||
{
|
||||
# $sha1_obj=$sha1_enc;
|
||||
$cflags.=" -DSHA1_ASM";
|
||||
@@ -1253,12 +1260,14 @@ while (<IN>)
|
||||
s/^EXE_EXT=.*$/EXE_EXT= $exe_ext/;
|
||||
s/^BN_ASM=.*$/BN_ASM= $bn_obj/;
|
||||
s/^DES_ENC=.*$/DES_ENC= $des_obj/;
|
||||
s/^FIPS_DES_ENC=.*$/FIPS_DES_ENC= $fips_des_obj/;
|
||||
s/^BF_ENC=.*$/BF_ENC= $bf_obj/;
|
||||
s/^CAST_ENC=.*$/CAST_ENC= $cast_obj/;
|
||||
s/^RC4_ENC=.*$/RC4_ENC= $rc4_obj/;
|
||||
s/^RC5_ENC=.*$/RC5_ENC= $rc5_obj/;
|
||||
s/^MD5_ASM_OBJ=.*$/MD5_ASM_OBJ= $md5_obj/;
|
||||
s/^SHA1_ASM_OBJ=.*$/SHA1_ASM_OBJ= $sha1_obj/;
|
||||
s/^FIPS_SHA1_ASM_OBJ=.*$/FIPS_SHA1_ASM_OBJ= $fips_sha1_obj/;
|
||||
s/^RMD160_ASM_OBJ=.*$/RMD160_ASM_OBJ= $rmd160_obj/;
|
||||
s/^PROCESSOR=.*/PROCESSOR= $processor/;
|
||||
s/^RANLIB=.*/RANLIB= $ranlib/;
|
||||
@@ -1491,7 +1500,7 @@ if($IsWindows) {
|
||||
printf OUT <<EOF;
|
||||
#ifndef MK1MF_BUILD
|
||||
/* auto-generated by Configure for crypto/cversion.c:
|
||||
* for Unix builds, crypto/Makefile.ssl generates functional definitions;
|
||||
* for Unix builds, crypto/Makefile generates functional definitions;
|
||||
* Windows builds (and other mk1mf builds) compile cversion.c with
|
||||
* -DMK1MF_BUILD and use definitions added to this file by util/mk1mf.pl. */
|
||||
#error "Windows builds (PLATFORM=$target) use mk1mf.pl-created Makefiles"
|
||||
@@ -1499,7 +1508,7 @@ if($IsWindows) {
|
||||
EOF
|
||||
close(OUT);
|
||||
} else {
|
||||
my $make_command = "make -f Makefile.ssl PERL=\'$perl\'";
|
||||
my $make_command = "make PERL=\'$perl\'";
|
||||
my $make_targets = "";
|
||||
$make_targets .= " links" if $symlink;
|
||||
$make_targets .= " depend" if $depflags ne "" && $make_depend;
|
||||
|
||||
9
FAQ
9
FAQ
@@ -68,7 +68,7 @@ OpenSSL - Frequently Asked Questions
|
||||
* Which is the current version of OpenSSL?
|
||||
|
||||
The current version is available from <URL: http://www.openssl.org>.
|
||||
OpenSSL 0.9.7c was released on September 30, 2003.
|
||||
OpenSSL 0.9.7d was released on March 17, 2004.
|
||||
|
||||
In addition to the current stable release, you can also access daily
|
||||
snapshots of the OpenSSL development version at <URL:
|
||||
@@ -116,11 +116,14 @@ OpenSSL. Information on the OpenSSL mailing lists is available from
|
||||
|
||||
* Where can I get a compiled version of OpenSSL?
|
||||
|
||||
You can finder pointers to binary distributions in
|
||||
http://www.openssl.org/related/binaries.html .
|
||||
|
||||
Some applications that use OpenSSL are distributed in binary form.
|
||||
When using such an application, you don't need to install OpenSSL
|
||||
yourself; the application will include the required parts (e.g. DLLs).
|
||||
|
||||
If you want to install OpenSSL on a Windows system and you don't have
|
||||
If you want to build OpenSSL on a Windows system and you don't have
|
||||
a C compiler, read the "Mingw32" section of INSTALL.W32 for information
|
||||
on how to obtain and install the free GNU C compiler.
|
||||
|
||||
@@ -457,7 +460,7 @@ get the best result from OpenSSL. A bit more complicated solution is the
|
||||
following:
|
||||
|
||||
----- snip:start -----
|
||||
make DIRS=crypto SDIRS=sha "`grep '^CFLAG=' Makefile.ssl | \
|
||||
make DIRS=crypto SDIRS=sha "`grep '^CFLAG=' Makefile | \
|
||||
sed -e 's/ -O[0-9] / -O0 /'`"
|
||||
rm `ls crypto/*.o crypto/sha/*.o | grep -v 'sha_dgst\.o'`
|
||||
make
|
||||
|
||||
4
INSTALL
4
INSTALL
@@ -123,7 +123,7 @@
|
||||
generic configurations "cc" or "gcc" should usually work on 32 bit
|
||||
systems.
|
||||
|
||||
Configure creates the file Makefile.ssl from Makefile.org and
|
||||
Configure creates the file Makefile from Makefile.org and
|
||||
defines various macros in crypto/opensslconf.h (generated from
|
||||
crypto/opensslconf.h.in).
|
||||
|
||||
@@ -159,7 +159,7 @@
|
||||
the failure that isn't a problem in OpenSSL itself (like a missing
|
||||
or malfunctioning bc). If it is a problem with OpenSSL itself,
|
||||
try removing any compiler optimization flags from the CFLAG line
|
||||
in Makefile.ssl and run "make clean; make". Please send a bug
|
||||
in Makefile and run "make clean; make". Please send a bug
|
||||
report to <openssl-bugs@openssl.org>, including the output of
|
||||
"make report" in order to be added to the request tracker at
|
||||
http://www.openssl.org/support/rt2.html.
|
||||
|
||||
13
INSTALL.W32
13
INSTALL.W32
@@ -46,12 +46,13 @@
|
||||
http://www.kernel.org/pub/software/devel/nasm/binaries/win32/
|
||||
The NASM binary nasmw.exe needs to be installed anywhere on your PATH.
|
||||
|
||||
Firstly you should run Configure:
|
||||
Firstly you should run Configure (to build a FIPS-certified variant of
|
||||
OpenSSL, add the option "fips"):
|
||||
|
||||
> perl Configure VC-WIN32
|
||||
|
||||
Next you need to build the Makefiles and optionally the assembly language
|
||||
files:
|
||||
files (to build a FIPS-certified variant of OpenSSL, add the argument "fips"):
|
||||
|
||||
- If you are using MASM then run:
|
||||
|
||||
@@ -100,10 +101,12 @@
|
||||
Borland C++ builder 5
|
||||
---------------------
|
||||
|
||||
* Configure for building with Borland Builder:
|
||||
* Configure for building with Borland Builder (to build a FIPS-certified
|
||||
variant of OpenSSL, add the option "fips"):
|
||||
> perl Configure BC-32
|
||||
|
||||
* Create the appropriate makefile
|
||||
* Create the appropriate makefile (to build a FIPS-certified variant of
|
||||
OpenSSL, add the argument "fips")
|
||||
> ms\do_nasm
|
||||
|
||||
* Build
|
||||
@@ -194,6 +197,8 @@
|
||||
occur, try
|
||||
> ms\mingw32 no-asm
|
||||
instead.
|
||||
If you want to build a FIPS-certified variant of OpenSSL, add the argument
|
||||
"fips"
|
||||
|
||||
libcrypto.a and libssl.a are the static libraries. To use the DLLs,
|
||||
link with libeay32.a and libssl32.a instead.
|
||||
|
||||
2
LICENSE
2
LICENSE
@@ -12,7 +12,7 @@
|
||||
---------------
|
||||
|
||||
/* ====================================================================
|
||||
* Copyright (c) 1998-2003 The OpenSSL Project. All rights reserved.
|
||||
* Copyright (c) 1998-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
|
||||
|
||||
@@ -2750,4 +2750,4 @@ void SkipWhiteSpace(char **ioSrcCharPtr,const Boolean inStopAtEOL)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -167,4 +167,4 @@ void ThrowErrorMessageException(void)
|
||||
ThrowDescriptiveException(gErrorMessage);
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
41
Makefile.org
41
Makefile.org
@@ -101,6 +101,7 @@ PROCESSOR=
|
||||
|
||||
# Set DES_ENC to des_enc.o if you want to use the C version
|
||||
#There are 4 x86 assember options.
|
||||
FIPS_DES_ENC= des_enc.o fcrypt_b.o
|
||||
DES_ENC= asm/dx86-out.o asm/yx86-out.o
|
||||
#DES_ENC= des_enc.o fcrypt_b.o # C
|
||||
#DES_ENC= asm/dx86-elf.o asm/yx86-elf.o # elf
|
||||
@@ -153,6 +154,7 @@ MD5_ASM_OBJ= asm/mx86-out.o
|
||||
|
||||
# Also need SHA1_ASM defined
|
||||
SHA1_ASM_OBJ= asm/sx86-out.o
|
||||
FIPS_SHA1_ASM_OBJ= asm/sx86-out.o
|
||||
#SHA1_ASM_OBJ= asm/sx86-elf.o # elf
|
||||
#SHA1_ASM_OBJ= asm/sx86-sol.o # solaris
|
||||
#SHA1_ASM_OBJ= asm/sx86-out.o # a.out, FreeBSD
|
||||
@@ -190,8 +192,7 @@ FDIRS= sha1 rand des aes dsa rsa
|
||||
# should be performed.
|
||||
TESTS = alltests
|
||||
|
||||
MAKEFILE= Makefile.ssl
|
||||
MAKE= make -f Makefile.ssl
|
||||
MAKEFILE= Makefile
|
||||
|
||||
MANDIR=$(OPENSSLDIR)/man
|
||||
MAN1=1
|
||||
@@ -222,11 +223,12 @@ HEADER= e_os.h
|
||||
# When we're prepared to use shared libraries in the programs we link here
|
||||
# we might remove 'clean-shared' from the targets to perform at this stage
|
||||
|
||||
all: Makefile.ssl sub_all openssl.pc
|
||||
all: Makefile sub_all openssl.pc
|
||||
|
||||
sigs: $(SIGS)
|
||||
libcrypto.sha1: libcrypto.a
|
||||
if egrep 'define OPENSSL_FIPS' $(TOP)/include/openssl/opensslconf.h > /dev/null; then \
|
||||
$(RANLIB) libcrypto.a; \
|
||||
fips/sha1/fips_standalone_sha1 libcrypto.a > libcrypto.sha1; \
|
||||
fi
|
||||
|
||||
@@ -235,7 +237,7 @@ sub_all:
|
||||
do \
|
||||
if [ -d "$$i" ]; then \
|
||||
(cd $$i && echo "making all in $$i..." && \
|
||||
$(MAKE) CC='${CC}' PLATFORM='${PLATFORM}' CFLAG='${CFLAG}' AS='${AS}' ASFLAG='${ASFLAG}' SDIRS='$(SDIRS)' FDIRS='$(FDIRS)' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' BN_ASM='${BN_ASM}' DES_ENC='${DES_ENC}' BF_ENC='${BF_ENC}' CAST_ENC='${CAST_ENC}' RC4_ENC='${RC4_ENC}' RC5_ENC='${RC5_ENC}' SHA1_ASM_OBJ='${SHA1_ASM_OBJ}' MD5_ASM_OBJ='${MD5_ASM_OBJ}' RMD160_ASM_OBJ='${RMD160_ASM_OBJ}' AR='${AR}' PROCESSOR='${PROCESSOR}' PERL='${PERL}' RANLIB='${RANLIB}' KRB5_INCLUDES='${KRB5_INCLUDES}' LIBKRB5='${LIBKRB5}' EXE_EXT='${EXE_EXT}' SHARED_LIBS='${SHARED_LIBS}' SHLIB_EXT='${SHLIB_EXT}' SHLIB_TARGET='${SHLIB_TARGET}' all ) || exit 1; \
|
||||
$(MAKE) CC='${CC}' PLATFORM='${PLATFORM}' CFLAG='${CFLAG}' AS='${AS}' ASFLAG='${ASFLAG}' SDIRS='$(SDIRS)' FDIRS='$(FDIRS)' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' BN_ASM='${BN_ASM}' DES_ENC='${DES_ENC}' FIPS_DES_ENC='${FIPS_DES_ENC}' BF_ENC='${BF_ENC}' CAST_ENC='${CAST_ENC}' RC4_ENC='${RC4_ENC}' RC5_ENC='${RC5_ENC}' SHA1_ASM_OBJ='${SHA1_ASM_OBJ}' FIPS_SHA1_ASM_OBJ='${FIPS_SHA1_ASM_OBJ}' MD5_ASM_OBJ='${MD5_ASM_OBJ}' RMD160_ASM_OBJ='${RMD160_ASM_OBJ}' AR='${AR}' PROCESSOR='${PROCESSOR}' PERL='${PERL}' RANLIB='${RANLIB}' KRB5_INCLUDES='${KRB5_INCLUDES}' LIBKRB5='${LIBKRB5}' EXE_EXT='${EXE_EXT}' SHARED_LIBS='${SHARED_LIBS}' SHLIB_EXT='${SHLIB_EXT}' SHLIB_TARGET='${SHLIB_TARGET}' all ) || exit 1; \
|
||||
else \
|
||||
$(MAKE) $$i; \
|
||||
fi; \
|
||||
@@ -246,7 +248,7 @@ sub_target:
|
||||
do \
|
||||
if [ -d "$$i" ]; then \
|
||||
(cd $$i && echo "making $(TARGET) in $$i..." && \
|
||||
$(MAKE) CC='${CC}' PLATFORM='${PLATFORM}' CFLAG='${CFLAG}' AS='${AS}' ASFLAG='${ASFLAG}' SDIRS='$(SDIRS)' FDIRS='$(FDIRS)' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' BN_ASM='${BN_ASM}' DES_ENC='${DES_ENC}' BF_ENC='${BF_ENC}' CAST_ENC='${CAST_ENC}' RC4_ENC='${RC4_ENC}' RC5_ENC='${RC5_ENC}' SHA1_ASM_OBJ='${SHA1_ASM_OBJ}' MD5_ASM_OBJ='${MD5_ASM_OBJ}' RMD160_ASM_OBJ='${RMD160_ASM_OBJ}' AR='${AR}' PROCESSOR='${PROCESSOR}' PERL='${PERL}' RANLIB='${RANLIB}' KRB5_INCLUDES='${KRB5_INCLUDES}' LIBKRB5='${LIBKRB5}' EXE_EXT='${EXE_EXT}' SHARED_LIBS='${SHARED_LIBS}' SHLIB_EXT='${SHLIB_EXT}' SHLIB_TARGET='${SHLIB_TARGET}' TARGET='$(TARGET)' sub_target ) || exit 1; \
|
||||
$(MAKE) CC='${CC}' PLATFORM='${PLATFORM}' CFLAG='${CFLAG}' AS='${AS}' ASFLAG='${ASFLAG}' SDIRS='$(SDIRS)' FDIRS='$(FDIRS)' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' BN_ASM='${BN_ASM}' DES_ENC='${DES_ENC}' FIPS_DES_ENC='${FIPS_DES_ENC}' BF_ENC='${BF_ENC}' CAST_ENC='${CAST_ENC}' RC4_ENC='${RC4_ENC}' RC5_ENC='${RC5_ENC}' SHA1_ASM_OBJ='${SHA1_ASM_OBJ}' FIPS_SHA1_ASM_OBJ='${FIPS_SHA1_ASM_OBJ}' MD5_ASM_OBJ='${MD5_ASM_OBJ}' RMD160_ASM_OBJ='${RMD160_ASM_OBJ}' AR='${AR}' PROCESSOR='${PROCESSOR}' PERL='${PERL}' RANLIB='${RANLIB}' KRB5_INCLUDES='${KRB5_INCLUDES}' LIBKRB5='${LIBKRB5}' EXE_EXT='${EXE_EXT}' SHARED_LIBS='${SHARED_LIBS}' SHLIB_EXT='${SHLIB_EXT}' SHLIB_TARGET='${SHLIB_TARGET}' TARGET='$(TARGET)' sub_target ) || exit 1; \
|
||||
else \
|
||||
$(MAKE) $$i; \
|
||||
fi; \
|
||||
@@ -476,10 +478,12 @@ do_irix-shared:
|
||||
if [ "${SHLIBDIRS}" = "ssl" -a -n "$(LIBKRB5)" ]; then \
|
||||
libs="$(LIBKRB5) $$libs"; \
|
||||
fi; \
|
||||
( set -x; ${CC} ${SHARED_LDFLAGS} \
|
||||
( WHOLELIB="-all lib$$i.a -notall"; \
|
||||
(${CC} -v 2>&1 | grep gcc) > /dev/null && WHOLELIB="-Wl,-all,lib$$i.a,-notall"; \
|
||||
set -x; ${CC} ${SHARED_LDFLAGS} \
|
||||
-shared -o lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
|
||||
-Wl,-soname,lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
|
||||
-all lib$$i.a $$libs ${EX_LIBS} -lc) || exit 1; \
|
||||
$${WHOLELIB} $$libs ${EX_LIBS} -lc) || exit 1; \
|
||||
libs="-l$$i $$libs"; \
|
||||
done; \
|
||||
fi
|
||||
@@ -595,7 +599,7 @@ do_reliantunix-shared:
|
||||
libs="-l$$i $$libs"; \
|
||||
done
|
||||
|
||||
openssl.pc: Makefile.ssl
|
||||
openssl.pc: Makefile
|
||||
@ ( echo 'prefix=$(INSTALLTOP)'; \
|
||||
echo 'exec_prefix=$${prefix}'; \
|
||||
echo 'libdir=$${exec_prefix}/lib'; \
|
||||
@@ -608,8 +612,8 @@ openssl.pc: Makefile.ssl
|
||||
echo 'Libs: -L$${libdir} -lssl -lcrypto $(LIBKRB5) $(EX_LIBS)'; \
|
||||
echo 'Cflags: -I$${includedir} $(KRB5_INCLUDES)' ) > openssl.pc
|
||||
|
||||
Makefile.ssl: Makefile.org
|
||||
@echo "Makefile.ssl is older than Makefile.org."
|
||||
Makefile: Makefile.org
|
||||
@echo "Makefile is older than Makefile.org."
|
||||
@echo "Reconfigure the source tree (via './config' or 'perl Configure'), please."
|
||||
@false
|
||||
|
||||
@@ -639,7 +643,7 @@ makefile.one: files
|
||||
sh util/do_ms.sh
|
||||
|
||||
files:
|
||||
$(PERL) $(TOP)/util/files.pl Makefile.ssl > $(TOP)/MINFO
|
||||
$(PERL) $(TOP)/util/files.pl Makefile > $(TOP)/MINFO
|
||||
@for i in $(DIRS) ;\
|
||||
do \
|
||||
if [ -d "$$i" ]; then \
|
||||
@@ -649,19 +653,18 @@ files:
|
||||
done;
|
||||
|
||||
links:
|
||||
@$(TOP)/util/point.sh Makefile.ssl Makefile
|
||||
@$(PERL) $(TOP)/util/mkdir-p.pl include/openssl
|
||||
@$(PERL) $(TOP)/util/mklink.pl include/openssl $(EXHEADER)
|
||||
@for i in $(DIRS); do \
|
||||
if [ -d "$$i" ]; then \
|
||||
(cd $$i && echo "making links in $$i..." && \
|
||||
$(MAKE) CC='${CC}' PLATFORM='${PLATFORM}' CFLAG='${CFLAG}' SDIRS='$(SDIRS)' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' BN_ASM='${BN_ASM}' DES_ENC='${DES_ENC}' BF_ENC='${BF_ENC}' CAST_ENC='${CAST_ENC}' RC4_ENC='${RC4_ENC}' RC5_ENC='${RC5_ENC}' SHA1_ASM_OBJ='${SHA1_ASM_OBJ}' MD5_ASM_OBJ='${MD5_ASM_OBJ}' RMD160_ASM_OBJ='${RMD160_ASM_OBJ}' AR='${AR}' PERL='${PERL}' KRB5_INCLUDES='${KRB5_INCLUDES}' LIBKRB5='${LIBKRB5}' links ) || exit 1; \
|
||||
$(MAKE) CC='${CC}' PLATFORM='${PLATFORM}' CFLAG='${CFLAG}' SDIRS='$(SDIRS)' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' BN_ASM='${BN_ASM}' DES_ENC='${DES_ENC}' FIPS_DES_ENC='${FIPS_DES_ENC}' BF_ENC='${BF_ENC}' CAST_ENC='${CAST_ENC}' RC4_ENC='${RC4_ENC}' RC5_ENC='${RC5_ENC}' SHA1_ASM_OBJ='${SHA1_ASM_OBJ}' FIPS_SHA1_ASM_OBJ='${FIPS_SHA1_ASM_OBJ}' MD5_ASM_OBJ='${MD5_ASM_OBJ}' RMD160_ASM_OBJ='${RMD160_ASM_OBJ}' AR='${AR}' PERL='${PERL}' KRB5_INCLUDES='${KRB5_INCLUDES}' LIBKRB5='${LIBKRB5}' links ) || exit 1; \
|
||||
fi; \
|
||||
done;
|
||||
|
||||
gentests:
|
||||
@(cd test && echo "generating dummy tests (if needed)..." && \
|
||||
$(MAKE) CC='${CC}' PLATFORM='${PLATFORM}' CFLAG='${CFLAG}' SDIRS='$(SDIRS)' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' BN_ASM='${BN_ASM}' DES_ENC='${DES_ENC}' BF_ENC='${BF_ENC}' CAST_ENC='${CAST_ENC}' RC4_ENC='${RC4_ENC}' RC5_ENC='${RC5_ENC}' SHA1_ASM_OBJ='${SHA1_ASM_OBJ}' MD5_ASM_OBJ='${MD5_ASM_OBJ}' RMD160_ASM_OBJ='${RMD160_ASM_OBJ}' AR='${AR}' PROCESSOR='${PROCESSOR}' PERL='${PERL}' RANLIB='${RANLIB}' TESTS='${TESTS}' KRB5_INCLUDES='${KRB5_INCLUDES}' LIBKRB5='${LIBKRB5}' EXE_EXT='${EXE_EXT}' SHARED_LIBS='${SHARED_LIBS}' SHLIB_EXT='${SHLIB_EXT}' SHLIB_TARGET='${SHLIB_TARGET}' TESTS='${TESTS}' OPENSSL_DEBUG_MEMORY=on generate );
|
||||
$(MAKE) CC='${CC}' PLATFORM='${PLATFORM}' CFLAG='${CFLAG}' SDIRS='$(SDIRS)' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' BN_ASM='${BN_ASM}' DES_ENC='${DES_ENC}' FIPS_DES_ENC='${FIPS_DES_ENC}' BF_ENC='${BF_ENC}' CAST_ENC='${CAST_ENC}' RC4_ENC='${RC4_ENC}' RC5_ENC='${RC5_ENC}' SHA1_ASM_OBJ='${SHA1_ASM_OBJ}' FIPS_SHA1_ASM_OBJ='${FIPS_SHA1_ASM_OBJ}' MD5_ASM_OBJ='${MD5_ASM_OBJ}' RMD160_ASM_OBJ='${RMD160_ASM_OBJ}' AR='${AR}' PROCESSOR='${PROCESSOR}' PERL='${PERL}' RANLIB='${RANLIB}' TESTS='${TESTS}' KRB5_INCLUDES='${KRB5_INCLUDES}' LIBKRB5='${LIBKRB5}' EXE_EXT='${EXE_EXT}' SHARED_LIBS='${SHARED_LIBS}' SHLIB_EXT='${SHLIB_EXT}' SHLIB_TARGET='${SHLIB_TARGET}' TESTS='${TESTS}' OPENSSL_DEBUG_MEMORY=on generate );
|
||||
|
||||
dclean:
|
||||
rm -f *.bak
|
||||
@@ -690,7 +693,7 @@ test: tests
|
||||
|
||||
tests: rehash
|
||||
@(cd test && echo "testing..." && \
|
||||
$(MAKE) CC='${CC}' PLATFORM='${PLATFORM}' CFLAG='${CFLAG}' SDIRS='$(SDIRS)' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' BN_ASM='${BN_ASM}' DES_ENC='${DES_ENC}' BF_ENC='${BF_ENC}' CAST_ENC='${CAST_ENC}' RC4_ENC='${RC4_ENC}' RC5_ENC='${RC5_ENC}' SHA1_ASM_OBJ='${SHA1_ASM_OBJ}' MD5_ASM_OBJ='${MD5_ASM_OBJ}' RMD160_ASM_OBJ='${RMD160_ASM_OBJ}' AR='${AR}' PROCESSOR='${PROCESSOR}' PERL='${PERL}' RANLIB='${RANLIB}' TESTS='${TESTS}' KRB5_INCLUDES='${KRB5_INCLUDES}' LIBKRB5='${LIBKRB5}' EXE_EXT='${EXE_EXT}' SHARED_LIBS='${SHARED_LIBS}' SHLIB_EXT='${SHLIB_EXT}' SHLIB_TARGET='${SHLIB_TARGET}' TESTS='${TESTS}' OPENSSL_DEBUG_MEMORY=on tests );
|
||||
$(MAKE) CC='${CC}' PLATFORM='${PLATFORM}' CFLAG='${CFLAG}' SDIRS='$(SDIRS)' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' BN_ASM='${BN_ASM}' DES_ENC='${DES_ENC}' FIPS_DES_ENC='${FIPS_DES_ENC}' BF_ENC='${BF_ENC}' CAST_ENC='${CAST_ENC}' RC4_ENC='${RC4_ENC}' RC5_ENC='${RC5_ENC}' SHA1_ASM_OBJ='${SHA1_ASM_OBJ}' FIPS_SHA1_ASM_OBJ='${FIPS_SHA1_ASM_OBJ}' MD5_ASM_OBJ='${MD5_ASM_OBJ}' RMD160_ASM_OBJ='${RMD160_ASM_OBJ}' AR='${AR}' PROCESSOR='${PROCESSOR}' PERL='${PERL}' RANLIB='${RANLIB}' TESTS='${TESTS}' KRB5_INCLUDES='${KRB5_INCLUDES}' LIBKRB5='${LIBKRB5}' EXE_EXT='${EXE_EXT}' SHARED_LIBS='${SHARED_LIBS}' SHLIB_EXT='${SHLIB_EXT}' SHLIB_TARGET='${SHLIB_TARGET}' TESTS='${TESTS}' OPENSSL_DEBUG_MEMORY=on tests );
|
||||
@LD_LIBRARY_PATH="`pwd`:$$LD_LIBRARY_PATH"; \
|
||||
DYLD_LIBRARY_PATH="`pwd`:$$DYLD_LIBRARY_PATH"; \
|
||||
SHLIB_PATH="`pwd`:$$SHLIB_PATH"; \
|
||||
@@ -795,8 +798,7 @@ install: all install_docs
|
||||
$(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl \
|
||||
$(INSTALL_PREFIX)$(OPENSSLDIR)/misc \
|
||||
$(INSTALL_PREFIX)$(OPENSSLDIR)/certs \
|
||||
$(INSTALL_PREFIX)$(OPENSSLDIR)/private \
|
||||
$(INSTALL_PREFIX)$(OPENSSLDIR)/lib
|
||||
$(INSTALL_PREFIX)$(OPENSSLDIR)/private
|
||||
@for i in $(EXHEADER) ;\
|
||||
do \
|
||||
(cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \
|
||||
@@ -814,7 +816,9 @@ install: all install_docs
|
||||
if [ -f "$$i" ]; then \
|
||||
( echo installing $$i; \
|
||||
cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \
|
||||
$(RANLIB) $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \
|
||||
if ! egrep 'define OPENSSL_FIPS' $(TOP)/include/openssl/opensslconf.h > /dev/null; then \
|
||||
$(RANLIB) $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \
|
||||
fi; \
|
||||
chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \
|
||||
mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i ); \
|
||||
fi; \
|
||||
@@ -856,6 +860,7 @@ install: all install_docs
|
||||
if [ -f "$$i" ]; then \
|
||||
( echo installing $$i; \
|
||||
cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \
|
||||
chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \
|
||||
mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i ); \
|
||||
fi; \
|
||||
done;
|
||||
|
||||
8
NEWS
8
NEWS
@@ -5,6 +5,14 @@
|
||||
This file gives a brief overview of the major changes between each OpenSSL
|
||||
release. For more details please read the CHANGES file.
|
||||
|
||||
Major changes between OpenSSL 0.9.7c and OpenSSL 0.9.7d:
|
||||
|
||||
o Security: Fix Kerberos ciphersuite SSL/TLS handshaking bug
|
||||
o Security: Fix null-pointer assignment in do_change_cipher_spec()
|
||||
o Allow multiple active certificates with same subject in CA index
|
||||
o Multiple X590 verification fixes
|
||||
o Speed up HMAC and other operations
|
||||
|
||||
Major changes between OpenSSL 0.9.7b and OpenSSL 0.9.7c:
|
||||
|
||||
o Security: fix various ASN1 parsing bugs.
|
||||
|
||||
4
PROBLEMS
4
PROBLEMS
@@ -12,8 +12,8 @@ along the whole library path before it bothers looking for .a libraries. This
|
||||
means that -L switches won't matter unless OpenSSL is built with shared
|
||||
library support.
|
||||
|
||||
The workaround may be to change the following lines in apps/Makefile.ssl and
|
||||
test/Makefile.ssl:
|
||||
The workaround may be to change the following lines in apps/Makefile and
|
||||
test/Makefile:
|
||||
|
||||
LIBCRYPTO=-L.. -lcrypto
|
||||
LIBSSL=-L.. -lssl
|
||||
|
||||
4
README
4
README
@@ -1,7 +1,7 @@
|
||||
|
||||
OpenSSL 0.9.7c 30 Sep 2003
|
||||
OpenSSL 0.9.7d 17 Mar 2004
|
||||
|
||||
Copyright (c) 1998-2003 The OpenSSL Project
|
||||
Copyright (c) 1998-2004 The OpenSSL Project
|
||||
Copyright (c) 1995-1998 Eric A. Young, Tim J. Hudson
|
||||
All rights reserved.
|
||||
|
||||
|
||||
5
STATUS
5
STATUS
@@ -1,14 +1,17 @@
|
||||
|
||||
OpenSSL STATUS Last modified at
|
||||
______________ $Date: 2003/10/02 10:55:20 $
|
||||
______________ $Date: 2004/03/23 15:00:59 $
|
||||
|
||||
DEVELOPMENT STATE
|
||||
|
||||
o OpenSSL 0.9.8: Under development...
|
||||
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
|
||||
|
||||
68
TABLE
68
TABLE
@@ -1552,7 +1552,7 @@ $arflags =
|
||||
|
||||
*** debug-ben-fips-debug
|
||||
$cc = gcc
|
||||
$cflags = -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DPEDANTIC -DDEBUG_SAFESTACK -DFIPS -g3 -O2 -pedantic -Wall -Wshadow -Werror -pipe
|
||||
$cflags = -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DPEDANTIC -DDEBUG_SAFESTACK -DOPENSSL_FIPS -g3 -O2 -pedantic -Wall -Wshadow -Werror -pipe
|
||||
$unistd =
|
||||
$thread_cflag = (unknown)
|
||||
$sys_id =
|
||||
@@ -1677,7 +1677,7 @@ $arflags =
|
||||
|
||||
*** debug-levitte-linux-elf
|
||||
$cc = gcc
|
||||
$cflags = -DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -DTERMIO -D_POSIX_SOURCE -DPEDANTIC -ggdb -g3 -mcpu=i486 -pedantic -ansi -Wall -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -pipe
|
||||
$cflags = -DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -DTERMIO -D_POSIX_SOURCE -DPEDANTIC -ggdb -g3 -mcpu=i486 -pedantic -ansi -Wall -Wshadow -Wcast-align -Wmissing-prototypes -Wno-long-long -pipe
|
||||
$unistd =
|
||||
$thread_cflag = -D_REENTRANT
|
||||
$sys_id =
|
||||
@@ -1702,7 +1702,7 @@ $arflags =
|
||||
|
||||
*** debug-levitte-linux-elf-extreme
|
||||
$cc = gcc
|
||||
$cflags = -DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -DTERMIO -D_POSIX_SOURCE -DPEDANTIC -ggdb -g3 -mcpu=i486 -pedantic -ansi -Wall -W -Wundef -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wconversion -Wno-long-long -pipe
|
||||
$cflags = -DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -DTERMIO -D_POSIX_SOURCE -DPEDANTIC -ggdb -g3 -mcpu=i486 -pedantic -ansi -Wall -W -Wundef -Wshadow -Wcast-align -Wmissing-prototypes -Wconversion -Wno-long-long -pipe
|
||||
$unistd =
|
||||
$thread_cflag = -D_REENTRANT
|
||||
$sys_id =
|
||||
@@ -1727,7 +1727,7 @@ $arflags =
|
||||
|
||||
*** debug-levitte-linux-noasm
|
||||
$cc = gcc
|
||||
$cflags = -DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -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 -pipe
|
||||
$cflags = -DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DOPENSSL_NO_ASM -DL_ENDIAN -DTERMIO -D_POSIX_SOURCE -DPEDANTIC -ggdb -g3 -mcpu=i486 -pedantic -ansi -Wall -Wshadow -Wcast-align -Wmissing-prototypes -Wno-long-long -pipe
|
||||
$unistd =
|
||||
$thread_cflag = -D_REENTRANT
|
||||
$sys_id =
|
||||
@@ -1752,7 +1752,7 @@ $arflags =
|
||||
|
||||
*** debug-levitte-linux-noasm-extreme
|
||||
$cc = gcc
|
||||
$cflags = -DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -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 -Wconversion -Wno-long-long -pipe
|
||||
$cflags = -DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DOPENSSL_NO_ASM -DL_ENDIAN -DTERMIO -D_POSIX_SOURCE -DPEDANTIC -ggdb -g3 -mcpu=i486 -pedantic -ansi -Wall -W -Wundef -Wshadow -Wcast-align -Wmissing-prototypes -Wconversion -Wno-long-long -pipe
|
||||
$unistd =
|
||||
$thread_cflag = -D_REENTRANT
|
||||
$sys_id =
|
||||
@@ -2675,6 +2675,31 @@ $shared_extension = .sl.$(SHLIB_MAJOR).$(SHLIB_MINOR)
|
||||
$ranlib =
|
||||
$arflags =
|
||||
|
||||
*** hpux64-parisc2-gcc
|
||||
$cc = gcc
|
||||
$cflags = -O3 -DB_ENDIAN -DMD32_XARRAY
|
||||
$unistd =
|
||||
$thread_cflag = -D_REENTRANT
|
||||
$sys_id =
|
||||
$lflags = -ldl
|
||||
$bn_ops = SIXTY_FOUR_BIT_LONG MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT
|
||||
$bn_obj = asm/pa-risc2W.o
|
||||
$des_obj =
|
||||
$bf_obj =
|
||||
$md5_obj =
|
||||
$sha1_obj =
|
||||
$cast_obj =
|
||||
$rc4_obj =
|
||||
$rmd160_obj =
|
||||
$rc5_obj =
|
||||
$dso_scheme = dlfcn
|
||||
$shared_target= hpux64-shared
|
||||
$shared_cflag = -fpic
|
||||
$shared_ldflag =
|
||||
$shared_extension = .sl.$(SHLIB_MAJOR).$(SHLIB_MINOR)
|
||||
$ranlib =
|
||||
$arflags =
|
||||
|
||||
*** hurd-x86
|
||||
$cc = gcc
|
||||
$cflags = -DL_ENDIAN -DTERMIOS -O3 -fomit-frame-pointer -m486 -Wall
|
||||
@@ -2770,7 +2795,7 @@ $rc5_obj =
|
||||
$dso_scheme = dlfcn
|
||||
$shared_target= irix-shared
|
||||
$shared_cflag =
|
||||
$shared_ldflag =
|
||||
$shared_ldflag = -n32
|
||||
$shared_extension = .so.$(SHLIB_MAJOR).$(SHLIB_MINOR)
|
||||
$ranlib =
|
||||
$arflags =
|
||||
@@ -2795,7 +2820,7 @@ $rc5_obj =
|
||||
$dso_scheme = dlfcn
|
||||
$shared_target= irix-shared
|
||||
$shared_cflag =
|
||||
$shared_ldflag =
|
||||
$shared_ldflag = -mabi=n32
|
||||
$shared_extension = .so.$(SHLIB_MAJOR).$(SHLIB_MINOR)
|
||||
$ranlib =
|
||||
$arflags =
|
||||
@@ -2820,7 +2845,7 @@ $rc5_obj =
|
||||
$dso_scheme = dlfcn
|
||||
$shared_target= irix-shared
|
||||
$shared_cflag =
|
||||
$shared_ldflag =
|
||||
$shared_ldflag = -64
|
||||
$shared_extension = .so.$(SHLIB_MAJOR).$(SHLIB_MINOR)
|
||||
$ranlib =
|
||||
$arflags =
|
||||
@@ -2845,7 +2870,7 @@ $rc5_obj =
|
||||
$dso_scheme = dlfcn
|
||||
$shared_target= irix-shared
|
||||
$shared_cflag =
|
||||
$shared_ldflag =
|
||||
$shared_ldflag = -mabi=64
|
||||
$shared_extension = .so.$(SHLIB_MAJOR).$(SHLIB_MINOR)
|
||||
$ranlib =
|
||||
$arflags =
|
||||
@@ -4375,31 +4400,6 @@ $shared_extension =
|
||||
$ranlib =
|
||||
$arflags =
|
||||
|
||||
*** vxworks-ppc860
|
||||
$cc = ccppc
|
||||
$cflags = -g -msoft-float -DCPU=PPC860 -DNO_STRINGS_H -I$(WIND_BASE)/target/h
|
||||
$unistd =
|
||||
$thread_cflag =
|
||||
$sys_id = VXWORKS
|
||||
$lflags = -r
|
||||
$bn_ops =
|
||||
$bn_obj =
|
||||
$des_obj =
|
||||
$bf_obj =
|
||||
$md5_obj =
|
||||
$sha1_obj =
|
||||
$cast_obj =
|
||||
$rc4_obj =
|
||||
$rmd160_obj =
|
||||
$rc5_obj =
|
||||
$dso_scheme =
|
||||
$shared_target=
|
||||
$shared_cflag =
|
||||
$shared_ldflag =
|
||||
$shared_extension =
|
||||
$ranlib =
|
||||
$arflags =
|
||||
|
||||
*** vxworks-ppc860
|
||||
$cc = ccppc
|
||||
$cflags = -nostdinc -msoft-float -DCPU=PPC860 -DNO_STRINGS_H -I$(WIND_BASE)/target/h
|
||||
|
||||
@@ -82,9 +82,6 @@ foreach (@ARGV) {
|
||||
mkdir "${CATOP}/crl", $DIRMODE ;
|
||||
mkdir "${CATOP}/newcerts", $DIRMODE;
|
||||
mkdir "${CATOP}/private", $DIRMODE;
|
||||
open OUT, ">${CATOP}/serial";
|
||||
print OUT "01\n";
|
||||
close OUT;
|
||||
open OUT, ">${CATOP}/index.txt";
|
||||
close OUT;
|
||||
}
|
||||
@@ -106,6 +103,10 @@ foreach (@ARGV) {
|
||||
$RET=$?;
|
||||
}
|
||||
}
|
||||
if (! -f "${CATOP}/serial" ) {
|
||||
system ("$X509 -in ${CATOP}/$CACERT -noout "
|
||||
. "-next_serial -out ${CATOP}/serial");
|
||||
}
|
||||
} elsif (/^-pkcs12$/) {
|
||||
my $cname = $ARGV[1];
|
||||
$cname = "My Certificate" unless defined $cname;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# apps/Makefile.ssl
|
||||
# apps/Makefile
|
||||
#
|
||||
|
||||
DIR= apps
|
||||
@@ -10,10 +10,9 @@ CFLAG= -g -static
|
||||
INSTALL_PREFIX=
|
||||
INSTALLTOP= /usr/local/ssl
|
||||
OPENSSLDIR= /usr/local/ssl
|
||||
MAKE= make -f Makefile.ssl
|
||||
MAKEDEPPROG= makedepend
|
||||
MAKEDEPEND= $(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG)
|
||||
MAKEFILE= Makefile.ssl
|
||||
MAKEFILE= Makefile
|
||||
PERL= perl
|
||||
RM= rm -f
|
||||
# KRB5 stuff
|
||||
@@ -94,7 +93,7 @@ sreq.o: req.c
|
||||
$(CC) -c $(INCLUDES) $(CFLAG) -o sreq.o req.c
|
||||
|
||||
files:
|
||||
$(PERL) $(TOP)/util/files.pl Makefile.ssl >> $(TOP)/MINFO
|
||||
$(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO
|
||||
|
||||
install:
|
||||
@for i in $(EXE); \
|
||||
@@ -121,7 +120,6 @@ tags:
|
||||
tests:
|
||||
|
||||
links:
|
||||
@$(TOP)/util/point.sh Makefile.ssl Makefile
|
||||
|
||||
lint:
|
||||
lint -DLINT $(INCLUDES) $(SRC)>fluff
|
||||
@@ -151,6 +149,7 @@ $(PROGRAM): progs.h $(E_OBJ) $(PROGRAM).o $(DLIBCRYPTO) $(DLIBSSL)
|
||||
LD_LIBRARY_PATH=..:$$LD_LIBRARY_PATH \
|
||||
$(CC) -o $(PROGRAM) $(CFLAGS) $(PROGRAM).o $(E_OBJ) $(PEX_LIBS) $(LIBSSL) $(LIBKRB5) $(LIBCRYPTO) $(EX_LIBS) ; \
|
||||
fi
|
||||
TOP=$(TOP) $(TOP)/fips/openssl_fips_fingerprint $(TOP)/libcrypto.a $(PROGRAM)
|
||||
-(cd ..; OPENSSL="`pwd`/apps/openssl"; export OPENSSL; \
|
||||
LD_LIBRARY_PATH="`pwd`:$$LD_LIBRARY_PATH"; \
|
||||
DYLD_LIBRARY_PATH="`pwd`:$$DYLD_LIBRARY_PATH"; \
|
||||
@@ -344,21 +343,22 @@ dgst.o: ../include/openssl/crypto.h ../include/openssl/des.h
|
||||
dgst.o: ../include/openssl/des_old.h ../include/openssl/dh.h
|
||||
dgst.o: ../include/openssl/dsa.h ../include/openssl/e_os2.h
|
||||
dgst.o: ../include/openssl/engine.h ../include/openssl/err.h
|
||||
dgst.o: ../include/openssl/evp.h ../include/openssl/idea.h
|
||||
dgst.o: ../include/openssl/lhash.h ../include/openssl/md2.h
|
||||
dgst.o: ../include/openssl/md4.h ../include/openssl/md5.h
|
||||
dgst.o: ../include/openssl/mdc2.h ../include/openssl/obj_mac.h
|
||||
dgst.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h
|
||||
dgst.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h
|
||||
dgst.o: ../include/openssl/pem.h ../include/openssl/pem2.h
|
||||
dgst.o: ../include/openssl/pkcs7.h ../include/openssl/rand.h
|
||||
dgst.o: ../include/openssl/rc2.h ../include/openssl/rc4.h
|
||||
dgst.o: ../include/openssl/rc5.h ../include/openssl/ripemd.h
|
||||
dgst.o: ../include/openssl/rsa.h ../include/openssl/safestack.h
|
||||
dgst.o: ../include/openssl/sha.h ../include/openssl/stack.h
|
||||
dgst.o: ../include/openssl/symhacks.h ../include/openssl/txt_db.h
|
||||
dgst.o: ../include/openssl/ui.h ../include/openssl/ui_compat.h
|
||||
dgst.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h apps.h dgst.c
|
||||
dgst.o: ../include/openssl/evp.h ../include/openssl/hmac.h
|
||||
dgst.o: ../include/openssl/idea.h ../include/openssl/lhash.h
|
||||
dgst.o: ../include/openssl/md2.h ../include/openssl/md4.h
|
||||
dgst.o: ../include/openssl/md5.h ../include/openssl/mdc2.h
|
||||
dgst.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h
|
||||
dgst.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
|
||||
dgst.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h
|
||||
dgst.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h
|
||||
dgst.o: ../include/openssl/rand.h ../include/openssl/rc2.h
|
||||
dgst.o: ../include/openssl/rc4.h ../include/openssl/rc5.h
|
||||
dgst.o: ../include/openssl/ripemd.h ../include/openssl/rsa.h
|
||||
dgst.o: ../include/openssl/safestack.h ../include/openssl/sha.h
|
||||
dgst.o: ../include/openssl/stack.h ../include/openssl/symhacks.h
|
||||
dgst.o: ../include/openssl/txt_db.h ../include/openssl/ui.h
|
||||
dgst.o: ../include/openssl/ui_compat.h ../include/openssl/x509.h
|
||||
dgst.o: ../include/openssl/x509_vfy.h apps.h dgst.c
|
||||
dh.o: ../e_os.h ../include/openssl/aes.h ../include/openssl/asn1.h
|
||||
dh.o: ../include/openssl/bio.h ../include/openssl/blowfish.h
|
||||
dh.o: ../include/openssl/bn.h ../include/openssl/buffer.h
|
||||
@@ -637,24 +637,25 @@ openssl.o: ../include/openssl/des.h ../include/openssl/des_old.h
|
||||
openssl.o: ../include/openssl/dh.h ../include/openssl/dsa.h
|
||||
openssl.o: ../include/openssl/e_os2.h ../include/openssl/engine.h
|
||||
openssl.o: ../include/openssl/err.h ../include/openssl/evp.h
|
||||
openssl.o: ../include/openssl/idea.h ../include/openssl/kssl.h
|
||||
openssl.o: ../include/openssl/lhash.h ../include/openssl/md2.h
|
||||
openssl.o: ../include/openssl/md4.h ../include/openssl/md5.h
|
||||
openssl.o: ../include/openssl/mdc2.h ../include/openssl/obj_mac.h
|
||||
openssl.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h
|
||||
openssl.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h
|
||||
openssl.o: ../include/openssl/pem.h ../include/openssl/pem2.h
|
||||
openssl.o: ../include/openssl/pkcs7.h ../include/openssl/rand.h
|
||||
openssl.o: ../include/openssl/rc2.h ../include/openssl/rc4.h
|
||||
openssl.o: ../include/openssl/rc5.h ../include/openssl/ripemd.h
|
||||
openssl.o: ../include/openssl/rsa.h ../include/openssl/safestack.h
|
||||
openssl.o: ../include/openssl/sha.h ../include/openssl/ssl.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/symhacks.h ../include/openssl/tls1.h
|
||||
openssl.o: ../include/openssl/txt_db.h ../include/openssl/ui.h
|
||||
openssl.o: ../include/openssl/ui_compat.h ../include/openssl/x509.h
|
||||
openssl.o: ../include/openssl/x509_vfy.h apps.h openssl.c progs.h s_apps.h
|
||||
openssl.o: ../include/openssl/fips.h ../include/openssl/idea.h
|
||||
openssl.o: ../include/openssl/kssl.h ../include/openssl/lhash.h
|
||||
openssl.o: ../include/openssl/md2.h ../include/openssl/md4.h
|
||||
openssl.o: ../include/openssl/md5.h ../include/openssl/mdc2.h
|
||||
openssl.o: ../include/openssl/obj_mac.h ../include/openssl/objects.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/pem2.h ../include/openssl/pkcs7.h
|
||||
openssl.o: ../include/openssl/rand.h ../include/openssl/rc2.h
|
||||
openssl.o: ../include/openssl/rc4.h ../include/openssl/rc5.h
|
||||
openssl.o: ../include/openssl/ripemd.h ../include/openssl/rsa.h
|
||||
openssl.o: ../include/openssl/safestack.h ../include/openssl/sha.h
|
||||
openssl.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h
|
||||
openssl.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h
|
||||
openssl.o: ../include/openssl/stack.h ../include/openssl/symhacks.h
|
||||
openssl.o: ../include/openssl/tls1.h ../include/openssl/txt_db.h
|
||||
openssl.o: ../include/openssl/ui.h ../include/openssl/ui_compat.h
|
||||
openssl.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h apps.h
|
||||
openssl.o: openssl.c progs.h s_apps.h
|
||||
passwd.o: ../e_os.h ../include/openssl/aes.h ../include/openssl/asn1.h
|
||||
passwd.o: ../include/openssl/bio.h ../include/openssl/blowfish.h
|
||||
passwd.o: ../include/openssl/bn.h ../include/openssl/buffer.h
|
||||
671
apps/apps.c
671
apps/apps.c
@@ -330,41 +330,19 @@ void program_name(char *in, char *out, int size)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef OPENSSL_SYS_WIN32
|
||||
int WIN32_rename(char *from, char *to)
|
||||
#ifdef OPENSSL_SYS_VMS
|
||||
int VMS_strcasecmp(const char *str1, const char *str2)
|
||||
{
|
||||
#ifndef OPENSSL_SYS_WINCE
|
||||
/* Windows rename gives an error if 'to' exists, so delete it
|
||||
* first and ignore file not found errror
|
||||
*/
|
||||
if((remove(to) != 0) && (errno != ENOENT))
|
||||
return -1;
|
||||
#undef rename
|
||||
return rename(from, to);
|
||||
#else
|
||||
/* convert strings to UNICODE */
|
||||
{
|
||||
BOOL result = FALSE;
|
||||
WCHAR* wfrom;
|
||||
WCHAR* wto;
|
||||
int i;
|
||||
wfrom = malloc((strlen(from)+1)*2);
|
||||
wto = malloc((strlen(to)+1)*2);
|
||||
if (wfrom != NULL && wto != NULL)
|
||||
while (*str1 && *str2)
|
||||
{
|
||||
for (i=0; i<(int)strlen(from)+1; i++)
|
||||
wfrom[i] = (short)from[i];
|
||||
for (i=0; i<(int)strlen(to)+1; i++)
|
||||
wto[i] = (short)to[i];
|
||||
result = MoveFile(wfrom, wto);
|
||||
int res = toupper(*str1) - toupper(*str2);
|
||||
if (res) return res < 0 ? -1 : 1;
|
||||
}
|
||||
if (wfrom != NULL)
|
||||
free(wfrom);
|
||||
if (wto != NULL)
|
||||
free(wto);
|
||||
return result;
|
||||
}
|
||||
#endif
|
||||
if (*str1)
|
||||
return 1;
|
||||
if (*str2)
|
||||
return -1;
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -475,7 +453,7 @@ static int ui_read(UI *ui, UI_STRING *uis)
|
||||
{
|
||||
const char *password =
|
||||
((PW_CB_DATA *)UI_get0_user_data(ui))->password;
|
||||
if (password[0] != '\0')
|
||||
if (password && password[0] != '\0')
|
||||
{
|
||||
UI_set_result(ui, uis, password);
|
||||
return 1;
|
||||
@@ -499,7 +477,7 @@ static int ui_write(UI *ui, UI_STRING *uis)
|
||||
{
|
||||
const char *password =
|
||||
((PW_CB_DATA *)UI_get0_user_data(ui))->password;
|
||||
if (password[0] != '\0')
|
||||
if (password && password[0] != '\0')
|
||||
return 1;
|
||||
}
|
||||
default:
|
||||
@@ -1385,14 +1363,631 @@ int load_config(BIO *err, CONF *cnf)
|
||||
char *make_config_name()
|
||||
{
|
||||
const char *t=X509_get_default_cert_area();
|
||||
size_t len;
|
||||
char *p;
|
||||
|
||||
p=OPENSSL_malloc(strlen(t)+strlen(OPENSSL_CONF)+2);
|
||||
strcpy(p,t);
|
||||
len=strlen(t)+strlen(OPENSSL_CONF)+2;
|
||||
p=OPENSSL_malloc(len);
|
||||
BUF_strlcpy(p,t,len);
|
||||
#ifndef OPENSSL_SYS_VMS
|
||||
strcat(p,"/");
|
||||
BUF_strlcat(p,"/",len);
|
||||
#endif
|
||||
strcat(p,OPENSSL_CONF);
|
||||
BUF_strlcat(p,OPENSSL_CONF,len);
|
||||
|
||||
return p;
|
||||
}
|
||||
|
||||
static unsigned long index_serial_hash(const char **a)
|
||||
{
|
||||
const char *n;
|
||||
|
||||
n=a[DB_serial];
|
||||
while (*n == '0') n++;
|
||||
return(lh_strhash(n));
|
||||
}
|
||||
|
||||
static int index_serial_cmp(const char **a, const char **b)
|
||||
{
|
||||
const char *aa,*bb;
|
||||
|
||||
for (aa=a[DB_serial]; *aa == '0'; aa++);
|
||||
for (bb=b[DB_serial]; *bb == '0'; bb++);
|
||||
return(strcmp(aa,bb));
|
||||
}
|
||||
|
||||
static int index_name_qual(char **a)
|
||||
{ return(a[0][0] == 'V'); }
|
||||
|
||||
static unsigned long index_name_hash(const char **a)
|
||||
{ return(lh_strhash(a[DB_name])); }
|
||||
|
||||
int index_name_cmp(const char **a, const char **b)
|
||||
{ return(strcmp(a[DB_name],
|
||||
b[DB_name])); }
|
||||
|
||||
static IMPLEMENT_LHASH_HASH_FN(index_serial_hash,const char **)
|
||||
static IMPLEMENT_LHASH_COMP_FN(index_serial_cmp,const char **)
|
||||
static IMPLEMENT_LHASH_HASH_FN(index_name_hash,const char **)
|
||||
static IMPLEMENT_LHASH_COMP_FN(index_name_cmp,const char **)
|
||||
|
||||
#undef BSIZE
|
||||
#define BSIZE 256
|
||||
|
||||
BIGNUM *load_serial(char *serialfile, int create, ASN1_INTEGER **retai)
|
||||
{
|
||||
BIO *in=NULL;
|
||||
BIGNUM *ret=NULL;
|
||||
MS_STATIC char buf[1024];
|
||||
ASN1_INTEGER *ai=NULL;
|
||||
|
||||
ai=ASN1_INTEGER_new();
|
||||
if (ai == NULL) goto err;
|
||||
|
||||
if ((in=BIO_new(BIO_s_file())) == NULL)
|
||||
{
|
||||
ERR_print_errors(bio_err);
|
||||
goto err;
|
||||
}
|
||||
|
||||
if (BIO_read_filename(in,serialfile) <= 0)
|
||||
{
|
||||
if (!create)
|
||||
{
|
||||
perror(serialfile);
|
||||
goto err;
|
||||
}
|
||||
else
|
||||
{
|
||||
ret=BN_new();
|
||||
if (ret == NULL || !rand_serial(ret, ai))
|
||||
BIO_printf(bio_err, "Out of memory\n");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!a2i_ASN1_INTEGER(in,ai,buf,1024))
|
||||
{
|
||||
BIO_printf(bio_err,"unable to load number from %s\n",
|
||||
serialfile);
|
||||
goto err;
|
||||
}
|
||||
ret=ASN1_INTEGER_to_BN(ai,NULL);
|
||||
if (ret == NULL)
|
||||
{
|
||||
BIO_printf(bio_err,"error converting number from bin to BIGNUM\n");
|
||||
goto err;
|
||||
}
|
||||
}
|
||||
|
||||
if (ret && retai)
|
||||
{
|
||||
*retai = ai;
|
||||
ai = NULL;
|
||||
}
|
||||
err:
|
||||
if (in != NULL) BIO_free(in);
|
||||
if (ai != NULL) ASN1_INTEGER_free(ai);
|
||||
return(ret);
|
||||
}
|
||||
|
||||
int save_serial(char *serialfile, char *suffix, BIGNUM *serial, ASN1_INTEGER **retai)
|
||||
{
|
||||
char buf[1][BSIZE];
|
||||
BIO *out = NULL;
|
||||
int ret=0;
|
||||
ASN1_INTEGER *ai=NULL;
|
||||
int j;
|
||||
|
||||
if (suffix == NULL)
|
||||
j = strlen(serialfile);
|
||||
else
|
||||
j = strlen(serialfile) + strlen(suffix) + 1;
|
||||
if (j >= BSIZE)
|
||||
{
|
||||
BIO_printf(bio_err,"file name too long\n");
|
||||
goto err;
|
||||
}
|
||||
|
||||
if (suffix == NULL)
|
||||
BUF_strlcpy(buf[0], serialfile, BSIZE);
|
||||
else
|
||||
{
|
||||
#ifndef OPENSSL_SYS_VMS
|
||||
j = BIO_snprintf(buf[0], sizeof buf[0], "%s.%s", serialfile, suffix);
|
||||
#else
|
||||
j = BIO_snprintf(buf[0], sizeof buf[0], "%s-%s", serialfile, suffix);
|
||||
#endif
|
||||
}
|
||||
#ifdef RL_DEBUG
|
||||
BIO_printf(bio_err, "DEBUG: writing \"%s\"\n", buf[0]);
|
||||
#endif
|
||||
out=BIO_new(BIO_s_file());
|
||||
if (out == NULL)
|
||||
{
|
||||
ERR_print_errors(bio_err);
|
||||
goto err;
|
||||
}
|
||||
if (BIO_write_filename(out,buf[0]) <= 0)
|
||||
{
|
||||
perror(serialfile);
|
||||
goto err;
|
||||
}
|
||||
|
||||
if ((ai=BN_to_ASN1_INTEGER(serial,NULL)) == NULL)
|
||||
{
|
||||
BIO_printf(bio_err,"error converting serial to ASN.1 format\n");
|
||||
goto err;
|
||||
}
|
||||
i2a_ASN1_INTEGER(out,ai);
|
||||
BIO_puts(out,"\n");
|
||||
ret=1;
|
||||
if (retai)
|
||||
{
|
||||
*retai = ai;
|
||||
ai = NULL;
|
||||
}
|
||||
err:
|
||||
if (out != NULL) BIO_free_all(out);
|
||||
if (ai != NULL) ASN1_INTEGER_free(ai);
|
||||
return(ret);
|
||||
}
|
||||
|
||||
int rotate_serial(char *serialfile, char *new_suffix, char *old_suffix)
|
||||
{
|
||||
char buf[5][BSIZE];
|
||||
int i,j;
|
||||
struct stat sb;
|
||||
|
||||
i = strlen(serialfile) + strlen(old_suffix);
|
||||
j = strlen(serialfile) + strlen(new_suffix);
|
||||
if (i > j) j = i;
|
||||
if (j + 1 >= BSIZE)
|
||||
{
|
||||
BIO_printf(bio_err,"file name too long\n");
|
||||
goto err;
|
||||
}
|
||||
|
||||
#ifndef OPENSSL_SYS_VMS
|
||||
j = BIO_snprintf(buf[0], sizeof buf[0], "%s.%s",
|
||||
serialfile, new_suffix);
|
||||
#else
|
||||
j = BIO_snprintf(buf[0], sizeof buf[0], "%s-%s",
|
||||
serialfile, new_suffix);
|
||||
#endif
|
||||
#ifndef OPENSSL_SYS_VMS
|
||||
j = BIO_snprintf(buf[1], sizeof buf[1], "%s.%s",
|
||||
serialfile, old_suffix);
|
||||
#else
|
||||
j = BIO_snprintf(buf[1], sizeof buf[1], "%s-%s",
|
||||
serialfile, old_suffix);
|
||||
#endif
|
||||
if (stat(serialfile,&sb) < 0)
|
||||
{
|
||||
if (errno != ENOENT
|
||||
#ifdef ENOTDIR
|
||||
&& errno != ENOTDIR)
|
||||
#endif
|
||||
goto err;
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef RL_DEBUG
|
||||
BIO_printf(bio_err, "DEBUG: renaming \"%s\" to \"%s\"\n",
|
||||
serialfile, buf[1]);
|
||||
#endif
|
||||
if (rename(serialfile,buf[1]) < 0)
|
||||
{
|
||||
BIO_printf(bio_err,
|
||||
"unable to rename %s to %s\n",
|
||||
serialfile, buf[1]);
|
||||
perror("reason");
|
||||
goto err;
|
||||
}
|
||||
}
|
||||
#ifdef RL_DEBUG
|
||||
BIO_printf(bio_err, "DEBUG: renaming \"%s\" to \"%s\"\n",
|
||||
buf[0],serialfile);
|
||||
#endif
|
||||
if (rename(buf[0],serialfile) < 0)
|
||||
{
|
||||
BIO_printf(bio_err,
|
||||
"unable to rename %s to %s\n",
|
||||
buf[0],serialfile);
|
||||
perror("reason");
|
||||
rename(buf[1],serialfile);
|
||||
goto err;
|
||||
}
|
||||
return 1;
|
||||
err:
|
||||
return 0;
|
||||
}
|
||||
|
||||
int rand_serial(BIGNUM *b, ASN1_INTEGER *ai)
|
||||
{
|
||||
BIGNUM *btmp;
|
||||
int ret = 0;
|
||||
if (b)
|
||||
btmp = b;
|
||||
else
|
||||
btmp = BN_new();
|
||||
|
||||
if (!btmp)
|
||||
return 0;
|
||||
|
||||
if (!BN_pseudo_rand(btmp, SERIAL_RAND_BITS, 0, 0))
|
||||
goto error;
|
||||
if (ai && !BN_to_ASN1_INTEGER(btmp, ai))
|
||||
goto error;
|
||||
|
||||
ret = 1;
|
||||
|
||||
error:
|
||||
|
||||
if (!b)
|
||||
BN_free(btmp);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
CA_DB *load_index(char *dbfile, DB_ATTR *db_attr)
|
||||
{
|
||||
CA_DB *retdb = NULL;
|
||||
TXT_DB *tmpdb = NULL;
|
||||
BIO *in = BIO_new(BIO_s_file());
|
||||
CONF *dbattr_conf = NULL;
|
||||
char buf[1][BSIZE];
|
||||
long errorline= -1;
|
||||
|
||||
if (in == NULL)
|
||||
{
|
||||
ERR_print_errors(bio_err);
|
||||
goto err;
|
||||
}
|
||||
if (BIO_read_filename(in,dbfile) <= 0)
|
||||
{
|
||||
perror(dbfile);
|
||||
BIO_printf(bio_err,"unable to open '%s'\n",dbfile);
|
||||
goto err;
|
||||
}
|
||||
if ((tmpdb = TXT_DB_read(in,DB_NUMBER)) == NULL)
|
||||
{
|
||||
if (tmpdb != NULL) TXT_DB_free(tmpdb);
|
||||
goto err;
|
||||
}
|
||||
|
||||
#ifndef OPENSSL_SYS_VMS
|
||||
BIO_snprintf(buf[0], sizeof buf[0], "%s.attr", dbfile);
|
||||
#else
|
||||
BIO_snprintf(buf[0], sizeof buf[0], "%s-attr", dbfile);
|
||||
#endif
|
||||
dbattr_conf = NCONF_new(NULL);
|
||||
if (NCONF_load(dbattr_conf,buf[0],&errorline) <= 0)
|
||||
{
|
||||
if (errorline > 0)
|
||||
{
|
||||
BIO_printf(bio_err,
|
||||
"error on line %ld of db attribute file '%s'\n"
|
||||
,errorline,buf[0]);
|
||||
goto err;
|
||||
}
|
||||
else
|
||||
{
|
||||
NCONF_free(dbattr_conf);
|
||||
dbattr_conf = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
if ((retdb = OPENSSL_malloc(sizeof(CA_DB))) == NULL)
|
||||
{
|
||||
fprintf(stderr, "Out of memory\n");
|
||||
goto err;
|
||||
}
|
||||
|
||||
retdb->db = tmpdb;
|
||||
tmpdb = NULL;
|
||||
if (db_attr)
|
||||
retdb->attributes = *db_attr;
|
||||
else
|
||||
{
|
||||
retdb->attributes.unique_subject = 1;
|
||||
}
|
||||
|
||||
if (dbattr_conf)
|
||||
{
|
||||
char *p = NCONF_get_string(dbattr_conf,NULL,"unique_subject");
|
||||
if (p)
|
||||
{
|
||||
BIO_printf(bio_err, "DEBUG[load_index]: unique_subject = \"%s\"\n", p);
|
||||
switch(*p)
|
||||
{
|
||||
case 'f': /* false */
|
||||
case 'F': /* FALSE */
|
||||
case 'n': /* no */
|
||||
case 'N': /* NO */
|
||||
retdb->attributes.unique_subject = 0;
|
||||
break;
|
||||
case 't': /* true */
|
||||
case 'T': /* TRUE */
|
||||
case 'y': /* yes */
|
||||
case 'Y': /* YES */
|
||||
default:
|
||||
retdb->attributes.unique_subject = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
err:
|
||||
if (dbattr_conf) NCONF_free(dbattr_conf);
|
||||
if (tmpdb) TXT_DB_free(tmpdb);
|
||||
if (in) BIO_free_all(in);
|
||||
return retdb;
|
||||
}
|
||||
|
||||
int index_index(CA_DB *db)
|
||||
{
|
||||
if (!TXT_DB_create_index(db->db, DB_serial, NULL,
|
||||
LHASH_HASH_FN(index_serial_hash),
|
||||
LHASH_COMP_FN(index_serial_cmp)))
|
||||
{
|
||||
BIO_printf(bio_err,
|
||||
"error creating serial number index:(%ld,%ld,%ld)\n",
|
||||
db->db->error,db->db->arg1,db->db->arg2);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (db->attributes.unique_subject
|
||||
&& !TXT_DB_create_index(db->db, DB_name, index_name_qual,
|
||||
LHASH_HASH_FN(index_name_hash),
|
||||
LHASH_COMP_FN(index_name_cmp)))
|
||||
{
|
||||
BIO_printf(bio_err,"error creating name index:(%ld,%ld,%ld)\n",
|
||||
db->db->error,db->db->arg1,db->db->arg2);
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
int save_index(char *dbfile, char *suffix, CA_DB *db)
|
||||
{
|
||||
char buf[3][BSIZE];
|
||||
BIO *out = BIO_new(BIO_s_file());
|
||||
int j;
|
||||
|
||||
if (out == NULL)
|
||||
{
|
||||
ERR_print_errors(bio_err);
|
||||
goto err;
|
||||
}
|
||||
|
||||
j = strlen(dbfile) + strlen(suffix);
|
||||
if (j + 6 >= BSIZE)
|
||||
{
|
||||
BIO_printf(bio_err,"file name too long\n");
|
||||
goto err;
|
||||
}
|
||||
|
||||
#ifndef OPENSSL_SYS_VMS
|
||||
j = BIO_snprintf(buf[2], sizeof buf[2], "%s.attr", dbfile);
|
||||
#else
|
||||
j = BIO_snprintf(buf[2], sizeof buf[2], "%s-attr", dbfile);
|
||||
#endif
|
||||
#ifndef OPENSSL_SYS_VMS
|
||||
j = BIO_snprintf(buf[1], sizeof buf[1], "%s.attr.%s", dbfile, suffix);
|
||||
#else
|
||||
j = BIO_snprintf(buf[1], sizeof buf[1], "%s-attr-%s", dbfile, suffix);
|
||||
#endif
|
||||
#ifndef OPENSSL_SYS_VMS
|
||||
j = BIO_snprintf(buf[0], sizeof buf[0], "%s.%s", dbfile, suffix);
|
||||
#else
|
||||
j = BIO_snprintf(buf[0], sizeof buf[0], "%s-%s", dbfile, suffix);
|
||||
#endif
|
||||
#ifdef RL_DEBUG
|
||||
BIO_printf(bio_err, "DEBUG: writing \"%s\"\n", buf[0]);
|
||||
#endif
|
||||
if (BIO_write_filename(out,buf[0]) <= 0)
|
||||
{
|
||||
perror(dbfile);
|
||||
BIO_printf(bio_err,"unable to open '%s'\n", dbfile);
|
||||
goto err;
|
||||
}
|
||||
j=TXT_DB_write(out,db->db);
|
||||
if (j <= 0) goto err;
|
||||
|
||||
BIO_free(out);
|
||||
|
||||
out = BIO_new(BIO_s_file());
|
||||
#ifdef RL_DEBUG
|
||||
BIO_printf(bio_err, "DEBUG: writing \"%s\"\n", buf[1]);
|
||||
#endif
|
||||
if (BIO_write_filename(out,buf[1]) <= 0)
|
||||
{
|
||||
perror(buf[2]);
|
||||
BIO_printf(bio_err,"unable to open '%s'\n", buf[2]);
|
||||
goto err;
|
||||
}
|
||||
BIO_printf(out,"unique_subject = %s\n",
|
||||
db->attributes.unique_subject ? "yes" : "no");
|
||||
BIO_free(out);
|
||||
|
||||
return 1;
|
||||
err:
|
||||
return 0;
|
||||
}
|
||||
|
||||
int rotate_index(char *dbfile, char *new_suffix, char *old_suffix)
|
||||
{
|
||||
char buf[5][BSIZE];
|
||||
int i,j;
|
||||
struct stat sb;
|
||||
|
||||
i = strlen(dbfile) + strlen(old_suffix);
|
||||
j = strlen(dbfile) + strlen(new_suffix);
|
||||
if (i > j) j = i;
|
||||
if (j + 6 >= BSIZE)
|
||||
{
|
||||
BIO_printf(bio_err,"file name too long\n");
|
||||
goto err;
|
||||
}
|
||||
|
||||
#ifndef OPENSSL_SYS_VMS
|
||||
j = BIO_snprintf(buf[4], sizeof buf[4], "%s.attr", dbfile);
|
||||
#else
|
||||
j = BIO_snprintf(buf[4], sizeof buf[4], "%s-attr", dbfile);
|
||||
#endif
|
||||
#ifndef OPENSSL_SYS_VMS
|
||||
j = BIO_snprintf(buf[2], sizeof buf[2], "%s.attr.%s",
|
||||
dbfile, new_suffix);
|
||||
#else
|
||||
j = BIO_snprintf(buf[2], sizeof buf[2], "%s-attr-%s",
|
||||
dbfile, new_suffix);
|
||||
#endif
|
||||
#ifndef OPENSSL_SYS_VMS
|
||||
j = BIO_snprintf(buf[0], sizeof buf[0], "%s.%s",
|
||||
dbfile, new_suffix);
|
||||
#else
|
||||
j = BIO_snprintf(buf[0], sizeof buf[0], "%s-%s",
|
||||
dbfile, new_suffix);
|
||||
#endif
|
||||
#ifndef OPENSSL_SYS_VMS
|
||||
j = BIO_snprintf(buf[1], sizeof buf[1], "%s.%s",
|
||||
dbfile, old_suffix);
|
||||
#else
|
||||
j = BIO_snprintf(buf[1], sizeof buf[1], "%s-%s",
|
||||
dbfile, old_suffix);
|
||||
#endif
|
||||
#ifndef OPENSSL_SYS_VMS
|
||||
j = BIO_snprintf(buf[3], sizeof buf[3], "%s.attr.%s",
|
||||
dbfile, old_suffix);
|
||||
#else
|
||||
j = BIO_snprintf(buf[3], sizeof buf[3], "%s-attr-%s",
|
||||
dbfile, old_suffix);
|
||||
#endif
|
||||
if (stat(dbfile,&sb) < 0)
|
||||
{
|
||||
if (errno != ENOENT
|
||||
#ifdef ENOTDIR
|
||||
&& errno != ENOTDIR)
|
||||
#endif
|
||||
goto err;
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef RL_DEBUG
|
||||
BIO_printf(bio_err, "DEBUG: renaming \"%s\" to \"%s\"\n",
|
||||
dbfile, buf[1]);
|
||||
#endif
|
||||
if (rename(dbfile,buf[1]) < 0)
|
||||
{
|
||||
BIO_printf(bio_err,
|
||||
"unable to rename %s to %s\n",
|
||||
dbfile, buf[1]);
|
||||
perror("reason");
|
||||
goto err;
|
||||
}
|
||||
}
|
||||
#ifdef RL_DEBUG
|
||||
BIO_printf(bio_err, "DEBUG: renaming \"%s\" to \"%s\"\n",
|
||||
buf[0],dbfile);
|
||||
#endif
|
||||
if (rename(buf[0],dbfile) < 0)
|
||||
{
|
||||
BIO_printf(bio_err,
|
||||
"unable to rename %s to %s\n",
|
||||
buf[0],dbfile);
|
||||
perror("reason");
|
||||
rename(buf[1],dbfile);
|
||||
goto err;
|
||||
}
|
||||
if (stat(buf[4],&sb) < 0)
|
||||
{
|
||||
if (errno != ENOENT
|
||||
#ifdef ENOTDIR
|
||||
&& errno != ENOTDIR)
|
||||
#endif
|
||||
goto err;
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef RL_DEBUG
|
||||
BIO_printf(bio_err, "DEBUG: renaming \"%s\" to \"%s\"\n",
|
||||
buf[4],buf[3]);
|
||||
#endif
|
||||
if (rename(buf[4],buf[3]) < 0)
|
||||
{
|
||||
BIO_printf(bio_err,
|
||||
"unable to rename %s to %s\n",
|
||||
buf[4], buf[3]);
|
||||
perror("reason");
|
||||
rename(dbfile,buf[0]);
|
||||
rename(buf[1],dbfile);
|
||||
goto err;
|
||||
}
|
||||
}
|
||||
#ifdef RL_DEBUG
|
||||
BIO_printf(bio_err, "DEBUG: renaming \"%s\" to \"%s\"\n",
|
||||
buf[2],buf[4]);
|
||||
#endif
|
||||
if (rename(buf[2],buf[4]) < 0)
|
||||
{
|
||||
BIO_printf(bio_err,
|
||||
"unable to rename %s to %s\n",
|
||||
buf[2],buf[4]);
|
||||
perror("reason");
|
||||
rename(buf[3],buf[4]);
|
||||
rename(dbfile,buf[0]);
|
||||
rename(buf[1],dbfile);
|
||||
goto err;
|
||||
}
|
||||
return 1;
|
||||
err:
|
||||
return 0;
|
||||
}
|
||||
|
||||
void free_index(CA_DB *db)
|
||||
{
|
||||
if (db)
|
||||
{
|
||||
if (db->db) TXT_DB_free(db->db);
|
||||
OPENSSL_free(db);
|
||||
}
|
||||
}
|
||||
|
||||
/* This code MUST COME AFTER anything that uses rename() */
|
||||
#ifdef OPENSSL_SYS_WIN32
|
||||
int WIN32_rename(char *from, char *to)
|
||||
{
|
||||
#ifndef OPENSSL_SYS_WINCE
|
||||
/* Windows rename gives an error if 'to' exists, so delete it
|
||||
* first and ignore file not found errror
|
||||
*/
|
||||
if((remove(to) != 0) && (errno != ENOENT))
|
||||
return -1;
|
||||
#undef rename
|
||||
return rename(from, to);
|
||||
#else
|
||||
/* convert strings to UNICODE */
|
||||
{
|
||||
BOOL result = FALSE;
|
||||
WCHAR* wfrom;
|
||||
WCHAR* wto;
|
||||
int i;
|
||||
wfrom = malloc((strlen(from)+1)*2);
|
||||
wto = malloc((strlen(to)+1)*2);
|
||||
if (wfrom != NULL && wto != NULL)
|
||||
{
|
||||
for (i=0; i<(int)strlen(from)+1; i++)
|
||||
wfrom[i] = (short)from[i];
|
||||
for (i=0; i<(int)strlen(to)+1; i++)
|
||||
wto[i] = (short)to[i];
|
||||
result = MoveFile(wfrom, wto);
|
||||
}
|
||||
if (wfrom != NULL)
|
||||
free(wfrom);
|
||||
if (wto != NULL)
|
||||
free(wto);
|
||||
return result;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
36
apps/apps.h
36
apps/apps.h
@@ -281,7 +281,39 @@ char *make_config_name(void);
|
||||
/* Functions defined in ca.c and also used in ocsp.c */
|
||||
int unpack_revinfo(ASN1_TIME **prevtm, int *preason, ASN1_OBJECT **phold,
|
||||
ASN1_GENERALIZEDTIME **pinvtm, char *str);
|
||||
int make_serial_index(TXT_DB *db);
|
||||
|
||||
#define DB_type 0
|
||||
#define DB_exp_date 1
|
||||
#define DB_rev_date 2
|
||||
#define DB_serial 3 /* index - unique */
|
||||
#define DB_file 4
|
||||
#define DB_name 5 /* index - unique when active and not disabled */
|
||||
#define DB_NUMBER 6
|
||||
|
||||
#define DB_TYPE_REV 'R'
|
||||
#define DB_TYPE_EXP 'E'
|
||||
#define DB_TYPE_VAL 'V'
|
||||
|
||||
typedef struct db_attr_st
|
||||
{
|
||||
int unique_subject;
|
||||
} DB_ATTR;
|
||||
typedef struct ca_db_st
|
||||
{
|
||||
DB_ATTR attributes;
|
||||
TXT_DB *db;
|
||||
} CA_DB;
|
||||
|
||||
BIGNUM *load_serial(char *serialfile, int create, ASN1_INTEGER **retai);
|
||||
int save_serial(char *serialfile, char *suffix, BIGNUM *serial, ASN1_INTEGER **retai);
|
||||
int rotate_serial(char *serialfile, char *new_suffix, char *old_suffix);
|
||||
int rand_serial(BIGNUM *b, ASN1_INTEGER *ai);
|
||||
CA_DB *load_index(char *dbfile, DB_ATTR *dbattr);
|
||||
int index_index(CA_DB *db);
|
||||
int save_index(char *dbfile, char *suffix, CA_DB *db);
|
||||
int rotate_index(char *dbfile, char *new_suffix, char *old_suffix);
|
||||
void free_index(CA_DB *db);
|
||||
int index_name_cmp(const char **a, const char **b);
|
||||
|
||||
X509_NAME *do_subject(char *str, long chtype);
|
||||
|
||||
@@ -304,4 +336,6 @@ X509_NAME *do_subject(char *str, long chtype);
|
||||
|
||||
#define APP_PASS_LEN 1024
|
||||
|
||||
#define SERIAL_RAND_BITS 64
|
||||
|
||||
#endif
|
||||
|
||||
@@ -304,7 +304,15 @@ bad:
|
||||
num=tmplen;
|
||||
}
|
||||
|
||||
if (length == 0) length=(unsigned int)num;
|
||||
if (offset >= num)
|
||||
{
|
||||
BIO_printf(bio_err, "Error: offset too large\n");
|
||||
goto end;
|
||||
}
|
||||
|
||||
num -= offset;
|
||||
|
||||
if ((length == 0) || ((long)length > num)) length=(unsigned int)num;
|
||||
if(derout) {
|
||||
if(BIO_write(derout, str + offset, length) != (int)length) {
|
||||
BIO_printf(bio_err, "Error writing output\n");
|
||||
|
||||
552
apps/ca.c
552
apps/ca.c
@@ -112,6 +112,7 @@
|
||||
#define ENV_NEW_CERTS_DIR "new_certs_dir"
|
||||
#define ENV_CERTIFICATE "certificate"
|
||||
#define ENV_SERIAL "serial"
|
||||
#define ENV_CRLNUMBER "crlnumber"
|
||||
#define ENV_CRL "crl"
|
||||
#define ENV_PRIVATE_KEY "private_key"
|
||||
#define ENV_RANDFILE "RANDFILE"
|
||||
@@ -133,18 +134,6 @@
|
||||
|
||||
#define ENV_DATABASE "database"
|
||||
|
||||
#define DB_type 0
|
||||
#define DB_exp_date 1
|
||||
#define DB_rev_date 2
|
||||
#define DB_serial 3 /* index - unique */
|
||||
#define DB_file 4
|
||||
#define DB_name 5 /* index - unique for active */
|
||||
#define DB_NUMBER 6
|
||||
|
||||
#define DB_TYPE_REV 'R'
|
||||
#define DB_TYPE_EXP 'E'
|
||||
#define DB_TYPE_VAL 'V'
|
||||
|
||||
/* Additional revocation information types */
|
||||
|
||||
#define REV_NONE 0 /* No addditional information */
|
||||
@@ -201,43 +190,36 @@ extern int EF_ALIGNMENT;
|
||||
#endif
|
||||
|
||||
static void lookup_fail(char *name,char *tag);
|
||||
static unsigned long index_serial_hash(const char **a);
|
||||
static int index_serial_cmp(const char **a, const char **b);
|
||||
static unsigned long index_name_hash(const char **a);
|
||||
static int index_name_qual(char **a);
|
||||
static int index_name_cmp(const char **a,const char **b);
|
||||
static BIGNUM *load_serial(char *serialfile);
|
||||
static int save_serial(char *serialfile, BIGNUM *serial);
|
||||
static int certify(X509 **xret, char *infile,EVP_PKEY *pkey,X509 *x509,
|
||||
const EVP_MD *dgst,STACK_OF(CONF_VALUE) *policy,TXT_DB *db,
|
||||
const EVP_MD *dgst,STACK_OF(CONF_VALUE) *policy,CA_DB *db,
|
||||
BIGNUM *serial, char *subj, int email_dn, char *startdate,
|
||||
char *enddate, long days, int batch, char *ext_sect, CONF *conf,
|
||||
int verbose, unsigned long certopt, unsigned long nameopt,
|
||||
int default_op, int ext_copy);
|
||||
static int certify_cert(X509 **xret, char *infile,EVP_PKEY *pkey,X509 *x509,
|
||||
const EVP_MD *dgst,STACK_OF(CONF_VALUE) *policy,
|
||||
TXT_DB *db, BIGNUM *serial, char *subj, int email_dn,
|
||||
CA_DB *db, BIGNUM *serial, char *subj, int email_dn,
|
||||
char *startdate, char *enddate, long days, int batch,
|
||||
char *ext_sect, CONF *conf,int verbose, unsigned long certopt,
|
||||
unsigned long nameopt, int default_op, int ext_copy,
|
||||
ENGINE *e);
|
||||
static int certify_spkac(X509 **xret, char *infile,EVP_PKEY *pkey,X509 *x509,
|
||||
const EVP_MD *dgst,STACK_OF(CONF_VALUE) *policy,
|
||||
TXT_DB *db, BIGNUM *serial,char *subj, int email_dn,
|
||||
CA_DB *db, BIGNUM *serial,char *subj, int email_dn,
|
||||
char *startdate, char *enddate, long days, char *ext_sect,
|
||||
CONF *conf, int verbose, unsigned long certopt,
|
||||
unsigned long nameopt, int default_op, int ext_copy);
|
||||
static int fix_data(int nid, int *type);
|
||||
static void write_new_certificate(BIO *bp, X509 *x, int output_der, int notext);
|
||||
static int do_body(X509 **xret, EVP_PKEY *pkey, X509 *x509, const EVP_MD *dgst,
|
||||
STACK_OF(CONF_VALUE) *policy, TXT_DB *db, BIGNUM *serial,char *subj,
|
||||
STACK_OF(CONF_VALUE) *policy, CA_DB *db, BIGNUM *serial,char *subj,
|
||||
int email_dn, char *startdate, char *enddate, long days, int batch,
|
||||
int verbose, X509_REQ *req, char *ext_sect, CONF *conf,
|
||||
unsigned long certopt, unsigned long nameopt, int default_op,
|
||||
int ext_copy);
|
||||
static int do_revoke(X509 *x509, TXT_DB *db, int ext, char *extval);
|
||||
static int get_certificate_status(const char *ser_status, TXT_DB *db);
|
||||
static int do_updatedb(TXT_DB *db);
|
||||
static int do_revoke(X509 *x509, CA_DB *db, int ext, char *extval);
|
||||
static int get_certificate_status(const char *ser_status, CA_DB *db);
|
||||
static int do_updatedb(CA_DB *db);
|
||||
static int check_time_format(char *str);
|
||||
char *make_revocation_str(int rev_type, char *rev_arg);
|
||||
int make_revoked(X509_REVOKED *rev, char *str);
|
||||
@@ -249,11 +231,6 @@ static char *section=NULL;
|
||||
static int preserve=0;
|
||||
static int msie_hack=0;
|
||||
|
||||
static IMPLEMENT_LHASH_HASH_FN(index_serial_hash,const char **)
|
||||
static IMPLEMENT_LHASH_COMP_FN(index_serial_cmp,const char **)
|
||||
static IMPLEMENT_LHASH_HASH_FN(index_name_hash,const char **)
|
||||
static IMPLEMENT_LHASH_COMP_FN(index_name_cmp,const char **)
|
||||
|
||||
|
||||
int MAIN(int, char **);
|
||||
|
||||
@@ -261,6 +238,7 @@ int MAIN(int argc, char **argv)
|
||||
{
|
||||
ENGINE *e = NULL;
|
||||
char *key=NULL,*passargin=NULL;
|
||||
int create_ser = 0;
|
||||
int free_key = 0;
|
||||
int total=0;
|
||||
int total_done=0;
|
||||
@@ -290,6 +268,7 @@ int MAIN(int argc, char **argv)
|
||||
char *outfile=NULL;
|
||||
char *outdir=NULL;
|
||||
char *serialfile=NULL;
|
||||
char *crlnumberfile=NULL;
|
||||
char *extensions=NULL;
|
||||
char *extfile=NULL;
|
||||
char *subj=NULL;
|
||||
@@ -298,6 +277,7 @@ int MAIN(int argc, char **argv)
|
||||
int rev_type = REV_NONE;
|
||||
char *rev_arg = NULL;
|
||||
BIGNUM *serial=NULL;
|
||||
BIGNUM *crlnumber=NULL;
|
||||
char *startdate=NULL;
|
||||
char *enddate=NULL;
|
||||
long days=0;
|
||||
@@ -310,14 +290,13 @@ int MAIN(int argc, char **argv)
|
||||
X509 *x=NULL;
|
||||
BIO *in=NULL,*out=NULL,*Sout=NULL,*Cout=NULL;
|
||||
char *dbfile=NULL;
|
||||
TXT_DB *db=NULL;
|
||||
CA_DB *db=NULL;
|
||||
X509_CRL *crl=NULL;
|
||||
X509_REVOKED *r=NULL;
|
||||
ASN1_TIME *tmptm;
|
||||
ASN1_INTEGER *tmpser;
|
||||
char **pp,*p,*f;
|
||||
int i,j;
|
||||
long l;
|
||||
const EVP_MD *dgst=NULL;
|
||||
STACK_OF(CONF_VALUE) *attribs=NULL;
|
||||
STACK_OF(X509) *cert_sk=NULL;
|
||||
@@ -329,6 +308,7 @@ int MAIN(int argc, char **argv)
|
||||
char *engine = NULL;
|
||||
#endif
|
||||
char *tofree=NULL;
|
||||
DB_ATTR db_attr;
|
||||
|
||||
#ifdef EFENCE
|
||||
EF_PROTECT_FREE=1;
|
||||
@@ -569,16 +549,19 @@ bad:
|
||||
if (configfile == NULL)
|
||||
{
|
||||
const char *s=X509_get_default_cert_area();
|
||||
size_t len;
|
||||
|
||||
#ifdef OPENSSL_SYS_VMS
|
||||
tofree=OPENSSL_malloc(strlen(s)+sizeof(CONFIG_FILE));
|
||||
len = strlen(s)+sizeof(CONFIG_FILE);
|
||||
tofree=OPENSSL_malloc(len);
|
||||
strcpy(tofree,s);
|
||||
#else
|
||||
tofree=OPENSSL_malloc(strlen(s)+sizeof(CONFIG_FILE)+1);
|
||||
strcpy(tofree,s);
|
||||
strcat(tofree,"/");
|
||||
len = strlen(s)+sizeof(CONFIG_FILE)+1;
|
||||
tofree=OPENSSL_malloc(len);
|
||||
BUF_strlcpy(tofree,s,len);
|
||||
BUF_strlcat(tofree,"/",len);
|
||||
#endif
|
||||
strcat(tofree,CONFIG_FILE);
|
||||
BUF_strlcat(tofree,CONFIG_FILE,len);
|
||||
configfile=tofree;
|
||||
}
|
||||
|
||||
@@ -649,6 +632,41 @@ bad:
|
||||
if (randfile == NULL)
|
||||
ERR_clear_error();
|
||||
app_RAND_load_file(randfile, bio_err, 0);
|
||||
|
||||
db_attr.unique_subject = 1;
|
||||
p = NCONF_get_string(conf, section, "unique_subject");
|
||||
if (p)
|
||||
{
|
||||
#ifdef RL_DEBUG
|
||||
BIO_printf(bio_err, "DEBUG: unique_subject = \"%s\"\n", p);
|
||||
#endif
|
||||
switch(*p)
|
||||
{
|
||||
case 'f': /* false */
|
||||
case 'F': /* FALSE */
|
||||
case 'n': /* no */
|
||||
case 'N': /* NO */
|
||||
db_attr.unique_subject = 0;
|
||||
break;
|
||||
case 't': /* true */
|
||||
case 'T': /* TRUE */
|
||||
case 'y': /* yes */
|
||||
case 'Y': /* YES */
|
||||
default:
|
||||
db_attr.unique_subject = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
ERR_clear_error();
|
||||
#ifdef RL_DEBUG
|
||||
if (!p)
|
||||
BIO_printf(bio_err, "DEBUG: unique_subject undefined\n", p);
|
||||
#endif
|
||||
#ifdef RL_DEBUG
|
||||
BIO_printf(bio_err, "DEBUG: configured unique_subject is %d\n",
|
||||
db_attr.unique_subject);
|
||||
#endif
|
||||
|
||||
in=BIO_new(BIO_s_file());
|
||||
out=BIO_new(BIO_s_file());
|
||||
@@ -669,17 +687,10 @@ bad:
|
||||
lookup_fail(section,ENV_DATABASE);
|
||||
goto err;
|
||||
}
|
||||
if (BIO_read_filename(in,dbfile) <= 0)
|
||||
{
|
||||
perror(dbfile);
|
||||
BIO_printf(bio_err,"unable to open '%s'\n",dbfile);
|
||||
goto err;
|
||||
}
|
||||
db=TXT_DB_read(in,DB_NUMBER);
|
||||
db = load_index(dbfile,&db_attr);
|
||||
if (db == NULL) goto err;
|
||||
|
||||
if (!make_serial_index(db))
|
||||
goto err;
|
||||
if (!index_index(db)) goto err;
|
||||
|
||||
if (get_certificate_status(ser_status,db) != 1)
|
||||
BIO_printf(bio_err,"Error verifying serial %s!\n",
|
||||
@@ -839,19 +850,13 @@ bad:
|
||||
lookup_fail(section,ENV_DATABASE);
|
||||
goto err;
|
||||
}
|
||||
if (BIO_read_filename(in,dbfile) <= 0)
|
||||
{
|
||||
perror(dbfile);
|
||||
BIO_printf(bio_err,"unable to open '%s'\n",dbfile);
|
||||
goto err;
|
||||
}
|
||||
db=TXT_DB_read(in,DB_NUMBER);
|
||||
db = load_index(dbfile, &db_attr);
|
||||
if (db == NULL) goto err;
|
||||
|
||||
/* Lets check some fields */
|
||||
for (i=0; i<sk_num(db->data); i++)
|
||||
for (i=0; i<sk_num(db->db->data); i++)
|
||||
{
|
||||
pp=(char **)sk_value(db->data,i);
|
||||
pp=(char **)sk_value(db->db->data,i);
|
||||
if ((pp[DB_type][0] != DB_TYPE_REV) &&
|
||||
(pp[DB_rev_date][0] != '\0'))
|
||||
{
|
||||
@@ -902,23 +907,13 @@ bad:
|
||||
out = BIO_push(tmpbio, out);
|
||||
}
|
||||
#endif
|
||||
TXT_DB_write(out,db);
|
||||
TXT_DB_write(out,db->db);
|
||||
BIO_printf(bio_err,"%d entries loaded from the database\n",
|
||||
db->data->num);
|
||||
db->db->data->num);
|
||||
BIO_printf(bio_err,"generating index\n");
|
||||
}
|
||||
|
||||
if (!make_serial_index(db))
|
||||
goto err;
|
||||
|
||||
if (!TXT_DB_create_index(db, DB_name, index_name_qual,
|
||||
LHASH_HASH_FN(index_name_hash),
|
||||
LHASH_COMP_FN(index_name_cmp)))
|
||||
{
|
||||
BIO_printf(bio_err,"error creating name index:(%ld,%ld,%ld)\n",
|
||||
db->error,db->arg1,db->arg2);
|
||||
goto err;
|
||||
}
|
||||
if (!index_index(db)) goto err;
|
||||
|
||||
/*****************************************************************/
|
||||
/* Update the db file for expired certificates */
|
||||
@@ -941,62 +936,9 @@ bad:
|
||||
}
|
||||
else
|
||||
{
|
||||
out = BIO_new(BIO_s_file());
|
||||
if (out == NULL)
|
||||
{
|
||||
ERR_print_errors(bio_err);
|
||||
goto err;
|
||||
}
|
||||
|
||||
#ifndef OPENSSL_SYS_VMS
|
||||
j = BIO_snprintf(buf[0], sizeof buf[0], "%s.new", dbfile);
|
||||
#else
|
||||
j = BIO_snprintf(buf[0], sizeof buf[0], "%s-new", dbfile);
|
||||
#endif
|
||||
if (j < 0 || j >= sizeof buf[0])
|
||||
{
|
||||
BIO_printf(bio_err, "file name too long\n");
|
||||
goto err;
|
||||
}
|
||||
if (BIO_write_filename(out,buf[0]) <= 0)
|
||||
{
|
||||
perror(dbfile);
|
||||
BIO_printf(bio_err,"unable to open '%s'\n",
|
||||
dbfile);
|
||||
goto err;
|
||||
}
|
||||
j=TXT_DB_write(out,db);
|
||||
if (j <= 0) goto err;
|
||||
|
||||
BIO_free(out);
|
||||
out = NULL;
|
||||
#ifndef OPENSSL_SYS_VMS
|
||||
j = BIO_snprintf(buf[1], sizeof buf[1], "%s.old", dbfile);
|
||||
#else
|
||||
j = BIO_snprintf(buf[1], sizeof buf[1], "%s-old", dbfile);
|
||||
#endif
|
||||
if (j < 0 || j >= sizeof buf[1])
|
||||
{
|
||||
BIO_printf(bio_err, "file name too long\n");
|
||||
goto err;
|
||||
}
|
||||
if (rename(dbfile,buf[1]) < 0)
|
||||
{
|
||||
BIO_printf(bio_err,
|
||||
"unable to rename %s to %s\n",
|
||||
dbfile, buf[1]);
|
||||
perror("reason");
|
||||
goto err;
|
||||
}
|
||||
if (rename(buf[0],dbfile) < 0)
|
||||
{
|
||||
BIO_printf(bio_err,
|
||||
"unable to rename %s to %s\n",
|
||||
buf[0],dbfile);
|
||||
perror("reason");
|
||||
rename(buf[1],dbfile);
|
||||
goto err;
|
||||
}
|
||||
if (!save_index(dbfile,"new",db)) goto err;
|
||||
|
||||
if (!rotate_index(dbfile,"new","old")) goto err;
|
||||
|
||||
if (verbose) BIO_printf(bio_err,
|
||||
"Done. %d entries marked as expired\n",i);
|
||||
@@ -1157,7 +1099,7 @@ bad:
|
||||
goto err;
|
||||
}
|
||||
|
||||
if ((serial=load_serial(serialfile)) == NULL)
|
||||
if ((serial=load_serial(serialfile, create_ser, NULL)) == NULL)
|
||||
{
|
||||
BIO_printf(bio_err,"error while loading serial number\n");
|
||||
goto err;
|
||||
@@ -1291,38 +1233,9 @@ bad:
|
||||
|
||||
BIO_printf(bio_err,"Write out database with %d new entries\n",sk_X509_num(cert_sk));
|
||||
|
||||
if(strlen(serialfile) > BSIZE-5 || strlen(dbfile) > BSIZE-5)
|
||||
{
|
||||
BIO_printf(bio_err,"file name too long\n");
|
||||
goto err;
|
||||
}
|
||||
if (!save_serial(serialfile,"new",serial,NULL)) goto err;
|
||||
|
||||
strcpy(buf[0],serialfile);
|
||||
|
||||
#ifdef OPENSSL_SYS_VMS
|
||||
strcat(buf[0],"-new");
|
||||
#else
|
||||
strcat(buf[0],".new");
|
||||
#endif
|
||||
|
||||
if (!save_serial(buf[0],serial)) goto err;
|
||||
|
||||
strcpy(buf[1],dbfile);
|
||||
|
||||
#ifdef OPENSSL_SYS_VMS
|
||||
strcat(buf[1],"-new");
|
||||
#else
|
||||
strcat(buf[1],".new");
|
||||
#endif
|
||||
|
||||
if (BIO_write_filename(out,buf[1]) <= 0)
|
||||
{
|
||||
perror(dbfile);
|
||||
BIO_printf(bio_err,"unable to open '%s'\n",dbfile);
|
||||
goto err;
|
||||
}
|
||||
l=TXT_DB_write(out,db);
|
||||
if (l <= 0) goto err;
|
||||
if (!save_index(dbfile, "new", db)) goto err;
|
||||
}
|
||||
|
||||
if (verbose)
|
||||
@@ -1330,7 +1243,7 @@ bad:
|
||||
for (i=0; i<sk_X509_num(cert_sk); i++)
|
||||
{
|
||||
int k;
|
||||
unsigned char *n;
|
||||
char *n;
|
||||
|
||||
x=sk_X509_value(cert_sk,i);
|
||||
|
||||
@@ -1346,15 +1259,19 @@ bad:
|
||||
strcpy(buf[2],outdir);
|
||||
|
||||
#ifndef OPENSSL_SYS_VMS
|
||||
strcat(buf[2],"/");
|
||||
BUF_strlcat(buf[2],"/",sizeof(buf[2]));
|
||||
#endif
|
||||
|
||||
n=(unsigned char *)&(buf[2][strlen(buf[2])]);
|
||||
n=(char *)&(buf[2][strlen(buf[2])]);
|
||||
if (j > 0)
|
||||
{
|
||||
for (k=0; k<j; k++)
|
||||
{
|
||||
sprintf((char *)n,"%02X",(unsigned char)*(p++));
|
||||
if (n >= &(buf[2][sizeof(buf[2])]))
|
||||
break;
|
||||
BIO_snprintf(n,
|
||||
&buf[2][0] + sizeof(buf[2]) - n,
|
||||
"%02X",(unsigned char)*(p++));
|
||||
n+=2;
|
||||
}
|
||||
}
|
||||
@@ -1380,59 +1297,10 @@ bad:
|
||||
if (sk_X509_num(cert_sk))
|
||||
{
|
||||
/* Rename the database and the serial file */
|
||||
strncpy(buf[2],serialfile,BSIZE-4);
|
||||
buf[2][BSIZE-4]='\0';
|
||||
if (!rotate_serial(serialfile,"new","old")) goto err;
|
||||
|
||||
#ifdef OPENSSL_SYS_VMS
|
||||
strcat(buf[2],"-old");
|
||||
#else
|
||||
strcat(buf[2],".old");
|
||||
#endif
|
||||
if (!rotate_index(dbfile,"new","old")) goto err;
|
||||
|
||||
BIO_free(in);
|
||||
BIO_free_all(out);
|
||||
in=NULL;
|
||||
out=NULL;
|
||||
if (rename(serialfile,buf[2]) < 0)
|
||||
{
|
||||
BIO_printf(bio_err,"unable to rename %s to %s\n",
|
||||
serialfile,buf[2]);
|
||||
perror("reason");
|
||||
goto err;
|
||||
}
|
||||
if (rename(buf[0],serialfile) < 0)
|
||||
{
|
||||
BIO_printf(bio_err,"unable to rename %s to %s\n",
|
||||
buf[0],serialfile);
|
||||
perror("reason");
|
||||
rename(buf[2],serialfile);
|
||||
goto err;
|
||||
}
|
||||
|
||||
strncpy(buf[2],dbfile,BSIZE-4);
|
||||
buf[2][BSIZE-4]='\0';
|
||||
|
||||
#ifdef OPENSSL_SYS_VMS
|
||||
strcat(buf[2],"-old");
|
||||
#else
|
||||
strcat(buf[2],".old");
|
||||
#endif
|
||||
|
||||
if (rename(dbfile,buf[2]) < 0)
|
||||
{
|
||||
BIO_printf(bio_err,"unable to rename %s to %s\n",
|
||||
dbfile,buf[2]);
|
||||
perror("reason");
|
||||
goto err;
|
||||
}
|
||||
if (rename(buf[1],dbfile) < 0)
|
||||
{
|
||||
BIO_printf(bio_err,"unable to rename %s to %s\n",
|
||||
buf[1],dbfile);
|
||||
perror("reason");
|
||||
rename(buf[2],dbfile);
|
||||
goto err;
|
||||
}
|
||||
BIO_printf(bio_err,"Data Base Updated\n");
|
||||
}
|
||||
}
|
||||
@@ -1463,6 +1331,14 @@ bad:
|
||||
}
|
||||
}
|
||||
|
||||
if ((crlnumberfile=NCONF_get_string(conf,section,ENV_CRLNUMBER))
|
||||
!= NULL)
|
||||
if ((crlnumber=load_serial(crlnumberfile,0,NULL)) == NULL)
|
||||
{
|
||||
BIO_printf(bio_err,"error while loading CRL number\n");
|
||||
goto err;
|
||||
}
|
||||
|
||||
if (!crldays && !crlhours)
|
||||
{
|
||||
if (!NCONF_get_number(conf,section,
|
||||
@@ -1491,9 +1367,9 @@ bad:
|
||||
|
||||
ASN1_TIME_free(tmptm);
|
||||
|
||||
for (i=0; i<sk_num(db->data); i++)
|
||||
for (i=0; i<sk_num(db->db->data); i++)
|
||||
{
|
||||
pp=(char **)sk_value(db->data,i);
|
||||
pp=(char **)sk_value(db->db->data,i);
|
||||
if (pp[DB_type][0] == DB_TYPE_REV)
|
||||
{
|
||||
if ((r=X509_REVOKED_new()) == NULL) goto err;
|
||||
@@ -1539,14 +1415,24 @@ bad:
|
||||
|
||||
/* Add any extensions asked for */
|
||||
|
||||
if (crl_ext)
|
||||
if (crl_ext || crlnumberfile != NULL)
|
||||
{
|
||||
X509V3_CTX crlctx;
|
||||
X509V3_set_ctx(&crlctx, x509, NULL, NULL, crl, 0);
|
||||
X509V3_set_nconf(&crlctx, conf);
|
||||
|
||||
if (!X509V3_EXT_CRL_add_nconf(conf, &crlctx,
|
||||
crl_ext, crl)) goto err;
|
||||
if (crl_ext)
|
||||
if (!X509V3_EXT_CRL_add_nconf(conf, &crlctx,
|
||||
crl_ext, crl)) goto err;
|
||||
if (crlnumberfile != NULL)
|
||||
{
|
||||
tmpser = BN_to_ASN1_INTEGER(crlnumber, NULL);
|
||||
if (!tmpser) goto err;
|
||||
X509_CRL_add1_ext_i2d(crl,NID_crl_number,tmpser,0,0);
|
||||
ASN1_INTEGER_free(tmpser);
|
||||
crl_v2 = 1;
|
||||
if (!BN_add_word(crlnumber,1)) goto err;
|
||||
}
|
||||
}
|
||||
if (crl_ext || crl_v2)
|
||||
{
|
||||
@@ -1554,9 +1440,17 @@ bad:
|
||||
goto err; /* version 2 CRL */
|
||||
}
|
||||
|
||||
|
||||
if (crlnumberfile != NULL) /* we have a CRL number that need updating */
|
||||
if (!save_serial(crlnumberfile,"new",crlnumber,NULL)) goto err;
|
||||
|
||||
if (!X509_CRL_sign(crl,pkey,dgst)) goto err;
|
||||
|
||||
PEM_write_bio_X509_CRL(Sout,crl);
|
||||
|
||||
if (crlnumberfile != NULL) /* Rename the crlnumber file */
|
||||
if (!rotate_serial(crlnumberfile,"new","old")) goto err;
|
||||
|
||||
}
|
||||
/*****************************************************************/
|
||||
if (dorevoke)
|
||||
@@ -1577,50 +1471,10 @@ bad:
|
||||
if (j <= 0) goto err;
|
||||
X509_free(revcert);
|
||||
|
||||
if(strlen(dbfile) > BSIZE-5)
|
||||
{
|
||||
BIO_printf(bio_err,"filename too long\n");
|
||||
goto err;
|
||||
}
|
||||
if (!save_index(dbfile, "new", db)) goto err;
|
||||
|
||||
if (!rotate_index(dbfile, "new", "old")) goto err;
|
||||
|
||||
strcpy(buf[0],dbfile);
|
||||
#ifndef OPENSSL_SYS_VMS
|
||||
strcat(buf[0],".new");
|
||||
#else
|
||||
strcat(buf[0],"-new");
|
||||
#endif
|
||||
if (BIO_write_filename(out,buf[0]) <= 0)
|
||||
{
|
||||
perror(dbfile);
|
||||
BIO_printf(bio_err,"unable to open '%s'\n",dbfile);
|
||||
goto err;
|
||||
}
|
||||
j=TXT_DB_write(out,db);
|
||||
if (j <= 0) goto err;
|
||||
BIO_free_all(out);
|
||||
out = NULL;
|
||||
BIO_free_all(in);
|
||||
in = NULL;
|
||||
strncpy(buf[1],dbfile,BSIZE-4);
|
||||
buf[1][BSIZE-4]='\0';
|
||||
#ifndef OPENSSL_SYS_VMS
|
||||
strcat(buf[1],".old");
|
||||
#else
|
||||
strcat(buf[1],"-old");
|
||||
#endif
|
||||
if (rename(dbfile,buf[1]) < 0)
|
||||
{
|
||||
BIO_printf(bio_err,"unable to rename %s to %s\n", dbfile, buf[1]);
|
||||
perror("reason");
|
||||
goto err;
|
||||
}
|
||||
if (rename(buf[0],dbfile) < 0)
|
||||
{
|
||||
BIO_printf(bio_err,"unable to rename %s to %s\n", buf[0],dbfile);
|
||||
perror("reason");
|
||||
rename(buf[1],dbfile);
|
||||
goto err;
|
||||
}
|
||||
BIO_printf(bio_err,"Data Base Updated\n");
|
||||
}
|
||||
}
|
||||
@@ -1642,7 +1496,7 @@ err:
|
||||
if (free_key && key)
|
||||
OPENSSL_free(key);
|
||||
BN_free(serial);
|
||||
TXT_DB_free(db);
|
||||
free_index(db);
|
||||
EVP_PKEY_free(pkey);
|
||||
X509_free(x509);
|
||||
X509_CRL_free(crl);
|
||||
@@ -1657,106 +1511,8 @@ static void lookup_fail(char *name, char *tag)
|
||||
BIO_printf(bio_err,"variable lookup failed for %s::%s\n",name,tag);
|
||||
}
|
||||
|
||||
static unsigned long index_serial_hash(const char **a)
|
||||
{
|
||||
const char *n;
|
||||
|
||||
n=a[DB_serial];
|
||||
while (*n == '0') n++;
|
||||
return(lh_strhash(n));
|
||||
}
|
||||
|
||||
static int index_serial_cmp(const char **a, const char **b)
|
||||
{
|
||||
const char *aa,*bb;
|
||||
|
||||
for (aa=a[DB_serial]; *aa == '0'; aa++);
|
||||
for (bb=b[DB_serial]; *bb == '0'; bb++);
|
||||
return(strcmp(aa,bb));
|
||||
}
|
||||
|
||||
static unsigned long index_name_hash(const char **a)
|
||||
{ return(lh_strhash(a[DB_name])); }
|
||||
|
||||
static int index_name_qual(char **a)
|
||||
{ return(a[0][0] == 'V'); }
|
||||
|
||||
static int index_name_cmp(const char **a, const char **b)
|
||||
{ return(strcmp(a[DB_name],
|
||||
b[DB_name])); }
|
||||
|
||||
static BIGNUM *load_serial(char *serialfile)
|
||||
{
|
||||
BIO *in=NULL;
|
||||
BIGNUM *ret=NULL;
|
||||
MS_STATIC char buf[1024];
|
||||
ASN1_INTEGER *ai=NULL;
|
||||
|
||||
if ((in=BIO_new(BIO_s_file())) == NULL)
|
||||
{
|
||||
ERR_print_errors(bio_err);
|
||||
goto err;
|
||||
}
|
||||
|
||||
if (BIO_read_filename(in,serialfile) <= 0)
|
||||
{
|
||||
perror(serialfile);
|
||||
goto err;
|
||||
}
|
||||
ai=ASN1_INTEGER_new();
|
||||
if (ai == NULL) goto err;
|
||||
if (!a2i_ASN1_INTEGER(in,ai,buf,1024))
|
||||
{
|
||||
BIO_printf(bio_err,"unable to load number from %s\n",
|
||||
serialfile);
|
||||
goto err;
|
||||
}
|
||||
ret=ASN1_INTEGER_to_BN(ai,NULL);
|
||||
if (ret == NULL)
|
||||
{
|
||||
BIO_printf(bio_err,"error converting number from bin to BIGNUM\n");
|
||||
goto err;
|
||||
}
|
||||
err:
|
||||
if (in != NULL) BIO_free(in);
|
||||
if (ai != NULL) ASN1_INTEGER_free(ai);
|
||||
return(ret);
|
||||
}
|
||||
|
||||
static int save_serial(char *serialfile, BIGNUM *serial)
|
||||
{
|
||||
BIO *out;
|
||||
int ret=0;
|
||||
ASN1_INTEGER *ai=NULL;
|
||||
|
||||
out=BIO_new(BIO_s_file());
|
||||
if (out == NULL)
|
||||
{
|
||||
ERR_print_errors(bio_err);
|
||||
goto err;
|
||||
}
|
||||
if (BIO_write_filename(out,serialfile) <= 0)
|
||||
{
|
||||
perror(serialfile);
|
||||
goto err;
|
||||
}
|
||||
|
||||
if ((ai=BN_to_ASN1_INTEGER(serial,NULL)) == NULL)
|
||||
{
|
||||
BIO_printf(bio_err,"error converting serial to ASN.1 format\n");
|
||||
goto err;
|
||||
}
|
||||
i2a_ASN1_INTEGER(out,ai);
|
||||
BIO_puts(out,"\n");
|
||||
ret=1;
|
||||
err:
|
||||
if (out != NULL) BIO_free_all(out);
|
||||
if (ai != NULL) ASN1_INTEGER_free(ai);
|
||||
return(ret);
|
||||
}
|
||||
|
||||
static int certify(X509 **xret, char *infile, EVP_PKEY *pkey, X509 *x509,
|
||||
const EVP_MD *dgst, STACK_OF(CONF_VALUE) *policy, TXT_DB *db,
|
||||
const EVP_MD *dgst, STACK_OF(CONF_VALUE) *policy, CA_DB *db,
|
||||
BIGNUM *serial, char *subj, int email_dn, char *startdate, char *enddate,
|
||||
long days, int batch, char *ext_sect, CONF *lconf, int verbose,
|
||||
unsigned long certopt, unsigned long nameopt, int default_op,
|
||||
@@ -1818,7 +1574,7 @@ err:
|
||||
}
|
||||
|
||||
static int certify_cert(X509 **xret, char *infile, EVP_PKEY *pkey, X509 *x509,
|
||||
const EVP_MD *dgst, STACK_OF(CONF_VALUE) *policy, TXT_DB *db,
|
||||
const EVP_MD *dgst, STACK_OF(CONF_VALUE) *policy, CA_DB *db,
|
||||
BIGNUM *serial, char *subj, int email_dn, char *startdate, char *enddate,
|
||||
long days, int batch, char *ext_sect, CONF *lconf, int verbose,
|
||||
unsigned long certopt, unsigned long nameopt, int default_op,
|
||||
@@ -1872,7 +1628,7 @@ err:
|
||||
}
|
||||
|
||||
static int do_body(X509 **xret, EVP_PKEY *pkey, X509 *x509, const EVP_MD *dgst,
|
||||
STACK_OF(CONF_VALUE) *policy, TXT_DB *db, BIGNUM *serial, char *subj,
|
||||
STACK_OF(CONF_VALUE) *policy, CA_DB *db, BIGNUM *serial, char *subj,
|
||||
int email_dn, char *startdate, char *enddate, long days, int batch,
|
||||
int verbose, X509_REQ *req, char *ext_sect, CONF *lconf,
|
||||
unsigned long certopt, unsigned long nameopt, int default_op,
|
||||
@@ -1890,7 +1646,7 @@ static int do_body(X509 **xret, EVP_PKEY *pkey, X509 *x509, const EVP_MD *dgst,
|
||||
int ok= -1,i,j,last,nid;
|
||||
char *p;
|
||||
CONF_VALUE *cv;
|
||||
char *row[DB_NUMBER],**rrow,**irow=NULL;
|
||||
char *row[DB_NUMBER],**rrow=NULL,**irow=NULL;
|
||||
char buf[25];
|
||||
|
||||
tmptm=ASN1_UTCTIME_new();
|
||||
@@ -2127,15 +1883,19 @@ again2:
|
||||
goto err;
|
||||
}
|
||||
|
||||
rrow=TXT_DB_get_by_index(db,DB_name,row);
|
||||
if (rrow != NULL)
|
||||
if (db->attributes.unique_subject)
|
||||
{
|
||||
BIO_printf(bio_err,"ERROR:There is already a certificate for %s\n",
|
||||
row[DB_name]);
|
||||
rrow=TXT_DB_get_by_index(db->db,DB_name,row);
|
||||
if (rrow != NULL)
|
||||
{
|
||||
BIO_printf(bio_err,
|
||||
"ERROR:There is already a certificate for %s\n",
|
||||
row[DB_name]);
|
||||
}
|
||||
}
|
||||
else
|
||||
if (rrow == NULL)
|
||||
{
|
||||
rrow=TXT_DB_get_by_index(db,DB_serial,row);
|
||||
rrow=TXT_DB_get_by_index(db->db,DB_serial,row);
|
||||
if (rrow != NULL)
|
||||
{
|
||||
BIO_printf(bio_err,"ERROR:Serial number %s has already been issued,\n",
|
||||
@@ -2342,7 +2102,7 @@ again2:
|
||||
BIO_printf(bio_err,"Memory allocation failure\n");
|
||||
goto err;
|
||||
}
|
||||
strcpy(row[DB_file],"unknown");
|
||||
BUF_strlcpy(row[DB_file],"unknown",8);
|
||||
row[DB_type][0]='V';
|
||||
row[DB_type][1]='\0';
|
||||
|
||||
@@ -2359,10 +2119,10 @@ again2:
|
||||
}
|
||||
irow[DB_NUMBER]=NULL;
|
||||
|
||||
if (!TXT_DB_insert(db,irow))
|
||||
if (!TXT_DB_insert(db->db,irow))
|
||||
{
|
||||
BIO_printf(bio_err,"failed to update database\n");
|
||||
BIO_printf(bio_err,"TXT_DB error number %ld\n",db->error);
|
||||
BIO_printf(bio_err,"TXT_DB error number %ld\n",db->db->error);
|
||||
goto err;
|
||||
}
|
||||
ok=1;
|
||||
@@ -2413,7 +2173,7 @@ static void write_new_certificate(BIO *bp, X509 *x, int output_der, int notext)
|
||||
}
|
||||
|
||||
static int certify_spkac(X509 **xret, char *infile, EVP_PKEY *pkey, X509 *x509,
|
||||
const EVP_MD *dgst, STACK_OF(CONF_VALUE) *policy, TXT_DB *db,
|
||||
const EVP_MD *dgst, STACK_OF(CONF_VALUE) *policy, CA_DB *db,
|
||||
BIGNUM *serial, char *subj, int email_dn, char *startdate, char *enddate,
|
||||
long days, char *ext_sect, CONF *lconf, int verbose, unsigned long certopt,
|
||||
unsigned long nameopt, int default_op, int ext_copy)
|
||||
@@ -2592,7 +2352,7 @@ static int check_time_format(char *str)
|
||||
return(ASN1_UTCTIME_check(&tm));
|
||||
}
|
||||
|
||||
static int do_revoke(X509 *x509, TXT_DB *db, int type, char *value)
|
||||
static int do_revoke(X509 *x509, CA_DB *db, int type, char *value)
|
||||
{
|
||||
ASN1_UTCTIME *tm=NULL;
|
||||
char *row[DB_NUMBER],**rrow,**irow;
|
||||
@@ -2617,10 +2377,10 @@ static int do_revoke(X509 *x509, TXT_DB *db, int type, char *value)
|
||||
/* We have to lookup by serial number because name lookup
|
||||
* skips revoked certs
|
||||
*/
|
||||
rrow=TXT_DB_get_by_index(db,DB_serial,row);
|
||||
rrow=TXT_DB_get_by_index(db->db,DB_serial,row);
|
||||
if (rrow == NULL)
|
||||
{
|
||||
BIO_printf(bio_err,"Adding Entry to DB for %s\n", row[DB_name]);
|
||||
BIO_printf(bio_err,"Adding Entry with serial number %s to DB for %s\n", row[DB_serial], row[DB_name]);
|
||||
|
||||
/* We now just add it to the database */
|
||||
row[DB_type]=(char *)OPENSSL_malloc(2);
|
||||
@@ -2643,7 +2403,7 @@ static int do_revoke(X509 *x509, TXT_DB *db, int type, char *value)
|
||||
BIO_printf(bio_err,"Memory allocation failure\n");
|
||||
goto err;
|
||||
}
|
||||
strcpy(row[DB_file],"unknown");
|
||||
BUF_strlcpy(row[DB_file],"unknown",8);
|
||||
row[DB_type][0]='V';
|
||||
row[DB_type][1]='\0';
|
||||
|
||||
@@ -2660,10 +2420,10 @@ static int do_revoke(X509 *x509, TXT_DB *db, int type, char *value)
|
||||
}
|
||||
irow[DB_NUMBER]=NULL;
|
||||
|
||||
if (!TXT_DB_insert(db,irow))
|
||||
if (!TXT_DB_insert(db->db,irow))
|
||||
{
|
||||
BIO_printf(bio_err,"failed to update database\n");
|
||||
BIO_printf(bio_err,"TXT_DB error number %ld\n",db->error);
|
||||
BIO_printf(bio_err,"TXT_DB error number %ld\n",db->db->error);
|
||||
goto err;
|
||||
}
|
||||
|
||||
@@ -2708,7 +2468,7 @@ err:
|
||||
return(ok);
|
||||
}
|
||||
|
||||
static int get_certificate_status(const char *serial, TXT_DB *db)
|
||||
static int get_certificate_status(const char *serial, CA_DB *db)
|
||||
{
|
||||
char *row[DB_NUMBER],**rrow;
|
||||
int ok=-1,i;
|
||||
@@ -2749,7 +2509,7 @@ static int get_certificate_status(const char *serial, TXT_DB *db)
|
||||
ok=1;
|
||||
|
||||
/* Search for the certificate */
|
||||
rrow=TXT_DB_get_by_index(db,DB_serial,row);
|
||||
rrow=TXT_DB_get_by_index(db->db,DB_serial,row);
|
||||
if (rrow == NULL)
|
||||
{
|
||||
BIO_printf(bio_err,"Serial %s not present in db.\n",
|
||||
@@ -2796,7 +2556,7 @@ err:
|
||||
return(ok);
|
||||
}
|
||||
|
||||
static int do_updatedb (TXT_DB *db)
|
||||
static int do_updatedb (CA_DB *db)
|
||||
{
|
||||
ASN1_UTCTIME *a_tm = NULL;
|
||||
int i, cnt = 0;
|
||||
@@ -2822,9 +2582,9 @@ static int do_updatedb (TXT_DB *db)
|
||||
else
|
||||
a_y2k = 0;
|
||||
|
||||
for (i = 0; i < sk_num(db->data); i++)
|
||||
for (i = 0; i < sk_num(db->db->data); i++)
|
||||
{
|
||||
rrow = (char **) sk_value(db->data, i);
|
||||
rrow = (char **) sk_value(db->db->data, i);
|
||||
|
||||
if (rrow[DB_type][0] == 'V')
|
||||
{
|
||||
@@ -2967,16 +2727,16 @@ char *make_revocation_str(int rev_type, char *rev_arg)
|
||||
|
||||
if (!str) return NULL;
|
||||
|
||||
strcpy(str, (char *)revtm->data);
|
||||
BUF_strlcpy(str, (char *)revtm->data, i);
|
||||
if (reason)
|
||||
{
|
||||
strcat(str, ",");
|
||||
strcat(str, reason);
|
||||
BUF_strlcat(str, ",", i);
|
||||
BUF_strlcat(str, reason, i);
|
||||
}
|
||||
if (other)
|
||||
{
|
||||
strcat(str, ",");
|
||||
strcat(str, other);
|
||||
BUF_strlcat(str, ",", i);
|
||||
BUF_strlcat(str, other, i);
|
||||
}
|
||||
ASN1_UTCTIME_free(revtm);
|
||||
return str;
|
||||
@@ -3311,17 +3071,3 @@ int unpack_revinfo(ASN1_TIME **prevtm, int *preason, ASN1_OBJECT **phold, ASN1_G
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int make_serial_index(TXT_DB *db)
|
||||
{
|
||||
if (!TXT_DB_create_index(db, DB_serial, NULL,
|
||||
LHASH_HASH_FN(index_serial_hash),
|
||||
LHASH_COMP_FN(index_serial_cmp)))
|
||||
{
|
||||
BIO_printf(bio_err,
|
||||
"error creating serial number index:(%ld,%ld,%ld)\n",
|
||||
db->error,db->arg1,db->arg2);
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
51
apps/dgst.c
51
apps/dgst.c
@@ -66,6 +66,7 @@
|
||||
#include <openssl/objects.h>
|
||||
#include <openssl/x509.h>
|
||||
#include <openssl/pem.h>
|
||||
#include <openssl/hmac.h>
|
||||
|
||||
#undef BUFSIZE
|
||||
#define BUFSIZE 1024*8
|
||||
@@ -73,9 +74,11 @@
|
||||
#undef PROG
|
||||
#define PROG dgst_main
|
||||
|
||||
static HMAC_CTX hmac_ctx;
|
||||
|
||||
int do_fp(BIO *out, unsigned char *buf, BIO *bp, int sep, int binout,
|
||||
EVP_PKEY *key, unsigned char *sigin, int siglen, const char *title,
|
||||
const char *file);
|
||||
const char *file,BIO *bmd,const char *hmac_key);
|
||||
|
||||
int MAIN(int, char **);
|
||||
|
||||
@@ -103,6 +106,7 @@ int MAIN(int argc, char **argv)
|
||||
#ifndef OPENSSL_NO_ENGINE
|
||||
char *engine=NULL;
|
||||
#endif
|
||||
char *hmac_key=NULL;
|
||||
|
||||
apps_startup();
|
||||
|
||||
@@ -181,6 +185,12 @@ int MAIN(int argc, char **argv)
|
||||
out_bin = 1;
|
||||
else if (strcmp(*argv,"-d") == 0)
|
||||
debug=1;
|
||||
else if (!strcmp(*argv,"-hmac"))
|
||||
{
|
||||
if (--argc < 1)
|
||||
break;
|
||||
hmac_key=*++argv;
|
||||
}
|
||||
else if ((m=EVP_get_digestbyname(&((*argv)[1]))) != NULL)
|
||||
md=m;
|
||||
else
|
||||
@@ -235,7 +245,7 @@ int MAIN(int argc, char **argv)
|
||||
}
|
||||
|
||||
#ifndef OPENSSL_NO_ENGINE
|
||||
e = setup_engine(bio_err, engine, 0);
|
||||
e = setup_engine(bio_err, engine, 0);
|
||||
#endif
|
||||
|
||||
in=BIO_new(BIO_s_file());
|
||||
@@ -318,8 +328,6 @@ int MAIN(int argc, char **argv)
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* we use md as a filter, reading from 'in' */
|
||||
BIO_set_md(bmd,md);
|
||||
@@ -329,7 +337,7 @@ int MAIN(int argc, char **argv)
|
||||
{
|
||||
BIO_set_fp(in,stdin,BIO_NOCLOSE);
|
||||
err=do_fp(out, buf,inp,separator, out_bin, sigkey, sigbuf,
|
||||
siglen,"","(stdin)");
|
||||
siglen,"","(stdin)",bmd,hmac_key);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -347,13 +355,15 @@ int MAIN(int argc, char **argv)
|
||||
}
|
||||
if(!out_bin)
|
||||
{
|
||||
tmp=tofree=OPENSSL_malloc(strlen(name)+strlen(argv[i])+5);
|
||||
sprintf(tmp,"%s(%s)= ",name,argv[i]);
|
||||
size_t len = strlen(name)+strlen(argv[i])+(hmac_key ? 5 : 0)+5;
|
||||
tmp=tofree=OPENSSL_malloc(len);
|
||||
BIO_snprintf(tmp,len,"%s%s(%s)= ",
|
||||
hmac_key ? "HMAC-" : "",name,argv[i]);
|
||||
}
|
||||
else
|
||||
tmp="";
|
||||
r=do_fp(out,buf,inp,separator,out_bin,sigkey,sigbuf,
|
||||
siglen,tmp,argv[i]);
|
||||
siglen,tmp,argv[i],bmd,hmac_key);
|
||||
if(r)
|
||||
err=r;
|
||||
if(tofree)
|
||||
@@ -378,11 +388,21 @@ end:
|
||||
|
||||
int do_fp(BIO *out, unsigned char *buf, BIO *bp, int sep, int binout,
|
||||
EVP_PKEY *key, unsigned char *sigin, int siglen, const char *title,
|
||||
const char *file)
|
||||
const char *file,BIO *bmd,const char *hmac_key)
|
||||
{
|
||||
int len;
|
||||
unsigned int len;
|
||||
int i;
|
||||
EVP_MD_CTX *md_ctx;
|
||||
|
||||
if (hmac_key)
|
||||
{
|
||||
EVP_MD *md;
|
||||
|
||||
BIO_get_md(bmd,&md);
|
||||
HMAC_Init(&hmac_ctx,hmac_key,strlen(hmac_key),md);
|
||||
BIO_get_md_ctx(bmd,&md_ctx);
|
||||
BIO_set_md_ctx(bmd,&hmac_ctx.md_ctx);
|
||||
}
|
||||
for (;;)
|
||||
{
|
||||
i=BIO_read(bp,(char *)buf,BUFSIZE);
|
||||
@@ -425,6 +445,11 @@ int do_fp(BIO *out, unsigned char *buf, BIO *bp, int sep, int binout,
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
else if(hmac_key)
|
||||
{
|
||||
HMAC_Final(&hmac_ctx,buf,&len);
|
||||
HMAC_CTX_cleanup(&hmac_ctx);
|
||||
}
|
||||
else
|
||||
len=BIO_gets(bp,(char *)buf,BUFSIZE);
|
||||
|
||||
@@ -432,7 +457,7 @@ int do_fp(BIO *out, unsigned char *buf, BIO *bp, int sep, int binout,
|
||||
else
|
||||
{
|
||||
BIO_write(out,title,strlen(title));
|
||||
for (i=0; i<len; i++)
|
||||
for (i=0; (unsigned int)i<len; i++)
|
||||
{
|
||||
if (sep && (i != 0))
|
||||
BIO_printf(out, ":");
|
||||
@@ -440,6 +465,10 @@ int do_fp(BIO *out, unsigned char *buf, BIO *bp, int sep, int binout,
|
||||
}
|
||||
BIO_printf(out, "\n");
|
||||
}
|
||||
if (hmac_key)
|
||||
{
|
||||
BIO_set_md_ctx(bmd,md_ctx);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -373,9 +373,9 @@ bad:
|
||||
{
|
||||
char buf[200];
|
||||
|
||||
sprintf(buf,"enter %s %s password:",
|
||||
OBJ_nid2ln(EVP_CIPHER_nid(cipher)),
|
||||
(enc)?"encryption":"decryption");
|
||||
BIO_snprintf(buf,sizeof buf,"enter %s %s password:",
|
||||
OBJ_nid2ln(EVP_CIPHER_nid(cipher)),
|
||||
(enc)?"encryption":"decryption");
|
||||
strbuf[0]='\0';
|
||||
i=EVP_read_pw_string((char *)strbuf,SIZE,buf,enc);
|
||||
if (i == 0)
|
||||
|
||||
@@ -122,8 +122,8 @@ static int append_buf(char **buf, const char *s, int *size, int step)
|
||||
return 0;
|
||||
|
||||
if (**buf != '\0')
|
||||
strcat(*buf, ", ");
|
||||
strcat(*buf, s);
|
||||
BUF_strlcat(*buf, ", ", *size);
|
||||
BUF_strlcat(*buf, s, *size);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
46
apps/ocsp.c
46
apps/ocsp.c
@@ -68,19 +68,6 @@
|
||||
/* Maximum leeway in validity period: default 5 minutes */
|
||||
#define MAX_VALIDITY_PERIOD (5 * 60)
|
||||
|
||||
/* CA index.txt definitions */
|
||||
#define DB_type 0
|
||||
#define DB_exp_date 1
|
||||
#define DB_rev_date 2
|
||||
#define DB_serial 3 /* index - unique */
|
||||
#define DB_file 4
|
||||
#define DB_name 5 /* index - unique for active */
|
||||
#define DB_NUMBER 6
|
||||
|
||||
#define DB_TYPE_REV 'R'
|
||||
#define DB_TYPE_EXP 'E'
|
||||
#define DB_TYPE_VAL 'V'
|
||||
|
||||
static int add_ocsp_cert(OCSP_REQUEST **req, X509 *cert, X509 *issuer,
|
||||
STACK_OF(OCSP_CERTID) *ids);
|
||||
static int add_ocsp_serial(OCSP_REQUEST **req, char *serial, X509 *issuer,
|
||||
@@ -89,12 +76,12 @@ static int print_ocsp_summary(BIO *out, OCSP_BASICRESP *bs, OCSP_REQUEST *req,
|
||||
STACK *names, STACK_OF(OCSP_CERTID) *ids,
|
||||
long nsec, long maxage);
|
||||
|
||||
static int make_ocsp_response(OCSP_RESPONSE **resp, OCSP_REQUEST *req, TXT_DB *db,
|
||||
static int make_ocsp_response(OCSP_RESPONSE **resp, OCSP_REQUEST *req, CA_DB *db,
|
||||
X509 *ca, X509 *rcert, EVP_PKEY *rkey,
|
||||
STACK_OF(X509) *rother, unsigned long flags,
|
||||
int nmin, int ndays);
|
||||
|
||||
static char **lookup_serial(TXT_DB *db, ASN1_INTEGER *ser);
|
||||
static char **lookup_serial(CA_DB *db, ASN1_INTEGER *ser);
|
||||
static BIO *init_responder(char *port);
|
||||
static int do_responder(OCSP_REQUEST **preq, BIO **pcbio, BIO *acbio, char *port);
|
||||
static int send_ocsp_response(BIO *cbio, OCSP_RESPONSE *resp);
|
||||
@@ -143,7 +130,7 @@ int MAIN(int argc, char **argv)
|
||||
X509 *rca_cert = NULL;
|
||||
char *ridx_filename = NULL;
|
||||
char *rca_filename = NULL;
|
||||
TXT_DB *rdb = NULL;
|
||||
CA_DB *rdb = NULL;
|
||||
int nmin = 0, ndays = -1;
|
||||
|
||||
if (bio_err == NULL) bio_err = BIO_new_fp(stderr, BIO_NOCLOSE);
|
||||
@@ -700,22 +687,9 @@ int MAIN(int argc, char **argv)
|
||||
|
||||
if (ridx_filename && !rdb)
|
||||
{
|
||||
BIO *db_bio = NULL;
|
||||
db_bio = BIO_new_file(ridx_filename, "r");
|
||||
if (!db_bio)
|
||||
{
|
||||
BIO_printf(bio_err, "Error opening index file %s\n", ridx_filename);
|
||||
goto end;
|
||||
}
|
||||
rdb = TXT_DB_read(db_bio, DB_NUMBER);
|
||||
BIO_free(db_bio);
|
||||
if (!rdb)
|
||||
{
|
||||
BIO_printf(bio_err, "Error reading index file %s\n", ridx_filename);
|
||||
goto end;
|
||||
}
|
||||
if (!make_serial_index(rdb))
|
||||
goto end;
|
||||
rdb = load_index(ridx_filename, NULL);
|
||||
if (!rdb) goto end;
|
||||
if (!index_index(rdb)) goto end;
|
||||
}
|
||||
|
||||
if (rdb)
|
||||
@@ -899,7 +873,7 @@ end:
|
||||
X509_free(cert);
|
||||
X509_free(rsigner);
|
||||
X509_free(rca_cert);
|
||||
TXT_DB_free(rdb);
|
||||
free_index(rdb);
|
||||
BIO_free_all(cbio);
|
||||
BIO_free_all(acbio);
|
||||
BIO_free(out);
|
||||
@@ -1041,7 +1015,7 @@ static int print_ocsp_summary(BIO *out, OCSP_BASICRESP *bs, OCSP_REQUEST *req,
|
||||
}
|
||||
|
||||
|
||||
static int make_ocsp_response(OCSP_RESPONSE **resp, OCSP_REQUEST *req, TXT_DB *db,
|
||||
static int make_ocsp_response(OCSP_RESPONSE **resp, OCSP_REQUEST *req, CA_DB *db,
|
||||
X509 *ca, X509 *rcert, EVP_PKEY *rkey,
|
||||
STACK_OF(X509) *rother, unsigned long flags,
|
||||
int nmin, int ndays)
|
||||
@@ -1133,7 +1107,7 @@ static int make_ocsp_response(OCSP_RESPONSE **resp, OCSP_REQUEST *req, TXT_DB *d
|
||||
|
||||
}
|
||||
|
||||
static char **lookup_serial(TXT_DB *db, ASN1_INTEGER *ser)
|
||||
static char **lookup_serial(CA_DB *db, ASN1_INTEGER *ser)
|
||||
{
|
||||
int i;
|
||||
BIGNUM *bn = NULL;
|
||||
@@ -1146,7 +1120,7 @@ static char **lookup_serial(TXT_DB *db, ASN1_INTEGER *ser)
|
||||
itmp = BN_bn2hex(bn);
|
||||
row[DB_serial] = itmp;
|
||||
BN_free(bn);
|
||||
rrow=TXT_DB_get_by_index(db,DB_serial,row);
|
||||
rrow=TXT_DB_get_by_index(db->db,DB_serial,row);
|
||||
OPENSSL_free(itmp);
|
||||
return rrow;
|
||||
}
|
||||
|
||||
@@ -129,6 +129,7 @@
|
||||
#include "progs.h"
|
||||
#include "s_apps.h"
|
||||
#include <openssl/err.h>
|
||||
#include <openssl/fips.h>
|
||||
|
||||
/* The LHASH callbacks ("hash" & "cmp") have been replaced by functions with the
|
||||
* base prototypes (we cast each variable inside the function to the required
|
||||
@@ -231,6 +232,24 @@ int main(int Argc, char *Argv[])
|
||||
arg.data=NULL;
|
||||
arg.count=0;
|
||||
|
||||
#ifdef OPENSSL_FIPS
|
||||
if(getenv("OPENSSL_FIPS")) {
|
||||
#if defined(_WIN32)
|
||||
char filename[MAX_PATH] = "";
|
||||
GetModuleFileName( NULL, filename, MAX_PATH) ;
|
||||
p = filename;
|
||||
#else
|
||||
p = Argv[0];
|
||||
#endif
|
||||
if (!FIPS_mode_set(1,p)) {
|
||||
ERR_load_crypto_strings();
|
||||
ERR_print_errors(BIO_new_fp(stderr,BIO_NOCLOSE));
|
||||
exit(1);
|
||||
}
|
||||
if (getenv("OPENSSL_FIPS_MD5"))
|
||||
FIPS_allow_md5(1);
|
||||
}
|
||||
#endif
|
||||
if (bio_err == NULL)
|
||||
if ((bio_err=BIO_new(BIO_s_file())) != NULL)
|
||||
BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT);
|
||||
|
||||
@@ -38,10 +38,14 @@ dir = ./demoCA # Where everything is kept
|
||||
certs = $dir/certs # Where the issued certs are kept
|
||||
crl_dir = $dir/crl # Where the issued crl are kept
|
||||
database = $dir/index.txt # database index file.
|
||||
#unique_subject = no # Set to 'no' to allow creation of
|
||||
# several ctificates with same subject.
|
||||
new_certs_dir = $dir/newcerts # default place for new certs.
|
||||
|
||||
certificate = $dir/cacert.pem # The CA certificate
|
||||
serial = $dir/serial # The current serial number
|
||||
#crlnumber = $dir/crlnumber # the current crl number
|
||||
# must be commented out to leave a V1 CRL
|
||||
crl = $dir/crl.pem # The current CRL
|
||||
private_key = $dir/private/cakey.pem# The private key
|
||||
RANDFILE = $dir/private/.rand # private random number file
|
||||
@@ -58,6 +62,7 @@ cert_opt = ca_default # Certificate field options
|
||||
|
||||
# Extensions to add to a CRL. Note: Netscape communicator chokes on V2 CRLs
|
||||
# so this is commented out by default to leave a V1 CRL.
|
||||
# crlnumber must also be commented out to leave a V1 CRL.
|
||||
# crl_extensions = crl_ext
|
||||
|
||||
default_days = 365 # how long to certify for
|
||||
|
||||
@@ -557,7 +557,7 @@ int MAIN(int argc, char **argv)
|
||||
BIO_printf (bio_err, "Can't read Password\n");
|
||||
goto export_end;
|
||||
}
|
||||
if (!twopass) strcpy(macpass, pass);
|
||||
if (!twopass) BUF_strlcpy(macpass, pass, sizeof macpass);
|
||||
/* Turn certbags into encrypted authsafe */
|
||||
authsafe = PKCS12_pack_p7encdata(cert_pbe, cpass, -1, NULL, 0,
|
||||
iter, bags);
|
||||
@@ -658,7 +658,7 @@ int MAIN(int argc, char **argv)
|
||||
CRYPTO_pop_info();
|
||||
#endif
|
||||
|
||||
if (!twopass) strcpy(macpass, pass);
|
||||
if (!twopass) BUF_strlcpy(macpass, pass, sizeof macpass);
|
||||
|
||||
if (options & INFO) BIO_printf (bio_err, "MAC Iteration %ld\n", p12->mac->iter ? ASN1_INTEGER_get (p12->mac->iter) : 1);
|
||||
if(macver) {
|
||||
|
||||
@@ -102,6 +102,9 @@ int MAIN(int argc, char **argv)
|
||||
if ((bio_err=BIO_new(BIO_s_file())) != NULL)
|
||||
BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT);
|
||||
|
||||
if (!load_config(bio_err, NULL))
|
||||
goto end;
|
||||
|
||||
infile=NULL;
|
||||
outfile=NULL;
|
||||
informat=FORMAT_PEM;
|
||||
|
||||
46
apps/req.c
46
apps/req.c
@@ -824,14 +824,16 @@ loop:
|
||||
if ((x509ss=X509_new()) == NULL) goto end;
|
||||
|
||||
/* Set version to V3 */
|
||||
if(!X509_set_version(x509ss, 2)) goto end;
|
||||
if(extensions && !X509_set_version(x509ss, 2)) goto end;
|
||||
if (serial)
|
||||
{
|
||||
if (!X509_set_serialNumber(x509ss, serial)) goto end;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!ASN1_INTEGER_set(X509_get_serialNumber(x509ss),0L)) goto end;
|
||||
if (!rand_serial(NULL,
|
||||
X509_get_serialNumber(x509ss)))
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (!X509_set_issuer_name(x509ss, X509_REQ_get_subject_name(req))) goto end;
|
||||
@@ -1223,34 +1225,34 @@ start: for (;;)
|
||||
}
|
||||
/* If OBJ not recognised ignore it */
|
||||
if ((nid=OBJ_txt2nid(type)) == NID_undef) goto start;
|
||||
|
||||
if(strlen(v->name) > sizeof buf-9)
|
||||
if (BIO_snprintf(buf,sizeof buf,"%s_default",v->name)
|
||||
>= sizeof buf)
|
||||
{
|
||||
BIO_printf(bio_err,"Name '%s' too long\n",v->name);
|
||||
return 0;
|
||||
}
|
||||
|
||||
sprintf(buf,"%s_default",v->name);
|
||||
if ((def=NCONF_get_string(req_conf,dn_sect,buf)) == NULL)
|
||||
{
|
||||
ERR_clear_error();
|
||||
def="";
|
||||
}
|
||||
sprintf(buf,"%s_value",v->name);
|
||||
|
||||
BIO_snprintf(buf,sizeof buf,"%s_value",v->name);
|
||||
if ((value=NCONF_get_string(req_conf,dn_sect,buf)) == NULL)
|
||||
{
|
||||
ERR_clear_error();
|
||||
value=NULL;
|
||||
}
|
||||
|
||||
sprintf(buf,"%s_min",v->name);
|
||||
BIO_snprintf(buf,sizeof buf,"%s_min",v->name);
|
||||
if (!NCONF_get_number(req_conf,dn_sect,buf, &n_min))
|
||||
{
|
||||
ERR_clear_error();
|
||||
n_min = -1;
|
||||
}
|
||||
|
||||
sprintf(buf,"%s_max",v->name);
|
||||
BIO_snprintf(buf,sizeof buf,"%s_max",v->name);
|
||||
if (!NCONF_get_number(req_conf,dn_sect,buf, &n_max))
|
||||
{
|
||||
ERR_clear_error();
|
||||
@@ -1288,13 +1290,13 @@ start2: for (;;)
|
||||
if ((nid=OBJ_txt2nid(type)) == NID_undef)
|
||||
goto start2;
|
||||
|
||||
if(strlen(v->name) > sizeof buf-9)
|
||||
if (BIO_snprintf(buf,sizeof buf,"%s_default",type)
|
||||
>= sizeof buf)
|
||||
{
|
||||
BIO_printf(bio_err,"Name '%s' too long\n",v->name);
|
||||
return 0;
|
||||
}
|
||||
|
||||
sprintf(buf,"%s_default",type);
|
||||
if ((def=NCONF_get_string(req_conf,attr_sect,buf))
|
||||
== NULL)
|
||||
{
|
||||
@@ -1303,7 +1305,7 @@ start2: for (;;)
|
||||
}
|
||||
|
||||
|
||||
sprintf(buf,"%s_value",type);
|
||||
BIO_snprintf(buf,sizeof buf,"%s_value",type);
|
||||
if ((value=NCONF_get_string(req_conf,attr_sect,buf))
|
||||
== NULL)
|
||||
{
|
||||
@@ -1311,11 +1313,11 @@ start2: for (;;)
|
||||
value=NULL;
|
||||
}
|
||||
|
||||
sprintf(buf,"%s_min",type);
|
||||
BIO_snprintf(buf,sizeof buf,"%s_min",type);
|
||||
if (!NCONF_get_number(req_conf,attr_sect,buf, &n_min))
|
||||
n_min = -1;
|
||||
|
||||
sprintf(buf,"%s_max",type);
|
||||
BIO_snprintf(buf,sizeof buf,"%s_max",type);
|
||||
if (!NCONF_get_number(req_conf,attr_sect,buf, &n_max))
|
||||
n_max = -1;
|
||||
|
||||
@@ -1397,9 +1399,8 @@ start:
|
||||
(void)BIO_flush(bio_err);
|
||||
if(value != NULL)
|
||||
{
|
||||
OPENSSL_assert(strlen(value) < sizeof buf-2);
|
||||
strcpy(buf,value);
|
||||
strcat(buf,"\n");
|
||||
BUF_strlcpy(buf,value,sizeof buf);
|
||||
BUF_strlcat(buf,"\n",sizeof buf);
|
||||
BIO_printf(bio_err,"%s\n",value);
|
||||
}
|
||||
else
|
||||
@@ -1421,8 +1422,8 @@ start:
|
||||
{
|
||||
if ((def == NULL) || (def[0] == '\0'))
|
||||
return(1);
|
||||
strcpy(buf,def);
|
||||
strcat(buf,"\n");
|
||||
BUF_strlcpy(buf,def,sizeof buf);
|
||||
BUF_strlcat(buf,"\n",sizeof buf);
|
||||
}
|
||||
else if ((buf[0] == '.') && (buf[1] == '\n')) return(1);
|
||||
|
||||
@@ -1456,9 +1457,8 @@ start:
|
||||
(void)BIO_flush(bio_err);
|
||||
if (value != NULL)
|
||||
{
|
||||
OPENSSL_assert(strlen(value) < sizeof buf-2);
|
||||
strcpy(buf,value);
|
||||
strcat(buf,"\n");
|
||||
BUF_strlcpy(buf,value,sizeof buf);
|
||||
BUF_strlcat(buf,"\n",sizeof buf);
|
||||
BIO_printf(bio_err,"%s\n",value);
|
||||
}
|
||||
else
|
||||
@@ -1480,8 +1480,8 @@ start:
|
||||
{
|
||||
if ((def == NULL) || (def[0] == '\0'))
|
||||
return(1);
|
||||
strcpy(buf,def);
|
||||
strcat(buf,"\n");
|
||||
BUF_strlcpy(buf,def,sizeof buf);
|
||||
BUF_strlcat(buf,"\n",sizeof buf);
|
||||
}
|
||||
else if ((buf[0] == '.') && (buf[1] == '\n')) return(1);
|
||||
|
||||
|
||||
@@ -97,6 +97,7 @@ int MAIN(int argc, char **argv)
|
||||
EVP_PKEY *pkey = NULL;
|
||||
RSA *rsa = NULL;
|
||||
unsigned char *rsa_in = NULL, *rsa_out = NULL, pad;
|
||||
char *passargin = NULL, *passin = NULL;
|
||||
int rsa_inlen, rsa_outlen = 0;
|
||||
int keysize;
|
||||
|
||||
@@ -124,6 +125,9 @@ int MAIN(int argc, char **argv)
|
||||
} else if(!strcmp(*argv, "-inkey")) {
|
||||
if (--argc < 1) badarg = 1;
|
||||
keyfile = *(++argv);
|
||||
} else if (!strcmp(*argv,"-passin")) {
|
||||
if (--argc < 1) badarg = 1;
|
||||
passargin= *(++argv);
|
||||
} else if (strcmp(*argv,"-keyform") == 0) {
|
||||
if (--argc < 1) badarg = 1;
|
||||
keyform=str2fmt(*(++argv));
|
||||
@@ -169,6 +173,10 @@ int MAIN(int argc, char **argv)
|
||||
#ifndef OPENSSL_NO_ENGINE
|
||||
e = setup_engine(bio_err, engine, 0);
|
||||
#endif
|
||||
if(!app_passwd(bio_err, passargin, NULL, &passin, NULL)) {
|
||||
BIO_printf(bio_err, "Error getting password\n");
|
||||
goto end;
|
||||
}
|
||||
|
||||
/* FIXME: seed PRNG only if needed */
|
||||
app_RAND_load_file(NULL, bio_err, 0);
|
||||
@@ -176,7 +184,7 @@ int MAIN(int argc, char **argv)
|
||||
switch(key_type) {
|
||||
case KEY_PRIVKEY:
|
||||
pkey = load_key(bio_err, keyfile, keyform, 0,
|
||||
NULL, e, "Private Key");
|
||||
passin, e, "Private Key");
|
||||
break;
|
||||
|
||||
case KEY_PUBKEY:
|
||||
@@ -290,6 +298,7 @@ int MAIN(int argc, char **argv)
|
||||
BIO_free_all(out);
|
||||
if(rsa_in) OPENSSL_free(rsa_in);
|
||||
if(rsa_out) OPENSSL_free(rsa_out);
|
||||
if(passin) OPENSSL_free(passin);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -313,6 +322,7 @@ static void usage()
|
||||
BIO_printf(bio_err, "-hexdump hex dump output\n");
|
||||
#ifndef OPENSSL_NO_ENGINE
|
||||
BIO_printf(bio_err, "-engine e use engine e, possibly a hardware device.\n");
|
||||
BIO_printf (bio_err, "-passin arg pass phrase source\n");
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
@@ -389,7 +389,7 @@ redoit:
|
||||
perror("OPENSSL_malloc");
|
||||
return(0);
|
||||
}
|
||||
strcpy(*host,h1->h_name);
|
||||
BUF_strlcpy(*host,h1->h_name,strlen(h1->h_name)+1);
|
||||
|
||||
h2=GetHostByName(*host);
|
||||
if (h2 == NULL)
|
||||
|
||||
@@ -502,7 +502,7 @@ int MAIN(int argc, char **argv)
|
||||
|
||||
if (s_www_path != NULL)
|
||||
{
|
||||
sprintf(buf,"GET %s HTTP/1.0\r\n\r\n",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;
|
||||
@@ -557,7 +557,7 @@ next:
|
||||
|
||||
if (s_www_path != NULL)
|
||||
{
|
||||
sprintf(buf,"GET %s HTTP/1.0\r\n\r\n",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 (SSL_read(scon,buf,sizeof(buf)) > 0)
|
||||
;
|
||||
@@ -595,7 +595,7 @@ next:
|
||||
|
||||
if (s_www_path)
|
||||
{
|
||||
sprintf(buf,"GET %s HTTP/1.0\r\n\r\n",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;
|
||||
|
||||
@@ -773,6 +773,7 @@ int MAIN(int argc, char **argv)
|
||||
{
|
||||
dsa_doit[R_DSA_512]=1;
|
||||
dsa_doit[R_DSA_1024]=1;
|
||||
dsa_doit[R_DSA_2048]=1;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
@@ -1006,6 +1007,9 @@ int MAIN(int argc, char **argv)
|
||||
c[D_CBC_RC5][0]=count;
|
||||
c[D_CBC_BF][0]=count;
|
||||
c[D_CBC_CAST][0]=count;
|
||||
c[D_CBC_128_AES][0]=count;
|
||||
c[D_CBC_192_AES][0]=count;
|
||||
c[D_CBC_256_AES][0]=count;
|
||||
|
||||
for (i=1; i<SIZE_NUM; i++)
|
||||
{
|
||||
@@ -1031,6 +1035,9 @@ int MAIN(int argc, char **argv)
|
||||
c[D_CBC_RC5][i]=c[D_CBC_RC5][i-1]*l0/l1;
|
||||
c[D_CBC_BF][i]=c[D_CBC_BF][i-1]*l0/l1;
|
||||
c[D_CBC_CAST][i]=c[D_CBC_CAST][i-1]*l0/l1;
|
||||
c[D_CBC_128_AES][i]=c[D_CBC_128_AES][i-1]*l0/l1;
|
||||
c[D_CBC_192_AES][i]=c[D_CBC_192_AES][i-1]*l0/l1;
|
||||
c[D_CBC_256_AES][i]=c[D_CBC_256_AES][i-1]*l0/l1;
|
||||
}
|
||||
#ifndef OPENSSL_NO_RSA
|
||||
rsa_c[R_RSA_512][0]=count/2000;
|
||||
|
||||
110
apps/x509.c
110
apps/x509.c
@@ -168,7 +168,7 @@ int MAIN(int argc, char **argv)
|
||||
char *CAkeyfile=NULL,*CAserial=NULL;
|
||||
char *alias=NULL;
|
||||
int text=0,serial=0,hash=0,subject=0,issuer=0,startdate=0,enddate=0;
|
||||
int ocspid=0;
|
||||
int next_serial=0,ocspid=0;
|
||||
int noout=0,sign_flag=0,CA_flag=0,CA_createserial=0,email=0;
|
||||
int trustout=0,clrtrust=0,clrreject=0,aliasout=0,clrext=0;
|
||||
int C=0;
|
||||
@@ -371,6 +371,8 @@ int MAIN(int argc, char **argv)
|
||||
email= ++num;
|
||||
else if (strcmp(*argv,"-serial") == 0)
|
||||
serial= ++num;
|
||||
else if (strcmp(*argv,"-next_serial") == 0)
|
||||
next_serial= ++num;
|
||||
else if (strcmp(*argv,"-modulus") == 0)
|
||||
modulus= ++num;
|
||||
else if (strcmp(*argv,"-pubkey") == 0)
|
||||
@@ -617,7 +619,7 @@ bad:
|
||||
if (xca == NULL) goto end;
|
||||
}
|
||||
|
||||
if (!noout || text)
|
||||
if (!noout || text || next_serial)
|
||||
{
|
||||
OBJ_create("2.99999.3",
|
||||
"SET.ex3","SET x509v3 extension 3");
|
||||
@@ -691,6 +693,24 @@ bad:
|
||||
i2a_ASN1_INTEGER(STDout,x->cert_info->serialNumber);
|
||||
BIO_printf(STDout,"\n");
|
||||
}
|
||||
else if (next_serial == i)
|
||||
{
|
||||
BIGNUM *bnser;
|
||||
ASN1_INTEGER *ser;
|
||||
ser = X509_get_serialNumber(x);
|
||||
bnser = ASN1_INTEGER_to_BN(ser, NULL);
|
||||
if (!bnser)
|
||||
goto end;
|
||||
if (!BN_add_word(bnser, 1))
|
||||
goto end;
|
||||
ser = BN_to_ASN1_INTEGER(bnser, NULL);
|
||||
if (!ser)
|
||||
goto end;
|
||||
BN_free(bnser);
|
||||
i2a_ASN1_INTEGER(out, ser);
|
||||
ASN1_INTEGER_free(ser);
|
||||
BIO_puts(out, "\n");
|
||||
}
|
||||
else if (email == i)
|
||||
{
|
||||
int j;
|
||||
@@ -1022,31 +1042,31 @@ end:
|
||||
OPENSSL_EXIT(ret);
|
||||
}
|
||||
|
||||
static ASN1_INTEGER *load_serial(char *CAfile, char *serialfile, int create)
|
||||
static ASN1_INTEGER *x509_load_serial(char *CAfile, char *serialfile, int create)
|
||||
{
|
||||
char *buf = NULL, *p;
|
||||
MS_STATIC char buf2[1024];
|
||||
ASN1_INTEGER *bs = NULL, *bs2 = NULL;
|
||||
BIO *io = NULL;
|
||||
ASN1_INTEGER *bs = NULL;
|
||||
BIGNUM *serial = NULL;
|
||||
size_t len;
|
||||
|
||||
buf=OPENSSL_malloc( ((serialfile == NULL)
|
||||
?(strlen(CAfile)+strlen(POSTFIX)+1)
|
||||
:(strlen(serialfile)))+1);
|
||||
len = ((serialfile == NULL)
|
||||
?(strlen(CAfile)+strlen(POSTFIX)+1)
|
||||
:(strlen(serialfile)))+1;
|
||||
buf=OPENSSL_malloc(len);
|
||||
if (buf == NULL) { BIO_printf(bio_err,"out of mem\n"); goto end; }
|
||||
if (serialfile == NULL)
|
||||
{
|
||||
strcpy(buf,CAfile);
|
||||
BUF_strlcpy(buf,CAfile,len);
|
||||
for (p=buf; *p; p++)
|
||||
if (*p == '.')
|
||||
{
|
||||
*p='\0';
|
||||
break;
|
||||
}
|
||||
strcat(buf,POSTFIX);
|
||||
BUF_strlcat(buf,POSTFIX,len);
|
||||
}
|
||||
else
|
||||
strcpy(buf,serialfile);
|
||||
BUF_strlcpy(buf,serialfile,len);
|
||||
serial=BN_new();
|
||||
bs=ASN1_INTEGER_new();
|
||||
if ((serial == NULL) || (bs == NULL))
|
||||
@@ -1055,72 +1075,18 @@ static ASN1_INTEGER *load_serial(char *CAfile, char *serialfile, int create)
|
||||
goto end;
|
||||
}
|
||||
|
||||
io=BIO_new(BIO_s_file());
|
||||
if (io == NULL)
|
||||
{
|
||||
ERR_print_errors(bio_err);
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (BIO_read_filename(io,buf) <= 0)
|
||||
{
|
||||
if (!create)
|
||||
{
|
||||
perror(buf);
|
||||
goto end;
|
||||
}
|
||||
else
|
||||
{
|
||||
ASN1_INTEGER_set(bs,1);
|
||||
BN_one(serial);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!a2i_ASN1_INTEGER(io,bs,buf2,sizeof buf2))
|
||||
{
|
||||
BIO_printf(bio_err,"unable to load serial number from %s\n",buf);
|
||||
ERR_print_errors(bio_err);
|
||||
goto end;
|
||||
}
|
||||
else
|
||||
{
|
||||
serial=BN_bin2bn(bs->data,bs->length,serial);
|
||||
if (serial == NULL)
|
||||
{
|
||||
BIO_printf(bio_err,"error converting bin 2 bn");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
}
|
||||
serial = load_serial(buf, create, NULL);
|
||||
if (serial == NULL) goto end;
|
||||
|
||||
if (!BN_add_word(serial,1))
|
||||
{ BIO_printf(bio_err,"add_word failure\n"); goto end; }
|
||||
if (!(bs2 = BN_to_ASN1_INTEGER(serial, NULL)))
|
||||
{ BIO_printf(bio_err,"error converting bn 2 asn1_integer\n"); goto end; }
|
||||
if (BIO_write_filename(io,buf) <= 0)
|
||||
{
|
||||
BIO_printf(bio_err,"error attempting to write serial number file\n");
|
||||
perror(buf);
|
||||
goto end;
|
||||
}
|
||||
i2a_ASN1_INTEGER(io,bs2);
|
||||
BIO_puts(io,"\n");
|
||||
|
||||
BIO_free(io);
|
||||
if (!save_serial(buf, NULL, serial, &bs)) goto end;
|
||||
|
||||
end:
|
||||
if (buf) OPENSSL_free(buf);
|
||||
ASN1_INTEGER_free(bs2);
|
||||
BN_free(serial);
|
||||
io=NULL;
|
||||
return bs;
|
||||
|
||||
end:
|
||||
if (buf) OPENSSL_free(buf);
|
||||
BIO_free(io);
|
||||
ASN1_INTEGER_free(bs);
|
||||
BN_free(serial);
|
||||
return NULL;
|
||||
|
||||
}
|
||||
|
||||
static int x509_certify(X509_STORE *ctx, char *CAfile, const EVP_MD *digest,
|
||||
@@ -1142,7 +1108,7 @@ static int x509_certify(X509_STORE *ctx, char *CAfile, const EVP_MD *digest,
|
||||
goto end;
|
||||
}
|
||||
if (sno) bs = sno;
|
||||
else if (!(bs = load_serial(CAfile, serialfile, create)))
|
||||
else if (!(bs = x509_load_serial(CAfile, serialfile, create)))
|
||||
goto end;
|
||||
|
||||
/* if (!X509_STORE_add_cert(ctx,x)) goto end;*/
|
||||
|
||||
23
certs/eng1.pem
Normal file
23
certs/eng1.pem
Normal file
@@ -0,0 +1,23 @@
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIID3TCCAsWgAwIBAgIBADANBgkqhkiG9w0BAQUFADCBqDELMAkGA1UEBhMCQ0Ex
|
||||
CzAJBgNVBAgTAk9OMRAwDgYDVQQHEwdUb3JvbnRvMRgwFgYDVQQKEw9CYW5rRW5n
|
||||
aW5lIEluYy4xKTAnBgNVBAsTIENlcnRpZmljYXRpb24gQXV0aG9yaXR5IERpdmlz
|
||||
aW9uMRMwEQYDVQQDEwpiYW5rZW5naW5lMSAwHgYJKoZIhvcNAQkBFhFjYUBiYW5r
|
||||
ZW5naW5lLmNvbTAeFw05ODAxMDEwMDAwMDBaFw0zODAxMTcwMDAwMDBaMIGoMQsw
|
||||
CQYDVQQGEwJDQTELMAkGA1UECBMCT04xEDAOBgNVBAcTB1Rvcm9udG8xGDAWBgNV
|
||||
BAoTD0JhbmtFbmdpbmUgSW5jLjEpMCcGA1UECxMgQ2VydGlmaWNhdGlvbiBBdXRo
|
||||
b3JpdHkgRGl2aXNpb24xEzARBgNVBAMTCmJhbmtlbmdpbmUxIDAeBgkqhkiG9w0B
|
||||
CQEWEWNhQGJhbmtlbmdpbmUuY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB
|
||||
CgKCAQEA14LoTUAl1/hEy+Kh1kLHiBdW2zD3V4IhM7xxTVKsYsIH56nr69ATTIxU
|
||||
P36eRzeZ137qt1AxHFjDCidk3m1Ul6l59ProPexdslLLM2npM3f2cteg+toyiYiS
|
||||
EJKjyzIu1xF1j9qzGkymSY/4DsXLZNk9FaczxMk/Ooc6Os1M3AverL4VG4rYIb6f
|
||||
eR32cIKJ9Q1fGuyKk7ipq1XQfPW8a8TgZdbHbe7U9Gk3iasGMHHvpR9Ep3mGbgdT
|
||||
uQ98SBEuIwe1BUCGg/MXpVy48MNXfAMotBgGw4pl9yqSjMni2FB+E9Q9DHFs2RgX
|
||||
MqzKuo8zcPxKx2kZ6Arj8+27dw2clQIDAQABoxAwDjAMBgNVHRMEBTADAQH/MA0G
|
||||
CSqGSIb3DQEBBQUAA4IBAQBauupHX9EhpC/r57d6b5kkeWvognxIP9//TO4iw3qb
|
||||
zIXEkPXmJmwVzlzoKJWqiya+aw19SP0+G6CzsFOBo/9ehmz+hZ8bhYX4MjlWzX5u
|
||||
Tnkhz172j9fOBUmrTVPkcRIs6zjCD5PQAGoBPP1/Zdy2N36lZ0U7lg07Opirj/yJ
|
||||
PSJeM2j0fwIFAroiVckvdT0BVwB6S/cPaAQGPghbbr1YGSmYrMriSv825ILJUfxz
|
||||
rJYunGR9FiY9Ob7+jwJwiZMS4CxSPktutxr/3hOvr1+ALS7IcVakhhA3PuZAJbdH
|
||||
FRclR9qMM8aBnBZmf+Uv3K3uhT+UBzzY654U9Yi1JYnA
|
||||
-----END CERTIFICATE-----
|
||||
23
certs/eng2.pem
Normal file
23
certs/eng2.pem
Normal file
@@ -0,0 +1,23 @@
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIID3TCCAsWgAwIBAgIBADANBgkqhkiG9w0BAQUFADCBqDELMAkGA1UEBhMCQ0Ex
|
||||
CzAJBgNVBAgTAk9OMRAwDgYDVQQHEwdUb3JvbnRvMRgwFgYDVQQKEw9DZXJ0RW5n
|
||||
aW5lIEluYy4xKTAnBgNVBAsTIENlcnRpZmljYXRpb24gQXV0aG9yaXR5IERpdmlz
|
||||
aW9uMRMwEQYDVQQDEwpjZXJ0ZW5naW5lMSAwHgYJKoZIhvcNAQkBFhFjYUBjZXJ0
|
||||
ZW5naW5lLmNvbTAeFw05ODAxMDEwMDAwMDBaFw0zODAxMTcwMDAwMDBaMIGoMQsw
|
||||
CQYDVQQGEwJDQTELMAkGA1UECBMCT04xEDAOBgNVBAcTB1Rvcm9udG8xGDAWBgNV
|
||||
BAoTD0NlcnRFbmdpbmUgSW5jLjEpMCcGA1UECxMgQ2VydGlmaWNhdGlvbiBBdXRo
|
||||
b3JpdHkgRGl2aXNpb24xEzARBgNVBAMTCmNlcnRlbmdpbmUxIDAeBgkqhkiG9w0B
|
||||
CQEWEWNhQGNlcnRlbmdpbmUuY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB
|
||||
CgKCAQEA7aTXURShaeVt9u/dP3Q2dVib3jTCZvEyc6yfpGgaYWewXWuP4HOSfI4h
|
||||
GZblbpl+dzJc6RjhR+pguIRtbT5FJB8SJGjRqoujBEOQOxtVtc2fjM9Dqh0iOvMW
|
||||
WS6buxHG55GVrHAQaO5HXEScKQBa9ZyNmpSXPTEBrDMej1OAGOkc524/TZrgFPF4
|
||||
AiJLLkxCcP8NuzUKlW3WzNMSSoCtjkUKy4wjSLlAWCFM0T9Df6/+Z8ZUQTzHoKCD
|
||||
ncH5Qnynd7DlOwKQ2JwwxRhYGiGVTUN0GUq7qA11kW3+vnbFesKQXoF6o2PVx9s2
|
||||
YXviI2NXXUjZ0pVnsnFCc45Pm8XojwIDAQABoxAwDjAMBgNVHRMEBTADAQH/MA0G
|
||||
CSqGSIb3DQEBBQUAA4IBAQBP/aHOKJ00Akzc9HWM1X30hlWZFBaQi4pqD4Uhk8+p
|
||||
KzzwFP5DRLBOz8TYBbtdXrS6hxVMr2sqWmhVkuyepWhHZazKGyHY/y0FbOXsewAV
|
||||
1QxxSyx7ve89pCKv4/w0rQcP916iHc8Y/TCpmz7eITa3GId+8H/XTaBi8GBp9X9O
|
||||
w8m25FmEB1NT+eJwefvfdKowjy4tSorKdW/eJspxNuTSRGmUy8G71W5dYvgpAlx6
|
||||
mdnHyzxEGvRYNNI2bS0ifXgbEFNWqSas9q34ea5KOpkJu8T/KyXfSb6rPOsBSb0t
|
||||
wMowwGtCVH2C4Lw/8zo0EjhMpTOsPaub408PrZ+NQ2bl
|
||||
-----END CERTIFICATE-----
|
||||
34
certs/eng3.pem
Normal file
34
certs/eng3.pem
Normal file
@@ -0,0 +1,34 @@
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIF3TCCA8WgAwIBAgIBADANBgkqhkiG9w0BAQUFADCBqDELMAkGA1UEBhMCQ0Ex
|
||||
CzAJBgNVBAgTAk9OMRAwDgYDVQQHEwdUb3JvbnRvMRgwFgYDVQQKEw9Gb3J0RW5n
|
||||
aW5lIEluYy4xKTAnBgNVBAsTIENlcnRpZmljYXRpb24gQXV0aG9yaXR5IERpdmlz
|
||||
aW9uMRMwEQYDVQQDEwpmb3J0ZW5naW5lMSAwHgYJKoZIhvcNAQkBFhFjYUBmb3J0
|
||||
ZW5naW5lLmNvbTAeFw05ODAxMDEwMDAwMDBaFw0zODAxMTcwMDAwMDBaMIGoMQsw
|
||||
CQYDVQQGEwJDQTELMAkGA1UECBMCT04xEDAOBgNVBAcTB1Rvcm9udG8xGDAWBgNV
|
||||
BAoTD0ZvcnRFbmdpbmUgSW5jLjEpMCcGA1UECxMgQ2VydGlmaWNhdGlvbiBBdXRo
|
||||
b3JpdHkgRGl2aXNpb24xEzARBgNVBAMTCmZvcnRlbmdpbmUxIDAeBgkqhkiG9w0B
|
||||
CQEWEWNhQGZvcnRlbmdpbmUuY29tMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIIC
|
||||
CgKCAgEAyr7GbpwDxx1v3EYbo0gcO+ligEhlDqG2e7u/AbWGoVAqc8+q6auUJUtz
|
||||
4i7oh0yNadu1o9kpXW+znkgO0zlrgjGskqqMO1ooppzTJdFy/P8gR6x1Iuv3kWtX
|
||||
OuzwPPEjv09LWlhyJsN+oU4ztTVf07I0Q9zYupcoDQ58XKRheI9KdDB2DYSmxywA
|
||||
WSLQwIeG0Qa7gvokeQlpkgkEC7viEecJ3752KXBJHnh7As51mxnlpmG6sDy67Eli
|
||||
HDw5tHETRqbtnscGBjskGQBqR5xt7+QnnthZrN8HJHDoa9zgGephwizhkL44lXLF
|
||||
YK9W5XhFbblw2c+mAcHkokRiwD7CPeIoyD2a/Jcw3n5hegKTlNhd4BFGVF6JR7gF
|
||||
OFk2QfHXit5uthsij9Xhl7WAgQUqLgggD9MphqPf4nY66OZUJV9ZsmB+Qfp8UizB
|
||||
0WAOegactKVyRqHtRa+KIEXQXNtZgjcmMk9CYkP0nIbKtgKXaH6+9VMHNOryCnFE
|
||||
7pSsuPUkypncFWCHGSeiFO3w4w4J4csltxBADQzxfRu5KZnlToQN7bVpI/Q31tVX
|
||||
E5bjrJcq6Oj/OTqZ3ID+OqbkUdAg0ggjRKcTgxnLHd/AbMzJ6PsclDDf7cLs0WSl
|
||||
xMxQR/z5bNST1rNtT9rsiv2TOhfvCBxO9AOjBioO8PLO032HTNECAwEAAaMQMA4w
|
||||
DAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQUFAAOCAgEAVyBpPWfT2VOyvVpslGKx
|
||||
8h0+CWP8cilygGRtZJ5dAJzc//1REAHdvK+TgZ4Foz3dqHhXI+RNN0FpzuWaYMjW
|
||||
ZTS0kAmcOQuGY1Oo4PGlPHI21pNz29oFDTJr0ZmLBJ4JKVsE2soJg55jdk9MZHA7
|
||||
K//7HH9RsmrWZOE5DZDlrxp6+naixhMwnlPKKisIy9GNZUPqGdUWABMdB/BUVVNl
|
||||
NU5TtWpIXUClMd8a+eoKcItBeYXowkHOBpinPkDX3clFDIUfWiw0Ro08s8SrrFqR
|
||||
8Szwbrj52Xv1RM56oGqCjnkvJctxihODV7NcpxoAFjIZokDom0q6zPrrTUsLFQov
|
||||
Plovc3w5hmALiDMshaTvE1nm3Psn4yQ+FlRE8epTZrQiIGypZkZC6lcz0mYawueW
|
||||
cThYWGFhVG4ktQzOjjNRsNxopW+W7cF1zQTxiWUDnxIKSj7gtdQ2jiubxEEhfVag
|
||||
r8DMtAccNVTZVURpGi56TptOOuotrTqqC+2GviW4hlxvdvmuQN0OlXlUwzz2Trxc
|
||||
FamNnuA54lZw/8arLtxsFmHrcnPw53+1spumLD0S5UkxHNu40h6LIVpZz3H+0rLz
|
||||
uFofTfiyMjcfK2AyHQTgUCbsrvgNuLDQUbyFGVchdFUkhztX3DhEVnxnnrpY4BVj
|
||||
QdTqWIvw7lGlSuDCjxEQAOc=
|
||||
-----END CERTIFICATE-----
|
||||
23
certs/eng4.pem
Normal file
23
certs/eng4.pem
Normal file
@@ -0,0 +1,23 @@
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIID3TCCAsWgAwIBAgIBADANBgkqhkiG9w0BAQUFADCBqDELMAkGA1UEBhMCQ0Ex
|
||||
CzAJBgNVBAgTAk9OMRAwDgYDVQQHEwdUb3JvbnRvMRgwFgYDVQQKEw9NYWlsRW5n
|
||||
aW5lIEluYy4xKTAnBgNVBAsTIENlcnRpZmljYXRpb24gQXV0aG9yaXR5IERpdmlz
|
||||
aW9uMRMwEQYDVQQDEwptYWlsZW5naW5lMSAwHgYJKoZIhvcNAQkBFhFjYUBtYWls
|
||||
ZW5naW5lLmNvbTAeFw05ODAxMDEwMDAwMDBaFw0zODAxMTcwMDAwMDBaMIGoMQsw
|
||||
CQYDVQQGEwJDQTELMAkGA1UECBMCT04xEDAOBgNVBAcTB1Rvcm9udG8xGDAWBgNV
|
||||
BAoTD01haWxFbmdpbmUgSW5jLjEpMCcGA1UECxMgQ2VydGlmaWNhdGlvbiBBdXRo
|
||||
b3JpdHkgRGl2aXNpb24xEzARBgNVBAMTCm1haWxlbmdpbmUxIDAeBgkqhkiG9w0B
|
||||
CQEWEWNhQG1haWxlbmdpbmUuY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB
|
||||
CgKCAQEAqXmfsU+lx+NFmn6tN17RTOyaddHqLnr/3rzEDIyT9TN+tF9TG7jmK7lJ
|
||||
Jrj5arQ3nTFaLF8JuND2U1z/cLPw6/TX+1tE3v3CNUDSjaisyUDiUyp3TE8hMMMz
|
||||
zfZQn0JsGgNhhWxqyzjhRQGtKL4+xtn8VsF/8zGgZYke7nlmVKz/FslDFTnNoodL
|
||||
BAEGiu9JQS9qqpbSs20NdZ6LXPL2A4iTjnsNFBW3jIMVIn/JVVyaycU7ue2oFviD
|
||||
vLNpkVZcR7A+jjIdIumOc5VSF0y7y74cQC5YwkR2mLK7UBYDK6NCY3ta/C4M8NsM
|
||||
0FpmvRl0+A1ivZtVwqI98dxDtp7HeQIDAQABoxAwDjAMBgNVHRMEBTADAQH/MA0G
|
||||
CSqGSIb3DQEBBQUAA4IBAQAjfNn5BCzxylBDakFQGWKE/P43PRibMOEzfd7+DzbY
|
||||
WIekoz3i00DwoH3b6j4gwlDJRAOq4dF6/Pt/uBOHDo/op+ef+9ErmKPd+ehXN9h3
|
||||
7QbccTgz7DtVwA4iRlDRLru+JuXzT+OsCHuFZMOLJ+KD2JAGh3W68JjdcLkrlcpt
|
||||
AU0wc5aOHPPfEBdIah8y8QtNzXRVzoBt8zzvgCARkXxTS2u/9QaXR1hML0JtDgQS
|
||||
SdZ6Kd8SN6yzqxD+buYD5sOfJmjBF/n3lqFHNMHnnGXy2TAXZtIAWzffU3A0cGPB
|
||||
N6FZ026a86HbF1X4k+xszhbJu/ikczyuWnCJIg3fTYSD
|
||||
-----END CERTIFICATE-----
|
||||
23
certs/eng5.pem
Normal file
23
certs/eng5.pem
Normal file
@@ -0,0 +1,23 @@
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIID6TCCAtGgAwIBAgIBADANBgkqhkiG9w0BAQUFADCBrjELMAkGA1UEBhMCQ0Ex
|
||||
CzAJBgNVBAgTAk9OMRAwDgYDVQQHEwdUb3JvbnRvMRowGAYDVQQKExFUcmFkZXJF
|
||||
bmdpbmUgSW5jLjEpMCcGA1UECxMgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgRGl2
|
||||
aXNpb24xFTATBgNVBAMTDHRyYWRlcmVuZ2luZTEiMCAGCSqGSIb3DQEJARYTY2FA
|
||||
dHJhZGVyZW5naW5lLmNvbTAeFw05ODAxMDEwMDAwMDBaFw0zODAxMTcwMDAwMDBa
|
||||
MIGuMQswCQYDVQQGEwJDQTELMAkGA1UECBMCT04xEDAOBgNVBAcTB1Rvcm9udG8x
|
||||
GjAYBgNVBAoTEVRyYWRlckVuZ2luZSBJbmMuMSkwJwYDVQQLEyBDZXJ0aWZpY2F0
|
||||
aW9uIEF1dGhvcml0eSBEaXZpc2lvbjEVMBMGA1UEAxMMdHJhZGVyZW5naW5lMSIw
|
||||
IAYJKoZIhvcNAQkBFhNjYUB0cmFkZXJlbmdpbmUuY29tMIIBIjANBgkqhkiG9w0B
|
||||
AQEFAAOCAQ8AMIIBCgKCAQEAzyX5QE+5SN+zgNn1v3zp9HmP4hQOWW8WuEVItZVP
|
||||
9bt/xj5NeJd1kyPL/SqnF2qHcL3o/74r0Ga55aKHniwKYgQTlp5ELGfQ568QQeN9
|
||||
xNIHtUXeStI9zCNZyZC+4YqObdMR/ivKA/WsLfUVMl2lV5JzJJz1BOE0gKEYiEyz
|
||||
gIq5oLzkP/mOXoHRvWSZD2D0eHYIO7ovV2epVFK7g7p+dC4QoeIUEli+GF/Myg88
|
||||
dV/qmi+Sybck2RLPXa8Nh27/ETVQ7kE1Eafmx7EyCqIhG+5lwJAy3HwHUBwAYuzj
|
||||
iuZz5lD8aQmr8SKuvy3eOH9SVN5wh3YBlrNGwTStkESVLwIDAQABoxAwDjAMBgNV
|
||||
HRMEBTADAQH/MA0GCSqGSIb3DQEBBQUAA4IBAQAWOPAUhZd3x9EQiFJcuxFTMd9q
|
||||
axgcriCzJsM6D96sYGko9xTeLhX/lr1bliVYI5AlupoLXAdMzGHJkOgaTirKjQXr
|
||||
F9nymDdUWKe3TmwGob5016nQlH7qRKvGO3hka0rOGRK2U/2JT/4Qp8iH/DFi6cyM
|
||||
uP0q8n64SAkxZXLzUuFQXqf7U/SNjzb9XJQEIAdjp7eYd3Qb4jDsDcX0FrKMF1aV
|
||||
r0dCDnS7am7WTXPYCDGdSkPgEHEtLYIYH3lZp5sKdVZ9wl4F0WNFkRWRUr7AXPjw
|
||||
50uLmUNmKCd8JZLMGA1TRNSTi7U9EcrWt0OkMWm74T2WVnAgNsDv2WrWsGfj
|
||||
-----END CERTIFICATE-----
|
||||
18
certs/expired/vsign3.pem
Normal file
18
certs/expired/vsign3.pem
Normal file
@@ -0,0 +1,18 @@
|
||||
subject=/C=US/O=VeriSign, Inc./OU=Class 3 Public Primary Certification Authority
|
||||
notBefore=Jan 29 00:00:00 1996 GMT
|
||||
notAfter=Jan 7 23:59:59 2004 GMT
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIICPTCCAaYCEQDknv3zOugOz6URPhmkJAIyMA0GCSqGSIb3DQEBAgUAMF8xCzAJ
|
||||
BgNVBAYTAlVTMRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE3MDUGA1UECxMuQ2xh
|
||||
c3MgMyBQdWJsaWMgUHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw05
|
||||
NjAxMjkwMDAwMDBaFw0wNDAxMDcyMzU5NTlaMF8xCzAJBgNVBAYTAlVTMRcwFQYD
|
||||
VQQKEw5WZXJpU2lnbiwgSW5jLjE3MDUGA1UECxMuQ2xhc3MgMyBQdWJsaWMgUHJp
|
||||
bWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTCBnzANBgkqhkiG9w0BAQEFAAOB
|
||||
jQAwgYkCgYEAyVxZnvIbigEUtBDfBEDb41evakVAj4QMC9Ez2dkRz+4CWB8l9yqo
|
||||
RAWq7AMfeH+ek7maAKojfdashaJjRcdyJ8z0TMZ1cdI5709C8HXfCpDGjiBvmA/4
|
||||
rCNfcCk2pMmG57GaIMtTpYXnPb59mv4kRTPcdhXtD6JxZExlLoFoRacCAwEAATAN
|
||||
BgkqhkiG9w0BAQIFAAOBgQBhcOwvP579K+ZoVCGwZ3kIDCCWMYoNer62Jt95LCJp
|
||||
STbjl3diYaIy13pUITa6Ask05yXaRDWw0lyAXbOU+Pms7qRgdSoflUkjsUp89LNH
|
||||
ciFbfperVKxi513srpvSybIk+4Kt6WcVS7qqpvCXoPawl1cAyAw8CaCCBLpB2veZ
|
||||
pA==
|
||||
-----END CERTIFICATE-----
|
||||
@@ -1,18 +1,17 @@
|
||||
subject=/C=US/O=VeriSign, Inc./OU=Class 3 Public Primary Certification Authority
|
||||
notBefore=Jan 29 00:00:00 1996 GMT
|
||||
notAfter=Jan 7 23:59:59 2004 GMT
|
||||
notAfter=Aug 1 23:59:59 2028 GMT
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIICPTCCAaYCEQDknv3zOugOz6URPhmkJAIyMA0GCSqGSIb3DQEBAgUAMF8xCzAJ
|
||||
BgNVBAYTAlVTMRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE3MDUGA1UECxMuQ2xh
|
||||
c3MgMyBQdWJsaWMgUHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw05
|
||||
NjAxMjkwMDAwMDBaFw0wNDAxMDcyMzU5NTlaMF8xCzAJBgNVBAYTAlVTMRcwFQYD
|
||||
VQQKEw5WZXJpU2lnbiwgSW5jLjE3MDUGA1UECxMuQ2xhc3MgMyBQdWJsaWMgUHJp
|
||||
bWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTCBnzANBgkqhkiG9w0BAQEFAAOB
|
||||
jQAwgYkCgYEAyVxZnvIbigEUtBDfBEDb41evakVAj4QMC9Ez2dkRz+4CWB8l9yqo
|
||||
RAWq7AMfeH+ek7maAKojfdashaJjRcdyJ8z0TMZ1cdI5709C8HXfCpDGjiBvmA/4
|
||||
rCNfcCk2pMmG57GaIMtTpYXnPb59mv4kRTPcdhXtD6JxZExlLoFoRacCAwEAATAN
|
||||
BgkqhkiG9w0BAQIFAAOBgQBhcOwvP579K+ZoVCGwZ3kIDCCWMYoNer62Jt95LCJp
|
||||
STbjl3diYaIy13pUITa6Ask05yXaRDWw0lyAXbOU+Pms7qRgdSoflUkjsUp89LNH
|
||||
ciFbfperVKxi513srpvSybIk+4Kt6WcVS7qqpvCXoPawl1cAyAw8CaCCBLpB2veZ
|
||||
pA==
|
||||
MIICPDCCAaUCEHC65B0Q2Sk0tjjKewPMur8wDQYJKoZIhvcNAQECBQAwXzELMAkG
|
||||
A1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFz
|
||||
cyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTk2
|
||||
MDEyOTAwMDAwMFoXDTI4MDgwMTIzNTk1OVowXzELMAkGA1UEBhMCVVMxFzAVBgNV
|
||||
BAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAzIFB1YmxpYyBQcmlt
|
||||
YXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGfMA0GCSqGSIb3DQEBAQUAA4GN
|
||||
ADCBiQKBgQDJXFme8huKARS0EN8EQNvjV69qRUCPhAwL0TPZ2RHP7gJYHyX3KqhE
|
||||
BarsAx94f56TuZoAqiN91qyFomNFx3InzPRMxnVx0jnvT0Lwdd8KkMaOIG+YD/is
|
||||
I19wKTakyYbnsZogy1Olhec9vn2a/iRFM9x2Fe0PonFkTGUugWhFpwIDAQABMA0G
|
||||
CSqGSIb3DQEBAgUAA4GBALtMEivPLCYATxQT3ab7/AoRhIzzKBxnki98tsX63/Do
|
||||
lbwdj2wsqFHMc9ikwFPwTtYmwHYBV4GSXiHx0bH/59AhWM1pF+NEHJwZRDmJXNyc
|
||||
AA9WjQKZ7aKQRUzkuxCkPfAyAw7xzvjoyVGM5mKf5p/AfbdynMk2OmufTqj/ZA1k
|
||||
-----END CERTIFICATE-----
|
||||
|
||||
13
config
13
config
@@ -134,7 +134,7 @@ case "${SYSTEM}:${RELEASE}:${VERSION}:${MACHINE}" in
|
||||
HPUXVER=`echo ${RELEASE}|sed -e 's/[^.]*.[0B]*//'`
|
||||
case "$HPUXVER" in
|
||||
1[0-9].*) # HPUX 10 and 11 targets are unified
|
||||
echo "${MACHINE}-hp-hpux10"; exit 0
|
||||
echo "${MACHINE}-hp-hpux1x"; exit 0
|
||||
;;
|
||||
*)
|
||||
echo "${MACHINE}-hp-hpux"; exit 0
|
||||
@@ -410,9 +410,10 @@ if [ "$SYSTEM" = "HP-UX" ];then
|
||||
GCC_BITS="32"
|
||||
if [ $GCCVER -ge 30 ]; then
|
||||
# PA64 support only came in with gcc 3.0.x.
|
||||
# We look for the preprocessor symbol __LP64__ indicating
|
||||
# 64bit bit long and pointer. sizeof(int) == 32 on HPUX64.
|
||||
if gcc -v -E -x c /dev/null 2>&1 | grep __LP64__ > /dev/null; then
|
||||
# We check if the preprocessor symbol __LP64__ is defined...
|
||||
if echo "__LP64__" | gcc -v -E -x c - 2>/dev/null | grep "^__LP64__" 2>&1 > /dev/null; then
|
||||
: # __LP64__ has slipped through, it therefore is not defined
|
||||
else
|
||||
GCC_BITS="64"
|
||||
fi
|
||||
fi
|
||||
@@ -685,7 +686,7 @@ EOF
|
||||
if [ $CC = "gcc" ];
|
||||
then
|
||||
if [ $GCC_BITS = "64" ]; then
|
||||
OUT="hpux64-parisc-gcc"
|
||||
OUT="hpux64-parisc2-gcc"
|
||||
else
|
||||
OUT="hpux-parisc-gcc"
|
||||
fi
|
||||
@@ -700,7 +701,7 @@ EOF
|
||||
if [ $CPU_VERSION -ge 768 ]; then # IA-64 CPU
|
||||
echo "WARNING! 64-bit ABI is the default configured ABI on HP-UXi."
|
||||
echo " If you wish to build 32-bit library, the you have to"
|
||||
echo " invoke './Configure hpux-ia32-cc' *manually*."
|
||||
echo " invoke './Configure hpux-ia64-cc' *manually*."
|
||||
if [ "$TEST" = "false" ]; then
|
||||
echo " You have about 5 seconds to press Ctrl-C to abort."
|
||||
(stty -icanon min 0 time 50; read waste) < /dev/tty
|
||||
|
||||
@@ -11,10 +11,9 @@ CFLAG= -g
|
||||
INSTALL_PREFIX=
|
||||
OPENSSLDIR= /usr/local/ssl
|
||||
INSTALLTOP= /usr/local/ssl
|
||||
MAKE= make -f Makefile.ssl
|
||||
MAKEDEPPROG= makedepend
|
||||
MAKEDEPEND= $(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG)
|
||||
MAKEFILE= Makefile.ssl
|
||||
MAKEFILE= Makefile
|
||||
RM= rm -f
|
||||
AR= ar r
|
||||
|
||||
@@ -50,11 +49,11 @@ ALL= $(GENERAL) $(SRC) $(HEADER)
|
||||
top:
|
||||
@(cd ..; $(MAKE) DIRS=$(DIR) all)
|
||||
|
||||
all: buildinf.h lib subdirs shared
|
||||
all: shared
|
||||
|
||||
buildinf.h: ../Makefile.ssl
|
||||
buildinf.h: ../Makefile
|
||||
( echo "#ifndef MK1MF_BUILD"; \
|
||||
echo ' /* auto-generated by crypto/Makefile.ssl for crypto/cversion.c */'; \
|
||||
echo ' /* auto-generated by crypto/Makefile for crypto/cversion.c */'; \
|
||||
echo ' #define CFLAGS "$(CC) $(CFLAG)"'; \
|
||||
echo ' #define PLATFORM "$(PLATFORM)"'; \
|
||||
echo " #define DATE \"`LC_ALL=C LC_TIME=C date`\""; \
|
||||
@@ -73,7 +72,7 @@ subdirs:
|
||||
done;
|
||||
|
||||
files:
|
||||
$(PERL) $(TOP)/util/files.pl Makefile.ssl >> $(TOP)/MINFO
|
||||
$(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO
|
||||
@for i in $(SDIRS) ;\
|
||||
do \
|
||||
(cd $$i && echo "making 'files' in crypto/$$i..." && \
|
||||
@@ -81,11 +80,9 @@ files:
|
||||
done;
|
||||
|
||||
links:
|
||||
@$(TOP)/util/point.sh Makefile.ssl Makefile
|
||||
@$(PERL) $(TOP)/util/mklink.pl ../include/openssl $(EXHEADER)
|
||||
@$(PERL) $(TOP)/util/mklink.pl ../test $(TEST)
|
||||
@$(PERL) $(TOP)/util/mklink.pl ../apps $(APPS)
|
||||
@$(TOP)/util/point.sh Makefile.ssl Makefile
|
||||
@for i in $(SDIRS); do \
|
||||
(cd $$i && echo "making links in crypto/$$i..." && \
|
||||
$(MAKE) CC='$(CC)' INCLUDES='${INCLUDES}' CFLAG='${CFLAG}' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' BN_ASM='${BN_ASM}' DES_ENC='${DES_ENC}' SHA1_ASM_OBJ='${SHA1_ASM_OBJ}' MD5_ASM_OBJ='${MD5_ASM_OBJ}' RMD160_ASM_OBJ='${RMD160_ASM_OBJ}' BF_ENC='${BF_ENC}' CAST_ENC='${CAST_ENC}' RC4_ENC='${RC4_ENC}' RC5_ENC='${RC5_ENC}' AR='${AR}' PERL='${PERL}' links ); \
|
||||
@@ -96,7 +93,7 @@ lib: $(LIBOBJ)
|
||||
$(RANLIB) $(LIB) || echo Never mind.
|
||||
@touch lib
|
||||
|
||||
shared:
|
||||
shared: buildinf.h lib subdirs
|
||||
if [ -n "$(SHARED_LIBS)" ]; then \
|
||||
(cd ..; $(MAKE) $(SHARED_LIB)); \
|
||||
fi
|
||||
@@ -11,10 +11,9 @@ CFLAG=-g
|
||||
INSTALL_PREFIX=
|
||||
OPENSSLDIR= /usr/local/ssl
|
||||
INSTALLTOP= /usr/local/ssl
|
||||
MAKE= make -f Makefile.ssl
|
||||
MAKEDEPPROG= makedepend
|
||||
MAKEDEPEND= $(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG)
|
||||
MAKEFILE= Makefile.ssl
|
||||
MAKEFILE= Makefile
|
||||
AR= ar r
|
||||
|
||||
# CFLAGS= -mpentiumpro $(INCLUDES) $(CFLAG) -O3 -fexpensive-optimizations -funroll-loops -fforce-addr
|
||||
@@ -49,10 +48,9 @@ lib: $(LIBOBJ)
|
||||
$(LIBOBJ): $(LIBSRC)
|
||||
|
||||
files:
|
||||
$(PERL) $(TOP)/util/files.pl Makefile.ssl >> $(TOP)/MINFO
|
||||
$(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO
|
||||
|
||||
links:
|
||||
@$(TOP)/util/point.sh Makefile.ssl Makefile
|
||||
@$(PERL) $(TOP)/util/mklink.pl ../../include/openssl $(EXHEADER)
|
||||
@$(PERL) $(TOP)/util/mklink.pl ../../test $(TEST)
|
||||
@$(PERL) $(TOP)/util/mklink.pl ../../apps $(APPS)
|
||||
@@ -104,7 +104,7 @@ void AES_cbc_encrypt(const unsigned char *in, unsigned char *out,
|
||||
memcpy(tmp, in, AES_BLOCK_SIZE);
|
||||
AES_decrypt(tmp, tmp, key);
|
||||
for(n=0; n < len; ++n)
|
||||
out[n] ^= ivec[n];
|
||||
out[n] = tmp[n] ^ ivec[n];
|
||||
memcpy(ivec, tmp, AES_BLOCK_SIZE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,10 +10,9 @@ CFLAG=-g
|
||||
INSTALL_PREFIX=
|
||||
OPENSSLDIR= /usr/local/ssl
|
||||
INSTALLTOP=/usr/local/ssl
|
||||
MAKE= make -f Makefile.ssl
|
||||
MAKEDEPPROG= makedepend
|
||||
MAKEDEPEND= $(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG)
|
||||
MAKEFILE= Makefile.ssl
|
||||
MAKEFILE= Makefile
|
||||
AR= ar r
|
||||
|
||||
CFLAGS= $(INCLUDES) $(CFLAG)
|
||||
@@ -74,10 +73,9 @@ lib: $(LIBOBJ)
|
||||
@touch lib
|
||||
|
||||
files:
|
||||
$(PERL) $(TOP)/util/files.pl Makefile.ssl >> $(TOP)/MINFO
|
||||
$(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO
|
||||
|
||||
links:
|
||||
@$(TOP)/util/point.sh Makefile.ssl Makefile
|
||||
@$(PERL) $(TOP)/util/mklink.pl ../../include/openssl $(EXHEADER)
|
||||
@$(PERL) $(TOP)/util/mklink.pl ../../test $(TEST)
|
||||
@$(PERL) $(TOP)/util/mklink.pl ../../apps $(APPS)
|
||||
@@ -208,6 +208,7 @@ ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_set(ASN1_GENERALIZEDTIME *s,
|
||||
char *p;
|
||||
struct tm *ts;
|
||||
struct tm data;
|
||||
size_t len = 20;
|
||||
|
||||
if (s == NULL)
|
||||
s=M_ASN1_GENERALIZEDTIME_new();
|
||||
@@ -219,17 +220,17 @@ ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_set(ASN1_GENERALIZEDTIME *s,
|
||||
return(NULL);
|
||||
|
||||
p=(char *)s->data;
|
||||
if ((p == NULL) || (s->length < 16))
|
||||
if ((p == NULL) || ((size_t)s->length < len))
|
||||
{
|
||||
p=OPENSSL_malloc(20);
|
||||
p=OPENSSL_malloc(len);
|
||||
if (p == NULL) return(NULL);
|
||||
if (s->data != NULL)
|
||||
OPENSSL_free(s->data);
|
||||
s->data=(unsigned char *)p;
|
||||
}
|
||||
|
||||
sprintf(p,"%04d%02d%02d%02d%02d%02dZ",ts->tm_year + 1900,
|
||||
ts->tm_mon+1,ts->tm_mday,ts->tm_hour,ts->tm_min,ts->tm_sec);
|
||||
BIO_snprintf(p,len,"%04d%02d%02d%02d%02d%02dZ",ts->tm_year + 1900,
|
||||
ts->tm_mon+1,ts->tm_mday,ts->tm_hour,ts->tm_min,ts->tm_sec);
|
||||
s->length=strlen(p);
|
||||
s->type=V_ASN1_GENERALIZEDTIME;
|
||||
#ifdef CHARSET_EBCDIC_not
|
||||
|
||||
@@ -145,14 +145,14 @@ int ASN1_mbstring_ncopy(ASN1_STRING **out, const unsigned char *in, int len,
|
||||
|
||||
if((minsize > 0) && (nchar < minsize)) {
|
||||
ASN1err(ASN1_F_ASN1_MBSTRING_COPY, ASN1_R_STRING_TOO_SHORT);
|
||||
sprintf(strbuf, "%ld", minsize);
|
||||
BIO_snprintf(strbuf, sizeof strbuf, "%ld", minsize);
|
||||
ERR_add_error_data(2, "minsize=", strbuf);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if((maxsize > 0) && (nchar > maxsize)) {
|
||||
ASN1err(ASN1_F_ASN1_MBSTRING_COPY, ASN1_R_STRING_TOO_LONG);
|
||||
sprintf(strbuf, "%ld", maxsize);
|
||||
BIO_snprintf(strbuf, sizeof strbuf, "%ld", maxsize);
|
||||
ERR_add_error_data(2, "maxsize=", strbuf);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -285,7 +285,7 @@ const static signed char tag2nbyte[] = {
|
||||
-1, -1, 0, -1, /* 10-13 */
|
||||
-1, -1, -1, -1, /* 15-17 */
|
||||
-1, 1, 1, /* 18-20 */
|
||||
-1, 1, -1,-1, /* 21-24 */
|
||||
-1, 1, 1, 1, /* 21-24 */
|
||||
-1, 1, -1, /* 25-27 */
|
||||
4, -1, 2 /* 28-30 */
|
||||
};
|
||||
|
||||
@@ -129,6 +129,7 @@ ASN1_GENERALIZEDTIME *ASN1_TIME_to_generalizedtime(const ASN1_TIME *t,
|
||||
{
|
||||
ASN1_GENERALIZEDTIME *ret;
|
||||
char *str;
|
||||
int newlen;
|
||||
|
||||
if (!ASN1_TIME_check(t)) return NULL;
|
||||
|
||||
@@ -151,12 +152,14 @@ ASN1_GENERALIZEDTIME *ASN1_TIME_to_generalizedtime(const ASN1_TIME *t,
|
||||
/* grow the string */
|
||||
if (!ASN1_STRING_set(ret, NULL, t->length + 2))
|
||||
return NULL;
|
||||
/* ASN1_STRING_set() allocated 'len + 1' bytes. */
|
||||
newlen = t->length + 2 + 1;
|
||||
str = (char *)ret->data;
|
||||
/* Work out the century and prepend */
|
||||
if (t->data[0] >= '5') strcpy(str, "19");
|
||||
else strcpy(str, "20");
|
||||
if (t->data[0] >= '5') BUF_strlcpy(str, "19", newlen);
|
||||
else BUF_strlcpy(str, "20", newlen);
|
||||
|
||||
BUF_strlcat(str, (char *)t->data, t->length+3); /* Include space for a '\0' */
|
||||
BUF_strlcat(str, (char *)t->data, newlen);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -188,6 +188,7 @@ ASN1_UTCTIME *ASN1_UTCTIME_set(ASN1_UTCTIME *s, time_t t)
|
||||
char *p;
|
||||
struct tm *ts;
|
||||
struct tm data;
|
||||
size_t len = 20;
|
||||
|
||||
if (s == NULL)
|
||||
s=M_ASN1_UTCTIME_new();
|
||||
@@ -199,17 +200,17 @@ ASN1_UTCTIME *ASN1_UTCTIME_set(ASN1_UTCTIME *s, time_t t)
|
||||
return(NULL);
|
||||
|
||||
p=(char *)s->data;
|
||||
if ((p == NULL) || (s->length < 14))
|
||||
if ((p == NULL) || ((size_t)s->length < len))
|
||||
{
|
||||
p=OPENSSL_malloc(20);
|
||||
p=OPENSSL_malloc(len);
|
||||
if (p == NULL) return(NULL);
|
||||
if (s->data != NULL)
|
||||
OPENSSL_free(s->data);
|
||||
s->data=(unsigned char *)p;
|
||||
}
|
||||
|
||||
sprintf(p,"%02d%02d%02d%02d%02d%02dZ",ts->tm_year%100,
|
||||
ts->tm_mon+1,ts->tm_mday,ts->tm_hour,ts->tm_min,ts->tm_sec);
|
||||
BIO_snprintf(p,len,"%02d%02d%02d%02d%02d%02dZ",ts->tm_year%100,
|
||||
ts->tm_mon+1,ts->tm_mday,ts->tm_hour,ts->tm_min,ts->tm_sec);
|
||||
s->length=strlen(p);
|
||||
s->type=V_ASN1_UTCTIME;
|
||||
#ifdef CHARSET_EBCDIC_not
|
||||
|
||||
@@ -414,8 +414,8 @@ void asn1_add_error(unsigned char *address, int offset)
|
||||
{
|
||||
char buf1[DECIMAL_SIZE(address)+1],buf2[DECIMAL_SIZE(offset)+1];
|
||||
|
||||
sprintf(buf1,"%lu",(unsigned long)address);
|
||||
sprintf(buf2,"%d",offset);
|
||||
BIO_snprintf(buf1,sizeof buf1,"%lu",(unsigned long)address);
|
||||
BIO_snprintf(buf2,sizeof buf2,"%d",offset);
|
||||
ERR_add_error_data(4,"address=",buf1," offset=",buf2);
|
||||
}
|
||||
|
||||
|
||||
@@ -83,11 +83,11 @@ static int asn1_print_info(BIO *bp, int tag, int xclass, int constructed,
|
||||
|
||||
p=str;
|
||||
if ((xclass & V_ASN1_PRIVATE) == V_ASN1_PRIVATE)
|
||||
sprintf(str,"priv [ %d ] ",tag);
|
||||
BIO_snprintf(str,sizeof str,"priv [ %d ] ",tag);
|
||||
else if ((xclass & V_ASN1_CONTEXT_SPECIFIC) == V_ASN1_CONTEXT_SPECIFIC)
|
||||
sprintf(str,"cont [ %d ]",tag);
|
||||
BIO_snprintf(str,sizeof str,"cont [ %d ]",tag);
|
||||
else if ((xclass & V_ASN1_APPLICATION) == V_ASN1_APPLICATION)
|
||||
sprintf(str,"appl [ %d ]",tag);
|
||||
BIO_snprintf(str,sizeof str,"appl [ %d ]",tag);
|
||||
else p = ASN1_tag2str(tag);
|
||||
|
||||
if (p2 != NULL)
|
||||
|
||||
@@ -87,9 +87,14 @@ static int oid_module_init(CONF_IMODULE *md, const CONF *cnf)
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
static void oid_module_finish(CONF_IMODULE *md)
|
||||
{
|
||||
OBJ_cleanup();
|
||||
}
|
||||
|
||||
void ASN1_add_oid_module(void)
|
||||
{
|
||||
CONF_module_add("oid_section", oid_module_init, 0);
|
||||
CONF_module_add("oid_section", oid_module_init, oid_module_finish);
|
||||
}
|
||||
|
||||
@@ -1,80 +0,0 @@
|
||||
/* crypto/asn1/f.c */
|
||||
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
|
||||
* All rights reserved.
|
||||
*
|
||||
* This package is an SSL implementation written
|
||||
* by Eric Young (eay@cryptsoft.com).
|
||||
* The implementation was written so as to conform with Netscapes SSL.
|
||||
*
|
||||
* This library is free for commercial and non-commercial use as long as
|
||||
* the following conditions are aheared to. The following conditions
|
||||
* apply to all code found in this distribution, be it the RC4, RSA,
|
||||
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
|
||||
* included with this distribution is covered by the same copyright terms
|
||||
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
|
||||
*
|
||||
* Copyright remains Eric Young's, and as such any Copyright notices in
|
||||
* the code are not to be removed.
|
||||
* If this package is used in a product, Eric Young should be given attribution
|
||||
* as the author of the parts of the library used.
|
||||
* This can be in the form of a textual message at program startup or
|
||||
* in documentation (online or textual) provided with the package.
|
||||
*
|
||||
* 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 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 acknowledgement:
|
||||
* "This product includes cryptographic software written by
|
||||
* Eric Young (eay@cryptsoft.com)"
|
||||
* The word 'cryptographic' can be left out if the rouines from the library
|
||||
* being used are not cryptographic related :-).
|
||||
* 4. If you include any Windows specific code (or a derivative thereof) from
|
||||
* the apps directory (application code) you must include an acknowledgement:
|
||||
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
|
||||
* ANY EXPRESS 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 AUTHOR OR 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.
|
||||
*
|
||||
* The licence and distribution terms for any publically available version or
|
||||
* derivative of this code cannot be changed. i.e. this code cannot simply be
|
||||
* copied and put under another distribution licence
|
||||
* [including the GNU Public Licence.]
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <openssl/asn1.h>
|
||||
#include <openssl/err.h>
|
||||
|
||||
main()
|
||||
{
|
||||
ASN1_TYPE *at;
|
||||
char buf[512];
|
||||
int n;
|
||||
long l;
|
||||
|
||||
at=ASN1_TYPE_new();
|
||||
|
||||
n=ASN1_TYPE_set_int_octetstring(at,98736,"01234567",8);
|
||||
printf("%d\n",n);
|
||||
n=ASN1_TYPE_get_int_octetstring(at,&l,buf,8);
|
||||
buf[8]='\0';
|
||||
printf("%ld %d %d\n",l,n,buf[8]);
|
||||
buf[8]='\0';
|
||||
printf("%s\n",buf);
|
||||
ERR_load_crypto_strings();
|
||||
ERR_print_errors_fp(stderr);
|
||||
}
|
||||
@@ -139,9 +139,9 @@ int RSA_print(BIO *bp, const RSA *x, int off)
|
||||
}
|
||||
|
||||
if (x->d == NULL)
|
||||
sprintf(str,"Modulus (%d bit):",BN_num_bits(x->n));
|
||||
BIO_snprintf(str,sizeof str,"Modulus (%d bit):",BN_num_bits(x->n));
|
||||
else
|
||||
strcpy(str,"modulus:");
|
||||
BUF_strlcpy(str,"modulus:",sizeof str);
|
||||
if (!print(bp,str,x->n,m,off)) goto err;
|
||||
s=(x->d == NULL)?"Exponent:":"publicExponent:";
|
||||
if (!print(bp,s,x->e,m,off)) goto err;
|
||||
|
||||
@@ -1,201 +0,0 @@
|
||||
/* crypto/asn1/x_cinf.c */
|
||||
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
|
||||
* All rights reserved.
|
||||
*
|
||||
* This package is an SSL implementation written
|
||||
* by Eric Young (eay@cryptsoft.com).
|
||||
* The implementation was written so as to conform with Netscapes SSL.
|
||||
*
|
||||
* This library is free for commercial and non-commercial use as long as
|
||||
* the following conditions are aheared to. The following conditions
|
||||
* apply to all code found in this distribution, be it the RC4, RSA,
|
||||
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
|
||||
* included with this distribution is covered by the same copyright terms
|
||||
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
|
||||
*
|
||||
* Copyright remains Eric Young's, and as such any Copyright notices in
|
||||
* the code are not to be removed.
|
||||
* If this package is used in a product, Eric Young should be given attribution
|
||||
* as the author of the parts of the library used.
|
||||
* This can be in the form of a textual message at program startup or
|
||||
* in documentation (online or textual) provided with the package.
|
||||
*
|
||||
* 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 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 acknowledgement:
|
||||
* "This product includes cryptographic software written by
|
||||
* Eric Young (eay@cryptsoft.com)"
|
||||
* The word 'cryptographic' can be left out if the rouines from the library
|
||||
* being used are not cryptographic related :-).
|
||||
* 4. If you include any Windows specific code (or a derivative thereof) from
|
||||
* the apps directory (application code) you must include an acknowledgement:
|
||||
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
|
||||
* ANY EXPRESS 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 AUTHOR OR 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.
|
||||
*
|
||||
* The licence and distribution terms for any publically available version or
|
||||
* derivative of this code cannot be changed. i.e. this code cannot simply be
|
||||
* copied and put under another distribution licence
|
||||
* [including the GNU Public Licence.]
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include "cryptlib.h"
|
||||
#include <openssl/asn1_mac.h>
|
||||
#include <openssl/x509.h>
|
||||
|
||||
int i2d_X509_CINF(X509_CINF *a, unsigned char **pp)
|
||||
{
|
||||
int v1=0,v2=0;
|
||||
M_ASN1_I2D_vars(a);
|
||||
|
||||
M_ASN1_I2D_len_EXP_opt(a->version,i2d_ASN1_INTEGER,0,v1);
|
||||
M_ASN1_I2D_len(a->serialNumber, i2d_ASN1_INTEGER);
|
||||
M_ASN1_I2D_len(a->signature, i2d_X509_ALGOR);
|
||||
M_ASN1_I2D_len(a->issuer, i2d_X509_NAME);
|
||||
M_ASN1_I2D_len(a->validity, i2d_X509_VAL);
|
||||
M_ASN1_I2D_len(a->subject, i2d_X509_NAME);
|
||||
M_ASN1_I2D_len(a->key, i2d_X509_PUBKEY);
|
||||
M_ASN1_I2D_len_IMP_opt(a->issuerUID, i2d_ASN1_BIT_STRING);
|
||||
M_ASN1_I2D_len_IMP_opt(a->subjectUID, i2d_ASN1_BIT_STRING);
|
||||
M_ASN1_I2D_len_EXP_SEQUENCE_opt_type(X509_EXTENSION,a->extensions,
|
||||
i2d_X509_EXTENSION,3,
|
||||
V_ASN1_SEQUENCE,v2);
|
||||
|
||||
M_ASN1_I2D_seq_total();
|
||||
|
||||
M_ASN1_I2D_put_EXP_opt(a->version,i2d_ASN1_INTEGER,0,v1);
|
||||
M_ASN1_I2D_put(a->serialNumber, i2d_ASN1_INTEGER);
|
||||
M_ASN1_I2D_put(a->signature, i2d_X509_ALGOR);
|
||||
M_ASN1_I2D_put(a->issuer, i2d_X509_NAME);
|
||||
M_ASN1_I2D_put(a->validity, i2d_X509_VAL);
|
||||
M_ASN1_I2D_put(a->subject, i2d_X509_NAME);
|
||||
M_ASN1_I2D_put(a->key, i2d_X509_PUBKEY);
|
||||
M_ASN1_I2D_put_IMP_opt(a->issuerUID, i2d_ASN1_BIT_STRING,1);
|
||||
M_ASN1_I2D_put_IMP_opt(a->subjectUID, i2d_ASN1_BIT_STRING,2);
|
||||
M_ASN1_I2D_put_EXP_SEQUENCE_opt_type(X509_EXTENSION,a->extensions,
|
||||
i2d_X509_EXTENSION,3,
|
||||
V_ASN1_SEQUENCE,v2);
|
||||
|
||||
M_ASN1_I2D_finish();
|
||||
}
|
||||
|
||||
X509_CINF *d2i_X509_CINF(X509_CINF **a, unsigned char **pp, long length)
|
||||
{
|
||||
int ver=0;
|
||||
M_ASN1_D2I_vars(a,X509_CINF *,X509_CINF_new);
|
||||
|
||||
M_ASN1_D2I_Init();
|
||||
M_ASN1_D2I_start_sequence();
|
||||
/* we have the optional version field */
|
||||
if (M_ASN1_next == (V_ASN1_CONTEXT_SPECIFIC | V_ASN1_CONSTRUCTED | 0))
|
||||
{
|
||||
M_ASN1_D2I_get_EXP_opt(ret->version,d2i_ASN1_INTEGER,0);
|
||||
if (ret->version->data != NULL)
|
||||
ver=ret->version->data[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
if (ret->version != NULL)
|
||||
{
|
||||
M_ASN1_INTEGER_free(ret->version);
|
||||
ret->version=NULL;
|
||||
}
|
||||
}
|
||||
M_ASN1_D2I_get(ret->serialNumber,d2i_ASN1_INTEGER);
|
||||
M_ASN1_D2I_get(ret->signature,d2i_X509_ALGOR);
|
||||
M_ASN1_D2I_get(ret->issuer,d2i_X509_NAME);
|
||||
M_ASN1_D2I_get(ret->validity,d2i_X509_VAL);
|
||||
M_ASN1_D2I_get(ret->subject,d2i_X509_NAME);
|
||||
M_ASN1_D2I_get(ret->key,d2i_X509_PUBKEY);
|
||||
if (ver >= 1) /* version 2 extensions */
|
||||
{
|
||||
if (ret->issuerUID != NULL)
|
||||
{
|
||||
M_ASN1_BIT_STRING_free(ret->issuerUID);
|
||||
ret->issuerUID=NULL;
|
||||
}
|
||||
if (ret->subjectUID != NULL)
|
||||
{
|
||||
M_ASN1_BIT_STRING_free(ret->subjectUID);
|
||||
ret->subjectUID=NULL;
|
||||
}
|
||||
M_ASN1_D2I_get_IMP_opt(ret->issuerUID,d2i_ASN1_BIT_STRING, 1,
|
||||
V_ASN1_BIT_STRING);
|
||||
M_ASN1_D2I_get_IMP_opt(ret->subjectUID,d2i_ASN1_BIT_STRING, 2,
|
||||
V_ASN1_BIT_STRING);
|
||||
}
|
||||
/* Note: some broken certificates include extensions but don't set
|
||||
* the version number properly. By bypassing this check they can
|
||||
* be parsed.
|
||||
*/
|
||||
|
||||
#ifdef VERSION_EXT_CHECK
|
||||
if (ver >= 2) /* version 3 extensions */
|
||||
#endif
|
||||
{
|
||||
if (ret->extensions != NULL)
|
||||
while (sk_X509_EXTENSION_num(ret->extensions))
|
||||
X509_EXTENSION_free(
|
||||
sk_X509_EXTENSION_pop(ret->extensions));
|
||||
M_ASN1_D2I_get_EXP_set_opt_type(X509_EXTENSION,ret->extensions,
|
||||
d2i_X509_EXTENSION,
|
||||
X509_EXTENSION_free,3,
|
||||
V_ASN1_SEQUENCE);
|
||||
}
|
||||
M_ASN1_D2I_Finish(a,X509_CINF_free,ASN1_F_D2I_X509_CINF);
|
||||
}
|
||||
|
||||
X509_CINF *X509_CINF_new(void)
|
||||
{
|
||||
X509_CINF *ret=NULL;
|
||||
ASN1_CTX c;
|
||||
|
||||
M_ASN1_New_Malloc(ret,X509_CINF);
|
||||
ret->version=NULL;
|
||||
M_ASN1_New(ret->serialNumber,M_ASN1_INTEGER_new);
|
||||
M_ASN1_New(ret->signature,X509_ALGOR_new);
|
||||
M_ASN1_New(ret->issuer,X509_NAME_new);
|
||||
M_ASN1_New(ret->validity,X509_VAL_new);
|
||||
M_ASN1_New(ret->subject,X509_NAME_new);
|
||||
M_ASN1_New(ret->key,X509_PUBKEY_new);
|
||||
ret->issuerUID=NULL;
|
||||
ret->subjectUID=NULL;
|
||||
ret->extensions=NULL;
|
||||
return(ret);
|
||||
M_ASN1_New_Error(ASN1_F_X509_CINF_NEW);
|
||||
}
|
||||
|
||||
void X509_CINF_free(X509_CINF *a)
|
||||
{
|
||||
if (a == NULL) return;
|
||||
M_ASN1_INTEGER_free(a->version);
|
||||
M_ASN1_INTEGER_free(a->serialNumber);
|
||||
X509_ALGOR_free(a->signature);
|
||||
X509_NAME_free(a->issuer);
|
||||
X509_VAL_free(a->validity);
|
||||
X509_NAME_free(a->subject);
|
||||
X509_PUBKEY_free(a->key);
|
||||
M_ASN1_BIT_STRING_free(a->issuerUID);
|
||||
M_ASN1_BIT_STRING_free(a->subjectUID);
|
||||
sk_X509_EXTENSION_pop_free(a->extensions,X509_EXTENSION_free);
|
||||
OPENSSL_free(a);
|
||||
}
|
||||
|
||||
@@ -104,7 +104,12 @@ static int long_i2c(ASN1_VALUE **pval, unsigned char *cont, int *putype, const A
|
||||
long ltmp;
|
||||
unsigned long utmp;
|
||||
int clen, pad, i;
|
||||
ltmp = *(long *)pval;
|
||||
/* this exists to bypass broken gcc optimization */
|
||||
char *cp = (char *)pval;
|
||||
|
||||
/* use memcpy, because we may not be long aligned */
|
||||
memcpy(<mp, cp, sizeof(long));
|
||||
|
||||
if(ltmp == it->size) return -1;
|
||||
/* Convert the long to positive: we subtract one if negative so
|
||||
* we can cleanly handle the padding if only the MSB of the leading
|
||||
@@ -136,6 +141,7 @@ static int long_c2i(ASN1_VALUE **pval, unsigned char *cont, int len, int utype,
|
||||
int neg, i;
|
||||
long ltmp;
|
||||
unsigned long utmp = 0;
|
||||
char *cp = (char *)pval;
|
||||
if(len > sizeof(long)) {
|
||||
ASN1err(ASN1_F_LONG_C2I, ASN1_R_INTEGER_TOO_LARGE_FOR_LONG);
|
||||
return 0;
|
||||
@@ -158,6 +164,6 @@ static int long_c2i(ASN1_VALUE **pval, unsigned char *cont, int len, int utype,
|
||||
ASN1err(ASN1_F_LONG_C2I, ASN1_R_INTEGER_TOO_LARGE_FOR_LONG);
|
||||
return 0;
|
||||
}
|
||||
*(long *)pval = ltmp;
|
||||
memcpy(cp, <mp, sizeof(long));
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -11,10 +11,9 @@ CFLAG=-g
|
||||
INSTALL_PREFIX=
|
||||
OPENSSLDIR= /usr/local/ssl
|
||||
INSTALLTOP=/usr/local/ssl
|
||||
MAKE= make -f Makefile.ssl
|
||||
MAKEDEPPROG= makedepend
|
||||
MAKEDEPEND= $(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG)
|
||||
MAKEFILE= Makefile.ssl
|
||||
MAKEFILE= Makefile
|
||||
AR= ar r
|
||||
|
||||
BF_ENC= bf_enc.o
|
||||
@@ -22,6 +21,7 @@ BF_ENC= bf_enc.o
|
||||
#DES_ENC= bx86-elf.o
|
||||
|
||||
CFLAGS= $(INCLUDES) $(CFLAG)
|
||||
ASFLAGS= $(INCLUDES) $(ASFLAG)
|
||||
|
||||
GENERAL=Makefile
|
||||
TEST=bftest.c
|
||||
@@ -64,10 +64,9 @@ asm/bx86unix.cpp: asm/bf-586.pl ../perlasm/x86asm.pl ../perlasm/cbc.pl
|
||||
(cd asm; $(PERL) bf-586.pl cpp $(PROCESSOR) >bx86unix.cpp)
|
||||
|
||||
files:
|
||||
$(PERL) $(TOP)/util/files.pl Makefile.ssl >> $(TOP)/MINFO
|
||||
$(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO
|
||||
|
||||
links:
|
||||
@$(TOP)/util/point.sh Makefile.ssl Makefile
|
||||
@$(PERL) $(TOP)/util/mklink.pl ../../include/openssl $(EXHEADER)
|
||||
@$(PERL) $(TOP)/util/mklink.pl ../../test $(TEST)
|
||||
@$(PERL) $(TOP)/util/mklink.pl ../../apps $(APPS)
|
||||
@@ -10,10 +10,9 @@ CFLAG=-g
|
||||
INSTALL_PREFIX=
|
||||
OPENSSLDIR= /usr/local/ssl
|
||||
INSTALLTOP=/usr/local/ssl
|
||||
MAKE= make -f Makefile.ssl
|
||||
MAKEDEPPROG= makedepend
|
||||
MAKEDEPEND= $(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG)
|
||||
MAKEFILE= Makefile.ssl
|
||||
MAKEFILE= Makefile
|
||||
AR= ar r
|
||||
|
||||
CFLAGS= $(INCLUDES) $(CFLAG)
|
||||
@@ -54,10 +53,9 @@ lib: $(LIBOBJ)
|
||||
@touch lib
|
||||
|
||||
files:
|
||||
$(PERL) $(TOP)/util/files.pl Makefile.ssl >> $(TOP)/MINFO
|
||||
$(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO
|
||||
|
||||
links:
|
||||
@$(TOP)/util/point.sh Makefile.ssl Makefile
|
||||
@$(PERL) $(TOP)/util/mklink.pl ../../include/openssl $(EXHEADER)
|
||||
@$(PERL) $(TOP)/util/mklink.pl ../../test $(TEST)
|
||||
@$(PERL) $(TOP)/util/mklink.pl ../../apps $(APPS)
|
||||
@@ -104,38 +104,41 @@ int BIO_dump_indent(BIO *bio, const char *s, int len, int indent)
|
||||
for(i=0;i<rows;i++)
|
||||
{
|
||||
buf[0]='\0'; /* start with empty string */
|
||||
strcpy(buf,str);
|
||||
sprintf(tmp,"%04x - ",i*dump_width);
|
||||
strcat(buf,tmp);
|
||||
BUF_strlcpy(buf,str,sizeof buf);
|
||||
BIO_snprintf(tmp,sizeof tmp,"%04x - ",i*dump_width);
|
||||
BUF_strlcat(buf,tmp,sizeof buf);
|
||||
for(j=0;j<dump_width;j++)
|
||||
{
|
||||
if (((i*dump_width)+j)>=len)
|
||||
{
|
||||
strcat(buf," ");
|
||||
BUF_strlcat(buf," ",sizeof buf);
|
||||
}
|
||||
else
|
||||
{
|
||||
ch=((unsigned char)*(s+i*dump_width+j)) & 0xff;
|
||||
sprintf(tmp,"%02x%c",ch,j==7?'-':' ');
|
||||
strcat(buf,tmp);
|
||||
BIO_snprintf(tmp,sizeof tmp,"%02x%c",ch,
|
||||
j==7?'-':' ');
|
||||
BUF_strlcat(buf,tmp,sizeof buf);
|
||||
}
|
||||
}
|
||||
strcat(buf," ");
|
||||
BUF_strlcat(buf," ",sizeof buf);
|
||||
for(j=0;j<dump_width;j++)
|
||||
{
|
||||
if (((i*dump_width)+j)>=len)
|
||||
break;
|
||||
ch=((unsigned char)*(s+i*dump_width+j)) & 0xff;
|
||||
#ifndef CHARSET_EBCDIC
|
||||
sprintf(tmp,"%c",((ch>=' ')&&(ch<='~'))?ch:'.');
|
||||
BIO_snprintf(tmp,sizeof tmp,"%c",
|
||||
((ch>=' ')&&(ch<='~'))?ch:'.');
|
||||
#else
|
||||
sprintf(tmp,"%c",((ch>=os_toascii[' '])&&(ch<=os_toascii['~']))
|
||||
? os_toebcdic[ch]
|
||||
: '.');
|
||||
BIO_snprintf(tmp,sizeof tmp,"%c",
|
||||
((ch>=os_toascii[' '])&&(ch<=os_toascii['~']))
|
||||
? os_toebcdic[ch]
|
||||
: '.');
|
||||
#endif
|
||||
strcat(buf,tmp);
|
||||
BUF_strlcat(buf,tmp,sizeof buf);
|
||||
}
|
||||
strcat(buf,"\n");
|
||||
BUF_strlcat(buf,"\n",sizeof buf);
|
||||
/* if this is the last call then update the ddt_dump thing so that
|
||||
* we will move the selection point in the debug window
|
||||
*/
|
||||
@@ -144,7 +147,8 @@ int BIO_dump_indent(BIO *bio, const char *s, int len, int indent)
|
||||
#ifdef TRUNCATE
|
||||
if (trunc > 0)
|
||||
{
|
||||
sprintf(buf,"%s%04x - <SPACES/NULS>\n",str,len+trunc);
|
||||
BIO_snprintf(buf,sizeof buf,"%s%04x - <SPACES/NULS>\n",str,
|
||||
len+trunc);
|
||||
ret+=BIO_write(bio,(char *)buf,strlen(buf));
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -576,12 +576,12 @@ abs_val(LDOUBLE value)
|
||||
}
|
||||
|
||||
static LDOUBLE
|
||||
pow10(int exp)
|
||||
pow10(int in_exp)
|
||||
{
|
||||
LDOUBLE result = 1;
|
||||
while (exp) {
|
||||
while (in_exp) {
|
||||
result *= 10;
|
||||
exp--;
|
||||
in_exp--;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -641,7 +641,7 @@ fmtfp(
|
||||
multiplying by a factor of 10 */
|
||||
fracpart = roundv((pow10(max)) * (ufvalue - intpart));
|
||||
|
||||
if (fracpart >= pow10(max)) {
|
||||
if (fracpart >= (long)pow10(max)) {
|
||||
intpart++;
|
||||
fracpart -= (long)pow10(max);
|
||||
}
|
||||
@@ -652,8 +652,8 @@ fmtfp(
|
||||
(caps ? "0123456789ABCDEF"
|
||||
: "0123456789abcdef")[intpart % 10];
|
||||
intpart = (intpart / 10);
|
||||
} while (intpart && (iplace < sizeof iplace));
|
||||
if (iplace == sizeof iplace)
|
||||
} while (intpart && (iplace < sizeof iconvert));
|
||||
if (iplace == sizeof iconvert)
|
||||
iplace--;
|
||||
iconvert[iplace] = 0;
|
||||
|
||||
@@ -664,7 +664,7 @@ fmtfp(
|
||||
: "0123456789abcdef")[fracpart % 10];
|
||||
fracpart = (fracpart / 10);
|
||||
} while (fplace < max);
|
||||
if (fplace == sizeof fplace)
|
||||
if (fplace == sizeof fconvert)
|
||||
fplace--;
|
||||
fconvert[fplace] = 0;
|
||||
|
||||
|
||||
@@ -709,12 +709,12 @@ int BIO_accept(int sock, char **addr)
|
||||
}
|
||||
*addr=p;
|
||||
}
|
||||
sprintf(*addr,"%d.%d.%d.%d:%d",
|
||||
(unsigned char)(l>>24L)&0xff,
|
||||
(unsigned char)(l>>16L)&0xff,
|
||||
(unsigned char)(l>> 8L)&0xff,
|
||||
(unsigned char)(l )&0xff,
|
||||
port);
|
||||
BIO_snprintf(*addr,24,"%d.%d.%d.%d:%d",
|
||||
(unsigned char)(l>>24L)&0xff,
|
||||
(unsigned char)(l>>16L)&0xff,
|
||||
(unsigned char)(l>> 8L)&0xff,
|
||||
(unsigned char)(l )&0xff,
|
||||
port);
|
||||
end:
|
||||
return(ret);
|
||||
}
|
||||
|
||||
@@ -347,6 +347,7 @@ typedef struct bio_f_buffer_ctx_struct
|
||||
#define BIO_C_NWRITE0 145
|
||||
#define BIO_C_NWRITE 146
|
||||
#define BIO_C_RESET_READ_REQUEST 147
|
||||
#define BIO_C_SET_MD_CTX 148
|
||||
|
||||
|
||||
#define BIO_set_app_data(s,arg) BIO_set_ex_data(s,0,arg)
|
||||
|
||||
@@ -70,55 +70,61 @@ long MS_CALLBACK BIO_debug_callback(BIO *bio, int cmd, const char *argp,
|
||||
MS_STATIC char buf[256];
|
||||
char *p;
|
||||
long r=1;
|
||||
size_t p_maxlen;
|
||||
|
||||
if (BIO_CB_RETURN & cmd)
|
||||
r=ret;
|
||||
|
||||
sprintf(buf,"BIO[%08lX]:",(unsigned long)bio);
|
||||
BIO_snprintf(buf,sizeof buf,"BIO[%08lX]:",(unsigned long)bio);
|
||||
p= &(buf[14]);
|
||||
p_maxlen = sizeof buf - 14;
|
||||
switch (cmd)
|
||||
{
|
||||
case BIO_CB_FREE:
|
||||
sprintf(p,"Free - %s\n",bio->method->name);
|
||||
BIO_snprintf(p,p_maxlen,"Free - %s\n",bio->method->name);
|
||||
break;
|
||||
case BIO_CB_READ:
|
||||
if (bio->method->type & BIO_TYPE_DESCRIPTOR)
|
||||
sprintf(p,"read(%d,%d) - %s fd=%d\n",bio->num,argi,bio->method->name,bio->num);
|
||||
BIO_snprintf(p,p_maxlen,"read(%d,%d) - %s fd=%d\n",
|
||||
bio->num,argi,bio->method->name,bio->num);
|
||||
else
|
||||
sprintf(p,"read(%d,%d) - %s\n",bio->num,argi,bio->method->name);
|
||||
BIO_snprintf(p,p_maxlen,"read(%d,%d) - %s\n",
|
||||
bio->num,argi,bio->method->name);
|
||||
break;
|
||||
case BIO_CB_WRITE:
|
||||
if (bio->method->type & BIO_TYPE_DESCRIPTOR)
|
||||
sprintf(p,"write(%d,%d) - %s fd=%d\n",bio->num,argi,bio->method->name,bio->num);
|
||||
BIO_snprintf(p,p_maxlen,"write(%d,%d) - %s fd=%d\n",
|
||||
bio->num,argi,bio->method->name,bio->num);
|
||||
else
|
||||
sprintf(p,"write(%d,%d) - %s\n",bio->num,argi,bio->method->name);
|
||||
BIO_snprintf(p,p_maxlen,"write(%d,%d) - %s\n",
|
||||
bio->num,argi,bio->method->name);
|
||||
break;
|
||||
case BIO_CB_PUTS:
|
||||
sprintf(p,"puts() - %s\n",bio->method->name);
|
||||
BIO_snprintf(p,p_maxlen,"puts() - %s\n",bio->method->name);
|
||||
break;
|
||||
case BIO_CB_GETS:
|
||||
sprintf(p,"gets(%d) - %s\n",argi,bio->method->name);
|
||||
BIO_snprintf(p,p_maxlen,"gets(%d) - %s\n",argi,bio->method->name);
|
||||
break;
|
||||
case BIO_CB_CTRL:
|
||||
sprintf(p,"ctrl(%d) - %s\n",argi,bio->method->name);
|
||||
BIO_snprintf(p,p_maxlen,"ctrl(%d) - %s\n",argi,bio->method->name);
|
||||
break;
|
||||
case BIO_CB_RETURN|BIO_CB_READ:
|
||||
sprintf(p,"read return %ld\n",ret);
|
||||
BIO_snprintf(p,p_maxlen,"read return %ld\n",ret);
|
||||
break;
|
||||
case BIO_CB_RETURN|BIO_CB_WRITE:
|
||||
sprintf(p,"write return %ld\n",ret);
|
||||
BIO_snprintf(p,p_maxlen,"write return %ld\n",ret);
|
||||
break;
|
||||
case BIO_CB_RETURN|BIO_CB_GETS:
|
||||
sprintf(p,"gets return %ld\n",ret);
|
||||
BIO_snprintf(p,p_maxlen,"gets return %ld\n",ret);
|
||||
break;
|
||||
case BIO_CB_RETURN|BIO_CB_PUTS:
|
||||
sprintf(p,"puts return %ld\n",ret);
|
||||
BIO_snprintf(p,p_maxlen,"puts return %ld\n",ret);
|
||||
break;
|
||||
case BIO_CB_RETURN|BIO_CB_CTRL:
|
||||
sprintf(p,"ctrl return %ld\n",ret);
|
||||
BIO_snprintf(p,p_maxlen,"ctrl return %ld\n",ret);
|
||||
break;
|
||||
default:
|
||||
sprintf(p,"bio callback - unknown type (%d)\n",cmd);
|
||||
BIO_snprintf(p,p_maxlen,"bio callback - unknown type (%d)\n",cmd);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -521,8 +521,8 @@ static long conn_ctrl(BIO *b, int cmd, long num, void *ptr)
|
||||
char buf[16];
|
||||
unsigned char *p = ptr;
|
||||
|
||||
sprintf(buf,"%d.%d.%d.%d",
|
||||
p[0],p[1],p[2],p[3]);
|
||||
BIO_snprintf(buf,sizeof buf,"%d.%d.%d.%d",
|
||||
p[0],p[1],p[2],p[3]);
|
||||
if (data->param_hostname != NULL)
|
||||
OPENSSL_free(data->param_hostname);
|
||||
data->param_hostname=BUF_strdup(buf);
|
||||
@@ -532,7 +532,7 @@ static long conn_ctrl(BIO *b, int cmd, long num, void *ptr)
|
||||
{
|
||||
char buf[DECIMAL_SIZE(int)+1];
|
||||
|
||||
sprintf(buf,"%d",*(int *)ptr);
|
||||
BIO_snprintf(buf,sizeof buf,"%d",*(int *)ptr);
|
||||
if (data->param_port != NULL)
|
||||
OPENSSL_free(data->param_port);
|
||||
data->param_port=BUF_strdup(buf);
|
||||
|
||||
@@ -213,13 +213,14 @@ static long MS_CALLBACK file_ctrl(BIO *b, int cmd, long num, void *ptr)
|
||||
b->shutdown=(int)num&BIO_CLOSE;
|
||||
b->ptr=(char *)ptr;
|
||||
b->init=1;
|
||||
#if defined(OPENSSL_SYS_WINDOWS)
|
||||
if (num & BIO_FP_TEXT)
|
||||
_setmode(fileno((FILE *)ptr),_O_TEXT);
|
||||
else
|
||||
_setmode(fileno((FILE *)ptr),_O_BINARY);
|
||||
#elif defined(OPENSSL_SYS_MSDOS)
|
||||
{
|
||||
#if defined(OPENSSL_SYS_WINDOWS)
|
||||
int fd = fileno((FILE*)ptr);
|
||||
if (num & BIO_FP_TEXT)
|
||||
_setmode(fd,_O_TEXT);
|
||||
else
|
||||
_setmode(fd,_O_BINARY);
|
||||
#elif defined(OPENSSL_SYS_MSDOS)
|
||||
int fd = fileno((FILE*)ptr);
|
||||
/* Set correct text/binary mode */
|
||||
if (num & BIO_FP_TEXT)
|
||||
@@ -235,13 +236,14 @@ static long MS_CALLBACK file_ctrl(BIO *b, int cmd, long num, void *ptr)
|
||||
else
|
||||
_setmode(fd,_O_BINARY);
|
||||
}
|
||||
}
|
||||
#elif defined(OPENSSL_SYS_OS2)
|
||||
int fd = fileno((FILE*)ptr);
|
||||
if (num & BIO_FP_TEXT)
|
||||
setmode(fileno((FILE *)ptr), O_TEXT);
|
||||
setmode(fd, O_TEXT);
|
||||
else
|
||||
setmode(fileno((FILE *)ptr), O_BINARY);
|
||||
setmode(fd, O_BINARY);
|
||||
#endif
|
||||
}
|
||||
break;
|
||||
case BIO_C_SET_FILENAME:
|
||||
file_free(b);
|
||||
@@ -249,15 +251,15 @@ static long MS_CALLBACK file_ctrl(BIO *b, int cmd, long num, void *ptr)
|
||||
if (num & BIO_FP_APPEND)
|
||||
{
|
||||
if (num & BIO_FP_READ)
|
||||
strcpy(p,"a+");
|
||||
else strcpy(p,"a");
|
||||
BUF_strlcpy(p,"a+",sizeof p);
|
||||
else BUF_strlcpy(p,"a",sizeof p);
|
||||
}
|
||||
else if ((num & BIO_FP_READ) && (num & BIO_FP_WRITE))
|
||||
strcpy(p,"r+");
|
||||
BUF_strlcpy(p,"r+",sizeof p);
|
||||
else if (num & BIO_FP_WRITE)
|
||||
strcpy(p,"w");
|
||||
BUF_strlcpy(p,"w",sizeof p);
|
||||
else if (num & BIO_FP_READ)
|
||||
strcpy(p,"r");
|
||||
BUF_strlcpy(p,"r",sizeof p);
|
||||
else
|
||||
{
|
||||
BIOerr(BIO_F_FILE_CTRL,BIO_R_BAD_FOPEN_MODE);
|
||||
|
||||
@@ -11,10 +11,9 @@ CFLAG=-g
|
||||
INSTALL_PREFIX=
|
||||
OPENSSLDIR= /usr/local/ssl
|
||||
INSTALLTOP=/usr/local/ssl
|
||||
MAKE= make -f Makefile.ssl
|
||||
MAKEDEPPROG= makedepend
|
||||
MAKEDEPEND= $(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG)
|
||||
MAKEFILE= Makefile.ssl
|
||||
MAKEFILE= Makefile
|
||||
AR= ar r
|
||||
|
||||
BN_ASM= bn_asm.o
|
||||
@@ -120,11 +119,13 @@ asm/ia64-cpp.o: asm/ia64.S
|
||||
|
||||
asm/x86_64-gcc.o: asm/x86_64-gcc.c
|
||||
|
||||
asm/pa-risc2W.o: asm/pa-risc2W.s
|
||||
/usr/ccs/bin/as -o asm/pa-risc2W.o asm/pa-risc2W.s
|
||||
|
||||
files:
|
||||
$(PERL) $(TOP)/util/files.pl Makefile.ssl >> $(TOP)/MINFO
|
||||
$(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO
|
||||
|
||||
links:
|
||||
@$(TOP)/util/point.sh Makefile.ssl Makefile
|
||||
@$(PERL) $(TOP)/util/mklink.pl ../../include/openssl $(EXHEADER)
|
||||
@$(PERL) $(TOP)/util/mklink.pl ../../test $(TEST)
|
||||
@$(PERL) $(TOP)/util/mklink.pl ../../apps $(APPS)
|
||||
@@ -11,7 +11,7 @@ require "x86asm.pl";
|
||||
&bn_div_words("bn_div_words");
|
||||
&bn_add_words("bn_add_words");
|
||||
&bn_sub_words("bn_sub_words");
|
||||
&bn_sub_part_words("bn_sub_part_words");
|
||||
#&bn_sub_part_words("bn_sub_part_words");
|
||||
|
||||
&asm_finish();
|
||||
|
||||
|
||||
@@ -142,7 +142,7 @@ void bn_sqr_words(BN_ULONG *r, BN_ULONG *a, int n)
|
||||
BN_ULONG bn_div_words(BN_ULONG h, BN_ULONG l, BN_ULONG d)
|
||||
{ BN_ULONG ret,waste;
|
||||
|
||||
asm ("divq %3"
|
||||
asm ("divq %4"
|
||||
: "=a"(ret),"=d"(waste)
|
||||
: "a"(l),"d"(h),"g"(d)
|
||||
: "cc");
|
||||
|
||||
@@ -433,19 +433,18 @@ void bn_sqr_comba4(BN_ULONG *r,const BN_ULONG *a);
|
||||
int bn_cmp_words(const BN_ULONG *a,const BN_ULONG *b,int n);
|
||||
int bn_cmp_part_words(const BN_ULONG *a, const BN_ULONG *b,
|
||||
int cl, int dl);
|
||||
#if 0
|
||||
/* bn_mul.c rollback <appro> */
|
||||
void bn_mul_recursive(BN_ULONG *r,BN_ULONG *a,BN_ULONG *b,int n2,
|
||||
int dna,int dnb,BN_ULONG *t);
|
||||
void bn_mul_part_recursive(BN_ULONG *r,BN_ULONG *a,BN_ULONG *b,
|
||||
int n,int tna,int tnb,BN_ULONG *t);
|
||||
#endif
|
||||
void bn_sqr_recursive(BN_ULONG *r,const BN_ULONG *a, int n2, BN_ULONG *t);
|
||||
void bn_mul_low_normal(BN_ULONG *r,BN_ULONG *a,BN_ULONG *b, int n);
|
||||
#ifdef BN_RECURSION
|
||||
void bn_mul_recursive(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int n2,
|
||||
BN_ULONG *t);
|
||||
void bn_mul_part_recursive(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int tn,
|
||||
int n, BN_ULONG *t);
|
||||
void bn_mul_low_recursive(BN_ULONG *r,BN_ULONG *a,BN_ULONG *b,int n2,
|
||||
BN_ULONG *t);
|
||||
void bn_mul_high(BN_ULONG *r,BN_ULONG *a,BN_ULONG *b,BN_ULONG *l,int n2,
|
||||
BN_ULONG *t);
|
||||
void bn_sqr_recursive(BN_ULONG *r,const BN_ULONG *a, int n2, BN_ULONG *t);
|
||||
#endif
|
||||
void bn_mul_low_normal(BN_ULONG *r,BN_ULONG *a,BN_ULONG *b, int n);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -145,11 +145,11 @@ char *BN_options(void)
|
||||
{
|
||||
init++;
|
||||
#ifdef BN_LLONG
|
||||
sprintf(data,"bn(%d,%d)",(int)sizeof(BN_ULLONG)*8,
|
||||
(int)sizeof(BN_ULONG)*8);
|
||||
BIO_snprintf(data,sizeof data,"bn(%d,%d)",
|
||||
(int)sizeof(BN_ULLONG)*8,(int)sizeof(BN_ULONG)*8);
|
||||
#else
|
||||
sprintf(data,"bn(%d,%d)",(int)sizeof(BN_ULONG)*8,
|
||||
(int)sizeof(BN_ULONG)*8);
|
||||
BIO_snprintf(data,sizeof data,"bn(%d,%d)",
|
||||
(int)sizeof(BN_ULONG)*8,(int)sizeof(BN_ULONG)*8);
|
||||
#endif
|
||||
}
|
||||
return(data);
|
||||
|
||||
@@ -119,6 +119,7 @@ char *BN_bn2dec(const BIGNUM *a)
|
||||
}
|
||||
if ((t=BN_dup(a)) == NULL) goto err;
|
||||
|
||||
#define BUF_REMAIN (num+3 - (size_t)(p - buf))
|
||||
p=buf;
|
||||
lp=bn_data;
|
||||
if (t->neg) *(p++)='-';
|
||||
@@ -139,12 +140,12 @@ char *BN_bn2dec(const BIGNUM *a)
|
||||
/* We now have a series of blocks, BN_DEC_NUM chars
|
||||
* in length, where the last one needs truncation.
|
||||
* The blocks need to be reversed in order. */
|
||||
sprintf(p,BN_DEC_FMT1,*lp);
|
||||
BIO_snprintf(p,BUF_REMAIN,BN_DEC_FMT1,*lp);
|
||||
while (*p) p++;
|
||||
while (lp != bn_data)
|
||||
{
|
||||
lp--;
|
||||
sprintf(p,BN_DEC_FMT2,*lp);
|
||||
BIO_snprintf(p,BUF_REMAIN,BN_DEC_FMT2,*lp);
|
||||
while (*p) p++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -232,7 +232,7 @@ int main(int argc, char *argv[])
|
||||
EXIT(0);
|
||||
err:
|
||||
BIO_puts(out,"1\n"); /* make sure the Perl script fed by bc notices
|
||||
* the failure, see test_bn in test/Makefile.ssl*/
|
||||
* the failure, see test_bn in test/Makefile */
|
||||
BIO_flush(out);
|
||||
ERR_load_crypto_strings();
|
||||
ERR_print_errors_fp(stderr);
|
||||
|
||||
@@ -10,10 +10,9 @@ CFLAG=-g
|
||||
INSTALL_PREFIX=
|
||||
OPENSSLDIR= /usr/local/ssl
|
||||
INSTALLTOP=/usr/local/ssl
|
||||
MAKE= make -f Makefile.ssl
|
||||
MAKEDEPPROG= makedepend
|
||||
MAKEDEPEND= $(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG)
|
||||
MAKEFILE= Makefile.ssl
|
||||
MAKEFILE= Makefile
|
||||
AR= ar r
|
||||
|
||||
CFLAGS= $(INCLUDES) $(CFLAG)
|
||||
@@ -44,10 +43,9 @@ lib: $(LIBOBJ)
|
||||
@touch lib
|
||||
|
||||
files:
|
||||
$(PERL) $(TOP)/util/files.pl Makefile.ssl >> $(TOP)/MINFO
|
||||
$(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO
|
||||
|
||||
links:
|
||||
@$(TOP)/util/point.sh Makefile.ssl Makefile
|
||||
@$(PERL) $(TOP)/util/mklink.pl ../../include/openssl $(EXHEADER)
|
||||
@$(PERL) $(TOP)/util/mklink.pl ../../test $(TEST)
|
||||
@$(PERL) $(TOP)/util/mklink.pl ../../apps $(APPS)
|
||||
@@ -11,10 +11,9 @@ CFLAG=-g
|
||||
INSTALL_PREFIX=
|
||||
OPENSSLDIR= /usr/local/ssl
|
||||
INSTALLTOP=/usr/local/ssl
|
||||
MAKE= make -f Makefile.ssl
|
||||
MAKEDEPPROG= makedepend
|
||||
MAKEDEPEND= $(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG)
|
||||
MAKEFILE= Makefile.ssl
|
||||
MAKEFILE= Makefile
|
||||
AR= ar r
|
||||
|
||||
CAST_ENC=c_enc.o
|
||||
@@ -25,6 +24,7 @@ CAST_ENC=c_enc.o
|
||||
#CAST_ENC=asm/cx86bdsi.o
|
||||
|
||||
CFLAGS= $(INCLUDES) $(CFLAG)
|
||||
ASFLAGS= $(INCLUDES) $(ASFLAG)
|
||||
|
||||
GENERAL=Makefile
|
||||
TEST=casttest.c
|
||||
@@ -67,10 +67,9 @@ asm/cx86unix.cpp: asm/cast-586.pl ../perlasm/x86asm.pl ../perlasm/cbc.pl
|
||||
(cd asm; $(PERL) cast-586.pl cpp $(PROCESSOR) >cx86unix.cpp)
|
||||
|
||||
files:
|
||||
$(PERL) $(TOP)/util/files.pl Makefile.ssl >> $(TOP)/MINFO
|
||||
$(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO
|
||||
|
||||
links:
|
||||
@$(TOP)/util/point.sh Makefile.ssl Makefile
|
||||
@$(PERL) $(TOP)/util/mklink.pl ../../include/openssl $(EXHEADER)
|
||||
@$(PERL) $(TOP)/util/mklink.pl ../../test $(TEST)
|
||||
@$(PERL) $(TOP)/util/mklink.pl ../../apps $(APPS)
|
||||
@@ -10,10 +10,9 @@ CFLAG=-g
|
||||
INSTALL_PREFIX=
|
||||
OPENSSLDIR= /usr/local/ssl
|
||||
INSTALLTOP=/usr/local/ssl
|
||||
MAKE= make -f Makefile.ssl
|
||||
MAKEDEPPROG= makedepend
|
||||
MAKEDEPEND= $(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG)
|
||||
MAKEFILE= Makefile.ssl
|
||||
MAKEFILE= Makefile
|
||||
AR= ar r
|
||||
|
||||
CFLAGS= $(INCLUDES) $(CFLAG)
|
||||
@@ -47,10 +46,9 @@ lib: $(LIBOBJ)
|
||||
@touch lib
|
||||
|
||||
files:
|
||||
$(PERL) $(TOP)/util/files.pl Makefile.ssl >> $(TOP)/MINFO
|
||||
$(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO
|
||||
|
||||
links:
|
||||
@$(TOP)/util/point.sh Makefile.ssl Makefile
|
||||
@$(PERL) $(TOP)/util/mklink.pl ../../include/openssl $(EXHEADER)
|
||||
@$(PERL) $(TOP)/util/mklink.pl ../../test $(TEST)
|
||||
@$(PERL) $(TOP)/util/mklink.pl ../../apps $(APPS)
|
||||
@@ -10,10 +10,9 @@ CFLAG=-g
|
||||
INSTALL_PREFIX=
|
||||
OPENSSLDIR= /usr/local/ssl
|
||||
INSTALLTOP=/usr/local/ssl
|
||||
MAKE= make -f Makefile.ssl
|
||||
MAKEDEPPROG= makedepend
|
||||
MAKEDEPEND= $(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG)
|
||||
MAKEFILE= Makefile.ssl
|
||||
MAKEFILE= Makefile
|
||||
AR= ar r
|
||||
|
||||
CFLAGS= $(INCLUDES) $(CFLAG)
|
||||
@@ -47,10 +46,9 @@ lib: $(LIBOBJ)
|
||||
@touch lib
|
||||
|
||||
files:
|
||||
$(PERL) $(TOP)/util/files.pl Makefile.ssl >> $(TOP)/MINFO
|
||||
$(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO
|
||||
|
||||
links:
|
||||
@$(TOP)/util/point.sh Makefile.ssl Makefile
|
||||
@$(PERL) $(TOP)/util/mklink.pl ../../include/openssl $(EXHEADER)
|
||||
@$(PERL) $(TOP)/util/mklink.pl ../../test $(TEST)
|
||||
@$(PERL) $(TOP)/util/mklink.pl ../../apps $(APPS)
|
||||
@@ -235,7 +235,7 @@ static int def_load_bio(CONF *conf, BIO *in, long *line)
|
||||
CONFerr(CONF_F_CONF_LOAD_BIO,ERR_R_MALLOC_FAILURE);
|
||||
goto err;
|
||||
}
|
||||
strcpy(section,"default");
|
||||
BUF_strlcpy(section,"default",10);
|
||||
|
||||
if (_CONF_new_data(conf) == 0)
|
||||
{
|
||||
@@ -392,7 +392,7 @@ again:
|
||||
ERR_R_MALLOC_FAILURE);
|
||||
goto err;
|
||||
}
|
||||
strcpy(v->name,pname);
|
||||
BUF_strlcpy(v->name,pname,strlen(pname)+1);
|
||||
if (!str_copy(conf,psection,&(v->value),start)) goto err;
|
||||
|
||||
if (strcmp(psection,section) != 0)
|
||||
@@ -447,7 +447,7 @@ err:
|
||||
if (buff != NULL) BUF_MEM_free(buff);
|
||||
if (section != NULL) OPENSSL_free(section);
|
||||
if (line != NULL) *line=eline;
|
||||
sprintf(btmp,"%ld",eline);
|
||||
BIO_snprintf(btmp,sizeof btmp,"%ld",eline);
|
||||
ERR_add_error_data(2,"line ",btmp);
|
||||
if ((h != conf->data) && (conf->data != NULL))
|
||||
{
|
||||
@@ -632,6 +632,11 @@ static int str_copy(CONF *conf, char *section, char **pto, char *from)
|
||||
BUF_MEM_grow_clean(buf,(strlen(p)+len-(e-from)));
|
||||
while (*p)
|
||||
buf->data[to++]= *(p++);
|
||||
|
||||
/* Since we change the pointer 'from', we also have
|
||||
to change the perceived length of the string it
|
||||
points at. /RL */
|
||||
len -= e-from;
|
||||
from=e;
|
||||
}
|
||||
else
|
||||
|
||||
@@ -232,7 +232,7 @@ static int module_run(const CONF *cnf, char *name, char *value,
|
||||
{
|
||||
char rcode[DECIMAL_SIZE(ret)+1];
|
||||
CONFerr(CONF_F_CONF_MODULES_LOAD, CONF_R_MODULE_INITIALIZATION_ERROR);
|
||||
sprintf(rcode, "%-8d", ret);
|
||||
BIO_snprintf(rcode, sizeof rcode, "%-8d", ret);
|
||||
ERR_add_error_data(6, "module=", name, ", value=", value, ", retcode=", rcode);
|
||||
}
|
||||
}
|
||||
@@ -561,11 +561,11 @@ char *CONF_get1_default_config_file(void)
|
||||
|
||||
if (!file)
|
||||
return NULL;
|
||||
strcpy(file,X509_get_default_cert_area());
|
||||
BUF_strlcpy(file,X509_get_default_cert_area(),len + 1);
|
||||
#ifndef OPENSSL_SYS_VMS
|
||||
strcat(file,"/");
|
||||
BUF_strlcat(file,"/",len + 1);
|
||||
#endif
|
||||
strcat(file,OPENSSL_CONF);
|
||||
BUF_strlcat(file,OPENSSL_CONF,len + 1);
|
||||
|
||||
return file;
|
||||
}
|
||||
@@ -576,12 +576,12 @@ char *CONF_get1_default_config_file(void)
|
||||
* be used to parse comma separated lists for example.
|
||||
*/
|
||||
|
||||
int CONF_parse_list(const char *list, int sep, int nospc,
|
||||
int CONF_parse_list(const char *list_, int sep, int nospc,
|
||||
int (*list_cb)(const char *elem, int len, void *usr), void *arg)
|
||||
{
|
||||
int ret;
|
||||
const char *lstart, *tmpend, *p;
|
||||
lstart = list;
|
||||
lstart = list_;
|
||||
|
||||
for(;;)
|
||||
{
|
||||
|
||||
@@ -61,7 +61,9 @@
|
||||
#include "cryptlib.h"
|
||||
#include <openssl/crypto.h>
|
||||
|
||||
#ifndef NO_WINDOWS_BRAINDEATH
|
||||
#include "buildinf.h"
|
||||
#endif
|
||||
|
||||
const char *SSLeay_version(int t)
|
||||
{
|
||||
@@ -72,7 +74,7 @@ const char *SSLeay_version(int t)
|
||||
#ifdef DATE
|
||||
static char buf[sizeof(DATE)+11];
|
||||
|
||||
sprintf(buf,"built on: %s",DATE);
|
||||
BIO_snprintf(buf,sizeof buf,"built on: %s",DATE);
|
||||
return(buf);
|
||||
#else
|
||||
return("built on: date not available");
|
||||
@@ -83,7 +85,7 @@ const char *SSLeay_version(int t)
|
||||
#ifdef CFLAGS
|
||||
static char buf[sizeof(CFLAGS)+11];
|
||||
|
||||
sprintf(buf,"compiler: %s",CFLAGS);
|
||||
BIO_snprintf(buf,sizeof buf,"compiler: %s",CFLAGS);
|
||||
return(buf);
|
||||
#else
|
||||
return("compiler: information not available");
|
||||
@@ -94,7 +96,7 @@ const char *SSLeay_version(int t)
|
||||
#ifdef PLATFORM
|
||||
static char buf[sizeof(PLATFORM)+11];
|
||||
|
||||
sprintf(buf,"platform: %s", PLATFORM);
|
||||
BIO_snprintf(buf,sizeof buf,"platform: %s", PLATFORM);
|
||||
return(buf);
|
||||
#else
|
||||
return("platform: information not available");
|
||||
|
||||
@@ -8,7 +8,7 @@ README - What this package is.
|
||||
VERSION - Which version this is and what was changed.
|
||||
KERBEROS - Kerberos version 4 notes.
|
||||
Makefile.PL - An old makefile to build with perl5, not current.
|
||||
Makefile.ssl - The SSLeay makefile
|
||||
Makefile - The SSLeay makefile
|
||||
Makefile.uni - The normal unix makefile.
|
||||
GNUmakefile - The makefile for use with glibc.
|
||||
makefile.bc - A Borland C makefile
|
||||
|
||||
@@ -11,10 +11,9 @@ CFLAG=-g
|
||||
INSTALL_PREFIX=
|
||||
OPENSSLDIR= /usr/local/ssl
|
||||
INSTALLTOP=/usr/local/ssl
|
||||
MAKE= make -f Makefile.ssl
|
||||
MAKEDEPPROG= makedepend
|
||||
MAKEDEPEND= $(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG)
|
||||
MAKEFILE= Makefile.ssl
|
||||
MAKEFILE= Makefile
|
||||
AR= ar r
|
||||
RANLIB= ranlib
|
||||
DES_ENC= des_enc.o fcrypt_b.o
|
||||
@@ -22,6 +21,7 @@ DES_ENC= des_enc.o fcrypt_b.o
|
||||
#DES_ENC= dx86-elf.o yx86-elf.o
|
||||
|
||||
CFLAGS= $(INCLUDES) $(CFLAG)
|
||||
ASFLAGS= $(INCLUDES) $(ASFLAG)
|
||||
|
||||
GENERAL=Makefile
|
||||
TEST=destest.c
|
||||
@@ -93,10 +93,9 @@ asm/yx86unix.cpp: asm/crypt586.pl ../perlasm/x86asm.pl
|
||||
(cd asm; $(PERL) crypt586.pl cpp >yx86unix.cpp)
|
||||
|
||||
files:
|
||||
$(PERL) $(TOP)/util/files.pl Makefile.ssl >> $(TOP)/MINFO
|
||||
$(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO
|
||||
|
||||
links:
|
||||
@$(TOP)/util/point.sh Makefile.ssl Makefile
|
||||
@$(PERL) $(TOP)/util/mklink.pl ../../include/openssl $(EXHEADER)
|
||||
@$(PERL) $(TOP)/util/mklink.pl ../../test $(TEST)
|
||||
@$(PERL) $(TOP)/util/mklink.pl ../../apps $(APPS)
|
||||
@@ -157,18 +156,19 @@ cfb64enc.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
|
||||
cfb64enc.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
|
||||
cfb64enc.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h
|
||||
cfb64enc.o: cfb64enc.c des_locl.h
|
||||
cfb_enc.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
|
||||
cfb_enc.o: ../../include/openssl/des_old.h ../../include/openssl/e_os2.h
|
||||
cfb_enc.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
|
||||
cfb_enc.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
|
||||
cfb_enc.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h
|
||||
cfb_enc.o: ../../include/openssl/ui_compat.h cfb_enc.c des_locl.h
|
||||
cfb_enc.o: ../../e_os.h ../../include/openssl/crypto.h
|
||||
cfb_enc.o: ../../include/openssl/des.h ../../include/openssl/des_old.h
|
||||
cfb_enc.o: ../../include/openssl/e_os2.h ../../include/openssl/opensslconf.h
|
||||
cfb_enc.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
|
||||
cfb_enc.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
|
||||
cfb_enc.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h
|
||||
cfb_enc.o: cfb_enc.c des_locl.h
|
||||
des_enc.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
|
||||
des_enc.o: ../../include/openssl/des_old.h ../../include/openssl/e_os2.h
|
||||
des_enc.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
|
||||
des_enc.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
|
||||
des_enc.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h
|
||||
des_enc.o: ../../include/openssl/ui_compat.h des_enc.c des_locl.h ncbc_enc.c
|
||||
des_enc.o: ../../include/openssl/ui_compat.h des_enc.c des_locl.h
|
||||
des_old.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
|
||||
des_old.o: ../../include/openssl/des_old.h ../../include/openssl/e_os2.h
|
||||
des_old.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
|
||||
@@ -191,13 +191,13 @@ ecb3_enc.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
|
||||
ecb3_enc.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
|
||||
ecb3_enc.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h
|
||||
ecb3_enc.o: des_locl.h ecb3_enc.c
|
||||
ecb_enc.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
|
||||
ecb_enc.o: ../../include/openssl/des_old.h ../../include/openssl/e_os2.h
|
||||
ecb_enc.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
|
||||
ecb_enc.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
|
||||
ecb_enc.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h
|
||||
ecb_enc.o: ../../include/openssl/ui_compat.h des_locl.h des_ver.h ecb_enc.c
|
||||
ecb_enc.o: spr.h
|
||||
ecb_enc.o: ../../include/openssl/bio.h ../../include/openssl/crypto.h
|
||||
ecb_enc.o: ../../include/openssl/des.h ../../include/openssl/des_old.h
|
||||
ecb_enc.o: ../../include/openssl/e_os2.h ../../include/openssl/opensslconf.h
|
||||
ecb_enc.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
|
||||
ecb_enc.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
|
||||
ecb_enc.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h
|
||||
ecb_enc.o: des_locl.h des_ver.h ecb_enc.c spr.h
|
||||
ede_cbcm_enc.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
|
||||
ede_cbcm_enc.o: ../../include/openssl/des_old.h ../../include/openssl/e_os2.h
|
||||
ede_cbcm_enc.o: ../../include/openssl/opensslconf.h
|
||||
@@ -150,9 +150,9 @@ void DES_ede3_cfb_encrypt(const unsigned char *in,unsigned char *out,
|
||||
DES_key_schedule *ks2,DES_key_schedule *ks3,
|
||||
DES_cblock *ivec,int enc)
|
||||
{
|
||||
register DES_LONG d0,d1,v0,v1,n=(numbits+7)/8;
|
||||
register unsigned long l=length;
|
||||
register int num=numbits;
|
||||
register DES_LONG d0,d1,v0,v1;
|
||||
register long l=length;
|
||||
register int num=numbits,n=(numbits+7)/8,i;
|
||||
DES_LONG ti[2];
|
||||
unsigned char *iv;
|
||||
unsigned char ovec[16];
|
||||
@@ -192,10 +192,10 @@ void DES_ede3_cfb_encrypt(const unsigned char *in,unsigned char *out,
|
||||
memmove(ovec,ovec+num/8,8+(num%8 ? 1 : 0));
|
||||
/* now the remaining bits */
|
||||
if(num%8 != 0)
|
||||
for(n=0 ; n < 8 ; ++n)
|
||||
for(i=0 ; i < 8 ; ++i)
|
||||
{
|
||||
ovec[n]<<=num%8;
|
||||
ovec[n]|=ovec[n+1]>>(8-num%8);
|
||||
ovec[i]<<=num%8;
|
||||
ovec[i]|=ovec[i+1]>>(8-num%8);
|
||||
}
|
||||
iv=&ovec[0];
|
||||
c2l(iv,v0);
|
||||
@@ -230,10 +230,10 @@ void DES_ede3_cfb_encrypt(const unsigned char *in,unsigned char *out,
|
||||
memmove(ovec,ovec+num/8,8+(num%8 ? 1 : 0));
|
||||
/* now the remaining bits */
|
||||
if(num%8 != 0)
|
||||
for(n=0 ; n < 8 ; ++n)
|
||||
for(i=0 ; i < 8 ; ++i)
|
||||
{
|
||||
ovec[n]<<=num%8;
|
||||
ovec[n]|=ovec[n+1]>>(8-num%8);
|
||||
ovec[i]<<=num%8;
|
||||
ovec[i]|=ovec[i+1]>>(8-num%8);
|
||||
}
|
||||
iv=&ovec[0];
|
||||
c2l(iv,v0);
|
||||
|
||||
@@ -65,17 +65,15 @@
|
||||
* the second. The second 12 bits will come from the 3rd and half the 4th
|
||||
* byte.
|
||||
*/
|
||||
/* WARNING WARNING: this uses in and out in 8-byte chunks regardless of
|
||||
* length */
|
||||
/* Until Aug 1 2003 this function did not correctly implement CFB-r, so it
|
||||
* will not be compatible with any encryption prior to that date. Ben. */
|
||||
void DES_cfb_encrypt(const unsigned char *in, unsigned char *out, int numbits,
|
||||
long length, DES_key_schedule *schedule, DES_cblock *ivec,
|
||||
int enc)
|
||||
{
|
||||
register DES_LONG d0,d1,v0,v1,n=(numbits+7)/8;
|
||||
register unsigned long l=length;
|
||||
register int num=numbits;
|
||||
register DES_LONG d0,d1,v0,v1;
|
||||
register unsigned long l=length,n=(numbits+7)/8;
|
||||
register int num=numbits,i;
|
||||
DES_LONG ti[2];
|
||||
unsigned char *iv;
|
||||
unsigned char ovec[16];
|
||||
@@ -115,10 +113,10 @@ void DES_cfb_encrypt(const unsigned char *in, unsigned char *out, int numbits,
|
||||
memmove(ovec,ovec+num/8,8+(num%8 ? 1 : 0));
|
||||
/* now the remaining bits */
|
||||
if(num%8 != 0)
|
||||
for(n=0 ; n < 8 ; ++n)
|
||||
for(i=0 ; i < 8 ; ++i)
|
||||
{
|
||||
ovec[n]<<=num%8;
|
||||
ovec[n]|=ovec[n+1]>>(8-num%8);
|
||||
ovec[i]<<=num%8;
|
||||
ovec[i]|=ovec[i+1]>>(8-num%8);
|
||||
}
|
||||
iv=&ovec[0];
|
||||
c2l(iv,v0);
|
||||
@@ -153,10 +151,10 @@ void DES_cfb_encrypt(const unsigned char *in, unsigned char *out, int numbits,
|
||||
memmove(ovec,ovec+num/8,8+(num%8 ? 1 : 0));
|
||||
/* now the remaining bits */
|
||||
if(num%8 != 0)
|
||||
for(n=0 ; n < 8 ; ++n)
|
||||
for(i=0 ; i < 8 ; ++i)
|
||||
{
|
||||
ovec[n]<<=num%8;
|
||||
ovec[n]|=ovec[n+1]>>(8-num%8);
|
||||
ovec[i]<<=num%8;
|
||||
ovec[i]|=ovec[i+1]>>(8-num%8);
|
||||
}
|
||||
iv=&ovec[0];
|
||||
c2l(iv,v0);
|
||||
|
||||
@@ -293,6 +293,8 @@ void DES_decrypt3(DES_LONG *data, DES_key_schedule *ks1,
|
||||
|
||||
#ifndef DES_DEFAULT_OPTIONS
|
||||
|
||||
#if !defined(OPENSSL_FIPS) || !defined(I386_ONLY)
|
||||
|
||||
#undef CBC_ENC_C__DONT_UPDATE_IV
|
||||
#include "ncbc_enc.c" /* DES_ncbc_encrypt */
|
||||
|
||||
@@ -408,4 +410,6 @@ void DES_ede3_cbc_encrypt(const unsigned char *input, unsigned char *output,
|
||||
tin[0]=tin[1]=0;
|
||||
}
|
||||
|
||||
#endif /* !defined(OPENSSL_FIPS) || !defined(I386_ONLY) */
|
||||
|
||||
#endif /* DES_DEFAULT_OPTIONS */
|
||||
|
||||
@@ -60,6 +60,7 @@
|
||||
#include "des_ver.h"
|
||||
#include "spr.h"
|
||||
#include <openssl/opensslv.h>
|
||||
#include <openssl/bio.h>
|
||||
|
||||
OPENSSL_GLOBAL const char *libdes_version="libdes" OPENSSL_VERSION_PTEXT;
|
||||
OPENSSL_GLOBAL const char *DES_version="DES" OPENSSL_VERSION_PTEXT;
|
||||
@@ -97,7 +98,8 @@ const char *DES_options(void)
|
||||
size="int";
|
||||
else
|
||||
size="long";
|
||||
sprintf(buf,"des(%s,%s,%s,%s)",ptr,risc,unroll,size);
|
||||
BIO_snprintf(buf,sizeof buf,"des(%s,%s,%s,%s)",ptr,risc,unroll,
|
||||
size);
|
||||
init=0;
|
||||
}
|
||||
return(buf);
|
||||
|
||||
@@ -65,6 +65,8 @@
|
||||
*/
|
||||
#include "des_locl.h"
|
||||
|
||||
#ifndef OPENSSL_FIPS
|
||||
|
||||
OPENSSL_IMPLEMENT_GLOBAL(int,DES_check_key); /* defaults to false */
|
||||
|
||||
static const unsigned char odd_parity[256]={
|
||||
@@ -405,3 +407,5 @@ void des_fixup_key_parity(des_cblock *key)
|
||||
des_set_odd_parity(key);
|
||||
}
|
||||
*/
|
||||
|
||||
#endif /* ndef OPENSSL_FIPS */
|
||||
|
||||
@@ -10,10 +10,9 @@ CFLAG=-g
|
||||
INSTALL_PREFIX=
|
||||
OPENSSLDIR= /usr/local/ssl
|
||||
INSTALLTOP=/usr/local/ssl
|
||||
MAKE= make -f Makefile.ssl
|
||||
MAKEDEPPROG= makedepend
|
||||
MAKEDEPEND= $(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG)
|
||||
MAKEFILE= Makefile.ssl
|
||||
MAKEFILE= Makefile
|
||||
AR= ar r
|
||||
|
||||
CFLAGS= $(INCLUDES) $(CFLAG)
|
||||
@@ -44,10 +43,9 @@ lib: $(LIBOBJ)
|
||||
@touch lib
|
||||
|
||||
files:
|
||||
$(PERL) $(TOP)/util/files.pl Makefile.ssl >> $(TOP)/MINFO
|
||||
$(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO
|
||||
|
||||
links:
|
||||
@$(TOP)/util/point.sh Makefile.ssl Makefile
|
||||
@$(PERL) $(TOP)/util/mklink.pl ../../include/openssl $(EXHEADER)
|
||||
@$(PERL) $(TOP)/util/mklink.pl ../../test $(TEST)
|
||||
@$(PERL) $(TOP)/util/mklink.pl ../../apps $(APPS)
|
||||
@@ -10,10 +10,9 @@ CFLAG=-g
|
||||
INSTALL_PREFIX=
|
||||
OPENSSLDIR= /usr/local/ssl
|
||||
INSTALLTOP=/usr/local/ssl
|
||||
MAKE= make -f Makefile.ssl
|
||||
MAKEDEPPROG= makedepend
|
||||
MAKEDEPEND= $(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG)
|
||||
MAKEFILE= Makefile.ssl
|
||||
MAKEFILE= Makefile
|
||||
AR= ar r
|
||||
|
||||
CFLAGS= $(INCLUDES) $(CFLAG)
|
||||
@@ -46,10 +45,9 @@ lib: $(LIBOBJ)
|
||||
@touch lib
|
||||
|
||||
files:
|
||||
$(PERL) $(TOP)/util/files.pl Makefile.ssl >> $(TOP)/MINFO
|
||||
$(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO
|
||||
|
||||
links:
|
||||
@$(TOP)/util/point.sh Makefile.ssl Makefile
|
||||
@$(PERL) $(TOP)/util/mklink.pl ../../include/openssl $(EXHEADER)
|
||||
@$(PERL) $(TOP)/util/mklink.pl ../../test $(TEST)
|
||||
@$(PERL) $(TOP)/util/mklink.pl ../../apps $(APPS)
|
||||
@@ -64,6 +64,7 @@
|
||||
#include <openssl/dsa.h>
|
||||
#include <openssl/rand.h>
|
||||
|
||||
#ifndef OPENSSL_FIPS
|
||||
int DSA_generate_key(DSA *dsa)
|
||||
{
|
||||
int ok=0;
|
||||
@@ -103,3 +104,4 @@ err:
|
||||
return(ok);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -10,10 +10,9 @@ CFLAG=-g
|
||||
INSTALL_PREFIX=
|
||||
OPENSSLDIR= /usr/local/ssl
|
||||
INSTALLTOP=/usr/local/ssl
|
||||
MAKE= make -f Makefile.ssl
|
||||
MAKEDEPPROG= makedepend
|
||||
MAKEDEPEND= $(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG)
|
||||
MAKEFILE= Makefile.ssl
|
||||
MAKEFILE= Makefile
|
||||
AR= ar r
|
||||
|
||||
CFLAGS= $(INCLUDES) $(CFLAG)
|
||||
@@ -46,10 +45,9 @@ lib: $(LIBOBJ)
|
||||
@touch lib
|
||||
|
||||
files:
|
||||
$(PERL) $(TOP)/util/files.pl Makefile.ssl >> $(TOP)/MINFO
|
||||
$(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO
|
||||
|
||||
links:
|
||||
@$(TOP)/util/point.sh Makefile.ssl Makefile
|
||||
@$(PERL) $(TOP)/util/mklink.pl ../../include/openssl $(EXHEADER)
|
||||
@$(PERL) $(TOP)/util/mklink.pl ../../test $(TEST)
|
||||
@$(PERL) $(TOP)/util/mklink.pl ../../apps $(APPS)
|
||||
@@ -383,7 +383,7 @@ int DSO_set_filename(DSO *dso, const char *filename)
|
||||
DSOerr(DSO_F_DSO_SET_FILENAME,ERR_R_MALLOC_FAILURE);
|
||||
return(0);
|
||||
}
|
||||
strcpy(copied, filename);
|
||||
BUF_strlcpy(copied, filename, strlen(filename) + 1);
|
||||
if(dso->filename)
|
||||
OPENSSL_free(dso->filename);
|
||||
dso->filename = copied;
|
||||
@@ -422,7 +422,7 @@ char *DSO_convert_filename(DSO *dso, const char *filename)
|
||||
ERR_R_MALLOC_FAILURE);
|
||||
return(NULL);
|
||||
}
|
||||
strcpy(result, filename);
|
||||
BUF_strlcpy(result, filename, strlen(filename) + 1);
|
||||
}
|
||||
return(result);
|
||||
}
|
||||
|
||||
@@ -10,10 +10,9 @@ CFLAG=-g
|
||||
INSTALL_PREFIX=
|
||||
OPENSSLDIR= /usr/local/ssl
|
||||
INSTALLTOP=/usr/local/ssl
|
||||
MAKE= make -f Makefile.ssl
|
||||
MAKEDEPPROG= makedepend
|
||||
MAKEDEPEND= $(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG)
|
||||
MAKEFILE= Makefile.ssl
|
||||
MAKEFILE= Makefile
|
||||
AR= ar r
|
||||
|
||||
CFLAGS= $(INCLUDES) $(CFLAG)
|
||||
@@ -47,10 +46,9 @@ lib: $(LIBOBJ)
|
||||
@touch lib
|
||||
|
||||
files:
|
||||
$(PERL) $(TOP)/util/files.pl Makefile.ssl >> $(TOP)/MINFO
|
||||
$(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO
|
||||
|
||||
links:
|
||||
@$(TOP)/util/point.sh Makefile.ssl Makefile
|
||||
@$(PERL) $(TOP)/util/mklink.pl ../../include/openssl $(EXHEADER)
|
||||
@$(PERL) $(TOP)/util/mklink.pl ../../test $(TEST)
|
||||
@$(PERL) $(TOP)/util/mklink.pl ../../apps $(APPS)
|
||||
@@ -896,7 +896,7 @@ int ec_GFp_simple_oct2point(const EC_GROUP *group, EC_POINT *point,
|
||||
}
|
||||
form = buf[0];
|
||||
y_bit = form & 1;
|
||||
form = form & ~1;
|
||||
form = form & ~1U;
|
||||
if ((form != 0) && (form != POINT_CONVERSION_COMPRESSED)
|
||||
&& (form != POINT_CONVERSION_UNCOMPRESSED)
|
||||
&& (form != POINT_CONVERSION_HYBRID))
|
||||
|
||||
@@ -10,10 +10,9 @@ CFLAG=-g
|
||||
INSTALL_PREFIX=
|
||||
OPENSSLDIR= /usr/local/ssl
|
||||
INSTALLTOP=/usr/local/ssl
|
||||
MAKE= make -f Makefile.ssl
|
||||
MAKEDEPPROG= makedepend
|
||||
MAKEDEPEND= $(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG)
|
||||
MAKEFILE= Makefile.ssl
|
||||
MAKEFILE= Makefile
|
||||
AR= ar r
|
||||
|
||||
CFLAGS= $(INCLUDES) $(CFLAG)
|
||||
@@ -54,10 +53,9 @@ lib: $(LIBOBJ)
|
||||
@touch lib
|
||||
|
||||
files:
|
||||
$(PERL) $(TOP)/util/files.pl Makefile.ssl >> $(TOP)/MINFO
|
||||
$(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO
|
||||
|
||||
links:
|
||||
@$(TOP)/util/point.sh Makefile.ssl Makefile
|
||||
@$(PERL) $(TOP)/util/mklink.pl ../../include/openssl $(EXHEADER)
|
||||
@$(PERL) $(TOP)/util/mklink.pl ../../test $(TEST)
|
||||
@$(PERL) $(TOP)/util/mklink.pl ../../apps $(APPS)
|
||||
@@ -160,15 +160,19 @@ static int int_ctrl_helper(ENGINE *e, int cmd, long i, void *p, void (*f)())
|
||||
case ENGINE_CTRL_GET_NAME_LEN_FROM_CMD:
|
||||
return strlen(e->cmd_defns[idx].cmd_name);
|
||||
case ENGINE_CTRL_GET_NAME_FROM_CMD:
|
||||
return sprintf(s, "%s", e->cmd_defns[idx].cmd_name);
|
||||
return BIO_snprintf(s,strlen(e->cmd_defns[idx].cmd_name) + 1,
|
||||
"%s", e->cmd_defns[idx].cmd_name);
|
||||
case ENGINE_CTRL_GET_DESC_LEN_FROM_CMD:
|
||||
if(e->cmd_defns[idx].cmd_desc)
|
||||
return strlen(e->cmd_defns[idx].cmd_desc);
|
||||
return strlen(int_no_description);
|
||||
case ENGINE_CTRL_GET_DESC_FROM_CMD:
|
||||
if(e->cmd_defns[idx].cmd_desc)
|
||||
return sprintf(s, "%s", e->cmd_defns[idx].cmd_desc);
|
||||
return sprintf(s, "%s", int_no_description);
|
||||
return BIO_snprintf(s,
|
||||
strlen(e->cmd_defns[idx].cmd_desc) + 1,
|
||||
"%s", e->cmd_defns[idx].cmd_desc);
|
||||
return BIO_snprintf(s, strlen(int_no_description) + 1,"%s",
|
||||
int_no_description);
|
||||
case ENGINE_CTRL_GET_CMD_FLAGS:
|
||||
return e->cmd_defns[idx].cmd_flags;
|
||||
}
|
||||
|
||||
@@ -107,14 +107,14 @@ static int int_def_cb(const char *alg, int len, void *arg)
|
||||
}
|
||||
|
||||
|
||||
int ENGINE_set_default_string(ENGINE *e, const char *list)
|
||||
int ENGINE_set_default_string(ENGINE *e, const char *def_list)
|
||||
{
|
||||
unsigned int flags = 0;
|
||||
if (!CONF_parse_list(list, ',', 1, int_def_cb, &flags))
|
||||
if (!CONF_parse_list(def_list, ',', 1, int_def_cb, &flags))
|
||||
{
|
||||
ENGINEerr(ENGINE_F_ENGINE_SET_DEFAULT_STRING,
|
||||
ENGINE_R_INVALID_STRING);
|
||||
ERR_add_error_data(2, "str=",list);
|
||||
ERR_add_error_data(2, "str=",def_list);
|
||||
return 0;
|
||||
}
|
||||
return ENGINE_set_default(e, flags);
|
||||
|
||||
@@ -513,7 +513,7 @@ ENGINE *ENGINE_get_digest_engine(int nid);
|
||||
* structure will have had its reference count up'd so the caller
|
||||
* should still free their own reference 'e'. */
|
||||
int ENGINE_set_default_RSA(ENGINE *e);
|
||||
int ENGINE_set_default_string(ENGINE *e, const char *list);
|
||||
int ENGINE_set_default_string(ENGINE *e, const char *def_list);
|
||||
/* Same for the other "methods" */
|
||||
int ENGINE_set_default_DSA(ENGINE *e);
|
||||
int ENGINE_set_default_DH(ENGINE *e);
|
||||
@@ -616,17 +616,20 @@ typedef int (*dynamic_bind_engine)(ENGINE *e, const char *id,
|
||||
const dynamic_fns *fns);
|
||||
#define IMPLEMENT_DYNAMIC_BIND_FN(fn) \
|
||||
int bind_engine(ENGINE *e, const char *id, const dynamic_fns *fns) { \
|
||||
if(!CRYPTO_set_mem_functions(fns->mem_fns.malloc_cb, \
|
||||
fns->mem_fns.realloc_cb, fns->mem_fns.free_cb)) \
|
||||
return 0; \
|
||||
CRYPTO_set_locking_callback(fns->lock_fns.lock_locking_cb); \
|
||||
CRYPTO_set_add_lock_callback(fns->lock_fns.lock_add_lock_cb); \
|
||||
CRYPTO_set_dynlock_create_callback(fns->lock_fns.dynlock_create_cb); \
|
||||
CRYPTO_set_dynlock_lock_callback(fns->lock_fns.dynlock_lock_cb); \
|
||||
CRYPTO_set_dynlock_destroy_callback(fns->lock_fns.dynlock_destroy_cb); \
|
||||
if(!CRYPTO_set_ex_data_implementation(fns->ex_data_fns)) \
|
||||
return 0; \
|
||||
if(!ERR_set_implementation(fns->err_fns)) return 0; \
|
||||
if (ERR_get_implementation() != fns->err_fns) \
|
||||
{ \
|
||||
if(!CRYPTO_set_mem_functions(fns->mem_fns.malloc_cb, \
|
||||
fns->mem_fns.realloc_cb, fns->mem_fns.free_cb)) \
|
||||
return 0; \
|
||||
CRYPTO_set_locking_callback(fns->lock_fns.lock_locking_cb); \
|
||||
CRYPTO_set_add_lock_callback(fns->lock_fns.lock_add_lock_cb); \
|
||||
CRYPTO_set_dynlock_create_callback(fns->lock_fns.dynlock_create_cb); \
|
||||
CRYPTO_set_dynlock_lock_callback(fns->lock_fns.dynlock_lock_cb); \
|
||||
CRYPTO_set_dynlock_destroy_callback(fns->lock_fns.dynlock_destroy_cb); \
|
||||
if(!CRYPTO_set_ex_data_implementation(fns->ex_data_fns)) \
|
||||
return 0; \
|
||||
if(!ERR_set_implementation(fns->err_fns)) return 0; \
|
||||
} \
|
||||
if(!fn(e,id)) return 0; \
|
||||
return 1; }
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user