Compare commits

...

1332 Commits

Author SHA1 Message Date
Matt Caswell
cdac2e8928 Prepare for 1.0.0q release
Reviewed-by: Stephen Henson <steve@openssl.org>
2015-01-15 14:56:27 +00:00
Matt Caswell
01fb34ad43 make update
Reviewed-by: Stephen Henson <steve@openssl.org>
2015-01-15 14:56:27 +00:00
Matt Caswell
08fac3fb6f Updates to CHANGES and NEWS
Reviewed-by: Dr Stephen Henson <steve@openssl.org>
2015-01-15 13:18:57 +00:00
Richard Levitte
0c8dc6ebe5 Fixup installation script for VMS
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-01-14 19:17:17 +01:00
Richard Levitte
f4f1e80801 VMS fixups for 1.0.0
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-01-14 00:18:23 +01:00
Matt Caswell
36f309c50a Make output from openssl version -f consistent with previous versions
Reviewed-by: Andy Polyakov <appro@openssl.org>
(cherry picked from commit 2d2671790e)
2015-01-13 11:29:21 +00:00
Matt Caswell
94e5cf36bd Fix warning where BIO_FLAGS_UPLINK was being redefined.
This warning breaks the build in 1.0.0 and 0.9.8

Reviewed-by: Andy Polyakov <appro@openssl.org>
(cherry picked from commit b1ffc6ca1c)
2015-01-13 11:25:55 +00:00
Matt Caswell
23df532ec4 Avoid deprecation problems in Visual Studio 13
Reviewed-by: Andy Polyakov <appro@openssl.org>
(cherry picked from commit 86d21d0b95)
2015-01-13 09:48:38 +00:00
Matt Caswell
b960060a0d Further windows specific .gitignore entries
Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
(cherry picked from commit 41c9cfbc4e)
2015-01-09 23:41:07 +00:00
Matt Caswell
e9cb6eb1d3 Update .gitignore with windows files to be excluded from git
Reviewed-by: Tim Hudson <tjh@openssl.org>

Conflicts:
	.gitignore

(cherry picked from commit 04f670cf3d)
2015-01-09 11:30:50 +00:00
Matt Caswell
181ae2badb Fix build failure on Windows due to undefined cflags identifier
Reviewed-by: Tim Hudson <tjh@openssl.org>
(cherry picked from commit 5c5e7e1a7e)
2015-01-08 19:28:43 +00:00
Matt Caswell
a98051fb47 Prepare for 1.0.0q-dev
Reviewed-by: Stephen Henson <steve@openssl.org>
2015-01-08 14:23:38 +00:00
Matt Caswell
225628f280 Prepare for 1.0.0p release
Reviewed-by: Stephen Henson <steve@openssl.org>
2015-01-08 14:21:42 +00:00
Matt Caswell
ca39b261bf make update
Reviewed-by: Stephen Henson <steve@openssl.org>
2015-01-08 14:21:42 +00:00
Matt Caswell
c1beec0e6d CHANGES and NEWS updates for release
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Steve Henson <steve@openssl.org>
2015-01-08 14:14:56 +00:00
Matt Caswell
b095884a58 A memory leak can occur in dtls1_buffer_record if either of the calls to
ssl3_setup_buffers or pqueue_insert fail. The former will fail if there is a
malloc failure, whilst the latter will fail if attempting to add a duplicate
record to the queue. This should never happen because duplicate records should
be detected and dropped before any attempt to add them to the queue.
Unfortunately records that arrive that are for the next epoch are not being
recorded correctly, and therefore replays are not being detected.
Additionally, these "should not happen" failures that can occur in
dtls1_buffer_record are not being treated as fatal and therefore an attacker
could exploit this by sending repeated replay records for the next epoch,
eventually causing a DoS through memory exhaustion.

Thanks to Chris Mueller for reporting this issue and providing initial
analysis and a patch. Further analysis and the final patch was performed by
Matt Caswell from the OpenSSL development team.

CVE-2015-0206

Reviewed-by: Dr Stephen Henson <steve@openssl.org>
(cherry picked from commit 652ff0f4796eecd8729b4690f2076d1c7ccb2862)
2015-01-08 14:14:56 +00:00
Dr. Stephen Henson
f7fe3d235a Unauthenticated DH client certificate fix.
Fix to prevent use of DH client certificates without sending
certificate verify message.

If we've used a client certificate to generate the premaster secret
ssl3_get_client_key_exchange returns 2 and ssl3_get_cert_verify is
never called.

We can only skip the certificate verify message in
ssl3_get_cert_verify if the client didn't send a certificate.

Thanks to Karthikeyan Bhargavan for reporting this issue.
CVE-2015-0205
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-01-08 14:14:56 +00:00
Matt Caswell
b2688c9161 Follow on from CVE-2014-3571. This fixes the code that was the original source
of the crash due to p being NULL. Steve's fix prevents this situation from
occuring - however this is by no means obvious by looking at the code for
dtls1_get_record. This fix just makes things look a bit more sane.

Conflicts:
	ssl/d1_pkt.c

Reviewed-by: Dr Stephen Henson <steve@openssl.org>
2015-01-08 14:14:29 +00:00
Dr. Stephen Henson
bf6fa208b5 Fix crash in dtls1_get_record whilst in the listen state where you get two
separate reads performed - one for the header and one for the body of the
handshake record.

CVE-2014-3571

Reviewed-by: Matt Caswell <matt@openssl.org>
2015-01-08 11:25:45 +00:00
Andy Polyakov
eb37b6aa41 Fix for CVE-2014-3570.
Reviewed-by: Emilia Kasper <emilia@openssl.org>
2015-01-08 11:25:45 +00:00
Dr. Stephen Henson
f66f76a24a fix error discrepancy
Reviewed-by: Matt Caswell <matt@openssl.org>
(cherry picked from commit 4a4d415857)
2015-01-07 18:11:07 +00:00
Dr. Stephen Henson
65c63da207 use correct credit in CHANGES
Reviewed-by: Matt Caswell <matt@openssl.org>
(cherry picked from commit 4138e38825)
2015-01-06 22:41:45 +00:00
Dr. Stephen Henson
9f028e4a78 use correct function name
Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(cherry picked from commit cb62ab4b17)
2015-01-06 21:05:07 +00:00
Matt Caswell
64eec8f898 Remove blank line from start of cflags character array in buildinf.h
Reviewed-by: Richard Levitte <levitte@openssl.org>
(cherry picked from commit b691154e18)
2015-01-06 15:39:32 +00:00
Dr. Stephen Henson
08a88774bd Only allow ephemeral RSA keys in export ciphersuites.
OpenSSL clients would tolerate temporary RSA keys in non-export
ciphersuites. It also had an option SSL_OP_EPHEMERAL_RSA which
enabled this server side. Remove both options as they are a
protocol violation.

Thanks to Karthikeyan Bhargavan for reporting this issue.
(CVE-2015-0204)
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>

(cherry picked from commit 4b4c1fcc88)

Conflicts:
	CHANGES
	doc/ssl/SSL_CTX_set_options.pod
2015-01-06 13:18:46 +00:00
Dr. Stephen Henson
802a070bb6 ECDH downgrade bug fix.
Fix bug where an OpenSSL client would accept a handshake using an
ephemeral ECDH ciphersuites with the server key exchange message omitted.

Thanks to Karthikeyan Bhargavan for reporting this issue.

CVE-2014-3572
Reviewed-by: Matt Caswell <matt@openssl.org>

(cherry picked from commit b15f876964)

Conflicts:
	CHANGES
2015-01-05 23:52:28 +00:00
Dr. Stephen Henson
31c65a7bc0 update ordinals
Reviewed-by: Emilia Käsper <emilia@openssl.org>
2015-01-05 16:50:31 +00:00
Dr. Stephen Henson
208a6012be Fix various certificate fingerprint issues.
By using non-DER or invalid encodings outside the signed portion of a
certificate the fingerprint can be changed without breaking the signature.
Although no details of the signed portion of the certificate can be changed
this can cause problems with some applications: e.g. those using the
certificate fingerprint for blacklists.

1. Reject signatures with non zero unused bits.

If the BIT STRING containing the signature has non zero unused bits reject
the signature. All current signature algorithms require zero unused bits.

2. Check certificate algorithm consistency.

Check the AlgorithmIdentifier inside TBS matches the one in the
certificate signature. NB: this will result in signature failure
errors for some broken certificates.

3. Check DSA/ECDSA signatures use DER.

Reencode DSA/ECDSA signatures and compare with the original received
signature. Return an error if there is a mismatch.

This will reject various cases including garbage after signature
(thanks to Antti Karjalainen and Tuomo Untinen from the Codenomicon CROSS
program for discovering this case) and use of BER or invalid ASN.1 INTEGERs
(negative or with leading zeroes).

CVE-2014-8275
Reviewed-by: Emilia Käsper <emilia@openssl.org>

(cherry picked from commit 684400ce19)

Conflicts:
	CHANGES
	crypto/dsa/dsa_asn1.c
2015-01-05 15:06:15 +00:00
Dr. Stephen Henson
d7f8a7cafd Constify ASN1_TYPE_cmp add X509_ALGOR_cmp.
Reviewed-by: Emilia Käsper <emilia@openssl.org>
(cherry picked from commit 4c52816d35)

Conflicts:
	crypto/asn1/x_algor.c
	crypto/x509/x509.h
2015-01-05 14:57:39 +00:00
Dr. Stephen Henson
0f1c30b00d Reject invalid constructed encodings.
According to X6.90 null, object identifier, boolean, integer and enumerated
types can only have primitive encodings: return an error if any of
these are received with a constructed encoding.
Reviewed-by: Emilia Käsper <emilia@openssl.org>

(cherry picked from commit f5e4b6b5b5)

Conflicts:
	crypto/asn1/asn1_err.c
2015-01-05 14:39:07 +00:00
Matt Caswell
c4b969639a Fix a problem if CFLAGS is too long cversion.c fails to compile when config
is run with --strict-warnings.

Reviewed-by: Richard Levitte <levitte@openssl.org>
(cherry picked from commit 488f16e31b)
2014-12-19 14:11:20 +00:00
Kurt Roeckx
bfb2e4b280 Return error when a bit string indicates an invalid amount of bits left
Reviewed-by: Matt Caswell <matt@openssl.org>
2014-12-18 15:12:34 +01:00
Emilia Kasper
d8c8a718a2 Revert "RT3425: constant-time evp_enc"
Causes more problems than it fixes: even though error codes
are not part of the stable API, several users rely on the
specific error code, and the change breaks them. Conversely,
we don't have any concrete use-cases for constant-time behaviour here.

This reverts commit b55ff319f8.

Reviewed-by: Andy Polyakov <appro@openssl.org>
2014-12-17 14:56:46 +01:00
Adam Langley
40c2812f56 Premaster secret handling fixes
From BoringSSL
- Send an alert when the client key exchange isn't correctly formatted.
- Reject overly short RSA ciphertexts to avoid a (benign) out-of-bounds memory access.

Reviewed-by: Kurt Roeckx <kurt@openssl.org>
(cherry picked from commit 4aecfd4d9f)
2014-12-17 14:04:14 +01:00
Matt Caswell
2e3e3d278e Add OPENSSL_NO_ECDH guards
Reviewed-by: Emilia Käsper <emilia@openssl.org>
(cherry picked from commit 7f9edfd23a)
2014-12-16 10:22:20 +00:00
Matt Caswell
2ececf59de Remove extraneous white space, and add some braces
Reviewed-by: Emilia Käsper <emilia@openssl.org>
(cherry picked from commit 55e530265a)
2014-12-16 00:11:02 +00:00
Matt Caswell
a60536348b DTLS fixes for signed/unsigned issues
Reviewed-by: Emilia Käsper <emilia@openssl.org>
(cherry picked from commit 1904d21123)
2014-12-16 00:11:02 +00:00
Matt Caswell
9d410579a7 Checkout return value of dtls1_output_cert_chain
Reviewed-by: Tim Hudson <tjh@openssl.org>
(cherry picked from commit 9beb948c0d)
2014-12-15 21:29:49 +00:00
Matt Caswell
4f90ef0c5b Check return value of ssl3_output_cert_chain
Based on commit 66f96fe2d5 by Steve Henson

Reviewed-by: Tim Hudson <tjh@openssl.org>
(cherry picked from commit ce5ddefc43)
2014-12-15 21:29:49 +00:00
Matt Caswell
eae2bb2f1f Fix memory leak in s2_srvr.c if BUF_MEM_grow fails
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Kurt Roeckx <kurt@openssl.org>
(cherry picked from commit d04a1e0b5b)
2014-12-13 00:06:10 +00:00
Matt Caswell
c313270836 Fixed memory leak if BUF_MEM_grow fails
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Kurt Roeckx <kurt@openssl.org>
(cherry picked from commit bb1ddd3d9a)
2014-12-13 00:06:10 +00:00
Matt Caswell
af8a66d10d Fix use of NULL memory pointer in X509_VERIFY_PARAM_new in the event of a
malloc failure.

Reviewed-by: Kurt Roeckx <kurt@openssl.org>
(cherry picked from commit c6a84ff351)
2014-12-12 23:52:41 +00:00
Matt Caswell
ec5c25b3b4 Fixed memory leak in the event of a failure of BUF_MEM_grow
Reviewed-by: Richard Levitte <levitte@openssl.org>
(cherry picked from commit 41bf250130)
2014-12-08 16:51:01 +00:00
Matt Caswell
38afaa48ec Fix memory leak in SSL_new if errors occur.
Reviewed-by: Richard Levitte <levitte@openssl.org>
(cherry picked from commit 76e6509085)
2014-12-08 16:51:01 +00:00
Matt Caswell
954818fe60 Remove incorrect code inadvertently introduced through commit 59669b6ab.
Reviewed-by: Tim Hudson <tjh@openssl.org>

Conflicts:
	ssl/d1_lib.c
2014-12-04 14:25:09 +00:00
Matt Caswell
027381f68c Remove "#if 0" code
Reviewed-by: Tim Hudson <tjh@openssl.org>
(cherry picked from commit 4bb8eb9ce4)
2014-12-03 09:43:49 +00:00
Matt Caswell
a900b3b51c Only use the fallback mtu after 2 unsuccessful retransmissions if it is less
than the mtu we are already using

Reviewed-by: Tim Hudson <tjh@openssl.org>
(cherry picked from commit 047f21593e)
2014-12-03 09:43:49 +00:00
Matt Caswell
82d7247fc5 Updates to s_client and s_server to remove the constant 28 (for IPv4 header
and UDP header) when setting an mtu. This constant is not always correct (e.g.
if using IPv6). Use the new DTLS_CTRL functions instead.

Reviewed-by: Tim Hudson <tjh@openssl.org>
(cherry picked from commit 464ce92026)
2014-12-03 09:43:49 +00:00
Matt Caswell
ceb4c684e4 If we really get a situation where the underlying mtu is less than the minimum
we will support then dtls1_do_write can go into an infinite loop. This commit
fixes that.

Reviewed-by: Tim Hudson <tjh@openssl.org>
(cherry picked from commit d3d9eef316)
2014-12-03 09:43:49 +00:00
Matt Caswell
a8da754d84 Fix dtls_query_mtu so that it will always either complete with an mtu that is
at least the minimum or it will fail.
There were some instances in dtls1_query_mtu where the final mtu can end up
being less than the minimum, i.e. where the user has set an mtu manually. This
shouldn't be allowed. Also remove dtls1_guess_mtu that, despite having
logic for guessing an mtu, was actually only ever used to work out the minimum
mtu to use.

Reviewed-by: Tim Hudson <tjh@openssl.org>
(cherry picked from commit 1620a2e49c)
2014-12-03 09:43:49 +00:00
Matt Caswell
8ccb44e6f5 Remove instances in libssl of the constant 28 (for size of IPv4 header + UDP)
and instead use the value provided by the underlying BIO. Also provide some
new DTLS_CTRLs so that the library user can set the mtu without needing to
know this constant. These new DTLS_CTRLs provide the capability to set the
link level mtu to be used (i.e. including this IP/UDP overhead). The previous
DTLS_CTRLs required the library user to subtract this overhead first.

Reviewed-by: Tim Hudson <tjh@openssl.org>
(cherry picked from commit 59669b6abf)

Conflicts:
	ssl/d1_both.c
	ssl/ssl.h
	ssl/ssl_lib.c
2014-12-03 09:43:47 +00:00
Matt Caswell
bbfdd1f0c9 There are a number of instances throughout the code where the constant 28 is
used with no explanation. Some of this was introduced as part of RT#1929. The
value 28 is the length of the IP header (20 bytes) plus the UDP header (8
bytes). However use of this constant is incorrect because there may be
instances where a different value is needed, e.g. an IPv4 header is 20 bytes
but an IPv6 header is 40. Similarly you may not be using UDP (e.g. SCTP).
This commit introduces a new BIO_CTRL that provides the value to be used for
this mtu "overhead". It will be used by subsequent commits.

Reviewed-by: Tim Hudson <tjh@openssl.org>
(cherry picked from commit 0d3ae34df5)

Conflicts:
	crypto/bio/bio.h
	crypto/bio/bss_dgram.c
2014-12-03 09:41:16 +00:00
Matt Caswell
8724f9f9cf The first call to query the mtu in dtls1_do_write correctly checks that the
mtu that we have received is not less than the minimum. If its less it uses the
minimum instead. The second call to query the mtu does not do that, but
instead uses whatever comes back. We have seen an instance in RT#3592 where we
have got an unreasonably small mtu come back. This commit makes both query
checks consistent.

Reviewed-by: Tim Hudson <tjh@openssl.org>
(cherry picked from commit 6abb0d1f8e)
2014-12-03 09:38:10 +00:00
Matt Caswell
6d41cbb63a The SSL_OP_NO_QUERY_MTU option is supposed to stop the mtu from being
automatically updated, and we should use the one provided instead.
Unfortunately there are a couple of locations where this is not respected.

Reviewed-by: Tim Hudson <tjh@openssl.org>
(cherry picked from commit 001235778a)
2014-12-03 09:38:10 +00:00
Matt Caswell
04a73c844f Verify that we have a sensible message len and fail if not
RT#3592 provides an instance where the OPENSSL_assert that this commit
replaces can be hit. I was able to recreate this issue by forcing the
underlying BIO to misbehave and come back with very small mtu values. This
happens the second time around the while loop after we have detected that the
MTU has been exceeded following the call to dtls1_write_bytes.

Reviewed-by: Tim Hudson <tjh@openssl.org>
(cherry picked from commit cf75017bfd)
2014-12-03 09:38:10 +00:00
Richard Levitte
87ff17a05d Check for FindNextFile when defining it rather than FindFirstFile
Reviewed-by: Matt Caswell <matt@openssl.org>
2014-11-28 23:31:53 +01:00
Richard Levitte
d93112abc6 [PR3597] Advance to the next state variant when reusing messages.
Previously, state variant was not advanced, which resulted in state
being stuck in the st1 variant (usually "_A").

This broke certificate callback retry logic when accepting connections
that were using SSLv2 ClientHello (hence reusing the message), because
their state never advanced to SSL3_ST_SR_CLNT_HELLO_C variant required
for the retry code path.

Reported by Yichun Zhang (agentzh).

Signed-off-by: Piotr Sikora <piotr@cloudflare.com>
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
2014-11-28 23:31:53 +01:00
Richard Levitte
875a33d7f7 Correct some layout issues, convert all remaining tabs to appropriate amounts of spaces.
Reviewed-by: Matt Caswell <matt@openssl.org>
(cherry picked from commit 8123d158ab)
2014-11-28 17:04:32 +01:00
Alok Menghrajani
cf48a6d7f6 Improves the proxy certificates howto doc.
The current documentation contains a bunch of spelling and grammar mistakes. I also
found it hard to understand some paragraphs, so here is my attempt to improve its
readability.

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(cherry picked from commit 03b637a730)
2014-11-28 17:04:32 +01:00
Matt Caswell
7f3490e685 Fixed warning in ssl2_enc
Reviewed-by: Richard Levitte <levitte@openssl.org>
(cherry picked from commit 2db95e094d)
2014-11-27 21:58:32 +00:00
Matt Caswell
dcf7a2dc4a Check EVP_Cipher return values for SSL2
Reviewed-by: Richard Levitte <levitte@openssl.org>
(cherry picked from commit 5fc8bb6ab7)
2014-11-27 21:58:32 +00:00
Matt Caswell
6ff76b3347 Add checks to the return value of EVP_Cipher to prevent silent encryption failure.
PR#1767

Reviewed-by: Richard Levitte <levitte@openssl.org>
(cherry picked from commit 244d0955ad)
2014-11-27 21:58:31 +00:00
Matt Caswell
3b12515180 Remove redundant checks in ssl_cert_dup. This was causing spurious error messages when using GOST
PR#3613

Reviewed-by: Richard Levitte <levitte@openssl.org>
(cherry picked from commit fc3968a25c)
2014-11-27 20:55:52 +00:00
Matt Caswell
4e73dc5b76 Remove duplicated code
Reviewed-by: Dr. Stephen Henson <steve@openssl.org>
2014-11-27 14:33:55 +00:00
Matt Caswell
67eb85d7d4 Tidy up ocsp help output
Reviewed-by: Dr. Stephen Henson <steve@openssl.org>
(cherry picked from commit 5e31a40f47)

Conflicts:
	apps/ocsp.c

(cherry picked from commit e164582690)
2014-11-27 14:21:42 +00:00
André Guerreiro
915a3b1c21 Add documentation on -timeout option in the ocsp utility
PR#3612

Reviewed-by: Dr. Stephen Henson <steve@openssl.org>
(cherry picked from commit de87dd46c1)
(cherry picked from commit 4d3df37bc7)
2014-11-27 14:21:42 +00:00
Matt Caswell
e1b1d82aab Fixed memory leak due to incorrect freeing of DTLS reassembly bit mask
PR#3608

Reviewed-by: Tim Hudson <tjh@openssl.org>
(cherry picked from commit 8a35dbb6d8)
2014-11-26 10:18:15 +00:00
Matt Caswell
c25456633c Corrected comments in ssl.h about SSLv23_method and friends
PR#3574

Reviewed-by: Dr. Stephen Henson <steve@openssl.org>
(cherry picked from commit 3a0765882c)
2014-11-25 22:28:42 +00:00
Dr. Stephen Henson
aaf9335970 Fix cross reference table generator.
If the hash or public key algorithm is "undef" the signature type
will receive special handling and shouldn't be included in the
cross reference table.
Reviewed-by: Tim Hudson <tjh@openssl.org>

(cherry picked from commit 55f7fb8848)

Conflicts:
	crypto/objects/obj_xref.h
2014-11-13 13:40:41 +00:00
Alok Menghrajani
cee17f96f1 Fixes a minor typo in the EVP docs.
Out is the buffer which needs to contain at least inl + cipher_block_size - 1 bytes. Outl
is just an int*.

Reviewed-by: Emilia Käsper <emilia@openssl.org>
(cherry picked from commit 5211e094de)
2014-11-12 21:05:44 +00:00
Michal Bozon
bd36615973 Correct timestamp output when clock_precision_digits > 0
PR#3535

Reviewed-by: Stephen Henson <steve@openssl.org>
2014-11-12 20:55:32 +00:00
Matt Caswell
db85611989 Fix free of garbage pointer. PR#3595
Reviewed-by: Emilia Käsper <emilia@openssl.org>
(cherry picked from commit e04d426bf9)
2014-11-12 20:33:24 +00:00
Kurt Roeckx
9e5267fcdd Fix warning about negative unsigned intergers
Reviewed-by: Richard Levitte <levitte@openssl.org>
2014-11-11 15:48:18 +01:00
Samuel Neves
0d330ce5cc Use only unsigned arithmetic in constant-time operations
Signed-off-by: Kurt Roeckx <kurt@roeckx.be>
Reviewed-by: Emilia Käsper <emilia@openssl.org>
2014-10-28 20:54:34 +01:00
Bodo Moeller
2a303a5834 Fix and improve SSL_MODE_SEND_FALLBACK_SCSV documentation.
Reviewed-by: Rich Salz <rsalz@openssl.org>
2014-10-21 22:41:07 +02:00
Bodo Moeller
8d81dfd0a6 When processing ClientHello.cipher_suites, don't ignore cipher suites
listed after TLS_FALLBACK_SCSV.

RT: 3575
Reviewed-by: Emilia Kasper <emilia@openssl.org>
2014-10-21 22:32:44 +02:00
Kurt Roeckx
69c163ac81 Keep old method in case of an unsupported protocol
When we're configured with no-ssl3 and we receive an SSL v3 Client Hello, we set
the method to NULL.  We didn't used to do that, and it breaks things.  This is a
regression introduced in 62f45cc27d.  Keep the old
method since the code is not able to deal with a NULL method at this time.

CVE-2014-3569, PR#3571

Reviewed-by: Emilia Käsper <emilia@openssl.org>
(cherry picked from commit 392fa7a952)
2014-10-21 21:15:58 +02:00
Tim Hudson
b7eaea7397 no-ssl2 with no-ssl3 does not mean drop the ssl lib
Reviewed-by: Geoff Thorpe <geoff@openssl.org>
(cherry picked from commit c882abd522)
2014-10-20 15:25:13 +10:00
Andy Polyakov
2d2965d2c1 e_os.h: refine inline override logic (to address warnings in debug build).
Reviewed-by: Dr Stephen Henson <steve@openssl.org>
(cherry picked from commit 55c7a4cf11)
2014-10-17 11:55:07 +02:00
Andy Polyakov
56cee260d8 e_os.h: allow inline functions to be compiled by legacy compilers.
Reviewed-by: Matt Caswell <matt@openssl.org>
(cherry picked from commit 40155f4089)
2014-10-17 11:55:02 +02:00
Kurt Cancemi
e2e13b8f3a RT3547: Add missing static qualifier
Reviewed-by: Ben Laurie <ben@openssl.org>
(cherry picked from commit 87d388c955)
2014-10-17 11:48:47 +02:00
Matt Caswell
13b2a4d06a Prepare for 1.0.0p-dev
Reviewed-by: Stephen Henson <steve@openssl.org>
2014-10-15 13:52:37 +01:00
Matt Caswell
41da9188cc Prepare for 1.0.0o release
Reviewed-by: Stephen Henson <steve@openssl.org>
2014-10-15 13:52:08 +01:00
Matt Caswell
e9fe4b1033 Updates to NEWS
Reviewed-by: Dr Stephen Henson <steve@openssl.org>
2014-10-15 08:49:50 -04:00
Matt Caswell
6469c947f5 Update to CHANGES file
Reviewed-by: Bodo Möller <bodo@openssl.org>
2014-10-15 08:49:50 -04:00
Geoff Thorpe
9bf3ff1ca0 Fix no-ssl3 configuration option
CVE-2014-3568

Reviewed-by: Emilia Kasper <emilia@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
2014-10-15 08:49:50 -04:00
Dr. Stephen Henson
74f77d40a9 Fix for session tickets memory leak.
CVE-2014-3567

Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
2014-10-15 08:49:50 -04:00
Bodo Moeller
55513f3e48 Fix SSL_R naming inconsistency.
Reviewed-by: Tim Hudson <tjh@openssl.org>
2014-10-15 14:47:17 +02:00
Tim Hudson
c8dd719095 Add constant_time_locl.h to HEADERS,
so the Win32 compile picks it up correctly.

Reviewed-by: Richard Levitte <levitte@openssl.org>
2014-10-15 11:32:17 +02:00
Richard Levitte
0bfd0bff17 Add the constant time test to the VMS build and tests
Reviewed-by: Tim Hudson <tjh@openssl.org>

Conflicts:
	test/maketests.com
	test/tests.com
2014-10-15 11:32:17 +02:00
Richard Levitte
eb269523bb Include "constant_time_locl.h" rather than "../constant_time_locl.h".
The different -I compiler parameters will take care of the rest...

Reviewed-by: Tim Hudson <tjh@openssl.org>

Conflicts:
	crypto/evp/evp_enc.c
2014-10-15 11:32:17 +02:00
Richard Levitte
802feda7fc Spaces were added in some strings for better readability. However, those spaces do not belong in file names, so when picking out the individual parts, remove the spaces
Reviewed-by: Tim Hudson <tjh@openssl.org>
2014-10-15 11:32:17 +02:00
Richard Levitte
cdad6ad015 Adjust VMS build to Unix build. Most of all, make it so the disabled
algorithms MD2 and RC5 don't get built.
Also, disable building the test apps in crypto/des and crypto/pkcs7, as
they have no support at all.

Reviewed-by: Tim Hudson <tjh@openssl.org>

Conflicts:
	crypto/crypto-lib.com
	makevms.com
	ssl/ssl-lib.com
2014-10-15 11:32:17 +02:00
Richard Levitte
4eca4cfbc8 Make sure test/tests.com exit gracefully, even when openssl.exe wasn't properly built.
Reviewed-by: Tim Hudson <tjh@openssl.org>
2014-10-15 11:32:17 +02:00
Richard Levitte
7e29be228e Make sure that disabling the MAYLOSEDATA3 warning is only done when the compiler supports it. Otherwise, there are warnings about it lacking everywhere, which is quite tedious to read through while trying to check for other warnings.
Reviewed-by: Tim Hudson <tjh@openssl.org>

Conflicts:
	ssl/ssl-lib.com
2014-10-15 11:32:15 +02:00
Bodo Moeller
8745c0815c Add TLS_FALLBACK_SCSV documentation, and move s_client -fallback_scsv
handling out of #ifndef OPENSSL_NO_DTLS1 section.

Reviewed-by: Rich Salz <rsalz@openssl.org>
2014-10-15 11:14:34 +02:00
Bodo Moeller
68828f167c Oops -- fix typo in coment added with TLS_FALLBACK_SCSV support.
Reviewed-by: Steve Henson <steve@openss.org>
2014-10-15 04:25:41 +02:00
Bodo Moeller
59dcfa21e5 Support TLS_FALLBACK_SCSV.
Reviewed-by: Rich Salz <rsalz@openssl.org>
2014-10-15 04:05:57 +02:00
Matt Caswell
13f8ddacbe Removed duplicate definition of PKCS7_type_is_encrypted
Patch supplied by Matthieu Patou <mat@matws.net>, and modified to also
remove duplicate definition of PKCS7_type_is_digest.

PR#3551

Reviewed-by: Rich Salz <rsalz@openssl.org>
(cherry picked from commit e0fdea3e49)
2014-10-06 23:48:39 +01:00
Dr. Stephen Henson
ad8b204386 Add additional DigestInfo checks.
Reencode DigestInto in DER and check against the original: this
will reject any improperly encoded DigestInfo structures.

Note: this is a precautionary measure, there is no known attack
which can exploit this.

Thanks to Brian Smith for reporting this issue.
Reviewed-by: Tim Hudson <tjh@openssl.org>
2014-09-29 12:30:47 +01:00
Emilia Kasper
7b7aef9bfd Add missing tests
Accidentally omitted from commit 455b65dfab

Reviewed-by: Kurt Roeckx <kurt@openssl.org>
(cherry picked from commit fdc35a9d3e)
2014-09-25 13:47:42 +02:00
Dr. Stephen Henson
93540299fe Use correct function name: CMS_add1_signer()
Reviewed-by: Matt Caswell <matt@openssl.org>
(cherry picked from commit 5886354dcc)
2014-09-25 00:07:26 +01:00
Andy Polyakov
1db72876dc crypto/bn/bn_nist.c: work around MSC ARM compiler bug.
RT: 3541
Reviewed-by: Emilia Kasper <emilia@openssl.org>
(cherry picked from commit 8b07c005fe)
2014-09-25 00:48:40 +02:00
Emilia Kasper
b55ff319f8 RT3425: constant-time evp_enc
Do the final padding check in EVP_DecryptFinal_ex in constant time to
avoid a timing leak from padding failure.

Reviewed-by: Rich Salz <rsalz@openssl.org>
(cherry picked from commit 4aac102f75)

Conflicts:
	crypto/evp/evp_enc.c

(cherry picked from commit 738911cde6)

Conflicts:
	crypto/evp/evp_enc.c
2014-09-24 16:29:02 +02:00
Emilia Kasper
9a6940a349 RT3067: simplify patch
(Original commit adb46dbc6d)

Use the new constant-time methods consistently in s3_srvr.c

Reviewed-by: Kurt Roeckx <kurt@openssl.org>
(cherry picked from commit 455b65dfab)

Conflicts:
	ssl/Makefile
2014-09-24 15:58:20 +02:00
Adam Langley
c36ceb0b15 This change alters the processing of invalid, RSA pre-master secrets so
that bad encryptions are treated like random session keys in constant
time.

(cherry picked from commit adb46dbc6d)

Reviewed-by: Rich Salz <rsalz@openssl.org>
2014-09-24 15:56:09 +02:00
Emilia Kasper
904fcce0c6 RT3066: rewrite RSA padding checks to be slightly more constant time.
Also tweak s3_cbc.c to use new constant-time methods.
Also fix memory leaks from internal errors in RSA_padding_check_PKCS1_OAEP_mgf1

This patch is based on the original RT submission by Adam Langley <agl@chromium.org>,
as well as code from BoringSSL and OpenSSL.

Reviewed-by: Kurt Roeckx <kurt@openssl.org>

Conflicts:
	crypto/rsa/rsa_oaep.c
2014-09-24 14:35:03 +02:00
Tim Hudson
2518a35a51 Fixed error introduced in commit f2be92b94d
that fixed PR#3450 where an existing cast masked an issue when i was changed
from int to long in that commit

Picked up on z/linux (s390) where sizeof(int)!=sizeof(long)

Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(cherry picked from commit b5ff559ff9)
2014-09-22 06:32:42 +10:00
Adam Langley
442ca2bd00 psk_client_callback, 128-byte id bug.
Fix a bug in handling of 128 byte long PSK identity in
psk_client_callback.

OpenSSL supports PSK identities of up to (and including) 128 bytes in
length. PSK identity is obtained via the psk_client_callback,
implementors of which are expected to provide a NULL-terminated
identity. However, the callback is invoked with only 128 bytes of
storage thus making it impossible to return a 128 byte long identity and
the required additional NULL byte.

This CL fixes the issue by passing in a 129 byte long buffer into the
psk_client_callback. As a safety precaution, this CL also zeroes out the
buffer before passing it into the callback, uses strnlen for obtaining
the length of the identity returned by the callback, and aborts the
handshake if the identity (without the NULL terminator) is longer than
128 bytes.

(Original patch amended to achieve strnlen in a different way.)

Reviewed-by: Rich Salz <rsalz@openssl.org>
(cherry picked from commit be0d851732)
2014-09-05 12:25:20 +02:00
Adam Langley
09e62af4d4 Ensure that x**0 mod 1 = 0.
(cherry picked from commit 2b0180c37f)

Reviewed-by: Ben Laurie <ben@openssl.org>
2014-09-04 16:07:16 +02:00
Richard Levitte
88f0c9797e Followup on RT3334 fix: make sure that a directory that's the empty
string returns 0 with errno = ENOENT.

Reviewed-by: Andy Polyakov <appro@openssl.org>
(cherry picked from commit 360928b7d0)
2014-09-03 22:26:19 +02:00
Phil Mesnier
74f5307d57 RT3334: Fix crypto/LPdir_win.c
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Andy Polyakov <appro@openssl.org>
(cherry picked from commit 6a14fe7576)
2014-09-03 22:26:19 +02:00
Emilia Kasper
da8dd611ae Make the inline const-time functions static.
"inline" without static is not correct as the compiler may choose to ignore it
and will then either emit an external definition, or expect one.

Reviewed-by: Geoff Thorpe <geoff@openssl.org>
(cherry picked from commit 86f50b36e6)
2014-09-02 15:25:04 +02:00
Andy Polyakov
43711a589b md5-x86_64.pl: work around warning.
Reviewed-by: Rich Salz <rsalz@openssl.org>
(cherry picked from commit 4d86e8df6b)
2014-08-30 19:19:47 +02:00
Rich Salz
bf63eab048 Add tags/TAGS
Reviewed-by: Tim Hudson <tjh@openssl.org>
(cherry picked from commit 9d6253cfd3)
2014-08-30 10:09:44 -04:00
Rich Salz
62ca466a54 RT2379: Bug in BIO_set_accept_port.pod
The doc says that port can be "*" to mean any port.
That's wrong.

Reviewed-by: Dr. Stephen Henson <steve@openssl.org>
(cherry picked from commit 07e3b31fae)
2014-08-29 16:46:44 -04:00
Matt Caswell
17d3b1ecea Fixed double inclusion of string.h
PR2693

Reviewed-by: Tim Hudson <tjh@openssl.org>
(cherry picked from commit 5d33b70ef5a4768fdfb77a73f9817c4570613039)
2014-08-29 21:38:03 +01:00
Emilia Kasper
73729e4cf3 Constant-time utilities
Pull constant-time methods out to a separate header, add tests.

Reviewed-by: Bodo Moeller <bodo@openssl.org>
(cherry picked from commit e7169a5835)

Conflicts:
	ssl/Makefile
	test/Makefile
2014-08-28 17:18:01 +02:00
Emilia Kasper
05f61fb27e Explicitly check for empty ASN.1 strings in d2i_ECPrivateKey
The old code implicitly relies on the ASN.1 code returning a \0-prefixed buffer
when the buffer length is 0. Change this to verify explicitly that the ASN.1 string
has positive length.

Reviewed-by: Dr Stephen Henson <steve@openssl.org>
(cherry picked from commit 82dc08de54ce443c2a9ac478faffe79e76157795)
2014-08-27 19:42:31 +02:00
Matt Caswell
10be715b95 RT3065: automatically generate a missing EC public key
When d2i_ECPrivateKey reads a private key with a missing (optional) public key,
generate one automatically from the group and private key.

Reviewed-by: Dr Stephen Henson <steve@openssl.org>
(cherry picked from commit ed383f847156940e93f256fed78599873a4a9b28)

Conflicts:
	doc/crypto/EC_KEY_new.pod
2014-08-27 19:42:24 +02:00
Adam Langley
e87a4a7011 RT3065: ec_private_key_dont_crash
This change saves several EC routines from crashing when an EC_KEY is
missing a public key. The public key is optional in the EC private key
format and, without this patch, running the following through `openssl
ec` causes a crash:

-----BEGIN EC PRIVATE KEY-----
MBkCAQEECAECAwQFBgcIoAoGCCqGSM49AwEH
-----END EC PRIVATE KEY-----

Reviewed-by: Dr Stephen Henson <steve@openssl.org>
(cherry picked from commit b391570bdeb386d4fd325917c248d593d3c43930)
2014-08-27 19:42:09 +02:00
Mihai Militaru
f2a57c101f RT2210: Add missing EVP_cleanup to example
I also removed some trailing whitespace and cleaned
up the "see also" list.

Reviewed-by: Emilia Kasper <emilia@openssl.org>
(cherry picked from commit 7b3e11c544)
2014-08-27 13:27:24 -04:00
David Gatwood
b88ffa2bce RT1744: SSL_CTX_set_dump_dh() doc feedback
The description of when the server creates a DH key is
confusing.  This cleans it up.
(rsalz: also removed trailing whitespace.)

Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
2014-08-26 13:40:16 -04:00
Jan Schaumann
27b0494153 RT1804: fix EXAMPLE in EVP_EncryptInit.pod
The EXAMPLE that used FILE and RC2 doesn't compile due to a
few minor errors.  Tweak to use IDEA and AES-128. Remove
examples about RC2 and RC5.

Reviewed-by: Emilia Kasper <emilia@openssl.org>
2014-08-25 10:27:20 -04:00
Matt Caswell
d38dcafe95 Typo fixes to evp documentation.
This patch was submitted by user "Kox" via the wiki

Reviewed-by: Tim Hudson <tjh@openssl.org>
(cherry picked from commit 2dd8cb3b95)
2014-08-24 21:27:11 +01:00
Adam Langley
b0873dbb44 RT3060: Limit the number of empty records.
Limit the number of empty records that will be processed consecutively
in order to prevent ssl3_get_record from never returning.

Reported by "oftc_must_be_destroyed" and George Kadianakis.

Reviewed-by: Bodo Moeller <bodo@openssl.org>
(cherry picked from commit 3aac17a82f)
2014-08-22 15:53:26 +02:00
Adam Langley
48ae65be09 RT3061: Don't SEGFAULT when trying to export a public DSA key as a private key.
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
(cherry picked from commit e19c93811f)
2014-08-22 15:25:30 +02:00
Emilia Kasper
dd5d7447c1 Improve EVP_PKEY_sign documentation
Clarify the intended use of EVP_PKEY_sign. Make the code example compile.

Reviewed-by: Dr Stephen Henson <steve@openssl.org>
(cherry picked from commit d64c533a20)
2014-08-22 15:06:26 +02:00
Emilia Kasper
4ff9cbe635 define inline for Visual Studio
In Visual Studio, inline is available in C++ only, however __inline is available for C, see
http://msdn.microsoft.com/en-us/library/z8y1yy88.aspx

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Dr Stephen Henson <steve@openssl.org>
(cherry picked from commit f511b25a73)
2014-08-21 16:08:05 +02:00
Adam Langley
e164b34079 Add volatile qualifications to two blocks of inline asm to stop GCC from
eliminating them as dead code.

Both volatile and "memory" are used because of some concern that the compiler
may still cache values across the asm block without it, and because this was
such a painful debugging session that I wanted to ensure that it's never
repeated.

(cherry picked from commit 7753a3a684)

Conflicts:
	crypto/bn/asm/x86_64-gcc.c

Reviewed-by: Rich Salz <rsalz@openssl.org>
(cherry picked from commit a90b1e32d2)
2014-08-19 17:11:14 +02:00
Matt Caswell
679d0c8655 Fixed out-of-bounds read errors in ssl3_get_key_exchange.
PR#3450

Conflicts:
	ssl/s3_clnt.c

Reviewed-by: Emilia Käsper <emilia@openssl.org>
2014-08-15 23:30:11 +01:00
Bodo Moeller
1d5e58b53c Further improve/fix ec_GFp_simple_points_make_affine (ecp_smpl.c) and
group_order_tests (ectest.c).  Also fix the EC_POINTs_mul documentation (ec.h).

Reviewed-by: emilia@openssl.org

Conflicts:
	crypto/ec/ectest.c
2014-08-13 17:56:18 +02:00
Matt Caswell
118149887b Prepare for 1.0.0o-dev
Reviewed-by: Stephen Henson <steve@openssl.org>
2014-08-06 22:25:27 +01:00
Matt Caswell
bb505311c6 Prepare for 1.0.0n release
Reviewed-by: Stephen Henson <steve@openssl.org>
2014-08-06 22:24:50 +01:00
Matt Caswell
f5fc85d382 make update
Reviewed-by: Stephen Henson <steve@openssl.org>
2014-08-06 22:24:50 +01:00
Matt Caswell
6e4929fcdb Updates to CHANGES and NEWS
Reviewed-by: Kurt Roeckx <kurt@openssl.org>
2014-08-06 21:34:00 +01:00
Gabor Tyukasz
03a12c1330 Fix race condition in ssl_parse_serverhello_tlsext
CVE-2014-3509
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Dr. Stephen Henson <steve@openssl.org>
2014-08-06 21:30:39 +01:00
Emilia Kasper
57b0c4697a Fix OID handling:
- Upon parsing, reject OIDs with invalid base-128 encoding.
- Always NUL-terminate the destination buffer in OBJ_obj2txt printing function.

CVE-2014-3508

Reviewed-by: Dr. Stephen Henson <steve@openssl.org>
Reviewed-by: Kurt Roeckx <kurt@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
2014-08-06 21:30:39 +01:00
Emilia Käsper
9fd3555305 Fix DTLS anonymous EC(DH) denial of service
CVE-2014-3510

Reviewed-by: Dr. Stephen Henson <steve@openssl.org>
2014-08-06 21:30:39 +01:00
David Benjamin
67e53f73bf Fix protocol downgrade bug in case of fragmented packets
CVE-2014-3511

Reviewed-by: Emilia Käsper <emilia@openssl.org>
Reviewed-by: Bodo Möller <bodo@openssl.org>
2014-08-06 21:30:39 +01:00
Adam Langley
2281d10a7b Remove some duplicate DTLS code.
In a couple of functions, a sequence number would be calculated twice.

Additionally, in |dtls1_process_out_of_seq_message|, we know that
|frag_len| <= |msg_hdr->msg_len| so the later tests for |frag_len <
msg_hdr->msg_len| can be more clearly written as |frag_len !=
msg_hdr->msg_len|, since that's the only remaining case.

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Emilia Käsper <emilia@openssl.org>
2014-08-06 21:30:39 +01:00
Matt Caswell
e5861c885f Applying same fix as in dtls1_process_out_of_seq_message. A truncated DTLS fragment would cause *ok to be clear, but the return value would still be the number of bytes read.
Problem identified by Emilia Käsper, based on previous issue/patch by Adam
Langley.

Reviewed-by: Emilia Käsper <emilia@openssl.org>
2014-08-06 21:30:39 +01:00
Adam Langley
60be115771 Fix return code for truncated DTLS fragment.
Previously, a truncated DTLS fragment in
|dtls1_process_out_of_seq_message| would cause *ok to be cleared, but
the return value would still be the number of bytes read. This would
cause |dtls1_get_message| not to consider it an error and it would
continue processing as normal until the calling function noticed that
*ok was zero.

I can't see an exploit here because |dtls1_get_message| uses
|s->init_num| as the length, which will always be zero from what I can
see.

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Emilia Käsper <emilia@openssl.org>
2014-08-06 21:30:39 +01:00
Adam Langley
5ee775a4a5 Fix memory leak from zero-length DTLS fragments.
The |pqueue_insert| function can fail if one attempts to insert a
duplicate sequence number. When handling a fragment of an out of
sequence message, |dtls1_process_out_of_seq_message| would not call
|dtls1_reassemble_fragment| if the fragment's length was zero. It would
then allocate a fresh fragment and attempt to insert it, but ignore the
return value, leaking the fragment.

This allows an attacker to exhaust the memory of a DTLS peer.

Fixes CVE-2014-3507

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Emilia Käsper <emilia@openssl.org>
2014-08-06 21:30:39 +01:00
Matt Caswell
934ca0714a Fix DTLS handshake message size checks.
In |dtls1_reassemble_fragment|, the value of
|msg_hdr->frag_off+frag_len| was being checked against the maximum
handshake message size, but then |msg_len| bytes were allocated for the
fragment buffer. This means that so long as the fragment was within the
allowed size, the pending handshake message could consume 16MB + 2MB
(for the reassembly bitmap). Approx 10 outstanding handshake messages
are allowed, meaning that an attacker could consume ~180MB per DTLS
connection.

In the non-fragmented path (in |dtls1_process_out_of_seq_message|), no
check was applied.

Fixes CVE-2014-3506

Wholly based on patch by Adam Langley with one minor amendment.

Reviewed-by: Emilia Käsper <emilia@openssl.org>
2014-08-06 21:30:39 +01:00
Matt Caswell
ad007e0aaf Added comment for the frag->reassembly == NULL case as per feedback from Emilia
Reviewed-by: Emilia Käsper <emilia@openssl.org>
2014-08-06 21:30:39 +01:00
Adam Langley
84361b898d Avoid double free when processing DTLS packets.
The |item| variable, in both of these cases, may contain a pointer to a
|pitem| structure within |s->d1->buffered_messages|. It was being freed
in the error case while still being in |buffered_messages|. When the
error later caused the |SSL*| to be destroyed, the item would be double
freed.

Thanks to Wah-Teh Chang for spotting that the fix in 1632ef74 was
inconsistent with the other error paths (but correct).

Fixes CVE-2014-3505

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Emilia Käsper <emilia@openssl.org>
2014-08-06 21:30:39 +01:00
Dr. Stephen Henson
1a80d39021 Fix warnings about ignored return values.
(cherry picked from commit 27131fe8f7)
Reviewed-by: Matt Caswell <matt@openssl.org>
2014-08-06 21:04:08 +01:00
Bodo Moeller
c5526a16b1 Simplify and fix ec_GFp_simple_points_make_affine
(which didn't always handle value 0 correctly).

Reviewed-by: emilia@openssl.org

Conflicts:
	CHANGES
	crypto/ec/ectest.c
2014-08-01 17:58:26 +02:00
Billy Brumley
b6b9670017 "EC_POINT_invert" was checking "dbl" function pointer instead of "invert".
PR#2569

Reviewed-by: Rich Salz <rsalz@openssl.org>
(cherry picked from commit cba11f57ce)
2014-07-21 22:29:12 +01:00
Tim Hudson
469665f658 Remove old unused and unmaintained demonstration code.
Reviewed-by: Dr. Stephen Henson <steve@openssl.org>
(cherry picked from commit 62352b8138)
2014-07-22 07:26:15 +10:00
Tim Hudson
c4eb02bcaa Minor documentation update removing "really" and a
statement of opinion rather than a fact.

Reviewed-by: Dr. Stephen Henson <steve@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
(cherry picked from commit c8d133e4b6)
2014-07-21 20:24:13 +10:00
Dr. Stephen Henson
97f336f25d Fix documentation for RSA_set_method(3)
PR#1675
Reviewed-by: Matt Caswell <matt@openssl.org>
(cherry picked from commit 197400c3f0d617d71ad8167b52fb73046d334320)
2014-07-19 18:26:31 +01:00
Jeffrey Walton
5e05728ace Fix typo, add reference.
PR#3456
Reviewed-by: Stephen Henson <steve@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(cherry picked from commit d48e78f0cf)
2014-07-17 12:09:02 +01:00
Matt Caswell
061a5bdba2 Add Matt Caswell's fingerprint, and general update on the fingerprints file to bring it up to date
Reviewed-by: Tim Hudson <tjh@openssl.org>
(cherry picked from commit 3bd548192a)
2014-07-15 23:24:48 +01:00
Dr. Stephen Henson
e6ed83fb74 Clarify -Verify and PSK.
PR#3452
(cherry picked from commit ca2015a617)
2014-07-15 20:23:41 +01:00
Dr. Stephen Henson
c3f2fc419b Fix DTLS certificate requesting code.
Use same logic when determining when to expect a client
certificate for both TLS and DTLS.

PR#3452
(cherry picked from commit c8d710dc5f)
2014-07-15 18:23:52 +01:00
Dr. Stephen Henson
ec9cb40da5 Add ECC extensions with DTLS.
PR#3449
(cherry picked from commit 2054eb771e)
2014-07-15 12:29:20 +01:00
Dr. Stephen Henson
ed1de3810d Don't allow -www etc options with DTLS.
The options which emulate a web server don't make sense when doing DTLS.
Exit with an error if an attempt is made to use them.

PR#3453
(cherry picked from commit 58a2aaeade8bdecd0f9f0df41927f7cff3012547)
2014-07-15 12:27:03 +01:00
Dr. Stephen Henson
df35da266d Use case insensitive compare for servername.
PR#3445
(cherry picked from commit 1c3e9a7c67)
2014-07-15 00:00:14 +01:00
Dr. Stephen Henson
26d60e29e3 Use more common name for GOST key exchange.
(cherry picked from commit 7aabd9c92fe6f0ea2a82869e5171dcc4518cee85)
2014-07-14 18:31:54 +01:00
Matt Caswell
5a0df377ac Fixed valgrind complaint due to BN_consttime_swap reading uninitialised data.
This is actually ok for this function, but initialised to zero anyway if
PURIFY defined.

This does have the impact of masking any *real* unitialised data reads in bn though.

Patch based on approach suggested by Rich Salz.

PR#3415

(cherry picked from commit 77747e2d9a5573b1dbc15e247ce18c03374c760c)
2014-07-13 22:25:53 +01:00
Peter Mosmans
f7123634a5 Add names of GOST algorithms.
PR#3440
(cherry picked from commit 924e5eda2c)

Conflicts:

	ssl/ssl_ciph.c
2014-07-13 18:35:14 +01:00
Richard Levitte
7aeb3d7937 * crypto/ui/ui_lib.c: misplaced brace in switch statement.
Detected by dcruette@qualitesys.com

(cherry picked from commit 8b5dd34091)
2014-07-13 19:16:06 +02:00
Matt Caswell
182f1ad8a1 Fix memory leak in BIO_free if there is no destroy function.
Based on an original patch by Neitrino Photonov <neitrinoph@gmail.com>

PR#3439

(cherry picked from commit 66816c53be)
2014-07-09 23:37:04 +01:00
David Lloyd
0819130188 Prevent infinite loop loading config files.
PR#2985
(cherry picked from commit 9d23f422a3)
2014-07-07 13:50:52 +01:00
Dr. Stephen Henson
3fe4fc4774 Usage for -hack and -prexit -verify_return_error
(cherry picked from commit a07f514fc0)
2014-07-06 22:59:03 +01:00
Dr. Stephen Henson
1326733457 Document certificate status request options.
Conflicts:

	doc/apps/s_client.pod
	doc/apps/s_server.pod
(cherry picked from commit b197c770a6)
2014-07-06 22:59:03 +01:00
Dr. Stephen Henson
d8426e6b7d s_server usage for certificate status requests 2014-07-06 22:58:58 +01:00
Dr. Stephen Henson
aa90ff7d8e Update ticket callback docs.
(cherry picked from commit a23a6e85d8)
2014-07-06 12:42:58 +01:00
Dr. Stephen Henson
aeae79951c Sanity check keylength in PVK files.
PR#2277
(cherry picked from commit 733a6c882e92f8221bd03a51643bb47f5f81bb81)
2014-07-06 00:36:10 +01:00
Matt Caswell
cf3792b3e4 Fixed error in pod files with latest versions of pod2man
(cherry picked from commit 07255f0a76d9d349d915e14f969b9ff2ee0d1953)
2014-07-06 00:05:01 +01:00
Alan Hryngle
e6b98d5a40 Return smaller of ret and f.
PR#3418.
(cherry picked from commit fdea4fff8f)
2014-07-05 22:38:56 +01:00
Dr. Stephen Henson
4054d95eb9 Don't limit message sizes in ssl3_get_cert_verify.
PR#319 (reoponed version).
(cherry picked from commit 7f6e957864)

Conflicts:

	ssl/s3_srvr.c
2014-07-05 13:31:53 +01:00
Dr. Stephen Henson
a05e954b66 Add license info.
(cherry picked from commit 55707a36cc)
2014-07-04 18:44:24 +01:00
Dr. Stephen Henson
ca4a339eeb typo
(cherry picked from commit 2cfbec1cae)
(cherry picked from commit a9661e45ac)
2014-07-04 18:44:18 +01:00
Rich Salz
835e32f9f6 Merge branch 'rsalz-docfixes' 2014-07-03 12:50:06 -04:00
Rich Salz
23396f5500 Close 3170, remove reference to Ariel Glenn's old 0.9.8 doc
(cherry picked from commit f1112985e8)
2014-07-03 12:44:41 -04:00
Dr. Stephen Henson
1c9b82a91f update release notes 2014-07-02 18:31:56 +01:00
Matt Smart
99657430c0 Fix doc typo.
ERR_get_error(3) references the non-existent
ERR_get_last_error_line_data instead of the one that does exist,
ERR_peek_last_error_line_data.

PR#3283
(cherry picked from commit 5cc99c6cf5)
2014-07-02 03:45:14 +01:00
Thijs Alkemade
ce20ac72b4 Make disabling last cipher work.
(cherry picked from commit 7cb472bd0d)
2014-07-02 03:33:12 +01:00
Geoff Thorpe
525b6c7585 util/mkerr.pl: fix perl warning
Gets rid of this;

defined(@array) is deprecated at ../util/mkerr.pl line 792.
        (Maybe you should just omit the defined()?)
defined(@array) is deprecated at ../util/mkerr.pl line 800.
        (Maybe you should just omit the defined()?)

Signed-off-by: Geoff Thorpe <geoff@openssl.org>
(cherry picked from commit 647f360e2e)
2014-07-02 01:50:58 +01:00
Dr. Stephen Henson
29ed482ffc ASN1 sanity check.
Primitive encodings shouldn't use indefinite length constructed
form.

PR#2438 (partial).
(cherry picked from commit 398e99fe5e)
2014-07-02 01:01:41 +01:00
Jeffrey Walton
b38db8803f Clarified that the signature's buffer size, s, is not used as an
IN parameter.

Under the old docs, the only thing stated was "at most
EVP_PKEY_size(pkey) bytes will be written". It was kind of misleading
since it appears EVP_PKEY_size(pkey) WILL be written regardless of the
signature's buffer size.

(cherry picked from commit 6e6ba36d98)
2014-06-29 23:37:12 +01:00
Dr. Stephen Henson
59899c4d1b Fix memory leak.
PR#2531.
2014-06-29 13:53:06 +01:00
Ken Ballou
eec4cc8878 Typo.
PR#3173
(cherry picked from commit 76ed5a42ea)
2014-06-29 13:39:28 +01:00
Dr. Stephen Henson
2e7124497d Show errors on CSR verification failure.
If CSR verify fails in ca utility print out error messages.
Otherwise some errors give misleading output: for example
if the key size exceeds the library limit.

PR#2875
(cherry picked from commit a30bdb55d1)
2014-06-29 13:35:01 +01:00
Dr. Stephen Henson
c0eae35b3d Make no-ssl3 no-ssl2 do more sensible things.
(cherry picked from commit 7ae6a4b659)
2014-06-29 03:05:54 +01:00
Dr. Stephen Henson
50c9141d00 Typo.
PR#3107
(cherry picked from commit 7c206db928)
2014-06-28 12:43:36 +01:00
Dr. Stephen Henson
2617a3c44d Don't disable state strings with no-ssl2
Some state strings were erronously not compiled when no-ssl2
was set.

PR#3295
(cherry picked from commit 0518a3e19e)
2014-06-28 00:56:59 +01:00
Andreas Westfeld
a7da2b8e17 Fix typo in ideatest.c
(cherry picked from commit d1d4382dcb)
2014-06-28 00:06:47 +01:00
Ken Ballou
e617a506ff Remove redundant check.
PR#3174
(cherry picked from commit fd331c0bb9b557903dd2ce88398570a3327b5ef0)
2014-06-27 23:18:25 +01:00
Dr. Stephen Henson
80640bf0bc Fix for EVP_PBE_alg_add().
In EVP_PBE_alg_add don't use the underlying NID for the cipher
as it may have a non-standard key size.

PR#3206
(cherry picked from commit efb7caef637a1de8468ca109efd355a9d0e73a45)
2014-06-27 22:59:13 +01:00
Dr. Stephen Henson
f05bce4f2f Tolerate critical AKID in CRLs.
PR#3014
(cherry picked from commit 11da66f8b1)
2014-06-27 18:50:45 +01:00
Tom Greenslade
5cd3ae9f18 Handle IPv6 addresses in OCSP_parse_url.
PR#2783
(cherry picked from commit b36f35cda9)
2014-06-27 17:31:50 +01:00
Tomas Mraz
d9d5a12823 Don't advertise ECC ciphersuits in SSLv2 compatible client hello.
PR#3374
(cherry picked from commit 0436369fcc)
2014-06-27 16:52:10 +01:00
Jeffrey Walton
06f3746c62 Clarify docs.
Document that the certificate passed to SSL_CTX_add_extra_chain_cert()
should not be freed by the application.

PR#3409
(cherry picked from commit 0535c2d67c)

Add restrictions section present in other branches.

Conflicts:

	doc/ssl/SSL_CTX_add_extra_chain_cert.pod
(cherry picked from commit 86cac6d3b2)
2014-06-27 16:42:42 +01:00
Dr. Stephen Henson
14247e4f59 Memory leak and NULL dereference fixes.
PR#3403
(cherry picked from commit d2aea03829)
2014-06-27 14:53:21 +01:00
Dr. Stephen Henson
72bc04942a Remove ancient obsolete files under pkcs7.
(cherry picked from commit 7be6b27aaf)
2014-06-27 13:56:53 +01:00
Huzaifa Sidhpurwala
8e28ef0d85 Make sure BN_sqr can never return a negative value.
PR#3410
(cherry picked from commit e14e764c0d5d469da63d0819c6ffc0e1e9e7f0bb)
2014-06-26 23:50:52 +01:00
Jenny Yung
996edff7e1 Memory allocation checks.
PR#3399.
(cherry picked from commit da0d5e78bc)
2014-06-26 23:33:05 +01:00
Miod Vallat
532ee6e056 Fix off-by-one errors in ssl_cipher_get_evp()
In the ssl_cipher_get_evp() function, fix off-by-one errors in index validation before accessing arrays.

Bug discovered and fixed by Miod Vallat from the OpenBSD team.

PR#3375
2014-06-22 23:22:49 +01:00
Matt Caswell
08db2cc9c1 Revert "Fix off-by-one errors in ssl_cipher_get_evp()"
This reverts commit 7e98378d15.

Incorrect attribution.
2014-06-22 23:22:33 +01:00
Dr. Stephen Henson
f25e4263fe Accept CCS after sending finished.
Allow CCS after finished has been sent by client: at this point
keys have been correctly set up so it is OK to accept CCS from
server. Without this renegotiation can sometimes fail.

PR#3400
(cherry picked from commit 99cd6a91fcb0931feaebbb4832681d40a66fad41)
2014-06-14 22:26:31 +01:00
Matt Caswell
2dc967ddd0 Fixed incorrect return code handling in ssl3_final_finish_mac.
Based on an original patch by Joel Sing (OpenBSD) who also originally identified the issue.
2014-06-13 15:56:19 +01:00
Matt Caswell
a357acdd3b Revert "Fixed incorrect return code handling in ssl3_final_finish_mac"
This reverts commit e05282f8b0.

Missing attribution.
2014-06-13 15:55:57 +01:00
Kurt Cancemi
7e98378d15 Fix off-by-one errors in ssl_cipher_get_evp()
In the ssl_cipher_get_evp() function, fix off-by-one errors in index validation before accessing arrays.

PR#3375
2014-06-12 21:17:30 +01:00
Ben Laurie
d663f506dc Allow the maximum value.
(Backported as a result of PR#3377 reported by Rainer Jung <rainer.jung@kippdata.de>)
2014-06-12 20:48:40 +01:00
Dr. Stephen Henson
ead6774804 Fix compilation with no-comp
(cherry picked from commit 7239a09c7b5757ed8d0e9869f3e9b03c0e11f4d1)
2014-06-11 14:33:47 +01:00
Matt Caswell
e05282f8b0 Fixed incorrect return code handling in ssl3_final_finish_mac 2014-06-10 23:29:53 +01:00
Dr. Stephen Henson
34b087c9d0 Fix null pointer errors.
PR#3394
(cherry picked from commit 7a9d59c148)
2014-06-10 14:48:12 +01:00
Dr. Stephen Henson
9f81028969 Update strength_bits for 3DES.
Fix strength_bits to 112 for 3DES.
2014-06-09 12:09:47 +01:00
Jakub Wilk
8781538f41 Create ~/.rnd with mode 0600 instead of 0666
Because of a missing include <fcntl.h> we don't have O_CREATE and don't create
the file with open() using mode 0600 but fall back to using fopen() with the
default umask followed by a chmod().

Problem found by Jakub Wilk <jwilk@debian.org>.
2014-06-08 21:29:23 +01:00
Dr. Stephen Henson
8343fdc3c7 update NEWS 2014-06-07 18:19:13 +01:00
Dr. Stephen Henson
e966578d2f Make tls_session_secret_cb work with CVE-2014-0224 fix.
If application uses tls_session_secret_cb for session resumption
set the CCS_OK flag.
(cherry picked from commit 953c592572e8811b7956cc09fbd8e98037068b58)
2014-06-07 15:27:21 +01:00
Matt Caswell
7bab3c16ff Fixed minor duplication in docs 2014-06-07 12:32:30 +01:00
Dr. Stephen Henson
e2d569973c Correct wording for website scripts. 2014-06-06 13:26:03 +01:00
Dr. Stephen Henson
caff6fc593 Add known issue. 2014-06-06 12:31:14 +01:00
Matt Caswell
ccb0398da6 Fixed Windows compilation failure 2014-06-05 20:24:36 +01:00
Dr. Stephen Henson
1f163fce81 Prepare for 1.0.0n-dev 2014-06-05 10:43:52 +01:00
Dr. Stephen Henson
4bee980bb5 Prepare for 1.0.0m release 2014-06-05 10:42:13 +01:00
Dr. Stephen Henson
7fa5428558 make update 2014-06-05 10:42:13 +01:00
Dr. Stephen Henson
b9c9cd3ded Update CHANGES and NEWS 2014-06-05 09:00:01 +01:00
Dr. Stephen Henson
8250e1b232 Fix CVE-2014-3470
Check session_cert is not NULL before dereferencing it.
2014-06-03 16:30:37 +01:00
Dr. Stephen Henson
519c977c47 Fix CVE-2014-0221
Unnecessary recursion when receiving a DTLS hello request can be used to
crash a DTLS client. Fixed by handling DTLS hello request without recursion.

Thanks to Imre Rad (Search-Lab Ltd.) for discovering this issue.
2014-06-03 16:30:37 +01:00
Dr. Stephen Henson
123370fb94 Additional CVE-2014-0224 protection.
Return a fatal error if an attempt is made to use a zero length
master secret.
2014-06-03 16:30:37 +01:00
Dr. Stephen Henson
c97e457d53 Fix for CVE-2014-0224
Only accept change cipher spec when it is expected instead of at any
time. This prevents premature setting of session keys before the master
secret is determined which an attacker could use as a MITM attack.

Thanks to KIKUCHI Masashi (Lepidum Co. Ltd.) for reporting this issue
and providing the initial fix this patch is based on.
2014-06-03 16:30:37 +01:00
Dr. Stephen Henson
f4e6ed09e4 Fix for CVE-2014-0195
A buffer overrun attack can be triggered by sending invalid DTLS fragments
to an OpenSSL DTLS client or server. This is potentially exploitable to
run arbitrary code on a vulnerable client or server.

Fixed by adding consistency check for DTLS fragments.

Thanks to Jüri Aedla for reporting this issue.
2014-06-03 16:30:37 +01:00
zhu qun-ying
b79e6e3a27 Free up s->d1->buffered_app_data.q properly.
PR#3286
(cherry picked from commit 71e95000afb2227fe5cac1c79ae884338bcd8d0b)
2014-06-02 14:40:32 +01:00
Dr. Stephen Henson
812b7246d4 Make PKCS7_NOCERTS match documentation.
As documented PKCS7_NOCERTS should only exclude the signer's certificate
and not any supplied in the "certs" parameter. This makes it possible to
exclude the signer's certificate but include other certificates. Applications
that don't want to include other certificates should set "certs" to NULL
anyway.
(cherry picked from commit 5c6f808b66f1a2e0fb2a508b24b845a88803fe3a)
2014-06-02 13:53:51 +01:00
Annie Yousar
db305124f3 Fix typo.
PR#2677.
2014-06-02 13:53:51 +01:00
Sami Farin
bffbaf92bf Typo: set i to -1 before goto.
PR#3302
(cherry picked from commit 9717f01951f976f76dd40a38d9fc7307057fa4c4)
2014-06-02 13:53:51 +01:00
Matt Caswell
5aca5d41c0 Added SSLErr call for internal error in dtls1_buffer_record 2014-06-01 21:43:51 +01:00
David Ramos
8343e6b6b2 Delays the queue insertion until after the ssl3_setup_buffers() call due to use-after-free bug. PR#3362 2014-06-01 21:42:47 +01:00
Dr. Stephen Henson
f87c6a551e Set default global mask to UTF8 only.
(cherry picked from commit 3009244da4)
2014-06-01 15:04:35 +01:00
David Ramos
268ae49453 Allocate extra space when NETSCAPE_HANG_BUG defined.
Make sure there is an extra 4 bytes for server done message when
NETSCAPE_HANG_BUG is defined.

PR#3361
(cherry picked from commit 673c42b238)
2014-06-01 14:31:30 +01:00
Hubert Kario
6270d1c086 add description of -attime to man page
the verify app man page didn't describe the usage of attime option
even though it was listed as a valid option in the -help message.

This patch fixes this omission.
2014-05-30 23:35:32 +01:00
Hubert Kario
5b54d26830 add description of -no_ecdhe option to s_server man page
While the -help message references this option, the man page
doesn't mention the -no_ecdhe option.
This patch fixes this omission.
2014-05-30 23:35:22 +01:00
Dr. Stephen Henson
fccbab6f31 Set version number correctly.
PR#3249
(cherry picked from commit 8909bf20269035d295743fca559207ef2eb84eb3)
2014-05-29 14:12:13 +01:00
František Bořánek
caf4e91a35 Fix memory leak.
PR#3278
(cherry picked from commit de56fe797081fc09ebd1add06d6e2df42a324fd5)
2014-05-29 14:12:13 +01:00
Ben Laurie
c01a838d62 Fix signed/unsigned warning.
(cherry picked from commit 989d87cb1a)
2014-05-29 14:12:13 +01:00
Dr. Stephen Henson
66d3fb6af0 Fix for PKCS12_create if no-rc2 specified.
Use triple DES for certificate encryption if no-rc2 is
specified.

PR#3357
(cherry picked from commit 2e2a6d0ecd8f6984c692078ec2e2683690e0bc59)
2014-05-29 14:12:12 +01:00
Dr. Stephen Henson
92e2dc11f3 Change default cipher in smime app to des3.
PR#3357
(cherry picked from commit ca3ffd9670f2b589bf8cc04923f953e06d6fbc58)
2014-05-29 14:12:12 +01:00
Peter Mosmans
5bcb4be17d Fix for test_bn regular expression to work on Windows using MSYS. PR#3346 2014-05-27 23:29:57 +01:00
Matt Caswell
dd9d9056cb Fixed error in args for SSL_set_msg_callback and SSL_set_msg_callback_arg 2014-05-25 23:48:36 +01:00
Matt Caswell
44f28dd1e6 Fix for non compilation with TLS_DEBUG defined 2014-05-24 23:59:24 +01:00
Matt Caswell
3f2959beee Fixed minor copy&paste error, and stray space causing rendering problem 2014-05-22 00:12:39 +01:00
Janpopan
30e9cbe792 Fix a wrong parameter count ERR_add_error_data 2014-05-19 22:18:23 +01:00
Matt Caswell
5b7f4c718f Removed note in BUGS section about AEAD ciphers - inadvertently added to wrong branch 2014-05-15 21:19:46 +01:00
Jeffrey Walton
cb8044f032 Fix grammar error in verify pod. PR#3355 2014-05-14 23:00:18 +01:00
Jeffrey Walton
7bca2646b5 Add information to BUGS section of enc documentation. PR#3354 2014-05-14 23:00:18 +01:00
Michal Bozon
edc2df54b9 Corrected POD syntax errors. PR#3353 2014-05-14 23:00:18 +01:00
Kurt Roeckx
365e872fa1 Check sk_SSL_CIPHER_num() after assigning sk. 2014-05-12 23:05:19 +01:00
Jean-Paul Calderone
b3edc5fdb1 Correct the return type on the signature for X509_STORE_CTX_get_ex_data given in the pod file. 2014-05-12 22:48:06 +01:00
Serguei E. Leontiev
f7c4fe519b Replace manual ASN1 decoder with ASN1_get_object
Replace manual ASN.1 decoder with ASN1_get object. This
will decode the tag and length properly and check against
it does not exceed the supplied buffer length.

PR#3335
(cherry picked from commit b0308dddd1cc6a8e1de803ef29ba6da25ee072c2)
2014-05-12 18:41:49 +01:00
Matt Caswell
92c2c6e88c Fixed NULL pointer dereference. See PR#3321 2014-05-12 00:48:17 +01:00
Günther Noack
12cbba0d54 Avoid out-of-bounds write in SSL_get_shared_ciphers
PR: 3317
2014-05-11 23:59:38 +01:00
Viktor Dukhovni
f9f6befa1f Fix infinite loop. PR#3347 2014-05-11 21:15:57 +01:00
Tim Hudson
0552cbcdaa safety check to ensure we dont send out beyond the users buffer 2014-05-11 13:33:57 +01:00
Dr. Stephen Henson
c3cd9be01f Return an error if no recipient type matches.
If the key type does not match any CMS recipient type return
an error instead of using a random key (MMA mitigation). This
does not leak any useful information to an attacker.

PR#3348
(cherry picked from commit 83a3182e0560f76548f4378325393461f6275493)
2014-05-09 14:24:49 +01:00
Tim Hudson
9f4a47b3ed coverity 966576 - close socket in error path 2014-05-08 23:24:56 +01:00
Tim Hudson
51080676f1 PR#3342 fix resource leak coverity issue 966577 2014-05-08 23:24:51 +01:00
Tim Hudson
1535ff91e1 fix coverity issue 966597 - error line is not always initialised 2014-05-08 00:04:16 +01:00
Matt Caswell
79c8c47d5c Fixed NULL pointer dereference in PKCS7_dataDecode reported by David Ramos in PR#3339 2014-05-07 23:28:26 +01:00
Geoff Thorpe
84fe686173 evp: prevent underflow in base64 decoding
This patch resolves RT ticket #2608.

Thanks to Robert Dugal for originally spotting this, and to David
Ramos for noticing that the ball had been dropped.

Signed-off-by: Geoff Thorpe <geoff@openssl.org>
2014-05-06 18:15:43 -04:00
Geoff Thorpe
44ea88c26e bignum: allow concurrent BN_MONT_CTX_set_locked()
The lazy-initialisation of BN_MONT_CTX was serialising all threads, as
noted by Daniel Sands and co at Sandia. This was to handle the case that
2 or more threads race to lazy-init the same context, but stunted all
scalability in the case where 2 or more threads are doing unrelated
things! We favour the latter case by punishing the former. The init work
gets done by each thread that finds the context to be uninitialised, and
we then lock the "set" logic after that work is done - the winning
thread's work gets used, the losing threads throw away what they've done.

Signed-off-by: Geoff Thorpe <geoff@openssl.org>
2014-05-06 18:15:41 -04:00
Geoff Thorpe
f4e6975590 dso: eliminate VMS code on non-VMS systems
Even though the meat of dso_vms.c is compiled out on non-VMS builds,
the (pre-)compiler still traverses some of the macro handling. This
trips up at least one non-VMS build configuration, so this commit
makes the skip-VMS case more robust.

Signed-off-by: Geoff Thorpe <geoff@openssl.org>
2014-05-06 18:15:37 -04:00
Dr. Stephen Henson
3dd101aa4d Initialize num properly.
PR#3289
PR#3345
(cherry picked from commit 3ba1e406c2)
2014-05-06 14:09:21 +01:00
Dr. Stephen Henson
ba44b8d42e Set Enveloped data version to 2 if ktri version not zero.
(cherry picked from commit 9c5d953a07)
2014-05-06 14:04:37 +01:00
David Ramos
7cdbce53f1 Double free in i2o_ECPublicKey
PR: 3338
2014-05-04 00:56:13 +01:00
Jeff Trawick
1ff9f2eed3 typo in SSL_get_peer_cert_chain docs
RT: 3304
2014-05-02 00:29:31 +01:00
Matt Caswell
ee30926671 Fixed missing =back commands 2014-04-30 23:58:24 +01:00
Lubomir Rintel
3d50fef7d7 POD: Fix item numbering
Newer pod2man considers =item [1-9] part of a numbered list, while =item
0 starts an unnumbered list. Add a zero effect formatting mark to override
this.

doc/apps/smime.pod around line 315: Expected text after =item, not a
number
...

PR#3146
2014-04-30 23:50:21 +01:00
mancha
33c162301a Fix version documentation.
Specify -f is for compilation flags. Add -d to synopsis section.

(cherry picked from commit 006397ea62bbcae22c8664d53c2222b808c4bdd1)

Closes #80.
2014-04-26 11:24:14 +01:00
mancha
3abcf477a9 Fix eckey_priv_encode()
Fix eckey_priv_encode to return an error on failure of i2d_ECPrivateKey.
2014-04-24 19:33:01 +00:00
Steve Marquess
986fa907ae Add new sponsors
(cherry picked from commit 351f0a124bffaa94d2a8abdec2e7dde5ae9c457d)
2014-04-24 12:32:58 +01:00
Ben Laurie
e4e1b8f230 Fix use after free. 2014-04-23 07:33:26 +01:00
mancha
da8f10881e Fix double frees.
Conflicts:
	CHANGES
2014-04-22 22:52:26 +01:00
Dr. Stephen Henson
ebbbc8bd1c Document -debug_decrypt option.
(cherry picked from commit 0dd5b94aeb)
2014-04-16 12:36:21 +01:00
Dr. Stephen Henson
bddd6e3495 Extension checking fixes.
When looking for an extension we need to set the last found
position to -1 to properly search all extensions.

PR#3309.
(cherry picked from commit 300b9f0b70)
2014-04-15 18:53:14 +01:00
Dr. Stephen Henson
6fc530e6a0 Clarify CMS_decrypt behaviour.
(cherry picked from commit 5f8e9a477a)
2014-04-15 18:19:50 +01:00
Dr. Stephen Henson
d24e8ac25b Add new key fingerprint.
(cherry picked from commit 3143a332e8)
2014-04-11 02:51:59 +01:00
Dr. Stephen Henson
06e17142fc Fix free errors in ocsp utility.
Keep copy of any host, path and port values allocated by
OCSP_parse_url and free as necessary.
(cherry picked from commit 5219d3dd35)
2014-04-09 15:45:46 +01:00
Dr. Stephen Henson
f82596346b Document -verify_return_error option.
(cherry picked from commit 4e6c12f308)
2014-04-07 13:05:46 +01:00
Andy Polyakov
38b4d7aab1 crypto/modes: strict aliasing fixes from master. 2014-04-06 17:23:55 +02:00
Dr. Stephen Henson
f16fede1cd Use correct length when prompting for password.
Use bufsiz - 1 not BUFSIZ - 1 when prompting for a password in
the openssl utility.

Thanks to Rob Mackinnon, Leviathan Security for reporting this issue.
(cherry picked from commit 7ba08a4d73)
2014-04-04 13:08:42 +01:00
Dr. Stephen Henson
4a15b7c625 Update FAQ.
(cherry picked from commit 6cc0068430)
2014-04-04 13:08:39 +01:00
Dr. Stephen Henson
065b75d3b7 Document new crl option.
(cherry picked from commit dbb7654dc1)
2014-04-03 13:38:00 +01:00
Tim Hudson
75c3073bbf Add option to generate old hash format.
New -hash_old to generate CRL hashes using old
(before OpenSSL 1.0.0) algorithm.
(cherry picked from commit de2d97cd79)
2014-04-03 13:37:56 +01:00
Eric Young
5762c18517 Fix base64 decoding bug.
A short PEM encoded sequence if passed to the BIO, and the file
had 2 \n following would fail.

PR#3289
(cherry picked from commit 10378fb5f4)
2014-04-02 19:57:57 +01:00
Dr. Stephen Henson
6a1dd28576 update NEWS 2014-03-12 14:43:03 +00:00
Dr. Stephen Henson
0737acd2a8 Update ordinals.
Use a previously unused value as we will be updating multiple released
branches.
2014-03-12 14:41:00 +00:00
Dr. Stephen Henson
2198be3483 Fix for CVE-2014-0076
Fix for the attack described in the paper "Recovering OpenSSL
ECDSA Nonces Using the FLUSH+RELOAD Cache Side-channel Attack"
by Yuval Yarom and Naomi Benger. Details can be obtained from:
http://eprint.iacr.org/2014/140

Thanks to Yuval Yarom and Naomi Benger for discovering this
flaw and to Yuval Yarom for supplying a fix.
2014-03-12 14:16:19 +00:00
Dr. Stephen Henson
6fe498497c typo
(cherry picked from commit a029788b0e)
2014-03-10 15:49:35 +00:00
Andy Polyakov
ce2c6d8452 engines/ccgost/gosthash.c: simplify and avoid SEGV.
PR: 3275
(cherry picked from commit ea38f02049)
2014-03-07 11:04:10 +01:00
Dr. Stephen Henson
e67c71c8fd Fix for WIN32 builds with KRB5
(cherry picked from commit 3eddd1706a30cdf3dc9278692d8ee9038eac8a0d)
2014-02-26 15:33:31 +00:00
Andy Polyakov
ffa0e16198 ssl/t1_enc.c: check EVP_MD_CTX_copy return value.
PR: 3201
(cherry picked from commit 03da57fe14)
2014-02-25 22:24:52 +01:00
Dr. Stephen Henson
910b3a81fd Avoid Windows 8 Getversion deprecated errors.
Windows 8 SDKs complain that GetVersion() is deprecated.

We only use GetVersion like this:

	(GetVersion() < 0x80000000)

which checks if the Windows version is NT based. Use a macro check_winnt()
which uses GetVersion() on older SDK versions and true otherwise.
(cherry picked from commit a4cc3c8041)
2014-02-25 13:43:04 +00:00
Andy Polyakov
24a47191f3 BC-32.pl: pre-1.0.2-specific refresh for Borland C.
PR: 3251
Suggested by: Thorsten Schning
(cherry picked from commit 3ae1b53496)
2014-02-24 16:55:46 +01:00
Andy Polyakov
4ba2edd2a5 BC-32.pl: refresh Borland C support.
PR: 3251
Suggested by: Thorsten Schning
(cherry picked from commit 779c51c644)
2014-02-24 16:49:50 +01:00
Andy Polyakov
4f5b7a76da x509/by_dir.c: fix run-away pointer (and potential SEGV)
when adding duplicates in add_cert_dir.

PR: 3261
Reported by: Marian Done
(cherry picked from commit 758954e0d8)
2014-02-24 15:24:14 +01:00
Dr. Stephen Henson
8fe4d5bedb Remove duplicate statement.
(cherry picked from commit 5a7652c3e5)
2014-02-15 01:29:49 +00:00
Kurt Roeckx
d43301b77a Use defaults bits in req when not given
If you use "-newkey rsa" it's supposed to read the default number of bits from the
config file.  However the value isn't used to generate the key, but it does
print it's generating such a key.  The set_keygen_ctx() doesn't call
EVP_PKEY_CTX_set_rsa_keygen_bits() and you end up with the default set in
pkey_rsa_init() (1024).  Afterwards the number of bits gets read from the config
file, but nothing is done with that anymore.

We now read the config first and use the value from the config file when no size
is given.

PR: 2592
(cherry picked from commit 3343220327)
2014-02-14 22:36:05 +00:00
Kurt Roeckx
4727d57400 Fix additional pod errors with numbered items.
(cherry picked from commit e547c45f1c)
2014-02-14 22:36:04 +00:00
Scott Schaefer
b815ab2101 Fix various spelling errors
(cherry picked from commit 2b4ffc659e)
2014-02-14 22:36:04 +00:00
Scott Schaefer
ffaebdf38c Document pkcs12 -password behavior
apps/pkcs12.c accepts -password as an argument.  The document author
almost certainly meant to write "-password, -passin".

However, that is not correct, either.  Actually the code treats
-password as equivalent to -passin, EXCEPT when -export is also
specified, in which case -password as equivalent to -passout.
(cherry picked from commit 856c6dfb09)
2014-02-14 22:36:04 +00:00
Dr. Stephen Henson
8e04001f85 Clarify docs.
Remove reference to ERR_TXT_MALLOCED in the error library as that is
only used internally. Indicate that returned error data must not be
freed.
(cherry picked from commit f2d678e6e8)
2014-01-29 01:02:24 +00:00
Dr. Stephen Henson
0450d6c177 typo
(cherry picked from commit cb2182676b)
2014-01-28 15:36:39 +00:00
Dr. Stephen Henson
745929c2a5 Fix demo comment: 0.9.9 never released.
(cherry picked from commit 717cc85895)
2014-01-28 15:17:58 +00:00
Dr. Stephen Henson
158d061609 Add loaded dynamic ENGINEs to list.
Always add a dynamically loaded ENGINE to list. Otherwise it can cause
problems when multiply loaded, especially if it adds new public key methods.
For all current engines we only want a single implementation anyway.
(cherry picked from commit e933f91f50)
2014-01-28 13:57:58 +00:00
Dr. Stephen Henson
16d616756f Use default digest implementation in dgst.c
Use default instead of ENGINE version of digest. Without this
errors will occur if you use an ENGINE for a private key and
it doesn't implement the digest in question.
(cherry picked from commit 4eedf86a16)
2014-01-23 18:38:51 +00:00
Dr. Stephen Henson
9fe6acbd1d make update 2014-01-23 17:14:48 +00:00
Kaspar Brand
5df832293e Omit initial status request callback check.
PR#3178
(cherry picked from commit eb85ee9a88)
2014-01-16 13:51:05 +00:00
Zoltan Arpadffy
317ed9abdb VMS fixes 2014-01-11 22:42:15 +00:00
Dr. Stephen Henson
080ae68432 fix shell syntax PR#3216 2014-01-10 23:03:47 +00:00
Dr. Stephen Henson
6c6f6c44e5 Fix bug in X509_V_FLAG_IGNORE_CRITICAL CRL handling.
(cherry picked from commit 8f4077ca69)
2014-01-09 22:56:40 +00:00
Dr. Stephen Henson
11d31c00ad Prepare for 1.0.0m-dev 2014-01-06 15:02:46 +00:00
Dr. Stephen Henson
7f94a3c3de Prepare for 1.0.0l release 2014-01-06 15:02:02 +00:00
Dr. Stephen Henson
528c6ef7c0 make update 2014-01-06 13:36:25 +00:00
Dr. Stephen Henson
1b0d48126b Restore SSL_OP_MSIE_SSLV2_RSA_PADDING
The flag SSL_OP_MSIE_SSLV2_RSA_PADDING hasn't done anything since OpenSSL
0.9.7h but deleting it will break source compatibility with any software
that references it. Restore it but #define to zero.
(cherry picked from commit b17d6b8d1d)
2014-01-04 14:01:05 +00:00
Dr. Stephen Henson
7233e20931 update NEWS 2014-01-02 19:03:58 +00:00
Dr. Stephen Henson
2d64b51d20 Fix DTLS retransmission from previous session.
For DTLS we might need to retransmit messages from the previous session
so keep a copy of write context in DTLS retransmission buffers instead
of replacing it after sending CCS. CVE-2013-6450.
(cherry picked from commit 34628967f1)

Conflicts:

	ssl/ssl_locl.h
2013-12-20 23:20:24 +00:00
Dr. Stephen Henson
1f7732bca2 Ignore NULL parameter in EVP_MD_CTX_destroy.
(cherry picked from commit a6c62f0c25)
2013-12-20 22:53:38 +00:00
Dr. Stephen Henson
fec613dcf2 remove obsolete STATUS file 2013-12-10 00:11:00 +00:00
Dr. Stephen Henson
91f17128ab Add release dates to NEWS 2013-12-09 23:54:37 +00:00
Dr. Stephen Henson
2a832cf05b Simplify and update openssl.spec 2013-11-27 15:37:00 +00:00
Dr. Stephen Henson
0c9394280a Fix memory leak.
(cherry picked from commit 16bc45ba95)
2013-11-11 23:55:47 +00:00
Dr. Stephen Henson
07aafc4956 Check for missing components in RSA_check.
(cherry picked from commit 01be36ef70525e81fc358d2e559bdd0a0d9427a5)
2013-11-09 15:09:21 +00:00
Dr. Stephen Henson
70fd1f9173 Document RSAPublicKey_{in,out} options.
(cherry picked from commit 7040d73d22987532faa503630d6616cf2788c975)
2013-11-09 15:09:20 +00:00
Andy Polyakov
16f2ba724d engines/ccgost/gost89.h: make word32 defintion unconditional.
Original definition depended on __LONG_MAX__ that is not guaranteed to
be present. As we don't support platforms with int narrower that 32 bits
it's appropriate to make defition inconditional.

PR: 3165
(cherry picked from commit 96180cac04)
2013-11-08 23:20:24 +01:00
Dr. Stephen Henson
0c0a51d34b Initialise context before using it.
(cherry picked from commit a4947e4e06)
2013-11-06 13:19:37 +00:00
Ben Laurie
68b6a94379 PBKDF2 should be efficient. Contributed by Christian Heimes
<christian@python.org>.

Conflicts:
	crypto/evp/p5_crpt2.c
2013-11-05 10:47:35 +00:00
Ben Laurie
b7aa71a3f9 Merge branch 'rob-100' into OpenSSL_1_0_0-stable 2013-10-04 14:43:43 +01:00
Rob Stradling
f1d0201952 Update CHANGES. 2013-10-04 14:25:36 +01:00
Andy Polyakov
41468ed388 evp/e_des3.c: fix typo with potential integer overflow on 32-bit platforms.
Submitted by: Yuriy Kaminskiy
(cherry picked from commit 524b00c0da)

Resolved conflicts:

	crypto/evp/e_des3.c
(cherry picked from commit eb22b7ec75)
2013-10-03 11:13:10 +02:00
Ben Laurie
5f0df1f650 Constification.
Conflicts:
	crypto/buffer/buffer.c
2013-10-01 15:26:14 +01:00
Dr. Stephen Henson
e6b4ed7ffa Typo.
(cherry picked from commit 415ece7301)
2013-09-30 14:26:10 +01:00
Bodo Moeller
f11bedf8ed Sync CHANGES and NEWS files. 2013-09-16 14:46:57 +02:00
Bodo Moeller
c23746f339 Fix overly lenient comparisons:
- EC_GROUP_cmp shouldn't consider curves equal just because
      the curve name is the same. (They really *should* be the same
      in this case, but there's an EC_GROUP_set_curve_name API,
      which could be misused.)

    - EC_POINT_cmp shouldn't return 0 for ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED
      or EC_R_INCOMPATIBLE_OBJECTS errors because in a cmp API, 0 indicates
      equality (not an error).

    Reported by: king cope

(cherry picked from commit 312a46791ab465cfa3bf26764361faed0e5df014)
2013-09-16 13:13:32 +02:00
Rob Stradling
7a1b1722f5 Remove empty line. 2013-09-10 11:38:52 +01:00
Rob Stradling
583c2aa3e5 Tidy up comments. 2013-09-10 10:13:00 +01:00
Rob Stradling
9b2b619133 Use TLS version supplied by client when fingerprinting Safari. 2013-09-10 10:05:17 +01:00
Rob Stradling
48f91f6a88 Backport TLS 1.1/1.2 #defines 2013-09-09 21:08:17 +01:00
Rob Stradling
6f1c8d45f7 Don't prefer ECDHE-ECDSA ciphers when the client appears to be Safari on OS X.
OS X 10.8..10.8.3 has broken support for ECDHE-ECDSA ciphers.
2013-09-09 14:13:59 +01:00
Dr. Stephen Henson
56023bc405 Correct ECDSA example.
(cherry picked from commit 3a918ea2bbf4175d9461f81be1403d3781b2c0dc)
2013-08-20 17:31:17 +01:00
Michael Tuexen
6f87807e62 DTLS message_sequence number wrong in rehandshake ServerHello
This fix ensures that
* A HelloRequest is retransmitted if not responded by a ClientHello
* The HelloRequest "consumes" the sequence number 0. The subsequent
ServerHello uses the sequence number 1.
* The client also expects the sequence number of the ServerHello to
be 1 if a HelloRequest was received earlier.
This patch fixes the RFC violation.
(cherry picked from commit b62f4daac0)

Conflicts:

	ssl/d1_pkt.c
2013-08-13 18:59:41 +01:00
Michael Tuexen
799f203ff6 DTLS handshake fix.
Reported by: Prashant Jaikumar <rmstar@gmail.com>

Fix handling of application data received before a handshake.
(cherry picked from commit 0c75eeacd3)
2013-08-08 13:32:26 +01:00
Dr. Stephen Henson
34eee35479 Fix verify loop with CRL checking.
PR #3090
Reported by: Franck Youssef <fry@open.ch>

If no new reason codes are obtained after checking a CRL exit with an
error to avoid repeatedly checking the same CRL.

This will only happen if verify errors such as invalid CRL scope are
overridden in a callback.
(cherry picked from commit 4b26645c1a)
2013-08-06 16:08:15 +01:00
Kaspar Brand
bcd092d706 Fix for PEM_X509_INFO_read_bio.
PR: 3028
Fix bug introduced in PEM_X509_INFO_bio which wouldn't process RSA keys
correctly if they appeared first.
(cherry picked from commit 5ae8d6bcba)
2013-08-06 16:05:52 +01:00
Andy Polyakov
713f110f53 config: fix executable format detection on latest FreeBSD.
Submitted by: Bryan Drewery
PR: 3075
(cherry picked from commit c256e69d3f)
2013-07-01 00:01:26 +02:00
Dr. Stephen Henson
4d11426716 Set s->d1 to NULL after freeing it.
(cherry picked from commit 04638f2fc3)
2013-04-08 18:40:08 +01:00
Dr. Stephen Henson
3087bd32ff Typo.
(cherry picked from commit 0ded2a0689)
2013-03-31 17:44:07 +01:00
Dr. Stephen Henson
a47060f1c9 Disable compression for DTLS.
The only standard compression method is stateful and is incompatible with
DTLS.
(cherry picked from commit e14b8410ca)
2013-03-19 13:47:51 +00:00
Andy Polyakov
b04c0d805c x86cpuid.pl: make it work with older CPUs.
PR: 3005
(cherry picked from commit 5702e965d7)
2013-03-18 19:51:13 +01:00
Michael Tuexen
a1a45c59ec Avoid unnecessary fragmentation.
(cherry picked from commit 80ccc66d7e)
2013-03-18 14:33:15 +00:00
Dr. Stephen Henson
64841ed746 Encode INTEGER correctly.
If an ASN1_INTEGER structure is allocated but not explicitly set encode
it as zero: don't generate an invalid zero length INTEGER.
(cherry picked from commit 1643edc63c)
2013-03-18 14:21:03 +00:00
Dr. Stephen Henson
901554b355 Typo.
(cherry picked from commit 1546fb780b)
2013-03-18 13:59:25 +00:00
Nick Alcock
0e05f88ebf Fix POD errors to stop make install_docs dying with pod2man 2.5.0+
podlators 2.5.0 has switched to dying on POD syntax errors. This means
that a bunch of long-standing erroneous POD in the openssl documentation
now leads to fatal errors from pod2man, halting installation.

Unfortunately POD constraints mean that you have to sort numeric lists
in ascending order if they start with 1: you cannot do 1, 0, 2 even if
you want 1 to appear first. I've reshuffled such (alas, I wish there
were a better way but I don't know of one).
(cherry picked from commit 5cc2707742)
2013-02-15 19:40:22 +01:00
Andy Polyakov
6715f00081 cms-test.pl: make it work with not-so-latest perl.
(cherry picked from commit 9c437e2fad)
2013-02-14 16:39:53 +01:00
David Woodhouse
6a14feb048 Check DTLS_BAD_VER for version number.
Need to check DTLS_BAD_VER as well as DTLS1_VERSION.
PR:2984
2013-02-12 15:09:44 +00:00
Dr. Stephen Henson
02c54f7c22 Fix in ssltest is no-ssl2 configured
(cherry picked from commit cbf9b4aed3)
2013-02-11 18:27:06 +00:00
Dr. Stephen Henson
243dac0af0 Fix for SSL_get_certificate
Now we set the current certificate to the one used by a server
there is no need to call ssl_get_server_send_cert which will
fail if we haven't sent a certificate yet.
(cherry picked from commit 147dbb2fe3)
2013-02-11 18:26:33 +00:00
Lutz Jaenicke
da018b129e FAQ/README: we are now using Git instead of CVS
(cherry picked from commit f88dbb8385)
2013-02-11 11:32:34 +01:00
Andy Polyakov
e9554f7f9b sparccpuid.S: work around emulator bug on T1.
(cherry picked from commit 3caeef94bd)
2013-02-11 10:42:32 +01:00
Andy Polyakov
71a1ac9398 ssl/s3_[clnt|srvr].c: fix warnings and linking error. 2013-02-09 19:48:34 +01:00
Andy Polyakov
6a2f94b39a s3_cbc.c: make CBC_MAC_ROTATE_IN_PLACE universal.
(cherry picked from commit f93a41877d)
2013-02-08 21:37:30 +01:00
Andy Polyakov
6ba1d561eb s3_cbc.c: get rid of expensive divisions [from master].
(cherry picked from commit e9baceab5a)
2013-02-08 17:01:31 +01:00
Andy Polyakov
f73546df92 ssl/[d1|s3]_pkt.c: harmomize orig_len handling.
(cherry picked from commit 8545f73b89)
2013-02-08 11:14:12 +01:00
Dr. Stephen Henson
be125aa5ba Fix IV check and padding removal.
Fix the calculation that checks there is enough room in a record
after removing padding and optional explicit IV. (by Steve)

For AEAD remove the correct number of padding bytes (by Andy)
(cherry picked from commit 32cc2479b4)

Resolved conflicts:

	ssl/s3_cbc.c
2013-02-08 11:12:49 +01:00
Andy Polyakov
413cbfe68d ssl/*: remove SSL3_RECORD->orig_len to restore binary compatibility.
Kludge alert. This is arranged by passing padding length in unused
bits of SSL3_RECORD->type, so that orig_len can be reconstructed.
(cherry picked from commit 8bfd4c659f)
2013-02-07 13:43:51 +00:00
Adam Langley
ee463921ed Fix for EXP-RC2-CBC-MD5
MD5 should use little endian order. Fortunately the only ciphersuite
affected is EXP-RC2-CBC-MD5 (TLS_RSA_EXPORT_WITH_RC2_CBC_40_MD5) which
is a rarely used export grade ciphersuite.
2013-02-06 15:50:42 +00:00
Dr. Stephen Henson
76e7744bef prepare for next version 2013-02-06 02:27:23 +00:00
Dr. Stephen Henson
d9e048ceac prepare for release 2013-02-05 16:46:21 +00:00
Dr. Stephen Henson
65a9383e6b make update 2013-02-05 16:46:21 +00:00
Dr. Stephen Henson
c6b82f7ee9 Add ordinal for CRYPTO_memcmp: since this will affect multiple
branches it needs to be in a "gap".
(cherry picked from commit 81ce0e14e7)
2013-02-05 16:46:20 +00:00
Dr. Stephen Henson
25590043d1 Fix error codes.
(cherry picked from commit 35d732fc2e)
2013-02-05 16:46:19 +00:00
Dr. Stephen Henson
8a5d624d5b Update CHANGES and NEWS 2013-02-05 16:46:19 +00:00
Andy Polyakov
ae4a75cecf bn_word.c: fix overflow bug in BN_add_word.
(cherry picked from commit 134c00659a)
2013-02-05 16:46:19 +00:00
Andy Polyakov
2e884ce11d x86_64 assembly pack: keep making Windows build more robust.
PR: 2963 and a number of others
(cherry picked from commit 4568182a8b)
2013-02-05 16:46:19 +00:00
Dr. Stephen Henson
da8f1b738c update NEWS 2013-02-05 16:46:18 +00:00
Andy Polyakov
33f44acbbe s3/s3_cbc.c: allow for compilations with NO_SHA256|512.
(cherry picked from commit d5371324d9)
2013-02-05 16:46:18 +00:00
Andy Polyakov
11c48a0fd2 ssl/s3_cbc.c: md_state alignment portability fix.
RISCs are picky and alignment granted by compiler for md_state can be
insufficient for SHA512.
(cherry picked from commit 36260233e7)
2013-02-05 16:46:18 +00:00
Andy Polyakov
3cdaca2436 ssl/s3_cbc.c: uint64_t portability fix.
Break dependency on uint64_t. It's possible to declare bits as
unsigned int, because TLS packets are limited in size and 32-bit
value can't overflow.
(cherry picked from commit cab13fc847)
2013-02-05 16:46:17 +00:00
Ben Laurie
b23da2919b Update DTLS code to match CBC decoding in TLS.
This change updates the DTLS code to match the constant-time CBC
behaviour in the TLS.
(cherry picked from commit 9f27de170d)
2013-02-05 16:46:17 +00:00
Ben Laurie
610dfc3ef4 Don't crash when processing a zero-length, TLS >= 1.1 record.
The previous CBC patch was bugged in that there was a path through enc()
in s3_pkt.c/d1_pkt.c which didn't set orig_len. orig_len would be left
at the previous value which could suggest that the packet was a
sufficient length when it wasn't.
(cherry picked from commit 6cb19b7681)
2013-02-05 16:46:17 +00:00
Ben Laurie
080f395392 Fixups from previous commit. 2013-02-05 16:46:17 +00:00
Ben Laurie
f852b60797 Oops. Add missing file.
(cherry picked from commit 014265eb02)
2013-02-05 16:46:16 +00:00
Ben Laurie
e2356454c8 Add a target so I can build this. 2013-02-05 16:46:16 +00:00
Ben Laurie
e5420be6cd Make CBC decoding constant time.
This patch makes the decoding of SSLv3 and TLS CBC records constant
time. Without this, a timing side-channel can be used to build a padding
oracle and mount Vaudenay's attack.

This patch also disables the stitched AESNI+SHA mode pending a similar
fix to that code.

In order to be easy to backport, this change is implemented in ssl/,
rather than as a generic AEAD mode. In the future this should be changed
around so that HMAC isn't in ssl/, but crypto/ as FIPS expects.
(cherry picked from commit e130841bcc)

Conflicts:
	crypto/evp/c_allc.c
	ssl/ssl_algs.c
	ssl/ssl_locl.h
	ssl/t1_enc.c
2013-02-05 16:46:16 +00:00
Ben Laurie
9c00a95060 Add and use a constant-time memcmp.
This change adds CRYPTO_memcmp, which compares two vectors of bytes in
an amount of time that's independent of their contents. It also changes
several MAC compares in the code to use this over the standard memcmp,
which may leak information about the size of a matching prefix.
(cherry picked from commit 2ee798880a)

Conflicts:
	crypto/crypto.h
	ssl/t1_lib.c
2013-02-05 16:46:15 +00:00
Dr. Stephen Henson
ebc71865f0 Don't try and verify signatures if key is NULL (CVE-2013-0166)
Add additional check to catch this in ASN1_item_verify too.
2013-02-05 16:46:15 +00:00
Dr. Stephen Henson
1dfa62d4c8 Don't include comp.h in cmd_cd.c if OPENSSL_NO_COMP set 2013-01-23 01:14:13 +00:00
Andy Polyakov
8c6364e198 x86_64 assembly pack: make Windows build more robust [from master].
PR: 2963 and a number of others
2013-01-22 23:00:02 +01:00
Dr. Stephen Henson
98c2e93723 Don't include comp.h if no-comp set. 2013-01-20 01:12:15 +00:00
Andy Polyakov
c053e538b4 engines/ccgost: GOST fixes [from master].
Submitted by: Dmitry Belyavsky, Seguei Leontiev
PR: 2821
2013-01-19 18:27:21 +01:00
Andy Polyakov
6386647298 .gitignore adjustments 2013-01-19 15:31:09 +01:00
Ben Laurie
4b24b754f5 Correct EVP_PKEY_verifyrecover to EVP_PKEY_verify_recover (RT 2955). 2013-01-13 22:58:00 +00:00
Dr. Stephen Henson
bfff2cc192 Add .gitignore 2013-01-13 22:57:22 +00:00
Dr. Stephen Henson
d8b177719a make no-comp compile 2012-12-30 16:05:24 +00:00
Dr. Stephen Henson
d985a68c89 add missing \n 2012-12-23 18:19:47 +00:00
Dr. Stephen Henson
8dad8bc465 PR: 2888
Reported by: Daniel Black <daniel.black@openquery.com>

Support renewing session tickets (backport from HEAD).
2012-12-10 16:45:19 +00:00
Dr. Stephen Henson
235e76bce1 Fix two bugs which affect delta CRL handling:
Use -1 to check all extensions in CRLs.
Always set flag for freshest CRL.
2012-12-06 18:25:18 +00:00
Dr. Stephen Henson
d38c549e60 check mval for NULL too 2012-12-04 17:26:26 +00:00
Dr. Stephen Henson
558189183f fix leak 2012-12-03 16:33:35 +00:00
Dr. Stephen Henson
77ada38dbd PR: 2803
Submitted by: jean-etienne.schwartz@bull.net

In OCSP_basic_varify return an error if X509_STORE_CTX_init fails.
2012-11-29 19:15:52 +00:00
Dr. Stephen Henson
8124ebcd78 reject zero length point format list or supported curves extensions 2012-11-22 14:15:00 +00:00
Dr. Stephen Henson
04fde2025b PR: 2908
Submitted by: Dmitry Belyavsky <beldmit@gmail.com>

Fix DH double free if parameter generation fails.
2012-11-21 14:01:55 +00:00
Dr. Stephen Henson
6bd61198fb fix leaks 2012-11-20 00:29:09 +00:00
Dr. Stephen Henson
23b5e47ffc correct docs 2012-11-19 20:07:14 +00:00
Dr. Stephen Henson
fb81e6d300 PR: 2880
Submitted by: "Florian Rüchel" <florian.ruechel@ruhr-uni-bochum.de>

Correctly handle local machine keys in the capi ENGINE.
2012-11-18 15:20:49 +00:00
Andy Polyakov
50ff4afb03 aix[64]-cc: get MT support right [from HEAD].
PR: 2896
2012-10-16 08:20:18 +00:00
Bodo Möller
c51f6bccea Fix EC_KEY initialization race.
Submitted by: Adam Langley
2012-10-05 20:51:31 +00:00
Dr. Stephen Henson
836a811604 backport OCSP fix enhancement 2012-10-05 13:00:18 +00:00
Ben Laurie
bb65e3f22b Backport OCSP Stapling fix. 2012-10-04 15:16:12 +00:00
Ben Laurie
b8719c753e Fix warning. 2012-10-04 15:04:26 +00:00
Ben Laurie
92b2530acd Fix warning (hope this doesn't break other platforms, there's a twisty
little maze of #ifs, all different).
2012-10-04 15:03:08 +00:00
Bodo Möller
9ff94ad7ae Fix Valgrind warning.
Submitted by: Adam Langley
2012-09-24 19:50:00 +00:00
Richard Levitte
60ccb02c4a * Configure: make the debug-levitte-linux{elf,noasm} less extreme. 2012-09-24 18:49:01 +00:00
Richard Levitte
094fb13876 * ssl/t1_enc.c (tls1_change_cipher_state): Stupid bug. Fortunately in
debugging code that's seldom used.
2012-09-21 13:08:26 +00:00
Bodo Möller
9c5d75d5a9 Fix warning.
Submitted by: Chromium Authors
2012-09-17 17:26:03 +00:00
Dr. Stephen Henson
ca461ecd11 fix memory leak 2012-09-11 13:45:11 +00:00
Dr. Stephen Henson
0ad9fe2d59 Don't load GOST ENGINE if it is already loaded.
Multiple copies of the ENGINE will cause problems when it is cleaned up as
the methods are stored in static structures which will be overwritten and
freed up more than once.

Set static methods to NULL when the ENGINE is freed so it can be reloaded.
2012-09-01 11:30:19 +00:00
Andy Polyakov
a203df7521 sha1-armv4-large.pl: comply with ABI [from HEAD]. 2012-08-17 20:01:47 +00:00
Andy Polyakov
144517299c gosthash.c: use memmove in circle_xor8, as input pointers can be equal
[from HEAD].

PR: 2858
2012-08-13 16:39:42 +00:00
Andy Polyakov
5c468f0c1f ./Configure: libcrypto.a can grow to many GB on Solaris 10, because of ar bug
[from HEAD].

PR: 2838
2012-08-13 16:21:00 +00:00
Richard Levitte
83a4ae6b0b Cosmetics: remove duplicate symbol in crypto/symhacks.h 2012-07-05 08:49:02 +00:00
Richard Levitte
9374bc1c10 Cosmetic: Reorder so it's more similar to the Unixly build. 2012-07-04 17:27:43 +00:00
Andy Polyakov
e9c563fc29 bss_dgram.c: fix typos in Windows code. 2012-07-01 09:12:23 +00:00
Andy Polyakov
4887e07819 x86_64 assembly pack: make it possible to compile with Perl located
on path with spaces [from HEAD].

PR: 2835
2012-06-27 13:04:17 +00:00
Dr. Stephen Henson
652ac3e93a oops, add -debug_decrypt option which was accidenatally left out 2012-06-19 13:38:47 +00:00
Andy Polyakov
8d2f61ac70 bss_dgram.c: fix bugs [from HEAD].
PR: 2833
2012-06-19 12:50:09 +00:00
Andy Polyakov
02a23fa309 s2_clnt.c: compensate for compiler bug [from HEAD]. 2012-05-16 18:22:39 +00:00
Dr. Stephen Henson
bef20d4a68 PR: 2813
Reported by: Constantine Sapuntzakis <csapuntz@gmail.com>

Fix possible deadlock when decoding public keys.
2012-05-11 13:50:09 +00:00
Dr. Stephen Henson
dddddb2e6c prepare for next version 2012-05-10 16:01:57 +00:00
Dr. Stephen Henson
8fcb93613a prepare for 1.0.0j release 2012-05-10 14:48:54 +00:00
Dr. Stephen Henson
ecb58c1628 update NEWS 2012-05-10 14:45:05 +00:00
Dr. Stephen Henson
a969ca5cc8 Sanity check record length before skipping explicit IV in DTLS
to fix DoS attack.

Thanks to Codenomicon for discovering this issue using Fuzz-o-Matic
fuzzing as a service testing platform.
(CVE-2012-2333)
2012-05-10 14:44:20 +00:00
Dr. Stephen Henson
1e4406a854 Reported by: Solar Designer of Openwall
Make sure tkeylen is initialised properly when encrypting CMS messages.
2012-05-10 13:28:28 +00:00
Richard Levitte
94fbee800b Correct environment variable is OPENSSL_ALLOW_PROXY_CERTS. 2012-05-04 10:43:19 +00:00
Andy Polyakov
c50847c28b ppccpuid.pl: branch hints in OPENSSL_cleanse impact small block performance
of digest algorithms, mosty SHA, on Power7. Mystery of century, why SHA,
why slower algorithm are affected more... [from HEAD].
PR: 2794
Submitted by: Ashley Lai
2012-04-27 20:21:26 +00:00
Dr. Stephen Henson
b1ce2d24dd correct error code 2012-04-22 13:31:37 +00:00
Dr. Stephen Henson
743fb51d2c correct old FAQ answers, sync with HEAD 2012-04-22 13:21:59 +00:00
Dr. Stephen Henson
0ed781740d prepare for next version 2012-04-19 17:02:49 +00:00
Dr. Stephen Henson
d0e542fdc9 prepare for 1.0.0i release 2012-04-19 11:47:20 +00:00
Dr. Stephen Henson
457863efdf update NEWS 2012-04-19 11:45:37 +00:00
Dr. Stephen Henson
5bd4fcc5c2 Check for potentially exploitable overflows in asn1_d2i_read_bio
BUF_mem_grow and BUF_mem_grow_clean. Refuse attempts to shrink buffer
in CRYPTO_realloc_clean.

Thanks to Tavis Ormandy, Google Security Team, for discovering this
issue and to Adam Langley <agl@chromium.org> for fixing it. (CVE-2012-2110)
2012-04-19 11:44:51 +00:00
Andy Polyakov
3dd2eebfbc Makefile.org: clear yet another environment variable [from HEAD].
PR: 2793
2012-04-19 06:40:47 +00:00
Andy Polyakov
d079b387a3 OPENSSL_NO_SOCK fixes [from HEAD].
PR: 2791
Submitted by: Ben Noordhuis
2012-04-16 17:43:28 +00:00
Andy Polyakov
8eeaeb4b04 Minor compatibility fixes [from HEAD].
PR: 2790
Submitted by: Alexei Khlebnikov
2012-04-16 17:37:04 +00:00
Andy Polyakov
0041925844 s3_srvr.c: fix typo [from HEAD].
PR: 2538
2012-04-15 17:23:23 +00:00
Dr. Stephen Henson
14fa016b2b update rather ancient EVP digest documentation 2012-04-10 22:28:34 +00:00
Dr. Stephen Henson
7fdccda37d PR: 2778(part)
Submitted by: John Fitzgibbon <john_fitzgibbon@yahoo.com>

Time is always encoded as 4 bytes, not sizeof(Time).
2012-03-31 18:02:35 +00:00
Andy Polyakov
cdc575c46b ans1/tasn_prn.c: avoid bool in variable names [from HEAD].
PR: 2776
2012-03-29 17:51:37 +00:00
Dr. Stephen Henson
2f0aaf76f3 Submitted by: Markus Friedl <mfriedl@gmail.com>
Fix memory leaks in 'goto err' cases.
2012-03-22 15:43:06 +00:00
Dr. Stephen Henson
6b7887b0ab Always use SSLv23_{client,server}_method in s_client.c and s_server.c,
the old code came from SSLeay days before TLS was even supported.
2012-03-18 18:14:46 +00:00
Richard Levitte
9ad1b440ae cipher should only be set to PSK if JPAKE is used. 2012-03-14 12:38:55 +00:00
Andy Polyakov
9275ad321f config: compensate for bug in Solaris cc drivers, which can remove /dev/null
[from HEAD,1.0.1]
2012-03-13 19:22:26 +00:00
Andy Polyakov
216a2a5fc6 x86_64-xlate.pl: remove old kludge.
PR: 2435,2440
2012-03-13 19:19:57 +00:00
Dr. Stephen Henson
c2c6044933 prepare for next version 2012-03-12 16:35:49 +00:00
Dr. Stephen Henson
dc95c53c6f corrected fix to PR#2711 and also cover mime_param_cmp 2012-03-12 15:26:48 +00:00
Dr. Stephen Henson
b24a53dd9a correct NEWS 2012-03-12 14:45:07 +00:00
Dr. Stephen Henson
ffbe7cd0c5 fix error code 2012-03-12 14:32:54 +00:00
Dr. Stephen Henson
97183a312e prepare for release 2012-03-12 14:24:50 +00:00
Dr. Stephen Henson
46ed8aff6d update NEWS 2012-03-12 14:23:35 +00:00
Dr. Stephen Henson
6a0a48433b Fix for CMS/PKCS7 MMA. If RSA decryption fails use a random key and
continue with symmetric decryption process to avoid leaking timing
information to an attacker.

Thanks to Ivan Nestlerode <inestlerode@us.ibm.com> for discovering
this issue. (CVE-2012-0884)
2012-03-12 14:22:59 +00:00
Dr. Stephen Henson
ad3d95222d PR: 2756
Submitted by: Robin Seggelmann <seggelmann@fh-muenster.de>

Fix DTLS timeout handling.
2012-03-09 15:52:09 +00:00
Dr. Stephen Henson
18ea747ce4 check return value of BIO_write in PKCS7_decrypt 2012-03-08 14:02:00 +00:00
Dr. Stephen Henson
f4f512a853 PR: 2755
Submitted by: Robin Seggelmann <seggelmann@fh-muenster.de>

Reduce MTU after failed transmissions.
2012-03-06 13:46:52 +00:00
Dr. Stephen Henson
9c2bed0b65 PR: 2748
Submitted by: Robin Seggelmann <seggelmann@fh-muenster.de>

Fix possible DTLS timer deadlock.
2012-03-06 13:22:57 +00:00
Andy Polyakov
ad83334e73 Configure: make no-whirlpool work [from HEAD]. 2012-03-03 13:48:21 +00:00
Dr. Stephen Henson
2cf4bc9ecd PR: 2743
Reported by: Dmitry Belyavsky <beldmit@gmail.com>

Fix memory leak if invalid GOST MAC key given.
2012-02-29 14:12:37 +00:00
Dr. Stephen Henson
c8ac945d59 PR: 2742
Reported by: Dmitry Belyavsky <beldmit@gmail.com>

If resigning with detached content in CMS just copy data across.
2012-02-29 14:01:40 +00:00
Dr. Stephen Henson
92aa50bc03 Fix memory leak cause by race condition when creating public keys.
Thanks to Ivan Nestlerode <inestlerode@us.ibm.com> for reporting this bug.
2012-02-28 14:47:25 +00:00
Dr. Stephen Henson
2f31308b17 PR: 2736
Reported by: Remi Gacogne <rgacogne-bugs@coredump.fr>

Preserve unused bits value in non-canonicalised ASN1_STRING structures
by using ASN1_STRING_copy which preseves flags.
2012-02-27 18:45:06 +00:00
Dr. Stephen Henson
468d58e712 xn is never actually used, remove it 2012-02-27 17:07:46 +00:00
Dr. Stephen Henson
dd4b50ff6a PR: 2737
Submitted by: Remi Gacogne <rgacogne-bugs@coredump.fr>

Fix double free in PKCS12_parse if we run out of memory.
2012-02-27 16:46:54 +00:00
Dr. Stephen Henson
030d5b8c97 PR: 2735
Make cryptodev digests work. Thanks to Nikos Mavrogiannopoulos for
this fix.
2012-02-27 16:33:16 +00:00
Dr. Stephen Henson
9b73be38ab free headers after use in error message 2012-02-27 16:27:00 +00:00
Dr. Stephen Henson
e5bf2f5d4c Detect symmetric crypto errors in PKCS7_decrypt.
Thanks to Ivan Nestlerode <inestlerode@us.ibm.com> for reporting this bug.
2012-02-27 15:23:04 +00:00
Dr. Stephen Henson
a7096946fa PR: 2711
Submitted by: Tomas Mraz <tmraz@redhat.com>

Tolerate bad MIME headers in parser.
2012-02-23 21:50:23 +00:00
Dr. Stephen Henson
4a8362a68b PR: 2696
Submitted by: Rob Austein <sra@hactrn.net>

Fix inverted range problem in RFC3779 code.

Thanks to Andrew Chi for generating test cases for this bug.
2012-02-23 21:31:10 +00:00
Dr. Stephen Henson
25128a11fb Fix bug in CVE-2011-4619: check we have really received a client hello
before rejecting multiple SGC restarts.
2012-02-16 15:21:46 +00:00
Dr. Stephen Henson
3deb968fec PR: 2713
Submitted by: Tomas Mraz <tmraz@redhat.com>

Move libraries that are not needed for dynamic linking to Libs.private in
the .pc files
2012-02-12 18:47:02 +00:00
Dr. Stephen Henson
276eb93218 PR: 2717
Submitted by: Tim Rice <tim@multitalents.net>

Make compilation work on OpenServer 5.0.7
2012-02-12 18:25:11 +00:00
Dr. Stephen Henson
29c33e16ac PR: 2703
Submitted by: Alexey Melnikov <alexey.melnikov@isode.com>

Fix some memory and resource leaks in CAPI ENGINE.
2012-02-11 23:12:48 +00:00
Dr. Stephen Henson
bffb696f65 PR: 2705
Submitted by: Alexey Melnikov <alexey.melnikov@isode.com>

Only create ex_data indices once for CAPI engine.
2012-02-11 23:07:48 +00:00
Dr. Stephen Henson
fd2d78e70b PR: 2710
Submitted by: Tomas Mraz <tmraz@redhat.com>

Check return codes for load_certs_crls.
2012-02-10 19:54:37 +00:00
Andy Polyakov
6b1fb9179e x86_64-xlate.pl: proper solution for RT#2620 [from HEAD]. 2012-01-21 11:35:29 +00:00
Dr. Stephen Henson
702175817f prepare for next version 2012-01-18 14:27:57 +00:00
Dr. Stephen Henson
703ec840dc prepare for release 2012-01-18 13:38:34 +00:00
Dr. Stephen Henson
04d706d42a update NEWS 2012-01-18 13:36:59 +00:00
Dr. Stephen Henson
b996cecc32 Fix for DTLS DoS issue introduced by fix for CVE-2011-4109.
Thanks to Antonio Martin, Enterprise Secure Access Research and
Development, Cisco Systems, Inc. for discovering this bug and
preparing a fix. (CVE-2012-0050)
2012-01-18 13:36:04 +00:00
Dr. Stephen Henson
7e927da2a5 fix CHANGES entry 2012-01-17 14:19:51 +00:00
Andy Polyakov
7aa6d2fcf9 Fix OPNESSL vs. OPENSSL typos [from HEAD].
PR: 2613
Submitted by: Leena Heino
2012-01-15 13:40:40 +00:00
Andy Polyakov
27b1f137ff Sanitize usage of <ctype.h> functions. It's important that characters
are passed zero-extended, not sign-extended [from HEAD].
PR: 2682
2012-01-12 16:37:20 +00:00
Andy Polyakov
f63c927e8e asn1/t_x509.c: fix serial number print, harmonize with a_int.c [from HEAD].
PR: 2675
Submitted by: Annie Yousar
2012-01-12 16:36:30 +00:00
Andy Polyakov
d572544a2c ecdsa.pod: typo.
PR: 2678
Submitted by: Annie Yousar
2012-01-11 21:42:20 +00:00
Andy Polyakov
9100840258 aes-sparcv9.pl: clean up regexp [from HEAD].
PR: 2685
2012-01-11 15:32:57 +00:00
Dr. Stephen Henson
0f32c83c91 fix warning 2012-01-10 14:37:09 +00:00
Bodo Möller
80b570142d Update for 0.9.8s. 2012-01-05 13:38:47 +00:00
Bodo Möller
a99b6fcb7c Fix usage indentation 2012-01-05 13:15:50 +00:00
Bodo Möller
02d1a6b3aa Fix for builds without DTLS support.
Submitted by: Brian Carlstrom
2012-01-05 10:22:23 +00:00
Dr. Stephen Henson
08e8d58785 update for next version 2012-01-04 23:55:26 +00:00
Dr. Stephen Henson
c90c41f09d prepare for release 2012-01-04 17:01:33 +00:00
Dr. Stephen Henson
c47b636a2c update NEWS 2012-01-04 16:57:14 +00:00
Dr. Stephen Henson
7200b39ecd make update 2012-01-04 16:52:53 +00:00
Dr. Stephen Henson
84c95826de Submitted by: Robin Seggelmann <seggelmann@fh-muenster.de>, Michael Tuexen <tuexen@fh-muenster.de>
Reviewed by: steve

Fix for DTLS plaintext recovery attack discovered by Nadhem Alfardan and
Kenny Paterson.
2012-01-04 16:51:14 +00:00
Dr. Stephen Henson
63819e6f00 add missing part for SGC restart fix (CVE-2011-4619) 2012-01-04 16:46:10 +00:00
Dr. Stephen Henson
8206dba75c Clear bytes used for block padding of SSL 3.0 records. (CVE-2011-4576) [include source patch this time!] 2012-01-04 15:38:54 +00:00
Dr. Stephen Henson
528ef87850 Clear bytes used for block padding of SSL 3.0 records. (CVE-2011-4576) 2012-01-04 15:33:15 +00:00
Dr. Stephen Henson
9004c53107 Only allow one SGC handshake restart for SSL/TLS. (CVE-2011-4619) 2012-01-04 15:27:54 +00:00
Dr. Stephen Henson
f47f99f295 stop warning 2012-01-04 15:26:29 +00:00
Dr. Stephen Henson
00f473b3cc Check GOST parameters are not NULL (CVE-2012-0027) 2012-01-04 15:16:20 +00:00
Dr. Stephen Henson
356de7146e Prevent malformed RFC3779 data triggering an assertion failure (CVE-2011-4577) 2012-01-04 15:07:54 +00:00
Dr. Stephen Henson
9eab925395 fix warnings 2012-01-04 14:45:09 +00:00
Dr. Stephen Henson
22d89c501e Submitted by: Adam Langley <agl@chromium.org>
Reviewed by: steve

Fix memory leaks.
2012-01-04 14:24:48 +00:00
Dr. Stephen Henson
c06916db9f PR: 2326
Submitted by: Tianjie Mao <tjmao@tjmao.net>
Reviewed by: steve

Fix incorrect comma expressions and goto f_err as alert has been set.
2011-12-26 19:38:19 +00:00
Dr. Stephen Henson
ef7545a3e6 PR: 2563
Submitted by: Paul Green <Paul.Green@stratus.com>
Reviewed by: steve

Improved PRNG seeding for VOS.
2011-12-19 17:04:39 +00:00
Andy Polyakov
fecb4ff331 x86-mont.pl: fix bug in integer-only squaring path.
PR: 2648
2011-12-09 14:26:56 +00:00
Dr. Stephen Henson
2a4adf19c8 The default CN prompt message can be confusing when often the CN needs to
be the server FQDN: change it.
[Reported by PSW Group]
2011-12-06 00:01:00 +00:00
Bodo Möller
44c854ddb9 Resolve a stack set-up race condition (if the list of compression
methods isn't presorted, it will be sorted on first read).

Submitted by: Adam Langley
2011-12-02 12:51:05 +00:00
Bodo Möller
47091035f1 Fix ecdsatest.c.
Submitted by: Emilia Kasper
2011-12-02 12:41:00 +00:00
Bodo Möller
f3d51d7740 Fix BIO_f_buffer().
Submitted by: Adam Langley
Reviewed by: Bodo Moeller
2011-12-02 12:24:29 +00:00
Andy Polyakov
70d3b4b653 Configure: fix corruption in RC4 implementation in darwin64-x86_64-cc. 2011-11-14 21:21:58 +00:00
Andy Polyakov
2fb94e4861 ppc.pl: fix bug in bn_mul_comba4 [from HEAD].
PR: 2636
Submitted by: Charles Bryant
2011-11-05 10:16:46 +00:00
Richard Levitte
1b84893905 Teach mkshared.com to have a look for disabled algorithms in opensslconf.h 2011-10-30 11:40:59 +00:00
Dr. Stephen Henson
68b5330040 PR: 2628
Submitted by: Robin Seggelmann <seggelmann@fh-muenster.de>
Reviewed by: steve

Send alert instead of assertion failure for incorrectly formatted DTLS
fragments.
2011-10-27 13:06:34 +00:00
Dr. Stephen Henson
da7ae62abd PR: 2628
Submitted by: Robin Seggelmann <seggelmann@fh-muenster.de>
Reviewed by: steve

Fix for ECC keys and DTLS.
2011-10-27 13:01:08 +00:00
Dr. Stephen Henson
f53337b89c PR: 2632
Submitted by: emmanuel.azencot@bull.net
Reviewed by: steve

Return -1 immediately if not affine coordinates as BN_CTX has not been
set up.
2011-10-26 16:43:14 +00:00
Bodo Möller
f70a5895e3 BN_BLINDING multi-threading fix.
Submitted by: Emilia Kasper (Google)
2011-10-19 14:58:34 +00:00
Bodo Möller
d41bbd0db5 use -no_ecdhe when using -no_dhe 2011-10-13 15:05:50 +00:00
Bodo Möller
49956294fc Clarify warning 2011-10-13 13:24:37 +00:00
Bodo Möller
48373e55d1 In ssl3_clear, preserve s3->init_extra along with s3->rbuf.
Submitted by: Bob Buckholz <bbuckholz@google.com>
2011-10-13 13:05:12 +00:00
Dr. Stephen Henson
42369021ed PR: 2482
Submitted by: Rob Austein <sra@hactrn.net>
Reviewed by: steve

Don't allow inverted ranges in RFC3779 code, discovered by Frank Ellermann.
2011-10-09 00:56:32 +00:00
Dr. Stephen Henson
b00fe7ce18 fix signed/unsigned warning 2011-09-26 17:04:49 +00:00
Dr. Stephen Henson
872e3fd502 use keyformat for -x509toreq, don't hard code PEM 2011-09-23 21:48:59 +00:00
Dr. Stephen Henson
c11ada6c99 PR: 2606
Submitted by: Christoph Viethen <cv@kawo2.rwth-aachen.de>
Reviewed by: steve

Handle timezones correctly in UTCTime.
2011-09-23 13:39:45 +00:00
Dr. Stephen Henson
8f0968850b PR: 2602
Submitted by: Robin Seggelmann <seggelmann@fh-muenster.de>
Reviewed by: steve

Fix DTLS bug which prevents manual MTU setting
2011-09-23 13:35:19 +00:00
Dr. Stephen Henson
0b96f60a56 PR: 2347
Submitted by: Tomas Mraz <tmraz@redhat.com>
Reviewed by: steve

Fix usage message.
2011-09-23 13:12:52 +00:00
Dr. Stephen Henson
ab06ff6bee prepare for next version 2011-09-06 13:44:52 +00:00
Dr. Stephen Henson
bba8456e65 update versions and dates for release 2011-09-06 13:01:44 +00:00
Dr. Stephen Henson
b493a05720 update NEWS 2011-09-06 12:56:21 +00:00
Dr. Stephen Henson
c2a8133d1c Initialise X509_STORE_CTX properly so CRLs with nextUpdate date in the past
produce an error (CVE-2011-3207)

Fix TLS ephemeral DH crash bug (CVE-2011-3210)
2011-09-06 12:53:56 +00:00
Bodo Möller
e935440ad7 (EC)DH memory handling fixes.
Submitted by: Adam Langley
2011-09-05 10:25:21 +00:00
Bodo Möller
8eaf563c41 Fix memory leak on bad inputs. 2011-09-05 09:57:03 +00:00
Bodo Möller
80d7e6b039 "make update" 2011-09-05 09:54:59 +00:00
Dr. Stephen Henson
9c44e33230 Don't use *from++ in tolower as this is implemented as a macro on some
platforms. Thanks to Shayne Murray <Shayne.Murray@Polycom.com> for
reporting this issue.
2011-09-02 11:28:05 +00:00
Dr. Stephen Henson
b86f3197b7 PR: 2576
Submitted by: Doug Goldstein <cardoe@gentoo.org>
Reviewed by: steve

Include header file stdlib.h which is needed on some platforms to get
getenv() declaration.
2011-09-02 11:20:41 +00:00
Dr. Stephen Henson
0875c00584 update NEWS 2011-09-01 17:08:44 +00:00
Dr. Stephen Henson
dd3a770e07 Add error checking to PKCS1_MGF1. From HEAD. 2011-09-01 15:42:38 +00:00
Dr. Stephen Henson
64763ce09b PR: 2340
Submitted by: "Mauro H. Leggieri" <mxmauro@caiman.com.ar>
Reviewed by: steve

Stop warnings if OPENSSL_NO_DGRAM is defined.
2011-09-01 15:02:53 +00:00
Dr. Stephen Henson
2fffc29bd1 make timing attack protection unconditional 2011-09-01 14:23:31 +00:00
Dr. Stephen Henson
d2650c3a4a PR: 2573
Submitted by: Robin Seggelmann <seggelmann@fh-muenster.de>
Reviewed by: steve

Fix DTLS buffering and decryption bug.
2011-09-01 14:02:02 +00:00
Dr. Stephen Henson
b5bd966ea4 PR: 2589
Submitted by: Thomas Jarosch <thomas.jarosch@intra2net.com>
Reviewed by: steve

Initialise p pointer.
2011-09-01 13:52:27 +00:00
Dr. Stephen Henson
e71f7786e3 PR: 2588
Submitted by: Thomas Jarosch <thomas.jarosch@intra2net.com>
Reviewed by: steve

Close file pointer.
2011-09-01 13:48:57 +00:00
Dr. Stephen Henson
e3b95e6b24 PR: 2586
Submitted by: Thomas Jarosch <thomas.jarosch@intra2net.com>
Reviewed by: steve

Zero structure fields properly.
2011-09-01 13:45:25 +00:00
Dr. Stephen Henson
658eeec7cd PR: 2586
Submitted by: Thomas Jarosch <thomas.jarosch@intra2net.com>
Reviewed by: steve

Fix brace mismatch.
2011-09-01 13:37:20 +00:00
Dr. Stephen Henson
e1c3d65f08 Remove hard coded ecdsaWithSHA1 hack in ssl routines and check for RSA
using OBJ xref utilities instead of string comparison with OID name.

This removes the arbitrary restriction on using SHA1 only with some ECC
ciphersuites.
2011-08-14 13:48:42 +00:00
Andy Polyakov
2e4abe2ce2 Alpha assembler fixes from HEAD.
PR: 2577
2011-08-12 12:32:10 +00:00
Dr. Stephen Henson
ea294bb50e PR: 2559
Submitted by: Robin Seggelmann <seggelmann@fh-muenster.de>
Reviewed by: steve

Fix DTLS socket error bug
2011-07-20 15:21:52 +00:00
Dr. Stephen Henson
b58ea0b941 PR: 2555
Submitted by: Robin Seggelmann <seggelmann@fh-muenster.de>
Reviewed by: steve

Fix DTLS sequence number bug
2011-07-20 15:17:33 +00:00
Dr. Stephen Henson
16067fe5fd PR: 2550
Submitted by: Robin Seggelmann <seggelmann@fh-muenster.de>
Reviewed by: steve

Fix DTLS HelloVerifyRequest Timer bug
2011-07-20 15:13:16 +00:00
Andy Polyakov
f2e9070f26 config: detect if assembler supports --noexecstack and pass it down [from HEAD]. 2011-07-15 19:59:18 +00:00
Dr. Stephen Henson
fe8629e1a5 PR: 2556 (partial)
Reported by: Daniel Marschall <daniel-marschall@viathinksoft.de>
Reviewed by: steve

Fix OID routines.

Check on encoding leading zero rejection should start at beginning of
encoding.

Allow for initial digit when testing when to use BIGNUMs which can increase
first value by 2 * 40.
2011-07-14 12:01:25 +00:00
Andy Polyakov
2a12eff4b2 ms/uplink.c: fix Visual Studio 2010 warning [from HEAD]. 2011-07-13 14:55:11 +00:00
Andy Polyakov
b680fef061 perlasm/cbc.pl: fix tail processing bug [from HEAD].
PR: 2557
2011-07-13 06:23:25 +00:00
Bodo Möller
7f7414e054 Fix typo.
Submitted by: Jim Morrison
2011-07-11 12:13:50 +00:00
Dr. Stephen Henson
8b9db484ed PR: 2470
Submitted by: Corinna Vinschen <vinschen@redhat.com>
Reviewed by: steve

Don't call ERR_remove_state from DllMain.
2011-06-22 15:39:00 +00:00
Dr. Stephen Henson
f59f2fcbff PR: 2543
Submitted by: Robin Seggelmann <seggelmann@fh-muenster.de>
Reviewed by: steve

Correctly handle errors in DTLSv1_handle_timeout()
2011-06-22 15:29:55 +00:00
Dr. Stephen Henson
419a530194 PR: 2540
Submitted by: emmanuel.azencot@bull.net
Reviewed by: steve

Prevent infinite loop in BN_GF2m_mod_inv().
2011-06-22 15:23:32 +00:00
Dr. Stephen Henson
69a8901eb1 correctly encode OIDs near 2^32 2011-06-22 15:15:38 +00:00
Dr. Stephen Henson
2bcd08e691 make EVP_dss() work for DSA signing 2011-06-20 20:05:38 +00:00
Bodo Möller
167d692925 Complete the version history (include information on unreleased
version 0.9.8s to show full information).
2011-06-15 14:21:17 +00:00
Dr. Stephen Henson
025ee1dbde fix memory leak 2011-06-08 15:56:20 +00:00
Dr. Stephen Henson
dce7b92d0b PR: 2533
Submitted by: Robin Seggelmann <seggelmann@fh-muenster.de>
Reviewed by: steve

Setting SSL_MODE_RELEASE_BUFFERS should be ignored for DTLS, but instead causes
the program to crash. This is due to missing version checks and is fixed with
this patch.
2011-05-25 15:21:12 +00:00
Dr. Stephen Henson
db886c2a2b PR: 2529
Submitted by: Marcus Meissner <meissner@suse.de>
Reviewed by: steve

Call ssl_new() to reallocate SSL BIO internals if we want to replace
the existing internal SSL structure.
2011-05-25 15:15:52 +00:00
Dr. Stephen Henson
4d43129446 PR: 2527
Submitted by: Marcus Meissner <meissner@suse.de>
Reviewed by: steve

Set cnf to NULL to avoid possible double free.
2011-05-25 15:06:05 +00:00
Dr. Stephen Henson
92107f8150 Fix the ECDSA timing attack mentioned in the paper at:
http://eprint.iacr.org/2011/232.pdf

Thanks to the original authors Billy Bob Brumley and Nicola Tuveri for
bringing this to our attention.
2011-05-25 14:52:44 +00:00
Dr. Stephen Henson
e82d6a2019 Fix the ECDSA timing attack mentioned in the paper at:
http://eprint.iacr.org/2011/232.pdf

Thanks to the original authors Billy Bob Brumley and Nicola Tuveri for
bringing this to our attention.
2011-05-25 14:43:05 +00:00
Dr. Stephen Henson
4e5755cd85 Oops use up to date patch for PR#2506 2011-05-25 14:29:55 +00:00
Dr. Stephen Henson
dda8dcd2c0 PR: 2512
Submitted by: Robin Seggelmann <seggelmann@fh-muenster.de>
Reviewed by: steve

Fix BIO_accept so it can be bound to IPv4 or IPv6 sockets consistently.
2011-05-25 12:36:50 +00:00
Dr. Stephen Henson
16646b0018 PR: 2506
Submitted by: Robin Seggelmann <seggelmann@fh-muenster.de>
Reviewed by: steve

Fully implement SSL_clear for DTLS.
2011-05-25 12:28:31 +00:00
Dr. Stephen Henson
320881c25c PR: 2505
Submitted by: Robin Seggelmann <seggelmann@fh-muenster.de>
Reviewed by: steve

Fix DTLS session resumption timer bug.
2011-05-25 12:24:26 +00:00
Dr. Stephen Henson
1d23fb382e update date 2011-05-19 17:56:47 +00:00
Dr. Stephen Henson
c4f1942a76 inherit HMAC flags from MD_CTX 2011-05-19 17:39:49 +00:00
Dr. Stephen Henson
38c42c6eea set encodedPoint to NULL after freeing it 2011-05-19 16:18:25 +00:00
Dr. Stephen Henson
51eb247d0f no need to include memory.h 2011-04-30 23:38:24 +00:00
Dr. Stephen Henson
8d22673a62 check buffer is larger enough before overwriting 2011-04-06 18:07:02 +00:00
Dr. Stephen Henson
3622d3743e PR: 2462
Submitted by: Robin Seggelmann <seggelmann@fh-muenster.de>
Reviewed by: steve

Fix DTLS Retransmission Buffer Bug
2011-04-03 17:15:08 +00:00
Dr. Stephen Henson
fbbf28e7c2 PR: 2458
Submitted by: Robin Seggelmann <seggelmann@fh-muenster.de>
Reviewed by: steve

Don't change state when answering DTLS ClientHello.
2011-04-03 16:26:14 +00:00
Dr. Stephen Henson
f5dac77c06 PR: 2457
Submitted by: Robin Seggelmann <seggelmann@fh-muenster.de>
Reviewed by: steve

Fix DTLS fragment reassembly bug.
2011-04-03 15:49:03 +00:00
Richard Levitte
067d72a082 Corrections to the VMS build system.
Submitted by Steven M. Schweda <sms@antinode.info>
2011-03-25 16:21:39 +00:00
Dr. Stephen Henson
ac0f3f506a make some non-VMS builds work again 2011-03-25 15:06:50 +00:00
Richard Levitte
f819147028 For VMS, implement the possibility to choose 64-bit pointers with
different options:
"64"		The build system will choose /POINTER_SIZE=64=ARGV if
		the compiler supports it, otherwise /POINTER_SIZE=64.
"64="		The build system will force /POINTER_SIZE=64.
"64=ARGV"	The build system will force /POINTER_SIZE=64=ARGV.
2011-03-25 09:40:18 +00:00
Richard Levitte
a530963f05 make update (1.0.0-stable) 2011-03-22 23:56:18 +00:00
Richard Levitte
bc5a53f5e9 * util/mkdef.pl: Add crypto/o_str.h and crypto/o_time.h. Maybe some
more need to be added...
2011-03-22 23:54:13 +00:00
Richard Levitte
83382fb9d5 * apps/makeapps.com: Forgot to end the check for /POINTER_SIZE=64=ARGV
with turning trapping back on.
* test/maketests.com: Do the same check for /POINTER_SIZE=64=ARGV
  here.
* test/clean-test.com: A new script for cleaning up.
2011-03-20 14:01:20 +00:00
Richard Levitte
0674370017 * apps/openssl.c: For VMS, take care of copying argv if needed much earlier,
directly in main().  'if needed' also includes when argv is a 32 bit
  pointer in an otherwise 64 bit environment.
* apps/makeapps.com: When using /POINTER_SIZE=64, try to use the additional
  =ARGV, but only if it's supported.  Fortunately, DCL is very helpful
  telling us in this case.
2011-03-20 13:15:41 +00:00
Richard Levitte
2f91cb2c5e Keep file references in the VMS build files in the same order as they
are in the Unix Makefiles
2011-03-19 10:44:41 +00:00
Richard Levitte
acb25c2327 Change INSTALL.VMS to reflect the changes done on the build and
install scripts.  This could need some more work.
2011-03-19 09:45:45 +00:00
Richard Levitte
2d842a90f8 Apply all the changes submitted by Steven M. Schweda <sms@antinode.info> 2011-03-19 09:44:53 +00:00
Dr. Stephen Henson
80705bfc50 PR: 2469
Submitted by: Jim Studt <jim@studt.net>
Reviewed by: steve

Check mac is present before trying to retrieve mac iteration count.
2011-03-13 18:20:14 +00:00
Dr. Stephen Henson
2a8692311d make no-dsa work again 2011-03-10 18:27:56 +00:00
Andy Polyakov
7d0ed89d57 s390x-mont.pl: optimize for z196. 2011-03-04 13:11:54 +00:00
Andy Polyakov
0912fae6ce dso_dlfcn.c: make it work on Tru64 4.0 [from HEAD].
PR: 2316
2011-02-12 16:46:10 +00:00
Bodo Möller
0bb2154ee9 Sync with 0.9.8 branch. 2011-02-08 19:06:57 +00:00
Bodo Möller
c9355e20c3 start 1.0.0e-dev 2011-02-08 17:58:45 +00:00
Bodo Möller
6545372c24 OCSP stapling fix (OpenSSL 0.9.8r/1.0.0d)
Submitted by: Neel Mehta, Adam Langley, Bodo Moeller
2011-02-08 17:10:53 +00:00
Bodo Möller
17f8412983 Add complete information on 0.9.8 branch. 2011-02-08 08:42:15 +00:00
Bodo Möller
d48df9a91b Assorted bugfixes:
- safestack macro changes for C++ were incomplete
- RLE decompression boundary case
- SSL 2.0 key arg length check

Submitted by: Google (Adam Langley, Neel Mehta, Bodo Moeller)
2011-02-03 12:04:40 +00:00
Bodo Möller
65448fd0d3 fix omission 2011-02-03 11:21:20 +00:00
Dr. Stephen Henson
a677c87b7b Since FIPS 186-3 specifies we use the leftmost bits of the digest
we shouldn't reject digest lengths larger than SHA256: the FIPS
algorithm tests include SHA384 and SHA512 tests.
2011-02-01 12:54:04 +00:00
Dr. Stephen Henson
f8a123b4a2 stop warnings about no previous prototype when compiling shared engines 2011-01-30 01:05:38 +00:00
Dr. Stephen Henson
c64beae686 PR: 2433
Submitted by: Chris Wilson <chris@qwirx.com>
Reviewed by: steve

Constify ASN1_STRING_set_default_mask_asc().
2011-01-24 16:20:15 +00:00
Dr. Stephen Henson
99ef8323e4 check EC public key isn't point at infinity 2011-01-24 15:08:01 +00:00
Dr. Stephen Henson
2668c58969 PR: 1612
Submitted by: Robert Jackson <robert@rjsweb.net>
Reviewed by: steve

Fix EC_POINT_cmp function for case where b but not a is the point at infinity.
2011-01-24 14:41:58 +00:00
Dr. Stephen Henson
5ae3168a77 stop warning with no-engine 2011-01-13 15:42:59 +00:00
Richard Levitte
559579659c The previous change was incorrect in this branch... 2011-01-10 21:00:25 +00:00
Richard Levitte
2dd74160cc PR: 2425
Synchronise VMS build with Unixly build.
2011-01-10 20:55:24 +00:00
Richard Levitte
2adf63272c PR: 2407
Fix fault include.
Submitted by Arpadffy Zoltan <Zoltan.Arpadffy@scientificgames.se>
2011-01-06 20:56:07 +00:00
Dr. Stephen Henson
fb5a0fb8f1 Since DTLS 1.0 is based on TLS 1.1 we should never return a decryption_failed
alert.
2011-01-04 19:33:22 +00:00
Dr. Stephen Henson
c222de16ce oops missed an assert 2011-01-03 12:53:33 +00:00
Dr. Stephen Henson
19091ac236 PR: 2411
Submitted by: Rob Austein <sra@hactrn.net>
Reviewed by: steve

Fix corner cases in RFC3779 code.
2011-01-03 01:40:34 +00:00
Dr. Stephen Henson
2fcf251d3d Fix escaping code for string printing. If *any* escaping is enabled we
must escape the escape character itself (backslash).
2011-01-03 01:27:00 +00:00
Dr. Stephen Henson
dab5848cd9 PR: 2410
Submitted by: Rob Austein <sra@hactrn.net>
Reviewed by: steve

Use OPENSSL_assert() instead of assert().
2011-01-03 01:22:09 +00:00
Dr. Stephen Henson
a02f0f3d69 PR: 2413
Submitted by: Michael Bergandi <mbergandi@gmail.com>
Reviewed by: steve

Fix typo in crypto/bio/bss_dgram.c
2011-01-03 01:07:03 +00:00
Dr. Stephen Henson
e69d49364e use fips-dev not dev-fips 2011-01-03 00:44:14 +00:00
Dr. Stephen Henson
38921f0abf PR: 2416
Submitted by: Mark Phalan <mark.phalan@oracle.com>
Reviewed by: steve

Use L suffix in version number.
2011-01-03 00:26:05 +00:00
Richard Levitte
d76ce84c92 Part of the IF structure didn't get pasted here...
PR: 2393
2010-12-14 21:44:36 +00:00
Richard Levitte
c3c7a0d26e First attempt at adding the possibility to set the pointer size for the builds on VMS.
PR: 2393
2010-12-14 19:18:52 +00:00
Andy Polyakov
d06bc800f2 bss_file.c: refine UTF8 logic [from HEAD].
PR: 2382
2010-12-11 14:53:58 +00:00
Dr. Stephen Henson
a01dc637bd ignore leading null fields 2010-12-03 19:31:06 +00:00
Dr. Stephen Henson
3bbbe757ea update for next release 2010-12-02 19:37:46 +00:00
Dr. Stephen Henson
76474e519f prepare for release 2010-12-02 18:29:04 +00:00
Dr. Stephen Henson
420f572d49 make update 2010-12-02 18:26:12 +00:00
Dr. Stephen Henson
6d65d44b95 fix for CVE-2010-4180 2010-12-02 18:24:55 +00:00
Dr. Stephen Henson
91e1ff77a0 PR: 2386
Submitted by: Stefan Birrer <stefan.birrer@adnovum.ch>
Reviewed by: steve

Correct SKM_ASN1_SET_OF_d2i macro.
2010-12-02 17:59:36 +00:00
Dr. Stephen Henson
c8e60ec8fa fix doc typos 2010-12-02 13:45:15 +00:00
Dr. Stephen Henson
e840570207 use consistent FAQ between version 2010-12-02 00:10:27 +00:00
Andy Polyakov
077527f19e Configure: make -mno-cygwin optional on mingw platforms [from HEAD].
PR: 2381
2010-11-30 22:19:26 +00:00
Dr. Stephen Henson
00daa2e6c6 PR: 2385
Submitted by: Stefan Birrer <stefan.birrer@adnovum.ch>
Reviewed by: steve

Zero key->pkey.ptr after it is freed so the structure can be reused.
2010-11-30 19:37:33 +00:00
Dr. Stephen Henson
000f221d60 update NEWS 2010-11-30 13:42:15 +00:00
Richard Levitte
579a605494 Better method for creating SSLROOT:.
Make sure to include the path to evptest.txt.
2010-11-29 22:27:21 +00:00
Dr. Stephen Henson
fa29ebd7ed add CVE to J-PAKE issue 2010-11-29 18:21:43 +00:00
Dr. Stephen Henson
3360999046 update NEWS 2010-11-29 16:53:54 +00:00
Dr. Stephen Henson
0b965e59cb Some of the MS_STATIC use in crypto/evp is a legacy from the days when
EVP_MD_CTX was much larger: it isn't needed anymore.
2010-11-27 17:34:57 +00:00
Dr. Stephen Henson
1684846f54 PR: 2240
Submitted by: Jack Lloyd <lloyd@randombit.net>, "Mounir IDRASSI" <mounir.idrassi@idrix.net>, steve
Reviewed by: steve

As required by RFC4492 an absent supported points format by a server is
not an error: it should be treated as equivalent to an extension only
containing uncompressed.
2010-11-25 12:28:28 +00:00
Ben Laurie
dde6d9520c Document change. 2010-11-24 15:07:56 +00:00
Ben Laurie
f9a772b743 J-PAKE was not correctly checking values, which could lead to attacks. 2010-11-24 13:48:12 +00:00
Andy Polyakov
0d6f7dbb50 INSTALL.W32: document trouble with symlinks under MSYS [from HEAD].
PR: 2377
2010-11-23 23:01:01 +00:00
Richard Levitte
994a1ea900 Implement bc test strategy as submitted by Steven M. Schweda <sms@antinode.info>.
Make sure we move to '__here' before trying to use it to build local sslroot:
2010-11-23 02:12:11 +00:00
Richard Levitte
e5d1fd38d1 Print openssl version information at the end of the tests 2010-11-23 01:06:10 +00:00
Richard Levitte
a330ed26be Give the architecture dependent directory higher priority 2010-11-23 01:05:29 +00:00
Richard Levitte
ca0a86c89d Don't define an empty CFLAGS, it's much more honest not to defined it at all.
Make sure to remove any [.CRYTO]BUILDINF.H so it doesn't get used instead of
[.CRYPTO._''ARCH'BUILDINF.H
2010-11-23 01:04:04 +00:00
Richard Levitte
1cf7bbce48 * tests.com: Add the symbol openssl_conf, so the openssl application
stops complaining about a missing configuration file.  Define the logical
  name PERL_ENV_TABLES with values to Perl considers the DCL symbol table
  as part of the environment (see 'man perlvms' for details), so cms-test.pl
  can get the value of EXE_DIR from tests.com, among others.
* cms-test.pl: Make changes to have it work on VMS as well.  Upper or mixed
  case options need to be quoted and the openssl command needs a VMS-specific
  treatment.  It all should work properly on Unix, I hope it does on Windows
  as well...
2010-11-22 23:42:51 +00:00
Andy Polyakov
4cdde22432 s390x.S: fix typo in bn_mul_words [from HEAD].
PR: 2380
2010-11-22 21:57:07 +00:00
Dr. Stephen Henson
a28cee6efe PR: 2376
Submitted by: Guenter <lists@gknw.net>
Reviewed by: steve

Cleanup alloca use, fix Win32 target for OpenWatcom.
2010-11-19 00:11:27 +00:00
Dr. Stephen Henson
1977bafba4 PR: 2375
Submitted by: Guenter <lists@gknw.net>
Reviewed by: steve

cleanup/fix e_aep.c for OpenWatcom
2010-11-18 22:59:42 +00:00
Dr. Stephen Henson
3c96907f2b PR: 2374
Submitted by: Guenter <lists@gknw.net>
Reviewed by: steve

Don't compile capi ENGINE on mingw32
2010-11-18 22:56:42 +00:00
Richard Levitte
2d96a30dc7 Tell the user what test is being performed. 2010-11-18 22:47:01 +00:00
Richard Levitte
c09d1df7d3 Make sure the source directory for ASN1TEST is defined. 2010-11-18 22:45:38 +00:00
Richard Levitte
c20dd45477 We expect these scripts not to bail on error, so make sure that's what happens. 2010-11-18 22:30:55 +00:00
Richard Levitte
abb320463d Synchronise with Unix tests 2010-11-18 22:24:09 +00:00
Richard Levitte
ada3f8b5d3 We redid the structure on architecture dependent source files, but
apparently forgot to adapt the copying to the installation directory.
2010-11-18 19:59:06 +00:00
Dr. Stephen Henson
6172561597 add ACKNOWLEDGEMENTS file to 1.0.0 branch 2010-11-18 17:26:19 +00:00
Dr. Stephen Henson
368b64d6dd compile cts128.c on VMS 2010-11-18 17:04:46 +00:00
Dr. Stephen Henson
4ed0ca2b3e fix no SIGALRM case in speed.c 2010-11-18 13:22:26 +00:00
Dr. Stephen Henson
a92f98c630 PR: 2372
Submitted by: "W.C.A. Wijngaards" <wouter@nlnetlabs.nl>
Reviewed by: steve

Fix OpenBSD compilation failure.
2010-11-18 12:28:57 +00:00
Dr. Stephen Henson
4385b556b4 Don't assume a decode error if session tlsext_ecpointformatlist is not NULL:
it can be legitimately set elsewhere.
2010-11-16 22:41:07 +00:00
Dr. Stephen Henson
5e7c9519b8 update for next version 2010-11-16 16:33:35 +00:00
Dr. Stephen Henson
ef02492908 prepare for release 2010-11-16 13:35:09 +00:00
Dr. Stephen Henson
86d5f9ba4f fix CVE-2010-3864 2010-11-16 13:26:24 +00:00
Dr. Stephen Henson
febcec6254 If EVP_PKEY structure contains an ENGINE the key is ENGINE specific and
we should use its method instead of any generic one.
2010-11-16 12:11:15 +00:00
Dr. Stephen Henson
f07cb1ce8e make update 2010-11-15 14:44:50 +00:00
Dr. Stephen Henson
b3c17a4805 Get correct GOST private key instead of just assuming the last one is
correct: this isn't always true if we have more than one certificate.
2010-11-14 13:50:29 +00:00
Dr. Stephen Henson
7b83fe34c0 update NEWS file 2010-11-11 15:30:33 +00:00
Dr. Stephen Henson
e0b1c57ae0 Submitted By: Bogdan Harjoc <harjoc@gmail.com>
Add missing debug WIN64 targets.
2010-11-11 15:23:19 +00:00
Dr. Stephen Henson
6806b06d21 PR: 2366
Submitted by: Damien Miller <djm@mindrot.org>
Reviewed by: steve

Stop pkeyutl crashing if some arguments are missing. Also make str2fmt
tolerate NULL parameter.
2010-11-11 14:42:19 +00:00
Dr. Stephen Henson
0af0e9d747 Submitted by: Jonathan Dixon <joth@chromium.org>
Reviewed by: steve

If store is NULL set flags correctly.
2010-11-02 15:57:40 +00:00
Dr. Stephen Henson
2191b3ba44 PR: 2295
Submitted by: Alexei Khlebnikov <alexei.khlebnikov@opera.com>
Reviewed by: steve

OOM checking. Leak in OOM fix. Fall-through comment. Duplicate code
elimination.
2010-10-11 23:24:51 +00:00
Andy Polyakov
73020a945b x86_64-xlate.pl: fix LNK4078 and LNK4210 link warnings [from HEAD].
PR: 2356
2010-10-10 21:14:17 +00:00
Dr. Stephen Henson
9c2d0cd11c PR: 2314
Submitted by: Mounir IDRASSI <mounir.idrassi@idrix.net>
Reviewed by: steve

Fix for double free bug in ssl/s3_clnt.c CVE-2010-2939
2010-10-10 12:33:10 +00:00
Dr. Stephen Henson
0ef9b9c7bf We can't always read 6 bytes in an OCSP response: fix so error statuses
are read correctly for non-blocking I/O.
2010-10-06 18:01:23 +00:00
Dr. Stephen Henson
c14c6e996d Minor documentation fixes, PR#2345 2010-10-04 13:28:35 +00:00
Dr. Stephen Henson
51381cd4ed Minor documentation fixes, PR#2344 2010-10-04 13:24:15 +00:00
Dr. Stephen Henson
8c9ab050e5 Add call to ENGINE_register_all_complete() to ENGINE_load_builtin_engines(),
this means that some implementations will be used automatically, e.g. aesni,
we do this for cryptodev anyway.

Setup cpuid in ENGINE_load_builtin_engines() too as some ENGINEs use it.
2010-10-03 18:57:01 +00:00
Andy Polyakov
b6996c7849 Alpha assembler pack: adapt for Linux [from HEAD].
PR: 2335
2010-09-13 20:32:31 +00:00
Andy Polyakov
2c23b0716e VC-32.pl: default to nasm if neither nasm or nasmw is is found at the moment [from HEAD].
PR: 2338
2010-09-13 16:28:34 +00:00
Andy Polyakov
f548a0e4d5 crypto/bn/asm/s390x.S: drop redundant instructions [from HEAD]. 2010-09-10 14:55:24 +00:00
Andy Polyakov
a404f63f92 sparcv9cap.c: disengange Solaris-specific CPU detection routine in favour
of unified procedure relying on SIGILL [from HEAD].
PR: 2321
2010-09-05 19:48:01 +00:00
Ben Laurie
b54f50d277 Oops. Make depend on a standard configuration. 2010-09-05 13:47:44 +00:00
Ben Laurie
10ba241909 Make depend. 2010-09-05 13:07:40 +00:00
Dr. Stephen Henson
1f238b1c4a make no-gost work on Windows 2010-09-02 17:23:36 +00:00
Dr. Stephen Henson
ef85bf8c2b fix bug in AES_unwrap() 2010-08-30 23:59:04 +00:00
Bodo Möller
cbfccdb729 ECC library bugfixes.
Submitted by: Emilia Kasper (Google)
2010-08-26 12:10:44 +00:00
Bodo Möller
94111aa401 Harmonize with OpenSSL_0_9_8-stable version of CHANGES. 2010-08-26 11:19:45 +00:00
Andy Polyakov
eec48070a1 util/cygwin.sh: maintainer's update [from HEAD].
Submitted by: Corinna Vinschen
2010-08-24 21:52:00 +00:00
Andy Polyakov
eebe668174 engine/Makefile: harmonize engine install rule for .dylib extension on MacOS X [from HEAD].
PR: 2319
2010-08-24 21:46:34 +00:00
Andy Polyakov
8a15a4a7b4 Makefile.shared: fix brown-bag typo in link_o.darwin [from HEAD].
PR: 2319
2010-08-21 11:36:49 +00:00
Andy Polyakov
19057003f1 sha1-armv4-large.pl: reschedule instructions for dual-issue pipeline [from HEAD]. 2010-08-03 15:36:31 +00:00
Andy Polyakov
031648d4ce Make inline assembler clang-friendly [from HEAD]. 2010-08-02 21:54:23 +00:00
Andy Polyakov
02bee340a2 alphacpuid.pl: fix brown-bag bug [from HEAD]. 2010-07-28 08:18:17 +00:00
Andy Polyakov
f6f2f68a05 Replace alphacpuid.s with alphacpuid.pl to ensure it makes to release tar-balls [from HEAD].
PR: 2309
2010-07-26 22:09:59 +00:00
Dr. Stephen Henson
982d68a0c0 Add modes.h to mkdef.pl, update ordinals. 2010-07-25 16:56:06 +00:00
Dr. Stephen Henson
7585a86a76 Fix WIN32 build system to correctly link ENGINE DLLs contained in a
directory: currently the GOST ENGINE is the only case.
2010-07-24 17:57:07 +00:00
Andy Polyakov
73190f1b46 Configure: suppress $multilib with non-system $prefix [from HEAD].
PR: 2307
2010-07-16 08:14:00 +00:00
Andy Polyakov
6673ac592a Makefile.shared: update link_o.darwin rule [from HEAD].
PR: 2306
2010-07-16 08:11:32 +00:00
Andy Polyakov
59aa655b53 ARM assembler pack: reschedule instructions for dual-issue pipeline [from HEAD].
Modest improvement coefficients mean that code already had some
parallelism and there was not very much room for improvement. Special
thanks to Ted Krovetz for benchmarking the code with such patience.
2010-07-13 14:08:03 +00:00
Dr. Stephen Henson
c4c99b4961 PR: 2297
Submitted by: Antony, Benoy <bantony@ebay.com>
Approved by: steve@openssl.org

Fix bug in AES wrap code when t > 0xff.
2010-07-09 17:25:27 +00:00
Andy Polyakov
ccbbcddd5f INSTALL.W32: mention _OPENSSL_isservice() [from HEAD].
PR: 2194
2010-07-09 14:31:41 +00:00
Andy Polyakov
65d82478d8 rand_nw.c: compensate for gcc bug (using %edx instead of %eax at -O3)
[from HEAD].
PR: 2296
2010-07-08 09:15:33 +00:00
Andy Polyakov
02a6518a02 PROBLEMS: MacOS X is not necessarily a problem anymore [from HEAD]. 2010-07-08 09:01:56 +00:00
Andy Polyakov
a79053511b sparcv9cap.c: reiterate CPU detection logic [from HEAD]. 2010-07-08 07:48:42 +00:00
Dr. Stephen Henson
eb56eb2279 i variable is used on some platforms 2010-07-05 11:03:22 +00:00
Andy Polyakov
d40f6d4a02 crypto/sparc*: elininate _sparcv9_rdwrasi [from HEAD]. 2010-07-02 08:08:20 +00:00
Andy Polyakov
943ae0951a SPARCv9 assembler pack: refine CPU detection on Linux, fix for "unaligned
opcodes detected in executable segment" error [from HEAD].
2010-07-01 07:57:20 +00:00
Dr. Stephen Henson
999eeaba14 oops, fix date string 2010-06-16 13:46:59 +00:00
Dr. Stephen Henson
dfa81d9efb update README, fix opensslv.h 2010-06-16 13:37:22 +00:00
Dr. Stephen Henson
1dba06e7b0 update for next version 2010-06-16 13:34:33 +00:00
Dr. Stephen Henson
daac87be95 clarify comment 2010-06-16 13:17:22 +00:00
Dr. Stephen Henson
e97359435e Fix warnings (From HEAD, original patch by Ben). 2010-06-15 17:25:15 +00:00
Andy Polyakov
afce9bcca1 VC-32.pl: fix /Fd name generation [from HEAD].
PR: 2284
2010-06-09 15:49:09 +00:00
Dr. Stephen Henson
9c7baca820 prepare for release 2010-06-01 13:31:38 +00:00
Dr. Stephen Henson
618265e645 Fix CVE-2010-1633 and CVE-2010-0742. 2010-06-01 13:17:06 +00:00
Andy Polyakov
9728978b75 VC-32.pl: unconditionally generate symbols.pdb [from HEAD]. 2010-06-01 06:03:20 +00:00
Andy Polyakov
938c0bbae1 x86_64-xlate.pl: updates from HEAD. 2010-06-01 05:57:26 +00:00
Andy Polyakov
a0cd818831 Configure: update mingw config-lines [from HEAD]. 2010-06-01 05:53:35 +00:00
Dr. Stephen Henson
31c4ab5401 fix PR#2261 in a different way 2010-05-31 13:18:08 +00:00
Dr. Stephen Henson
1f65529824 PR: 2278
Submitted By: Mattias Ellert <mattias.ellert@fysast.uu.se>

Fix type checking macro SKM_ASN1_SET_OF_i2d
2010-05-29 12:49:48 +00:00
Dr. Stephen Henson
5b3a6eedd1 update NEWS 2010-05-27 15:05:01 +00:00
Dr. Stephen Henson
6938440d68 PR: 2262
Submitted By: Victor Wagner <vitus@cryptocom.ru>

Fix error reporting in load_key function.
2010-05-27 14:09:13 +00:00
Dr. Stephen Henson
57ec6c9bad PR: 2261
Submitted By: De Rudder, Stephen L." <s_derudder@tditx.com>

Workaround for newer Windows headers which define EADDRINUSE but not to the
same value as WSAEADDRINUSE.
2010-05-27 13:07:45 +00:00
Dr. Stephen Henson
7a09bc4068 PR: 2258
Submitted By: Ger Hobbelt <ger@hobbelt.com>

Base64 BIO fixes:

Use OPENSSL_assert() instead of assert().
Use memmove() as buffers overlap.
Fix write retry logic.
2010-05-27 12:41:20 +00:00
Dr. Stephen Henson
deb15645a8 PR: 2266
Submitted By: Jonathan Gray <jsg@goblin.cx>

Correct ioctl definitions.
2010-05-26 23:23:44 +00:00
Dr. Stephen Henson
f0b358e8b9 Avoid use of ex_data free function in Chil ENGINE so it can be safely
reloaded.
2010-05-26 16:17:06 +00:00
Dr. Stephen Henson
dce2b5a8fc PR: 2254
Submitted by: Ger Hobbelt <ger@hobbelt.com>
Approved by: steve@openssl.org

Check for <= 0 i2d return value.
2010-05-22 00:40:58 +00:00
Dr. Stephen Henson
59d100d959 PR: 2251
Submitted by: Ger Hobbelt <ger@hobbelt.com>
Approved by: steve@openssl.org

Memleak, BIO chain leak and realloc checks in v3_pci.c
2010-05-22 00:31:02 +00:00
Dr. Stephen Henson
d497b5362b oops, typo 2010-05-20 17:35:37 +00:00
Dr. Stephen Henson
369b0abdc2 Update cms-test.pl to handle some Unix like Windows environments where
calling shlib_wrap.sh doesn't work.
2010-05-20 17:28:51 +00:00
Dr. Stephen Henson
72240ab31a PR: 2259
Submitted By: Artem Chuprina <ran@cryptocom.ru>

Check return values of HMAC in tls_P_hash and tls1_generate_key_block.

Although the previous version could in theory crash that would only happen if a
digest call failed. The standard software methods can never fail and only one
ENGINE currently uses digests and it is not compiled in by default.
2010-05-17 11:26:56 +00:00
Dr. Stephen Henson
dc4e1ddc9f PR: 2253
Submitted By: Ger Hobbelt <ger@hobbelt.com>

Check callback return value when outputting errors.
2010-05-15 00:36:12 +00:00
Dr. Stephen Henson
ff656346fa PR: 2255
Submitted By: Ger Hobbelt <ger@hobbelt.com>

Place RSA dependent variable under #ifndef OPENSSL_NO_RSA
2010-05-15 00:19:57 +00:00
Dr. Stephen Henson
ca91057d50 PR: 2252
Submitted By: Ger Hobbelt <ger@hobbelt.com>

Update docs to BIO_f_buffer()
2010-05-03 15:29:51 +00:00
Dr. Stephen Henson
8c1e7de6cb PR: 2230
Submitted By: Robin Seggelmann <seggelmann@fh-muenster.de>

Fix bug in bitmask macros and stop warnings.
2010-05-03 13:01:50 +00:00
Dr. Stephen Henson
207886cd3a PR: 2244
Submitted By: "PMHager" <hager@dortmund.net>

Initialise pkey callback to 0.
2010-05-03 12:50:52 +00:00
Andy Polyakov
336d1ee733 bss_file.c: reserve for option to encode file name in UTF-8 on Windows
[from HEAD].
2010-04-28 20:04:37 +00:00
Andy Polyakov
bed2b769f5 md5-ia64.S: fix assembler warning [from HEAD]. 2010-04-20 20:41:23 +00:00
Dr. Stephen Henson
26029d9c4c PR: 2241
Submitted By: Artemy Lebedev <vagran.ast@gmail.com>

Typo.
2010-04-20 12:53:05 +00:00
Dr. Stephen Henson
c64c888929 oops, commit Configure part of PR#2234 2010-04-15 13:17:05 +00:00
Dr. Stephen Henson
8d9db41880 PR: 2234
Submitted By: Matthias Andree <matthias.andree@gmx.de>

Use correct path to openssl utility in c_rehash script.
2010-04-14 23:07:28 +00:00
Dr. Stephen Henson
4fae54a8e0 PR: 2235
Submitted By: Bruce Stephens <bruce.stephens@isode.com>

Make ts/Makefile consistent with other Makefiles.
2010-04-14 23:04:19 +00:00
Andy Polyakov
9f35928719 x86_64cpuid.pl: ml64 is allergic to db on label line [from HEAD]. 2010-04-14 19:25:09 +00:00
Dr. Stephen Henson
c5af032df5 update FAQ 2010-04-14 13:20:53 +00:00
Andy Polyakov
8a898a6fcc [co]cf128.c: fix "n=0" bug [from HEAD]. 2010-04-14 07:47:53 +00:00
Dr. Stephen Henson
9f827ded1c fix signed/unsigned comparison warnings 2010-04-14 00:41:01 +00:00
Dr. Stephen Henson
5daa9411a0 fix bug in ccgost CFB mode code 2010-04-14 00:33:22 +00:00
Dr. Stephen Henson
094d4019b8 check ASN1 type before using it 2010-04-14 00:30:12 +00:00
Dr. Stephen Henson
1507f3abba PR: 2230
Submitted By: Robin Seggelmann <seggelmann@fh-muenster.de>

Fix various DTLS fragment reassembly bugs.
2010-04-14 00:17:29 +00:00
Dr. Stephen Henson
30e8defe52 PR: 2229
Submitted By: Robin Seggelmann <seggelmann@fh-muenster.de>

Don't drop DTLS connection if mac or decryption failed.
2010-04-14 00:09:55 +00:00
Dr. Stephen Henson
9f4dd3e3e3 PR: 2228
Submitted By: Robin Seggelmann <seggelmann@fh-muenster.de>

Fix DTLS buffer record MAC failure bug.
2010-04-14 00:03:13 +00:00
Dr. Stephen Henson
8c00014d7e make update 2010-04-13 17:08:50 +00:00
Richard Levitte
1cf12a6350 No need to look for the file if none was entered. 2010-04-13 14:39:58 +00:00
Richard Levitte
dc9461e23f A few more things that aren't built on VAX 2010-04-13 14:39:08 +00:00
Richard Levitte
72d57050df Since test modules aren't copied to the test/ directory any more on
VMS, we need to rework this script with knowledge of where they are.
2010-04-13 14:38:39 +00:00
Richard Levitte
49d1f665a4 Rework the way engines are built 2010-04-13 14:37:43 +00:00
Richard Levitte
2c25edc4c1 Too long symbols 2010-04-13 14:36:58 +00:00
Richard Levitte
d2f098b33d Spelling 2010-04-13 14:34:48 +00:00
Richard Levitte
6f4f7f35f3 Rework the configuration of avoided algorithms.
Avoid copying test modules.
2010-04-13 14:33:04 +00:00
Richard Levitte
0a4fe6c8db Undo the previous change, it was incorrect in this branch. 2010-04-13 11:10:07 +00:00
Richard Levitte
7bba401d5d Third argument to dtls1_buffer_record is by reference 2010-04-13 08:41:58 +00:00
Andy Polyakov
c73cff12f1 aes-ppc.pl: 10% performance improvement on Power6 [from HEAD]. 2010-04-10 14:54:34 +00:00
Andy Polyakov
b32d93840e cryptlib.c: allow application to override OPENSSL_isservice [from HEAD]. 2010-04-10 14:13:12 +00:00
Andy Polyakov
cb457849fd ctr129.c: fix typo, simplify ctr128_inc and fix "n=0" bug [from HEAD]. 2010-04-10 13:47:11 +00:00
Andy Polyakov
cb3c30059a darwin-ppc-cc: add -Wa,-force_cpusubtype_ALL to produce binaries not
specific to G5. This was already added to HEAD earlier.
PR: 2231
2010-04-10 13:41:58 +00:00
Andy Polyakov
20dc93e49e sparccpuid.S: some assembler is allergic to apostrophes in comments [from HEAD]. 2010-04-10 13:37:06 +00:00
Andy Polyakov
b620447dcc alpha-mont.pl: comply with stack alignment requirement [from HEAD]. 2010-04-10 13:33:46 +00:00
Dr. Stephen Henson
4ffd2ad1d3 make GOST MAC work again 2010-04-08 10:54:54 +00:00
Dr. Stephen Henson
acc9938ba5 Add SHA2 algorithms to SSL_library_init(). Although these aren't used
directly by SSL/TLS SHA2 certificates are becoming more common and
applications that only call SSL_library_init() and not
OpenSSL_add_all_alrgorithms() will fail when verifying certificates.

Update docs.
2010-04-07 13:18:30 +00:00
Dr. Stephen Henson
f6d13ac8cf Remove obsolete PRNG note. Add comment about use of SHA256 et al. 2010-04-06 15:05:47 +00:00
Dr. Stephen Henson
24cb653c6b PR: 2209
Submitted Daniel Mentz <danielml@sent.com>

Documentation typo.
2010-04-06 14:45:31 +00:00
Dr. Stephen Henson
6dfd3cf68e PR: 2218
Submitted By: Robin Seggelmann <seggelmann@fh-muenster.de>

Fixes for DTLS replay bug.
2010-04-06 12:44:55 +00:00
Dr. Stephen Henson
073775cbbb PR: 2219
Submitted By: Robin Seggelmann <seggelmann@fh-muenster.de>

Fixes for DTLS buffering bug.
2010-04-06 12:40:10 +00:00
Dr. Stephen Henson
e995d5044e PR: 2223
Submitted By: Robin Seggelmann <seggelmann@fh-muenster.de>

Fixes for DTLS timeout bug
2010-04-06 12:29:21 +00:00
Dr. Stephen Henson
5b0a79a27a PR: 2220
Fixes to make OpenSSL compile with no-rc4
2010-04-06 11:18:32 +00:00
Dr. Stephen Henson
6747de655e updates for next release 2010-03-30 00:55:00 +00:00
Dr. Stephen Henson
91bad2b09e Prepare for 1.0.0 release - finally ;-) 2010-03-29 13:11:54 +00:00
Andy Polyakov
1244d5b713 ARMv4 assembler: [unconfirmed] fix for compilation failure [from HEAD]. 2010-03-29 09:59:58 +00:00
Andy Polyakov
c0ed5cd47b dso_dlfcn.c: fix compile failure on Tru64 [from HEAD]. 2010-03-29 09:50:33 +00:00
Dr. Stephen Henson
c8281fd38e PR: 1696
Check return value if d2i_PBEPARAM().
2010-03-28 00:42:29 +00:00
Dr. Stephen Henson
fe8e6bff9b PR: 1763
Remove useless num = 0 assignment.

Remove redundant cases on sock_ctrl(): default case handles them.
2010-03-27 23:28:23 +00:00
Dr. Stephen Henson
9caf25d144 PR: 1904
Submitted by: David Woodhouse <dwmw2@infradead.org>

Pass passphrase minimum length down to UI.
2010-03-27 19:27:51 +00:00
Dr. Stephen Henson
348620c7ac PR: 1813
Submitted by: Torsten Hilbrich <torsten.hilbrich@secunet.com>

Fix memory leak when engine name cannot be loaded.
2010-03-27 18:28:13 +00:00
Dr. Stephen Henson
30fc2ab92b update FAQ 2010-03-25 12:07:45 +00:00
Bodo Möller
5b5464d525 Fix for "Record of death" vulnerability CVE-2010-0740.
Also, add missing CHANGES entry for CVE-2009-3245 (code changes submitted to this branch on 23 Feb 2010).
2010-03-25 11:22:42 +00:00
Dr. Stephen Henson
cd15a0528f initialise buf if wrong_info not used 2010-03-24 23:42:20 +00:00
Dr. Stephen Henson
7b52778eff PR: 1731 and maybe 2197
Clear error queue in a few places in SSL code where errors are expected
so they don't stay in the queue.
2010-03-24 23:16:49 +00:00
Andy Polyakov
162de2f2b5 rand_win.c: fix logical bug in readscreen [from HEAD]. 2010-03-22 22:44:35 +00:00
Andy Polyakov
f6e4af6fd7 bss_file.c: fix MSC 6.0 warning [from HEAD]. 2010-03-22 22:39:46 +00:00
Andy Polyakov
32b76dcdac e_capi.c: fix typo. 2010-03-15 22:29:20 +00:00
Andy Polyakov
bcfd252052 Fix UPLINK typo [from HEAD]. 2010-03-15 22:26:33 +00:00
Dr. Stephen Henson
32c452779e workaround for missing definition in some headers 2010-03-15 13:09:39 +00:00
Dr. Stephen Henson
118b90c59e PR: 2192
Submitted By: Jaroslav Imrich <jaroslav.imrich@disig.sk>

The prompt_info and wrong_info parameters can be empty strings which
can produce confusing prompts. Treat empty string same as NULL.
2010-03-12 12:48:46 +00:00
Dr. Stephen Henson
f6a61b140e missing goto meant signature was never printed out 2010-03-12 12:07:05 +00:00
Dr. Stephen Henson
75ece4b5cf don't leave bogus errors in the queue 2010-03-10 13:48:21 +00:00
Dr. Stephen Henson
724cca4178 make update 2010-03-09 17:23:51 +00:00
Dr. Stephen Henson
5b3fdb0181 PR: 2188
Submitted By: Jaroslav Imrich <jaroslav.imrich@disig.sk>

Add "missing" functions to get and set prompt constructor.
2010-03-09 17:18:17 +00:00
Dr. Stephen Henson
fcc3d0265d PR: 2186
Submitted By: "Joel Rabinovitch" <Joel.Rabinovitch@tecsys.com>

Detect aix64-gcc
2010-03-09 17:08:39 +00:00
Dr. Stephen Henson
5356ea7cde reserve a few more bits for future cipher modes 2010-03-08 23:47:57 +00:00
Dr. Stephen Henson
06226df1a9 The OID sanity check was incorrect. It should only disallow *leading* 0x80
values.
2010-03-07 16:40:19 +00:00
Dr. Stephen Henson
bf638ef026 don't add digest alias if signature algorithm is undefined 2010-03-06 20:47:45 +00:00
Dr. Stephen Henson
07973d5db8 Fix memory leak: free up ENGINE functional reference if digest is not
found in an ENGINE.
2010-03-05 13:33:43 +00:00
Dr. Stephen Henson
3b3f71121b PR: 2183
PR#1999 broke fork detection by assuming HAVE_FORK was set for all platforms.
Include original HAVE_FORK detection logic while allowing it to be
overridden on specific platforms with -DHAVE_FORK=1 or -DHAVE_FORK=0
2010-03-03 19:56:17 +00:00
Dr. Stephen Henson
47333a34d5 Submitted by: Tomas Hoger <thoger@redhat.com>
Fix for CVE-2010-0433 where some kerberos enabled versions of OpenSSL
could be crashed if the relevant tables were not present (e.g. chrooted).
2010-03-03 15:41:00 +00:00
Dr. Stephen Henson
d92138f703 don't mix definitions and code 2010-03-03 15:30:26 +00:00
Andy Polyakov
b2bf335327 Fix s390x-specific HOST_l2c|c2l [from HEAD].
Submitted by: Andreas Krebbel
2010-03-02 16:25:10 +00:00
Dr. Stephen Henson
33bec62a20 PR: 2178
Submitted by: "Kennedy, Brendan" <brendan.kennedy@intel.com>

Handle error codes correctly: cryptodev returns 0 for success whereas OpenSSL
returns 1.
2010-03-01 23:54:34 +00:00
Dr. Stephen Henson
2e630b1847 use supplied ENGINE in genrsa 2010-03-01 14:22:02 +00:00
Dr. Stephen Henson
002d3fe863 use correct prototype as in HEAD 2010-03-01 03:01:56 +00:00
Dr. Stephen Henson
fb24311e7c 'typo' 2010-03-01 01:52:47 +00:00
Dr. Stephen Henson
90278430d9 make USE_CRYPTODEV_DIGESTS work 2010-03-01 01:19:36 +00:00
Ben Laurie
bcd9d12a8d Fix warning. 2010-02-28 13:38:16 +00:00
Dr. Stephen Henson
79363339b7 algorithms field has changed in 1.0.0 and later: update 2010-02-28 00:24:24 +00:00
Dr. Stephen Henson
fbe2c6b33e Add Kerberos fix which was in 0.9.8-stable but never committed to HEAD and
1.0.0. Original fix was on 2007-Mar-09 and had the log message: "Fix kerberos
ciphersuite bugs introduced with PR:1336."
2010-02-27 23:04:10 +00:00
Dr. Stephen Henson
fc11f47229 Revert CFB block length change. Despite what SP800-38a says the input to
CFB mode does *not* have to be a multiple of the block length and several
other specifications (e.g. PKCS#11) do not require this.
2010-02-26 14:41:48 +00:00
Dr. Stephen Henson
2b23d89d14 oops, use correct date 2010-02-26 12:14:30 +00:00
Dr. Stephen Henson
9cfa3cff54 update FAQ, NEWS 2010-02-25 18:21:20 +00:00
Dr. Stephen Henson
6507653e72 The meaning of the X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY and
X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT error codes were reversed in
the verify application documentation.
2010-02-23 14:09:22 +00:00
Bodo Möller
7fe747d1eb Always check bn_wexpend() return values for failure (CVE-2009-3245).
(The CHANGES entry covers the change from PR #2111 as well, submitted by
Martin Olsson.)

Submitted by: Neel Mehta
2010-02-23 10:36:30 +00:00
Bodo Möller
32567c9f3b Fix X509_STORE locking 2010-02-19 18:26:23 +00:00
Dr. Stephen Henson
4f3d52fedc clarify documentation 2010-02-18 12:41:50 +00:00
Dr. Stephen Henson
8321bab39c OR default SSL_OP_LEGACY_SERVER_CONNECT so existing options are preserved 2010-02-17 19:43:46 +00:00
Dr. Stephen Henson
989238802a Allow renegotiation if SSL_OP_LEGACY_SERVER_CONNECT is set as well as
initial connection to unpatched servers. There are no additional security
concerns in doing this as clients don't see renegotiation during an
attack anyway.
2010-02-17 18:38:10 +00:00
Dr. Stephen Henson
9051fc538f PR: 2100
Submitted by: James Baker <jbaker@tableausoftware.com> et al.

Workaround for slow Heap32Next on some versions of Windows.
2010-02-17 14:32:25 +00:00
Dr. Stephen Henson
03fd7f27db Submitted by: Dmitry Ivanov <vonami@gmail.com>
Don't leave dangling pointers in GOST engine if calls fail.
2010-02-16 14:30:19 +00:00
Dr. Stephen Henson
45d6a15ae9 PR: 2171
Submitted by: Tomas Mraz <tmraz@redhat.com>

Since SSLv2 doesn't support renegotiation at all don't reject it if
legacy renegotiation isn't enabled.

Also can now use SSL2 compatible client hello because RFC5746 supports it.
2010-02-16 14:20:40 +00:00
Dr. Stephen Henson
6c6ca18664 The "block length" for CFB mode was incorrectly coded as 1 all the time. It
should be the number of feedback bits expressed in bytes. For CFB1 mode set
this to 1 by rounding up to the nearest multiple of 8.
2010-02-15 19:40:30 +00:00
Dr. Stephen Henson
97fe2b40c1 Correct ECB mode EVP_CIPHER definition: IV length is 0 2010-02-15 19:25:52 +00:00
Dr. Stephen Henson
f689ab5017 add EVP_CIPH_FLAG_LENGTH_BITS from 0.9.8-stable 2010-02-15 19:17:55 +00:00
Dr. Stephen Henson
edb7cac271 PR: 2164
Submitted by: "Noszticzius, Istvan" <inoszticzius@rightnow.com>

Don't clear the output buffer: ciphers should correctly the same input
and output buffers.
2010-02-15 19:01:56 +00:00
Dr. Stephen Henson
81d87a2a28 update references to new RI RFC 2010-02-12 21:59:57 +00:00
Dr. Stephen Henson
7366f0b304 PR: 2170
Submitted by: Magnus Lilja <lilja.magnus@gmail.com>

Make -c option in dgst work again.
2010-02-12 17:07:24 +00:00
Dr. Stephen Henson
1d8fa09c80 Make assembly language versions of OPENSSL_cleanse() accept zero length
parameter. Backport from HEAD, orginal by appro.
2010-02-12 17:02:13 +00:00
Dr. Stephen Henson
e085e6c84c Fix memory leak in ENGINE autoconfig code. Improve error logging. 2010-02-09 14:17:57 +00:00
Dr. Stephen Henson
008fa4584d update year 2010-02-09 14:13:00 +00:00
Dr. Stephen Henson
c8c49133d9 oops, use new value for new flag 2010-02-07 13:54:54 +00:00
Dr. Stephen Henson
961f1dea06 make update 2010-02-07 13:47:08 +00:00
Dr. Stephen Henson
1700426256 Add missing function EVP_CIPHER_CTX_copy(). Current code uses memcpy() to copy
an EVP_CIPHER_CTX structure which may have problems with external ENGINEs
who need to duplicate internal handles etc.
2010-02-07 13:41:23 +00:00
Dr. Stephen Henson
aa7f5baad2 don't assume 0x is at start of string 2010-02-03 18:19:05 +00:00
Dr. Stephen Henson
45acdd6f6d tolerate broken CMS/PKCS7 implementations using signature OID instead of digest 2010-02-02 14:26:32 +00:00
Dr. Stephen Henson
8b354e776b PR: 2161
Submitted by: Doug Goldstein <cardoe@gentoo.org>, Steve.

Make no-dsa, no-ecdsa and no-rsa compile again.
2010-02-02 13:36:05 +00:00
Dr. Stephen Henson
868f5e44ca PR: 2160
Submitted by: Robin Seggelmann <seggelmann@fh-muenster.de>

Make session tickets work with DTLS.
2010-02-01 16:49:42 +00:00
Dr. Stephen Henson
4e5fdd11ea PR: 2159
Submitted by: Robin Seggelmann <seggelmann@fh-muenster.de>

Typo in PR#1949 bug, oops!
2010-02-01 12:44:11 +00:00
Richard Levitte
d552a3391a Typo. 2010-01-29 12:07:50 +00:00
Richard Levitte
d023b4e2dd The previous take went wrong, try again. 2010-01-29 12:02:54 +00:00
Richard Levitte
fa79cc9c23 Architecture specific header files need special handling. 2010-01-29 11:44:40 +00:00
Richard Levitte
06daa75fb9 If opensslconf.h and buildinf.h are to be in an architecture specific
directory, place it in the same tree as the other architecture
specific things.
2010-01-29 11:43:53 +00:00
Dr. Stephen Henson
ffa304c838 oops, revert more test code arghh! 2010-01-28 17:52:18 +00:00
Dr. Stephen Henson
df21765a3e In engine_table_select() don't clear out entire error queue: just clear
out any we added using ERR_set_mark() and ERR_pop_to_mark() otherwise
errors from other sources (e.g. SSL library) can be wiped.
2010-01-28 17:50:23 +00:00
Dr. Stephen Henson
5a6ae115f8 reword RI description 2010-01-27 18:53:49 +00:00
Dr. Stephen Henson
5e5df40b9b update documentation to reflect new renegotiation options 2010-01-27 17:50:20 +00:00
Dr. Stephen Henson
6d4943e81f Some shells print out the directory name if CDPATH is set breaking the
pod2man test. Use ./util instead to avoid this.
2010-01-27 16:06:58 +00:00
Dr. Stephen Henson
57cffe901f typo 2010-01-27 14:05:15 +00:00
Dr. Stephen Henson
a758f61793 PR: 2157
Submitted by: "Green, Paul" <Paul.Green@stratus.com>

Typo.
2010-01-27 12:55:52 +00:00
Richard Levitte
b3b35df2a2 Cosmetic changes, including changing a confusing example. 2010-01-27 09:18:05 +00:00
Richard Levitte
5ad50246fc Apparently, test/testtsa.com was only half done 2010-01-27 01:19:12 +00:00
Richard Levitte
d89b895cfd size_t doesn't compare less than zero... 2010-01-27 01:18:26 +00:00
Dr. Stephen Henson
d793c292cb add CHANGES entry 2010-01-26 19:48:10 +00:00
Dr. Stephen Henson
57749b1b9f PR: 1949
Submitted by: steve@openssl.org

More robust fix and workaround for PR#1949. Don't try to work out if there
is any write pending data as this can be unreliable: always flush.
2010-01-26 19:46:30 +00:00
Dr. Stephen Henson
1cdb7854a5 PR: 2138
Submitted by: Kevin Regan <k.regan@f5.com>

Clear stat structure if -DPURIFY is set to avoid problems on some
platforms which include unitialised fields.
2010-01-26 18:07:41 +00:00
Dr. Stephen Henson
704d33b347 Add flags functions which were added to 0.9.8 for fips but not 1.0.0 and
later.
2010-01-26 14:33:52 +00:00
Dr. Stephen Henson
b2a7515ee8 OPENSSL_isservice is now defined on all platforms not just WIN32 2010-01-26 13:58:49 +00:00
Dr. Stephen Henson
f4f2b52995 oops 2010-01-26 13:56:15 +00:00
Dr. Stephen Henson
c7d5edbf5e export OPENSSL_isservice and make update 2010-01-26 13:55:33 +00:00
Dr. Stephen Henson
d8f07f1674 Typo 2010-01-26 12:29:48 +00:00
Dr. Stephen Henson
78bfb45b07 PR: 2149
Submitted by: Douglas Stebila <douglas@stebila.ca>

Fix wap OIDs.
2010-01-25 16:07:51 +00:00
Richard Levitte
6ad4d60555 There's really no need to use $ENV::HOME 2010-01-25 00:22:52 +00:00
Richard Levitte
2fad8aa209 Forgot to correct the definition of __arch in this file.
Submitted by Steven M. Schweda <sms@antinode.info>
2010-01-25 00:21:14 +00:00
Richard Levitte
74397d45b2 It seems like sslroot: needs to be defined for some tests to work.
Submitted by Steven M. Schweda <sms@antinode.info>
2010-01-25 00:20:32 +00:00
Richard Levitte
c8ca769d3b Compile t1_reneg on VMS as well.
Submitted by Steven M. Schweda <sms@antinode.info>
2010-01-25 00:19:33 +00:00
Richard Levitte
25d42c17e3 A few more macros for long symbols.
Submitted by Steven M. Schweda <sms@antinode.info>
2010-01-25 00:18:31 +00:00
Dr. Stephen Henson
a377811f15 PR: 2153, 2125
Submitted by: steve@openssl.org

The original fix for PR#2125 broke compilation on some Unixware platforms:
revert and make conditional on VMS.
2010-01-24 16:57:38 +00:00
Dr. Stephen Henson
ef1b6b2cf2 The fix for PR#1949 unfortunately broke cases where the BIO_CTRL_WPENDING
ctrl is incorrectly implemented (e.g. some versions of Apache). As a workaround
call both BIO_CTRL_INFO and BIO_CTRL_WPENDING if it returns zero. This should
both address the original bug and retain compatibility with the old behaviour.
2010-01-24 13:54:07 +00:00
Dr. Stephen Henson
1699389a46 Tolerate PKCS#8 DSA format with negative private key. 2010-01-22 20:17:30 +00:00
Dr. Stephen Henson
ad8ee3d7d1 If legacy renegotiation is not permitted then send a fatal alert if a patched
server attempts to renegotiate with an unpatched client.
2010-01-22 18:49:19 +00:00
Dr. Stephen Henson
39f0a4d8e9 typo 2010-01-21 18:46:28 +00:00
Dr. Stephen Henson
15a9821cc2 fix comments 2010-01-21 01:17:45 +00:00
Dr. Stephen Henson
53e97e7433 update version for next beta if we have one... 2010-01-20 15:40:27 +00:00
Dr. Stephen Henson
bc0ecd202a make update 2010-01-20 15:05:52 +00:00
Dr. Stephen Henson
b307daa23f Prepare for beta5 release 2010-01-20 15:00:49 +00:00
Dr. Stephen Henson
4c95b1bfda Update demo 2010-01-20 14:05:56 +00:00
Dr. Stephen Henson
9359fc5ff2 Support -L options in VC++ link. 2010-01-20 14:04:55 +00:00
Andy Polyakov
a238d7d1eb rand_win.c: handel GetTickCount wrap-around [from HEAD]. 2010-01-19 21:44:07 +00:00
Andy Polyakov
0e92313331 x86_64-xlate.pl: refine sign extension logic when handling lea [from HEAD].
PR: 2094,2095
2010-01-19 21:43:05 +00:00
Andy Polyakov
3e719c99f5 s390x assembler update: add support for run-time facility detection [from HEAD]. 2010-01-19 21:40:58 +00:00
Dr. Stephen Henson
2a4d0dcb89 The use of NIDs in the password based encryption table can result in
algorithms not found when an application uses PKCS#12 and only calls
SSL_library_init() instead of OpenSSL_add_all_algorithms(). Simple
work around is to add the missing algorithm (40 bit RC2) in
SSL_library_init().
2010-01-19 19:55:47 +00:00
Dr. Stephen Henson
2e155fde39 PR: 2141
Submitted by: "NARUSE, Yui" <naruse@airemix.jp>

Remove non-ASCII comment which causes compilation errors on some versions
of VC++.
2010-01-19 19:28:03 +00:00
Dr. Stephen Henson
9a8c8cb22e stop asn1test compilation producing link errors 2010-01-19 19:25:16 +00:00
Dr. Stephen Henson
04aa7441ab PR: 2144
Submitted by: Robin Seggelmann <seggelmann@fh-muenster.de>

Better fix for PR#2144
2010-01-19 19:11:21 +00:00
Dr. Stephen Henson
28dc54f6d9 Reverted patch for PR#2095. Addressed by Andy now in x86_64-xlate.pl 2010-01-17 16:58:56 +00:00
Dr. Stephen Henson
a1e1165200 PR: 2135
Submitted by: Mike Frysinger <vapier@gentoo.org>

Change missed references to lib to $(LIBDIR)
2010-01-16 20:06:10 +00:00
Dr. Stephen Henson
ddba003d5e PR: 2144
Submitted by: steve@openssl.org

Fix DTLS connection so new_session is reset if we read second client hello:
new_session is used to detect renegotiation.
2010-01-16 19:45:59 +00:00
Dr. Stephen Henson
e59d9a34c9 PR: 2133
Submitted by: steve@openssl.org

Add missing DTLS state strings.
2010-01-16 19:20:38 +00:00
Ben Laurie
9e198c4bd0 Fix type-checking/casting issue. 2010-01-16 13:32:14 +00:00
Dr. Stephen Henson
7eceffbfef convert to Unix EOL form 2010-01-15 15:26:32 +00:00
Dr. Stephen Henson
8043f01b13 PR: 2125
Submitted by: "Alon Bar-Lev" <alon.barlev@gmail.com>

Fix gcc-aix compilation issue.
2010-01-14 17:51:52 +00:00
Dr. Stephen Henson
41c0f68630 Fix version handling so it can cope with a major version >3.
Although it will be many years before TLS v2.0 or later appears old versions
of servers have a habit of hanging around for a considerable time so best
if we handle this properly now.
2010-01-13 19:08:29 +00:00
Dr. Stephen Henson
2c627637c5 Modify compression code so it avoids using ex_data free functions. This
stops applications that call CRYPTO_free_all_ex_data() prematurely leaking
memory.
2010-01-13 18:46:01 +00:00
Dr. Stephen Henson
58f4b3511e update ordinals 2010-01-12 17:33:59 +00:00
Dr. Stephen Henson
93fac08ec3 PR: 2136
Submitted by: Willy Weisz <weisz@vcpc.univie.ac.at>

Add options to output hash using older algorithm compatible with OpenSSL
versions before 1.0.0
2010-01-12 17:27:11 +00:00
Dr. Stephen Henson
23c3bee970 make update 2010-01-12 01:59:11 +00:00
Dr. Stephen Henson
73ff97ad76 Simplify RI+SCSV logic:
1. Send SCSV is not renegotiating, never empty RI.
2. Send RI if renegotiating.
2010-01-07 19:05:03 +00:00
Andy Polyakov
0d8ffc2007 b_sock.c: bind/connect are picky about socket address length [from HEAD]. 2010-01-07 13:15:39 +00:00
Andy Polyakov
a32f7fb832 sendto is reportedly picky about destination socket address length [from HEAD].
PR: 2114
Submitted by: Robin Seggelmann
2010-01-07 10:44:21 +00:00
Andy Polyakov
496cf69e40 Fix compilation on older Linux [from HEAD]. 2010-01-06 21:25:22 +00:00
Dr. Stephen Henson
eb17330837 Updates to conform with draft-ietf-tls-renegotiation-03.txt:
1. Add provisional SCSV value.
2. Don't send SCSV and RI at same time.
3. Fatal error is SCSV received when renegotiating.
2010-01-06 17:37:38 +00:00
Dr. Stephen Henson
2708603bb4 ENGINE_load_capi() now exists on all platforms (but no op on non-WIN32) 2010-01-06 13:20:52 +00:00
Dr. Stephen Henson
e4f1cda7de PR: 2102
Submitted by: John Fitzgibbon <john_fitzgibbon@yahoo.com>

Remove duplicate definitions.
2010-01-05 17:58:15 +00:00
Dr. Stephen Henson
4359b88bbe Typo 2010-01-05 17:50:01 +00:00
Dr. Stephen Henson
c079fde3f7 PR: 2132
Submitted by: steve

Fix bundled pod2man.pl to handle alternative comment formats.
2010-01-05 17:33:09 +00:00
Dr. Stephen Henson
6e94156199 Remove tabs on blank lines: they produce warnings in pod2man 2010-01-05 17:17:20 +00:00
Dr. Stephen Henson
1f67a3a985 compress_meth should be unsigned 2010-01-05 16:46:39 +00:00
Dr. Stephen Henson
4cba294d79 Client side compression algorithm sanity checks: ensure old compression
algorithm matches current and give error if compression is disabled and
server requests it (shouldn't happen unless server is broken).
2010-01-01 14:39:51 +00:00
Dr. Stephen Henson
e642fd7a1c Compression handling on session resume was badly broken: it always
used compression algorithms in client hello (a legacy from when
the compression algorithm wasn't serialized with SSL_SESSION).
2010-01-01 00:44:36 +00:00
Andy Polyakov
5448e6739c b_sock.c: correct indirect calls on WinSock platforms [from HEAD].
PR: 2130
Submitted by: Eugeny Gostyukhin
2009-12-30 12:56:16 +00:00
Andy Polyakov
f0389d8d37 Adapt mingw config for newer mingw environment [from HEAD].
PR: 2113
2009-12-30 11:57:39 +00:00
Andy Polyakov
a5313cf360 sha512.c update for esoteric PPC platfrom(s) [from HEAD].
PR: 1998
2009-12-30 11:53:33 +00:00
Andy Polyakov
b26c45b033 Deploy multilib config-line parameter [from HEAD]. 2009-12-29 10:46:46 +00:00
Dr. Stephen Henson
986093affa Typo 2009-12-27 23:03:25 +00:00
Dr. Stephen Henson
f88e0acb0e Update RI to match latest spec.
MCSV is now called SCSV.

Don't send SCSV if renegotiating.

Also note if RI is empty in debug messages.
2009-12-27 22:59:09 +00:00
Dr. Stephen Henson
aed461b431 Traditional Yuletide commit ;-)
Add Triple DES CFB1 and CFB8 to algorithm list and NID translation.
2009-12-25 14:12:24 +00:00
Bodo Möller
8bbd0e826c Use properly local variables for thread-safety.
Submitted by: Martin Rex
2009-12-22 11:52:15 +00:00
Bodo Möller
40c45f86d4 Constify crypto/cast. 2009-12-22 11:45:59 +00:00
Bodo Möller
a0b7277724 Constify crypto/cast. 2009-12-22 10:58:01 +00:00
Dr. Stephen Henson
54bc369ad7 Alert to use is now defined in spec: update code 2009-12-17 15:42:43 +00:00
Dr. Stephen Henson
2d3855fc6e PR: 2127
Submitted by: Tomas Mraz <tmraz@redhat.com>

Check for lookup failures in EVP_PBE_CipherInit().
2009-12-17 15:28:45 +00:00
Dr. Stephen Henson
1cd47f5f6e Ooops revert stuff which shouldn't have been part of previous commit. 2009-12-16 20:33:11 +00:00
Dr. Stephen Henson
675564835c New option to enable/disable connection to unpatched servers 2009-12-16 20:28:30 +00:00
Dr. Stephen Henson
2456cd58c4 Allow initial connection (but no renegoriation) to servers which don't support
RI.

Reorganise RI checking code and handle some missing cases.
2009-12-14 13:55:39 +00:00
Ben Laurie
43a107026d Missing error code. 2009-12-12 15:57:53 +00:00
Ben Laurie
ef0498a00b Use gcc 4.4. 2009-12-12 15:57:19 +00:00
Dr. Stephen Henson
f1784f2fd2 Move SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION out of SSL_OP_ALL 2009-12-11 00:20:58 +00:00
Dr. Stephen Henson
730f5752ff clarify docs 2009-12-09 18:17:09 +00:00
Dr. Stephen Henson
a88c73b43a Document option clearning functions.
Initial secure renegotiation documentation.
2009-12-09 18:00:52 +00:00
Dr. Stephen Henson
a6d204e241 Add patch to crypto/evp which didn't apply from PR#2124 2009-12-09 15:02:14 +00:00
Dr. Stephen Henson
941baf6641 Revert lhash patch for PR#2124 2009-12-09 15:00:20 +00:00
Dr. Stephen Henson
b41a614686 Check s3 is not NULL 2009-12-09 14:53:51 +00:00
Dr. Stephen Henson
aac751832a PR: 2124
Submitted by: Jan Pechanec <Jan.Pechanec@Sun.COM>

Check for memory allocation failures.
2009-12-09 13:38:20 +00:00
Dr. Stephen Henson
52a08e90d1 Add ctrls to clear options and mode.
Change RI ctrl so it doesn't clash.
2009-12-09 13:25:38 +00:00
Dr. Stephen Henson
6b5f0458fe Send no_renegotiation alert as required by spec. 2009-12-08 19:06:09 +00:00
Dr. Stephen Henson
b52a2738d4 Add ctrl and macro so we can determine if peer support secure renegotiation. 2009-12-08 13:42:32 +00:00
Dr. Stephen Henson
10f99d7b77 Add support for magic cipher suite value (MCSV). Make secure renegotiation
work in SSLv3: initial handshake has no extensions but includes MCSV, if
server indicates RI support then renegotiation handshakes include RI.

NB: current MCSV value is bogus for testing only, will be updated when we
have an official value.

Change mismatch alerts to handshake_failure as required by spec.

Also have some debugging fprintfs so we can clearly see what is going on
if OPENSSL_RI_DEBUG is set.
2009-12-08 13:15:12 +00:00
Dr. Stephen Henson
593222afe1 PR: 2121
Submitted by: Robin Seggelmann <seggelmann@fh-muenster.de>

Add extension support to DTLS code mainly using existing implementation for
TLS.
2009-12-08 11:38:18 +00:00
Dr. Stephen Henson
7b1856e5a1 PR: 2111
Submitted by: Martin Olsson <molsson@opera.com>

Check for bn_wexpand errors in bn_mul.c
2009-12-02 15:28:05 +00:00
Dr. Stephen Henson
3d5d81bf39 Replace the broken SPKAC certification with the correct version. 2009-12-02 14:41:24 +00:00
Dr. Stephen Henson
50f06b46f4 Check it actually compiles this time ;-) 2009-12-02 14:25:55 +00:00
Dr. Stephen Henson
be6076c0ad PR: 2120
Submitted by: steve@openssl.org

Initialize fields correctly if pem_str or info are NULL in  EVP_PKEY_asn1_new().
2009-12-02 13:57:03 +00:00
Dr. Stephen Henson
6125e07d79 check DSA_sign() return value properly 2009-12-01 18:41:50 +00:00
Dr. Stephen Henson
d5b8c46499 PR: 2115
Submitted by: Robin Seggelmann <seggelmann@fh-muenster.de>
Approved by: steve@openssl.org

Add Renegotiation extension to DTLS, fix DTLS ClientHello processing bug.
2009-12-01 17:41:42 +00:00
Dr. Stephen Henson
7805e23588 PR: 1432
Submitted by: "Andrzej Chmielowiec" <achmielowiec@enigma.com.pl>, steve@openssl.org
Approved by: steve@openssl.org

Truncate hash if it is too large: as required by FIPS 186-3.
2009-12-01 17:32:33 +00:00
Dr. Stephen Henson
9117b9d17a PR: 2118
Submitted by: Mounir IDRASSI <mounir.idrassi@idrix.net>
Approved by: steve@openssl.org

Check return value of ECDSA_sign() properly.
2009-11-30 13:53:42 +00:00
Dr. Stephen Henson
e274c8fb72 typo 2009-11-29 13:45:18 +00:00
Andy Polyakov
e8dbd66e2b cms-test.pl: use EXE_EXT (from HEAD).
PR: 2107
2009-11-26 21:12:12 +00:00
Andy Polyakov
8b9b23603f bss_dgram.c: re-fix BIO_CTRL_DGRAM_GET_PEER (from HEAD). 2009-11-26 20:56:05 +00:00
Bodo Möller
aefb9dc5e5 Make CHANGES in the OpenSSL_1_0_0-stable branch consistent with the
one in the OpenSSL_0_9_8-stable branch.
2009-11-26 18:37:11 +00:00
Andy Polyakov
a8c1b19a31 x86_64-xlate.pl: fix typo introduced in last commit.
PR: 2109
2009-11-23 19:51:24 +00:00
Andy Polyakov
29c8d2a54a x86_64-xlate.pl: new gas requires sign extension.
x86masm.pl: fix linker warning.
PR: 2094,2095
2009-11-22 12:52:18 +00:00
Andy Polyakov
87827be0c2 VC-32.pl: bufferoverlowu.lib only when needed and remove duplicate code
(update from HEAD).
PR: 2086
2009-11-22 12:26:15 +00:00
Andy Polyakov
e4572e5210 bio_sock.c and bss_dgram.c: update from HEAD.
PR: 2069
2009-11-22 12:24:43 +00:00
Dr. Stephen Henson
3e8e12a6b6 Servers can't end up talking SSLv2 with legacy renegotiation disabled 2009-11-18 15:09:35 +00:00
Dr. Stephen Henson
5ddbb8f41a Don't use SSLv2 compatible client hello if we don't tolerate legacy renegotiation 2009-11-18 14:45:32 +00:00
Dr. Stephen Henson
3c44e92bcb Include a more meaningful error message when rejecting legacy renegotiation 2009-11-18 14:19:52 +00:00
Dr. Stephen Henson
5e8d95f590 PR: 2103
Submitted by: Rob Austein <sra@hactrn.net>
Approved by: steve@openssl.org

Initialise atm.flags to 0.
2009-11-17 13:25:35 +00:00
Dr. Stephen Henson
2156704924 PR: 2101 (additional)
Submitted by: Roumen Petrov <openssl@roumenpetrov.info>
Approved by: steve@openssl.org

Another mingw fix.
2009-11-15 19:06:21 +00:00
Dr. Stephen Henson
4e49aa0ca3 PR: 2095
Submitted by: Arkadiusz Miskiewicz <arekm@maven.pl>
Approved by: steve@openssl.org

Fix for out range of signed 32bit displacement error on newer binutils
in file sha1-x86_64.pl
2009-11-13 14:23:44 +00:00
Dr. Stephen Henson
d5d1c53735 PR: 2101
Submitted by: Doug Kaufman <dkaufman@rahul.net>
Approved by: steve@openssl.org

Fixes for tests in cms-test.pl
2009-11-13 13:44:14 +00:00
Richard Levitte
1aac5c0ee8 Add test_cms 2009-11-13 08:45:52 +00:00
Dr. Stephen Henson
4434328b0a PR: 2088
Submitted by: Aleksey Samsonov <s4ms0n0v@gmail.com>
Approved by: steve@openssl.org

Fix memory leak in d2i_PublicKey().
2009-11-12 19:57:39 +00:00
Dr. Stephen Henson
9b2cfb890c set engine to NULL after releasing it 2009-11-12 19:24:34 +00:00
Richard Levitte
b2f364ec62 Compiling vms.mar doesn't work on other than VAX. 2009-11-12 14:05:04 +00:00
Richard Levitte
b7aeb4c9b5 Another symbol longer than 31 characters. 2009-11-12 14:04:26 +00:00
Richard Levitte
370f48da2a Typo 2009-11-12 14:03:57 +00:00
Richard Levitte
32def77ace Everywhere was a little too much. 2009-11-12 14:03:35 +00:00
Dr. Stephen Henson
531c81ece8 PR: 2098
Submitted by: Corinna Vinschen <vinschen@redhat.com>
Approved by: steve@openssl.org

For Cygwin enable zlib and mdc2 by default.
2009-11-11 19:04:56 +00:00
Dr. Stephen Henson
73582b8117 add missing parts of reneg port, fix apps patch 2009-11-11 14:51:29 +00:00
Dr. Stephen Henson
5c33091cfa commit missing apps code for reneg fix 2009-11-11 14:10:09 +00:00
Dr. Stephen Henson
56327ebe6a make update 2009-11-10 13:23:04 +00:00
Dr. Stephen Henson
e0031b1c78 Prepare for beta4 release 2009-11-10 13:15:09 +00:00
Dr. Stephen Henson
b2ac5cb2d0 PR: 1686
Submitted by: Hanno Böck <hanno@hboeck.de>
Approved by: steve@openssl.org

Create engines dir if it doesn't already exist.
2009-11-10 01:52:52 +00:00
Dr. Stephen Henson
6757ef89b3 PR: 2091
Submitted by: Martin Kaiser <lists@kaiser.cx>, Stephen Henson
Approved by: steve@openssl.org

If an OID has no short name or long name return the numerical representation.
2009-11-10 01:00:23 +00:00
Dr. Stephen Henson
bf6eea6536 PR: 2090
Submitted by: Martin Kaiser <lists@kaiser.cx>, Stephen Henson
Approved by: steve@openssl.org

Improve error checking in asn1_gen.c
2009-11-10 00:47:37 +00:00
Dr. Stephen Henson
ec4346f6f9 oops, add missing prototypes 2009-11-09 18:58:50 +00:00
Dr. Stephen Henson
e42ff486a8 fix CHANGES 2009-11-09 18:46:59 +00:00
Dr. Stephen Henson
bc9058d041 First cut of renegotiation extension. (port to 1.0.0-stable) 2009-11-09 18:45:42 +00:00
Dr. Stephen Henson
4a276f3039 make update 2009-11-09 14:35:30 +00:00
Dr. Stephen Henson
acf47d8f24 Remove BF_PTR2 from configuration: it doesn't improve performance any more and causes gcc warnings about arrays out of range 2009-11-09 14:11:13 +00:00
Dr. Stephen Henson
f62d1ea3d5 Combat gcc 4.4.1 aliasing rules. (from HEAD) 2009-11-09 14:09:53 +00:00
Dr. Stephen Henson
f923bba73c file t1_reneg.c was added on branch OpenSSL_1_0_0-stable on 2009-11-09 18:45:42 +0000 2009-11-08 14:51:55 +00:00
Dr. Stephen Henson
e3738c49b8 If it is a new session don't send the old TLS ticket: send a zero length
ticket to request a new session.
2009-11-08 14:36:32 +00:00
Dr. Stephen Henson
41746da8c2 Update ordinals. 2009-11-04 13:29:58 +00:00
Dr. Stephen Henson
23b97c6bb5 PR: 2089
Submitted by: Robin Seggelmann <seggelmann@fh-muenster.de>
Approved by: steve@openssl.org

DTLS Fragment size bug fix.
2009-11-02 13:37:17 +00:00
Dr. Stephen Henson
4a7f7171f5 Add missing functions to allow access to newer X509_STORE_CTX status
information. Add more informative message to verify callback to indicate
when CRL path validation is taking place.
2009-10-31 19:21:47 +00:00
Dr. Stephen Henson
961092281f Add option to allow in-band CRL loading in verify utility. Add function
load_crls and tidy up load_certs. Remove useless purpose variable from
verify utility: now done with args_verify.
2009-10-31 13:34:19 +00:00
Dr. Stephen Henson
036b3f331b Generate stateless session ID just after the ticket is received instead
of when a session is loaded. This will mean that applications that
just hold onto SSL_SESSION structures and never call d2i_SSL_SESSION()
will still work.
2009-10-30 14:06:18 +00:00
Dr. Stephen Henson
9ac5c355a2 Move CHANGES entry to 0.9.8l section 2009-10-30 13:29:08 +00:00
Dr. Stephen Henson
3d0b604c14 Fix statless session resumption so it can coexist with SNI 2009-10-30 13:22:44 +00:00
Dr. Stephen Henson
257b2bfb6c Don't attempt session resumption if no ticket is present and session
ID length is zero.
2009-10-28 19:52:35 +00:00
Dr. Stephen Henson
90528846e8 Add -no_cache option to s_server 2009-10-28 17:49:37 +00:00
Dr. Stephen Henson
32509c9731 Don't replace whole AR line 2009-10-28 15:33:20 +00:00
Dr. Stephen Henson
d3f940833d PR: 2081
Submitted by: Mike Frysinger <vapier@gentoo.org>
Approved by: steve@openssl.org

Respect AR and RANLIB environment variables if set.
2009-10-28 14:00:41 +00:00
Dr. Stephen Henson
b335e351d4 PR: 2080
Submitted by: Mike Frysinger <vapier@gentoo.org>
Approved by: steve@openssl.org

Respect MAKE environment variable if set.
2009-10-28 13:55:55 +00:00
Dr. Stephen Henson
67bcde9ba8 PR: 2078
Submitted by: Dale Anderson <dra@redevised.net>
Approved by: steve@openssl.org

Corrections to bn_internal documentation.
2009-10-28 13:51:56 +00:00
Dr. Stephen Henson
169bfde4d4 Clarification 2009-10-23 12:47:01 +00:00
Dr. Stephen Henson
0a7f291268 Sync FAQ with HEAD. 2009-10-23 12:24:54 +00:00
Dr. Stephen Henson
0c2c2e71a6 If not checking all certificates don't attempt to find a CRL
for the leaf certificate of a CRL path.
2009-10-23 12:05:54 +00:00
Dr. Stephen Henson
d1d746afb4 Need to check <= 0 here. 2009-10-22 23:14:12 +00:00
Dr. Stephen Henson
db6e41f0ed PR: 2070
Submitted by: Alexander Nikitovskiy <Nikitovski@ya.ru>
Approved by: steve@openssl.org

Fix wrong cast.
2009-10-19 13:13:14 +00:00
Dr. Stephen Henson
5b2b60ae98 Document additions for X509 chain verification from HEAD 2009-10-18 15:28:59 +00:00
Dr. Stephen Henson
c90a1ae0c9 make update 2009-10-18 14:44:51 +00:00
Dr. Stephen Henson
c679fb298e Add new function X509_STORE_set_verify_cb and use it in apps 2009-10-18 14:42:27 +00:00
Dr. Stephen Henson
17c7cad545 take install prefix from the environment 2009-10-18 14:26:46 +00:00
Dr. Stephen Henson
164c263b5c PR: 2074
Submitted by: Bram Neijt <bneijt@gmail.com>
Approved by: steve@openssl.org

Typo: "contet".
2009-10-16 15:29:34 +00:00
Dr. Stephen Henson
a9bb9d0eb4 PR: 2072
Submitted by: Tomas Mraz <tmraz@redhat.com>
Approved by: steve@openssl.org

Avoid potential doublefree and reuse of freed handshake_buffer.
2009-10-16 15:24:19 +00:00
Dr. Stephen Henson
cc6688d796 PR: 2073
Submitted by: Tomas Mraz <tmraz@redhat.com>
Approved by: steve@openssl.org

Don't access freed SSL_CTX in SSL_free().
2009-10-16 13:41:52 +00:00
Dr. Stephen Henson
9b1f24df3d Fixes to CROSS_COMPILE, don't override command line option from environment 2009-10-15 23:44:11 +00:00
Dr. Stephen Henson
595e804ae3 Fix for WIN32 (and possibly other platforms) which don't define in_port_t. 2009-10-15 18:48:47 +00:00
Dr. Stephen Henson
b381e9b952 Update ordinals. 2009-10-15 18:04:43 +00:00
Dr. Stephen Henson
28418076b2 PR: 2069
Submitted by: Michael Tuexen <tuexen@fh-muenster.de>
Approved by: steve@openssl.org

IPv6 support for DTLS.
2009-10-15 17:41:44 +00:00
Dr. Stephen Henson
abdfdb029e PR: 1847
Submitted by: Tomas Mraz <tmraz@redhat.com>
Approved by: steve@openssl.org

Integrated patches to CA.sh to bring it into line with CA.pl functionality.
2009-10-15 17:27:47 +00:00
Dr. Stephen Henson
8465b81d50 PR: 2066
Submitted by: Guenter <lists@gknw.net>
Approved by: steve@openssl.org

Add -r option to dgst to produce format compatible with core utilities.
2009-10-15 17:18:03 +00:00
Dr. Stephen Henson
ed65b6e512 Rename CROSS_COMPILE_PREFIX to CROSS_COMPILE 2009-10-15 13:05:41 +00:00
Dr. Stephen Henson
d793544518 Allow uname values to be overridden by the environment 2009-10-07 16:46:51 +00:00
Dr. Stephen Henson
53480a673b Allow cross compilation prefix to come from CROSS_COMPILE environment variable 2009-10-07 16:41:33 +00:00
Dr. Stephen Henson
ad187f8905 Fix unitialized warnings 2009-10-04 16:52:35 +00:00
Dr. Stephen Henson
2280f82fc6 Fix warnings about ignoring fgets return value 2009-10-04 16:43:21 +00:00
Dr. Stephen Henson
e6714faffb Prevent ignored return value warning 2009-10-04 14:04:14 +00:00
Dr. Stephen Henson
af8f2bb174 Prevent aliasing warning 2009-10-04 14:02:03 +00:00
Dr. Stephen Henson
d7501c16bf Yes it is a typo ;-) 2009-10-01 12:17:18 +00:00
Dr. Stephen Henson
804196a418 PR: 2061
Submitted by: Julia Lawall <julia@diku.dk>
Approved by: steve@openssl.org

Correct i2b_PVK_bio error handling in rsa.c, dsa.c
2009-10-01 00:26:07 +00:00
Dr. Stephen Henson
50d70c01d6 PR: 2062
Submitted by: Julia Lawall <julia@diku.dk>
Approved by: steve@openssl.org

Correct BN_rand error handling in bntest.c
2009-10-01 00:21:55 +00:00
Dr. Stephen Henson
9fc601cfbb PR: 2059
Submitted by: Julia Lawall <julia@diku.dk>
Approved by: steve@openssl.org

Correct EVP_SealInit error handling in pem_seal.c
2009-10-01 00:17:35 +00:00
Dr. Stephen Henson
fed5333248 PR: 2056
Submitted by: Julia Lawall <julia@diku.dk>
Approved by: steve@openssl.org

Correct BIO_wirte error handling in asn1_par.c
2009-10-01 00:11:49 +00:00
Dr. Stephen Henson
3d1dab4404 PR: 2055
Submitted by: Julia Lawall <julia@diku.dk>
Approved by: steve@openssl.org

Correct BIO_ctrl error handling in s2_srvr.c
2009-10-01 00:07:10 +00:00
Dr. Stephen Henson
29c2fd46d2 PR: 2054
Submitted by: Julia Lawall <julia@diku.dk>
Approved by: steve@openssl.org

Correct BIO_ctrl error handling
2009-10-01 00:03:50 +00:00
Dr. Stephen Henson
a3d5cdb07c PR: 2063
Submitted by: Julia Lawall <julia@diku.dk>
Approved by: steve@openssl.org

Correct BIO_write error handling in ocsp_prn.c
2009-09-30 23:59:16 +00:00
Dr. Stephen Henson
d99c0f6b4a PR: 2057
Submitted by: Julia Lawall <julia@diku.dk>
Approved by: steve@openssl.org

Correct BIO_write, BIO_printf, i2a_ASN1_INTEGER and i2a_ASN1_OBJECT
error handling in OCSP print routines.
2009-09-30 23:55:29 +00:00
Dr. Stephen Henson
43f21e62aa PR: 2058
Submitted by: Julia Lawall <julia@diku.dk>
Approved by: steve@openssl.org

Correct EVP_DigestVerifyFinal error handling.
2009-09-30 23:50:10 +00:00
Dr. Stephen Henson
50425bc137 Change version from 0.9.9 to 1.0.0 in docs 2009-09-30 23:40:52 +00:00
Dr. Stephen Henson
0c690586e0 PR: 2064, 728
Submitted by: steve@openssl.org

Add support for custom headers in OCSP requests.
2009-09-30 21:41:53 +00:00
Dr. Stephen Henson
bc8c5fe58d Free SSL_CTX after BIO 2009-09-30 21:35:26 +00:00
Dr. Stephen Henson
0cc0db32e3 PR: 2050
Submitted by: Michael Tuexen <tuexen@fh-muenster.de>
Approved by: steve@openssl.org

Fix handling of ENOTCONN and EMSGSIZE for dgram BIOs.
2009-09-22 11:34:25 +00:00
Dr. Stephen Henson
d68f7641a3 PR: 2047
Submitted by: David Lee <live4thee@gmail.com>, steve@openssl.org
Approved by: steve@openssl.org

Fix for IPv6 handling in BIO_get_accept_socket().
2009-09-20 16:40:59 +00:00
Dr. Stephen Henson
4fcbaa3dd9 Ooops, missing close quote 2009-09-20 12:47:04 +00:00
Dr. Stephen Henson
5e56584285 Don't use __try+__except unless on VC++ 2009-09-20 12:39:16 +00:00
Dr. Stephen Henson
ca26ccb083 add version info for VC-WIN64I too 2009-09-20 11:39:59 +00:00
Dr. Stephen Henson
3e8b713b06 PR: 2048
Submitted by: john blair <mailtome200420032002@yahoo.com>
Approved by: steve@openssl.org

Add version info in VC-WIN64A too.
2009-09-19 23:01:24 +00:00
Andy Polyakov
13eca7d782 cmll-x86_64.pl: small buglet in CBC subroutine [from HEAD].
PR: 2035
2009-09-17 19:35:49 +00:00
Dr. Stephen Henson
af3d4e1b02 PR: 2039
Submitted by: Robin Seggelmann <seggelmann@fh-muenster.de>
Approved by: steve@openssl.org

DTLS listen bug fix,
2009-09-15 22:48:30 +00:00
Dr. Stephen Henson
80afb40ae3 Submitted by: Julia Lawall <julia@diku.dk>
The functions ENGINE_ctrl(), OPENSSL_isservice(), EVP_PKEY_sign(),
CMS_get1_RecipientRequest() and RAND_bytes() can return <=0 on error fix
so the return code is checked correctly.
2009-09-13 11:27:27 +00:00
Dr. Stephen Henson
3333428b44 PR: 2023
Submitted by: James Beckett <jmb.openssl@nospam.hackery.net>, steve
Approved by: steve@openssl.org

Fix documentation errors in d2i_X509 manual pages.
2009-09-12 23:34:56 +00:00
Dr. Stephen Henson
a131de9bb2 PR: 2025
Submitted by: Tomas Mraz <tmraz@redhat.com>
Approved by: steve@openssl.org

Constify SSL_CIPHER_description
2009-09-12 23:18:09 +00:00
Dr. Stephen Henson
0ddd002f60 PR: 1411
Submitted by: steve@openssl.org

Allow use of trusted certificates in SSL_CTX_use_chain_file()
2009-09-12 23:09:26 +00:00
Dr. Stephen Henson
e7209103e6 PR: 2038
Submitted by: Artem Chuprina <ran@cryptocom.ru>
Approved by: steve@openssl.org

Avoid double call to BIO_free().
2009-09-11 11:03:31 +00:00
Dr. Stephen Henson
53f062d050 PR: 2033
Submitted by: Robin Seggelmann <seggelmann@fh-muenster.de>
Approved by: steve@openssl.org

DTLS listen support.
2009-09-09 17:05:42 +00:00
Dr. Stephen Henson
b5b65403a4 Add new option --strict-warnings to Configure script. This is used to add
in devteam warnings into other configurations.
2009-09-09 16:32:19 +00:00
Dr. Stephen Henson
1a3914fe0c Seed PRNG with DSA and ECDSA digests for additional protection against
possible PRNG state duplication.
2009-09-09 12:14:36 +00:00
Dr. Stephen Henson
b7e3cb31a5 PR: 2031
Submitted by: steve@openssl.org

Tolerate application/timestamp-response which some servers send out.
2009-09-07 17:57:02 +00:00
Dr. Stephen Henson
9769137a43 Typo presumably... 2009-09-06 17:55:40 +00:00
Dr. Stephen Henson
c0688f1aef Make update, deleting bogus DTLS error code 2009-09-06 15:55:54 +00:00
Dr. Stephen Henson
6c29853bf2 PR: 1644
Submitted by: steve@openssl.org

Fix to make DHparams_dup() et al work in C++.

For 1.0 fix the final argument to ASN1_dup() so it is void *. Replace some
*_dup macros with functions.
2009-09-06 15:49:12 +00:00
Dr. Stephen Henson
2e9802b7a7 PR: 2028
Submitted by: Robin Seggelmann <seggelmann@fh-muenster.de>
Approved by: steve@openssl.org

Fix DTLS cookie management bugs.
2009-09-04 17:42:06 +00:00
Dr. Stephen Henson
7483896e15 Correction: salt is now default 2009-09-04 12:27:01 +00:00
Dr. Stephen Henson
4b4f249e0d Oops, s can be NULL 2009-09-04 11:31:19 +00:00
Dr. Stephen Henson
196dcf93bc PR: 2020
Submitted by: Keith Beckman <kbeckman@mcg.edu>,  Tomas Mraz <tmraz@redhat.com>
Checked by: steve@openssl.org

Fix improperly capitalized references to WWW::Curl::Easy.
2009-09-02 15:57:12 +00:00
Dr. Stephen Henson
2c11ec308b PR: 2029
Submitted by: Tomas Mraz <tmraz@redhat.com>
Checked by: steve@openssl.org

Fix so that the legacy digest EVP_dss1() still works.
2009-09-02 15:51:28 +00:00
Dr. Stephen Henson
e5eb96c83a PR: 2013
Submitted by: steve@openssl.org

Include a flag ASN1_STRING_FLAG_MSTRING when a multi string type is created.
This makes it possible to tell if the underlying type is UTCTime,
GeneralizedTime or Time when the structure is reused and X509_time_adj_ex()
can handle each case in an appropriate manner.

Add error checking to CRL generation in ca utility when nextUpdate is being
set.
2009-09-02 13:55:22 +00:00
Dr. Stephen Henson
54ed003ace PR: 2009
Submitted by: "Alexei Khlebnikov" <alexei.khlebnikov@opera.com>
Approved by: steve@openssl.org

Avoid memory leak and fix error reporting in d2i_SSL_SESSION(). NB: although
the ticket mentions buffer overruns this isn't a security issue because
the SSL_SESSION structure is generated internally and it should never be
possible to supply its contents from an untrusted application (this would
among other things destroy session cache security).
2009-09-02 13:20:22 +00:00
Dr. Stephen Henson
f18e10253d PR: 2022
Submitted by: Robin Seggelmann <seggelmann@fh-muenster.de>
Approved by: steve@openssl.org

Fix DTLS record header length bug.
2009-09-02 12:53:32 +00:00
Dr. Stephen Henson
c9add317a9 Tidy up and fix verify callbacks to avoid structure dereference, use of
obsolete functions and enhance to handle new conditions such as policy
printing.
2009-09-02 12:45:19 +00:00
Dr. Stephen Henson
6d1741030b Missing break. 2009-08-31 22:21:01 +00:00
Dr. Stephen Henson
b8dc932c05 PR: 2005
Submitted by: steve@openssl.org

Some systems have broken IPv6 headers and/or implementations. If
OPENSSL_USE_IPV6 is set to 0 IPv6 is not used, if it is set to 1 it is used
and if undefined an attempt is made to detect at compile time by checking
if AF_INET6 is set and excluding known problem platforms.
2009-08-26 15:13:43 +00:00
Dr. Stephen Henson
17f8d8db61 PR: 2006
Submitted by: Robin Seggelmann <seggelmann@fh-muenster.de>
Approved by: steve@openssl.org

Do not use multiple DTLS records for a single user message
2009-08-26 11:51:23 +00:00
Dr. Stephen Henson
38437fa135 PR: 2015
Submitted by: Robin Seggelmann <seggelmann@fh-muenster.de>
Approved by: steve@openssl.org

Define LIBDIR properly.
2009-08-26 11:41:32 +00:00
Richard Levitte
82f35daaaf Moving up the inclusion of e_os.h was a bad idea.
Put it back where it was and place an inclusion of e_os2.h to get platform
macros defined...
2009-08-26 11:21:50 +00:00
Richard Levitte
b529bba4bf Make sure ENGINES can be separately compiled as well.
Make sure _XOPEN_SOURCE_EXTENDED is defined in opensslconf.h

Submitted by Zoltan Arpadffy <zoli@polarhome.com>
2009-08-25 07:30:02 +00:00
Richard Levitte
dde33ea9c3 Remove tmdiff.h from EXHEADERS as it doesn't exist.
Don't have separate installation directory variables for VAX and AXP.

Submitted by Zoltan Arpadffy <zoli@polarhome.com>
2009-08-25 07:28:12 +00:00
Richard Levitte
cb0d89705b Define EXE_DIR earlier.
Make sure S_SOCKET also gets compiled with _POSIX_C_SOURCE defined.

Submitted by Zoltan Arpadffy <zoli@polarhome.com>
2009-08-25 07:25:55 +00:00
Richard Levitte
f49353b42f Move up the inclusion of e_os.h so OPENSSL_SYS_VMS_DECC has a chance
to be properly defined.
2009-08-25 07:23:21 +00:00
Richard Levitte
573c61dcde Make it possible to compile non-assembler routines on AXP as well.
Submitted by Zoltan Arpadffy <arpadffy@polarhome.com>
2009-08-25 07:22:08 +00:00
Richard Levitte
51f38e6c2d Make engines compile on VMS for ia64 as well.
Parse file types in a more secure manner.

Submitted by sms@antinode.info (Steven M. Schweda)
2009-08-25 07:19:20 +00:00
Richard Levitte
2de213732a Correct some typos and missing things.
Submitted by Arpadffy Zoltan <Zoltan.Arpadffy@scientificgames.se>
2009-08-25 07:17:13 +00:00
Richard Levitte
3798c36686 Include proper header files for time functions.
Submitted by Arpadffy Zoltan <Zoltan.Arpadffy@scientificgames.se>
2009-08-25 07:10:09 +00:00
Dr. Stephen Henson
209abea1db Stop unused variable warning on WIN32 et al. 2009-08-18 11:14:12 +00:00
Dr. Stephen Henson
250705e7b5 Use SHA1 and not deprecated MD5 in demos. 2009-08-15 10:51:37 +00:00
Dr. Stephen Henson
5a96822f2c Update default dependency flags.
Make error name discrepancies a fatal error.
Fix error codes.
make update
2009-08-12 17:08:44 +00:00
Dr. Stephen Henson
23b34259e0 Re-enable mdc2 default by default as the patent is now expired. 2009-08-12 16:45:35 +00:00
Dr. Stephen Henson
11b6cb8aae Update README with bug report and contribution details. 2009-08-12 16:41:46 +00:00
Dr. Stephen Henson
a4bade7aac PR: 1997
Submitted by: Robin Seggelmann <seggelmann@fh-muenster.de>
Approved by: steve@openssl.org

DTLS timeout handling fix.
2009-08-12 13:21:26 +00:00
Dr. Stephen Henson
e322b5d167 Typo 2009-08-10 15:53:11 +00:00
Dr. Stephen Henson
01af4edcfe PR: 1999
Submitted by: "Bayram Kurumahmut" <kbayram@ubicom.com>
Approved by: steve@openssl.org

Don't use HAVE_FORK in apps/speed.c it can conflict with configured version.
2009-08-10 15:30:29 +00:00
Dr. Stephen Henson
ff0945cbdc PR: 2004
Submitted by: Peter Sylvester <peter.sylvester@edelweb.fr>
Approved by: steve@openssl.org

Handle fractional seconds properly in ASN1_GENERALIZEDTIME_print
2009-08-10 14:57:11 +00:00
Dr. Stephen Henson
d5ec7d66a8 PR: 2003
Make it possible to install OpenSSL in directories with name other
than "lib" for example "lib64". Based on patch from Jeremy Utley.
2009-08-10 14:42:05 +00:00
Dr. Stephen Henson
dc0aebabe6 Add COMP error strings. 2009-08-09 14:58:05 +00:00
Dr. Stephen Henson
52828ca214 Add missing CHANGES entry. 2009-08-06 16:29:42 +00:00
Dr. Stephen Henson
757e9886a0 Update from HEAD. 2009-08-05 15:52:06 +00:00
Dr. Stephen Henson
f45e8c7bdd PR: 2000
Submitted by: 	Vadim Zeitlin <vz-openssl@zeitlins.org>
Approved by: steve@openssl.org

Make no-comp compile without warnings.
2009-08-05 15:29:14 +00:00
Dr. Stephen Henson
ea904b4074 Update from HEAD. 2009-08-05 15:04:16 +00:00
Dr. Stephen Henson
ec6158d029 PR: 1996
Submitted by: steve@openssl.org

Change conflicting name "BLOCK" to "OPENSSL_BLOCK".
2009-07-27 21:21:25 +00:00
Dr. Stephen Henson
4386445c18 Change STRING to OPENSSL_STRING etc as common words such
as "STRING" cause conflicts with other headers/libraries.
2009-07-27 21:08:53 +00:00
Ben Laurie
a585aa6750 Fix warnings. 2009-07-26 12:26:38 +00:00
Dr. Stephen Henson
2475a52061 Update from 0.9.8-stable. 2009-07-24 13:47:52 +00:00
Dr. Stephen Henson
001dfac061 Remove MD2 test from WIN32 tests. 2009-07-24 13:43:23 +00:00
Dr. Stephen Henson
1b37c55e26 Fix typo. 2009-07-24 13:36:36 +00:00
Dr. Stephen Henson
3442781798 Update TABLE. 2009-07-24 13:29:45 +00:00
Dr. Stephen Henson
c9d3f123a6 Add new debug targets. 2009-07-24 13:29:13 +00:00
Dr. Stephen Henson
d069a4d15d PR: 1990
Update from 0.9.8-stable.
2009-07-24 13:07:08 +00:00
Dr. Stephen Henson
f1ad8fb627 Doc update from HEAD. 2009-07-24 13:02:55 +00:00
Dr. Stephen Henson
d7406b1528 PR: 1993
Fix from 0.9.8-stable.
2009-07-24 11:52:32 +00:00
Dr. Stephen Henson
02ce897e80 Fix from 0.9.8-stable 2009-07-24 11:34:41 +00:00
Dr. Stephen Henson
0bd9d3a60e Update from 0.9.8-stable. 2009-07-24 11:24:45 +00:00
Dr. Stephen Henson
b4c81fb6db Update from 0.9.8-stable 2009-07-24 11:15:55 +00:00
Dr. Stephen Henson
0f566bda2b Update from 0.9.8-stable. 2009-07-24 11:10:57 +00:00
Dr. Stephen Henson
f97a8149cd Update from HEAD. 2009-07-16 09:54:49 +00:00
Dr. Stephen Henson
f4b6a3e9c0 Call CMS tests with "make test" 2009-07-15 17:59:17 +00:00
Dr. Stephen Henson
7dfae89768 Handle OSX ".dynlib" DSO extension. 2009-07-15 17:58:57 +00:00
Dr. Stephen Henson
d41ca3f0e2 Update for next beta. 2009-07-15 12:08:35 +00:00
Dr. Stephen Henson
65fc4c55be Preparation for beta3 release. 2009-07-15 11:37:45 +00:00
Dr. Stephen Henson
5135d6b985 Fix error codes and indentation. 2009-07-15 11:32:58 +00:00
Dr. Stephen Henson
2202edeff0 PR: 1980
Submitted by: Victor Wagner <vitus@wagner.pp.ru>
Approved by: steve@openssl.org

Fix memory leaks.
2009-07-15 11:01:40 +00:00
Dr. Stephen Henson
c8f759ec74 Stop warning of signed/unsigned compare. 2009-07-14 15:28:44 +00:00
Dr. Stephen Henson
5fda10c6f1 Oops, use right function name... 2009-07-14 15:14:39 +00:00
Dr. Stephen Henson
11ba084e1b Document MD2 deprecation. 2009-07-13 11:57:15 +00:00
Dr. Stephen Henson
cddd00166c PR: 1984
Submitted by: Michael Tüxen <Michael.Tuexen@lurchi.franken.de>
Approved by: steve@openssl.org

Don't concatenate reads in DTLS.
2009-07-13 11:44:04 +00:00
Dr. Stephen Henson
0190aa7353 Update from HEAD. 2009-07-13 11:40:46 +00:00
Dr. Stephen Henson
1546de87f0 Fix from 0.9.8-stable. 2009-07-11 22:36:27 +00:00
Dr. Stephen Henson
affffaed3d Update from HEAD. 2009-07-11 22:30:02 +00:00
Dr. Stephen Henson
0c644f1462 PR: 1985
Submitted by: Artem Chuprina <ran@cryptocom.ru>
Approved by: steve@openssl.org

Initialise flags.
2009-07-11 21:42:47 +00:00
Dr. Stephen Henson
a2da5c7daa Make update. 2009-07-08 09:13:24 +00:00
Dr. Stephen Henson
c155d83f5b Delete MD2 from algorithm tables and default compilation. 2009-07-08 08:50:53 +00:00
Dr. Stephen Henson
5a03e3ac3f Fix from HEAD. 2009-07-04 12:05:14 +00:00
Dr. Stephen Henson
08b2097967 Update from HEAD. 2009-07-04 11:44:01 +00:00
Dr. Stephen Henson
15401859b5 PR: 1976
Submitted by: David McCullough <david_mccullough@securecomputing.com>
Approved by: steve@openssl.org

Cleanup some compile time warnings/magic numbers.
2009-07-01 15:46:43 +00:00
Dr. Stephen Henson
6f24165170 PR: 1974(partial)
Submitted by: David McCullough <david_mccullough@securecomputing.com>
Approved by: steve@openssl.org

Cryptodev digest support.
2009-07-01 15:42:38 +00:00
Dr. Stephen Henson
a8afd9382c 192, 256 bit AES and RC4 support for cryptodev. 2009-07-01 15:36:55 +00:00
Dr. Stephen Henson
caddf00d78 PR: 1974(partial)
Submitted by: David McCullough <david_mccullough@securecomputing.com>
Approved by: steve@openssl.org

Fix up RSA API compliance for rsa_nocrt_mod_exp method.
2009-07-01 15:25:17 +00:00
Dr. Stephen Henson
e105098b3f PR: 1974 (partial)
Submitted by: David McCullough <david_mccullough@securecomputing.com>
Approved by: steve@openssl.org

If -DHAVE_CRYPTODEV is set enable cryptodev support
2009-07-01 14:55:59 +00:00
Dr. Stephen Henson
9852e7e4d7 PR: 1972
Submitted by: David McCullough <david_mccullough@securecomputing.com>
Approved by: steve@openssl.org

Add support for building with the uClinux-dist.
2009-07-01 11:43:57 +00:00
Dr. Stephen Henson
b855560192 PR: 1970
Submitted by: David McCullough <david_mccullough@securecomputing.com>
Reviewed by: steve@openssl.org

Fix unused variable "words" and uninitialised data "b".
2009-07-01 11:39:59 +00:00
Dr. Stephen Henson
f2f50efea3 PR: 1965
Submitted by: David McCullough <david_mccullough@securecomputing.com>
Approved by: steve@openssl.org

Make sure defines to remove SHA are correct.
2009-07-01 11:35:46 +00:00
Dr. Stephen Henson
2b3cd246e5 PR: 1962
Submitted by: Daniel Mentz <daniel.m@sent.com>
Reviewed by: steve@openssl.org

Fix "for dtls1_get_record() returns a bad record in one edge case" bug.
2009-07-01 11:29:01 +00:00
Dr. Stephen Henson
7171ade2c2 Submitted by: "Victor B. Wagner" <vitus@cryptocom.ru>
Reviewed by: steve@openssl.org

EVP_CTRL_PBE_PRF_NID suppot for Gost engine.
2009-07-01 11:23:07 +00:00
Dr. Stephen Henson
76ec9151d1 Update from 0.9.8-stable. 2009-06-30 22:26:28 +00:00
Dr. Stephen Henson
6c24dd9005 Typo. 2009-06-30 20:55:55 +00:00
Dr. Stephen Henson
e323afb0ce Update from HEAD. 2009-06-30 16:10:24 +00:00
Dr. Stephen Henson
1fd43fd86e PR: 1969
Submitted by: David McCullough <david_mccullough@securecomputing.com>
Approved by: steve@openssl.org

Don't use repeating key when testing algs.
2009-06-30 15:21:48 +00:00
Dr. Stephen Henson
3e70c81ed9 PR: 1967
Submitted by: David McCullough <david_mccullough@securecomputing.com>
Approved by: steve@openssl.org

Don't go past end of params array.
2009-06-30 15:10:54 +00:00
Dr. Stephen Henson
6e07229564 PR: 1966
Submitted by: David McCullough <david_mccullough@securecomputing.com>
Reviewed by: steve@openssl.org

Make no-ocsp work properly.
2009-06-30 15:08:38 +00:00
Dr. Stephen Henson
859d5eb2d7 PR: 1963
Submitted by: David McCullough <david_mccullough@securecomputing.com>
Approved by: steve@openssl.org

Make build fail if makedepend not present.
2009-06-30 14:59:59 +00:00
Dr. Stephen Henson
29b0c4a01c Add "missing" functions for setting all verify parameters for SSL_CTX and SSL
structures.
2009-06-30 11:57:24 +00:00
Dr. Stephen Henson
b824f0f458 Redundant check: s->param is always non-NULL, it is set in SSL_new(). 2009-06-30 11:41:35 +00:00
Dr. Stephen Henson
43ea53a04a Inherit parameters properly in SSL contexts: any parameters set should
replace those in the current list.
2009-06-30 11:21:00 +00:00
Dr. Stephen Henson
fa07f00aaf Update from HEAD. 2009-06-29 16:09:58 +00:00
Dr. Stephen Henson
dbb834ffeb Update from 0.9.8-stable. 2009-06-28 16:24:11 +00:00
Dr. Stephen Henson
8549a8a5dc Fix from 0.9.8-stable 2009-06-26 23:14:11 +00:00
Dr. Stephen Henson
887c250852 Update from 0.9.8-stable. 2009-06-26 15:04:22 +00:00
Dr. Stephen Henson
710c1c34d1 Allow checking of self-signed certifictes if a flag is set. 2009-06-26 11:28:52 +00:00
Dr. Stephen Henson
e16818108f Fix from HEAD. 2009-06-25 17:11:48 +00:00
Dr. Stephen Henson
0cb76e79df PR: 1748
Fix nasty SSL BIO pop bug. Since this changes the behaviour of SSL BIOs and
will break applications that worked around the bug only included in 1.0.0 and
later.
2009-06-25 11:26:45 +00:00
Ben Laurie
6cb419673e DEBUG_BN_CTX doesn't really debug anything (it is essentially verbosity) and
has made make test far too noisy.
2009-06-25 10:15:06 +00:00
Dr. Stephen Henson
72d668c332 Update from HEAD. 2009-06-24 13:30:07 +00:00
Dr. Stephen Henson
5ce4799a38 Update from HEAD. 2009-06-17 12:19:35 +00:00
Dr. Stephen Henson
6178da0142 Update from HEAD. 2009-06-17 12:05:51 +00:00
Dr. Stephen Henson
27713e3fc2 Check t too. 2009-06-17 11:47:54 +00:00
Dr. Stephen Henson
3492c47b18 Update from HEAD. 2009-06-17 11:38:26 +00:00
Dr. Stephen Henson
43dc001b62 Update from HEAD. 2009-06-17 11:33:17 +00:00
Dr. Stephen Henson
8280b43a62 Update from HEAD. 2009-06-17 11:26:09 +00:00
Dr. Stephen Henson
85d9b02d16 Update from HEAD. 2009-06-16 16:55:01 +00:00
Dr. Stephen Henson
bfd502f027 Updates from HEAD. 2009-06-16 16:39:20 +00:00
Dr. Stephen Henson
f1ed5fa827 Update from 0.9.8-stable. 2009-06-15 15:00:19 +00:00
Dr. Stephen Henson
5bb9e1b4d4 Update from HEAD. 2009-06-15 11:23:33 +00:00
Ben Laurie
7de819237d Two digits is not wide enough. 2009-06-14 10:23:29 +00:00
Ben Laurie
6cfab29b71 Make depend. 2009-06-14 02:37:22 +00:00
Dr. Stephen Henson
55708796af Update from HEAD. 2009-06-13 20:47:09 +00:00
Dr. Stephen Henson
7074f1df07 Stop gcc bracket warning. 2009-06-05 14:57:10 +00:00
Dr. Stephen Henson
67d8ab07e6 Stop warning if dtls disabled. 2009-06-05 14:56:48 +00:00
Dr. Stephen Henson
4e63da0669 PR: 1950
Submitted by: Robin Seggelmann <seggelmann@fh-muenster.de>
Reviewed by: steve@openssl.org

DTLS fragment retransmission bug.
2009-06-05 14:46:49 +00:00
Ben Laurie
15b0a5651c Not always used. 2009-06-05 08:35:54 +00:00
Dr. Stephen Henson
4e66723517 Update from HEAD. 2009-06-02 11:23:30 +00:00
Dr. Stephen Henson
3e53c86001 Update from HEAD. 2009-06-02 11:06:28 +00:00
Dr. Stephen Henson
524e5b844b Update from HEAD. 2009-06-01 12:14:15 +00:00
Dr. Stephen Henson
e1f09dfd84 PR: 1921
Submitted by: Michael Tuexen <tuexen@fh-muenster.de>
Reviewed by: steve@openssl.org

Add ECDHE and PSK support to DTLS.
2009-05-31 17:11:24 +00:00
Dr. Stephen Henson
f16411ccfd Ensure canonical encodings of X509_NAME structures are valid. 2009-05-30 18:10:59 +00:00
Dr. Stephen Henson
2bbcd45b05 Update from HEAD. 2009-05-29 18:58:59 +00:00
Dr. Stephen Henson
fdc6c6ef08 Update from 0.9.8-stable. 2009-05-29 14:02:30 +00:00
Dr. Stephen Henson
6e87cc8da6 Need definition of struct timeval for dtls1.h which broke WIN32 builds,
so include winsock.h. (might be a cleaner way to do this...)
2009-05-28 20:53:16 +00:00
Dr. Stephen Henson
2d0b6c72b8 Update ordinals and sync with 0.9.8 2009-05-28 20:49:29 +00:00
Dr. Stephen Henson
3e84046f90 make errors 2009-05-28 20:45:26 +00:00
Dr. Stephen Henson
cc1cb996f1 Submitted by: Artem Chuprina <ran@cryptocom.ru>
Reviewed by: steve@openssl.org

Fix to match latest GOST in TLS draft.
2009-05-28 18:10:47 +00:00
Dr. Stephen Henson
32fbeacdfb Add CHANGES entries from 0.9.8-stable. 2009-05-18 17:37:13 +00:00
Dr. Stephen Henson
431aad3c15 Delete line which should have gone with PR#1922. 2009-05-18 16:11:58 +00:00
Dr. Stephen Henson
0454f2c490 PR: 1929
Submitted by: Michael Tuexen <tuexen@fh-muenster.de>
Approved by: steve@openssl.org

Updated DTLS MTU bug fix.
2009-05-17 16:04:21 +00:00
Dr. Stephen Henson
5f911774bf Revert previous MTU patch from PR#1929 2009-05-17 15:57:51 +00:00
Dr. Stephen Henson
66b7e42790 PR: 1599
Reformat PKCS12_parse manual page, document return values.
2009-05-17 14:48:02 +00:00
Richard Levitte
6a419388fc Stupid typo 2009-05-17 07:22:15 +00:00
Dr. Stephen Henson
abda7c1147 PR: 1931
Submitted by: Robin Seggelmann <seggelmann@fh-muenster.de>
Approved by: steve@openssl.org

Fix fragment handling memory leak.
2009-05-16 16:22:11 +00:00
Dr. Stephen Henson
88b48dc680 PR: 1930
Submitted by: Robin Seggelmann <seggelmann@fh-muenster.de>
Approved by: steve@openssl.org

Limit size of DTLS record buffer queue.
2009-05-16 16:17:46 +00:00
Dr. Stephen Henson
661d35dfb2 Disable ECDHE in DTLS in a cleaner way. 2009-05-16 11:16:15 +00:00
Dr. Stephen Henson
f99c9daa39 Make the stuff compile again, fix missing prototype warnings. 2009-05-16 11:14:55 +00:00
Dr. Stephen Henson
019b3f3e5a Update from HEAD. 2009-05-15 23:07:41 +00:00
Dr. Stephen Henson
d6584eba8c PR: 1922
Submitted by: Robin Seggelmann <seggelmann@fh-muenster.de>
Approved by: steve@openssl.org

DTLS Timer bug fix.
2009-05-15 22:58:13 +00:00
Dr. Stephen Henson
a379c433a3 PR: 1925
Submitted by: "Green, Paul" <Paul.Green@stratus.com>
Approved by: steve@openssl.org

VOS extended name support.
2009-05-15 22:50:12 +00:00
Richard Levitte
006c7c6bb1 Functional VMS changes submitted by sms@antinode.info (Steven M. Schweda).
Thank you\!
(note: not tested for now, a few nightly builds should give indications though)
2009-05-15 16:37:08 +00:00
Richard Levitte
bd4a902a15 Have mkdef.pl also handle VAX and Non-VAX differences for VMS 2009-05-15 16:01:42 +00:00
Richard Levitte
17ae5e9f13 Add a comment about libeay.num and ssleay.num 2009-05-15 16:00:08 +00:00
Andy Polyakov
baa5f52422 x86[_64]cpuid.pl: update from HEAD. 2009-05-14 18:25:29 +00:00
Dr. Stephen Henson
b3620451b2 PR: 1921
Submitted by: steve@openssl.org

Our DTLS implementation doesn't currently handle ECDHE so don't include
unsupported ciphers in client hello.
2009-05-13 16:25:35 +00:00
Dr. Stephen Henson
d2f17d9615 Print out DTLS versions too. 2009-05-13 16:24:12 +00:00
Dr. Stephen Henson
561cbe5678 PR: 1923
Submitted by: Daniel Mentz <daniel.m@sent.com>, Robin Seggelmann <seggelmann@fh-muenster.de>
Approved by: steve@openssl.org

Don't access freed data structure.
2009-05-13 11:51:30 +00:00
Dr. Stephen Henson
756d2074b8 PR: 1924
Submitted by: "Green, Paul" <Paul.Green@stratus.com>
Approved by: steve@openssl.org

Fix _POSIX_C_SOURCE usage.
2009-05-13 11:32:24 +00:00
Andy Polyakov
c65db618bb e_padlock.c: update from HEAD. 2009-05-12 20:24:23 +00:00
Dr. Stephen Henson
8355647403 Typo. 2009-05-07 16:26:44 +00:00
Dr. Stephen Henson
b839d73411 Typo. 2009-05-06 16:58:27 +00:00
Dr. Stephen Henson
4563c1e043 Add debug-VC-WIN32 target and let mk1mf.pl auto detect it, update docs. 2009-05-06 16:54:25 +00:00
Richard Levitte
11f35a036d Select updates from HEAD 2009-05-06 14:03:24 +00:00
Dr. Stephen Henson
d8646dab14 Don't use -D_CRT_NONSTDC_NO_DEPRECATE, fix bio_lcl.h instead. 2009-05-06 10:23:39 +00:00
Andy Polyakov
47b3cd98f2 Configure: update from HEAD (Camellia assembler in VC-WIN64A, CAPI engine
in mingw64).
2009-05-05 19:25:53 +00:00
Andy Polyakov
27c7e53882 ec_mult.c: update from HEAD (Win64 compile warnings). 2009-05-05 19:23:45 +00:00
Andy Polyakov
b2b28803fb cryptlib.c: update from HEAD. 2009-05-05 19:23:14 +00:00
Andy Polyakov
8e92b1b9ce perlasm: update from HEAD. 2009-05-05 19:21:12 +00:00
Andy Polyakov
0f41ccf370 e_capi.c: update from HEAD. 2009-05-05 19:17:00 +00:00
Richard Levitte
c44544a1d7 Update from HEAD 2009-05-05 08:46:30 +00:00
Dr. Stephen Henson
4e50f02638 If an SSLv2 method is explicitly asked for use the SSLv2 cipher string:
assume an application *really* wants SSLv2 if they do that.

Otherwise stick with the default which excludes all SSLv2 cipher suites.
2009-04-29 14:12:54 +00:00
Dr. Stephen Henson
174ea15647 Typo. 2009-04-28 22:35:42 +00:00
Dr. Stephen Henson
18f8258a87 PR: 1629
Submitted by: Kaspar Brand <ossl-rt@velox.ch>
Approved by: steve@openssl.org

Don't use extensions if using SSLv3: this chokes some broken servers.
2009-04-28 22:01:53 +00:00
Dr. Stephen Henson
376bbb5887 PR: 1914
Make safestack work with C++.
2009-04-28 21:56:04 +00:00
Richard Levitte
2c8275409e Update from HEAD. 2009-04-28 13:00:50 +00:00
Andy Polyakov
892582b541 v3_alt.c: otherName parsing fix from HEAD.
Submitted by: Love Hoernquist Aastrand
2009-04-27 19:37:23 +00:00
Andy Polyakov
57b53c1b0a VC-32.pl: update from HEAD. 2009-04-27 19:32:13 +00:00
Andy Polyakov
004c3ca521 test_padlock: update from HEAD. 2009-04-27 19:31:52 +00:00
Andy Polyakov
f0f00f9272 sha*-s390x.pl: minor update from HEAD. 2009-04-27 19:31:30 +00:00
Andy Polyakov
a243c68736 rc4-x86_64.pl: Win64 SEH update from HEAD. 2009-04-27 19:31:04 +00:00
Andy Polyakov
467d9f2a34 b_sock.c: readability update from HEAD. 2009-04-27 19:30:36 +00:00
Richard Levitte
226a94963a Updates from HEAD 2009-04-27 00:08:50 +00:00
Dr. Stephen Henson
d7f0d147b1 Update docs: can use backslashes now. 2009-04-26 15:50:55 +00:00
Dr. Stephen Henson
26902b9aad Prevent warning if WINCE not used. 2009-04-26 15:04:06 +00:00
Dr. Stephen Henson
3c69d6bec4 Add extra no deprecate flags in Configure. 2009-04-26 14:54:23 +00:00
Dr. Stephen Henson
4f44677a41 This at least break WIN32 which doesn't have sys/time.h might need to make
this a bit more generous later...
2009-04-26 14:53:58 +00:00
Richard Levitte
88d9f669c5 Add local symbol hacks for OpenVMS 2009-04-26 12:26:04 +00:00
Richard Levitte
22e1421672 Cast to avoid signedness confusion 2009-04-26 12:16:12 +00:00
Richard Levitte
5409414eff Updates from HEAD 2009-04-26 11:35:58 +00:00
Dr. Stephen Henson
7134507de0 Make no-rsa, no-dsa and no-dh compile again. 2009-04-23 17:16:40 +00:00
Dr. Stephen Henson
fe41d9853c Make no-ec work 2009-04-23 16:25:00 +00:00
Dr. Stephen Henson
d07692cd96 Make no-gost work properly. 2009-04-23 16:12:09 +00:00
Dr. Stephen Henson
82ae57136b Some no-ec fixes (not complete yet). 2009-04-23 15:24:27 +00:00
Dr. Stephen Henson
30baeaaeab CryptoAPI engine only exists on WIN32. 2009-04-22 17:36:45 +00:00
Dr. Stephen Henson
87a0f4b92e PR: 1902
Add ecdsa/ecdh algorithms to default for speed utility.
2009-04-22 17:31:04 +00:00
Dr. Stephen Henson
1b08bcbfe3 Find openssl utility if on the PATH. 2009-04-22 16:50:42 +00:00
Dr. Stephen Henson
346b1001eb PR: 1903
Submitted by: "Paul Smedley" <pauldespam@despamsmedley.id.au>
Approved by: steve@openssl.org

OS/2 fixes (excludes Makefile.shared patch for now).
2009-04-22 16:21:20 +00:00
Dr. Stephen Henson
b61a84c8e6 Fix WIN32 warnings. 2009-04-22 15:40:54 +00:00
Dr. Stephen Henson
a543ea44bc Fix WIN32 warning. 2009-04-22 12:17:02 +00:00
Dr. Stephen Henson
b0dd3d1b94 Another kerberos fix. 2009-04-21 22:30:54 +00:00
Dr. Stephen Henson
461be68b75 Change version to beta3-dev 2009-04-21 22:27:41 +00:00
Dr. Stephen Henson
21fb688d26 Some fixes for kerberos builds. 2009-04-21 22:20:12 +00:00
Dr. Stephen Henson
d8faad27b7 Fix RFC num. 2009-04-21 15:42:01 +00:00
Dr. Stephen Henson
dab7075946 Update STATUS. 2009-04-21 15:19:15 +00:00
Dr. Stephen Henson
dfc8e96daa Fix warning. 2009-04-21 15:11:59 +00:00
Dr. Stephen Henson
71d3eaf358 make update. 2009-04-21 15:02:20 +00:00
Dr. Stephen Henson
ef6b25be63 Beta 2 preparation. 2009-04-21 14:58:57 +00:00
Dr. Stephen Henson
b452f43322 PR: 1751
Submitted by: David Woodhouse <dwmw2@infradead.org>
Approved by: steve@openssl.org

Compatibility patches for Cisco VPN client DTLS.
2009-04-19 18:03:13 +00:00
Dr. Stephen Henson
52891f832f Fix error header files and error files too. 2009-04-19 17:58:01 +00:00
Dr. Stephen Henson
9990cb75c1 PR: 1894
Submitted by: Ger Hobbelt <ger@hobbelt.com>
Approved by: steve@openssl.org

Fix various typos and stuff.
2009-04-16 17:22:51 +00:00
Dr. Stephen Henson
a5cc69c7ae PR: 1900
Submitted by: Robin Seggelmann <seggelmann@fh-muenster.de>
Approved by: steve@openssl.org

Remove unnecessary included header file.
2009-04-16 16:42:02 +00:00
Dr. Stephen Henson
0b4b8ba64e PR: 1895
Submitted by: Ger Hobbelt <ger@hobbelt.com>
Approved by: steve@openssl.org

Updates to mkerr.pl script.
2009-04-15 15:16:29 +00:00
Dr. Stephen Henson
268e78c305 PR: 1899
Submitted by: Ger Hobbelt <ger@hobbelt.com>
Approved by: steve@openssl.org

Check for <= 0 when verifying CRL issuers.
2009-04-15 15:07:09 +00:00
Dr. Stephen Henson
c900a78c99 PR: 1828
Submitted by: Robin Seggelmann <seggelmann@fh-muenster.de>
Approved by: steve@openssl.org

Updated DTLS Rentransmission bug patch.
2009-04-15 14:49:36 +00:00
Dr. Stephen Henson
46ffb2dc97 PR #1828 reverted: state save/restore incompatible with 1.0.0-stable. 2009-04-14 15:29:34 +00:00
Dr. Stephen Henson
10acacb3bf Fix typo and stop WIN32 warnings. 2009-04-14 15:13:35 +00:00
Dr. Stephen Henson
aab790a656 PR: 1829
Submitted by: Robin Seggelmann <seggelmann@fh-muenster.de>
Approved by: steve@openssl.org

DTLS Timer Bug fix.
2009-04-14 14:33:12 +00:00
Dr. Stephen Henson
1319aad994 PR: 1647
Submitted by: Robin Seggelmann <seggelmann@fh-muenster.de>
Approved by: steve@openssl.org

Update patch for PR#1647.
2009-04-14 14:22:26 +00:00
Dr. Stephen Henson
3c0ce01cea PR: 1827
Submitted by: Robin Seggelmann <seggelmann@fh-muenster.de>
Approved by: steve@openssl.org

Updated patch for PR #1827
2009-04-14 14:20:57 +00:00
Dr. Stephen Henson
9fcbefebdb PR: 1828
Submitted by: Robin Seggelmann <seggelmann@fh-muenster.de>
Approved by: steve@openssl.org

Update from 0.9.8-stable.
2009-04-14 14:19:46 +00:00
Dr. Stephen Henson
017d2a887f PR: 1838
Submitted by: Robin Seggelmann <seggelmann@fh-muenster.de>
Approved by: steve@openssl.org

Updated patch from 0.9.8-stable.
2009-04-14 14:18:16 +00:00
Dr. Stephen Henson
0416482605 Make update. 2009-04-13 11:40:00 +00:00
Dr. Stephen Henson
0f17424918 PR: 1786
Submitted by: Ger Hobbelt <ger@hobbelt.com>
Approved by: steve@openssl.org

Add missing IMPLEMENT.
2009-04-13 11:36:19 +00:00
Dr. Stephen Henson
55ed10db21 PR: 1785
Submitted by: Ger Hobbelt <ger@hobbelt.com>
Approved by: steve@openssl.org

Properly handle malloc failure.
2009-04-13 11:31:22 +00:00
Dr. Stephen Henson
3877b6bfe9 PR: 1896
Submitted by: Ger Hobbelt <ger@hobbelt.com>
Approved by: steve@openssl.org

Remove double sk_*_free() definition and add missing definition to mkstack.pl
2009-04-13 11:26:31 +00:00
Dr. Stephen Henson
a0f32454b6 PR: 1898
Submitted by: Ger Hobbelt <ger@hobbelt.com>
Approved by: steve@openssl.org

Include correct headers in selftest.pl generated code.
2009-04-13 11:22:55 +00:00
Dr. Stephen Henson
6fda4d7e5d PR: 1887
Submitted by: "Victor B. Wagner" <vitus@cryptocom.ru>
Approved by: steve@openssl.org

Document/clarify use of some options and include details of GOST algorihthm
usage.
2009-04-10 16:42:28 +00:00
Dr. Stephen Henson
36a252ea46 Typo. 2009-04-10 11:35:31 +00:00
Dr. Stephen Henson
a31a195246 PR: 1887 (part, modified)
Submitted by: "Victor B. Wagner" <vitus@cryptocom.ru>
Approved by: steve@openssl.org

Use correct command names in -engine description and fix typo.
2009-04-10 11:25:54 +00:00
Dr. Stephen Henson
5f590d2218 PR: 1887 (part)
Submitted by: "Victor B. Wagner" <vitus@cryptocom.ru>
Approved by: steve@openssl.org

Added error codes for ccgost.
2009-04-10 11:07:35 +00:00
Dr. Stephen Henson
791b7bc715 Fix usage messages and lookup digests later in req command.
(part of PR #1887)
2009-04-10 11:00:12 +00:00
Dr. Stephen Henson
19ae090787 Print out registered digest names in dgst utility instead of hard
coding them. Modify EVP_MD_do_all() to include registered digest name.

This is a modified version of part of PR#1887.
2009-04-10 10:30:27 +00:00
Dr. Stephen Henson
db3076621b PR: 1892
Fix memory leak when email:move option used.
2009-04-08 15:58:07 +00:00
Dr. Stephen Henson
9ae5743515 Disable SSLv2 cipher suites by default and avoid SSLv2 compatible client
hello if no SSLv2 cipher suites are included. This effectively disables
the broken SSLv2 use by default.
2009-04-07 17:01:07 +00:00
Dr. Stephen Henson
c184b140df Update from 0.9.8-stable. 2009-04-07 16:30:32 +00:00
Dr. Stephen Henson
9d80aa7e3f Update from 0.9.8-stable 2009-04-07 12:10:59 +00:00
Dr. Stephen Henson
15671a90a9 PR: 1677
Submitted by: Vennemann <rvennemann@cool.ms>
Approved by: steve@openssl.org

Call RSA_new() after ENGINE has been set up.
2009-04-06 21:42:11 +00:00
Dr. Stephen Henson
0048464449 Use basename of objxref.pl not whole path in generated header. 2009-04-06 16:16:23 +00:00
Dr. Stephen Henson
b422166ce0 Updates from HEAD. 2009-04-06 16:02:51 +00:00
Dr. Stephen Henson
81be661ae2 PR: 1626
Submitted by: Cerutti Pietro <pietro.cerutti@bfh.ch>

Fix manual page.
2009-04-06 15:16:41 +00:00
Dr. Stephen Henson
8681c66eec PR: 1890
Submitted by: "Green, Paul" <Paul.Green@stratus.com>
Approved by: steve@openssl.org

Fixes to --with-zlib-include and --with-zlib-lib and init PRNG for VOS.
2009-04-06 14:31:36 +00:00
Dr. Stephen Henson
69a0034e50 PR: 1899
Submitted by: Doug Kaufman <dkaufman@rahul.net>
Approved by: steve@openssl.org

Mingw fixes.
2009-04-06 14:25:02 +00:00
Dr. Stephen Henson
c9a1778134 Fix error codes. 2009-04-05 11:54:34 +00:00
Dr. Stephen Henson
326794e9c6 Change default openssl.cnf to only use issuer+serial option in AKID if no
SKID.
2009-04-04 18:09:43 +00:00
Dr. Stephen Henson
2dd5ca1fbc Make no-ssl2 work including on Win32 builds. 2009-04-04 17:57:34 +00:00
Ben Laurie
3042945ac8 Fix warning. 2009-04-04 13:39:48 +00:00
Dr. Stephen Henson
da29b0d335 Fix for VC++ 6 which chokes on the empty argument. 2009-04-04 11:44:48 +00:00
Dr. Stephen Henson
6abbc68188 PR: 1870
Submitted by: kilroy <kilroy@mail.zutom.sk>
Approved by: steve@openssl.org

Handle pkcs12 format correctly by not assuming PEM format straight away.
2009-04-03 17:06:35 +00:00
Dr. Stephen Henson
25f6c7fd8b Update from 0.9.8-stable. 2009-04-03 16:54:37 +00:00
Dr. Stephen Henson
1cf3571ea4 PR: 1888
Submitted by: Tim Rice <tim@multitalents.net>
Approved by: steve@openssl.org

Allow SOCKLEN_T type to be overridden at config time e.g.
./config -DSOCKLEN_T=int
2009-04-03 16:44:40 +00:00
Dr. Stephen Henson
d769e7a58c PR: 1613
Submitted by: "Jean Rebiffe" <jrebiffe@gmail.com>
Approved by: steve@openssl.org

Free section.
2009-04-03 16:21:01 +00:00
Dr. Stephen Henson
fa3619f233 Update version info, fix typo. 2009-04-03 11:50:59 +00:00
Dr. Stephen Henson
a414cbcad3 Update from 0.9.8-stable. 2009-04-03 11:37:47 +00:00
Dr. Stephen Henson
c6196da587 Update from 0.9.8-stable. 2009-04-02 22:28:52 +00:00
Dr. Stephen Henson
5d48762647 Make PKCS12_parse() handle some PKCS#12 files which have their own ideas
about settings for local key id...
2009-04-02 17:44:50 +00:00
Dr. Stephen Henson
77e749405d Fix demo program. 2009-04-02 17:39:25 +00:00
Dr. Stephen Henson
9ccd4e224f Add USE_SOCKETS. 2009-04-02 15:19:03 +00:00
Dr. Stephen Henson
1dad4f3672 PR: 1882
Submitted by: Corinna Vinschen <vinschen@redhat.com>
Approved by: steve@openssl.org

Typo.
2009-04-02 15:04:01 +00:00
Dr. Stephen Henson
59745556b4 Add another one... 2009-04-01 15:22:00 +00:00
Dr. Stephen Henson
fab4447179 PR: 1880
Document -ocsp_uri command line switch to x509 utility.
2009-04-01 15:06:28 +00:00
Dr. Stephen Henson
417b8d4705 PR:1880
Load config in ts utility.
2009-04-01 14:59:18 +00:00
Dr. Stephen Henson
e614ec4769 Update README. 2009-04-01 08:57:37 +00:00
Dr. Stephen Henson
a6b03f4138 Make update fixing duplicate ASN1 error codes. 2009-04-01 08:55:54 +00:00
Dr. Stephen Henson
809fa4cc59 Update for first beta. 2009-04-01 08:47:28 +00:00
Dr. Stephen Henson
463f448595 Win32 build fixes. 2009-03-31 22:04:25 +00:00
Dr. Stephen Henson
5cd0cf8cce Fix other read call too. 2009-03-31 21:57:26 +00:00
Dr. Stephen Henson
49cb959494 Use OPENSSL_SYS_WIN32 instead of _WIN32 2009-03-31 21:45:29 +00:00
Dr. Stephen Henson
783a73c47f Oops. 2009-03-31 21:39:54 +00:00
Dr. Stephen Henson
99bf516908 Add update from 0.9.8-stable branch. 2009-03-31 21:35:55 +00:00
Dr. Stephen Henson
a26c372cfc Fix shlib version. 2009-03-31 21:21:42 +00:00
Dr. Stephen Henson
ed5ac22e5b Correct version. 2009-03-31 21:19:17 +00:00
cvs2svn
3d11b8f896 This commit was manufactured by cvs2svn to create branch
'OpenSSL_1_0_0-stable'.
2009-03-31 19:54:52 +00:00
753 changed files with 24085 additions and 13204 deletions

109
.gitignore vendored Normal file
View File

@@ -0,0 +1,109 @@
# Object files
*.o
*.obj
# editor artefacts
*.swp
.#*
#*#
*~
# Top level excludes
/Makefile.bak
/Makefile
/*.a
/include
/*.pc
/rehash.time
# Most *.c files under test/ are symlinks
/test/*.c
# Apart from these
!/test/asn1test.c
!/test/methtest.c
!/test/dummytest.c
!/test/igetest.c
!/test/r160test.c
!/test/fips_algvs.c
/test/*.ss
/test/*.srl
/test/.rnd
/test/test*.pem
/test/newkey.pem
# Certificate symbolic links
*.0
# Links under apps
/apps/CA.pl
/apps/md4.c
# Auto generated headers
/crypto/buildinf.h
/crypto/opensslconf.h
# Auto generated assembly language source files
*.s
!/crypto/bn/asm/pa-risc2.s
!/crypto/bn/asm/pa-risc2W.s
crypto/aes/asm/a_win32.asm
crypto/bf/asm/b_win32.asm
crypto/bn/asm/bn_win32.asm
crypto/bn/asm/co_win32.asm
crypto/bn/asm/mt_win32.asm
crypto/cast/asm/c_win32.asm
crypto/cpu_win32.asm
crypto/des/asm/d_win32.asm
crypto/des/asm/y_win32.asm
crypto/md5/asm/m5_win32.asm
crypto/rc4/asm/r4_win32.asm
crypto/rc5/asm/r5_win32.asm
crypto/ripemd/asm/rm_win32.asm
crypto/sha/asm/s1_win32.asm
crypto/sha/asm/sha512-sse2.asm
# Executables
/apps/openssl
/test/sha256t
/test/sha512t
/test/*test
/test/fips_aesavs
/test/fips_desmovs
/test/fips_dhvs
/test/fips_drbgvs
/test/fips_dssvs
/test/fips_ecdhvs
/test/fips_ecdsavs
/test/fips_rngvs
/test/fips_test_suite
*.so*
*.dylib*
*.dll*
# Exceptions
!/test/bctest
!/crypto/des/times/486-50.sol
# Misc auto generated files
/tools/c_rehash
/test/evptests.txt
lib
Makefile.save
*.bak
tags
TAGS
# Windows
/tmp32dll
/tmp32dll.dbg
/out32dll
/out32dll.dbg
/inc32
/MINFO
ms/bcb.mak
ms/libeay32.def
ms/nt.mak
ms/ntdll.mak
ms/ssleay32.def
ms/version32.rc

30
ACKNOWLEDGMENTS Normal file
View File

@@ -0,0 +1,30 @@
The OpenSSL project depends on volunteer efforts and financial support from
the end user community. That support comes in the form of donations and paid
sponsorships, software support contracts, paid consulting services
and commissioned software development.
Since all these activities support the continued development and improvement
of OpenSSL we consider all these clients and customers as sponsors of the
OpenSSL project.
We would like to identify and thank the following such sponsors for their past
or current significant support of the OpenSSL project:
Major support:
Qualys http://www.qualys.com/
Very significant support:
OpenGear: http://www.opengear.com/
Significant support:
PSW Group: http://www.psw.net/
Acano Ltd. http://acano.com/
Please note that we ask permission to identify sponsors and that some sponsors
we consider eligible for inclusion here have requested to remain anonymous.
Additional sponsorship or financial support is always welcome: for more
information please contact the OpenSSL Software Foundation.

980
CHANGES

File diff suppressed because it is too large Load Diff

View File

@@ -148,7 +148,7 @@ eric (about to go bushwalking for the 4 day easter break :-)
This would tend to cause memory overwrites since SSLv3 has This would tend to cause memory overwrites since SSLv3 has
a maximum packet size of 16k. If your program uses a maximum packet size of 16k. If your program uses
buffers <= 16k, you would probably never see this problem. buffers <= 16k, you would probably never see this problem.
- Fixed a new errors that were cause by malloc() not returning - Fixed a few errors that were cause by malloc() not returning
0 initialised memory.. 0 initialised memory..
- SSL_OP_NETSCAPE_CA_DN_BUG was being switched on when using - SSL_OP_NETSCAPE_CA_DN_BUG was being switched on when using
SSL_CTX_set_options(ssl_ctx,SSL_OP_ALL); which was a bad thing SSL_CTX_set_options(ssl_ctx,SSL_OP_ALL); which was a bad thing

164
Configure
View File

@@ -104,6 +104,8 @@ my $usage="Usage: Configure [no-<cipher> ...] [enable-<cipher> ...] [experimenta
my $gcc_devteam_warn = "-Wall -pedantic -DPEDANTIC -Wno-long-long -Wsign-compare -Wmissing-prototypes -Wshadow -Wformat -Werror -DCRYPTO_MDEBUG_ALL -DCRYPTO_MDEBUG_ABORT -DREF_CHECK -DOPENSSL_NO_DEPRECATED"; my $gcc_devteam_warn = "-Wall -pedantic -DPEDANTIC -Wno-long-long -Wsign-compare -Wmissing-prototypes -Wshadow -Wformat -Werror -DCRYPTO_MDEBUG_ALL -DCRYPTO_MDEBUG_ABORT -DREF_CHECK -DOPENSSL_NO_DEPRECATED";
my $strict_warnings = 0;
my $x86_gcc_des="DES_PTR DES_RISC1 DES_UNROLL"; my $x86_gcc_des="DES_PTR DES_RISC1 DES_UNROLL";
# MD2_CHAR slags pentium pros # MD2_CHAR slags pentium pros
@@ -131,7 +133,7 @@ my $sparcv9_asm="sparcv9cap.o sparccpuid.o:bn-sparcv9.o sparcv9-mont.o sparcv9a-
my $sparcv8_asm=":sparcv8.o:des_enc-sparc.o fcrypt_b.o:::::::::::void"; my $sparcv8_asm=":sparcv8.o:des_enc-sparc.o fcrypt_b.o:::::::::::void";
my $alpha_asm="alphacpuid.o:bn_asm.o alpha-mont.o::::::::::::void"; my $alpha_asm="alphacpuid.o:bn_asm.o alpha-mont.o::::::::::::void";
my $mips3_asm=":bn-mips3.o::::::::::::void"; my $mips3_asm=":bn-mips3.o::::::::::::void";
my $s390x_asm="s390xcpuid.o:bn-s390x.o s390x-mont.o::aes-s390x.o:::sha1-s390x.o sha256-s390x.o sha512-s390x.o::rc4-s390x.o:::::void"; my $s390x_asm="s390xcap.o s390xcpuid.o:bn-s390x.o s390x-mont.o::aes-s390x.o:::sha1-s390x.o sha256-s390x.o sha512-s390x.o::rc4-s390x.o:::::void";
my $armv4_asm=":bn_asm.o armv4-mont.o::aes_cbc.o aes-armv4.o:::sha1-armv4-large.o sha256-armv4.o sha512-armv4.o:::::::void"; my $armv4_asm=":bn_asm.o armv4-mont.o::aes_cbc.o aes-armv4.o:::sha1-armv4-large.o sha256-armv4.o sha512-armv4.o:::::::void";
my $ppc32_asm="ppccpuid.o:bn-ppc.o::aes_core.o aes_cbc.o aes-ppc.o:::sha1-ppc.o sha256-ppc.o::::::"; my $ppc32_asm="ppccpuid.o:bn-ppc.o::aes_core.o aes_cbc.o aes-ppc.o:::sha1-ppc.o sha256-ppc.o::::::";
my $ppc64_asm="ppccpuid.o:bn-ppc.o ppc-mont.o::aes_core.o aes_cbc.o aes-ppc.o:::sha1-ppc.o sha256-ppc.o sha512-ppc.o::::::"; my $ppc64_asm="ppccpuid.o:bn-ppc.o ppc-mont.o::aes_core.o aes_cbc.o aes-ppc.o:::sha1-ppc.o sha256-ppc.o sha512-ppc.o::::::";
@@ -161,22 +163,23 @@ my %table=(
# Our development configs # Our development configs
"purify", "purify gcc:-g -DPURIFY -Wall::(unknown)::-lsocket -lnsl::::", "purify", "purify gcc:-g -DPURIFY -Wall::(unknown)::-lsocket -lnsl::::",
"debug", "gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DOPENSSL_NO_ASM -ggdb -g2 -Wformat -Wshadow -Wmissing-prototypes -Wmissing-declarations -Werror::(unknown)::-lefence::::", "debug", "gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DOPENSSL_NO_ASM -ggdb -g2 -Wformat -Wshadow -Wmissing-prototypes -Wmissing-declarations -Werror::(unknown)::-lefence::::",
"debug-ben", "gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DPEDANTIC -DDEBUG_SAFESTACK -O2 -pedantic -Wall -Wshadow -Werror -pipe::(unknown):::::bn86-elf.o co86-elf.o", "debug-ben", "gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DPEDANTIC -DDEBUG_SAFESTACK -DDEBUG_UNUSED -O2 -pedantic -Wall -Wshadow -Werror -pipe::(unknown):::::bn86-elf.o co86-elf.o",
"debug-ben-openbsd","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DPEDANTIC -DDEBUG_SAFESTACK -DOPENSSL_OPENBSD_DEV_CRYPTO -DOPENSSL_NO_ASM -O2 -pedantic -Wall -Wshadow -Werror -pipe::(unknown)::::", "debug-ben-openbsd","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DPEDANTIC -DDEBUG_SAFESTACK -DOPENSSL_OPENBSD_DEV_CRYPTO -DOPENSSL_NO_ASM -O2 -pedantic -Wall -Wshadow -Werror -pipe::(unknown)::::",
"debug-ben-openbsd-debug","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DPEDANTIC -DDEBUG_SAFESTACK -DOPENSSL_OPENBSD_DEV_CRYPTO -DOPENSSL_NO_ASM -g3 -O2 -pedantic -Wall -Wshadow -Werror -pipe::(unknown)::::", "debug-ben-openbsd-debug","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DPEDANTIC -DDEBUG_SAFESTACK -DOPENSSL_OPENBSD_DEV_CRYPTO -DOPENSSL_NO_ASM -g3 -O2 -pedantic -Wall -Wshadow -Werror -pipe::(unknown)::::",
"debug-ben-debug", "gcc:$gcc_devteam_warn -DBN_DEBUG -DCONF_DEBUG -DBN_CTX_DEBUG -DDEBUG_SAFESTACK -g3 -O2 -pipe::(unknown)::::::", "debug-ben-debug", "gcc44:$gcc_devteam_warn -DBN_DEBUG -DCONF_DEBUG -DDEBUG_SAFESTACK -DDEBUG_UNUSED -g3 -O2 -pipe::(unknown)::::::",
"debug-ben-debug-64", "gcc:$gcc_devteam_warn -Wno-error=overlength-strings -Wno-error=strict-aliasing -Wno-error=uninitialized -DBN_DEBUG -DCONF_DEBUG -DDEBUG_SAFESTACK -DDEBUG_UNUSED -g3 -O3 -pipe::${BSDthreads}:::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"debug-ben-no-opt", "gcc: -Wall -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations -DDEBUG_SAFESTACK -DCRYPTO_MDEBUG -Werror -DL_ENDIAN -DTERMIOS -Wall -g3::(unknown)::::::", "debug-ben-no-opt", "gcc: -Wall -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations -DDEBUG_SAFESTACK -DCRYPTO_MDEBUG -Werror -DL_ENDIAN -DTERMIOS -Wall -g3::(unknown)::::::",
"debug-ben-strict", "gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DCONST_STRICT -O2 -Wall -Wshadow -Werror -Wpointer-arith -Wcast-qual -Wwrite-strings -pipe::(unknown)::::::", "debug-ben-strict", "gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DCONST_STRICT -O2 -Wall -Wshadow -Werror -Wpointer-arith -Wcast-qual -Wwrite-strings -pipe::(unknown)::::::",
"debug-rse","cc:-DTERMIOS -DL_ENDIAN -pipe -O -g -ggdb3 -Wall::(unknown):::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}", "debug-rse","cc:-DTERMIOS -DL_ENDIAN -pipe -O -g -ggdb3 -Wall::(unknown):::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}",
"debug-bodo", "gcc:-DL_ENDIAN -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBIO_PAIR_DEBUG -DPEDANTIC -g -march=i486 -pedantic -Wshadow -Wall -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wundef -Wconversion::-D_REENTRANT:::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}", "debug-bodo", "gcc:$gcc_devteam_warn -Wno-error=overlength-strings -DBN_DEBUG -DBN_DEBUG_RAND -DCONF_DEBUG -DBIO_PAIR_DEBUG -m64 -DL_ENDIAN -DTERMIO -g -DMD32_REG_T=int::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64",
"debug-ulf", "gcc:-DTERMIOS -DL_ENDIAN -march=i486 -Wall -DBN_DEBUG -DBN_DEBUG_RAND -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DOPENSSL_NO_ASM -g -Wformat -Wshadow -Wmissing-prototypes -Wmissing-declarations:::CYGWIN32:::${no_asm}:win32:cygwin-shared:::.dll", "debug-ulf", "gcc:-DTERMIOS -DL_ENDIAN -march=i486 -Wall -DBN_DEBUG -DBN_DEBUG_RAND -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DOPENSSL_NO_ASM -g -Wformat -Wshadow -Wmissing-prototypes -Wmissing-declarations:::CYGWIN32:::${no_asm}:win32:cygwin-shared:::.dll",
"debug-steve64", "gcc:$gcc_devteam_warn -m64 -DL_ENDIAN -DTERMIO -DCONF_DEBUG -DDEBUG_SAFESTACK -g -DMD32_REG_T=int::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK BF_PTR2 DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", "debug-steve64", "gcc:$gcc_devteam_warn -m64 -DL_ENDIAN -DTERMIO -DCONF_DEBUG -DDEBUG_SAFESTACK -g -DMD32_REG_T=int::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"debug-steve32", "gcc:$gcc_devteam_warn -m32 -DL_ENDIAN -DCONF_DEBUG -DDEBUG_SAFESTACK -g -pipe::-D_REENTRANT::-rdynamic -ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC:-m32:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", "debug-steve32", "gcc:$gcc_devteam_warn -m32 -DL_ENDIAN -DCONF_DEBUG -DDEBUG_SAFESTACK -g -pipe::-D_REENTRANT::-rdynamic -ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC:-m32:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"debug-steve-opt", "gcc:$gcc_devteam_warn -m64 -O3 -DL_ENDIAN -DTERMIO -DCONF_DEBUG -DDEBUG_SAFESTACK -g -DMD32_REG_T=int::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK BF_PTR2 DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", "debug-steve-opt", "gcc:$gcc_devteam_warn -m64 -O3 -DL_ENDIAN -DTERMIO -DCONF_DEBUG -DDEBUG_SAFESTACK -g -DMD32_REG_T=int::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"debug-levitte-linux-elf","gcc:-DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_DEBUG -DBN_DEBUG_RAND -DCRYPTO_MDEBUG -DENGINE_CONF_DEBUG -DL_ENDIAN -DTERMIO -D_POSIX_SOURCE -DPEDANTIC -ggdb -g3 -mcpu=i486 -pedantic -ansi -Wall -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wundef -Wconversion -pipe::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", "debug-levitte-linux-elf","gcc:-DLEVITTE_DEBUG -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -ggdb -g3 -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"debug-levitte-linux-noasm","gcc:-DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_DEBUG -DBN_DEBUG_RAND -DCRYPTO_MDEBUG -DENGINE_CONF_DEBUG -DOPENSSL_NO_ASM -DL_ENDIAN -DTERMIO -D_POSIX_SOURCE -DPEDANTIC -ggdb -g3 -mcpu=i486 -pedantic -ansi -Wall -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wundef -Wconversion -pipe::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", "debug-levitte-linux-noasm","gcc:-DLEVITTE_DEBUG -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -DOPENSSL_NO_ASM -DL_ENDIAN -ggdb -g3 -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"debug-levitte-linux-elf-extreme","gcc:-DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_DEBUG -DBN_DEBUG_RAND -DCRYPTO_MDEBUG -DENGINE_CONF_DEBUG -DL_ENDIAN -DTERMIO -D_POSIX_SOURCE -DPEDANTIC -ggdb -g3 -mcpu=i486 -pedantic -ansi -Wall -W -Wundef -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wundef -Wconversion -pipe::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", "debug-levitte-linux-elf-extreme","gcc:-DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_DEBUG -DBN_DEBUG_RAND -DCRYPTO_MDEBUG -DENGINE_CONF_DEBUG -DL_ENDIAN -DTERMIO -DPEDANTIC -ggdb -g3 -pedantic -ansi -Wall -W -Wundef -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wundef -Wconversion -pipe::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"debug-levitte-linux-noasm-extreme","gcc:-DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_DEBUG -DBN_DEBUG_RAND -DCRYPTO_MDEBUG -DENGINE_CONF_DEBUG -DOPENSSL_NO_ASM -DL_ENDIAN -DTERMIO -D_POSIX_SOURCE -DPEDANTIC -ggdb -g3 -mcpu=i486 -pedantic -ansi -Wall -W -Wundef -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wundef -Wconversion -pipe::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", "debug-levitte-linux-noasm-extreme","gcc:-DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_DEBUG -DBN_DEBUG_RAND -DCRYPTO_MDEBUG -DENGINE_CONF_DEBUG -DOPENSSL_NO_ASM -DL_ENDIAN -DTERMIO -DPEDANTIC -ggdb -g3 -pedantic -ansi -Wall -W -Wundef -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wundef -Wconversion -pipe::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"debug-geoff32","gcc:-DBN_DEBUG -DBN_DEBUG_RAND -DBN_STRICT -DPURIFY -DOPENSSL_NO_DEPRECATED -DOPENSSL_NO_ASM -DOPENSSL_NO_INLINE_ASM -DL_ENDIAN -DTERMIO -DPEDANTIC -DMD32_REG_T=int -O1 -ggdb2 -Wall -Werror -Wundef -pedantic -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-align -Wsign-compare -Wmissing-prototypes -Wmissing-declarations -Wno-long-long::-D_REENTRANT::-ldl:BN_LLONG:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", "debug-geoff32","gcc:-DBN_DEBUG -DBN_DEBUG_RAND -DBN_STRICT -DPURIFY -DOPENSSL_NO_DEPRECATED -DOPENSSL_NO_ASM -DOPENSSL_NO_INLINE_ASM -DL_ENDIAN -DTERMIO -DPEDANTIC -DMD32_REG_T=int -O1 -ggdb2 -Wall -Werror -Wundef -pedantic -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-align -Wsign-compare -Wmissing-prototypes -Wmissing-declarations -Wno-long-long::-D_REENTRANT::-ldl:BN_LLONG:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"debug-geoff64","gcc:-DBN_DEBUG -DBN_DEBUG_RAND -DBN_STRICT -DPURIFY -DOPENSSL_NO_DEPRECATED -DOPENSSL_NO_ASM -DOPENSSL_NO_INLINE_ASM -DL_ENDIAN -DTERMIO -DPEDANTIC -DMD32_REG_T=int -O1 -ggdb2 -Wall -Werror -Wundef -pedantic -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-align -Wsign-compare -Wmissing-prototypes -Wmissing-declarations -Wno-long-long::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", "debug-geoff64","gcc:-DBN_DEBUG -DBN_DEBUG_RAND -DBN_STRICT -DPURIFY -DOPENSSL_NO_DEPRECATED -DOPENSSL_NO_ASM -DOPENSSL_NO_INLINE_ASM -DL_ENDIAN -DTERMIO -DPEDANTIC -DMD32_REG_T=int -O1 -ggdb2 -Wall -Werror -Wundef -pedantic -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-align -Wsign-compare -Wmissing-prototypes -Wmissing-declarations -Wno-long-long::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"debug-linux-pentium","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -DTERMIO -g -mcpu=pentium -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn", "debug-linux-pentium","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -DTERMIO -g -mcpu=pentium -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn",
@@ -184,6 +187,9 @@ my %table=(
"debug-linux-elf","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -DTERMIO -g -march=i486 -Wall::-D_REENTRANT::-lefence -ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", "debug-linux-elf","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -DTERMIO -g -march=i486 -Wall::-D_REENTRANT::-lefence -ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"debug-linux-elf-noefence","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -DTERMIO -g -march=i486 -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", "debug-linux-elf-noefence","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -DTERMIO -g -march=i486 -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"debug-linux-ia32-aes", "gcc:-DAES_EXPERIMENTAL -DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:x86cpuid.o:bn-586.o co-586.o x86-mont.o:des-586.o crypt586.o:aes_x86core.o aes_cbc.o:bf-586.o:md5-586.o:sha1-586.o sha256-586.o sha512-586.o:cast-586.o:rc4-586.o:rmd-586.o:rc5-586.o:wp_block.o wp-mmx.o::elf:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", "debug-linux-ia32-aes", "gcc:-DAES_EXPERIMENTAL -DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:x86cpuid.o:bn-586.o co-586.o x86-mont.o:des-586.o crypt586.o:aes_x86core.o aes_cbc.o:bf-586.o:md5-586.o:sha1-586.o sha256-586.o sha512-586.o:cast-586.o:rc4-586.o:rmd-586.o:rc5-586.o:wp_block.o wp-mmx.o::elf:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"debug-linux-generic32","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -DTERMIO -g -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"debug-linux-generic64","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -DTERMIO -g -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"debug-linux-x86_64", "gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -m64 -DL_ENDIAN -DTERMIO -g -Wall -DMD32_REG_T=int::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64",
"dist", "cc:-O::(unknown)::::::", "dist", "cc:-O::(unknown)::::::",
# Basic configs that should work on any (32 and less bit) box # Basic configs that should work on any (32 and less bit) box
@@ -191,8 +197,8 @@ my %table=(
"cc", "cc:-O::(unknown)::::::", "cc", "cc:-O::(unknown)::::::",
####VOS Configurations ####VOS Configurations
"vos-gcc","gcc:-O3 -Wall -D_POSIX_C_SOURCE=200112L -D_BSD -DB_ENDIAN::(unknown):VOS:-Wl,-map:BN_LLONG:${no_asm}:::::.so:", "vos-gcc","gcc:-O3 -Wall -DOPENSSL_SYSNAME_VOS -D_POSIX_C_SOURCE=200112L -D_BSD -D_VOS_EXTENDED_NAMES -DB_ENDIAN::(unknown):VOS:-Wl,-map:BN_LLONG:${no_asm}:::::.so:",
"debug-vos-gcc","gcc:-O0 -g -Wall -D_POSIX_C_SOURCE=200112L -D_BSD -DB_ENDIAN -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG::(unknown):VOS:-Wl,-map:BN_LLONG:${no_asm}:::::.so:", "debug-vos-gcc","gcc:-O0 -g -Wall -DOPENSSL_SYSNAME_VOS -D_POSIX_C_SOURCE=200112L -D_BSD -D_VOS_EXTENDED_NAMES -DB_ENDIAN -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG::(unknown):VOS:-Wl,-map:BN_LLONG:${no_asm}:::::.so:",
#### Solaris x86 with GNU C setups #### Solaris x86 with GNU C setups
# -DOPENSSL_NO_INLINE_ASM switches off inline assembler. We have to do it # -DOPENSSL_NO_INLINE_ASM switches off inline assembler. We have to do it
@@ -209,11 +215,11 @@ my %table=(
# actually recommend to consider using gcc shared build even with vendor # actually recommend to consider using gcc shared build even with vendor
# compiler:-) # compiler:-)
# <appro@fy.chalmers.se> # <appro@fy.chalmers.se>
"solaris64-x86_64-gcc","gcc:-m64 -O3 -Wall -DL_ENDIAN -DMD32_REG_T=int::-D_REENTRANT::-lsocket -lnsl -ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK BF_PTR2 DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:solaris-shared:-fPIC:-m64 -shared -static-libgcc:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::/64", "solaris64-x86_64-gcc","gcc:-m64 -O3 -Wall -DL_ENDIAN -DMD32_REG_T=int::-D_REENTRANT::-lsocket -lnsl -ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:solaris-shared:-fPIC:-m64 -shared -static-libgcc:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::/64",
#### Solaris x86 with Sun C setups #### Solaris x86 with Sun C setups
"solaris-x86-cc","cc:-fast -O -Xa::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_UNROLL BF_PTR:${no_asm}:dlfcn:solaris-shared:-KPIC:-G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", "solaris-x86-cc","cc:-fast -O -Xa::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_UNROLL BF_PTR:${no_asm}:dlfcn:solaris-shared:-KPIC:-G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"solaris64-x86_64-cc","cc:-fast -xarch=amd64 -xstrconst -Xa -DL_ENDIAN::-D_REENTRANT::-lsocket -lnsl -ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK BF_PTR2 DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:solaris-shared:-KPIC:-xarch=amd64 -G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::/64", "solaris64-x86_64-cc","cc:-fast -xarch=amd64 -xstrconst -Xa -DL_ENDIAN::-D_REENTRANT::-lsocket -lnsl -ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:solaris-shared:-KPIC:-xarch=amd64 -G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::/64",
#### SPARC Solaris with GNU C setups #### SPARC Solaris with GNU C setups
"solaris-sparcv7-gcc","gcc:-O3 -fomit-frame-pointer -Wall -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${no_asm}:dlfcn:solaris-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", "solaris-sparcv7-gcc","gcc:-O3 -fomit-frame-pointer -Wall -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${no_asm}:dlfcn:solaris-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
@@ -232,7 +238,7 @@ my %table=(
"solaris-sparcv7-cc","cc:-xO5 -xstrconst -xdepend -Xa -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_RISC1 DES_UNROLL BF_PTR:${no_asm}:dlfcn:solaris-shared:-KPIC:-G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", "solaris-sparcv7-cc","cc:-xO5 -xstrconst -xdepend -Xa -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_RISC1 DES_UNROLL BF_PTR:${no_asm}:dlfcn:solaris-shared:-KPIC:-G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"solaris-sparcv8-cc","cc:-xarch=v8 -xO5 -xstrconst -xdepend -Xa -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_RISC1 DES_UNROLL BF_PTR:${sparcv8_asm}:dlfcn:solaris-shared:-KPIC:-G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", "solaris-sparcv8-cc","cc:-xarch=v8 -xO5 -xstrconst -xdepend -Xa -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_RISC1 DES_UNROLL BF_PTR:${sparcv8_asm}:dlfcn:solaris-shared:-KPIC:-G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"solaris-sparcv9-cc","cc:-xtarget=ultra -xarch=v8plus -xO5 -xstrconst -xdepend -Xa -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK_LL DES_PTR DES_RISC1 DES_UNROLL BF_PTR:${sparcv9_asm}:dlfcn:solaris-shared:-KPIC:-G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", "solaris-sparcv9-cc","cc:-xtarget=ultra -xarch=v8plus -xO5 -xstrconst -xdepend -Xa -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK_LL DES_PTR DES_RISC1 DES_UNROLL BF_PTR:${sparcv9_asm}:dlfcn:solaris-shared:-KPIC:-G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"solaris64-sparcv9-cc","cc:-xtarget=ultra -xarch=v9 -xO5 -xstrconst -xdepend -Xa -DB_ENDIAN::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL BF_PTR:${sparcv9_asm}:dlfcn:solaris-shared:-KPIC:-xarch=v9 -G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):/usr/ccs/bin/ar rs::/64", "solaris64-sparcv9-cc","cc:-xtarget=ultra -xarch=v9 -xO5 -xstrconst -xdepend -Xa -DB_ENDIAN::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL BF_PTR:${sparcv9_asm}:dlfcn:solaris-shared:-KPIC:-xarch=v9 -G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::/64",
#### ####
"debug-solaris-sparcv8-cc","cc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -xarch=v8 -g -O -xstrconst -Xa -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_RISC1 DES_UNROLL BF_PTR:${sparcv8_asm}:dlfcn:solaris-shared:-KPIC:-G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", "debug-solaris-sparcv8-cc","cc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -xarch=v8 -g -O -xstrconst -Xa -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_RISC1 DES_UNROLL BF_PTR:${sparcv8_asm}:dlfcn:solaris-shared:-KPIC:-G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"debug-solaris-sparcv9-cc","cc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -xtarget=ultra -xarch=v8plus -g -O -xstrconst -Xa -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK_LL DES_PTR DES_RISC1 DES_UNROLL BF_PTR:${sparcv9_asm}:dlfcn:solaris-shared:-KPIC:-G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", "debug-solaris-sparcv9-cc","cc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -xtarget=ultra -xarch=v8plus -g -O -xstrconst -Xa -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK_LL DES_PTR DES_RISC1 DES_UNROLL BF_PTR:${sparcv9_asm}:dlfcn:solaris-shared:-KPIC:-G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
@@ -346,7 +352,7 @@ my %table=(
"linux-ia64", "gcc:-DL_ENDIAN -DTERMIO -O3 -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_UNROLL DES_INT:${ia64_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", "linux-ia64", "gcc:-DL_ENDIAN -DTERMIO -O3 -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_UNROLL DES_INT:${ia64_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"linux-ia64-ecc","ecc:-DL_ENDIAN -DTERMIO -O2 -Wall -no_cpprt::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT:${ia64_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", "linux-ia64-ecc","ecc:-DL_ENDIAN -DTERMIO -O2 -Wall -no_cpprt::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT:${ia64_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"linux-ia64-icc","icc:-DL_ENDIAN -DTERMIO -O2 -Wall -no_cpprt::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_RISC1 DES_INT:${ia64_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", "linux-ia64-icc","icc:-DL_ENDIAN -DTERMIO -O2 -Wall -no_cpprt::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_RISC1 DES_INT:${ia64_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"linux-x86_64", "gcc:-m64 -DL_ENDIAN -DTERMIO -O3 -Wall -DMD32_REG_T=int::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK BF_PTR2 DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64", "linux-x86_64", "gcc:-m64 -DL_ENDIAN -DTERMIO -O3 -Wall -DMD32_REG_T=int::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64",
"linux-s390x", "gcc:-m64 -DB_ENDIAN -DTERMIO -O3 -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL:${s390x_asm}:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64", "linux-s390x", "gcc:-m64 -DB_ENDIAN -DTERMIO -O3 -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL:${s390x_asm}:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64",
#### SPARC Linux setups #### SPARC Linux setups
# Ray Miller <ray.miller@computing-services.oxford.ac.uk> has patiently # Ray Miller <ray.miller@computing-services.oxford.ac.uk> has patiently
@@ -400,7 +406,8 @@ my %table=(
# QNX # QNX
"qnx4", "cc:-DL_ENDIAN -DTERMIO::(unknown):::${x86_gcc_des} ${x86_gcc_opts}:", "qnx4", "cc:-DL_ENDIAN -DTERMIO::(unknown):::${x86_gcc_des} ${x86_gcc_opts}:",
"qnx6", "cc:-DL_ENDIAN -DTERMIOS::(unknown)::-lsocket:${x86_gcc_des} ${x86_gcc_opts}:", "QNX6", "gcc:-DTERMIOS::::-lsocket::${no_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"QNX6-i386", "gcc:-DL_ENDIAN -DTERMIOS -O2 -Wall::::-lsocket:${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
# BeOS # BeOS
"beos-x86-r5", "gcc:-DL_ENDIAN -DTERMIOS -O3 -fomit-frame-pointer -mcpu=pentium -Wall::-D_REENTRANT:BEOS:-lbe -lnet:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:beos:beos-shared:-fPIC -DPIC:-shared:.so", "beos-x86-r5", "gcc:-DL_ENDIAN -DTERMIOS -O3 -fomit-frame-pointer -mcpu=pentium -Wall::-D_REENTRANT:BEOS:-lbe -lnet:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:beos:beos-shared:-fPIC -DPIC:-shared:.so",
@@ -432,8 +439,8 @@ my %table=(
"aix64-gcc","gcc:-maix64 -O -DB_ENDIAN::-pthread:AIX::SIXTY_FOUR_BIT_LONG RC4_CHAR:${ppc64_asm}:aix64:dlfcn:aix-shared::-maix64 -shared -Wl,-G:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)::-X64", "aix64-gcc","gcc:-maix64 -O -DB_ENDIAN::-pthread:AIX::SIXTY_FOUR_BIT_LONG RC4_CHAR:${ppc64_asm}:aix64:dlfcn:aix-shared::-maix64 -shared -Wl,-G:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)::-X64",
# Below targets assume AIX 5. Idea is to effectively disregard $OBJECT_MODE # Below targets assume AIX 5. Idea is to effectively disregard $OBJECT_MODE
# at build time. $OBJECT_MODE is respected at ./config stage! # at build time. $OBJECT_MODE is respected at ./config stage!
"aix-cc", "cc:-q32 -O -DB_ENDIAN -qmaxmem=16384 -qro -qroconst::-qthreaded:AIX::BN_LLONG RC4_CHAR:${ppc32_asm}:aix32:dlfcn:aix-shared::-q32 -G:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)::-X 32", "aix-cc", "cc:-q32 -O -DB_ENDIAN -qmaxmem=16384 -qro -qroconst::-qthreaded -D_THREAD_SAFE:AIX::BN_LLONG RC4_CHAR:${ppc32_asm}:aix32:dlfcn:aix-shared::-q32 -G:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)::-X 32",
"aix64-cc", "cc:-q64 -O -DB_ENDIAN -qmaxmem=16384 -qro -qroconst::-qthreaded:AIX::SIXTY_FOUR_BIT_LONG RC4_CHAR:${ppc64_asm}:aix64:dlfcn:aix-shared::-q64 -G:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)::-X 64", "aix64-cc", "cc:-q64 -O -DB_ENDIAN -qmaxmem=16384 -qro -qroconst::-qthreaded -D_THREAD_SAFE:AIX::SIXTY_FOUR_BIT_LONG RC4_CHAR:${ppc64_asm}:aix64:dlfcn:aix-shared::-q64 -G:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)::-X 64",
# #
# Cray T90 and similar (SDSC) # Cray T90 and similar (SDSC)
@@ -485,18 +492,21 @@ my %table=(
# #
# Win64 targets, WIN64I denotes IA-64 and WIN64A - AMD64 # Win64 targets, WIN64I denotes IA-64 and WIN64A - AMD64
"VC-WIN64I","cl:-W3 -Gs0 -Gy -nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -DUNICODE -D_UNICODE -D_CRT_SECURE_NO_DEPRECATE:::WIN64I::SIXTY_FOUR_BIT RC4_CHUNK_LL DES_INT EXPORT_VAR_AS_FN:ia64cpuid.o:ia64.o::aes_core.o aes_cbc.o aes-ia64.o::md5-ia64.o:sha1-ia64.o sha256-ia64.o sha512-ia64.o:::::::ias:win32", "VC-WIN64I","cl:-W3 -Gs0 -Gy -nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -DUNICODE -D_UNICODE -D_CRT_SECURE_NO_DEPRECATE:::WIN64I::SIXTY_FOUR_BIT RC4_CHUNK_LL DES_INT EXPORT_VAR_AS_FN:ia64cpuid.o:ia64.o::aes_core.o aes_cbc.o aes-ia64.o::md5-ia64.o:sha1-ia64.o sha256-ia64.o sha512-ia64.o:::::::ias:win32",
"VC-WIN64A","cl:-W3 -Gs0 -Gy -nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -DUNICODE -D_UNICODE -D_CRT_SECURE_NO_DEPRECATE:::WIN64A::SIXTY_FOUR_BIT RC4_CHUNK_LL DES_INT EXPORT_VAR_AS_FN:x86_64cpuid.o:bn_asm.o x86_64-mont.o::aes-x86_64.o::md5-x86_64.o:sha1-x86_64.o sha256-x86_64.o sha512-x86_64.o::rc4-x86_64.o:::wp-x86_64.o::ml64:win32", "VC-WIN64A","cl:-W3 -Gs0 -Gy -nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -DUNICODE -D_UNICODE -D_CRT_SECURE_NO_DEPRECATE:::WIN64A::SIXTY_FOUR_BIT RC4_CHUNK_LL DES_INT EXPORT_VAR_AS_FN:x86_64cpuid.o:bn_asm.o x86_64-mont.o::aes-x86_64.o::md5-x86_64.o:sha1-x86_64.o sha256-x86_64.o sha512-x86_64.o::rc4-x86_64.o:::wp-x86_64.o:cmll-x86_64.o cmll_misc.o:auto:win32",
"debug-VC-WIN64I","cl:-W3 -Gs0 -Gy -Zi -nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -DUNICODE -D_UNICODE -D_CRT_SECURE_NO_DEPRECATE:::WIN64I::SIXTY_FOUR_BIT RC4_CHUNK_LL DES_INT EXPORT_VAR_AS_FN:ia64cpuid.o:ia64.o::aes_core.o aes_cbc.o aes-ia64.o::md5-ia64.o:sha1-ia64.o sha256-ia64.o sha512-ia64.o:::::::ias:win32",
"debug-VC-WIN64A","cl:-W3 -Gs0 -Gy -Zi -nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -DUNICODE -D_UNICODE -D_CRT_SECURE_NO_DEPRECATE:::WIN64A::SIXTY_FOUR_BIT RC4_CHUNK_LL DES_INT EXPORT_VAR_AS_FN:x86_64cpuid.o:bn_asm.o x86_64-mont.o::aes-x86_64.o::md5-x86_64.o:sha1-x86_64.o sha256-x86_64.o sha512-x86_64.o::rc4-x86_64.o:::wp-x86_64.o:cmll-x86_64.o cmll_misc.o:auto:win32",
# x86 Win32 target defaults to ANSI API, if you want UNICODE, complement # x86 Win32 target defaults to ANSI API, if you want UNICODE, complement
# 'perl Configure VC-WIN32' with '-DUNICODE -D_UNICODE' # 'perl Configure VC-WIN32' with '-DUNICODE -D_UNICODE'
"VC-WIN32","cl:-W3 -WX -Gs0 -GF -Gy -nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -D_CRT_SECURE_NO_DEPRECATE:::WIN32::BN_LLONG RC4_INDEX EXPORT_VAR_AS_FN ${x86_gcc_opts}:${x86_asm}:win32n:win32", "VC-WIN32","cl:-W3 -WX -Gs0 -GF -Gy -nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -D_CRT_SECURE_NO_DEPRECATE:::WIN32::BN_LLONG RC4_INDEX EXPORT_VAR_AS_FN ${x86_gcc_opts}:${x86_asm}:win32n:win32",
# Unified CE target # Unified CE target
"debug-VC-WIN32","cl:-W3 -WX -Gs0 -GF -Gy -Zi -nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -D_CRT_SECURE_NO_DEPRECATE:::WIN32::BN_LLONG RC4_INDEX EXPORT_VAR_AS_FN ${x86_gcc_opts}:${x86_asm}:win32n:win32",
"VC-CE","cl::::WINCE::BN_LLONG RC4_INDEX EXPORT_VAR_AS_FN ${x86_gcc_opts}:${no_asm}:win32", "VC-CE","cl::::WINCE::BN_LLONG RC4_INDEX EXPORT_VAR_AS_FN ${x86_gcc_opts}:${no_asm}:win32",
# Borland C++ 4.5 # Borland C++ 4.5
"BC-32","bcc32::::WIN32::BN_LLONG DES_PTR RC4_INDEX EXPORT_VAR_AS_FN:${no_asm}:win32", "BC-32","bcc32::::WIN32::BN_LLONG DES_PTR RC4_INDEX EXPORT_VAR_AS_FN:${no_asm}:win32",
# MinGW # MinGW
"mingw", "gcc:-mno-cygwin -DL_ENDIAN -fomit-frame-pointer -O3 -march=i486 -Wall:::MINGW32:-lws2_32 -lgdi32:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts} EXPORT_VAR_AS_FN:${x86_asm}:coff:win32:cygwin-shared:-D_WINDLL -DOPENSSL_USE_APPLINK:-mno-cygwin:.dll.a", "mingw", "gcc:-mno-cygwin -DL_ENDIAN -DWIN32_LEAN_AND_MEAN -fomit-frame-pointer -O3 -march=i486 -Wall::-D_MT:MINGW32:-lws2_32 -lgdi32 -lcrypt32:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts} EXPORT_VAR_AS_FN:${x86_asm}:coff:win32:cygwin-shared:-D_WINDLL -DOPENSSL_USE_APPLINK:-mno-cygwin:.dll.a",
# As for OPENSSL_USE_APPLINK. Applink makes it possible to use .dll # As for OPENSSL_USE_APPLINK. Applink makes it possible to use .dll
# compiled with one compiler with application compiled with another # compiled with one compiler with application compiled with another
# compiler. It's possible to engage Applink support in mingw64 build, # compiler. It's possible to engage Applink support in mingw64 build,
@@ -504,7 +514,7 @@ my %table=(
# handling, one can't seriously consider its binaries for using with # handling, one can't seriously consider its binaries for using with
# non-mingw64 run-time environment. And as mingw64 is always consistent # non-mingw64 run-time environment. And as mingw64 is always consistent
# with itself, Applink is never engaged and can as well be omitted. # with itself, Applink is never engaged and can as well be omitted.
"mingw64", "gcc:-mno-cygwin -DL_ENDIAN -O3 -Wall -DWIN32_LEAN_AND_MEAN -DUNICODE -D_UNICODE:::MINGW64:-lws2_32 -lgdi32:SIXTY_FOUR_BIT RC4_CHUNK_LL DES_INT EXPORT_VAR_AS_FN:${x86_64_asm}:mingw64:win32:cygwin-shared:-D_WINDLL:-mno-cygwin:.dll.a", "mingw64", "gcc:-mno-cygwin -DL_ENDIAN -O3 -Wall -DWIN32_LEAN_AND_MEAN -DUNICODE -D_UNICODE::-D_MT:MINGW64:-lws2_32 -lgdi32 -lcrypt32:SIXTY_FOUR_BIT RC4_CHUNK_LL DES_INT EXPORT_VAR_AS_FN:${x86_64_asm}:mingw64:win32:cygwin-shared:-D_WINDLL:-mno-cygwin:.dll.a",
# UWIN # UWIN
"UWIN", "cc:-DTERMIOS -DL_ENDIAN -O -Wall:::UWIN::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${no_asm}:win32", "UWIN", "cc:-DTERMIOS -DL_ENDIAN -O -Wall:::UWIN::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${no_asm}:win32",
@@ -540,11 +550,11 @@ my %table=(
##### MacOS X (a.k.a. Rhapsody or Darwin) setup ##### MacOS X (a.k.a. Rhapsody or Darwin) setup
"rhapsody-ppc-cc","cc:-O3 -DB_ENDIAN::(unknown):MACOSX_RHAPSODY::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${no_asm}::", "rhapsody-ppc-cc","cc:-O3 -DB_ENDIAN::(unknown):MACOSX_RHAPSODY::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${no_asm}::",
"darwin-ppc-cc","cc:-arch ppc -O3 -DB_ENDIAN::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${ppc32_asm}:osx32:dlfcn:darwin-shared:-fPIC -fno-common:-arch ppc -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib", "darwin-ppc-cc","cc:-arch ppc -O3 -DB_ENDIAN -Wa,-force_cpusubtype_ALL::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${ppc32_asm}:osx32:dlfcn:darwin-shared:-fPIC -fno-common:-arch ppc -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
"darwin64-ppc-cc","cc:-arch ppc64 -O3 -DB_ENDIAN::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${ppc64_asm}:osx64:dlfcn:darwin-shared:-fPIC -fno-common:-arch ppc64 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib", "darwin64-ppc-cc","cc:-arch ppc64 -O3 -DB_ENDIAN::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${ppc64_asm}:osx64:dlfcn:darwin-shared:-fPIC -fno-common:-arch ppc64 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
"darwin-i386-cc","cc:-arch i386 -O3 -fomit-frame-pointer -DL_ENDIAN::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:BN_LLONG RC4_INT RC4_CHUNK DES_UNROLL BF_PTR:${x86_asm}:macosx:dlfcn:darwin-shared:-fPIC -fno-common:-arch i386 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib", "darwin-i386-cc","cc:-arch i386 -O3 -fomit-frame-pointer -DL_ENDIAN::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:BN_LLONG RC4_INT RC4_CHUNK DES_UNROLL BF_PTR:${x86_asm}:macosx:dlfcn:darwin-shared:-fPIC -fno-common:-arch i386 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
"debug-darwin-i386-cc","cc:-arch i386 -g3 -DL_ENDIAN::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:BN_LLONG RC4_INT RC4_CHUNK DES_UNROLL BF_PTR:${x86_asm}:macosx:dlfcn:darwin-shared:-fPIC -fno-common:-arch i386 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib", "debug-darwin-i386-cc","cc:-arch i386 -g3 -DL_ENDIAN::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:BN_LLONG RC4_INT RC4_CHUNK DES_UNROLL BF_PTR:${x86_asm}:macosx:dlfcn:darwin-shared:-fPIC -fno-common:-arch i386 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
"darwin64-x86_64-cc","cc:-arch x86_64 -O3 -DL_ENDIAN -DMD32_REG_T=int -Wall::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK BF_PTR2 DES_INT DES_UNROLL:${x86_64_asm}:macosx:dlfcn:darwin-shared:-fPIC -fno-common:-arch x86_64 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib", "darwin64-x86_64-cc","cc:-arch x86_64 -O3 -DL_ENDIAN -DMD32_REG_T=int -Wall::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL:".eval{my $asm=$x86_64_asm;$asm=~s/rc4\-[^:]+//;$asm}.":macosx:dlfcn:darwin-shared:-fPIC -fno-common:-arch x86_64 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
"debug-darwin-ppc-cc","cc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -DB_ENDIAN -g -Wall -O::-D_REENTRANT:MACOSX::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${ppc32_asm}:osx32:dlfcn:darwin-shared:-fPIC:-dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib", "debug-darwin-ppc-cc","cc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -DB_ENDIAN -g -Wall -O::-D_REENTRANT:MACOSX::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${ppc32_asm}:osx32:dlfcn:darwin-shared:-fPIC:-dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
##### A/UX ##### A/UX
@@ -569,11 +579,16 @@ my %table=(
##### Compaq Non-Stop Kernel (Tandem) ##### Compaq Non-Stop Kernel (Tandem)
"tandem-c89","c89:-Ww -D__TANDEM -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1 -D_TANDEM_SOURCE -DB_ENDIAN::(unknown):::THIRTY_TWO_BIT:::", "tandem-c89","c89:-Ww -D__TANDEM -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1 -D_TANDEM_SOURCE -DB_ENDIAN::(unknown):::THIRTY_TWO_BIT:::",
# uClinux
"uClinux-dist","$ENV{'CC'}:\$(CFLAGS)::-D_REENTRANT::\$(LDFLAGS) \$(LDLIBS):BN_LLONG:::::::::::::::$ENV{'LIBSSL_dlfcn'}:linux-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):$ENV{'RANLIB'}::",
"uClinux-dist64","$ENV{'CC'}:\$(CFLAGS)::-D_REENTRANT::\$(LDFLAGS) \$(LDLIBS):SIXTY_FOUR_BIT_LONG:::::::::::::::$ENV{'LIBSSL_dlfcn'}:linux-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):$ENV{'RANLIB'}::",
); );
my @MK1MF_Builds=qw(VC-WIN64I VC-WIN64A my @MK1MF_Builds=qw(VC-WIN64I VC-WIN64A
VC-NT VC-CE VC-WIN32 debug-VC-WIN64I debug-VC-WIN64A
BC-32 OS2-EMX VC-NT VC-CE VC-WIN32 debug-VC-WIN32
BC-32
netware-clib netware-clib-bsdsock netware-clib netware-clib-bsdsock
netware-libc netware-libc-bsdsock); netware-libc netware-libc-bsdsock);
@@ -609,9 +624,10 @@ my $idx_arflags = $idx++;
my $idx_multilib = $idx++; my $idx_multilib = $idx++;
my $prefix=""; my $prefix="";
my $libdir="";
my $openssldir=""; my $openssldir="";
my $exe_ext=""; my $exe_ext="";
my $install_prefix=""; my $install_prefix= "$ENV{'INSTALL_PREFIX'}";
my $cross_compile_prefix=""; my $cross_compile_prefix="";
my $no_threads=0; my $no_threads=0;
my $threads=0; my $threads=0;
@@ -654,7 +670,7 @@ my $perl;
my %disabled = ( # "what" => "comment" [or special keyword "experimental"] my %disabled = ( # "what" => "comment" [or special keyword "experimental"]
"gmp" => "default", "gmp" => "default",
"jpake" => "experimental", "jpake" => "experimental",
"mdc2" => "default", "md2" => "default",
"rc5" => "default", "rc5" => "default",
"rfc3779" => "default", "rfc3779" => "default",
"shared" => "default", "shared" => "default",
@@ -666,8 +682,7 @@ my @experimental = ();
# This is what $depflags will look like with the above defaults # This is what $depflags will look like with the above defaults
# (we need this to see if we should advise the user to run "make depend"): # (we need this to see if we should advise the user to run "make depend"):
my $default_depflags = " -DOPENSSL_NO_GMP -DOPENSSL_NO_JPAKE -DOPENSSL_NO_MDC2 -DOPENSSL_NO_RC5 -DOPENSSL_NO_RFC3779 -DOPENSSL_NO_STORE"; my $default_depflags = " -DOPENSSL_NO_GMP -DOPENSSL_NO_JPAKE -DOPENSSL_NO_MD2 -DOPENSSL_NO_RC5 -DOPENSSL_NO_RFC3779 -DOPENSSL_NO_STORE";
# Explicit "no-..." options will be collected in %disabled along with the defaults. # Explicit "no-..." options will be collected in %disabled along with the defaults.
# To remove something from %disabled, use "enable-foo" (unless it's experimental). # To remove something from %disabled, use "enable-foo" (unless it's experimental).
@@ -765,6 +780,10 @@ PROCESS_ARGS:
{ {
exit(&test_sanity()); exit(&test_sanity());
} }
elsif (/^--strict-warnings/)
{
$strict_warnings = 1;
}
elsif (/^reconfigure/ || /^reconf/) elsif (/^reconfigure/ || /^reconf/)
{ {
if (open(IN,"<$Makefile")) if (open(IN,"<$Makefile"))
@@ -810,6 +829,10 @@ PROCESS_ARGS:
{ {
$prefix=$1; $prefix=$1;
} }
elsif (/^--libdir=(.*)$/)
{
$libdir=$1;
}
elsif (/^--openssldir=(.*)$/) elsif (/^--openssldir=(.*)$/)
{ {
$openssldir=$1; $openssldir=$1;
@@ -918,6 +941,12 @@ if (defined($disabled{"tls1"}))
$disabled{"tlsext"} = "forced"; $disabled{"tlsext"} = "forced";
} }
if (defined($disabled{"ec"}) || defined($disabled{"dsa"})
|| defined($disabled{"dh"}))
{
$disabled{"gost"} = "forced";
}
if ($target eq "TABLE") { if ($target eq "TABLE") {
foreach $target (sort keys %table) { foreach $target (sort keys %table) {
print_table_entry($target); print_table_entry($target);
@@ -987,6 +1016,8 @@ foreach (sort (keys %disabled))
else else
{ {
push @skip, $algo; push @skip, $algo;
# fix-up crypto/directory name(s)
@skip[$#skip]="whrlpool" if $algo eq "whirlpool";
print " (skip dir)"; print " (skip dir)";
$depflags .= " -DOPENSSL_NO_$ALGO"; $depflags .= " -DOPENSSL_NO_$ALGO";
@@ -1019,6 +1050,9 @@ $prefix=$openssldir if $prefix eq "";
$default_ranlib= &which("ranlib") or $default_ranlib="true"; $default_ranlib= &which("ranlib") or $default_ranlib="true";
$perl=$ENV{'PERL'} or $perl=&which("perl5") or $perl=&which("perl") $perl=$ENV{'PERL'} or $perl=&which("perl5") or $perl=&which("perl")
or $perl="perl"; or $perl="perl";
my $make = $ENV{'MAKE'} || "make";
$cross_compile_prefix=$ENV{'CROSS_COMPILE'} if $cross_compile_prefix eq "";
chop $openssldir if $openssldir =~ /\/$/; chop $openssldir if $openssldir =~ /\/$/;
chop $prefix if $prefix =~ /.\/$/; chop $prefix if $prefix =~ /.\/$/;
@@ -1060,10 +1094,19 @@ my $shared_target = $fields[$idx_shared_target];
my $shared_cflag = $fields[$idx_shared_cflag]; my $shared_cflag = $fields[$idx_shared_cflag];
my $shared_ldflag = $fields[$idx_shared_ldflag]; my $shared_ldflag = $fields[$idx_shared_ldflag];
my $shared_extension = $fields[$idx_shared_extension]; my $shared_extension = $fields[$idx_shared_extension];
my $ranlib = $fields[$idx_ranlib]; my $ranlib = $ENV{'RANLIB'} || $fields[$idx_ranlib];
my $ar = $ENV{'AR'} || "ar";
my $arflags = $fields[$idx_arflags]; my $arflags = $fields[$idx_arflags];
my $multilib = $fields[$idx_multilib]; my $multilib = $fields[$idx_multilib];
# if $prefix/lib$multilib is not an existing directory, then
# assume that it's not searched by linker automatically, in
# which case adding $multilib suffix causes more grief than
# we're ready to tolerate, so don't...
$multilib="" if !-d "$prefix/lib$multilib";
$libdir="lib$multilib" if $libdir eq "";
$cflags = "$cflags$exp_cflags"; $cflags = "$cflags$exp_cflags";
# '%' in $lflags is used to split flags to "pre-" and post-flags # '%' in $lflags is used to split flags to "pre-" and post-flags
@@ -1071,6 +1114,12 @@ my ($prelflags,$postlflags)=split('%',$lflags);
if (defined($postlflags)) { $lflags=$postlflags; } if (defined($postlflags)) { $lflags=$postlflags; }
else { $lflags=$prelflags; undef $prelflags; } else { $lflags=$prelflags; undef $prelflags; }
if ($target =~ /^mingw/ && `$cc --target-help 2>&1` !~ m/\-mno\-cygwin/m)
{
$cflags =~ s/\-mno\-cygwin\s*//;
$shared_ldflag =~ s/\-mno\-cygwin\s*//;
}
my $no_shared_warn=0; my $no_shared_warn=0;
my $no_user_cflags=0; my $no_user_cflags=0;
@@ -1218,7 +1267,14 @@ if ($zlib)
$cflags = "-DZLIB $cflags"; $cflags = "-DZLIB $cflags";
if (defined($disabled{"zlib-dynamic"})) if (defined($disabled{"zlib-dynamic"}))
{ {
$lflags = "$lflags -lz"; if (defined($withargs{"zlib-lib"}))
{
$lflags = "$lflags -L" . $withargs{"zlib-lib"} . " -lz";
}
else
{
$lflags = "$lflags -lz";
}
} }
else else
{ {
@@ -1362,7 +1418,7 @@ else {
$aes_obj=$aes_enc; $aes_obj=$aes_enc;
} }
$wp_obj="" if ($wp_obj =~ /mmx/ && $processor eq "386"); $wp_obj="" if ($wp_obj =~ /mmx/ && $processor eq "386");
if ($wp_obj =~ /\.o$/) if ($wp_obj =~ /\.o$/ && !$disabled{"whirlpool"})
{ {
$cflags.=" -DWHIRLPOOL_ASM"; $cflags.=" -DWHIRLPOOL_ASM";
} }
@@ -1407,6 +1463,16 @@ if ($shlib_version_number =~ /(^[0-9]*)\.([0-9\.]*)/)
$shlib_minor=$2; $shlib_minor=$2;
} }
if ($strict_warnings)
{
my $wopt;
die "ERROR --strict-warnings requires gcc" unless ($cc =~ /gcc$/);
foreach $wopt (split /\s+/, $gcc_devteam_warn)
{
$cflags .= " $wopt" unless ($cflags =~ /$wopt/)
}
}
open(IN,'<Makefile.org') || die "unable to read Makefile.org:$!\n"; open(IN,'<Makefile.org') || die "unable to read Makefile.org:$!\n";
unlink("$Makefile.new") || die "unable to remove old $Makefile.new:$!\n" if -e "$Makefile.new"; unlink("$Makefile.new") || die "unable to remove old $Makefile.new:$!\n" if -e "$Makefile.new";
open(OUT,">$Makefile.new") || die "unable to create $Makefile.new:$!\n"; open(OUT,">$Makefile.new") || die "unable to create $Makefile.new:$!\n";
@@ -1425,6 +1491,7 @@ while (<IN>)
} }
$sdirs = 0 unless /\\$/; $sdirs = 0 unless /\\$/;
s/engines // if (/^DIRS=/ && $disabled{"engine"}); s/engines // if (/^DIRS=/ && $disabled{"engine"});
s/ccgost// if (/^ENGDIRS=/ && $disabled{"gost"});
s/^VERSION=.*/VERSION=$version/; s/^VERSION=.*/VERSION=$version/;
s/^MAJOR=.*/MAJOR=$major/; s/^MAJOR=.*/MAJOR=$major/;
s/^MINOR=.*/MINOR=$minor/; s/^MINOR=.*/MINOR=$minor/;
@@ -1436,20 +1503,22 @@ while (<IN>)
s/^INSTALLTOP=.*$/INSTALLTOP=$prefix/; s/^INSTALLTOP=.*$/INSTALLTOP=$prefix/;
s/^MULTILIB=.*$/MULTILIB=$multilib/; s/^MULTILIB=.*$/MULTILIB=$multilib/;
s/^OPENSSLDIR=.*$/OPENSSLDIR=$openssldir/; s/^OPENSSLDIR=.*$/OPENSSLDIR=$openssldir/;
s/^LIBDIR=.*$/LIBDIR=$libdir/;
s/^INSTALL_PREFIX=.*$/INSTALL_PREFIX=$install_prefix/; s/^INSTALL_PREFIX=.*$/INSTALL_PREFIX=$install_prefix/;
s/^PLATFORM=.*$/PLATFORM=$target/; s/^PLATFORM=.*$/PLATFORM=$target/;
s/^OPTIONS=.*$/OPTIONS=$options/; s/^OPTIONS=.*$/OPTIONS=$options/;
s/^CONFIGURE_ARGS=.*$/CONFIGURE_ARGS=$argvstring/; s/^CONFIGURE_ARGS=.*$/CONFIGURE_ARGS=$argvstring/;
if ($cross_compile_prefix) if ($cross_compile_prefix)
{ {
s/^CC=.*$/CROSS_COMPILE_PREFIX= $cross_compile_prefix\nCC= \$\(CROSS_COMPILE_PREFIX\)$cc/; s/^CC=.*$/CROSS_COMPILE= $cross_compile_prefix\nCC= \$\(CROSS_COMPILE\)$cc/;
s/^AR=\s*/AR= \$\(CROSS_COMPILE_PREFIX\)/; s/^AR=\s*/AR= \$\(CROSS_COMPILE\)/;
s/^NM=\s*/NM= \$\(CROSS_COMPILE_PREFIX\)/; s/^NM=\s*/NM= \$\(CROSS_COMPILE\)/;
s/^RANLIB=\s*/RANLIB= \$\(CROSS_COMPILE_PREFIX\)/; s/^RANLIB=\s*/RANLIB= \$\(CROSS_COMPILE\)/;
s/^MAKEDEPPROG=.*$/MAKEDEPPROG= \$\(CROSS_COMPILE_PREFIX\)$cc/ if $cc eq "gcc"; s/^MAKEDEPPROG=.*$/MAKEDEPPROG= \$\(CROSS_COMPILE\)$cc/ if $cc eq "gcc";
} }
else { else {
s/^CC=.*$/CC= $cc/; s/^CC=.*$/CC= $cc/;
s/^AR=\s*ar/AR= $ar/;
s/^RANLIB=.*/RANLIB= $ranlib/; s/^RANLIB=.*/RANLIB= $ranlib/;
s/^MAKEDEPPROG=.*$/MAKEDEPPROG= $cc/ if $cc eq "gcc"; s/^MAKEDEPPROG=.*$/MAKEDEPPROG= $cc/ if $cc eq "gcc";
} }
@@ -1622,10 +1691,7 @@ while (<IN>)
} }
elsif (/^#define\s+ENGINESDIR/) elsif (/^#define\s+ENGINESDIR/)
{ {
# $foo is to become "$prefix/lib$multilib/engines"; my $foo = "$prefix/$libdir/engines";
# as Makefile.org and engines/Makefile are adapted for
# $multilib suffix.
my $foo = "$prefix/lib/engines";
$foo =~ s/\\/\\\\/g; $foo =~ s/\\/\\\\/g;
print OUT "#define ENGINESDIR \"$foo\"\n"; print OUT "#define ENGINESDIR \"$foo\"\n";
} }
@@ -1733,7 +1799,7 @@ if($IsMK1MF) {
EOF EOF
close(OUT); close(OUT);
} else { } else {
my $make_command = "make PERL=\'$perl\'"; my $make_command = "$make PERL=\'$perl\'";
my $make_targets = ""; my $make_targets = "";
$make_targets .= " links" if $symlink; $make_targets .= " links" if $symlink;
$make_targets .= " depend" if $depflags ne $default_depflags && $make_depend; $make_targets .= " depend" if $depflags ne $default_depflags && $make_depend;
@@ -1741,11 +1807,11 @@ EOF
(system $make_command.$make_targets) == 0 or exit $? (system $make_command.$make_targets) == 0 or exit $?
if $make_targets ne ""; if $make_targets ne "";
if ( $perl =~ m@^/@) { if ( $perl =~ m@^/@) {
&dofile("tools/c_rehash",$perl,'^#!/', '#!%s','^my \$dir;$', 'my $dir = "' . $openssldir . '";'); &dofile("tools/c_rehash",$perl,'^#!/', '#!%s','^my \$dir;$', 'my $dir = "' . $openssldir . '";', '^my \$prefix;$', 'my $prefix = "' . $prefix . '";');
&dofile("apps/CA.pl",$perl,'^#!/', '#!%s'); &dofile("apps/CA.pl",$perl,'^#!/', '#!%s');
} else { } else {
# No path for Perl known ... # No path for Perl known ...
&dofile("tools/c_rehash",'/usr/local/bin/perl','^#!/', '#!%s','^my \$dir;$', 'my $dir = "' . $openssldir . '";'); &dofile("tools/c_rehash",'/usr/local/bin/perl','^#!/', '#!%s','^my \$dir;$', 'my $dir = "' . $openssldir . '";', '^my \$prefix;$', 'my $prefix = "' . $prefix . '";');
&dofile("apps/CA.pl",'/usr/local/bin/perl','^#!/', '#!%s'); &dofile("apps/CA.pl",'/usr/local/bin/perl','^#!/', '#!%s');
} }
if ($depflags ne $default_depflags && !$make_depend) { if ($depflags ne $default_depflags && !$make_depend) {
@@ -1970,23 +2036,23 @@ sub test_sanity
{ {
@fields = split(/\s*:\s*/,$table{$target} . ":" x 30 , -1); @fields = split(/\s*:\s*/,$table{$target} . ":" x 30 , -1);
if ($fields[$idx_dso_scheme-1] =~ /^(dl|dlfcn|win32|vms)$/) if ($fields[$idx_dso_scheme-1] =~ /^(beos|dl|dlfcn|win32|vms)$/)
{ {
$errorcnt++; $errorcnt++;
print STDERR "SANITY ERROR: '$target' has the dso_scheme [$idx_dso_scheme] values\n"; print STDERR "SANITY ERROR: '$target' has the dso_scheme [$idx_dso_scheme] values\n";
print STDERR " in the previous field\n"; print STDERR " in the previous field\n";
} }
elsif ($fields[$idx_dso_scheme+1] =~ /^(dl|dlfcn|win32|vms)$/) elsif ($fields[$idx_dso_scheme+1] =~ /^(beos|dl|dlfcn|win32|vms)$/)
{ {
$errorcnt++; $errorcnt++;
print STDERR "SANITY ERROR: '$target' has the dso_scheme [$idx_dso_scheme] values\n"; print STDERR "SANITY ERROR: '$target' has the dso_scheme [$idx_dso_scheme] values\n";
print STDERR " in the following field\n"; print STDERR " in the following field\n";
} }
elsif ($fields[$idx_dso_scheme] !~ /^(dl|dlfcn|win32|vms|)$/) elsif ($fields[$idx_dso_scheme] !~ /^(beos|dl|dlfcn|win32|vms|)$/)
{ {
$errorcnt++; $errorcnt++;
print STDERR "SANITY ERROR: '$target' has the dso_scheme [$idx_dso_scheme] field = ",$fields[$idx_dso_scheme],"\n"; print STDERR "SANITY ERROR: '$target' has the dso_scheme [$idx_dso_scheme] field = ",$fields[$idx_dso_scheme],"\n";
print STDERR " valid values are 'dl', 'dlfcn', 'win32' and 'vms'\n"; print STDERR " valid values are 'beos', 'dl', 'dlfcn', 'win32' and 'vms'\n";
} }
} }
print STDERR "No sanity errors detected!\n" if $errorcnt == 0; print STDERR "No sanity errors detected!\n" if $errorcnt == 0;

104
FAQ
View File

@@ -10,6 +10,7 @@ OpenSSL - Frequently Asked Questions
* Why aren't tools like 'autoconf' and 'libtool' used? * Why aren't tools like 'autoconf' and 'libtool' used?
* What is an 'engine' version? * What is an 'engine' version?
* How do I check the authenticity of the OpenSSL distribution? * How do I check the authenticity of the OpenSSL distribution?
* How does the versioning scheme work?
[LEGAL] Legal questions [LEGAL] Legal questions
@@ -52,6 +53,9 @@ OpenSSL - Frequently Asked Questions
* Why does the OpenSSL test suite fail in sha512t on x86 CPU? * Why does the OpenSSL test suite fail in sha512t on x86 CPU?
* Why does compiler fail to compile sha512.c? * Why does compiler fail to compile sha512.c?
* Test suite still fails, what to do? * Test suite still fails, what to do?
* I think I've found a bug, what should I do?
* I'm SURE I've found a bug, how do I report it?
* I've found a security issue, how do I report it?
[PROG] Questions about programming with OpenSSL [PROG] Questions about programming with OpenSSL
@@ -70,6 +74,7 @@ OpenSSL - Frequently Asked Questions
* I think I've detected a memory leak, is this a bug? * I think I've detected a memory leak, is this a bug?
* Why does Valgrind complain about the use of uninitialized data? * Why does Valgrind complain about the use of uninitialized data?
* Why doesn't a memory BIO work when a file does? * Why doesn't a memory BIO work when a file does?
* Where are the declarations and implementations of d2i_X509() etc?
=============================================================================== ===============================================================================
@@ -78,11 +83,11 @@ OpenSSL - Frequently Asked Questions
* Which is the current version of OpenSSL? * Which is the current version of OpenSSL?
The current version is available from <URL: http://www.openssl.org>. The current version is available from <URL: http://www.openssl.org>.
OpenSSL 0.9.8k was released on Mar 25th, 2009. OpenSSL 1.0.1c was released on Feb 5th, 2013.
In addition to the current stable release, you can also access daily In addition to the current stable release, you can also access daily
snapshots of the OpenSSL development version at <URL: snapshots of the OpenSSL development version at <URL:
ftp://ftp.openssl.org/snapshot/>, or get it by anonymous CVS access. ftp://ftp.openssl.org/snapshot/>, or get it by anonymous Git access.
* Where is the documentation? * Where is the documentation?
@@ -94,19 +99,19 @@ explains how to install this library.
OpenSSL includes a command line utility that can be used to perform a OpenSSL includes a command line utility that can be used to perform a
variety of cryptographic functions. It is described in the openssl(1) variety of cryptographic functions. It is described in the openssl(1)
manpage. Documentation for developers is currently being written. A manpage. Documentation for developers is currently being written. Many
few manual pages already are available; overviews over libcrypto and manual pages are available; overviews over libcrypto and
libssl are given in the crypto(3) and ssl(3) manpages. libssl are given in the crypto(3) and ssl(3) manpages.
The OpenSSL manpages are installed in /usr/local/ssl/man/ (or a The OpenSSL manpages are installed in /usr/local/ssl/man/ (or a
different directory if you specified one as described in INSTALL). different directory if you specified one as described in INSTALL).
In addition, you can read the most current versions at In addition, you can read the most current versions at
<URL: http://www.openssl.org/docs/>. <URL: http://www.openssl.org/docs/>. Note that the online documents refer
to the very latest development versions of OpenSSL and may include features
For information on parts of libcrypto that are not yet documented, you not present in released versions. If in doubt refer to the documentation
might want to read Ariel Glenn's documentation on SSLeay 0.9, OpenSSL's that came with the version of OpenSSL you are using. The pod format
predecessor, at <URL: http://www.columbia.edu/~ariel/ssleay/>. Much documentation is included in each OpenSSL distribution under the docs
of this still applies to OpenSSL. directory.
There is some documentation about certificate extensions and PKCS#12 There is some documentation about certificate extensions and PKCS#12
in doc/openssl.txt in doc/openssl.txt
@@ -127,7 +132,7 @@ OpenSSL. Information on the OpenSSL mailing lists is available from
* Where can I get a compiled version of OpenSSL? * Where can I get a compiled version of OpenSSL?
You can finder pointers to binary distributions in You can finder pointers to binary distributions in
http://www.openssl.org/related/binaries.html . <URL: http://www.openssl.org/related/binaries.html> .
Some applications that use OpenSSL are distributed in binary form. Some applications that use OpenSSL are distributed in binary form.
When using such an application, you don't need to install OpenSSL When using such an application, you don't need to install OpenSSL
@@ -166,6 +171,19 @@ just do:
pgp TARBALL.asc pgp TARBALL.asc
* How does the versioning scheme work?
After the release of OpenSSL 1.0.0 the versioning scheme changed. Letter
releases (e.g. 1.0.1a) can only contain bug and security fixes and no
new features. Minor releases change the last number (e.g. 1.0.2) and
can contain new features that retain binary compatibility. Changes to
the middle number are considered major releases and neither source nor
binary compatibility is guaranteed.
Therefore the answer to the common question "when will feature X be
backported to OpenSSL 1.0.0/0.9.8?" is "never" but it could appear
in the next minor release.
[LEGAL] ======================================================================= [LEGAL] =======================================================================
* Do I need patent licenses to use OpenSSL? * Do I need patent licenses to use OpenSSL?
@@ -277,7 +295,7 @@ current directory in this case, but this has changed with 0.9.6a.)
Check out the CA.pl(1) manual page. This provides a simple wrapper round Check out the CA.pl(1) manual page. This provides a simple wrapper round
the 'req', 'verify', 'ca' and 'pkcs12' utilities. For finer control check the 'req', 'verify', 'ca' and 'pkcs12' utilities. For finer control check
out the manual pages for the individual utilities and the certificate out the manual pages for the individual utilities and the certificate
extensions documentation (currently in doc/openssl.txt). extensions documentation (in ca(1), req(1), x509v3_config(5) )
* Why can't I create certificate requests? * Why can't I create certificate requests?
@@ -459,7 +477,7 @@ administrators.
Other projects do have other policies so you can for example extract the CA Other projects do have other policies so you can for example extract the CA
bundle used by Mozilla and/or modssl as described in this article: bundle used by Mozilla and/or modssl as described in this article:
http://www.mail-archive.com/modssl-users@modssl.org/msg16980.html <URL: http://www.mail-archive.com/modssl-users@modssl.org/msg16980.html>
[BUILD] ======================================================================= [BUILD] =======================================================================
@@ -501,7 +519,7 @@ when you run the test suite (using "make test"). The message returned is
"bc: 1 not implemented". "bc: 1 not implemented".
The best way to deal with this is to find another implementation of bc The best way to deal with this is to find another implementation of bc
and compile/install it. GNU bc (see http://www.gnu.org/software/software.html and compile/install it. GNU bc (see <URL: http://www.gnu.org/software/software.html>
for download instructions) can be safely used, for example. for download instructions) can be safely used, for example.
@@ -512,7 +530,7 @@ that the OpenSSL bntest throws at it. This gets triggered when you run the
test suite (using "make test"). The message returned is "bc: stack empty". test suite (using "make test"). The message returned is "bc: stack empty".
The best way to deal with this is to find another implementation of bc The best way to deal with this is to find another implementation of bc
and compile/install it. GNU bc (see http://www.gnu.org/software/software.html and compile/install it. GNU bc (see <URL: http://www.gnu.org/software/software.html>
for download instructions) can be safely used, for example. for download instructions) can be safely used, for example.
@@ -705,6 +723,49 @@ never make sense, and tend to emerge when you least expect them. In order
to identify one, drop optimization level, e.g. by editing CFLAG line in to identify one, drop optimization level, e.g. by editing CFLAG line in
top-level Makefile, recompile and re-run the test. top-level Makefile, recompile and re-run the test.
* I think I've found a bug, what should I do?
If you are a new user then it is quite likely you haven't found a bug and
something is happening you aren't familiar with. Check this FAQ, the associated
documentation and the mailing lists for similar queries. If you are still
unsure whether it is a bug or not submit a query to the openssl-users mailing
list.
* I'm SURE I've found a bug, how do I report it?
Bug reports with no security implications should be sent to the request
tracker. This can be done by mailing the report to <rt@openssl.org> (or its
alias <openssl-bugs@openssl.org>), please note that messages sent to the
request tracker also appear in the public openssl-dev mailing list.
The report should be in plain text. Any patches should be sent as
plain text attachments because some mailers corrupt patches sent inline.
If your issue affects multiple versions of OpenSSL check any patches apply
cleanly and, if possible include patches to each affected version.
The report should be given a meaningful subject line briefly summarising the
issue. Just "bug in OpenSSL" or "bug in OpenSSL 0.9.8n" is not very helpful.
By sending reports to the request tracker the bug can then be given a priority
and assigned to the appropriate maintainer. The history of discussions can be
accessed and if the issue has been addressed or a reason why not. If patches
are only sent to openssl-dev they can be mislaid if a team member has to
wade through months of old messages to review the discussion.
See also <URL: http://www.openssl.org/support/rt.html>
* I've found a security issue, how do I report it?
If you think your bug has security implications then please send it to
openssl-security@openssl.org if you don't get a prompt reply at least
acknowledging receipt then resend or mail it directly to one of the
more active team members (e.g. Steve).
Note that bugs only present in the openssl utility are not in general
considered to be security issues.
[PROG] ======================================================================== [PROG] ========================================================================
* Is OpenSSL thread-safe? * Is OpenSSL thread-safe?
@@ -718,7 +779,7 @@ file.
Multi-threaded applications must provide two callback functions to Multi-threaded applications must provide two callback functions to
OpenSSL by calling CRYPTO_set_locking_callback() and OpenSSL by calling CRYPTO_set_locking_callback() and
CRYPTO_set_id_callback(), for all versions of OpenSSL up to and CRYPTO_set_id_callback(), for all versions of OpenSSL up to and
including 0.9.8[abc...]. As of version 0.9.9, CRYPTO_set_id_callback() including 0.9.8[abc...]. As of version 1.0.0, CRYPTO_set_id_callback()
and associated APIs are deprecated by CRYPTO_THREADID_set_callback() and associated APIs are deprecated by CRYPTO_THREADID_set_callback()
and friends. This is described in the threads(3) manpage. and friends. This is described in the threads(3) manpage.
@@ -964,4 +1025,15 @@ is needed. This must be done by calling:
See the manual pages for more details. See the manual pages for more details.
* Where are the declarations and implementations of d2i_X509() etc?
These are defined and implemented by macros of the form:
DECLARE_ASN1_FUNCTIONS(X509) and IMPLEMENT_ASN1_FUNCTIONS(X509)
The implementation passes an ASN1 "template" defining the structure into an
ASN1 interpreter using generalised functions such as ASN1_item_d2i().
=============================================================================== ===============================================================================

View File

@@ -103,6 +103,12 @@
define preprocessor symbols, specify additional libraries, define preprocessor symbols, specify additional libraries,
library directories or other compiler options. library directories or other compiler options.
-DHAVE_CRYPTODEV Enable the BSD cryptodev engine even if we are not using
BSD. Useful if you are running ocf-linux or something
similar. Once enabled you can also enable the use of
cryptodev digests, which is usually slower unless you have
large amounts data. Use -DUSE_CRYPTODEV_DIGESTS to force
it.
Installation in Detail Installation in Detail
---------------------- ----------------------

View File

@@ -71,7 +71,7 @@ the top to understand how to use them. However, if you want to
compile all you can get, the simplest is to use MAKEVMS.COM in the top compile all you can get, the simplest is to use MAKEVMS.COM in the top
directory. The syntax is the following: directory. The syntax is the following:
@MAKEVMS <option> <rsaref-p> <debug-p> [<compiler>] @MAKEVMS <option> <bits> <debug-p> [<compiler>]
<option> must be one of the following: <option> must be one of the following:
@@ -87,24 +87,11 @@ directory. The syntax is the following:
TEST Just build the "[.xxx.EXE.TEST]" test programs for OpenSSL. TEST Just build the "[.xxx.EXE.TEST]" test programs for OpenSSL.
APPS Just build the "[.xxx.EXE.APPS]" application programs for OpenSSL. APPS Just build the "[.xxx.EXE.APPS]" application programs for OpenSSL.
<rsaref-p> must be one of the following: <bits> must be one of the following:
RSAREF compile using the RSAREF Library "" compile using default pointer size
NORSAREF compile without using RSAREF 32 compile using 32 bit pointer size
64 compile using 64 bit pointer size
Note 0: The RSAREF library IS NO LONGER NEEDED. The RSA patent
expires September 20, 2000, and RSA Security chose to make
the algorithm public domain two weeks before that.
Note 1: If you still want to use RSAREF, the library is NOT INCLUDED
and you have to download it. RSA Security doesn't carry it
any more, but there are a number of places where you can find
it. You have to get the ".tar-Z" file as the ".zip" file
doesn't have the directory structure stored. You have to
extract the file into the [.RSAREF] directory as that is where
the scripts will look for the files.
Note 2: I have never done this, so I've no idea if it works or not.
<debug-p> must be one of the following: <debug-p> must be one of the following:
@@ -117,12 +104,13 @@ Note 2: I have never done this, so I've no idea if it works or not.
GNUC For GNU C. GNUC For GNU C.
You will find the crypto library in [.xxx.EXE.CRYPTO], called LIBCRYPTO.OLB, You will find the crypto library in [.xxx.EXE.CRYPTO] (where xxx is VAX,
where xxx is VAX or AXP. You will find the SSL library in [.xxx.EXE.SSL], ALPHA or IA64), called SSL_LIBCRYPTO32.OLB or SSL_LIBCRYPTO.OLB depending
named LIBSSL.OLB, and you will find a bunch of useful programs in on how it was built. You will find the SSL library in [.xxx.EXE.SSL],
[.xxx.EXE.APPS]. However, these shouldn't be used right off unless it's named SSL_LIBSSL32.OLB or SSL_LIBSSL.OLB, and you will find a bunch of
just to test them. For production use, make sure you install first, see useful programs in [.xxx.EXE.APPS]. However, these shouldn't be used
Installation below. right off unless it's just to test them. For production use, make sure
you install first, see Installation below.
Note 1: Some programs in this package require a TCP/IP library. Note 1: Some programs in this package require a TCP/IP library.
@@ -170,12 +158,14 @@ Installation:
Installation is easy, just do the following: Installation is easy, just do the following:
@INSTALL <root> @INSTALL <root> <bits>
<root> is the directory in which everything will be installed, <root> is the directory in which everything will be installed,
subdirectories, libraries, header files, programs and startup command subdirectories, libraries, header files, programs and startup command
procedures. procedures.
<bits> works the same way as for MAKEVMS.COM
N.B.: INSTALL.COM builds a new directory structure, different from N.B.: INSTALL.COM builds a new directory structure, different from
the directory tree where you have now build OpenSSL. the directory tree where you have now build OpenSSL.
@@ -196,6 +186,10 @@ following command procedures:
sets up the symbols to the applications. Should be called sets up the symbols to the applications. Should be called
from for example SYS$MANAGER:SYLOGIN.COM from for example SYS$MANAGER:SYLOGIN.COM
OPENSSL_UNDO.COM
deassigns the logical names created with OPENSSL_STARTUP.COM.
The logical names that are set up are the following: The logical names that are set up are the following:
SSLROOT a dotted concealed logical name pointing at the SSLROOT a dotted concealed logical name pointing at the
@@ -203,7 +197,6 @@ The logical names that are set up are the following:
SSLCERTS Initially an empty directory, this is the default SSLCERTS Initially an empty directory, this is the default
location for certificate files. location for certificate files.
SSLMISC Various scripts.
SSLPRIVATE Initially an empty directory, this is the default SSLPRIVATE Initially an empty directory, this is the default
location for private key files. location for private key files.
@@ -211,8 +204,9 @@ The logical names that are set up are the following:
programs. programs.
SSLINCLUDE Contains the header files needed if you want to SSLINCLUDE Contains the header files needed if you want to
compile programs with libcrypto or libssl. compile programs with libcrypto or libssl.
SSLLIB Contains the OpenSSL library files (LIBCRYPTO.OLB SSLLIB Contains the OpenSSL library files themselves:
and LIBSSL.OLB) themselves. - SSL_LIBCRYPTO32.OLB and SSL_LIBSSL32.OLB or
- SSL_LIBCRYPTO.OLB and SSL_LIBSSL.OLB
OPENSSL Same as SSLINCLUDE. This is because the standard OPENSSL Same as SSLINCLUDE. This is because the standard
way to include OpenSSL header files from version way to include OpenSSL header files from version
@@ -296,4 +290,4 @@ have any ideas.
-- --
Richard Levitte <richard@levitte.org> Richard Levitte <richard@levitte.org>
2000-02-27 2000-02-27, 2011-03-18

View File

@@ -27,9 +27,9 @@
- Netwide Assembler, a.k.a. NASM, available from http://nasm.sourceforge.net/ - Netwide Assembler, a.k.a. NASM, available from http://nasm.sourceforge.net/
is required if you intend to utilize assembler modules. Note that NASM is required if you intend to utilize assembler modules. Note that NASM
is the only supported assembler. is now the only supported assembler.
If you are compiling from a tarball or a CVS snapshot then the Win32 files If you are compiling from a tarball or a Git snapshot then the Win32 files
may well be not up to date. This may mean that some "tweaking" is required to may well be not up to date. This may mean that some "tweaking" is required to
get it all to work. See the trouble shooting section later on for if (when?) get it all to work. See the trouble shooting section later on for if (when?)
it goes wrong. it goes wrong.
@@ -41,9 +41,9 @@
C++, then you will need already mentioned Netwide Assembler binary, C++, then you will need already mentioned Netwide Assembler binary,
nasmw.exe or nasm.exe, to be available on your %PATH%. nasmw.exe or nasm.exe, to be available on your %PATH%.
Firstly you should run Configure: Firstly you should run Configure with platform VC-WIN32:
> perl Configure VC-WIN32 --prefix=c:/some/openssl/dir > perl Configure VC-WIN32 --prefix=c:\some\openssl\dir
Where the prefix argument specifies where OpenSSL will be installed to. Where the prefix argument specifies where OpenSSL will be installed to.
@@ -56,6 +56,7 @@
- If you don't want to use the assembly language files at all then run: - If you don't want to use the assembly language files at all then run:
> perl Configure VC-WIN32 no-asm --prefix=c:/some/openssl/dir
> ms\do_ms > ms\do_ms
If you get errors about things not having numbers assigned then check the If you get errors about things not having numbers assigned then check the
@@ -80,16 +81,13 @@
There are various changes you can make to the Win32 compile There are various changes you can make to the Win32 compile
environment. By default the library is not compiled with debugging environment. By default the library is not compiled with debugging
symbols. If you add 'debug' to the mk1mf.pl lines in the do_* batch symbols. If you use the platform debug-VC-WIN32 instead of VC-WIN32
file then debugging symbols will be compiled in. Note that mk1mf.pl then debugging symbols will be compiled in.
expects the platform to be the last argument on the command line, so
'debug' must appear before that, as all other options.
By default in 1.0.0 OpenSSL will compile builtin ENGINES into the
By default in 0.9.8 OpenSSL will compile builtin ENGINES into the separate shared librariesy. If you specify the "enable-static-engine"
libeay32.dll shared library. If you specify the "no-static-engine"
option on the command line to Configure the shared library build option on the command line to Configure the shared library build
(ms\ntdll.mak) will compile the engines as separate DLLs. (ms\ntdll.mak) will compile the engines into libeay32.dll instead.
The default Win32 environment is to leave out any Windows NT specific The default Win32 environment is to leave out any Windows NT specific
features. features.
@@ -102,7 +100,6 @@
ms\nt.mak ms\nt.mak
Borland C++ builder 5 Borland C++ builder 5
--------------------- ---------------------
@@ -188,6 +185,15 @@
required. Run the installers and do whatever magic they say it takes required. Run the installers and do whatever magic they say it takes
to start MSYS bash shell with GNU tools on its PATH. to start MSYS bash shell with GNU tools on its PATH.
N.B. Since source tar-ball can contain symbolic links, it's essential
that you use accompanying MSYS tar to unpack the source. It will
either handle them in one way or another or fail to extract them,
which does the trick too. Latter means that you may safely ignore all
"cannot create symlink" messages, as they will be "re-created" at
configure stage by copying corresponding files. Alternative programs
were observed to create empty files instead, which results in build
failure.
* Compile OpenSSL: * Compile OpenSSL:
$ ./config $ ./config
@@ -251,7 +257,7 @@
then ms\do_XXX should not give a warning any more. However the numbers that then ms\do_XXX should not give a warning any more. However the numbers that
get assigned by this technique may not match those that eventually get get assigned by this technique may not match those that eventually get
assigned in the CVS tree: so anything linked against this version of the assigned in the Git tree: so anything linked against this version of the
library may need to be recompiled. library may need to be recompiled.
If you get errors about unresolved symbols there are several possible If you get errors about unresolved symbols there are several possible
@@ -300,7 +306,18 @@
desktop, which is not available to service processes. The toolkit is desktop, which is not available to service processes. The toolkit is
designed to detect in which context it's currently executed, GUI, designed to detect in which context it's currently executed, GUI,
console app or service, and act accordingly, namely whether or not to console app or service, and act accordingly, namely whether or not to
actually make GUI calls. actually make GUI calls. Additionally those who wish to
/DELAYLOAD:GDI32.DLL and /DELAYLOAD:USER32.DLL and actually keep them
off service process should consider implementing and exporting from
.exe image in question own _OPENSSL_isservice not relying on USER32.DLL.
E.g., on Windows Vista and later you could:
__declspec(dllexport) __cdecl BOOL _OPENSSL_isservice(void)
{ DWORD sess;
if (ProcessIdToSessionId(GetCurrentProcessId(),&sess))
return sess==0;
return FALSE;
}
If you link with OpenSSL .DLLs, then you're expected to include into If you link with OpenSSL .DLLs, then you're expected to include into
your application code small "shim" snippet, which provides glue between your application code small "shim" snippet, which provides glue between

View File

@@ -12,7 +12,7 @@
--------------- ---------------
/* ==================================================================== /* ====================================================================
* Copyright (c) 1998-2008 The OpenSSL Project. All rights reserved. * Copyright (c) 1998-2011 The OpenSSL Project. All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions

View File

@@ -71,6 +71,7 @@ PERL= perl
TAR= tar TAR= tar
TARFLAGS= --no-recursion TARFLAGS= --no-recursion
MAKEDEPPROG=makedepend MAKEDEPPROG=makedepend
LIBDIR=lib
# We let the C compiler driver to take care of .s files. This is done in # We let the C compiler driver to take care of .s files. This is done in
# order to be excused from maintaining a separate set of architecture # order to be excused from maintaining a separate set of architecture
@@ -109,6 +110,7 @@ ZLIB_INCLUDE=
LIBZLIB= LIBZLIB=
DIRS= crypto ssl engines apps test tools DIRS= crypto ssl engines apps test tools
ENGDIRS= ccgost
SHLIBDIRS= crypto ssl SHLIBDIRS= crypto ssl
# dirs in crypto to build # dirs in crypto to build
@@ -170,7 +172,7 @@ CLEARENV= TOP= && unset TOP $${LIB+LIB} $${LIBS+LIBS} \
$${EXHEADER+EXHEADER} $${HEADER+HEADER} \ $${EXHEADER+EXHEADER} $${HEADER+HEADER} \
$${GENERAL+GENERAL} $${CFLAGS+CFLAGS} \ $${GENERAL+GENERAL} $${CFLAGS+CFLAGS} \
$${ASFLAGS+ASFLAGS} $${AFLAGS+AFLAGS} \ $${ASFLAGS+ASFLAGS} $${AFLAGS+AFLAGS} \
$${LDCMD+LDCMD} $${LDFLAGS+LDFLAGS} \ $${LDCMD+LDCMD} $${LDFLAGS+LDFLAGS} $${SCRIPTS+SCRIPTS} \
$${SHAREDCMD+SHAREDCMD} $${SHAREDFLAGS+SHAREDFLAGS} \ $${SHAREDCMD+SHAREDCMD} $${SHAREDFLAGS+SHAREDFLAGS} \
$${SHARED_LIB+SHARED_LIB} $${LIBEXTRAS+LIBEXTRAS} $${SHARED_LIB+SHARED_LIB} $${LIBEXTRAS+LIBEXTRAS}
@@ -178,16 +180,18 @@ BUILDENV= PLATFORM='$(PLATFORM)' PROCESSOR='$(PROCESSOR)' \
CC='$(CC)' CFLAG='$(CFLAG)' \ CC='$(CC)' CFLAG='$(CFLAG)' \
AS='$(CC)' ASFLAG='$(CFLAG) -c' \ AS='$(CC)' ASFLAG='$(CFLAG) -c' \
AR='$(AR)' NM='$(NM)' RANLIB='$(RANLIB)' \ AR='$(AR)' NM='$(NM)' RANLIB='$(RANLIB)' \
CROSS_COMPILE_PREFIX='$(CROSS_COMPILE_PREFIX)' \ CROSS_COMPILE='$(CROSS_COMPILE)' \
PERL='$(PERL)' \ PERL='$(PERL)' ENGDIRS='$(ENGDIRS)' \
SDIRS='$(SDIRS)' LIBRPATH='$(INSTALLTOP)/lib' \ SDIRS='$(SDIRS)' LIBRPATH='$(INSTALLTOP)/$(LIBDIR)' \
INSTALL_PREFIX='$(INSTALL_PREFIX)' \ INSTALL_PREFIX='$(INSTALL_PREFIX)' \
INSTALLTOP='$(INSTALLTOP)' OPENSSLDIR='$(OPENSSLDIR)' \ INSTALLTOP='$(INSTALLTOP)' OPENSSLDIR='$(OPENSSLDIR)' \
LIBDIR='$(LIBDIR)' \
MAKEDEPEND='$$$${TOP}/util/domd $$$${TOP} -MD $(MAKEDEPPROG)' \ MAKEDEPEND='$$$${TOP}/util/domd $$$${TOP} -MD $(MAKEDEPPROG)' \
DEPFLAG='-DOPENSSL_NO_DEPRECATED $(DEPFLAG)' \ DEPFLAG='-DOPENSSL_NO_DEPRECATED $(DEPFLAG)' \
MAKEDEPPROG='$(MAKEDEPPROG)' \ MAKEDEPPROG='$(MAKEDEPPROG)' \
SHARED_LDFLAGS='$(SHARED_LDFLAGS)' \ SHARED_LDFLAGS='$(SHARED_LDFLAGS)' \
KRB5_INCLUDES='$(KRB5_INCLUDES)' LIBKRB5='$(LIBKRB5)' \ KRB5_INCLUDES='$(KRB5_INCLUDES)' LIBKRB5='$(LIBKRB5)' \
ZLIB_INCLUDE='$(ZLIB_INCLUDE)' LIBZLIB='$(LIBZLIB)' \
EXE_EXT='$(EXE_EXT)' SHARED_LIBS='$(SHARED_LIBS)' \ EXE_EXT='$(EXE_EXT)' SHARED_LIBS='$(SHARED_LIBS)' \
SHLIB_EXT='$(SHLIB_EXT)' SHLIB_TARGET='$(SHLIB_TARGET)' \ SHLIB_EXT='$(SHLIB_EXT)' SHLIB_TARGET='$(SHLIB_TARGET)' \
PEX_LIBS='$(PEX_LIBS)' EX_LIBS='$(EX_LIBS)' \ PEX_LIBS='$(PEX_LIBS)' EX_LIBS='$(EX_LIBS)' \
@@ -297,7 +301,7 @@ build-shared: do_$(SHLIB_TARGET) link-shared
do_$(SHLIB_TARGET): do_$(SHLIB_TARGET):
@ set -e; libs='-L. $(SHLIBDEPS)'; for i in $(SHLIBDIRS); do \ @ set -e; libs='-L. $(SHLIBDEPS)'; for i in $(SHLIBDIRS); do \
if [ "$(SHLIBDIRS)" = "ssl" -a -n "$(LIBKRB5)" ]; then \ if [ "$$i" = "ssl" -a -n "$(LIBKRB5)" ]; then \
libs="$(LIBKRB5) $$libs"; \ libs="$(LIBKRB5) $$libs"; \
fi; \ fi; \
$(CLEARENV) && $(MAKE) -f Makefile.shared -e $(BUILDENV) \ $(CLEARENV) && $(MAKE) -f Makefile.shared -e $(BUILDENV) \
@@ -311,40 +315,43 @@ do_$(SHLIB_TARGET):
libcrypto.pc: Makefile libcrypto.pc: Makefile
@ ( echo 'prefix=$(INSTALLTOP)'; \ @ ( echo 'prefix=$(INSTALLTOP)'; \
echo 'exec_prefix=$${prefix}'; \ echo 'exec_prefix=$${prefix}'; \
echo 'libdir=$${exec_prefix}/lib'; \ echo 'libdir=$${exec_prefix}/$(LIBDIR)'; \
echo 'includedir=$${prefix}/include'; \ echo 'includedir=$${prefix}/include'; \
echo ''; \ echo ''; \
echo 'Name: OpenSSL-libcrypto'; \ echo 'Name: OpenSSL-libcrypto'; \
echo 'Description: OpenSSL cryptography library'; \ echo 'Description: OpenSSL cryptography library'; \
echo 'Version: '$(VERSION); \ echo 'Version: '$(VERSION); \
echo 'Requires: '; \ echo 'Requires: '; \
echo 'Libs: -L$${libdir} -lcrypto $(EX_LIBS)'; \ echo 'Libs: -L$${libdir} -lcrypto'; \
echo 'Libs.private: $(EX_LIBS)'; \
echo 'Cflags: -I$${includedir} $(KRB5_INCLUDES)' ) > libcrypto.pc echo 'Cflags: -I$${includedir} $(KRB5_INCLUDES)' ) > libcrypto.pc
libssl.pc: Makefile libssl.pc: Makefile
@ ( echo 'prefix=$(INSTALLTOP)'; \ @ ( echo 'prefix=$(INSTALLTOP)'; \
echo 'exec_prefix=$${prefix}'; \ echo 'exec_prefix=$${prefix}'; \
echo 'libdir=$${exec_prefix}/lib'; \ echo 'libdir=$${exec_prefix}/$(LIBDIR)'; \
echo 'includedir=$${prefix}/include'; \ echo 'includedir=$${prefix}/include'; \
echo ''; \ echo ''; \
echo 'Name: OpenSSL'; \ echo 'Name: OpenSSL'; \
echo 'Description: Secure Sockets Layer and cryptography libraries'; \ echo 'Description: Secure Sockets Layer and cryptography libraries'; \
echo 'Version: '$(VERSION); \ echo 'Version: '$(VERSION); \
echo 'Requires: '; \ echo 'Requires: '; \
echo 'Libs: -L$${libdir} -lssl -lcrypto $(EX_LIBS)'; \ echo 'Libs: -L$${libdir} -lssl -lcrypto'; \
echo 'Libs.private: $(EX_LIBS)'; \
echo 'Cflags: -I$${includedir} $(KRB5_INCLUDES)' ) > libssl.pc echo 'Cflags: -I$${includedir} $(KRB5_INCLUDES)' ) > libssl.pc
openssl.pc: Makefile openssl.pc: Makefile
@ ( echo 'prefix=$(INSTALLTOP)'; \ @ ( echo 'prefix=$(INSTALLTOP)'; \
echo 'exec_prefix=$${prefix}'; \ echo 'exec_prefix=$${prefix}'; \
echo 'libdir=$${exec_prefix}/lib'; \ echo 'libdir=$${exec_prefix}/$(LIBDIR)'; \
echo 'includedir=$${prefix}/include'; \ echo 'includedir=$${prefix}/include'; \
echo ''; \ echo ''; \
echo 'Name: OpenSSL'; \ echo 'Name: OpenSSL'; \
echo 'Description: Secure Sockets Layer and cryptography libraries and tools'; \ echo 'Description: Secure Sockets Layer and cryptography libraries and tools'; \
echo 'Version: '$(VERSION); \ echo 'Version: '$(VERSION); \
echo 'Requires: '; \ echo 'Requires: '; \
echo 'Libs: -L$${libdir} -lssl -lcrypto $(EX_LIBS)'; \ echo 'Libs: -L$${libdir} -lssl -lcrypto'; \
echo 'Libs.private: $(EX_LIBS)'; \
echo 'Cflags: -I$${includedir} $(KRB5_INCLUDES)' ) > openssl.pc echo 'Cflags: -I$${includedir} $(KRB5_INCLUDES)' ) > openssl.pc
Makefile: Makefile.org Configure config Makefile: Makefile.org Configure config
@@ -390,7 +397,7 @@ dclean:
rehash: rehash.time rehash: rehash.time
rehash.time: certs apps rehash.time: certs apps
@if [ -z "$(CROSS_COMPILE_PREFIX)" ]; then \ @if [ -z "$(CROSS_COMPILE)" ]; then \
(OPENSSL="`pwd`/util/opensslwrap.sh"; \ (OPENSSL="`pwd`/util/opensslwrap.sh"; \
[ -x "apps/openssl.exe" ] && OPENSSL="apps/openssl.exe" || :; \ [ -x "apps/openssl.exe" ] && OPENSSL="apps/openssl.exe" || :; \
OPENSSL_DEBUG_MEMORY=on; \ OPENSSL_DEBUG_MEMORY=on; \
@@ -403,8 +410,8 @@ test: tests
tests: rehash tests: rehash
@(cd test && echo "testing..." && \ @(cd test && echo "testing..." && \
$(CLEARENV) && $(MAKE) -e $(BUILDENV) TOP=.. TESTS='$(TESTS)' OPENSSL_DEBUG_MEMORY=on tests ); $(CLEARENV) && $(MAKE) -e $(BUILDENV) TOP=.. TESTS='$(TESTS)' OPENSSL_DEBUG_MEMORY=on OPENSSL_CONF=../apps/openssl.cnf tests );
util/opensslwrap.sh version -a OPENSSL_CONF=apps/openssl.cnf util/opensslwrap.sh version -a
report: report:
@$(PERL) util/selftest.pl @$(PERL) util/selftest.pl
@@ -492,9 +499,9 @@ install: all install_docs install_sw
install_sw: install_sw:
@$(PERL) $(TOP)/util/mkdir-p.pl $(INSTALL_PREFIX)$(INSTALLTOP)/bin \ @$(PERL) $(TOP)/util/mkdir-p.pl $(INSTALL_PREFIX)$(INSTALLTOP)/bin \
$(INSTALL_PREFIX)$(INSTALLTOP)/lib \ $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR) \
$(INSTALL_PREFIX)$(INSTALLTOP)/lib/engines \ $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines \
$(INSTALL_PREFIX)$(INSTALLTOP)/lib/pkgconfig \ $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/pkgconfig \
$(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl \ $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl \
$(INSTALL_PREFIX)$(OPENSSLDIR)/misc \ $(INSTALL_PREFIX)$(OPENSSLDIR)/misc \
$(INSTALL_PREFIX)$(OPENSSLDIR)/certs \ $(INSTALL_PREFIX)$(OPENSSLDIR)/certs \
@@ -509,10 +516,10 @@ install_sw:
do \ do \
if [ -f "$$i" ]; then \ if [ -f "$$i" ]; then \
( echo installing $$i; \ ( echo installing $$i; \
cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \ cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
$(RANLIB) $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \ $(RANLIB) $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \ chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i ); \ mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i ); \
fi; \ fi; \
done; done;
@set -e; if [ -n "$(SHARED_LIBS)" ]; then \ @set -e; if [ -n "$(SHARED_LIBS)" ]; then \
@@ -522,17 +529,17 @@ install_sw:
if [ -f "$$i" -o -f "$$i.a" ]; then \ if [ -f "$$i" -o -f "$$i.a" ]; then \
( echo installing $$i; \ ( echo installing $$i; \
if [ "$(PLATFORM)" != "Cygwin" ]; then \ if [ "$(PLATFORM)" != "Cygwin" ]; then \
cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \ cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
chmod 555 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \ chmod 555 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i; \ mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i; \
else \ else \
c=`echo $$i | sed 's/^lib\(.*\)\.dll\.a/cyg\1-$(SHLIB_VERSION_NUMBER).dll/'`; \ c=`echo $$i | sed 's/^lib\(.*\)\.dll\.a/cyg\1-$(SHLIB_VERSION_NUMBER).dll/'`; \
cp $$c $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new; \ cp $$c $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new; \
chmod 755 $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new; \ chmod 755 $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new; \
mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c; \ mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c; \
cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \ cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \ chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i; \ mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i; \
fi ); \ fi ); \
if expr $(PLATFORM) : 'mingw' > /dev/null; then \ if expr $(PLATFORM) : 'mingw' > /dev/null; then \
( case $$i in \ ( case $$i in \
@@ -547,7 +554,7 @@ install_sw:
fi; \ fi; \
done; \ done; \
( here="`pwd`"; \ ( here="`pwd`"; \
cd $(INSTALL_PREFIX)$(INSTALLTOP)/lib; \ cd $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR); \
$(MAKE) -f $$here/Makefile HERE="$$here" link-shared ); \ $(MAKE) -f $$here/Makefile HERE="$$here" link-shared ); \
if [ "$(INSTALLTOP)" != "/usr" ]; then \ if [ "$(INSTALLTOP)" != "/usr" ]; then \
echo 'OpenSSL shared libraries have been installed in:'; \ echo 'OpenSSL shared libraries have been installed in:'; \
@@ -556,12 +563,12 @@ install_sw:
sed -e '1,/^$$/d' doc/openssl-shared.txt; \ sed -e '1,/^$$/d' doc/openssl-shared.txt; \
fi; \ fi; \
fi fi
cp libcrypto.pc $(INSTALL_PREFIX)$(INSTALLTOP)/lib/pkgconfig cp libcrypto.pc $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/pkgconfig
chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/pkgconfig/libcrypto.pc chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libcrypto.pc
cp libssl.pc $(INSTALL_PREFIX)$(INSTALLTOP)/lib/pkgconfig cp libssl.pc $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/pkgconfig
chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/pkgconfig/libssl.pc chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libssl.pc
cp openssl.pc $(INSTALL_PREFIX)$(INSTALLTOP)/lib/pkgconfig cp openssl.pc $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/pkgconfig
chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/pkgconfig/openssl.pc chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/openssl.pc
install_html_docs: install_html_docs:
here="`pwd`"; \ here="`pwd`"; \
@@ -579,7 +586,7 @@ install_html_docs:
grep -v $$filecase "^$$fn\$$" | \ grep -v $$filecase "^$$fn\$$" | \
(cd $(INSTALL_PREFIX)$(HTMLDIR)/$$subdir; \ (cd $(INSTALL_PREFIX)$(HTMLDIR)/$$subdir; \
while read n; do \ while read n; do \
$$here/util/point.sh $$fn.$(HTMLSUFFIX) "$$n".$(HTMLSUFFIX); \ PLATFORM=$(PLATFORM) $$here/util/point.sh $$fn.$(HTMLSUFFIX) "$$n".$(HTMLSUFFIX); \
done); \ done); \
done; \ done; \
done done
@@ -590,7 +597,7 @@ install_docs:
$(INSTALL_PREFIX)$(MANDIR)/man3 \ $(INSTALL_PREFIX)$(MANDIR)/man3 \
$(INSTALL_PREFIX)$(MANDIR)/man5 \ $(INSTALL_PREFIX)$(MANDIR)/man5 \
$(INSTALL_PREFIX)$(MANDIR)/man7 $(INSTALL_PREFIX)$(MANDIR)/man7
@pod2man="`cd util; ./pod2mantest $(PERL)`"; \ @pod2man="`cd ./util; ./pod2mantest $(PERL)`"; \
here="`pwd`"; \ here="`pwd`"; \
filecase=; \ filecase=; \
if [ "$(PLATFORM)" = "DJGPP" -o "$(PLATFORM)" = "Cygwin" -o "$(PLATFORM)" = "mingw" ]; then \ if [ "$(PLATFORM)" = "DJGPP" -o "$(PLATFORM)" = "Cygwin" -o "$(PLATFORM)" = "mingw" ]; then \
@@ -610,7 +617,7 @@ install_docs:
(grep -v "[ ]"; true) | \ (grep -v "[ ]"; true) | \
(cd $(INSTALL_PREFIX)$(MANDIR)/man$$sec/; \ (cd $(INSTALL_PREFIX)$(MANDIR)/man$$sec/; \
while read n; do \ while read n; do \
$$here/util/point.sh $$fn.$${sec}$(MANSUFFIX) "$$n".$${sec}$(MANSUFFIX); \ PLATFORM=$(PLATFORM) $$here/util/point.sh $$fn.$${sec}$(MANSUFFIX) "$$n".$${sec}$(MANSUFFIX); \
done); \ done); \
done; \ done; \
set -e; for i in doc/crypto/*.pod doc/ssl/*.pod; do \ set -e; for i in doc/crypto/*.pod doc/ssl/*.pod; do \
@@ -627,7 +634,7 @@ install_docs:
(grep -v "[ ]"; true) | \ (grep -v "[ ]"; true) | \
(cd $(INSTALL_PREFIX)$(MANDIR)/man$$sec/; \ (cd $(INSTALL_PREFIX)$(MANDIR)/man$$sec/; \
while read n; do \ while read n; do \
$$here/util/point.sh $$fn.$${sec}$(MANSUFFIX) "$$n".$${sec}$(MANSUFFIX); \ PLATFORM=$(PLATFORM) $$here/util/point.sh $$fn.$${sec}$(MANSUFFIX) "$$n".$${sec}$(MANSUFFIX); \
done); \ done); \
done done

View File

@@ -135,7 +135,7 @@ LINK_SO_A_VIA_O= \
ALL=$$ALLSYMSFLAGS; ALLSYMSFLAGS=; NOALLSYMSFLAGS=; \ ALL=$$ALLSYMSFLAGS; ALLSYMSFLAGS=; NOALLSYMSFLAGS=; \
( $(SET_X); \ ( $(SET_X); \
ld $(LDFLAGS) -r -o lib$(LIBNAME).o $$ALL lib$(LIBNAME).a $(LIBEXTRAS) ); \ ld $(LDFLAGS) -r -o lib$(LIBNAME).o $$ALL lib$(LIBNAME).a $(LIBEXTRAS) ); \
$(LINK_SO) && rm -f $(LIBNAME).o $(LINK_SO) && rm -f lib$(LIBNAME).o
LINK_SO_A_UNPACKED= \ LINK_SO_A_UNPACKED= \
UNPACKDIR=link_tmp.$$$$; rm -rf $$UNPACKDIR; mkdir $$UNPACKDIR; \ UNPACKDIR=link_tmp.$$$$; rm -rf $$UNPACKDIR; mkdir $$UNPACKDIR; \
@@ -207,17 +207,29 @@ link_app.bsd:
fi; $(LINK_APP) fi; $(LINK_APP)
# For Darwin AKA Mac OS/X (dyld) # For Darwin AKA Mac OS/X (dyld)
# link_o.darwin produces .so, because we let it use dso_dlfcn module, # Originally link_o.darwin produced .so, because it was hard-coded
# which has .so extension hard-coded. One can argue that one should # in dso_dlfcn module. At later point dso_dlfcn switched to .dylib
# develop special dso module for MacOS X. At least manual encourages # extension in order to allow for run-time linking with vendor-
# to use native NSModule(3) API and refers to dlfcn as termporary hack. # supplied shared libraries such as libz, so that link_o.darwin had
# to be harmonized with it. This caused minor controversy, because
# it was believed that dlopen can't be used to dynamically load
# .dylib-s, only so called bundle modules (ones linked with -bundle
# flag). The belief seems to be originating from pre-10.4 release,
# where dlfcn functionality was emulated by dlcompat add-on. In
# 10.4 dlopen was rewritten as native part of dyld and is documented
# to be capable of loading both dynamic libraries and bundles. In
# order to provide compatibility with pre-10.4 dlopen, modules are
# linked with -bundle flag, which makes .dylib extension misleading.
# It works, because dlopen is [and always was] extension-agnostic.
# Alternative to this heuristic approach is to develop specific
# MacOS X dso module relying on whichever "native" dyld interface.
link_o.darwin: link_o.darwin:
@ $(CALC_VERSIONS); \ @ $(CALC_VERSIONS); \
SHLIB=lib$(LIBNAME); \ SHLIB=lib$(LIBNAME); \
SHLIB_SUFFIX=.so; \ SHLIB_SUFFIX=.dylib; \
ALLSYMSFLAGS='-all_load'; \ ALLSYMSFLAGS='-all_load'; \
NOALLSYMSFLAGS=''; \ NOALLSYMSFLAGS=''; \
SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS)"; \ SHAREDFLAGS="$(CFLAGS) `echo $(SHARED_LDFLAGS) | sed s/dynamiclib/bundle/`"; \
if [ -n "$(LIBVERSION)" ]; then \ if [ -n "$(LIBVERSION)" ]; then \
SHAREDFLAGS="$$SHAREDFLAGS -current_version $(LIBVERSION)"; \ SHAREDFLAGS="$$SHAREDFLAGS -current_version $(LIBVERSION)"; \
fi; \ fi; \
@@ -238,7 +250,7 @@ link_a.darwin:
if [ -n "$$SHLIB_SOVER_NODOT" ]; then \ if [ -n "$$SHLIB_SOVER_NODOT" ]; then \
SHAREDFLAGS="$$SHAREDFLAGS -compatibility_version $$SHLIB_SOVER_NODOT"; \ SHAREDFLAGS="$$SHAREDFLAGS -compatibility_version $$SHLIB_SOVER_NODOT"; \
fi; \ fi; \
SHAREDFLAGS="$$SHAREDFLAGS -install_name $(INSTALLTOP)/lib/$$SHLIB$(SHLIB_EXT)"; \ SHAREDFLAGS="$$SHAREDFLAGS -install_name $(INSTALLTOP)/$(LIBDIR)/$$SHLIB$(SHLIB_EXT)"; \
$(LINK_SO_A) $(LINK_SO_A)
link_app.darwin: # is there run-path on darwin? link_app.darwin: # is there run-path on darwin?
$(LINK_APP) $(LINK_APP)
@@ -281,7 +293,7 @@ link_a.cygwin:
fi; \ fi; \
dll_name=$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX; \ dll_name=$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX; \
$(PERL) util/mkrc.pl $$dll_name | \ $(PERL) util/mkrc.pl $$dll_name | \
$(CROSS_COMPILE_PREFIX)windres -o rc.o; \ $(CROSS_COMPILE)windres -o rc.o; \
extras="$$extras rc.o"; \ extras="$$extras rc.o"; \
ALLSYMSFLAGS='-Wl,--whole-archive'; \ ALLSYMSFLAGS='-Wl,--whole-archive'; \
NOALLSYMSFLAGS='-Wl,--no-whole-archive'; \ NOALLSYMSFLAGS='-Wl,--no-whole-archive'; \

281
NEWS
View File

@@ -5,13 +5,126 @@
This file gives a brief overview of the major changes between each OpenSSL This file gives a brief overview of the major changes between each OpenSSL
release. For more details please read the CHANGES file. release. For more details please read the CHANGES file.
Major changes between OpenSSL 0.9.8k and OpenSSL 1.0: Major changes between OpenSSL 1.0.0p and OpenSSL 1.0.0q [15 Jan 2015]
o Build fixes for the Windows and OpenVMS platforms
Major changes between OpenSSL 1.0.0o and OpenSSL 1.0.0p [8 Jan 2015]
o Fix for CVE-2014-3571
o Fix for CVE-2015-0206
o Fix for CVE-2014-3569
o Fix for CVE-2014-3572
o Fix for CVE-2015-0204
o Fix for CVE-2015-0205
o Fix for CVE-2014-8275
o Fix for CVE-2014-3570
Major changes between OpenSSL 1.0.0n and OpenSSL 1.0.0o [15 Oct 2014]
o Fix for CVE-2014-3513
o Fix for CVE-2014-3567
o Mitigation for CVE-2014-3566 (SSL protocol vulnerability)
o Fix for CVE-2014-3568
Major changes between OpenSSL 1.0.0m and OpenSSL 1.0.0n [6 Aug 2014]
o Fix for CVE-2014-3510
o Fix for CVE-2014-3507
o Fix for CVE-2014-3506
o Fix for CVE-2014-3505
o Fix for CVE-2014-3509
o Fix for CVE-2014-3508
Known issues in OpenSSL 1.0.0m:
o EAP-FAST and other applications using tls_session_secret_cb
wont resume sessions. Fixed in 1.0.0n-dev
o Compilation failure of s3_pkt.c on some platforms due to missing
<limits.h> include. Fixed in 1.0.0n-dev
Major changes between OpenSSL 1.0.0l and OpenSSL 1.0.0m [5 Jun 2014]
o Fix for CVE-2014-0224
o Fix for CVE-2014-0221
o Fix for CVE-2014-0198
o Fix for CVE-2014-0195
o Fix for CVE-2014-3470
o Fix for CVE-2014-0076
o Fix for CVE-2010-5298
Major changes between OpenSSL 1.0.0k and OpenSSL 1.0.0l [6 Jan 2014]
o Fix for DTLS retransmission bug CVE-2013-6450
Major changes between OpenSSL 1.0.0j and OpenSSL 1.0.0k [5 Feb 2013]:
o Fix for SSL/TLS/DTLS CBC plaintext recovery attack CVE-2013-0169
o Fix OCSP bad key DoS attack CVE-2013-0166
Major changes between OpenSSL 1.0.0i and OpenSSL 1.0.0j [10 May 2012]:
o Fix DTLS record length checking bug CVE-2012-2333
Major changes between OpenSSL 1.0.0h and OpenSSL 1.0.0i [19 Apr 2012]:
o Fix for ASN1 overflow bug CVE-2012-2110
Major changes between OpenSSL 1.0.0g and OpenSSL 1.0.0h [12 Mar 2012]:
o Fix for CMS/PKCS#7 MMA CVE-2012-0884
o Corrected fix for CVE-2011-4619
o Various DTLS fixes.
Major changes between OpenSSL 1.0.0f and OpenSSL 1.0.0g [18 Jan 2012]:
o Fix for DTLS DoS issue CVE-2012-0050
Major changes between OpenSSL 1.0.0e and OpenSSL 1.0.0f [4 Jan 2012]:
o Fix for DTLS plaintext recovery attack CVE-2011-4108
o Clear block padding bytes of SSL 3.0 records CVE-2011-4576
o Only allow one SGC handshake restart for SSL/TLS CVE-2011-4619
o Check parameters are not NULL in GOST ENGINE CVE-2012-0027
o Check for malformed RFC3779 data CVE-2011-4577
Major changes between OpenSSL 1.0.0d and OpenSSL 1.0.0e [6 Sep 2011]:
o Fix for CRL vulnerability issue CVE-2011-3207
o Fix for ECDH crashes CVE-2011-3210
o Protection against EC timing attacks.
o Support ECDH ciphersuites for certificates using SHA2 algorithms.
o Various DTLS fixes.
Major changes between OpenSSL 1.0.0c and OpenSSL 1.0.0d [8 Feb 2011]:
o Fix for security issue CVE-2011-0014
Major changes between OpenSSL 1.0.0b and OpenSSL 1.0.0c [2 Dec 2010]:
o Fix for security issue CVE-2010-4180
o Fix for CVE-2010-4252
o Fix mishandling of absent EC point format extension.
o Fix various platform compilation issues.
o Corrected fix for security issue CVE-2010-3864.
Major changes between OpenSSL 1.0.0a and OpenSSL 1.0.0b [16 Nov 2010]:
o Fix for security issue CVE-2010-3864.
o Fix for CVE-2010-2939
o Fix WIN32 build system for GOST ENGINE.
Major changes between OpenSSL 1.0.0 and OpenSSL 1.0.0a [1 Jun 2010]:
o Fix for security issue CVE-2010-1633.
o GOST MAC and CFB fixes.
Major changes between OpenSSL 0.9.8n and OpenSSL 1.0.0 [29 Mar 2010]:
o RFC3280 path validation: sufficient to process PKITS tests. o RFC3280 path validation: sufficient to process PKITS tests.
o Integrated support for PVK files and keyblobs. o Integrated support for PVK files and keyblobs.
o Change default private key format to PKCS#8. o Change default private key format to PKCS#8.
o CMS support: able to process all examples in RFCXXXX o CMS support: able to process all examples in RFC4134
o Streaming ASN1 encode support for PKCS#7 and CMS. o Streaming ASN1 encode support for PKCS#7 and CMS.
o Multiple signer and signer add support for PKCS#7 and CMS. o Multiple signer and signer add support for PKCS#7 and CMS.
o ASN1 printing support. o ASN1 printing support.
@@ -27,30 +140,108 @@
o ecdsa-with-SHA224/256/384/512 signature types. o ecdsa-with-SHA224/256/384/512 signature types.
o dsa-with-SHA224 and dsa-with-SHA256 signature types. o dsa-with-SHA224 and dsa-with-SHA256 signature types.
o Opaque PRF Input TLS extension support. o Opaque PRF Input TLS extension support.
o Updated time routines to avoid OS limitations.
Major changes between OpenSSL 0.9.8j and OpenSSL 0.9.8k: Major changes between OpenSSL 0.9.8x and OpenSSL 0.9.8y [5 Feb 2013]:
o Fix for SSL/TLS/DTLS CBC plaintext recovery attack CVE-2013-0169
o Fix OCSP bad key DoS attack CVE-2013-0166
Major changes between OpenSSL 0.9.8w and OpenSSL 0.9.8x [10 May 2012]:
o Fix DTLS record length checking bug CVE-2012-2333
Major changes between OpenSSL 0.9.8v and OpenSSL 0.9.8w [23 Apr 2012]:
o Fix for CVE-2012-2131 (corrected fix for 0.9.8 and CVE-2012-2110)
Major changes between OpenSSL 0.9.8u and OpenSSL 0.9.8v [19 Apr 2012]:
o Fix for ASN1 overflow bug CVE-2012-2110
Major changes between OpenSSL 0.9.8t and OpenSSL 0.9.8u [12 Mar 2012]:
o Fix for CMS/PKCS#7 MMA CVE-2012-0884
o Corrected fix for CVE-2011-4619
o Various DTLS fixes.
Major changes between OpenSSL 0.9.8s and OpenSSL 0.9.8t [18 Jan 2012]:
o Fix for DTLS DoS issue CVE-2012-0050
Major changes between OpenSSL 0.9.8r and OpenSSL 0.9.8s [4 Jan 2012]:
o Fix for DTLS plaintext recovery attack CVE-2011-4108
o Fix policy check double free error CVE-2011-4109
o Clear block padding bytes of SSL 3.0 records CVE-2011-4576
o Only allow one SGC handshake restart for SSL/TLS CVE-2011-4619
o Check for malformed RFC3779 data CVE-2011-4577
Major changes between OpenSSL 0.9.8q and OpenSSL 0.9.8r [8 Feb 2011]:
o Fix for security issue CVE-2011-0014
Major changes between OpenSSL 0.9.8p and OpenSSL 0.9.8q [2 Dec 2010]:
o Fix for security issue CVE-2010-4180
o Fix for CVE-2010-4252
Major changes between OpenSSL 0.9.8o and OpenSSL 0.9.8p [16 Nov 2010]:
o Fix for security issue CVE-2010-3864.
Major changes between OpenSSL 0.9.8n and OpenSSL 0.9.8o [1 Jun 2010]:
o Fix for security issue CVE-2010-0742.
o Various DTLS fixes.
o Recognise SHA2 certificates if only SSL algorithms added.
o Fix for no-rc4 compilation.
o Chil ENGINE unload workaround.
Major changes between OpenSSL 0.9.8m and OpenSSL 0.9.8n [24 Mar 2010]:
o CFB cipher definition fixes.
o Fix security issues CVE-2010-0740 and CVE-2010-0433.
Major changes between OpenSSL 0.9.8l and OpenSSL 0.9.8m [25 Feb 2010]:
o Cipher definition fixes.
o Workaround for slow RAND_poll() on some WIN32 versions.
o Remove MD2 from algorithm tables.
o SPKAC handling fixes.
o Support for RFC5746 TLS renegotiation extension.
o Compression memory leak fixed.
o Compression session resumption fixed.
o Ticket and SNI coexistence fixes.
o Many fixes to DTLS handling.
Major changes between OpenSSL 0.9.8k and OpenSSL 0.9.8l [5 Nov 2009]:
o Temporary work around for CVE-2009-3555: disable renegotiation.
Major changes between OpenSSL 0.9.8j and OpenSSL 0.9.8k [25 Mar 2009]:
o Fix various build issues. o Fix various build issues.
o Fix security issues (CVE-2009-0590, CVE-2009-0591, CVE-2009-0789) o Fix security issues (CVE-2009-0590, CVE-2009-0591, CVE-2009-0789)
Major changes between OpenSSL 0.9.8i and OpenSSL 0.9.8j: Major changes between OpenSSL 0.9.8i and OpenSSL 0.9.8j [7 Jan 2009]:
o Fix security issue (CVE-2008-5077) o Fix security issue (CVE-2008-5077)
o Merge FIPS 140-2 branch code. o Merge FIPS 140-2 branch code.
Major changes between OpenSSL 0.9.8g and OpenSSL 0.9.8h: Major changes between OpenSSL 0.9.8g and OpenSSL 0.9.8h [28 May 2008]:
o CryptoAPI ENGINE support. o CryptoAPI ENGINE support.
o Various precautionary measures. o Various precautionary measures.
o Fix for bugs affecting certificate request creation. o Fix for bugs affecting certificate request creation.
o Support for local machine keyset attribute in PKCS#12 files. o Support for local machine keyset attribute in PKCS#12 files.
Major changes between OpenSSL 0.9.8f and OpenSSL 0.9.8g: Major changes between OpenSSL 0.9.8f and OpenSSL 0.9.8g [19 Oct 2007]:
o Backport of CMS functionality to 0.9.8. o Backport of CMS functionality to 0.9.8.
o Fixes for bugs introduced with 0.9.8f. o Fixes for bugs introduced with 0.9.8f.
Major changes between OpenSSL 0.9.8e and OpenSSL 0.9.8f: Major changes between OpenSSL 0.9.8e and OpenSSL 0.9.8f [11 Oct 2007]:
o Add gcc 4.2 support. o Add gcc 4.2 support.
o Add support for AES and SSE2 assembly lanugauge optimization o Add support for AES and SSE2 assembly lanugauge optimization
@@ -61,23 +252,23 @@
o RFC4507bis support. o RFC4507bis support.
o TLS Extensions support. o TLS Extensions support.
Major changes between OpenSSL 0.9.8d and OpenSSL 0.9.8e: Major changes between OpenSSL 0.9.8d and OpenSSL 0.9.8e [23 Feb 2007]:
o Various ciphersuite selection fixes. o Various ciphersuite selection fixes.
o RFC3779 support. o RFC3779 support.
Major changes between OpenSSL 0.9.8c and OpenSSL 0.9.8d: Major changes between OpenSSL 0.9.8c and OpenSSL 0.9.8d [28 Sep 2006]:
o Introduce limits to prevent malicious key DoS (CVE-2006-2940) o Introduce limits to prevent malicious key DoS (CVE-2006-2940)
o Fix security issues (CVE-2006-2937, CVE-2006-3737, CVE-2006-4343) o Fix security issues (CVE-2006-2937, CVE-2006-3737, CVE-2006-4343)
o Changes to ciphersuite selection algorithm o Changes to ciphersuite selection algorithm
Major changes between OpenSSL 0.9.8b and OpenSSL 0.9.8c: Major changes between OpenSSL 0.9.8b and OpenSSL 0.9.8c [5 Sep 2006]:
o Fix Daniel Bleichenbacher forged signature attack, CVE-2006-4339 o Fix Daniel Bleichenbacher forged signature attack, CVE-2006-4339
o New cipher Camellia o New cipher Camellia
Major changes between OpenSSL 0.9.8a and OpenSSL 0.9.8b: Major changes between OpenSSL 0.9.8a and OpenSSL 0.9.8b [4 May 2006]:
o Cipher string fixes. o Cipher string fixes.
o Fixes for VC++ 2005. o Fixes for VC++ 2005.
@@ -87,12 +278,12 @@
o Built in dynamic engine compilation support on Win32. o Built in dynamic engine compilation support on Win32.
o Fixes auto dynamic engine loading in Win32. o Fixes auto dynamic engine loading in Win32.
Major changes between OpenSSL 0.9.8 and OpenSSL 0.9.8a: Major changes between OpenSSL 0.9.8 and OpenSSL 0.9.8a [11 Oct 2005]:
o Fix potential SSL 2.0 rollback, CVE-2005-2969 o Fix potential SSL 2.0 rollback, CVE-2005-2969
o Extended Windows CE support o Extended Windows CE support
Major changes between OpenSSL 0.9.7g and OpenSSL 0.9.8: Major changes between OpenSSL 0.9.7g and OpenSSL 0.9.8 [5 Jul 2005]:
o Major work on the BIGNUM library for higher efficiency and to o Major work on the BIGNUM library for higher efficiency and to
make operations more streamlined and less contradictory. This make operations more streamlined and less contradictory. This
@@ -166,36 +357,36 @@
o Added initial support for Win64. o Added initial support for Win64.
o Added alternate pkg-config files. o Added alternate pkg-config files.
Major changes between OpenSSL 0.9.7l and OpenSSL 0.9.7m: Major changes between OpenSSL 0.9.7l and OpenSSL 0.9.7m [23 Feb 2007]:
o FIPS 1.1.1 module linking. o FIPS 1.1.1 module linking.
o Various ciphersuite selection fixes. o Various ciphersuite selection fixes.
Major changes between OpenSSL 0.9.7k and OpenSSL 0.9.7l: Major changes between OpenSSL 0.9.7k and OpenSSL 0.9.7l [28 Sep 2006]:
o Introduce limits to prevent malicious key DoS (CVE-2006-2940) o Introduce limits to prevent malicious key DoS (CVE-2006-2940)
o Fix security issues (CVE-2006-2937, CVE-2006-3737, CVE-2006-4343) o Fix security issues (CVE-2006-2937, CVE-2006-3737, CVE-2006-4343)
Major changes between OpenSSL 0.9.7j and OpenSSL 0.9.7k: Major changes between OpenSSL 0.9.7j and OpenSSL 0.9.7k [5 Sep 2006]:
o Fix Daniel Bleichenbacher forged signature attack, CVE-2006-4339 o Fix Daniel Bleichenbacher forged signature attack, CVE-2006-4339
Major changes between OpenSSL 0.9.7i and OpenSSL 0.9.7j: Major changes between OpenSSL 0.9.7i and OpenSSL 0.9.7j [4 May 2006]:
o Visual C++ 2005 fixes. o Visual C++ 2005 fixes.
o Update Windows build system for FIPS. o Update Windows build system for FIPS.
Major changes between OpenSSL 0.9.7h and OpenSSL 0.9.7i: Major changes between OpenSSL 0.9.7h and OpenSSL 0.9.7i [14 Oct 2005]:
o Give EVP_MAX_MD_SIZE it's old value, except for a FIPS build. o Give EVP_MAX_MD_SIZE it's old value, except for a FIPS build.
Major changes between OpenSSL 0.9.7g and OpenSSL 0.9.7h: Major changes between OpenSSL 0.9.7g and OpenSSL 0.9.7h [11 Oct 2005]:
o Fix SSL 2.0 Rollback, CVE-2005-2969 o Fix SSL 2.0 Rollback, CVE-2005-2969
o Allow use of fixed-length exponent on DSA signing o Allow use of fixed-length exponent on DSA signing
o Default fixed-window RSA, DSA, DH private-key operations o Default fixed-window RSA, DSA, DH private-key operations
Major changes between OpenSSL 0.9.7f and OpenSSL 0.9.7g: Major changes between OpenSSL 0.9.7f and OpenSSL 0.9.7g [11 Apr 2005]:
o More compilation issues fixed. o More compilation issues fixed.
o Adaptation to more modern Kerberos API. o Adaptation to more modern Kerberos API.
@@ -204,7 +395,7 @@
o More constification. o More constification.
o Added processing of proxy certificates (RFC 3820). o Added processing of proxy certificates (RFC 3820).
Major changes between OpenSSL 0.9.7e and OpenSSL 0.9.7f: Major changes between OpenSSL 0.9.7e and OpenSSL 0.9.7f [22 Mar 2005]:
o Several compilation issues fixed. o Several compilation issues fixed.
o Many memory allocation failure checks added. o Many memory allocation failure checks added.
@@ -212,12 +403,12 @@
o Mandatory basic checks on certificates. o Mandatory basic checks on certificates.
o Performance improvements. o Performance improvements.
Major changes between OpenSSL 0.9.7d and OpenSSL 0.9.7e: Major changes between OpenSSL 0.9.7d and OpenSSL 0.9.7e [25 Oct 2004]:
o Fix race condition in CRL checking code. o Fix race condition in CRL checking code.
o Fixes to PKCS#7 (S/MIME) code. o Fixes to PKCS#7 (S/MIME) code.
Major changes between OpenSSL 0.9.7c and OpenSSL 0.9.7d: Major changes between OpenSSL 0.9.7c and OpenSSL 0.9.7d [17 Mar 2004]:
o Security: Fix Kerberos ciphersuite SSL/TLS handshaking bug o Security: Fix Kerberos ciphersuite SSL/TLS handshaking bug
o Security: Fix null-pointer assignment in do_change_cipher_spec() o Security: Fix null-pointer assignment in do_change_cipher_spec()
@@ -225,14 +416,14 @@
o Multiple X509 verification fixes o Multiple X509 verification fixes
o Speed up HMAC and other operations o Speed up HMAC and other operations
Major changes between OpenSSL 0.9.7b and OpenSSL 0.9.7c: Major changes between OpenSSL 0.9.7b and OpenSSL 0.9.7c [30 Sep 2003]:
o Security: fix various ASN1 parsing bugs. o Security: fix various ASN1 parsing bugs.
o New -ignore_err option to OCSP utility. o New -ignore_err option to OCSP utility.
o Various interop and bug fixes in S/MIME code. o Various interop and bug fixes in S/MIME code.
o SSL/TLS protocol fix for unrequested client certificates. o SSL/TLS protocol fix for unrequested client certificates.
Major changes between OpenSSL 0.9.7a and OpenSSL 0.9.7b: Major changes between OpenSSL 0.9.7a and OpenSSL 0.9.7b [10 Apr 2003]:
o Security: counter the Klima-Pokorny-Rosa extension of o Security: counter the Klima-Pokorny-Rosa extension of
Bleichbacher's attack Bleichbacher's attack
@@ -243,7 +434,7 @@
o ASN.1: treat domainComponent correctly. o ASN.1: treat domainComponent correctly.
o Documentation: fixes and additions. o Documentation: fixes and additions.
Major changes between OpenSSL 0.9.7 and OpenSSL 0.9.7a: Major changes between OpenSSL 0.9.7 and OpenSSL 0.9.7a [19 Feb 2003]:
o Security: Important security related bugfixes. o Security: Important security related bugfixes.
o Enhanced compatibility with MIT Kerberos. o Enhanced compatibility with MIT Kerberos.
@@ -254,7 +445,7 @@
o SSL/TLS: now handles manual certificate chain building. o SSL/TLS: now handles manual certificate chain building.
o SSL/TLS: certain session ID malfunctions corrected. o SSL/TLS: certain session ID malfunctions corrected.
Major changes between OpenSSL 0.9.6 and OpenSSL 0.9.7: Major changes between OpenSSL 0.9.6 and OpenSSL 0.9.7 [30 Dec 2002]:
o New library section OCSP. o New library section OCSP.
o Complete rewrite of ASN1 code. o Complete rewrite of ASN1 code.
@@ -300,23 +491,23 @@
o SSL/TLS: add callback to retrieve SSL/TLS messages. o SSL/TLS: add callback to retrieve SSL/TLS messages.
o SSL/TLS: support AES cipher suites (RFC3268). o SSL/TLS: support AES cipher suites (RFC3268).
Major changes between OpenSSL 0.9.6j and OpenSSL 0.9.6k: Major changes between OpenSSL 0.9.6j and OpenSSL 0.9.6k [30 Sep 2003]:
o Security: fix various ASN1 parsing bugs. o Security: fix various ASN1 parsing bugs.
o SSL/TLS protocol fix for unrequested client certificates. o SSL/TLS protocol fix for unrequested client certificates.
Major changes between OpenSSL 0.9.6i and OpenSSL 0.9.6j: Major changes between OpenSSL 0.9.6i and OpenSSL 0.9.6j [10 Apr 2003]:
o Security: counter the Klima-Pokorny-Rosa extension of o Security: counter the Klima-Pokorny-Rosa extension of
Bleichbacher's attack Bleichbacher's attack
o Security: make RSA blinding default. o Security: make RSA blinding default.
o Build: shared library support fixes. o Build: shared library support fixes.
Major changes between OpenSSL 0.9.6h and OpenSSL 0.9.6i: Major changes between OpenSSL 0.9.6h and OpenSSL 0.9.6i [19 Feb 2003]:
o Important security related bugfixes. o Important security related bugfixes.
Major changes between OpenSSL 0.9.6g and OpenSSL 0.9.6h: Major changes between OpenSSL 0.9.6g and OpenSSL 0.9.6h [5 Dec 2002]:
o New configuration targets for Tandem OSS and A/UX. o New configuration targets for Tandem OSS and A/UX.
o New OIDs for Microsoft attributes. o New OIDs for Microsoft attributes.
@@ -330,25 +521,25 @@
o Fixes for smaller building problems. o Fixes for smaller building problems.
o Updates of manuals, FAQ and other instructive documents. o Updates of manuals, FAQ and other instructive documents.
Major changes between OpenSSL 0.9.6f and OpenSSL 0.9.6g: Major changes between OpenSSL 0.9.6f and OpenSSL 0.9.6g [9 Aug 2002]:
o Important building fixes on Unix. o Important building fixes on Unix.
Major changes between OpenSSL 0.9.6e and OpenSSL 0.9.6f: Major changes between OpenSSL 0.9.6e and OpenSSL 0.9.6f [8 Aug 2002]:
o Various important bugfixes. o Various important bugfixes.
Major changes between OpenSSL 0.9.6d and OpenSSL 0.9.6e: Major changes between OpenSSL 0.9.6d and OpenSSL 0.9.6e [30 Jul 2002]:
o Important security related bugfixes. o Important security related bugfixes.
o Various SSL/TLS library bugfixes. o Various SSL/TLS library bugfixes.
Major changes between OpenSSL 0.9.6c and OpenSSL 0.9.6d: Major changes between OpenSSL 0.9.6c and OpenSSL 0.9.6d [9 May 2002]:
o Various SSL/TLS library bugfixes. o Various SSL/TLS library bugfixes.
o Fix DH parameter generation for 'non-standard' generators. o Fix DH parameter generation for 'non-standard' generators.
Major changes between OpenSSL 0.9.6b and OpenSSL 0.9.6c: Major changes between OpenSSL 0.9.6b and OpenSSL 0.9.6c [21 Dec 2001]:
o Various SSL/TLS library bugfixes. o Various SSL/TLS library bugfixes.
o BIGNUM library fixes. o BIGNUM library fixes.
@@ -361,7 +552,7 @@
Broadcom and Cryptographic Appliance's keyserver Broadcom and Cryptographic Appliance's keyserver
[in 0.9.6c-engine release]. [in 0.9.6c-engine release].
Major changes between OpenSSL 0.9.6a and OpenSSL 0.9.6b: Major changes between OpenSSL 0.9.6a and OpenSSL 0.9.6b [9 Jul 2001]:
o Security fix: PRNG improvements. o Security fix: PRNG improvements.
o Security fix: RSA OAEP check. o Security fix: RSA OAEP check.
@@ -378,7 +569,7 @@
o Increase default size for BIO buffering filter. o Increase default size for BIO buffering filter.
o Compatibility fixes in some scripts. o Compatibility fixes in some scripts.
Major changes between OpenSSL 0.9.6 and OpenSSL 0.9.6a: Major changes between OpenSSL 0.9.6 and OpenSSL 0.9.6a [5 Apr 2001]:
o Security fix: change behavior of OpenSSL to avoid using o Security fix: change behavior of OpenSSL to avoid using
environment variables when running as root. environment variables when running as root.
@@ -403,7 +594,7 @@
o New function BN_rand_range(). o New function BN_rand_range().
o Add "-rand" option to openssl s_client and s_server. o Add "-rand" option to openssl s_client and s_server.
Major changes between OpenSSL 0.9.5a and OpenSSL 0.9.6: Major changes between OpenSSL 0.9.5a and OpenSSL 0.9.6 [10 Oct 2000]:
o Some documentation for BIO and SSL libraries. o Some documentation for BIO and SSL libraries.
o Enhanced chain verification using key identifiers. o Enhanced chain verification using key identifiers.
@@ -418,7 +609,7 @@
[1] The support for external crypto devices is currently a separate [1] The support for external crypto devices is currently a separate
distribution. See the file README.ENGINE. distribution. See the file README.ENGINE.
Major changes between OpenSSL 0.9.5 and OpenSSL 0.9.5a: Major changes between OpenSSL 0.9.5 and OpenSSL 0.9.5a [1 Apr 2000]:
o Bug fixes for Win32, SuSE Linux, NeXTSTEP and FreeBSD 2.2.8 o Bug fixes for Win32, SuSE Linux, NeXTSTEP and FreeBSD 2.2.8
o Shared library support for HPUX and Solaris-gcc o Shared library support for HPUX and Solaris-gcc
@@ -427,7 +618,7 @@
o New 'rand' application o New 'rand' application
o New way to check for existence of algorithms from scripts o New way to check for existence of algorithms from scripts
Major changes between OpenSSL 0.9.4 and OpenSSL 0.9.5: Major changes between OpenSSL 0.9.4 and OpenSSL 0.9.5 [25 May 2000]:
o S/MIME support in new 'smime' command o S/MIME support in new 'smime' command
o Documentation for the OpenSSL command line application o Documentation for the OpenSSL command line application
@@ -463,7 +654,7 @@
o Enhanced support for Alpha Linux o Enhanced support for Alpha Linux
o Experimental MacOS support o Experimental MacOS support
Major changes between OpenSSL 0.9.3 and OpenSSL 0.9.4: Major changes between OpenSSL 0.9.3 and OpenSSL 0.9.4 [9 Aug 1999]:
o Transparent support for PKCS#8 format private keys: these are used o Transparent support for PKCS#8 format private keys: these are used
by several software packages and are more secure than the standard by several software packages and are more secure than the standard
@@ -474,7 +665,7 @@
o New pipe-like BIO that allows using the SSL library when actual I/O o New pipe-like BIO that allows using the SSL library when actual I/O
must be handled by the application (BIO pair) must be handled by the application (BIO pair)
Major changes between OpenSSL 0.9.2b and OpenSSL 0.9.3: Major changes between OpenSSL 0.9.2b and OpenSSL 0.9.3 [24 May 1999]:
o Lots of enhancements and cleanups to the Configuration mechanism o Lots of enhancements and cleanups to the Configuration mechanism
o RSA OEAP related fixes o RSA OEAP related fixes
o Added `openssl ca -revoke' option for revoking a certificate o Added `openssl ca -revoke' option for revoking a certificate
@@ -488,7 +679,7 @@
o Sparc assembler bignum implementation, optimized hash functions o Sparc assembler bignum implementation, optimized hash functions
o Option to disable selected ciphers o Option to disable selected ciphers
Major changes between OpenSSL 0.9.1c and OpenSSL 0.9.2b: Major changes between OpenSSL 0.9.1c and OpenSSL 0.9.2b [22 Mar 1999]:
o Fixed a security hole related to session resumption o Fixed a security hole related to session resumption
o Fixed RSA encryption routines for the p < q case o Fixed RSA encryption routines for the p < q case
o "ALL" in cipher lists now means "everything except NULL ciphers" o "ALL" in cipher lists now means "everything except NULL ciphers"
@@ -510,7 +701,7 @@
o Lots of memory leak fixes. o Lots of memory leak fixes.
o Lots of bug fixes. o Lots of bug fixes.
Major changes between SSLeay 0.9.0b and OpenSSL 0.9.1c: Major changes between SSLeay 0.9.0b and OpenSSL 0.9.1c [23 Dec 1998]:
o Integration of the popular NO_RSA/NO_DSA patches o Integration of the popular NO_RSA/NO_DSA patches
o Initial support for compression inside the SSL record layer o Initial support for compression inside the SSL record layer
o Added BIO proxy and filtering functionality o Added BIO proxy and filtering functionality

View File

@@ -36,7 +36,9 @@ may differ on your machine.
As long as Apple doesn't fix the problem with ld, this problem building As long as Apple doesn't fix the problem with ld, this problem building
OpenSSL will remain as is. OpenSSL will remain as is. Well, the problem was addressed in 0.9.8f by
passing -Wl,-search_paths_first, but it's unknown if the flag was
supported from the initial MacOS X release.
* Parallell make leads to errors * Parallell make leads to errors
@@ -195,3 +197,17 @@ reconfigure with additional no-sse2 [or 386] option passed to ./config.
We don't have framework to associate -ldl with no-dso, therefore the only We don't have framework to associate -ldl with no-dso, therefore the only
way is to edit Makefile right after ./config no-dso and remove -ldl from way is to edit Makefile right after ./config no-dso and remove -ldl from
EX_LIBS line. EX_LIBS line.
* hpux-parisc2-cc no-asm build fails with SEGV in ECDSA/DH.
Compiler bug, presumably at particular patch level. Remaining
hpux*-parisc*-cc configurations can be affected too. Drop optimization
level to +O2 when compiling bn_nist.o.
* solaris64-sparcv9-cc link failure
Solaris 8 ar can fail to maintain symbol table in .a, which results in
link failures. Apply 109147-09 or later or modify Makefile generated
by ./Configure solaris64-sparcv9-cc and replace RANLIB assignment with
RANLIB= /usr/ccs/bin/ar rs

27
README
View File

@@ -1,7 +1,7 @@
OpenSSL 1.0.0-dev XX xxx XXXX OpenSSL 1.0.0q 15 Jan 2015
Copyright (c) 1998-2008 The OpenSSL Project Copyright (c) 1998-2011 The OpenSSL Project
Copyright (c) 1995-1998 Eric A. Young, Tim J. Hudson Copyright (c) 1995-1998 Eric A. Young, Tim J. Hudson
All rights reserved. All rights reserved.
@@ -112,8 +112,6 @@
should be contacted if that algorithm is to be used; their web page is should be contacted if that algorithm is to be used; their web page is
http://www.ascom.ch/. http://www.ascom.ch/.
The MDC2 algorithm is patented by IBM.
NTT and Mitsubishi have patents and pending patents on the Camellia NTT and Mitsubishi have patents and pending patents on the Camellia
algorithm, but allow use at no charge without requiring an explicit algorithm, but allow use at no charge without requiring an explicit
licensing agreement: http://info.isl.ntt.co.jp/crypt/eng/info/chiteki.html licensing agreement: http://info.isl.ntt.co.jp/crypt/eng/info/chiteki.html
@@ -139,6 +137,9 @@
SUPPORT SUPPORT
------- -------
See the OpenSSL website www.openssl.org for details of how to obtain
commercial technical support.
If you have any problems with OpenSSL then please take the following steps If you have any problems with OpenSSL then please take the following steps
first: first:
@@ -165,6 +166,10 @@
openssl-bugs@openssl.org openssl-bugs@openssl.org
Note that the request tracker should NOT be used for general assistance
or support queries. Just because something doesn't work the way you expect
does not mean it is necessarily a bug in OpenSSL.
Note that mail to openssl-bugs@openssl.org is recorded in the publicly Note that mail to openssl-bugs@openssl.org is recorded in the publicly
readable request tracker database and is forwarded to a public readable request tracker database and is forwarded to a public
mailing list. Confidential mail may be sent to openssl-security@openssl.org mailing list. Confidential mail may be sent to openssl-security@openssl.org
@@ -175,10 +180,22 @@
Development is coordinated on the openssl-dev mailing list (see Development is coordinated on the openssl-dev mailing list (see
http://www.openssl.org for information on subscribing). If you http://www.openssl.org for information on subscribing). If you
would like to submit a patch, send it to openssl-dev@openssl.org with would like to submit a patch, send it to openssl-bugs@openssl.org with
the string "[PATCH]" in the subject. Please be sure to include a the string "[PATCH]" in the subject. Please be sure to include a
textual explanation of what your patch does. textual explanation of what your patch does.
If you are unsure as to whether a feature will be useful for the general
OpenSSL community please discuss it on the openssl-dev mailing list first.
Someone may be already working on the same thing or there may be a good
reason as to why that feature isn't implemented.
Patches should be as up to date as possible, preferably relative to the
current Git or the last snapshot. They should follow the coding style of
OpenSSL and compile without warnings. Some of the core team developer targets
can be used for testing purposes, (debug-steve64, debug-geoff etc). OpenSSL
compiles on many varied platforms: try to ensure you only use portable
features.
Note: For legal reasons, contributions from the US can be accepted only Note: For legal reasons, contributions from the US can be accepted only
if a TSU notification and a copy of the patch are sent to crypt@bis.doc.gov if a TSU notification and a copy of the patch are sent to crypt@bis.doc.gov
(formerly BXA) with a copy to the ENC Encryption Request Coordinator; (formerly BXA) with a copy to the ENC Encryption Request Coordinator;

132
STATUS
View File

@@ -1,132 +0,0 @@
OpenSSL STATUS Last modified at
______________ $Date: 2009/03/30 11:33:03 $
DEVELOPMENT STATE
o OpenSSL 1.0: Under development...
o OpenSSL 0.9.8h: Released on May 28th, 2008
o OpenSSL 0.9.8g: Released on October 19th, 2007
o OpenSSL 0.9.8f: Released on October 11th, 2007
o OpenSSL 0.9.8e: Released on February 23rd, 2007
o OpenSSL 0.9.8d: Released on September 28th, 2006
o OpenSSL 0.9.8c: Released on September 5th, 2006
o OpenSSL 0.9.8b: Released on May 4th, 2006
o OpenSSL 0.9.8a: Released on October 11th, 2005
o OpenSSL 0.9.8: Released on July 5th, 2005
o OpenSSL 0.9.7m: Released on February 23rd, 2007
o OpenSSL 0.9.7l: Released on September 28th, 2006
o OpenSSL 0.9.7k: Released on September 5th, 2006
o OpenSSL 0.9.7j: Released on May 4th, 2006
o OpenSSL 0.9.7i: Released on October 14th, 2005
o OpenSSL 0.9.7h: Released on October 11th, 2005
o OpenSSL 0.9.7g: Released on April 11th, 2005
o OpenSSL 0.9.7f: Released on March 22nd, 2005
o OpenSSL 0.9.7e: Released on October 25th, 2004
o OpenSSL 0.9.7d: Released on March 17th, 2004
o OpenSSL 0.9.7c: Released on September 30th, 2003
o OpenSSL 0.9.7b: Released on April 10th, 2003
o OpenSSL 0.9.7a: Released on February 19th, 2003
o OpenSSL 0.9.7: Released on December 31st, 2002
o OpenSSL 0.9.6m: Released on March 17th, 2004
o OpenSSL 0.9.6l: Released on November 4th, 2003
o OpenSSL 0.9.6k: Released on September 30th, 2003
o OpenSSL 0.9.6j: Released on April 10th, 2003
o OpenSSL 0.9.6i: Released on February 19th, 2003
o OpenSSL 0.9.6h: Released on December 5th, 2002
o OpenSSL 0.9.6g: Released on August 9th, 2002
o OpenSSL 0.9.6f: Released on August 8th, 2002
o OpenSSL 0.9.6e: Released on July 30th, 2002
o OpenSSL 0.9.6d: Released on May 9th, 2002
o OpenSSL 0.9.6c: Released on December 21st, 2001
o OpenSSL 0.9.6b: Released on July 9th, 2001
o OpenSSL 0.9.6a: Released on April 5th, 2001
o OpenSSL 0.9.6: Released on September 24th, 2000
o OpenSSL 0.9.5a: Released on April 1st, 2000
o OpenSSL 0.9.5: Released on February 28th, 2000
o OpenSSL 0.9.4: Released on August 09th, 1999
o OpenSSL 0.9.3a: Released on May 29th, 1999
o OpenSSL 0.9.3: Released on May 25th, 1999
o OpenSSL 0.9.2b: Released on March 22th, 1999
o OpenSSL 0.9.1c: Released on December 23th, 1998
[See also http://www.openssl.org/support/rt.html]
RELEASE SHOWSTOPPERS
o The Makefiles fail with some SysV makes.
o
AVAILABLE PATCHES
o
IN PROGRESS
o Steve is currently working on (in no particular order):
ASN1 code redesign, butchery, replacement.
OCSP
EVP cipher enhancement.
Enhanced certificate chain verification.
Private key, certificate and CRL API and implementation.
Developing and bugfixing PKCS#7 (S/MIME code).
Various X509 issues: character sets, certificate request extensions.
o Richard is currently working on:
Constification
Attribute Certificate support
Certificate Pair support
Storage Engines (primarly an LDAP storage engine)
Certificate chain validation with full RFC 3280 compatibility
NEEDS PATCH
o 0.9.8-dev: COMPLEMENTOFALL and COMPLEMENTOFDEFAULT do not
handle ECCdraft cipher suites correctly.
o apps/ca.c: "Sign the certificate?" - "n" creates empty certificate file
o "OpenSSL STATUS" is never up-to-date.
OPEN ISSUES
o The Makefile hierarchy and build mechanism is still not a round thing:
1. The config vs. Configure scripts
It's the same nasty situation as for Apache with APACI vs.
src/Configure. It confuses.
Suggestion: Merge Configure and config into a single configure
script with a Autoconf style interface ;-) and remove
Configure and config. Or even let us use GNU Autoconf
itself. Then we can avoid a lot of those platform checks
which are currently in Configure.
o Support for Shared Libraries has to be added at least
for the major Unix platforms. The details we can rip from the stuff
Ralf has done for the Apache src/Configure script. Ben wants the
solution to be really simple.
Status: Ralf will look how we can easily incorporate the
compiler PIC and linker DSO flags from Apache
into the OpenSSL Configure script.
Ulf: +1 for using GNU autoconf and libtool (but not automake,
which apparently is not flexible enough to generate
libcrypto)
WISHES
o Add variants of DH_generate_parameters() and BN_generate_prime() [etc?]
where the callback function can request that the function be aborted.
[Gregory Stark <ghstark@pobox.com>, <rayyang2000@yahoo.com>]
o SRP in TLS.
[wished by:
Dj <derek@yo.net>, Tom Wu <tom@arcot.com>,
Tom Holroyd <tomh@po.crl.go.jp>]
See http://search.ietf.org/internet-drafts/draft-ietf-tls-srp-00.txt
as well as http://www-cs-students.stanford.edu/~tjw/srp/.
Tom Holroyd tells us there is a SRP patch for OpenSSH at
http://members.tripod.com/professor_tom/archives/, that could
be useful.

472
TABLE
View File

@@ -496,6 +496,68 @@ $ranlib =
$arflags = $arflags =
$multilib = $multilib =
*** QNX6
$cc = gcc
$cflags = -DTERMIOS
$unistd =
$thread_cflag =
$sys_id =
$lflags = -lsocket
$bn_ops =
$cpuid_obj =
$bn_obj =
$des_obj =
$aes_obj =
$bf_obj =
$md5_obj =
$sha1_obj =
$cast_obj =
$rc4_obj =
$rmd160_obj =
$rc5_obj =
$wp_obj =
$cmll_obj =
$perlasm_scheme = void
$dso_scheme = dlfcn
$shared_target= bsd-gcc-shared
$shared_cflag = -fPIC
$shared_ldflag =
$shared_extension = .so.$(SHLIB_MAJOR).$(SHLIB_MINOR)
$ranlib =
$arflags =
$multilib =
*** QNX6-i386
$cc = gcc
$cflags = -DL_ENDIAN -DTERMIOS -O2 -Wall
$unistd =
$thread_cflag =
$sys_id =
$lflags = -lsocket
$bn_ops = DES_PTR DES_RISC1 DES_UNROLL RC4_INDEX MD2_INT
$cpuid_obj = x86cpuid.o
$bn_obj = bn-586.o co-586.o x86-mont.o
$des_obj = des-586.o crypt586.o
$aes_obj = aes-586.o
$bf_obj = bf-586.o
$md5_obj = md5-586.o
$sha1_obj = sha1-586.o sha256-586.o sha512-586.o
$cast_obj = cast-586.o
$rc4_obj = rc4-586.o
$rmd160_obj = rmd-586.o
$rc5_obj = rc5-586.o
$wp_obj = wp_block.o wp-mmx.o
$cmll_obj = cmll-x86.o
$perlasm_scheme = elf
$dso_scheme = dlfcn
$shared_target= bsd-gcc-shared
$shared_cflag = -fPIC
$shared_ldflag =
$shared_extension = .so.$(SHLIB_MAJOR).$(SHLIB_MINOR)
$ranlib =
$arflags =
$multilib =
*** ReliantUNIX *** ReliantUNIX
$cc = cc $cc = cc
$cflags = -KPIC -g -DTERMIOS -DB_ENDIAN $cflags = -KPIC -g -DTERMIOS -DB_ENDIAN
@@ -702,8 +764,8 @@ $rc4_obj = rc4-x86_64.o
$rmd160_obj = $rmd160_obj =
$rc5_obj = $rc5_obj =
$wp_obj = wp-x86_64.o $wp_obj = wp-x86_64.o
$cmll_obj = $cmll_obj = cmll-x86_64.o cmll_misc.o
$perlasm_scheme = ml64 $perlasm_scheme = auto
$dso_scheme = win32 $dso_scheme = win32
$shared_target= $shared_target=
$shared_cflag = $shared_cflag =
@@ -748,7 +810,7 @@ $multilib =
$cc = cc $cc = cc
$cflags = -q32 -O -DB_ENDIAN -qmaxmem=16384 -qro -qroconst $cflags = -q32 -O -DB_ENDIAN -qmaxmem=16384 -qro -qroconst
$unistd = $unistd =
$thread_cflag = -qthreaded $thread_cflag = -qthreaded -D_THREAD_SAFE
$sys_id = AIX $sys_id = AIX
$lflags = $lflags =
$bn_ops = BN_LLONG RC4_CHAR $bn_ops = BN_LLONG RC4_CHAR
@@ -841,7 +903,7 @@ $multilib =
$cc = cc $cc = cc
$cflags = -q64 -O -DB_ENDIAN -qmaxmem=16384 -qro -qroconst $cflags = -q64 -O -DB_ENDIAN -qmaxmem=16384 -qro -qroconst
$unistd = $unistd =
$thread_cflag = -qthreaded $thread_cflag = -qthreaded -D_THREAD_SAFE
$sys_id = AIX $sys_id = AIX
$lflags = $lflags =
$bn_ops = SIXTY_FOUR_BIT_LONG RC4_CHAR $bn_ops = SIXTY_FOUR_BIT_LONG RC4_CHAR
@@ -1149,7 +1211,7 @@ $multilib =
*** darwin-ppc-cc *** darwin-ppc-cc
$cc = cc $cc = cc
$cflags = -arch ppc -O3 -DB_ENDIAN $cflags = -arch ppc -O3 -DB_ENDIAN -Wa,-force_cpusubtype_ALL
$unistd = $unistd =
$thread_cflag = -D_REENTRANT $thread_cflag = -D_REENTRANT
$sys_id = MACOSX $sys_id = MACOSX
@@ -1216,7 +1278,7 @@ $unistd =
$thread_cflag = -D_REENTRANT $thread_cflag = -D_REENTRANT
$sys_id = MACOSX $sys_id = MACOSX
$lflags = -Wl,-search_paths_first% $lflags = -Wl,-search_paths_first%
$bn_ops = SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK BF_PTR2 DES_INT DES_UNROLL $bn_ops = SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL
$cpuid_obj = x86_64cpuid.o $cpuid_obj = x86_64cpuid.o
$bn_obj = x86_64-gcc.o x86_64-mont.o $bn_obj = x86_64-gcc.o x86_64-mont.o
$des_obj = $des_obj =
@@ -1225,7 +1287,7 @@ $bf_obj =
$md5_obj = md5-x86_64.o $md5_obj = md5-x86_64.o
$sha1_obj = sha1-x86_64.o sha256-x86_64.o sha512-x86_64.o $sha1_obj = sha1-x86_64.o sha256-x86_64.o sha512-x86_64.o
$cast_obj = $cast_obj =
$rc4_obj = rc4-x86_64.o $rc4_obj =
$rmd160_obj = $rmd160_obj =
$rc5_obj = $rc5_obj =
$wp_obj = wp-x86_64.o $wp_obj = wp-x86_64.o
@@ -1333,9 +1395,102 @@ $ranlib =
$arflags = $arflags =
$multilib = $multilib =
*** debug-VC-WIN32
$cc = cl
$cflags = -W3 -WX -Gs0 -GF -Gy -Zi -nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -D_CRT_SECURE_NO_DEPRECATE
$unistd =
$thread_cflag =
$sys_id = WIN32
$lflags =
$bn_ops = BN_LLONG RC4_INDEX EXPORT_VAR_AS_FN RC4_INDEX MD2_INT
$cpuid_obj = x86cpuid.o
$bn_obj = bn-586.o co-586.o x86-mont.o
$des_obj = des-586.o crypt586.o
$aes_obj = aes-586.o
$bf_obj = bf-586.o
$md5_obj = md5-586.o
$sha1_obj = sha1-586.o sha256-586.o sha512-586.o
$cast_obj = cast-586.o
$rc4_obj = rc4-586.o
$rmd160_obj = rmd-586.o
$rc5_obj = rc5-586.o
$wp_obj = wp_block.o wp-mmx.o
$cmll_obj = cmll-x86.o
$perlasm_scheme = win32n
$dso_scheme = win32
$shared_target=
$shared_cflag =
$shared_ldflag =
$shared_extension =
$ranlib =
$arflags =
$multilib =
*** debug-VC-WIN64A
$cc = cl
$cflags = -W3 -Gs0 -Gy -Zi -nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -DUNICODE -D_UNICODE -D_CRT_SECURE_NO_DEPRECATE
$unistd =
$thread_cflag =
$sys_id = WIN64A
$lflags =
$bn_ops = SIXTY_FOUR_BIT RC4_CHUNK_LL DES_INT EXPORT_VAR_AS_FN
$cpuid_obj = x86_64cpuid.o
$bn_obj = bn_asm.o x86_64-mont.o
$des_obj =
$aes_obj = aes-x86_64.o
$bf_obj =
$md5_obj = md5-x86_64.o
$sha1_obj = sha1-x86_64.o sha256-x86_64.o sha512-x86_64.o
$cast_obj =
$rc4_obj = rc4-x86_64.o
$rmd160_obj =
$rc5_obj =
$wp_obj = wp-x86_64.o
$cmll_obj = cmll-x86_64.o cmll_misc.o
$perlasm_scheme = auto
$dso_scheme = win32
$shared_target=
$shared_cflag =
$shared_ldflag =
$shared_extension =
$ranlib =
$arflags =
$multilib =
*** debug-VC-WIN64I
$cc = cl
$cflags = -W3 -Gs0 -Gy -Zi -nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -DUNICODE -D_UNICODE -D_CRT_SECURE_NO_DEPRECATE
$unistd =
$thread_cflag =
$sys_id = WIN64I
$lflags =
$bn_ops = SIXTY_FOUR_BIT RC4_CHUNK_LL DES_INT EXPORT_VAR_AS_FN
$cpuid_obj = ia64cpuid.o
$bn_obj = ia64.o
$des_obj =
$aes_obj = aes_core.o aes_cbc.o aes-ia64.o
$bf_obj =
$md5_obj = md5-ia64.o
$sha1_obj = sha1-ia64.o sha256-ia64.o sha512-ia64.o
$cast_obj =
$rc4_obj =
$rmd160_obj =
$rc5_obj =
$wp_obj =
$cmll_obj =
$perlasm_scheme = ias
$dso_scheme = win32
$shared_target=
$shared_cflag =
$shared_ldflag =
$shared_extension =
$ranlib =
$arflags =
$multilib =
*** debug-ben *** debug-ben
$cc = gcc $cc = gcc
$cflags = -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DPEDANTIC -DDEBUG_SAFESTACK -O2 -pedantic -Wall -Wshadow -Werror -pipe $cflags = -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DPEDANTIC -DDEBUG_SAFESTACK -DDEBUG_UNUSED -O2 -pedantic -Wall -Wshadow -Werror -pipe
$unistd = $unistd =
$thread_cflag = (unknown) $thread_cflag = (unknown)
$sys_id = $sys_id =
@@ -1365,8 +1520,8 @@ $arflags =
$multilib = $multilib =
*** debug-ben-debug *** debug-ben-debug
$cc = gcc $cc = gcc44
$cflags = -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DPEDANTIC -DDEBUG_SAFESTACK -g3 -O2 -pedantic -Wall -Wshadow -Werror -pipe $cflags = -Wall -pedantic -DPEDANTIC -Wno-long-long -Wsign-compare -Wmissing-prototypes -Wshadow -Wformat -Werror -DCRYPTO_MDEBUG_ALL -DCRYPTO_MDEBUG_ABORT -DREF_CHECK -DOPENSSL_NO_DEPRECATED -DBN_DEBUG -DCONF_DEBUG -DDEBUG_SAFESTACK -DDEBUG_UNUSED -g3 -O2 -pipe
$unistd = $unistd =
$thread_cflag = (unknown) $thread_cflag = (unknown)
$sys_id = $sys_id =
@@ -1395,6 +1550,37 @@ $ranlib =
$arflags = $arflags =
$multilib = $multilib =
*** debug-ben-debug-64
$cc = gcc
$cflags = -Wall -pedantic -DPEDANTIC -Wno-long-long -Wsign-compare -Wmissing-prototypes -Wshadow -Wformat -Werror -DCRYPTO_MDEBUG_ALL -DCRYPTO_MDEBUG_ABORT -DREF_CHECK -DOPENSSL_NO_DEPRECATED -Wno-error=overlength-strings -Wno-error=strict-aliasing -Wno-error=uninitialized -DBN_DEBUG -DCONF_DEBUG -DDEBUG_SAFESTACK -DDEBUG_UNUSED -g3 -O3 -pipe
$unistd =
$thread_cflag = -pthread -D_THREAD_SAFE -D_REENTRANT
$sys_id =
$lflags =
$bn_ops = SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL
$cpuid_obj = x86_64cpuid.o
$bn_obj = x86_64-gcc.o x86_64-mont.o
$des_obj =
$aes_obj = aes-x86_64.o
$bf_obj =
$md5_obj = md5-x86_64.o
$sha1_obj = sha1-x86_64.o sha256-x86_64.o sha512-x86_64.o
$cast_obj =
$rc4_obj = rc4-x86_64.o
$rmd160_obj =
$rc5_obj =
$wp_obj = wp-x86_64.o
$cmll_obj = cmll-x86_64.o cmll_misc.o
$perlasm_scheme = elf
$dso_scheme = dlfcn
$shared_target= bsd-gcc-shared
$shared_cflag = -fPIC
$shared_ldflag =
$shared_extension = .so.$(SHLIB_MAJOR).$(SHLIB_MINOR)
$ranlib =
$arflags =
$multilib =
*** debug-ben-no-opt *** debug-ben-no-opt
$cc = gcc $cc = gcc
$cflags = -Wall -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations -DDEBUG_SAFESTACK -DCRYPTO_MDEBUG -Werror -DL_ENDIAN -DTERMIOS -Wall -g3 $cflags = -Wall -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations -DDEBUG_SAFESTACK -DCRYPTO_MDEBUG -Werror -DL_ENDIAN -DTERMIOS -Wall -g3
@@ -1521,34 +1707,34 @@ $multilib =
*** debug-bodo *** debug-bodo
$cc = gcc $cc = gcc
$cflags = -DL_ENDIAN -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBIO_PAIR_DEBUG -DPEDANTIC -g -march=i486 -pedantic -Wshadow -Wall -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wundef -Wconversion $cflags = -Wall -pedantic -DPEDANTIC -Wno-long-long -Wsign-compare -Wmissing-prototypes -Wshadow -Wformat -Werror -DCRYPTO_MDEBUG_ALL -DCRYPTO_MDEBUG_ABORT -DREF_CHECK -DOPENSSL_NO_DEPRECATED -Wno-error=overlength-strings -DBN_DEBUG -DBN_DEBUG_RAND -DCONF_DEBUG -DBIO_PAIR_DEBUG -m64 -DL_ENDIAN -DTERMIO -g -DMD32_REG_T=int
$unistd = $unistd =
$thread_cflag = -D_REENTRANT $thread_cflag = -D_REENTRANT
$sys_id = $sys_id =
$lflags = $lflags = -ldl
$bn_ops = BN_LLONG DES_PTR DES_RISC1 DES_UNROLL RC4_INDEX MD2_INT $bn_ops = SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL
$cpuid_obj = x86cpuid.o $cpuid_obj = x86_64cpuid.o
$bn_obj = bn-586.o co-586.o x86-mont.o $bn_obj = x86_64-gcc.o x86_64-mont.o
$des_obj = des-586.o crypt586.o $des_obj =
$aes_obj = aes-586.o $aes_obj = aes-x86_64.o
$bf_obj = bf-586.o $bf_obj =
$md5_obj = md5-586.o $md5_obj = md5-x86_64.o
$sha1_obj = sha1-586.o sha256-586.o sha512-586.o $sha1_obj = sha1-x86_64.o sha256-x86_64.o sha512-x86_64.o
$cast_obj = cast-586.o $cast_obj =
$rc4_obj = rc4-586.o $rc4_obj = rc4-x86_64.o
$rmd160_obj = rmd-586.o $rmd160_obj =
$rc5_obj = rc5-586.o $rc5_obj =
$wp_obj = wp_block.o wp-mmx.o $wp_obj = wp-x86_64.o
$cmll_obj = cmll-x86.o $cmll_obj = cmll-x86_64.o cmll_misc.o
$perlasm_scheme = elf $perlasm_scheme = elf
$dso_scheme = $dso_scheme = dlfcn
$shared_target= $shared_target= linux-shared
$shared_cflag = $shared_cflag = -fPIC
$shared_ldflag = $shared_ldflag = -m64
$shared_extension = $shared_extension = .so.$(SHLIB_MAJOR).$(SHLIB_MINOR)
$ranlib = $ranlib =
$arflags = $arflags =
$multilib = $multilib = 64
*** debug-darwin-i386-cc *** debug-darwin-i386-cc
$cc = cc $cc = cc
@@ -1676,7 +1862,7 @@ $multilib =
*** debug-levitte-linux-elf *** debug-levitte-linux-elf
$cc = gcc $cc = gcc
$cflags = -DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_DEBUG -DBN_DEBUG_RAND -DCRYPTO_MDEBUG -DENGINE_CONF_DEBUG -DL_ENDIAN -DTERMIO -D_POSIX_SOURCE -DPEDANTIC -ggdb -g3 -mcpu=i486 -pedantic -ansi -Wall -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wundef -Wconversion -pipe $cflags = -DLEVITTE_DEBUG -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -ggdb -g3 -Wall
$unistd = $unistd =
$thread_cflag = -D_REENTRANT $thread_cflag = -D_REENTRANT
$sys_id = $sys_id =
@@ -1707,7 +1893,7 @@ $multilib =
*** debug-levitte-linux-elf-extreme *** debug-levitte-linux-elf-extreme
$cc = gcc $cc = gcc
$cflags = -DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_DEBUG -DBN_DEBUG_RAND -DCRYPTO_MDEBUG -DENGINE_CONF_DEBUG -DL_ENDIAN -DTERMIO -D_POSIX_SOURCE -DPEDANTIC -ggdb -g3 -mcpu=i486 -pedantic -ansi -Wall -W -Wundef -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wundef -Wconversion -pipe $cflags = -DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_DEBUG -DBN_DEBUG_RAND -DCRYPTO_MDEBUG -DENGINE_CONF_DEBUG -DL_ENDIAN -DTERMIO -DPEDANTIC -ggdb -g3 -pedantic -ansi -Wall -W -Wundef -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wundef -Wconversion -pipe
$unistd = $unistd =
$thread_cflag = -D_REENTRANT $thread_cflag = -D_REENTRANT
$sys_id = $sys_id =
@@ -1738,7 +1924,7 @@ $multilib =
*** debug-levitte-linux-noasm *** debug-levitte-linux-noasm
$cc = gcc $cc = gcc
$cflags = -DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_DEBUG -DBN_DEBUG_RAND -DCRYPTO_MDEBUG -DENGINE_CONF_DEBUG -DOPENSSL_NO_ASM -DL_ENDIAN -DTERMIO -D_POSIX_SOURCE -DPEDANTIC -ggdb -g3 -mcpu=i486 -pedantic -ansi -Wall -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wundef -Wconversion -pipe $cflags = -DLEVITTE_DEBUG -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -DOPENSSL_NO_ASM -DL_ENDIAN -ggdb -g3 -Wall
$unistd = $unistd =
$thread_cflag = -D_REENTRANT $thread_cflag = -D_REENTRANT
$sys_id = $sys_id =
@@ -1769,7 +1955,7 @@ $multilib =
*** debug-levitte-linux-noasm-extreme *** debug-levitte-linux-noasm-extreme
$cc = gcc $cc = gcc
$cflags = -DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_DEBUG -DBN_DEBUG_RAND -DCRYPTO_MDEBUG -DENGINE_CONF_DEBUG -DOPENSSL_NO_ASM -DL_ENDIAN -DTERMIO -D_POSIX_SOURCE -DPEDANTIC -ggdb -g3 -mcpu=i486 -pedantic -ansi -Wall -W -Wundef -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wundef -Wconversion -pipe $cflags = -DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_DEBUG -DBN_DEBUG_RAND -DCRYPTO_MDEBUG -DENGINE_CONF_DEBUG -DOPENSSL_NO_ASM -DL_ENDIAN -DTERMIO -DPEDANTIC -ggdb -g3 -pedantic -ansi -Wall -W -Wundef -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wundef -Wconversion -pipe
$unistd = $unistd =
$thread_cflag = -D_REENTRANT $thread_cflag = -D_REENTRANT
$sys_id = $sys_id =
@@ -1860,6 +2046,68 @@ $ranlib =
$arflags = $arflags =
$multilib = $multilib =
*** debug-linux-generic32
$cc = gcc
$cflags = -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -DTERMIO -g -Wall
$unistd =
$thread_cflag = -D_REENTRANT
$sys_id =
$lflags = -ldl
$bn_ops = BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR
$cpuid_obj =
$bn_obj =
$des_obj =
$aes_obj =
$bf_obj =
$md5_obj =
$sha1_obj =
$cast_obj =
$rc4_obj =
$rmd160_obj =
$rc5_obj =
$wp_obj =
$cmll_obj =
$perlasm_scheme = void
$dso_scheme = dlfcn
$shared_target= linux-shared
$shared_cflag = -fPIC
$shared_ldflag =
$shared_extension = .so.$(SHLIB_MAJOR).$(SHLIB_MINOR)
$ranlib =
$arflags =
$multilib =
*** debug-linux-generic64
$cc = gcc
$cflags = -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -DTERMIO -g -Wall
$unistd =
$thread_cflag = -D_REENTRANT
$sys_id =
$lflags = -ldl
$bn_ops = SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR
$cpuid_obj =
$bn_obj =
$des_obj =
$aes_obj =
$bf_obj =
$md5_obj =
$sha1_obj =
$cast_obj =
$rc4_obj =
$rmd160_obj =
$rc5_obj =
$wp_obj =
$cmll_obj =
$perlasm_scheme = void
$dso_scheme = dlfcn
$shared_target= linux-shared
$shared_cflag = -fPIC
$shared_ldflag =
$shared_extension = .so.$(SHLIB_MAJOR).$(SHLIB_MINOR)
$ranlib =
$arflags =
$multilib =
*** debug-linux-ia32-aes *** debug-linux-ia32-aes
$cc = gcc $cc = gcc
$cflags = -DAES_EXPERIMENTAL -DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall $cflags = -DAES_EXPERIMENTAL -DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall
@@ -1953,6 +2201,37 @@ $ranlib =
$arflags = $arflags =
$multilib = $multilib =
*** debug-linux-x86_64
$cc = gcc
$cflags = -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -m64 -DL_ENDIAN -DTERMIO -g -Wall -DMD32_REG_T=int
$unistd =
$thread_cflag = -D_REENTRANT
$sys_id =
$lflags = -ldl
$bn_ops = SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL
$cpuid_obj = x86_64cpuid.o
$bn_obj = x86_64-gcc.o x86_64-mont.o
$des_obj =
$aes_obj = aes-x86_64.o
$bf_obj =
$md5_obj = md5-x86_64.o
$sha1_obj = sha1-x86_64.o sha256-x86_64.o sha512-x86_64.o
$cast_obj =
$rc4_obj = rc4-x86_64.o
$rmd160_obj =
$rc5_obj =
$wp_obj = wp-x86_64.o
$cmll_obj = cmll-x86_64.o cmll_misc.o
$perlasm_scheme = elf
$dso_scheme = dlfcn
$shared_target= linux-shared
$shared_cflag = -fPIC
$shared_ldflag = -m64
$shared_extension = .so.$(SHLIB_MAJOR).$(SHLIB_MINOR)
$ranlib =
$arflags =
$multilib = 64
*** debug-rse *** debug-rse
$cc = cc $cc = cc
$cflags = -DTERMIOS -DL_ENDIAN -pipe -O -g -ggdb3 -Wall $cflags = -DTERMIOS -DL_ENDIAN -pipe -O -g -ggdb3 -Wall
@@ -2115,7 +2394,7 @@ $unistd =
$thread_cflag = -D_REENTRANT $thread_cflag = -D_REENTRANT
$sys_id = $sys_id =
$lflags = -ldl $lflags = -ldl
$bn_ops = SIXTY_FOUR_BIT_LONG RC4_CHUNK BF_PTR2 DES_INT DES_UNROLL $bn_ops = SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL
$cpuid_obj = x86_64cpuid.o $cpuid_obj = x86_64cpuid.o
$bn_obj = x86_64-gcc.o x86_64-mont.o $bn_obj = x86_64-gcc.o x86_64-mont.o
$des_obj = $des_obj =
@@ -2177,7 +2456,7 @@ $unistd =
$thread_cflag = -D_REENTRANT $thread_cflag = -D_REENTRANT
$sys_id = $sys_id =
$lflags = -ldl $lflags = -ldl
$bn_ops = SIXTY_FOUR_BIT_LONG RC4_CHUNK BF_PTR2 DES_INT DES_UNROLL $bn_ops = SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL
$cpuid_obj = x86_64cpuid.o $cpuid_obj = x86_64cpuid.o
$bn_obj = x86_64-gcc.o x86_64-mont.o $bn_obj = x86_64-gcc.o x86_64-mont.o
$des_obj = $des_obj =
@@ -2234,7 +2513,7 @@ $multilib =
*** debug-vos-gcc *** debug-vos-gcc
$cc = gcc $cc = gcc
$cflags = -O0 -g -Wall -D_POSIX_C_SOURCE=200112L -D_BSD -DB_ENDIAN -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG $cflags = -O0 -g -Wall -DOPENSSL_SYSNAME_VOS -D_POSIX_C_SOURCE=200112L -D_BSD -D_VOS_EXTENDED_NAMES -DB_ENDIAN -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG
$unistd = $unistd =
$thread_cflag = (unknown) $thread_cflag = (unknown)
$sys_id = VOS $sys_id = VOS
@@ -3542,7 +3821,7 @@ $thread_cflag = -D_REENTRANT
$sys_id = $sys_id =
$lflags = -ldl $lflags = -ldl
$bn_ops = SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL $bn_ops = SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL
$cpuid_obj = s390xcpuid.o $cpuid_obj = s390xcap.o s390xcpuid.o
$bn_obj = bn-s390x.o s390x-mont.o $bn_obj = bn-s390x.o s390x-mont.o
$des_obj = $des_obj =
$aes_obj = aes-s390x.o $aes_obj = aes-s390x.o
@@ -3634,7 +3913,7 @@ $unistd =
$thread_cflag = -D_REENTRANT $thread_cflag = -D_REENTRANT
$sys_id = $sys_id =
$lflags = -ldl $lflags = -ldl
$bn_ops = SIXTY_FOUR_BIT_LONG RC4_CHUNK BF_PTR2 DES_INT DES_UNROLL $bn_ops = SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL
$cpuid_obj = x86_64cpuid.o $cpuid_obj = x86_64cpuid.o
$bn_obj = x86_64-gcc.o x86_64-mont.o $bn_obj = x86_64-gcc.o x86_64-mont.o
$des_obj = $des_obj =
@@ -3691,11 +3970,11 @@ $multilib = 64
*** mingw *** mingw
$cc = gcc $cc = gcc
$cflags = -mno-cygwin -DL_ENDIAN -fomit-frame-pointer -O3 -march=i486 -Wall $cflags = -mno-cygwin -DL_ENDIAN -DWIN32_LEAN_AND_MEAN -fomit-frame-pointer -O3 -march=i486 -Wall
$unistd = $unistd =
$thread_cflag = $thread_cflag = -D_MT
$sys_id = MINGW32 $sys_id = MINGW32
$lflags = -lws2_32 -lgdi32 $lflags = -lws2_32 -lgdi32 -lcrypt32
$bn_ops = BN_LLONG DES_PTR DES_RISC1 DES_UNROLL RC4_INDEX MD2_INT EXPORT_VAR_AS_FN $bn_ops = BN_LLONG DES_PTR DES_RISC1 DES_UNROLL RC4_INDEX MD2_INT EXPORT_VAR_AS_FN
$cpuid_obj = x86cpuid.o $cpuid_obj = x86cpuid.o
$bn_obj = bn-586.o co-586.o x86-mont.o $bn_obj = bn-586.o co-586.o x86-mont.o
@@ -3724,9 +4003,9 @@ $multilib =
$cc = gcc $cc = gcc
$cflags = -mno-cygwin -DL_ENDIAN -O3 -Wall -DWIN32_LEAN_AND_MEAN -DUNICODE -D_UNICODE $cflags = -mno-cygwin -DL_ENDIAN -O3 -Wall -DWIN32_LEAN_AND_MEAN -DUNICODE -D_UNICODE
$unistd = $unistd =
$thread_cflag = $thread_cflag = -D_MT
$sys_id = MINGW64 $sys_id = MINGW64
$lflags = -lws2_32 -lgdi32 $lflags = -lws2_32 -lgdi32 -lcrypt32
$bn_ops = SIXTY_FOUR_BIT RC4_CHUNK_LL DES_INT EXPORT_VAR_AS_FN $bn_ops = SIXTY_FOUR_BIT RC4_CHUNK_LL DES_INT EXPORT_VAR_AS_FN
$cpuid_obj = x86_64cpuid.o $cpuid_obj = x86_64cpuid.o
$bn_obj = x86_64-gcc.o x86_64-mont.o $bn_obj = x86_64-gcc.o x86_64-mont.o
@@ -4247,37 +4526,6 @@ $ranlib =
$arflags = $arflags =
$multilib = $multilib =
*** qnx6
$cc = cc
$cflags = -DL_ENDIAN -DTERMIOS
$unistd =
$thread_cflag = (unknown)
$sys_id =
$lflags = -lsocket
$bn_ops = DES_PTR DES_RISC1 DES_UNROLL RC4_INDEX MD2_INT
$cpuid_obj =
$bn_obj =
$des_obj =
$aes_obj =
$bf_obj =
$md5_obj =
$sha1_obj =
$cast_obj =
$rc4_obj =
$rmd160_obj =
$rc5_obj =
$wp_obj =
$cmll_obj =
$perlasm_scheme =
$dso_scheme =
$shared_target=
$shared_cflag =
$shared_ldflag =
$shared_extension =
$ranlib =
$arflags =
$multilib =
*** rhapsody-ppc-cc *** rhapsody-ppc-cc
$cc = cc $cc = cc
$cflags = -O3 -DB_ENDIAN $cflags = -O3 -DB_ENDIAN
@@ -4646,7 +4894,7 @@ $shared_target= solaris-shared
$shared_cflag = -KPIC $shared_cflag = -KPIC
$shared_ldflag = -xarch=v9 -G -dy -z text $shared_ldflag = -xarch=v9 -G -dy -z text
$shared_extension = .so.$(SHLIB_MAJOR).$(SHLIB_MINOR) $shared_extension = .so.$(SHLIB_MAJOR).$(SHLIB_MINOR)
$ranlib = /usr/ccs/bin/ar rs $ranlib =
$arflags = $arflags =
$multilib = /64 $multilib = /64
@@ -4688,7 +4936,7 @@ $unistd =
$thread_cflag = -D_REENTRANT $thread_cflag = -D_REENTRANT
$sys_id = $sys_id =
$lflags = -lsocket -lnsl -ldl $lflags = -lsocket -lnsl -ldl
$bn_ops = SIXTY_FOUR_BIT_LONG RC4_CHUNK BF_PTR2 DES_INT DES_UNROLL $bn_ops = SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL
$cpuid_obj = x86_64cpuid.o $cpuid_obj = x86_64cpuid.o
$bn_obj = x86_64-gcc.o x86_64-mont.o $bn_obj = x86_64-gcc.o x86_64-mont.o
$des_obj = $des_obj =
@@ -4719,7 +4967,7 @@ $unistd =
$thread_cflag = -D_REENTRANT $thread_cflag = -D_REENTRANT
$sys_id = $sys_id =
$lflags = -lsocket -lnsl -ldl $lflags = -lsocket -lnsl -ldl
$bn_ops = SIXTY_FOUR_BIT_LONG RC4_CHUNK BF_PTR2 DES_INT DES_UNROLL $bn_ops = SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL
$cpuid_obj = x86_64cpuid.o $cpuid_obj = x86_64cpuid.o
$bn_obj = x86_64-gcc.o x86_64-mont.o $bn_obj = x86_64-gcc.o x86_64-mont.o
$des_obj = $des_obj =
@@ -4836,6 +5084,68 @@ $ranlib =
$arflags = $arflags =
$multilib = $multilib =
*** uClinux-dist
$cc =
$cflags = $(CFLAGS)
$unistd =
$thread_cflag = -D_REENTRANT
$sys_id =
$lflags = $(LDFLAGS) $(LDLIBS)
$bn_ops = BN_LLONG
$cpuid_obj =
$bn_obj =
$des_obj =
$aes_obj =
$bf_obj =
$md5_obj =
$sha1_obj =
$cast_obj =
$rc4_obj =
$rmd160_obj =
$rc5_obj =
$wp_obj =
$cmll_obj =
$perlasm_scheme =
$dso_scheme =
$shared_target= linux-shared
$shared_cflag = -fPIC
$shared_ldflag = -shared
$shared_extension = .so.$(SHLIB_MAJOR).$(SHLIB_MINOR)
$ranlib =
$arflags =
$multilib =
*** uClinux-dist64
$cc =
$cflags = $(CFLAGS)
$unistd =
$thread_cflag = -D_REENTRANT
$sys_id =
$lflags = $(LDFLAGS) $(LDLIBS)
$bn_ops = SIXTY_FOUR_BIT_LONG
$cpuid_obj =
$bn_obj =
$des_obj =
$aes_obj =
$bf_obj =
$md5_obj =
$sha1_obj =
$cast_obj =
$rc4_obj =
$rmd160_obj =
$rc5_obj =
$wp_obj =
$cmll_obj =
$perlasm_scheme =
$dso_scheme =
$shared_target= linux-shared
$shared_cflag = -fPIC
$shared_ldflag = -shared
$shared_extension = .so.$(SHLIB_MAJOR).$(SHLIB_MINOR)
$ranlib =
$arflags =
$multilib =
*** ultrix-cc *** ultrix-cc
$cc = cc $cc = cc
$cflags = -std1 -O -Olimit 2500 -DL_ENDIAN $cflags = -std1 -O -Olimit 2500 -DL_ENDIAN
@@ -5024,7 +5334,7 @@ $multilib =
*** vos-gcc *** vos-gcc
$cc = gcc $cc = gcc
$cflags = -O3 -Wall -D_POSIX_C_SOURCE=200112L -D_BSD -DB_ENDIAN $cflags = -O3 -Wall -DOPENSSL_SYSNAME_VOS -D_POSIX_C_SOURCE=200112L -D_BSD -D_VOS_EXTENDED_NAMES -DB_ENDIAN
$unistd = $unistd =
$thread_cflag = (unknown) $thread_cflag = (unknown)
$sys_id = VOS $sys_id = VOS

67
VMS/install-vms.com Executable file
View File

@@ -0,0 +1,67 @@
$! install-vms.com -- Installs the files in a given directory tree
$!
$! Author: Richard Levitte <richard@levitte.org>
$! Time of creation: 23-MAY-1998 19:22
$!
$! P1 root of the directory tree
$!
$!
$! Announce/identify.
$!
$ proc = f$environment( "procedure")
$ write sys$output "@@@ "+ -
f$parse( proc, , , "name")+ f$parse( proc, , , "type")
$!
$ on error then goto tidy
$ on control_c then goto tidy
$!
$ if p1 .eqs. ""
$ then
$ write sys$output "First argument missing."
$ write sys$output -
"Should be the directory where you want things installed."
$ exit
$ endif
$
$ if (f$getsyi( "cpu") .lt. 128)
$ then
$ arch = "VAX"
$ else
$ arch = f$edit( f$getsyi( "arch_name"), "upcase")
$ if (arch .eqs. "") then arch = "UNK"
$ endif
$
$ root = f$parse( P1, "[]A.;0", , , "SYNTAX_ONLY, NO_CONCEAL")- "A.;0"
$ root_dev = f$parse( root, , , "device", "syntax_only")
$ root_dir = f$parse( root, , , "directory", "syntax_only") - -
"[000000." - "][" - "[" - "]"
$ root = root_dev + "[" + root_dir
$
$ define /nolog wrk_sslroot 'root'.] /translation_attributes = concealed
$ define /nolog wrk_sslinclude wrk_sslroot:[include]
$
$ if f$parse( "wrk_sslroot:[000000]") .eqs. "" then -
create /directory /log wrk_sslroot:[000000]
$ if f$parse( "wrk_sslinclude:") .eqs. "" then -
create /directory /log wrk_sslinclude:
$ if f$parse( "wrk_sslroot:[vms]") .eqs. "" then -
create /directory /log wrk_sslroot:[vms]
$!
$ copy /log /protection = world:re openssl_startup.com wrk_sslroot:[vms]
$ copy /log /protection = world:re openssl_undo.com wrk_sslroot:[vms]
$ copy /log /protection = world:re openssl_utils.com wrk_sslroot:[vms]
$!
$ tidy:
$!
$ call deass wrk_sslroot
$ call deass wrk_sslinclude
$!
$ exit
$!
$ deass: subroutine
$ if (f$trnlnm( p1, "LNM$PROCESS") .nes. "")
$ then
$ deassign /process 'p1'
$ endif
$ endsubroutine
$!

View File

@@ -1,72 +0,0 @@
$! INSTALL.COM -- Installs the files in a given directory tree
$!
$! Author: Richard Levitte <richard@levitte.org>
$! Time of creation: 23-MAY-1998 19:22
$!
$! P1 root of the directory tree
$!
$ IF P1 .EQS. ""
$ THEN
$ WRITE SYS$OUTPUT "First argument missing."
$ WRITE SYS$OUTPUT "Should be the directory where you want things installed."
$ EXIT
$ ENDIF
$
$ ROOT = F$PARSE(P1,"[]A.;0",,,"SYNTAX_ONLY,NO_CONCEAL") - "A.;0"
$ ROOT_DEV = F$PARSE(ROOT,,,"DEVICE","SYNTAX_ONLY")
$ ROOT_DIR = F$PARSE(ROOT,,,"DIRECTORY","SYNTAX_ONLY") -
- "[000000." - "][" - "[" - "]"
$ ROOT = ROOT_DEV + "[" + ROOT_DIR
$
$ DEFINE/NOLOG WRK_SSLROOT 'ROOT'.] /TRANS=CONC
$ DEFINE/NOLOG WRK_SSLVLIB WRK_SSLROOT:[VAX_LIB]
$ DEFINE/NOLOG WRK_SSLALIB WRK_SSLROOT:[ALPHA_LIB]
$ DEFINE/NOLOG WRK_SSLINCLUDE WRK_SSLROOT:[INCLUDE]
$ DEFINE/NOLOG WRK_SSLVEXE WRK_SSLROOT:[VAX_EXE]
$ DEFINE/NOLOG WRK_SSLAEXE WRK_SSLROOT:[ALPHA_EXE]
$ DEFINE/NOLOG WRK_SSLCERTS WRK_SSLROOT:[CERTS]
$ DEFINE/NOLOG WRK_SSLPRIVATE WRK_SSLROOT:[PRIVATE]
$
$ IF F$PARSE("WRK_SSLROOT:[000000]") .EQS. "" THEN -
CREATE/DIR/LOG WRK_SSLROOT:[000000]
$ IF F$PARSE("WRK_SSLINCLUDE:") .EQS. "" THEN -
CREATE/DIR/LOG WRK_SSLINCLUDE:
$ IF F$PARSE("WRK_SSLROOT:[VMS]") .EQS. "" THEN -
CREATE/DIR/LOG WRK_SSLROOT:[VMS]
$
$ IF F$SEARCH("WRK_SSLINCLUDE:vms_idhacks.h") .NES. "" THEN -
DELETE WRK_SSLINCLUDE:vms_idhacks.h;*
$
$ OPEN/WRITE SF WRK_SSLROOT:[VMS]OPENSSL_STARTUP.COM
$ WRITE SYS$OUTPUT "%OPEN-I-CREATED, ",F$SEARCH("WRK_SSLROOT:[VMS]OPENSSL_STARTUP.COM")," created."
$ WRITE SF "$! Startup file for Openssl 0.9.2-RL 15-Mar-1999"
$ WRITE SF "$!"
$ WRITE SF "$! Do not edit this file, as it will be regenerated during next installation."
$ WRITE SF "$! Instead, add or change SSLROOT:[VMS]OPENSSL_SYSTARTUP.COM"
$ WRITE SF "$!"
$ WRITE SF "$! P1 a qualifier to DEFINE. For example ""/SYSTEM"" to get the logical names"
$ WRITE SF "$! defined in the system logical name table."
$ WRITE SF "$!"
$ WRITE SF "$ ARCH = ""VAX"""
$ WRITE SF "$ IF F$GETSYI(""CPU"") .GE. 128 THEN ARCH = ""ALPHA"""
$ WRITE SF "$ DEFINE/NOLOG'P1 SSLROOT ",ROOT,".] /TRANS=CONC"
$ WRITE SF "$ DEFINE/NOLOG'P1 SSLLIB SSLROOT:['ARCH'_LIB]"
$ WRITE SF "$ DEFINE/NOLOG'P1 SSLINCLUDE SSLROOT:[INCLUDE]"
$ WRITE SF "$ DEFINE/NOLOG'P1 SSLEXE SSLROOT:['ARCH'_EXE]"
$ WRITE SF "$ DEFINE/NOLOG'P1 SSLCERTS SSLROOT:[CERTS]"
$ WRITE SF "$ DEFINE/NOLOG'P1 SSLPRIVATE SSLROOT:[PRIVATE]"
$ WRITE SF "$"
$ WRITE SF "$! This is program can include <openssl/{foo}.h>"
$ WRITE SF "$ DEFINE/NOLOG'P1 OPENSSL SSLINCLUDE:"
$ WRITE SF "$"
$ WRITE SF "$ IF F$SEARCH(""SSLROOT:[VMS]OPENSSL_SYSTARTUP.COM"") .NES."""" THEN -"
$ WRITE SF " @SSLROOT:[VMS]OPENSSL_SYSTARTUP.COM"
$ WRITE SF "$"
$ WRITE SF "$ EXIT"
$ CLOSE SF
$ SET FILE/PROT=WORLD:RE WRK_SSLROOT:[VMS]OPENSSL_STARTUP.COM
$
$ COPY OPENSSL_UTILS.COM WRK_SSLROOT:[VMS]/LOG
$ SET FILE/PROT=WORLD:RE WRK_SSLROOT:[VMS]OPENSSL_UTILS.COM
$
$ EXIT

View File

@@ -1,77 +1,168 @@
$! MKSHARED.COM -- script to created shareable images on VMS $! MKSHARED.COM -- Create shareable images.
$! $!
$! No command line parameters. This should be run at the start of the source $! P1: "64" for 64-bit pointers.
$! tree (the same directory where one finds INSTALL.VMS).
$! $!
$! Input: [.UTIL]LIBEAY.NUM,[.AXP.EXE.CRYPTO]LIBCRYPTO.OLB $! P2: Zlib object library path (optional).
$! [.UTIL]SSLEAY.NUM,[.AXP.EXE.SSL]LIBSSL.OLB $!
$! Output: [.AXP.EXE.CRYPTO]LIBCRYPTO.OPT,.MAP,.EXE $! Input: [.UTIL]LIBEAY.NUM,[.xxx.EXE.CRYPTO]SSL_LIBCRYPTO[32].OLB
$! [.AXP.EXE.SSL]LIBSSL.OPT,.MAP,.EXE $! [.UTIL]SSLEAY.NUM,[.xxx.EXE.SSL]SSL_LIBSSL[32].OLB
$! [.CRYPTO.xxx]OPENSSLCONF.H
$! Output: [.xxx.EXE.CRYPTO]SSL_LIBCRYPTO_SHR[32].OPT,.MAP,.EXE
$! [.xxx.EXE.SSL]SSL_LIBSSL_SRH[32].OPT,.MAP,.EXE
$! $!
$! So far, tests have only been made on VMS for Alpha. VAX will come in time. $! So far, tests have only been made on VMS for Alpha. VAX will come in time.
$! =========================================================================== $! ===========================================================================
$ $!
$! Announce/identify.
$!
$ proc = f$environment( "procedure")
$ write sys$output "@@@ "+ -
f$parse( proc, , , "name")+ f$parse( proc, , , "type")
$!
$! Save the original default device:[directory].
$!
$ def_orig = f$environment( "default")
$ on error then goto tidy
$ on control_c then goto tidy
$!
$! SET DEFAULT to the main kit directory.
$!
$ proc = f$environment("procedure")
$ proc = f$parse( "A.;", proc)- "A.;"
$ set default 'proc'
$ set default [-]
$!
$! ----- Prepare info for processing: version number and file info $! ----- Prepare info for processing: version number and file info
$ gosub read_version_info $ gosub read_version_info
$ if libver .eqs. "" $ if libver .eqs. ""
$ then $ then
$ write sys$error "ERROR: Couldn't find any library version info..." $ write sys$error "ERROR: Couldn't find any library version info..."
$ exit $ go to tidy:
$ endif $ endif
$ $
$ if f$getsyi("CPU") .ge. 128 $ if (f$getsyi("cpu") .lt. 128)
$ then $ then
$ libid = "Crypto" $ arch_vax = 1
$ libnum = "[.UTIL]LIBEAY.NUM" $ arch = "VAX"
$ libdir = "[.AXP.EXE.CRYPTO]"
$ libolb = "''libdir'LIBCRYPTO.OLB"
$ libopt = "''libdir'LIBCRYPTO.OPT"
$ libmap = "''libdir'LIBCRYPTO.MAP"
$ libgoal= "''libdir'LIBCRYPTO.EXE"
$ libref = ""
$ gosub create_axp_shr
$ libid = "SSL"
$ libnum = "[.UTIL]SSLEAY.NUM"
$ libdir = "[.AXP.EXE.SSL]"
$ libolb = "''libdir'LIBSSL.OLB"
$ libopt = "''libdir'LIBSSL.OPT"
$ libmap = "''libdir'LIBSSL.MAP"
$ libgoal= "''libdir'LIBSSL.EXE"
$ libref = "[.AXP.EXE.CRYPTO]LIBCRYPTO.EXE"
$ gosub create_axp_shr
$ else $ else
$ arch_vax = 0
$ arch = f$edit( f$getsyi( "ARCH_NAME"), "UPCASE")
$ if (arch .eqs. "") then arch = "UNK"
$ endif
$!
$ archd = arch
$ lib32 = "32"
$ shr = "SHR32"
$!
$ if (p1 .nes. "")
$ then
$ if (p1 .eqs. "64")
$ then
$ archd = arch+ "_64"
$ lib32 = ""
$ shr = "SHR"
$ else
$ if (p1 .nes. "32")
$ then
$ write sys$output "Second argument invalid."
$ write sys$output "It should be "32", "64", or nothing."
$ exit
$ endif
$ endif
$ endif
$!
$! ----- Prepare info for processing: disabled algorithms info
$ gosub read_disabled_algorithms_info
$!
$ ZLIB = p2
$ zlib_lib = ""
$ if (ZLIB .nes. "")
$ then
$ file2 = f$parse( ZLIB, "libz.olb", , , "syntax_only")
$ if (f$search( file2) .eqs. "")
$ then
$ write sys$output ""
$ write sys$output "The Option ", ZLIB, " Is Invalid."
$ write sys$output " Can't find library: ''file2'"
$ write sys$output ""
$ goto tidy
$ endif
$ zlib_lib = ", ''file2' /library"
$ endif
$!
$ if (arch_vax)
$ then
$ libtit = "CRYPTO_TRANSFER_VECTOR" $ libtit = "CRYPTO_TRANSFER_VECTOR"
$ libid = "Crypto" $ libid = "Crypto"
$ libnum = "[.UTIL]LIBEAY.NUM" $ libnum = "[.UTIL]LIBEAY.NUM"
$ libdir = "[.VAX.EXE.CRYPTO]" $ libdir = "[.''ARCHD'.EXE.CRYPTO]"
$ libmar = "''libdir'LIBCRYPTO.MAR" $ libmar = "''libdir'SSL_LIBCRYPTO_''shr'.MAR"
$ libolb = "''libdir'LIBCRYPTO.OLB" $ libolb = "''libdir'SSL_LIBCRYPTO''lib32'.OLB"
$ libopt = "''libdir'LIBCRYPTO.OPT" $ libopt = "''libdir'SSL_LIBCRYPTO_''shr'.OPT"
$ libobj = "''libdir'LIBCRYPTO.OBJ" $ libobj = "''libdir'SSL_LIBCRYPTO_''shr'.OBJ"
$ libmap = "''libdir'LIBCRYPTO.MAP" $ libmap = "''libdir'SSL_LIBCRYPTO_''shr'.MAP"
$ libgoal= "''libdir'LIBCRYPTO.EXE" $ libgoal= "''libdir'SSL_LIBCRYPTO_''shr'.EXE"
$ libref = "" $ libref = ""
$ libvec = "LIBCRYPTO" $ libvec = "LIBCRYPTO"
$ gosub create_vax_shr $ if f$search( libolb) .nes. "" then gosub create_vax_shr
$ libtit = "SSL_TRANSFER_VECTOR" $ libtit = "SSL_TRANSFER_VECTOR"
$ libid = "SSL" $ libid = "SSL"
$ libnum = "[.UTIL]SSLEAY.NUM" $ libnum = "[.UTIL]SSLEAY.NUM"
$ libdir = "[.VAX.EXE.SSL]" $ libdir = "[.''ARCHD'.EXE.SSL]"
$ libmar = "''libdir'LIBSSL.MAR" $ libmar = "''libdir'SSL_LIBSSL_''shr'.MAR"
$ libolb = "''libdir'LIBSSL.OLB" $ libolb = "''libdir'SSL_LIBSSL''lib32'.OLB"
$ libopt = "''libdir'LIBSSL.OPT" $ libopt = "''libdir'SSL_LIBSSL_''shr'.OPT"
$ libobj = "''libdir'LIBSSL.OBJ" $ libobj = "''libdir'SSL_LIBSSL_''shr'.OBJ"
$ libmap = "''libdir'LIBSSL.MAP" $ libmap = "''libdir'SSL_LIBSSL_''shr'.MAP"
$ libgoal= "''libdir'LIBSSL.EXE" $ libgoal= "''libdir'SSL_LIBSSL_''shr'.EXE"
$ libref = "[.VAX.EXE.CRYPTO]LIBCRYPTO.EXE" $ libref = "[.''ARCHD'.EXE.CRYPTO]SSL_LIBCRYPTO_''shr'.EXE"
$ libvec = "LIBSSL" $ libvec = "LIBSSL"
$ gosub create_vax_shr $ if f$search( libolb) .nes. "" then gosub create_vax_shr
$ else
$ libid = "Crypto"
$ libnum = "[.UTIL]LIBEAY.NUM"
$ libdir = "[.''ARCHD'.EXE.CRYPTO]"
$ libolb = "''libdir'SSL_LIBCRYPTO''lib32'.OLB"
$ libopt = "''libdir'SSL_LIBCRYPTO_''shr'.OPT"
$ libmap = "''libdir'SSL_LIBCRYPTO_''shr'.MAP"
$ libgoal= "''libdir'SSL_LIBCRYPTO_''shr'.EXE"
$ libref = ""
$ if f$search( libolb) .nes. "" then gosub create_nonvax_shr
$ libid = "SSL"
$ libnum = "[.UTIL]SSLEAY.NUM"
$ libdir = "[.''ARCHD'.EXE.SSL]"
$ libolb = "''libdir'SSL_LIBSSL''lib32'.OLB"
$ libopt = "''libdir'SSL_LIBSSL_''shr'.OPT"
$ libmap = "''libdir'SSL_LIBSSL_''shr'.MAP"
$ libgoal= "''libdir'SSL_LIBSSL_''shr'.EXE"
$ libref = "[.''ARCHD'.EXE.CRYPTO]SSL_LIBCRYPTO_''shr'.EXE"
$ if f$search( libolb) .nes. "" then gosub create_nonvax_shr
$ endif $ endif
$!
$ tidy:
$!
$! Close any open files.
$!
$ if (f$trnlnm( "libnum", "LNM$PROCESS", 0, "SUPERVISOR") .nes. "") then -
close libnum
$!
$ if (f$trnlnm( "mar", "LNM$PROCESS", 0, "SUPERVISOR") .nes. "") then -
close mar
$!
$ if (f$trnlnm( "opt", "LNM$PROCESS", 0, "SUPERVISOR") .nes. "") then -
close opt
$!
$ if (f$trnlnm( "vf", "LNM$PROCESS", 0, "SUPERVISOR") .nes. "") then -
close vf
$!
$! Restore the original default device:[directory].
$!
$ set default 'def_orig'
$ exit $ exit
$ $
$! ----- Soubroutines to actually build the shareable libraries $! ----- Subroutines to build the shareable libraries
$! The way things work, there's a main shareable library creator for each $! For each supported architecture, there's a main shareable library
$! supported architecture, which is called from the main code above. $! creator, which is called from the main code above.
$! The creator will define a number of variables to tell the next levels of $! The creator will define a number of variables to tell the next levels of
$! subroutines what routines to use to write to the option files, call the $! subroutines what routines to use to write to the option files, call the
$! main processor, read_func_num, and when that is done, it will write version $! main processor, read_func_num, and when that is done, it will write version
@@ -97,28 +188,29 @@ $! read_func_num depends on the following variables from the creator:
$! libwriter The name of the writer routine to call for each .num file line $! libwriter The name of the writer routine to call for each .num file line
$! ----- $! -----
$ $
$! ----- Subroutines for AXP $! ----- Subroutines for non-VAX
$! ----- $! -----
$! The creator routine $! The creator routine
$ create_axp_shr: $ create_nonvax_shr:
$ open/write opt 'libopt' $ open /write opt 'libopt'
$ write opt "identification=""",libid," ",libverstr,"""" $ write opt "identification=""",libid," ",libverstr,""""
$ write opt libolb,"/lib" $ write opt libolb, " /library"
$ if libref .nes. "" then write opt libref,"/SHARE" $ if libref .nes. "" then write opt libref,"/SHARE"
$ write opt "SYMBOL_VECTOR=(-" $ write opt "SYMBOL_VECTOR=(-"
$ libfirstentry := true $ libfirstentry := true
$ libwrch := opt $ libwrch := opt
$ libwriter := write_axp_transfer_entry $ libwriter := write_nonvax_transfer_entry
$ textcount = 0 $ textcount = 0
$ gosub read_func_num $ gosub read_func_num
$ write opt ")" $ write opt ")"
$ write opt "GSMATCH=",libvmatch,",",libver $ write opt "GSMATCH=",libvmatch,",",libver
$ close opt $ close opt
$ link/map='libmap'/full/share='libgoal' 'libopt'/option $ link /map = 'libmap' /full /share = 'libgoal' 'libopt' /options -
'zlib_lib'
$ return $ return
$ $
$! The record writer routine $! The record writer routine
$ write_axp_transfer_entry: $ write_nonvax_transfer_entry:
$ if libentry .eqs. ".dummy" then return $ if libentry .eqs. ".dummy" then return
$ if info_kind .eqs. "VARIABLE" $ if info_kind .eqs. "VARIABLE"
$ then $ then
@@ -144,11 +236,11 @@ $ libfirstentry := false
$ textcount = textcount + textcount_this $ textcount = textcount + textcount_this
$ return $ return
$ $
$! ----- Subroutines for AXP $! ----- Subroutines for VAX
$! ----- $! -----
$! The creator routine $! The creator routine
$ create_vax_shr: $ create_vax_shr:
$ open/write mar 'libmar' $ open /write mar 'libmar'
$ type sys$input:/out=mar: $ type sys$input:/out=mar:
; ;
; Transfer vector for VAX shareable image ; Transfer vector for VAX shareable image
@@ -183,10 +275,10 @@ $! libwriter := write_vax_vtransfer_entry
$! gosub read_func_num $! gosub read_func_num
$ write mar " .END" $ write mar " .END"
$ close mar $ close mar
$ open/write opt 'libopt' $ open /write opt 'libopt'
$ write opt "identification=""",libid," ",libverstr,"""" $ write opt "identification=""",libid," ",libverstr,""""
$ write opt libobj $ write opt libobj
$ write opt libolb,"/lib" $ write opt libolb, " /library"
$ if libref .nes. "" then write opt libref,"/SHARE" $ if libref .nes. "" then write opt libref,"/SHARE"
$ type sys$input:/out=opt: $ type sys$input:/out=opt:
! !
@@ -205,7 +297,8 @@ $ libwriter := write_vax_psect_attr
$ gosub read_func_num $ gosub read_func_num
$ close opt $ close opt
$ macro/obj='libobj' 'libmar' $ macro/obj='libobj' 'libmar'
$ link/map='libmap'/full/share='libgoal' 'libopt'/option $ link /map = 'libmap' /full /share = 'libgoal' 'libopt' /options -
'zlib_lib'
$ return $ return
$ $
$! The record writer routine for VAX functions $! The record writer routine for VAX functions
@@ -227,9 +320,9 @@ $ return
$ $
$! ----- Common subroutines $! ----- Common subroutines
$! ----- $! -----
$! The .num file reader. This one has great responsability. $! The .num file reader. This one has great responsibility.
$ read_func_num: $ read_func_num:
$ open libnum 'libnum' $ open /read libnum 'libnum'
$ goto read_nums $ goto read_nums
$ $
$ read_nums: $ read_nums:
@@ -237,35 +330,46 @@ $ libentrynum=0
$ liblastentry:=false $ liblastentry:=false
$ entrycount=0 $ entrycount=0
$ loop: $ loop:
$ read/end=loop_end/err=loop_end libnum line $ read /end=loop_end /err=loop_end libnum line
$ entrynum=f$int(f$element(1," ",f$edit(line,"COMPRESS,TRIM"))) $ lin = f$edit( line, "COMPRESS,TRIM")
$ entryinfo=f$element(2," ",f$edit(line,"COMPRESS,TRIM")) $! Skip a "#" comment line.
$ curentry=f$element(0," ",f$edit(line,"COMPRESS,TRIM")) $ if (f$extract( 0, 1, lin) .eqs. "#") then goto loop
$ info_exist=f$element(0,":",entryinfo) $ entrynum = f$int(f$element( 1, " ", lin))
$ info_platforms=","+f$element(1,":",entryinfo)+"," $ entryinfo = f$element( 2, " ", lin)
$ info_kind=f$element(2,":",entryinfo) $ curentry = f$element( 0, " ", lin)
$ info_algorithms=","+f$element(3,":",entryinfo)+"," $ info_exist = f$element( 0, ":", entryinfo)
$ info_platforms = ","+ f$element(1, ":", entryinfo)+ ","
$ info_kind = f$element( 2, ":", entryinfo)
$ info_algorithms = ","+ f$element( 3, ":", entryinfo)+ ","
$ if info_exist .eqs. "NOEXIST" then goto loop $ if info_exist .eqs. "NOEXIST" then goto loop
$ truesum = 0 $ truesum = 0
$ falsesum = 0 $ falsesum = 0
$ negatives = 1 $ negatives = 1
$ plat_i = 0 $ plat_i = 0
$ loop1: $ loop1:
$ plat_entry = f$element(plat_i,",",info_platforms) $ plat_entry = f$element( plat_i, ",", info_platforms)
$ plat_i = plat_i + 1 $ plat_i = plat_i + 1
$ if plat_entry .eqs. "" then goto loop1 $ if plat_entry .eqs. "" then goto loop1
$ if plat_entry .nes. "," $ if plat_entry .nes. ","
$ then $ then
$ if f$extract(0,1,plat_entry) .nes. "!" then negatives = 0 $ if f$extract(0,1,plat_entry) .nes. "!" then negatives = 0
$ if f$getsyi("CPU") .lt. 128 $ if (arch_vax)
$ then $ then
$ if plat_entry .eqs. "EXPORT_VAR_AS_FUNCTION" then - $ if plat_entry .eqs. "EXPORT_VAR_AS_FUNCTION" then -
$ truesum = truesum + 1 $ truesum = truesum + 1
$ if plat_entry .eqs. "!EXPORT_VAR_AS_FUNCTION" then - $ if plat_entry .eqs. "!EXPORT_VAR_AS_FUNCTION" then -
$ falsesum = falsesum + 1 $ falsesum = falsesum + 1
$ endif $ endif
$ if plat_entry .eqs. "VMS" then truesum = truesum + 1 $!
$ if plat_entry .eqs. "!VMS" then falsesum = falsesum + 1 $ if ((plat_entry .eqs. "VMS") .or. -
((plat_entry .eqs. "ZLIB") .and. (ZLIB .nes. "")) .or. -
(arch_vax .and. (plat_entry .eqs. "VMSVAX"))) then -
truesum = truesum + 1
$!
$ if ((plat_entry .eqs. "!VMS") .or. -
(arch_vax .and. (plat_entry .eqs. "!VMSVAX"))) then -
falsesum = falsesum + 1
$!
$ goto loop1 $ goto loop1
$ endif $ endif
$ endloop1: $ endloop1:
@@ -284,8 +388,7 @@ $ alg_i = alg_i + 1
$ if alg_entry .eqs. "" then goto loop2 $ if alg_entry .eqs. "" then goto loop2
$ if alg_entry .nes. "," $ if alg_entry .nes. ","
$ then $ then
$ if alg_entry .eqs. "KRB5" then goto loop ! Special for now $ if disabled_algorithms - ("," + alg_entry + ",") .nes disabled_algorithms then goto loop
$ if alg_entry .eqs. "STATIC_ENGINE" then goto loop ! Special for now
$ if f$trnlnm("OPENSSL_NO_"+alg_entry) .nes. "" then goto loop $ if f$trnlnm("OPENSSL_NO_"+alg_entry) .nes. "" then goto loop
$ goto loop2 $ goto loop2
$ endif $ endif
@@ -328,7 +431,7 @@ $
$! The version number reader $! The version number reader
$ read_version_info: $ read_version_info:
$ libver = "" $ libver = ""
$ open/read vf [.CRYPTO]OPENSSLV.H $ open /read vf [.CRYPTO]OPENSSLV.H
$ loop_rvi: $ loop_rvi:
$ read/err=endloop_rvi/end=endloop_rvi vf rvi_line $ read/err=endloop_rvi/end=endloop_rvi vf rvi_line
$ if rvi_line - "SHLIB_VERSION_NUMBER """ .eqs. rvi_line then - $ if rvi_line - "SHLIB_VERSION_NUMBER """ .eqs. rvi_line then -
@@ -352,3 +455,22 @@ $ endif
$ endloop_rvi: $ endloop_rvi:
$ close vf $ close vf
$ return $ return
$
$! The disabled algorithms reader
$ read_disabled_algorithms_info:
$ disabled_algorithms = ","
$ open /read cf [.CRYPTO.'ARCH']OPENSSLCONF.H
$ loop_rci:
$ read/err=endloop_rci/end=endloop_rci cf rci_line
$ rci_line = f$edit(rci_line,"TRIM,COMPRESS")
$ rci_ei = 0
$ if f$extract(0,9,rci_line) .eqs. "# define " then rci_ei = 2
$ if f$extract(0,8,rci_line) .eqs. "#define " then rci_ei = 1
$ if rci_ei .eq. 0 then goto loop_rci
$ rci_e = f$element(rci_ei," ",rci_line)
$ if f$extract(0,11,rci_e) .nes. "OPENSSL_NO_" then goto loop_rci
$ disabled_algorithms = disabled_algorithms + f$extract(11,999,rci_e) + ","
$ goto loop_rci
$ endloop_rci:
$ close cf
$ return

108
VMS/openssl_startup.com Executable file
View File

@@ -0,0 +1,108 @@
$!
$! Startup file for OpenSSL 1.x.
$!
$! 2011-03-05 SMS.
$!
$! This procedure must reside in the OpenSSL installation directory.
$! It will fail if it is copied to a different location.
$!
$! P1 qualifier(s) for DEFINE. For example, "/SYSTEM" to get the
$! logical names defined in the system logical name table.
$!
$! P2 "64", to use executables which were built with 64-bit pointers.
$!
$! Good (default) and bad status values.
$!
$ status = %x00010001 ! RMS$_NORMAL, normal successful completion.
$ rms_e_fnf = %x00018292 ! RMS$_FNF, file not found.
$!
$! Prepare for problems.
$!
$ orig_dev_dir = f$environment( "DEFAULT")
$ on control_y then goto clean_up
$ on error then goto clean_up
$!
$! Determine hardware architecture.
$!
$ if (f$getsyi( "cpu") .lt. 128)
$ then
$ arch_name = "VAX"
$ else
$ arch_name = f$edit( f$getsyi( "arch_name"), "upcase")
$ if (arch_name .eqs. "") then arch_name = "UNK"
$ endif
$!
$ if (p2 .eqs. "64")
$ then
$ arch_name_exe = arch_name+ "_64"
$ else
$ arch_name_exe = arch_name
$ endif
$!
$! Derive the OpenSSL installation device:[directory] from the location
$! of this command procedure.
$!
$ proc = f$environment( "procedure")
$ proc_dev_dir = f$parse( "A.;", proc, , , "no_conceal") - "A.;"
$ proc_dev = f$parse( proc_dev_dir, , , "device", "syntax_only")
$ proc_dir = f$parse( proc_dev_dir, , , "directory", "syntax_only") - -
".][000000"- "[000000."- "]["- "["- "]"
$ proc_dev_dir = proc_dev+ "["+ proc_dir+ "]"
$ set default 'proc_dev_dir'
$ set default [-]
$ ossl_dev_dir = f$environment( "default")
$!
$! Check existence of expected directories (to see if this procedure has
$! been moved away from its proper place).
$!
$ if ((f$search( "certs.dir;1") .eqs. "") .or. -
(f$search( "include.dir;1") .eqs. "") .or. -
(f$search( "private.dir;1") .eqs. "") .or. -
(f$search( "vms.dir;1") .eqs. ""))
$ then
$ write sys$output -
" Can't find expected common OpenSSL directories in:"
$ write sys$output " ''ossl_dev_dir'"
$ status = rms_e_fnf
$ goto clean_up
$ endif
$!
$ if ((f$search( "''arch_name_exe'_exe.dir;1") .eqs. "") .or. -
(f$search( "''arch_name'_lib.dir;1") .eqs. ""))
$ then
$ write sys$output -
" Can't find expected architecture-specific OpenSSL directories in:"
$ write sys$output " ''ossl_dev_dir'"
$ status = rms_e_fnf
$ goto clean_up
$ endif
$!
$! All seems well (enough). Define the OpenSSL logical names.
$!
$ ossl_root = ossl_dev_dir- "]"+ ".]"
$ define /translation_attributes = concealed /nolog'p1 SSLROOT 'ossl_root'
$ define /nolog 'p1' SSLCERTS sslroot:[certs]
$ define /nolog 'p1' SSLINCLUDE sslroot:[include]
$ define /nolog 'p1' SSLPRIVATE sslroot:[private]
$ define /nolog 'p1' SSLEXE sslroot:['arch_name_exe'_exe]
$ define /nolog 'p1' SSLLIB sslroot:['arch_name'_lib]
$!
$! Defining OPENSSL lets a C program use "#include <openssl/{foo}.h>":
$ define /nolog 'p1' OPENSSL SSLINCLUDE:
$!
$! Run a site-specific procedure, if it exists.
$!
$ if f$search( "sslroot:[vms]openssl_systartup.com") .nes."" then -
@ sslroot:[vms]openssl_systartup.com
$!
$! Restore the original default dev:[dir] (if known).
$!
$ clean_up:
$!
$ if (f$type( orig_dev_dir) .nes. "")
$ then
$ set default 'orig_dev_dir'
$ endif
$!
$ EXIT 'status'
$!

20
VMS/openssl_undo.com Executable file
View File

@@ -0,0 +1,20 @@
$!
$! Deassign OpenSSL logical names.
$!
$ call deass "OPENSSL" "''p1'"
$ call deass "SSLCERTS" "''p1'"
$ call deass "SSLEXE" "''p1'"
$ call deass "SSLINCLUDE" "''p1'"
$ call deass "SSLLIB" "''p1'"
$ call deass "SSLPRIVATE" "''p1'"
$ call deass "SSLROOT" "''p1'"
$!
$ exit
$!
$deass: subroutine
$ if (f$trnlnm( p1) .nes. "")
$ then
$ deassign 'p2' 'p1'
$ endif
$ endsubroutine
$!

View File

@@ -8,31 +8,39 @@ $!
$! $!
$! Slightly modified by Richard Levitte <richard@levitte.org> $! Slightly modified by Richard Levitte <richard@levitte.org>
$! $!
$!
$! Always define OPENSSL. Others are optional (non-null P1).
$!
$ OPENSSL :== $SSLEXE:OPENSSL $ OPENSSL :== $SSLEXE:OPENSSL
$ VERIFY :== $SSLEXE:OPENSSL VERIFY $
$ ASN1PARSE:== $SSLEXE:OPENSSL ASN1PARS $ IF (P1 .NES. "")
$ REQ :== $SSLEXE:OPENSSL REQ $ THEN
$ DGST :== $SSLEXE:OPENSSL DGST $ VERIFY :== $SSLEXE:OPENSSL VERIFY
$ DH :== $SSLEXE:OPENSSL DH $ ASN1PARSE:== $SSLEXE:OPENSSL ASN1PARS
$ ENC :== $SSLEXE:OPENSSL ENC $! REQ could conflict with REQUEST.
$ GENDH :== $SSLEXE:OPENSSL GENDH $ OREQ :== $SSLEXE:OPENSSL REQ
$ ERRSTR :== $SSLEXE:OPENSSL ERRSTR $ DGST :== $SSLEXE:OPENSSL DGST
$ CA :== $SSLEXE:OPENSSL CA $ DH :== $SSLEXE:OPENSSL DH
$ CRL :== $SSLEXE:OPENSSL CRL $ ENC :== $SSLEXE:OPENSSL ENC
$ RSA :== $SSLEXE:OPENSSL RSA $ GENDH :== $SSLEXE:OPENSSL GENDH
$ DSA :== $SSLEXE:OPENSSL DSA $ ERRSTR :== $SSLEXE:OPENSSL ERRSTR
$ DSAPARAM :== $SSLEXE:OPENSSL DSAPARAM $ CA :== $SSLEXE:OPENSSL CA
$ X509 :== $SSLEXE:OPENSSL X509 $ CRL :== $SSLEXE:OPENSSL CRL
$ GENRSA :== $SSLEXE:OPENSSL GENRSA $ RSA :== $SSLEXE:OPENSSL RSA
$ GENDSA :== $SSLEXE:OPENSSL GENDSA $ DSA :== $SSLEXE:OPENSSL DSA
$ S_SERVER :== $SSLEXE:OPENSSL S_SERVER $ DSAPARAM :== $SSLEXE:OPENSSL DSAPARAM
$ S_CLIENT :== $SSLEXE:OPENSSL S_CLIENT $ X509 :== $SSLEXE:OPENSSL X509
$ SPEED :== $SSLEXE:OPENSSL SPEED $ GENRSA :== $SSLEXE:OPENSSL GENRSA
$ S_TIME :== $SSLEXE:OPENSSL S_TIME $ GENDSA :== $SSLEXE:OPENSSL GENDSA
$ VERSION :== $SSLEXE:OPENSSL VERSION $ S_SERVER :== $SSLEXE:OPENSSL S_SERVER
$ PKCS7 :== $SSLEXE:OPENSSL PKCS7 $ S_CLIENT :== $SSLEXE:OPENSSL S_CLIENT
$ CRL2PKCS7:== $SSLEXE:OPENSSL CRL2P7 $ SPEED :== $SSLEXE:OPENSSL SPEED
$ SESS_ID :== $SSLEXE:OPENSSL SESS_ID $ S_TIME :== $SSLEXE:OPENSSL S_TIME
$ CIPHERS :== $SSLEXE:OPENSSL CIPHERS $ VERSION :== $SSLEXE:OPENSSL VERSION
$ NSEQ :== $SSLEXE:OPENSSL NSEQ $ PKCS7 :== $SSLEXE:OPENSSL PKCS7
$ PKCS12 :== $SSLEXE:OPENSSL PKCS12 $ CRL2PKCS7:== $SSLEXE:OPENSSL CRL2P7
$ SESS_ID :== $SSLEXE:OPENSSL SESS_ID
$ CIPHERS :== $SSLEXE:OPENSSL CIPHERS
$ NSEQ :== $SSLEXE:OPENSSL NSEQ
$ PKCS12 :== $SSLEXE:OPENSSL PKCS12
$ ENDIF

View File

@@ -37,14 +37,25 @@ $ VERIFY = openssl + " verify"
$ X509 = openssl + " x509" $ X509 = openssl + " x509"
$ PKCS12 = openssl + " pkcs12" $ PKCS12 = openssl + " pkcs12"
$ echo = "write sys$Output" $ echo = "write sys$Output"
$ RET = 1
$! $!
$ s = F$PARSE(F$ENVIRONMENT("DEFAULT"),"[]") - "].;" $! 2010-12-20 SMS.
$ CATOP := 's'.demoCA $! Use a concealed logical name to reduce command line lengths, to
$ CAKEY := ]cakey.pem $! avoid DCL errors on VAX:
$ CACERT := ]cacert.pem $! %DCL-W-TKNOVF, command element is too long - shorten
$! (Path segments like "openssl-1_0_1-stable-SNAP-20101217" accumulate
$! quickly.)
$!
$ CATOP = F$PARSE( F$ENVIRONMENT( "DEFAULT"), "[]")- "].;"+ ".demoCA.]"
$ define /translation_attributes = concealed CATOP 'CATOP'
$!
$ on error then goto clean_up
$ on control_y then goto clean_up
$!
$ CAKEY = "CATOP:[private]cakey.pem"
$ CACERT = "CATOP:[000000]cacert.pem"
$ $
$ __INPUT := SYS$COMMAND $ __INPUT := SYS$COMMAND
$ RET = 1
$! $!
$ i = 1 $ i = 1
$opt_loop: $opt_loop:
@@ -55,7 +66,7 @@ $
$ IF (prog_opt .EQS. "?" .OR. prog_opt .EQS. "-h" .OR. prog_opt .EQS. "-help") $ IF (prog_opt .EQS. "?" .OR. prog_opt .EQS. "-h" .OR. prog_opt .EQS. "-help")
$ THEN $ THEN
$ echo "usage: CA -newcert|-newreq|-newca|-sign|-verify" $ echo "usage: CA -newcert|-newreq|-newca|-sign|-verify"
$ exit $ goto clean_up
$ ENDIF $ ENDIF
$! $!
$ IF (prog_opt .EQS. "-input") $ IF (prog_opt .EQS. "-input")
@@ -69,7 +80,7 @@ $!
$ IF (prog_opt .EQS. "-newcert") $ IF (prog_opt .EQS. "-newcert")
$ THEN $ THEN
$ ! Create a certificate. $ ! Create a certificate.
$ DEFINE/USER SYS$INPUT '__INPUT' $ DEFINE /USER_MODE SYS$INPUT '__INPUT'
$ REQ -new -x509 -keyout newreq.pem -out newreq.pem 'DAYS' $ REQ -new -x509 -keyout newreq.pem -out newreq.pem 'DAYS'
$ RET=$STATUS $ RET=$STATUS
$ echo "Certificate (and private key) is in newreq.pem" $ echo "Certificate (and private key) is in newreq.pem"
@@ -79,7 +90,7 @@ $!
$ IF (prog_opt .EQS. "-newreq") $ IF (prog_opt .EQS. "-newreq")
$ THEN $ THEN
$ ! Create a certificate request $ ! Create a certificate request
$ DEFINE/USER SYS$INPUT '__INPUT' $ DEFINE /USER_MODE SYS$INPUT '__INPUT'
$ REQ -new -keyout newreq.pem -out newreq.pem 'DAYS' $ REQ -new -keyout newreq.pem -out newreq.pem 'DAYS'
$ RET=$STATUS $ RET=$STATUS
$ echo "Request (and private key) is in newreq.pem" $ echo "Request (and private key) is in newreq.pem"
@@ -90,41 +101,40 @@ $ IF (prog_opt .EQS. "-newca")
$ THEN $ THEN
$ ! If explicitly asked for or it doesn't exist then setup the directory $ ! If explicitly asked for or it doesn't exist then setup the directory
$ ! structure that Eric likes to manage things. $ ! structure that Eric likes to manage things.
$ IF F$SEARCH(CATOP+"]serial.") .EQS. "" $ IF F$SEARCH( "CATOP:[000000]serial.") .EQS. ""
$ THEN $ THEN
$ CREATE /DIR /PROTECTION=OWNER:RWED 'CATOP'] $ CREATE /DIRECTORY /PROTECTION=OWNER:RWED CATOP:[000000]
$ CREATE /DIR /PROTECTION=OWNER:RWED 'CATOP'.certs] $ CREATE /DIRECTORY /PROTECTION=OWNER:RWED CATOP:[certs]
$ CREATE /DIR /PROTECTION=OWNER:RWED 'CATOP'.crl] $ CREATE /DIRECTORY /PROTECTION=OWNER:RWED CATOP:[crl]
$ CREATE /DIR /PROTECTION=OWNER:RWED 'CATOP'.newcerts] $ CREATE /DIRECTORY /PROTECTION=OWNER:RWED CATOP:[newcerts]
$ CREATE /DIR /PROTECTION=OWNER:RWED 'CATOP'.private] $ CREATE /DIRECTORY /PROTECTION=OWNER:RWED CATOP:[private]
$ $
$ OPEN /WRITE ser_file 'CATOP']serial. $ OPEN /WRITE ser_file CATOP:[000000]serial.
$ WRITE ser_file "01" $ WRITE ser_file "01"
$ CLOSE ser_file $ CLOSE ser_file
$ APPEND/NEW NL: 'CATOP']index.txt $ APPEND /NEW_VERSION NL: CATOP:[000000]index.txt
$ $
$ ! The following is to make sure access() doesn't get confused. It $ ! The following is to make sure access() doesn't get confused. It
$ ! really needs one file in the directory to give correct answers... $ ! really needs one file in the directory to give correct answers...
$ COPY NLA0: 'CATOP'.certs].; $ COPY NLA0: CATOP:[certs].;
$ COPY NLA0: 'CATOP'.crl].; $ COPY NLA0: CATOP:[crl].;
$ COPY NLA0: 'CATOP'.newcerts].; $ COPY NLA0: CATOP:[newcerts].;
$ COPY NLA0: 'CATOP'.private].; $ COPY NLA0: CATOP:[private].;
$ ENDIF $ ENDIF
$! $!
$ IF F$SEARCH(CATOP+".private"+CAKEY) .EQS. "" $ IF F$SEARCH( CAKEY) .EQS. ""
$ THEN $ THEN
$ READ '__INPUT' FILE - $ READ '__INPUT' FILE -
/PROMT="CA certificate filename (or enter to create)" /PROMPT="CA certificate filename (or enter to create): "
$ IF F$SEARCH(FILE) .NES. "" $ IF (FILE .NES. "") .AND. (F$SEARCH(FILE) .NES. "")
$ THEN $ THEN
$ COPY 'FILE' 'CATOP'.private'CAKEY' $ COPY 'FILE' 'CAKEY'
$ RET=$STATUS $ RET=$STATUS
$ ELSE $ ELSE
$ echo "Making CA certificate ..." $ echo "Making CA certificate ..."
$ DEFINE/USER SYS$INPUT '__INPUT' $ DEFINE /USER_MODE SYS$INPUT '__INPUT'
$ REQ -new -x509 -keyout 'CATOP'.private'CAKEY' - $ REQ -new -x509 -keyout 'CAKEY' -out 'CACERT' 'DAYS'
-out 'CATOP''CACERT' 'DAYS' $ RET=$STATUS
$ RET=$STATUS
$ ENDIF $ ENDIF
$ ENDIF $ ENDIF
$ GOTO opt_loop_continue $ GOTO opt_loop_continue
@@ -135,16 +145,16 @@ $ THEN
$ i = i + 1 $ i = i + 1
$ cname = P'i' $ cname = P'i'
$ IF cname .EQS. "" THEN cname = "My certificate" $ IF cname .EQS. "" THEN cname = "My certificate"
$ PKCS12 -in newcert.pem -inkey newreq.pem -certfile 'CATOP''CACERT - $ PKCS12 -in newcert.pem -inkey newreq.pem -certfile 'CACERT' -
-out newcert.p12 -export -name "''cname'" -out newcert.p12 -export -name "''cname'"
$ RET=$STATUS $ RET=$STATUS
$ exit RET $ goto clean_up
$ ENDIF $ ENDIF
$! $!
$ IF (prog_opt .EQS. "-xsign") $ IF (prog_opt .EQS. "-xsign")
$ THEN $ THEN
$! $!
$ DEFINE/USER SYS$INPUT '__INPUT' $ DEFINE /USER_MODE SYS$INPUT '__INPUT'
$ CA -policy policy_anything -infiles newreq.pem $ CA -policy policy_anything -infiles newreq.pem
$ RET=$STATUS $ RET=$STATUS
$ GOTO opt_loop_continue $ GOTO opt_loop_continue
@@ -153,7 +163,7 @@ $!
$ IF ((prog_opt .EQS. "-sign") .OR. (prog_opt .EQS. "-signreq")) $ IF ((prog_opt .EQS. "-sign") .OR. (prog_opt .EQS. "-signreq"))
$ THEN $ THEN
$! $!
$ DEFINE/USER SYS$INPUT '__INPUT' $ DEFINE /USER_MODE SYS$INPUT '__INPUT'
$ CA -policy policy_anything -out newcert.pem -infiles newreq.pem $ CA -policy policy_anything -out newcert.pem -infiles newreq.pem
$ RET=$STATUS $ RET=$STATUS
$ type newcert.pem $ type newcert.pem
@@ -165,9 +175,9 @@ $ IF (prog_opt .EQS. "-signcert")
$ THEN $ THEN
$! $!
$ echo "Cert passphrase will be requested twice - bug?" $ echo "Cert passphrase will be requested twice - bug?"
$ DEFINE/USER SYS$INPUT '__INPUT' $ DEFINE /USER_MODE SYS$INPUT '__INPUT'
$ X509 -x509toreq -in newreq.pem -signkey newreq.pem -out tmp.pem $ X509 -x509toreq -in newreq.pem -signkey newreq.pem -out tmp.pem
$ DEFINE/USER SYS$INPUT '__INPUT' $ DEFINE /USER_MODE SYS$INPUT '__INPUT'
$ CA -policy policy_anything -out newcert.pem -infiles tmp.pem $ CA -policy policy_anything -out newcert.pem -infiles tmp.pem
y y
y y
@@ -182,17 +192,17 @@ $!
$ i = i + 1 $ i = i + 1
$ IF (p'i' .EQS. "") $ IF (p'i' .EQS. "")
$ THEN $ THEN
$ DEFINE/USER SYS$INPUT '__INPUT' $ DEFINE /USER_MODE SYS$INPUT '__INPUT'
$ VERIFY "-CAfile" 'CATOP''CACERT' newcert.pem $ VERIFY "-CAfile" 'CACERT' newcert.pem
$ ELSE $ ELSE
$ j = i $ j = i
$ verify_opt_loop: $ verify_opt_loop:
$ IF j .GT. 8 THEN GOTO verify_opt_loop_end $ IF j .GT. 8 THEN GOTO verify_opt_loop_end
$ IF p'j' .NES. "" $ IF p'j' .NES. ""
$ THEN $ THEN
$ DEFINE/USER SYS$INPUT '__INPUT' $ DEFINE /USER_MODE SYS$INPUT '__INPUT'
$ __tmp = p'j' $ __tmp = p'j'
$ VERIFY "-CAfile" 'CATOP''CACERT' '__tmp' $ VERIFY "-CAfile" 'CACERT' '__tmp'
$ tmp=$STATUS $ tmp=$STATUS
$ IF tmp .NE. 0 THEN RET=tmp $ IF tmp .NE. 0 THEN RET=tmp
$ ENDIF $ ENDIF
@@ -208,8 +218,8 @@ $ IF (prog_opt .NES. "")
$ THEN $ THEN
$! $!
$ echo "Unknown argument ''prog_opt'" $ echo "Unknown argument ''prog_opt'"
$ $ RET = 3
$ EXIT 3 $ goto clean_up
$ ENDIF $ ENDIF
$ $
$opt_loop_continue: $opt_loop_continue:
@@ -217,4 +227,10 @@ $ i = i + 1
$ GOTO opt_loop $ GOTO opt_loop
$ $
$opt_loop_end: $opt_loop_end:
$!
$clean_up:
$!
$ if f$trnlnm( "CATOP", "LNM$PROCESS") .nes. "" then -
deassign /process CATOP
$!
$ EXIT 'RET' $ EXIT 'RET'

View File

@@ -5,10 +5,10 @@
# things easier between now and when Eric is convinced to fix it :-) # things easier between now and when Eric is convinced to fix it :-)
# #
# CA -newca ... will setup the right stuff # CA -newca ... will setup the right stuff
# CA -newreq ... will generate a certificate request # CA -newreq ... will generate a certificate request
# CA -sign ... will sign the generated request and output # CA -sign ... will sign the generated request and output
# #
# At the end of that grab newreq.pem and newcert.pem (one has the key # At the end of that grab newreq.pem and newcert.pem (one has the key
# and the other the certificate) and cat them together and that is what # and the other the certificate) and cat them together and that is what
# you want/need ... I'll make even this a little cleaner later. # you want/need ... I'll make even this a little cleaner later.
# #
@@ -16,8 +16,8 @@
# 12-Jan-96 tjh Added more things ... including CA -signcert which # 12-Jan-96 tjh Added more things ... including CA -signcert which
# converts a certificate to a request and then signs it. # converts a certificate to a request and then signs it.
# 10-Jan-96 eay Fixed a few more bugs and added the SSLEAY_CONFIG # 10-Jan-96 eay Fixed a few more bugs and added the SSLEAY_CONFIG
# environment variable so this can be driven from # environment variable so this can be driven from
# a script. # a script.
# 25-Jul-96 eay Cleaned up filenames some more. # 25-Jul-96 eay Cleaned up filenames some more.
# 11-Jun-96 eay Fixed a few filename missmatches. # 11-Jun-96 eay Fixed a few filename missmatches.
# 03-May-96 eay Modified to use 'ssleay cmd' instead of 'cmd'. # 03-May-96 eay Modified to use 'ssleay cmd' instead of 'cmd'.
@@ -29,52 +29,87 @@
# default openssl.cnf file has setup as per the following # default openssl.cnf file has setup as per the following
# demoCA ... where everything is stored # demoCA ... where everything is stored
cp_pem() {
infile=$1
outfile=$2
bound=$3
flag=0
exec <$infile;
while read line; do
if [ $flag -eq 1 ]; then
echo $line|grep "^-----END.*$bound" 2>/dev/null 1>/dev/null
if [ $? -eq 0 ] ; then
echo $line >>$outfile
break
else
echo $line >>$outfile
fi
fi
echo $line|grep "^-----BEGIN.*$bound" 2>/dev/null 1>/dev/null
if [ $? -eq 0 ]; then
echo $line >$outfile
flag=1
fi
done
}
usage() {
echo "usage: $0 -newcert|-newreq|-newreq-nodes|-newca|-sign|-verify" >&2
}
if [ -z "$OPENSSL" ]; then OPENSSL=openssl; fi if [ -z "$OPENSSL" ]; then OPENSSL=openssl; fi
DAYS="-days 365" # 1 year if [ -z "$DAYS" ] ; then DAYS="-days 365" ; fi # 1 year
CADAYS="-days 1095" # 3 years CADAYS="-days 1095" # 3 years
REQ="$OPENSSL req $SSLEAY_CONFIG" REQ="$OPENSSL req $SSLEAY_CONFIG"
CA="$OPENSSL ca $SSLEAY_CONFIG" CA="$OPENSSL ca $SSLEAY_CONFIG"
VERIFY="$OPENSSL verify" VERIFY="$OPENSSL verify"
X509="$OPENSSL x509" X509="$OPENSSL x509"
PKCS12="openssl pkcs12"
CATOP=./demoCA if [ -z "$CATOP" ] ; then CATOP=./demoCA ; fi
CAKEY=./cakey.pem CAKEY=./cakey.pem
CAREQ=./careq.pem CAREQ=./careq.pem
CACERT=./cacert.pem CACERT=./cacert.pem
for i RET=0
do
case $i in while [ "$1" != "" ] ; do
case $1 in
-\?|-h|-help) -\?|-h|-help)
echo "usage: CA -newcert|-newreq|-newca|-sign|-verify" >&2 usage
exit 0 exit 0
;; ;;
-newcert) -newcert)
# create a certificate # create a certificate
$REQ -new -x509 -keyout newkey.pem -out newcert.pem $DAYS $REQ -new -x509 -keyout newkey.pem -out newcert.pem $DAYS
RET=$? RET=$?
echo "Certificate is in newcert.pem, private key is in newkey.pem" echo "Certificate is in newcert.pem, private key is in newkey.pem"
;; ;;
-newreq) -newreq)
# create a certificate request # create a certificate request
$REQ -new -keyout newkey.pem -out newreq.pem $DAYS $REQ -new -keyout newkey.pem -out newreq.pem $DAYS
RET=$? RET=$?
echo "Request is in newreq.pem, private key is in newkey.pem" echo "Request is in newreq.pem, private key is in newkey.pem"
;; ;;
-newca) -newreq-nodes)
# create a certificate request
$REQ -new -nodes -keyout newreq.pem -out newreq.pem $DAYS
RET=$?
echo "Request (and private key) is in newreq.pem"
;;
-newca)
# if explicitly asked for or it doesn't exist then setup the directory # if explicitly asked for or it doesn't exist then setup the directory
# structure that Eric likes to manage things # structure that Eric likes to manage things
NEW="1" NEW="1"
if [ "$NEW" -o ! -f ${CATOP}/serial ]; then if [ "$NEW" -o ! -f ${CATOP}/serial ]; then
# create the directory hierarchy # create the directory hierarchy
mkdir ${CATOP} mkdir -p ${CATOP}
mkdir ${CATOP}/certs mkdir -p ${CATOP}/certs
mkdir ${CATOP}/crl mkdir -p ${CATOP}/crl
mkdir ${CATOP}/newcerts mkdir -p ${CATOP}/newcerts
mkdir ${CATOP}/private mkdir -p ${CATOP}/private
echo "00" > ${CATOP}/serial
touch ${CATOP}/index.txt touch ${CATOP}/index.txt
fi fi
if [ ! -f ${CATOP}/private/$CAKEY ]; then if [ ! -f ${CATOP}/private/$CAKEY ]; then
@@ -83,37 +118,60 @@ case $i in
# ask user for existing CA certificate # ask user for existing CA certificate
if [ "$FILE" ]; then if [ "$FILE" ]; then
cp $FILE ${CATOP}/private/$CAKEY cp_pem $FILE ${CATOP}/private/$CAKEY PRIVATE
cp_pem $FILE ${CATOP}/$CACERT CERTIFICATE
RET=$? RET=$?
if [ ! -f "${CATOP}/serial" ]; then
$X509 -in ${CATOP}/$CACERT -noout -next_serial \
-out ${CATOP}/serial
fi
else else
echo "Making CA certificate ..." echo "Making CA certificate ..."
$REQ -new -keyout ${CATOP}/private/$CAKEY \ $REQ -new -keyout ${CATOP}/private/$CAKEY \
-out ${CATOP}/$CAREQ -out ${CATOP}/$CAREQ
$CA -out ${CATOP}/$CACERT $CADAYS -batch \ $CA -create_serial -out ${CATOP}/$CACERT $CADAYS -batch \
-keyfile ${CATOP}/private/$CAKEY -selfsign \ -keyfile ${CATOP}/private/$CAKEY -selfsign \
-infiles ${CATOP}/$CAREQ -extensions v3_ca \
-infiles ${CATOP}/$CAREQ
RET=$? RET=$?
fi fi
fi fi
;; ;;
-xsign) -xsign)
$CA -policy policy_anything -infiles newreq.pem $CA -policy policy_anything -infiles newreq.pem
RET=$? RET=$?
;; ;;
-sign|-signreq) -pkcs12)
if [ -z "$2" ] ; then
CNAME="My Certificate"
else
CNAME="$2"
fi
$PKCS12 -in newcert.pem -inkey newreq.pem -certfile ${CATOP}/$CACERT \
-out newcert.p12 -export -name "$CNAME"
RET=$?
exit $RET
;;
-sign|-signreq)
$CA -policy policy_anything -out newcert.pem -infiles newreq.pem $CA -policy policy_anything -out newcert.pem -infiles newreq.pem
RET=$? RET=$?
cat newcert.pem cat newcert.pem
echo "Signed certificate is in newcert.pem" echo "Signed certificate is in newcert.pem"
;; ;;
-signcert) -signCA)
$CA -policy policy_anything -out newcert.pem -extensions v3_ca -infiles newreq.pem
RET=$?
echo "Signed CA certificate is in newcert.pem"
;;
-signcert)
echo "Cert passphrase will be requested twice - bug?" echo "Cert passphrase will be requested twice - bug?"
$X509 -x509toreq -in newreq.pem -signkey newreq.pem -out tmp.pem $X509 -x509toreq -in newreq.pem -signkey newreq.pem -out tmp.pem
$CA -policy policy_anything -out newcert.pem -infiles tmp.pem $CA -policy policy_anything -out newcert.pem -infiles tmp.pem
RET=$?
cat newcert.pem cat newcert.pem
echo "Signed certificate is in newcert.pem" echo "Signed certificate is in newcert.pem"
;; ;;
-verify) -verify)
shift shift
if [ -z "$1" ]; then if [ -z "$1" ]; then
$VERIFY -CAfile $CATOP/$CACERT newcert.pem $VERIFY -CAfile $CATOP/$CACERT newcert.pem
@@ -127,13 +185,14 @@ case $i in
fi fi
done done
fi fi
exit 0 exit $RET
;; ;;
*) *)
echo "Unknown arg $i"; echo "Unknown arg $i" >&2
usage
exit 1 exit 1
;; ;;
esac esac
shift
done done
exit $RET exit $RET

View File

@@ -789,14 +789,14 @@ s_cb.o: ../include/openssl/objects.h ../include/openssl/ocsp.h
s_cb.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h s_cb.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
s_cb.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h s_cb.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h
s_cb.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h s_cb.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h
s_cb.o: ../include/openssl/pqueue.h ../include/openssl/safestack.h s_cb.o: ../include/openssl/pqueue.h ../include/openssl/rand.h
s_cb.o: ../include/openssl/sha.h ../include/openssl/ssl.h s_cb.o: ../include/openssl/safestack.h ../include/openssl/sha.h
s_cb.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h s_cb.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h
s_cb.o: ../include/openssl/ssl3.h ../include/openssl/stack.h s_cb.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h
s_cb.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h s_cb.o: ../include/openssl/stack.h ../include/openssl/symhacks.h
s_cb.o: ../include/openssl/txt_db.h ../include/openssl/x509.h s_cb.o: ../include/openssl/tls1.h ../include/openssl/txt_db.h
s_cb.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h s_cb.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h
s_cb.o: s_apps.h s_cb.c s_cb.o: ../include/openssl/x509v3.h apps.h s_apps.h s_cb.c
s_client.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h s_client.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
s_client.o: ../include/openssl/bn.h ../include/openssl/buffer.h s_client.o: ../include/openssl/bn.h ../include/openssl/buffer.h
s_client.o: ../include/openssl/comp.h ../include/openssl/conf.h s_client.o: ../include/openssl/comp.h ../include/openssl/conf.h
@@ -843,26 +843,27 @@ s_server.o: ../include/openssl/tls1.h ../include/openssl/txt_db.h
s_server.o: ../include/openssl/ui.h ../include/openssl/x509.h s_server.o: ../include/openssl/ui.h ../include/openssl/x509.h
s_server.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h s_server.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h
s_server.o: s_apps.h s_server.c timeouts.h s_server.o: s_apps.h s_server.c timeouts.h
s_socket.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h s_socket.o: ../e_os.h ../e_os2.h ../include/openssl/asn1.h
s_socket.o: ../include/openssl/buffer.h ../include/openssl/comp.h s_socket.o: ../include/openssl/bio.h ../include/openssl/buffer.h
s_socket.o: ../include/openssl/conf.h ../include/openssl/crypto.h s_socket.o: ../include/openssl/comp.h ../include/openssl/conf.h
s_socket.o: ../include/openssl/dtls1.h ../include/openssl/e_os2.h s_socket.o: ../include/openssl/crypto.h ../include/openssl/dtls1.h
s_socket.o: ../include/openssl/ec.h ../include/openssl/ecdh.h s_socket.o: ../include/openssl/e_os2.h ../include/openssl/ec.h
s_socket.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h s_socket.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h
s_socket.o: ../include/openssl/evp.h ../include/openssl/hmac.h s_socket.o: ../include/openssl/engine.h ../include/openssl/evp.h
s_socket.o: ../include/openssl/kssl.h ../include/openssl/lhash.h s_socket.o: ../include/openssl/hmac.h ../include/openssl/kssl.h
s_socket.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h s_socket.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h
s_socket.o: ../include/openssl/ocsp.h ../include/openssl/opensslconf.h s_socket.o: ../include/openssl/objects.h ../include/openssl/ocsp.h
s_socket.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h s_socket.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
s_socket.o: ../include/openssl/pem.h ../include/openssl/pem2.h s_socket.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h
s_socket.o: ../include/openssl/pkcs7.h ../include/openssl/pqueue.h s_socket.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h
s_socket.o: ../include/openssl/safestack.h ../include/openssl/sha.h s_socket.o: ../include/openssl/pqueue.h ../include/openssl/safestack.h
s_socket.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h s_socket.o: ../include/openssl/sha.h ../include/openssl/ssl.h
s_socket.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h s_socket.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h
s_socket.o: ../include/openssl/stack.h ../include/openssl/symhacks.h s_socket.o: ../include/openssl/ssl3.h ../include/openssl/stack.h
s_socket.o: ../include/openssl/tls1.h ../include/openssl/txt_db.h s_socket.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h
s_socket.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h s_socket.o: ../include/openssl/txt_db.h ../include/openssl/x509.h
s_socket.o: ../include/openssl/x509v3.h apps.h s_apps.h s_socket.c s_socket.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h
s_socket.o: s_apps.h s_socket.c
s_time.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h s_time.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
s_time.o: ../include/openssl/buffer.h ../include/openssl/comp.h s_time.o: ../include/openssl/buffer.h ../include/openssl/comp.h
s_time.o: ../include/openssl/conf.h ../include/openssl/crypto.h s_time.o: ../include/openssl/conf.h ../include/openssl/crypto.h
@@ -932,8 +933,8 @@ speed.o: ../include/openssl/ec.h ../include/openssl/ecdh.h
speed.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h speed.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h
speed.o: ../include/openssl/err.h ../include/openssl/evp.h speed.o: ../include/openssl/err.h ../include/openssl/evp.h
speed.o: ../include/openssl/hmac.h ../include/openssl/idea.h speed.o: ../include/openssl/hmac.h ../include/openssl/idea.h
speed.o: ../include/openssl/lhash.h ../include/openssl/md2.h speed.o: ../include/openssl/lhash.h ../include/openssl/md4.h
speed.o: ../include/openssl/md4.h ../include/openssl/md5.h speed.o: ../include/openssl/md5.h ../include/openssl/mdc2.h
speed.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h speed.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h
speed.o: ../include/openssl/ocsp.h ../include/openssl/opensslconf.h speed.o: ../include/openssl/ocsp.h ../include/openssl/opensslconf.h
speed.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h speed.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h
@@ -1005,17 +1006,16 @@ version.o: ../include/openssl/des_old.h ../include/openssl/e_os2.h
version.o: ../include/openssl/ec.h ../include/openssl/ecdh.h version.o: ../include/openssl/ec.h ../include/openssl/ecdh.h
version.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h version.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h
version.o: ../include/openssl/evp.h ../include/openssl/idea.h version.o: ../include/openssl/evp.h ../include/openssl/idea.h
version.o: ../include/openssl/lhash.h ../include/openssl/md2.h version.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h
version.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h version.o: ../include/openssl/objects.h ../include/openssl/ocsp.h
version.o: ../include/openssl/ocsp.h ../include/openssl/opensslconf.h version.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
version.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h version.o: ../include/openssl/ossl_typ.h ../include/openssl/pkcs7.h
version.o: ../include/openssl/pkcs7.h ../include/openssl/rc4.h version.o: ../include/openssl/rc4.h ../include/openssl/safestack.h
version.o: ../include/openssl/safestack.h ../include/openssl/sha.h version.o: ../include/openssl/sha.h ../include/openssl/stack.h
version.o: ../include/openssl/stack.h ../include/openssl/symhacks.h version.o: ../include/openssl/symhacks.h ../include/openssl/txt_db.h
version.o: ../include/openssl/txt_db.h ../include/openssl/ui.h version.o: ../include/openssl/ui.h ../include/openssl/ui_compat.h
version.o: ../include/openssl/ui_compat.h ../include/openssl/x509.h version.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h
version.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h version.o: ../include/openssl/x509v3.h apps.h version.c
version.o: version.c
x509.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h x509.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
x509.o: ../include/openssl/bn.h ../include/openssl/buffer.h x509.o: ../include/openssl/bn.h ../include/openssl/buffer.h
x509.o: ../include/openssl/conf.h ../include/openssl/crypto.h x509.o: ../include/openssl/conf.h ../include/openssl/crypto.h

View File

@@ -109,14 +109,16 @@
* *
*/ */
#if !defined(_POSIX_C_SOURCE) && defined(OPENSSL_SYS_VMS)
#define _POSIX_C_SOURCE 2 /* On VMS, you need to define this to get #define _POSIX_C_SOURCE 2 /* On VMS, you need to define this to get
the declaration of fileno(). The value the declaration of fileno(). The value
2 is to make sure no function defined 2 is to make sure no function defined
in POSIX-2 is left undefined. */ in POSIX-2 is left undefined. */
#endif
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#ifndef OPENSSL_SYSNAME_WIN32 #if !defined(OPENSSL_SYSNAME_WIN32) && !defined(NETWARE_CLIB)
#include <strings.h> #include <strings.h>
#endif #endif
#include <sys/types.h> #include <sys/types.h>
@@ -255,17 +257,12 @@ int args_from_file(char *file, int *argc, char **argv[])
int str2fmt(char *s) int str2fmt(char *s)
{ {
if (s == NULL)
return FORMAT_UNDEF;
if ((*s == 'D') || (*s == 'd')) if ((*s == 'D') || (*s == 'd'))
return(FORMAT_ASN1); return(FORMAT_ASN1);
else if ((*s == 'T') || (*s == 't')) else if ((*s == 'T') || (*s == 't'))
return(FORMAT_TEXT); return(FORMAT_TEXT);
else if ((*s == 'P') || (*s == 'p'))
{
if (s[1] == 'V' || s[1] == 'v')
return FORMAT_PVK;
else
return(FORMAT_PEM);
}
else if ((*s == 'N') || (*s == 'n')) else if ((*s == 'N') || (*s == 'n'))
return(FORMAT_NETSCAPE); return(FORMAT_NETSCAPE);
else if ((*s == 'S') || (*s == 's')) else if ((*s == 'S') || (*s == 's'))
@@ -278,6 +275,13 @@ int str2fmt(char *s)
return(FORMAT_PKCS12); return(FORMAT_PKCS12);
else if ((*s == 'E') || (*s == 'e')) else if ((*s == 'E') || (*s == 'e'))
return(FORMAT_ENGINE); return(FORMAT_ENGINE);
else if ((*s == 'P') || (*s == 'p'))
{
if (s[1] == 'V' || s[1] == 'v')
return FORMAT_PVK;
else
return(FORMAT_PEM);
}
else else
return(FORMAT_UNDEF); return(FORMAT_UNDEF);
} }
@@ -375,18 +379,19 @@ void program_name(char *in, char *out, int size)
int chopup_args(ARGS *arg, char *buf, int *argc, char **argv[]) int chopup_args(ARGS *arg, char *buf, int *argc, char **argv[])
{ {
int num,len,i; int num,i;
char *p; char *p;
*argc=0; *argc=0;
*argv=NULL; *argv=NULL;
len=strlen(buf);
i=0; i=0;
if (arg->count == 0) if (arg->count == 0)
{ {
arg->count=20; arg->count=20;
arg->data=(char **)OPENSSL_malloc(sizeof(char *)*arg->count); arg->data=(char **)OPENSSL_malloc(sizeof(char *)*arg->count);
if (arg->data == NULL)
return 0;
} }
for (i=0; i<arg->count; i++) for (i=0; i<arg->count; i++)
arg->data[i]=NULL; arg->data[i]=NULL;
@@ -583,12 +588,12 @@ int password_callback(char *buf, int bufsiz, int verify,
if (ok >= 0) if (ok >= 0)
ok = UI_add_input_string(ui,prompt,ui_flags,buf, ok = UI_add_input_string(ui,prompt,ui_flags,buf,
PW_MIN_LENGTH,BUFSIZ-1); PW_MIN_LENGTH,bufsiz-1);
if (ok >= 0 && verify) if (ok >= 0 && verify)
{ {
buff = (char *)OPENSSL_malloc(bufsiz); buff = (char *)OPENSSL_malloc(bufsiz);
ok = UI_add_verify_string(ui,prompt,ui_flags,buff, ok = UI_add_verify_string(ui,prompt,ui_flags,buff,
PW_MIN_LENGTH,BUFSIZ-1, buf); PW_MIN_LENGTH,bufsiz-1, buf);
} }
if (ok >= 0) if (ok >= 0)
do do
@@ -795,7 +800,9 @@ X509 *load_cert(BIO *err, const char *file, int format,
if (file == NULL) if (file == NULL)
{ {
#ifdef _IONBF #ifdef _IONBF
# ifndef OPENSSL_NO_SETVBUF_IONBF
setvbuf(stdin, NULL, _IONBF, 0); setvbuf(stdin, NULL, _IONBF, 0);
# endif /* ndef OPENSSL_NO_SETVBUF_IONBF */
#endif #endif
BIO_set_fp(cert,stdin,BIO_NOCLOSE); BIO_set_fp(cert,stdin,BIO_NOCLOSE);
} }
@@ -873,10 +880,17 @@ EVP_PKEY *load_key(BIO *err, const char *file, int format, int maybe_stdin,
if (format == FORMAT_ENGINE) if (format == FORMAT_ENGINE)
{ {
if (!e) if (!e)
BIO_printf(bio_err,"no engine specified\n"); BIO_printf(err,"no engine specified\n");
else else
{
pkey = ENGINE_load_private_key(e, file, pkey = ENGINE_load_private_key(e, file,
ui_method, &cb_data); ui_method, &cb_data);
if (!pkey)
{
BIO_printf(err,"cannot load %s from engine\n",key_descrip);
ERR_print_errors(err);
}
}
goto end; goto end;
} }
#endif #endif
@@ -889,7 +903,9 @@ EVP_PKEY *load_key(BIO *err, const char *file, int format, int maybe_stdin,
if (file == NULL && maybe_stdin) if (file == NULL && maybe_stdin)
{ {
#ifdef _IONBF #ifdef _IONBF
# ifndef OPENSSL_NO_SETVBUF_IONBF
setvbuf(stdin, NULL, _IONBF, 0); setvbuf(stdin, NULL, _IONBF, 0);
# endif /* ndef OPENSSL_NO_SETVBUF_IONBF */
#endif #endif
BIO_set_fp(key,stdin,BIO_NOCLOSE); BIO_set_fp(key,stdin,BIO_NOCLOSE);
} }
@@ -921,11 +937,13 @@ EVP_PKEY *load_key(BIO *err, const char *file, int format, int maybe_stdin,
&pkey, NULL, NULL)) &pkey, NULL, NULL))
goto end; goto end;
} }
#if !defined(OPENSSL_NO_RSA) && !defined(OPENSSL_NO_DSA) && !defined (OPENSSL_NO_RC4)
else if (format == FORMAT_MSBLOB) else if (format == FORMAT_MSBLOB)
pkey = b2i_PrivateKey_bio(key); pkey = b2i_PrivateKey_bio(key);
else if (format == FORMAT_PVK) else if (format == FORMAT_PVK)
pkey = b2i_PVK_bio(key, (pem_password_cb *)password_callback, pkey = b2i_PVK_bio(key, (pem_password_cb *)password_callback,
&cb_data); &cb_data);
#endif
else else
{ {
BIO_printf(err,"bad input format specified for key file\n"); BIO_printf(err,"bad input format specified for key file\n");
@@ -933,8 +951,11 @@ EVP_PKEY *load_key(BIO *err, const char *file, int format, int maybe_stdin,
} }
end: end:
if (key != NULL) BIO_free(key); if (key != NULL) BIO_free(key);
if (pkey == NULL) if (pkey == NULL)
{
BIO_printf(err,"unable to load %s\n", key_descrip); BIO_printf(err,"unable to load %s\n", key_descrip);
ERR_print_errors(err);
}
return(pkey); return(pkey);
} }
@@ -973,7 +994,9 @@ EVP_PKEY *load_pubkey(BIO *err, const char *file, int format, int maybe_stdin,
if (file == NULL && maybe_stdin) if (file == NULL && maybe_stdin)
{ {
#ifdef _IONBF #ifdef _IONBF
# ifndef OPENSSL_NO_SETVBUF_IONBF
setvbuf(stdin, NULL, _IONBF, 0); setvbuf(stdin, NULL, _IONBF, 0);
# endif /* ndef OPENSSL_NO_SETVBUF_IONBF */
#endif #endif
BIO_set_fp(key,stdin,BIO_NOCLOSE); BIO_set_fp(key,stdin,BIO_NOCLOSE);
} }
@@ -989,6 +1012,7 @@ EVP_PKEY *load_pubkey(BIO *err, const char *file, int format, int maybe_stdin,
{ {
pkey=d2i_PUBKEY_bio(key, NULL); pkey=d2i_PUBKEY_bio(key, NULL);
} }
#ifndef OPENSSL_NO_RSA
else if (format == FORMAT_ASN1RSA) else if (format == FORMAT_ASN1RSA)
{ {
RSA *rsa; RSA *rsa;
@@ -1018,7 +1042,7 @@ EVP_PKEY *load_pubkey(BIO *err, const char *file, int format, int maybe_stdin,
else else
pkey = NULL; pkey = NULL;
} }
#endif
else if (format == FORMAT_PEM) else if (format == FORMAT_PEM)
{ {
pkey=PEM_read_bio_PUBKEY(key,NULL, pkey=PEM_read_bio_PUBKEY(key,NULL,
@@ -1028,8 +1052,10 @@ EVP_PKEY *load_pubkey(BIO *err, const char *file, int format, int maybe_stdin,
else if (format == FORMAT_NETSCAPE || format == FORMAT_IISSGC) else if (format == FORMAT_NETSCAPE || format == FORMAT_IISSGC)
pkey = load_netscape_key(err, key, file, key_descrip, format); pkey = load_netscape_key(err, key, file, key_descrip, format);
#endif #endif
#if !defined(OPENSSL_NO_RSA) && !defined(OPENSSL_NO_DSA)
else if (format == FORMAT_MSBLOB) else if (format == FORMAT_MSBLOB)
pkey = b2i_PublicKey_bio(key); pkey = b2i_PublicKey_bio(key);
#endif
else else
{ {
BIO_printf(err,"bad input format specified for key file\n"); BIO_printf(err,"bad input format specified for key file\n");
@@ -1088,76 +1114,122 @@ error:
} }
#endif /* ndef OPENSSL_NO_RC4 */ #endif /* ndef OPENSSL_NO_RC4 */
STACK_OF(X509) *load_certs(BIO *err, const char *file, int format, static int load_certs_crls(BIO *err, const char *file, int format,
const char *pass, ENGINE *e, const char *cert_descrip) const char *pass, ENGINE *e, const char *desc,
STACK_OF(X509) **pcerts, STACK_OF(X509_CRL) **pcrls)
{ {
BIO *certs;
int i; int i;
STACK_OF(X509) *othercerts = NULL; BIO *bio;
STACK_OF(X509_INFO) *allcerts = NULL; STACK_OF(X509_INFO) *xis = NULL;
X509_INFO *xi; X509_INFO *xi;
PW_CB_DATA cb_data; PW_CB_DATA cb_data;
int rv = 0;
cb_data.password = pass; cb_data.password = pass;
cb_data.prompt_info = file; cb_data.prompt_info = file;
if((certs = BIO_new(BIO_s_file())) == NULL) if (format != FORMAT_PEM)
{ {
ERR_print_errors(err); BIO_printf(err,"bad input format specified for %s\n", desc);
goto end; return 0;
} }
if (file == NULL) if (file == NULL)
BIO_set_fp(certs,stdin,BIO_NOCLOSE); bio = BIO_new_fp(stdin,BIO_NOCLOSE);
else else
bio = BIO_new_file(file, "r");
if (bio == NULL)
{ {
if (BIO_read_filename(certs,file) <= 0) BIO_printf(err, "Error opening %s %s\n",
{ desc, file ? file : "stdin");
BIO_printf(err, "Error opening %s %s\n", ERR_print_errors(err);
cert_descrip, file); return 0;
ERR_print_errors(err); }
xis = PEM_X509_INFO_read_bio(bio, NULL,
(pem_password_cb *)password_callback, &cb_data);
BIO_free(bio);
if (pcerts)
{
*pcerts = sk_X509_new_null();
if (!*pcerts)
goto end; goto end;
}
if (pcrls)
{
*pcrls = sk_X509_CRL_new_null();
if (!*pcrls)
goto end;
}
for(i = 0; i < sk_X509_INFO_num(xis); i++)
{
xi = sk_X509_INFO_value (xis, i);
if (xi->x509 && pcerts)
{
if (!sk_X509_push(*pcerts, xi->x509))
goto end;
xi->x509 = NULL;
}
if (xi->crl && pcrls)
{
if (!sk_X509_CRL_push(*pcrls, xi->crl))
goto end;
xi->crl = NULL;
} }
} }
if (format == FORMAT_PEM) if (pcerts && sk_X509_num(*pcerts) > 0)
rv = 1;
if (pcrls && sk_X509_CRL_num(*pcrls) > 0)
rv = 1;
end:
if (xis)
sk_X509_INFO_pop_free(xis, X509_INFO_free);
if (rv == 0)
{ {
othercerts = sk_X509_new_null(); if (pcerts)
if(!othercerts)
{ {
sk_X509_free(othercerts); sk_X509_pop_free(*pcerts, X509_free);
othercerts = NULL; *pcerts = NULL;
goto end;
} }
allcerts = PEM_X509_INFO_read_bio(certs, NULL, if (pcrls)
(pem_password_cb *)password_callback, &cb_data);
for(i = 0; i < sk_X509_INFO_num(allcerts); i++)
{ {
xi = sk_X509_INFO_value (allcerts, i); sk_X509_CRL_pop_free(*pcrls, X509_CRL_free);
if (xi->x509) *pcrls = NULL;
{
sk_X509_push(othercerts, xi->x509);
xi->x509 = NULL;
}
} }
goto end; BIO_printf(err,"unable to load %s\n",
} pcerts ? "certificates" : "CRLs");
else {
BIO_printf(err,"bad input format specified for %s\n",
cert_descrip);
goto end;
}
end:
if (othercerts == NULL)
{
BIO_printf(err,"unable to load certificates\n");
ERR_print_errors(err); ERR_print_errors(err);
} }
if (allcerts) sk_X509_INFO_pop_free(allcerts, X509_INFO_free); return rv;
if (certs != NULL) BIO_free(certs);
return(othercerts);
} }
STACK_OF(X509) *load_certs(BIO *err, const char *file, int format,
const char *pass, ENGINE *e, const char *desc)
{
STACK_OF(X509) *certs;
if (!load_certs_crls(err, file, format, pass, e, desc, &certs, NULL))
return NULL;
return certs;
}
STACK_OF(X509_CRL) *load_crls(BIO *err, const char *file, int format,
const char *pass, ENGINE *e, const char *desc)
{
STACK_OF(X509_CRL) *crls;
if (!load_certs_crls(err, file, format, pass, e, desc, NULL, &crls))
return NULL;
return crls;
}
#define X509V3_EXT_UNKNOWN_MASK (0xfL << 16) #define X509V3_EXT_UNKNOWN_MASK (0xfL << 16)
/* Return error for unknown extensions */ /* Return error for unknown extensions */
@@ -1472,6 +1544,8 @@ char *make_config_name()
len=strlen(t)+strlen(OPENSSL_CONF)+2; len=strlen(t)+strlen(OPENSSL_CONF)+2;
p=OPENSSL_malloc(len); p=OPENSSL_malloc(len);
if (p == NULL)
return NULL;
BUF_strlcpy(p,t,len); BUF_strlcpy(p,t,len);
#ifndef OPENSSL_SYS_VMS #ifndef OPENSSL_SYS_VMS
BUF_strlcat(p,"/",len); BUF_strlcat(p,"/",len);
@@ -1481,7 +1555,7 @@ char *make_config_name()
return p; return p;
} }
static unsigned long index_serial_hash(const CSTRING *a) static unsigned long index_serial_hash(const OPENSSL_CSTRING *a)
{ {
const char *n; const char *n;
@@ -1490,7 +1564,7 @@ static unsigned long index_serial_hash(const CSTRING *a)
return(lh_strhash(n)); return(lh_strhash(n));
} }
static int index_serial_cmp(const CSTRING *a, const CSTRING *b) static int index_serial_cmp(const OPENSSL_CSTRING *a, const OPENSSL_CSTRING *b)
{ {
const char *aa,*bb; const char *aa,*bb;
@@ -1502,16 +1576,16 @@ static int index_serial_cmp(const CSTRING *a, const CSTRING *b)
static int index_name_qual(char **a) static int index_name_qual(char **a)
{ return(a[0][0] == 'V'); } { return(a[0][0] == 'V'); }
static unsigned long index_name_hash(const CSTRING *a) static unsigned long index_name_hash(const OPENSSL_CSTRING *a)
{ return(lh_strhash(a[DB_name])); } { return(lh_strhash(a[DB_name])); }
int index_name_cmp(const CSTRING *a, const CSTRING *b) int index_name_cmp(const OPENSSL_CSTRING *a, const OPENSSL_CSTRING *b)
{ return(strcmp(a[DB_name], b[DB_name])); } { return(strcmp(a[DB_name], b[DB_name])); }
static IMPLEMENT_LHASH_HASH_FN(index_serial, CSTRING) static IMPLEMENT_LHASH_HASH_FN(index_serial, OPENSSL_CSTRING)
static IMPLEMENT_LHASH_COMP_FN(index_serial, CSTRING) static IMPLEMENT_LHASH_COMP_FN(index_serial, OPENSSL_CSTRING)
static IMPLEMENT_LHASH_HASH_FN(index_name, CSTRING) static IMPLEMENT_LHASH_HASH_FN(index_name, OPENSSL_CSTRING)
static IMPLEMENT_LHASH_COMP_FN(index_name, CSTRING) static IMPLEMENT_LHASH_COMP_FN(index_name, OPENSSL_CSTRING)
#undef BSIZE #undef BSIZE
#define BSIZE 256 #define BSIZE 256
@@ -2062,7 +2136,7 @@ X509_NAME *parse_name(char *subject, long chtype, int multirdn)
X509_NAME *n = NULL; X509_NAME *n = NULL;
int nid; int nid;
if (!buf || !ne_types || !ne_values) if (!buf || !ne_types || !ne_values || !mval)
{ {
BIO_printf(bio_err, "malloc error\n"); BIO_printf(bio_err, "malloc error\n");
goto error; goto error;
@@ -2166,6 +2240,7 @@ X509_NAME *parse_name(char *subject, long chtype, int multirdn)
OPENSSL_free(ne_values); OPENSSL_free(ne_values);
OPENSSL_free(ne_types); OPENSSL_free(ne_types);
OPENSSL_free(buf); OPENSSL_free(buf);
OPENSSL_free(mval);
return n; return n;
error: error:
@@ -2174,6 +2249,8 @@ error:
OPENSSL_free(ne_values); OPENSSL_free(ne_values);
if (ne_types) if (ne_types)
OPENSSL_free(ne_types); OPENSSL_free(ne_types);
if (mval)
OPENSSL_free(mval);
if (buf) if (buf)
OPENSSL_free(buf); OPENSSL_free(buf);
return NULL; return NULL;
@@ -2185,7 +2262,7 @@ int args_verify(char ***pargs, int *pargc,
ASN1_OBJECT *otmp = NULL; ASN1_OBJECT *otmp = NULL;
unsigned long flags = 0; unsigned long flags = 0;
int i; int i;
int purpose = 0; int purpose = 0, depth = -1;
char **oldargs = *pargs; char **oldargs = *pargs;
char *arg = **pargs, *argn = (*pargs)[1]; char *arg = **pargs, *argn = (*pargs)[1];
if (!strcmp(arg, "-policy")) if (!strcmp(arg, "-policy"))
@@ -2225,6 +2302,21 @@ int args_verify(char ***pargs, int *pargc,
} }
(*pargs)++; (*pargs)++;
} }
else if (strcmp(arg,"-verify_depth") == 0)
{
if (!argn)
*badarg = 1;
else
{
depth = atoi(argn);
if(depth < 0)
{
BIO_printf(err, "invalid depth\n");
*badarg = 1;
}
}
(*pargs)++;
}
else if (!strcmp(arg, "-ignore_critical")) else if (!strcmp(arg, "-ignore_critical"))
flags |= X509_V_FLAG_IGNORE_CRITICAL; flags |= X509_V_FLAG_IGNORE_CRITICAL;
else if (!strcmp(arg, "-issuer_checks")) else if (!strcmp(arg, "-issuer_checks"))
@@ -2249,6 +2341,8 @@ int args_verify(char ***pargs, int *pargc,
flags |= X509_V_FLAG_USE_DELTAS; flags |= X509_V_FLAG_USE_DELTAS;
else if (!strcmp(arg, "-policy_print")) else if (!strcmp(arg, "-policy_print"))
flags |= X509_V_FLAG_NOTIFY_POLICY; flags |= X509_V_FLAG_NOTIFY_POLICY;
else if (!strcmp(arg, "-check_ss_sig"))
flags |= X509_V_FLAG_CHECK_SS_SIGNATURE;
else else
return 0; return 0;
@@ -2274,6 +2368,9 @@ int args_verify(char ***pargs, int *pargc,
if (purpose) if (purpose)
X509_VERIFY_PARAM_set_purpose(*pm, purpose); X509_VERIFY_PARAM_set_purpose(*pm, purpose);
if (depth >= 0)
X509_VERIFY_PARAM_set_depth(*pm, depth);
end: end:
(*pargs)++; (*pargs)++;
@@ -2679,7 +2776,7 @@ double app_tminterval(int stop,int usertime)
if (proc==NULL) if (proc==NULL)
{ {
if (GetVersion() < 0x80000000) if (check_winnt())
proc = OpenProcess(PROCESS_QUERY_INFORMATION,FALSE, proc = OpenProcess(PROCESS_QUERY_INFORMATION,FALSE,
GetCurrentProcessId()); GetCurrentProcessId());
if (proc==NULL) proc = (HANDLE)-1; if (proc==NULL) proc = (HANDLE)-1;

View File

@@ -168,6 +168,12 @@ extern BIO *bio_err;
#define do_pipe_sig() #define do_pipe_sig()
#endif #endif
#ifdef OPENSSL_NO_COMP
#define zlib_cleanup()
#else
#define zlib_cleanup() COMP_zlib_cleanup()
#endif
#if defined(MONOLITH) && !defined(OPENSSL_C) #if defined(MONOLITH) && !defined(OPENSSL_C)
# define apps_startup() \ # define apps_startup() \
do_pipe_sig() do_pipe_sig()
@@ -182,7 +188,7 @@ extern BIO *bio_err;
do { CONF_modules_unload(1); destroy_ui_method(); \ do { CONF_modules_unload(1); destroy_ui_method(); \
OBJ_cleanup(); EVP_cleanup(); ENGINE_cleanup(); \ OBJ_cleanup(); EVP_cleanup(); ENGINE_cleanup(); \
CRYPTO_cleanup_all_ex_data(); ERR_remove_thread_state(NULL); \ CRYPTO_cleanup_all_ex_data(); ERR_remove_thread_state(NULL); \
ERR_free_strings(); COMP_zlib_cleanup();} while(0) ERR_free_strings(); zlib_cleanup();} while(0)
# else # else
# define apps_startup() \ # define apps_startup() \
do { do_pipe_sig(); CRYPTO_malloc_init(); \ do { do_pipe_sig(); CRYPTO_malloc_init(); \
@@ -192,7 +198,7 @@ extern BIO *bio_err;
do { CONF_modules_unload(1); destroy_ui_method(); \ do { CONF_modules_unload(1); destroy_ui_method(); \
OBJ_cleanup(); EVP_cleanup(); \ OBJ_cleanup(); EVP_cleanup(); \
CRYPTO_cleanup_all_ex_data(); ERR_remove_thread_state(NULL); \ CRYPTO_cleanup_all_ex_data(); ERR_remove_thread_state(NULL); \
ERR_free_strings(); } while(0) ERR_free_strings(); zlib_cleanup(); } while(0)
# endif # endif
#endif #endif
@@ -245,6 +251,8 @@ EVP_PKEY *load_pubkey(BIO *err, const char *file, int format, int maybe_stdin,
const char *pass, ENGINE *e, const char *key_descrip); const char *pass, ENGINE *e, const char *key_descrip);
STACK_OF(X509) *load_certs(BIO *err, const char *file, int format, STACK_OF(X509) *load_certs(BIO *err, const char *file, int format,
const char *pass, ENGINE *e, const char *cert_descrip); const char *pass, ENGINE *e, const char *cert_descrip);
STACK_OF(X509_CRL) *load_crls(BIO *err, const char *file, int format,
const char *pass, ENGINE *e, const char *cert_descrip);
X509_STORE *setup_verify(BIO *bp, char *CAfile, char *CApath); X509_STORE *setup_verify(BIO *bp, char *CAfile, char *CApath);
#ifndef OPENSSL_NO_ENGINE #ifndef OPENSSL_NO_ENGINE
ENGINE *setup_engine(BIO *err, const char *engine, int debug); ENGINE *setup_engine(BIO *err, const char *engine, int debug);
@@ -253,6 +261,7 @@ ENGINE *setup_engine(BIO *err, const char *engine, int debug);
#ifndef OPENSSL_NO_OCSP #ifndef OPENSSL_NO_OCSP
OCSP_RESPONSE *process_responder(BIO *err, OCSP_REQUEST *req, OCSP_RESPONSE *process_responder(BIO *err, OCSP_REQUEST *req,
char *host, char *path, char *port, int use_ssl, char *host, char *path, char *port, int use_ssl,
STACK_OF(CONF_VALUE) *headers,
int req_timeout); int req_timeout);
#endif #endif
@@ -295,9 +304,9 @@ int save_index(const char *dbfile, const char *suffix, CA_DB *db);
int rotate_index(const char *dbfile, const char *new_suffix, const char *old_suffix); int rotate_index(const char *dbfile, const char *new_suffix, const char *old_suffix);
void free_index(CA_DB *db); void free_index(CA_DB *db);
#define index_name_cmp_noconst(a, b) \ #define index_name_cmp_noconst(a, b) \
index_name_cmp((const CSTRING *)CHECKED_PTR_OF(STRING, a), \ index_name_cmp((const OPENSSL_CSTRING *)CHECKED_PTR_OF(OPENSSL_STRING, a), \
(const CSTRING *)CHECKED_PTR_OF(STRING, b)) (const OPENSSL_CSTRING *)CHECKED_PTR_OF(OPENSSL_STRING, b))
int index_name_cmp(const CSTRING *a, const CSTRING *b); int index_name_cmp(const OPENSSL_CSTRING *a, const OPENSSL_CSTRING *b);
int parse_yesno(const char *str, int def); int parse_yesno(const char *str, int def);
X509_NAME *parse_name(char *str, long chtype, int multirdn); X509_NAME *parse_name(char *str, long chtype, int multirdn);

View File

@@ -96,7 +96,7 @@ int MAIN(int argc, char **argv)
unsigned char *tmpbuf; unsigned char *tmpbuf;
const unsigned char *ctmpbuf; const unsigned char *ctmpbuf;
BUF_MEM *buf=NULL; BUF_MEM *buf=NULL;
STACK_OF(STRING) *osk=NULL; STACK_OF(OPENSSL_STRING) *osk=NULL;
ASN1_TYPE *at=NULL; ASN1_TYPE *at=NULL;
informat=FORMAT_PEM; informat=FORMAT_PEM;
@@ -113,7 +113,7 @@ int MAIN(int argc, char **argv)
prog=argv[0]; prog=argv[0];
argc--; argc--;
argv++; argv++;
if ((osk=sk_STRING_new_null()) == NULL) if ((osk=sk_OPENSSL_STRING_new_null()) == NULL)
{ {
BIO_printf(bio_err,"Memory allocation failure\n"); BIO_printf(bio_err,"Memory allocation failure\n");
goto end; goto end;
@@ -169,7 +169,7 @@ int MAIN(int argc, char **argv)
else if (strcmp(*argv,"-strparse") == 0) else if (strcmp(*argv,"-strparse") == 0)
{ {
if (--argc < 1) goto bad; if (--argc < 1) goto bad;
sk_STRING_push(osk,*(++argv)); sk_OPENSSL_STRING_push(osk,*(++argv));
} }
else if (strcmp(*argv,"-genstr") == 0) else if (strcmp(*argv,"-genstr") == 0)
{ {
@@ -302,18 +302,18 @@ bad:
/* If any structs to parse go through in sequence */ /* If any structs to parse go through in sequence */
if (sk_STRING_num(osk)) if (sk_OPENSSL_STRING_num(osk))
{ {
tmpbuf=(unsigned char *)str; tmpbuf=(unsigned char *)str;
tmplen=num; tmplen=num;
for (i=0; i<sk_STRING_num(osk); i++) for (i=0; i<sk_OPENSSL_STRING_num(osk); i++)
{ {
ASN1_TYPE *atmp; ASN1_TYPE *atmp;
int typ; int typ;
j=atoi(sk_STRING_value(osk,i)); j=atoi(sk_OPENSSL_STRING_value(osk,i));
if (j == 0) if (j == 0)
{ {
BIO_printf(bio_err,"'%s' is an invalid number\n",sk_STRING_value(osk,i)); BIO_printf(bio_err,"'%s' is an invalid number\n",sk_OPENSSL_STRING_value(osk,i));
continue; continue;
} }
tmpbuf+=j; tmpbuf+=j;
@@ -378,7 +378,7 @@ end:
ERR_print_errors(bio_err); ERR_print_errors(bio_err);
if (buf != NULL) BUF_MEM_free(buf); if (buf != NULL) BUF_MEM_free(buf);
if (at != NULL) ASN1_TYPE_free(at); if (at != NULL) ASN1_TYPE_free(at);
if (osk != NULL) sk_STRING_free(osk); if (osk != NULL) sk_OPENSSL_STRING_free(osk);
OBJ_cleanup(); OBJ_cleanup();
apps_shutdown(); apps_shutdown();
OPENSSL_EXIT(ret); OPENSSL_EXIT(ret);
@@ -408,6 +408,7 @@ static int do_generate(BIO *bio, char *genstr, char *genconf, BUF_MEM *buf)
atyp = ASN1_generate_nconf(genstr, cnf); atyp = ASN1_generate_nconf(genstr, cnf);
NCONF_free(cnf); NCONF_free(cnf);
cnf = NULL;
if (!atyp) if (!atyp)
return -1; return -1;

View File

@@ -215,7 +215,6 @@ static int certify_spkac(X509 **xret, char *infile,EVP_PKEY *pkey,X509 *x509,
char *startdate, char *enddate, long days, char *ext_sect, char *startdate, char *enddate, long days, char *ext_sect,
CONF *conf, int verbose, unsigned long certopt, CONF *conf, int verbose, unsigned long certopt,
unsigned long nameopt, int default_op, int ext_copy); 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 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, static int do_body(X509 **xret, EVP_PKEY *pkey, X509 *x509, const EVP_MD *dgst,
STACK_OF(CONF_VALUE) *policy, CA_DB *db, BIGNUM *serial,char *subj,unsigned long chtype, int multirdn, STACK_OF(CONF_VALUE) *policy, CA_DB *db, BIGNUM *serial,char *subj,unsigned long chtype, int multirdn,
@@ -883,9 +882,9 @@ bad:
if (db == NULL) goto err; if (db == NULL) goto err;
/* Lets check some fields */ /* Lets check some fields */
for (i=0; i<sk_PSTRING_num(db->db->data); i++) for (i=0; i<sk_OPENSSL_PSTRING_num(db->db->data); i++)
{ {
pp=sk_PSTRING_value(db->db->data,i); pp=sk_OPENSSL_PSTRING_value(db->db->data,i);
if ((pp[DB_type][0] != DB_TYPE_REV) && if ((pp[DB_type][0] != DB_TYPE_REV) &&
(pp[DB_rev_date][0] != '\0')) (pp[DB_rev_date][0] != '\0'))
{ {
@@ -938,7 +937,7 @@ bad:
#endif #endif
TXT_DB_write(out,db->db); TXT_DB_write(out,db->db);
BIO_printf(bio_err,"%d entries loaded from the database\n", BIO_printf(bio_err,"%d entries loaded from the database\n",
sk_PSTRING_num(db->db->data)); sk_OPENSSL_PSTRING_num(db->db->data));
BIO_printf(bio_err,"generating index\n"); BIO_printf(bio_err,"generating index\n");
} }
@@ -1263,7 +1262,12 @@ bad:
BIO_printf(bio_err,"\n%d out of %d certificate requests certified, commit? [y/n]",total_done,total); BIO_printf(bio_err,"\n%d out of %d certificate requests certified, commit? [y/n]",total_done,total);
(void)BIO_flush(bio_err); (void)BIO_flush(bio_err);
buf[0][0]='\0'; buf[0][0]='\0';
fgets(buf[0],10,stdin); if (!fgets(buf[0],10,stdin))
{
BIO_printf(bio_err,"CERTIFICATION CANCELED: I/O error\n");
ret=0;
goto err;
}
if ((buf[0][0] != 'y') && (buf[0][0] != 'Y')) if ((buf[0][0] != 'y') && (buf[0][0] != 'Y'))
{ {
BIO_printf(bio_err,"CERTIFICATION CANCELED\n"); BIO_printf(bio_err,"CERTIFICATION CANCELED\n");
@@ -1403,14 +1407,19 @@ bad:
if (!tmptm) goto err; if (!tmptm) goto err;
X509_gmtime_adj(tmptm,0); X509_gmtime_adj(tmptm,0);
X509_CRL_set_lastUpdate(crl, tmptm); X509_CRL_set_lastUpdate(crl, tmptm);
X509_time_adj_ex(tmptm, crldays, crlhours*60*60 + crlsec, NULL); if (!X509_time_adj_ex(tmptm, crldays, crlhours*60*60 + crlsec,
NULL))
{
BIO_puts(bio_err, "error setting CRL nextUpdate\n");
goto err;
}
X509_CRL_set_nextUpdate(crl, tmptm); X509_CRL_set_nextUpdate(crl, tmptm);
ASN1_TIME_free(tmptm); ASN1_TIME_free(tmptm);
for (i=0; i<sk_PSTRING_num(db->db->data); i++) for (i=0; i<sk_OPENSSL_PSTRING_num(db->db->data); i++)
{ {
pp=sk_PSTRING_value(db->db->data,i); pp=sk_OPENSSL_PSTRING_value(db->db->data,i);
if (pp[DB_type][0] == DB_TYPE_REV) if (pp[DB_type][0] == DB_TYPE_REV)
{ {
if ((r=X509_REVOKED_new()) == NULL) goto err; if ((r=X509_REVOKED_new()) == NULL) goto err;
@@ -1590,12 +1599,14 @@ static int certify(X509 **xret, char *infile, EVP_PKEY *pkey, X509 *x509,
{ {
ok=0; ok=0;
BIO_printf(bio_err,"Signature verification problems....\n"); BIO_printf(bio_err,"Signature verification problems....\n");
ERR_print_errors(bio_err);
goto err; goto err;
} }
if (i == 0) if (i == 0)
{ {
ok=0; ok=0;
BIO_printf(bio_err,"Signature did not match the certificate request\n"); BIO_printf(bio_err,"Signature did not match the certificate request\n");
ERR_print_errors(bio_err);
goto err; goto err;
} }
else else
@@ -1685,9 +1696,9 @@ static int do_body(X509 **xret, EVP_PKEY *pkey, X509 *x509, const EVP_MD *dgst,
int ok= -1,i,j,last,nid; int ok= -1,i,j,last,nid;
const char *p; const char *p;
CONF_VALUE *cv; CONF_VALUE *cv;
STRING row[DB_NUMBER]; OPENSSL_STRING row[DB_NUMBER];
STRING *irow=NULL; OPENSSL_STRING *irow=NULL;
STRING *rrow=NULL; OPENSSL_STRING *rrow=NULL;
char buf[25]; char buf[25];
tmptm=ASN1_UTCTIME_new(); tmptm=ASN1_UTCTIME_new();
@@ -1929,7 +1940,7 @@ again2:
if (db->attributes.unique_subject) if (db->attributes.unique_subject)
{ {
STRING *crow=row; OPENSSL_STRING *crow=row;
rrow=TXT_DB_get_by_index(db->db,DB_name,crow); rrow=TXT_DB_get_by_index(db->db,DB_name,crow);
if (rrow != NULL) if (rrow != NULL)
@@ -2117,7 +2128,12 @@ again2:
BIO_printf(bio_err,"Sign the certificate? [y/n]:"); BIO_printf(bio_err,"Sign the certificate? [y/n]:");
(void)BIO_flush(bio_err); (void)BIO_flush(bio_err);
buf[0]='\0'; buf[0]='\0';
fgets(buf,sizeof(buf)-1,stdin); if (!fgets(buf,sizeof(buf)-1,stdin))
{
BIO_printf(bio_err,"CERTIFICATE WILL NOT BE CERTIFIED: I/O error\n");
ok=0;
goto err;
}
if (!((buf[0] == 'y') || (buf[0] == 'Y'))) if (!((buf[0] == 'y') || (buf[0] == 'Y')))
{ {
BIO_printf(bio_err,"CERTIFICATE WILL NOT BE CERTIFIED\n"); BIO_printf(bio_err,"CERTIFICATE WILL NOT BE CERTIFIED\n");
@@ -2319,25 +2335,9 @@ static int certify_spkac(X509 **xret, char *infile, EVP_PKEY *pkey, X509 *x509,
continue; continue;
} }
/* if (!X509_NAME_add_entry_by_NID(n, nid, chtype,
if ((nid == NID_pkcs9_emailAddress) && (email_dn == 0)) (unsigned char *)buf, -1, -1, 0))
continue;
*/
j=ASN1_PRINTABLE_type((unsigned char *)buf,-1);
if (fix_data(nid, &j) == 0)
{
BIO_printf(bio_err,
"invalid characters in string %s\n",buf);
goto err; goto err;
}
if ((ne=X509_NAME_ENTRY_create_by_NID(&ne,nid,j,
(unsigned char *)buf,
strlen(buf))) == NULL)
goto err;
if (!X509_NAME_add_entry(n,ne,-1, 0)) goto err;
} }
if (spki == NULL) if (spki == NULL)
{ {
@@ -2380,21 +2380,6 @@ err:
return(ok); return(ok);
} }
static int fix_data(int nid, int *type)
{
if (nid == NID_pkcs9_emailAddress)
*type=V_ASN1_IA5STRING;
if ((nid == NID_commonName) && (*type == V_ASN1_IA5STRING))
*type=V_ASN1_T61STRING;
if ((nid == NID_pkcs9_challengePassword) && (*type == V_ASN1_IA5STRING))
*type=V_ASN1_T61STRING;
if ((nid == NID_pkcs9_unstructuredName) && (*type == V_ASN1_T61STRING))
return(0);
if (nid == NID_pkcs9_unstructuredName)
*type=V_ASN1_IA5STRING;
return(1);
}
static int check_time_format(const char *str) static int check_time_format(const char *str)
{ {
return ASN1_TIME_set_string(NULL, str); return ASN1_TIME_set_string(NULL, str);
@@ -2553,7 +2538,7 @@ static int get_certificate_status(const char *serial, CA_DB *db)
/* Make it Upper Case */ /* Make it Upper Case */
for (i=0; row[DB_serial][i] != '\0'; i++) for (i=0; row[DB_serial][i] != '\0'; i++)
row[DB_serial][i] = toupper(row[DB_serial][i]); row[DB_serial][i] = toupper((unsigned char)row[DB_serial][i]);
ok=1; ok=1;
@@ -2632,9 +2617,9 @@ static int do_updatedb (CA_DB *db)
else else
a_y2k = 0; a_y2k = 0;
for (i = 0; i < sk_PSTRING_num(db->db->data); i++) for (i = 0; i < sk_OPENSSL_PSTRING_num(db->db->data); i++)
{ {
rrow = sk_PSTRING_value(db->db->data, i); rrow = sk_OPENSSL_PSTRING_value(db->db->data, i);
if (rrow[DB_type][0] == 'V') if (rrow[DB_type][0] == 'V')
{ {
@@ -2769,6 +2754,9 @@ char *make_revocation_str(int rev_type, char *rev_arg)
revtm = X509_gmtime_adj(NULL, 0); revtm = X509_gmtime_adj(NULL, 0);
if (!revtm)
return NULL;
i = revtm->length + 1; i = revtm->length + 1;
if (reason) i += strlen(reason) + 1; if (reason) i += strlen(reason) + 1;

View File

@@ -96,13 +96,7 @@ int MAIN(int argc, char **argv)
char buf[512]; char buf[512];
BIO *STDout=NULL; BIO *STDout=NULL;
#if !defined(OPENSSL_NO_SSL2) && !defined(OPENSSL_NO_SSL3)
meth=SSLv23_server_method(); meth=SSLv23_server_method();
#elif !defined(OPENSSL_NO_SSL3)
meth=SSLv3_server_method();
#elif !defined(OPENSSL_NO_SSL2)
meth=SSLv2_server_method();
#endif
apps_startup(); apps_startup();

View File

@@ -71,9 +71,9 @@
static int save_certs(char *signerfile, STACK_OF(X509) *signers); static int save_certs(char *signerfile, STACK_OF(X509) *signers);
static int cms_cb(int ok, X509_STORE_CTX *ctx); static int cms_cb(int ok, X509_STORE_CTX *ctx);
static void receipt_request_print(BIO *out, CMS_ContentInfo *cms); static void receipt_request_print(BIO *out, CMS_ContentInfo *cms);
static CMS_ReceiptRequest *make_receipt_request(STACK_OF(STRING) *rr_to, static CMS_ReceiptRequest *make_receipt_request(STACK_OF(OPENSSL_STRING) *rr_to,
int rr_allorfirst, int rr_allorfirst,
STACK_OF(STRING) *rr_from); STACK_OF(OPENSSL_STRING) *rr_from);
#define SMIME_OP 0x10 #define SMIME_OP 0x10
#define SMIME_IP 0x20 #define SMIME_IP 0x20
@@ -108,7 +108,7 @@ int MAIN(int argc, char **argv)
const char *inmode = "r", *outmode = "w"; const char *inmode = "r", *outmode = "w";
char *infile = NULL, *outfile = NULL, *rctfile = NULL; char *infile = NULL, *outfile = NULL, *rctfile = NULL;
char *signerfile = NULL, *recipfile = NULL; char *signerfile = NULL, *recipfile = NULL;
STACK_OF(STRING) *sksigners = NULL, *skkeys = NULL; STACK_OF(OPENSSL_STRING) *sksigners = NULL, *skkeys = NULL;
char *certfile = NULL, *keyfile = NULL, *contfile=NULL; char *certfile = NULL, *keyfile = NULL, *contfile=NULL;
char *certsoutfile = NULL; char *certsoutfile = NULL;
const EVP_CIPHER *cipher = NULL; const EVP_CIPHER *cipher = NULL;
@@ -122,7 +122,7 @@ int MAIN(int argc, char **argv)
int flags = CMS_DETACHED, noout = 0, print = 0; int flags = CMS_DETACHED, noout = 0, print = 0;
int verify_retcode = 0; int verify_retcode = 0;
int rr_print = 0, rr_allorfirst = -1; int rr_print = 0, rr_allorfirst = -1;
STACK_OF(STRING) *rr_to = NULL, *rr_from = NULL; STACK_OF(OPENSSL_STRING) *rr_to = NULL, *rr_from = NULL;
CMS_ReceiptRequest *rr = NULL; CMS_ReceiptRequest *rr = NULL;
char *to = NULL, *from = NULL, *subject = NULL; char *to = NULL, *from = NULL, *subject = NULL;
char *CAfile = NULL, *CApath = NULL; char *CAfile = NULL, *CApath = NULL;
@@ -232,6 +232,8 @@ int MAIN(int argc, char **argv)
else if (!strcmp(*args,"-camellia256")) else if (!strcmp(*args,"-camellia256"))
cipher = EVP_camellia_256_cbc(); cipher = EVP_camellia_256_cbc();
#endif #endif
else if (!strcmp (*args, "-debug_decrypt"))
flags |= CMS_DEBUG_DECRYPT;
else if (!strcmp (*args, "-text")) else if (!strcmp (*args, "-text"))
flags |= CMS_TEXT; flags |= CMS_TEXT;
else if (!strcmp (*args, "-nointern")) else if (!strcmp (*args, "-nointern"))
@@ -281,8 +283,8 @@ int MAIN(int argc, char **argv)
goto argerr; goto argerr;
args++; args++;
if (!rr_from) if (!rr_from)
rr_from = sk_STRING_new_null(); rr_from = sk_OPENSSL_STRING_new_null();
sk_STRING_push(rr_from, *args); sk_OPENSSL_STRING_push(rr_from, *args);
} }
else if (!strcmp(*args,"-receipt_request_to")) else if (!strcmp(*args,"-receipt_request_to"))
{ {
@@ -290,8 +292,8 @@ int MAIN(int argc, char **argv)
goto argerr; goto argerr;
args++; args++;
if (!rr_to) if (!rr_to)
rr_to = sk_STRING_new_null(); rr_to = sk_OPENSSL_STRING_new_null();
sk_STRING_push(rr_to, *args); sk_OPENSSL_STRING_push(rr_to, *args);
} }
else if (!strcmp (*args, "-print")) else if (!strcmp (*args, "-print"))
{ {
@@ -387,13 +389,13 @@ int MAIN(int argc, char **argv)
if (signerfile) if (signerfile)
{ {
if (!sksigners) if (!sksigners)
sksigners = sk_STRING_new_null(); sksigners = sk_OPENSSL_STRING_new_null();
sk_STRING_push(sksigners, signerfile); sk_OPENSSL_STRING_push(sksigners, signerfile);
if (!keyfile) if (!keyfile)
keyfile = signerfile; keyfile = signerfile;
if (!skkeys) if (!skkeys)
skkeys = sk_STRING_new_null(); skkeys = sk_OPENSSL_STRING_new_null();
sk_STRING_push(skkeys, keyfile); sk_OPENSSL_STRING_push(skkeys, keyfile);
keyfile = NULL; keyfile = NULL;
} }
signerfile = *++args; signerfile = *++args;
@@ -435,12 +437,12 @@ int MAIN(int argc, char **argv)
goto argerr; goto argerr;
} }
if (!sksigners) if (!sksigners)
sksigners = sk_STRING_new_null(); sksigners = sk_OPENSSL_STRING_new_null();
sk_STRING_push(sksigners, signerfile); sk_OPENSSL_STRING_push(sksigners, signerfile);
signerfile = NULL; signerfile = NULL;
if (!skkeys) if (!skkeys)
skkeys = sk_STRING_new_null(); skkeys = sk_OPENSSL_STRING_new_null();
sk_STRING_push(skkeys, keyfile); sk_OPENSSL_STRING_push(skkeys, keyfile);
} }
keyfile = *++args; keyfile = *++args;
} }
@@ -539,13 +541,13 @@ int MAIN(int argc, char **argv)
if (signerfile) if (signerfile)
{ {
if (!sksigners) if (!sksigners)
sksigners = sk_STRING_new_null(); sksigners = sk_OPENSSL_STRING_new_null();
sk_STRING_push(sksigners, signerfile); sk_OPENSSL_STRING_push(sksigners, signerfile);
if (!skkeys) if (!skkeys)
skkeys = sk_STRING_new_null(); skkeys = sk_OPENSSL_STRING_new_null();
if (!keyfile) if (!keyfile)
keyfile = signerfile; keyfile = signerfile;
sk_STRING_push(skkeys, keyfile); sk_OPENSSL_STRING_push(skkeys, keyfile);
} }
if (!sksigners) if (!sksigners)
{ {
@@ -618,7 +620,7 @@ int MAIN(int argc, char **argv)
BIO_printf (bio_err, "-certsout file certificate output file\n"); BIO_printf (bio_err, "-certsout file certificate output file\n");
BIO_printf (bio_err, "-signer file signer certificate file\n"); BIO_printf (bio_err, "-signer file signer certificate file\n");
BIO_printf (bio_err, "-recip file recipient certificate file for decryption\n"); BIO_printf (bio_err, "-recip file recipient certificate file for decryption\n");
BIO_printf (bio_err, "-skeyid use subject key identifier\n"); BIO_printf (bio_err, "-keyid use subject key identifier\n");
BIO_printf (bio_err, "-in file input file\n"); BIO_printf (bio_err, "-in file input file\n");
BIO_printf (bio_err, "-inform arg input format SMIME (default), PEM or DER\n"); BIO_printf (bio_err, "-inform arg input format SMIME (default), PEM or DER\n");
BIO_printf (bio_err, "-inkey file input private key (if not signer or recipient)\n"); BIO_printf (bio_err, "-inkey file input private key (if not signer or recipient)\n");
@@ -704,7 +706,7 @@ int MAIN(int argc, char **argv)
if (secret_key && !secret_keyid) if (secret_key && !secret_keyid)
{ {
BIO_printf(bio_err, "No sectre key id\n"); BIO_printf(bio_err, "No secret key id\n");
goto end; goto end;
} }
@@ -880,7 +882,7 @@ int MAIN(int argc, char **argv)
{ {
if (!(store = setup_verify(bio_err, CAfile, CApath))) if (!(store = setup_verify(bio_err, CAfile, CApath)))
goto end; goto end;
X509_STORE_set_verify_cb_func(store, cms_cb); X509_STORE_set_verify_cb(store, cms_cb);
if (vpm) if (vpm)
X509_STORE_set1_param(store, vpm); X509_STORE_set1_param(store, vpm);
} }
@@ -980,11 +982,11 @@ int MAIN(int argc, char **argv)
} }
else else
flags |= CMS_REUSE_DIGEST; flags |= CMS_REUSE_DIGEST;
for (i = 0; i < sk_STRING_num(sksigners); i++) for (i = 0; i < sk_OPENSSL_STRING_num(sksigners); i++)
{ {
CMS_SignerInfo *si; CMS_SignerInfo *si;
signerfile = sk_STRING_value(sksigners, i); signerfile = sk_OPENSSL_STRING_value(sksigners, i);
keyfile = sk_STRING_value(skkeys, i); keyfile = sk_OPENSSL_STRING_value(skkeys, i);
signer = load_cert(bio_err, signerfile,FORMAT_PEM, NULL, signer = load_cert(bio_err, signerfile,FORMAT_PEM, NULL,
e, "signer certificate"); e, "signer certificate");
if (!signer) if (!signer)
@@ -1020,6 +1022,8 @@ int MAIN(int argc, char **argv)
ret = 4; ret = 4;
if (operation == SMIME_DECRYPT) if (operation == SMIME_DECRYPT)
{ {
if (flags & CMS_DEBUG_DECRYPT)
CMS_decrypt(cms, NULL, NULL, NULL, NULL, flags);
if (secret_key) if (secret_key)
{ {
@@ -1160,9 +1164,9 @@ end:
if (vpm) if (vpm)
X509_VERIFY_PARAM_free(vpm); X509_VERIFY_PARAM_free(vpm);
if (sksigners) if (sksigners)
sk_STRING_free(sksigners); sk_OPENSSL_STRING_free(sksigners);
if (skkeys) if (skkeys)
sk_STRING_free(skkeys); sk_OPENSSL_STRING_free(skkeys);
if (secret_key) if (secret_key)
OPENSSL_free(secret_key); OPENSSL_free(secret_key);
if (secret_keyid) if (secret_keyid)
@@ -1172,9 +1176,9 @@ end:
if (rr) if (rr)
CMS_ReceiptRequest_free(rr); CMS_ReceiptRequest_free(rr);
if (rr_to) if (rr_to)
sk_STRING_free(rr_to); sk_OPENSSL_STRING_free(rr_to);
if (rr_from) if (rr_from)
sk_STRING_free(rr_from); sk_OPENSSL_STRING_free(rr_from);
X509_STORE_free(store); X509_STORE_free(store);
X509_free(cert); X509_free(cert);
X509_free(recip); X509_free(recip);
@@ -1296,7 +1300,7 @@ static void receipt_request_print(BIO *out, CMS_ContentInfo *cms)
} }
} }
static STACK_OF(GENERAL_NAMES) *make_names_stack(STACK_OF(STRING) *ns) static STACK_OF(GENERAL_NAMES) *make_names_stack(STACK_OF(OPENSSL_STRING) *ns)
{ {
int i; int i;
STACK_OF(GENERAL_NAMES) *ret; STACK_OF(GENERAL_NAMES) *ret;
@@ -1305,9 +1309,9 @@ static STACK_OF(GENERAL_NAMES) *make_names_stack(STACK_OF(STRING) *ns)
ret = sk_GENERAL_NAMES_new_null(); ret = sk_GENERAL_NAMES_new_null();
if (!ret) if (!ret)
goto err; goto err;
for (i = 0; i < sk_STRING_num(ns); i++) for (i = 0; i < sk_OPENSSL_STRING_num(ns); i++)
{ {
char *str = sk_STRING_value(ns, i); char *str = sk_OPENSSL_STRING_value(ns, i);
gen = a2i_GENERAL_NAME(NULL, NULL, NULL, GEN_EMAIL, str, 0); gen = a2i_GENERAL_NAME(NULL, NULL, NULL, GEN_EMAIL, str, 0);
if (!gen) if (!gen)
goto err; goto err;
@@ -1335,9 +1339,9 @@ static STACK_OF(GENERAL_NAMES) *make_names_stack(STACK_OF(STRING) *ns)
} }
static CMS_ReceiptRequest *make_receipt_request(STACK_OF(STRING) *rr_to, static CMS_ReceiptRequest *make_receipt_request(STACK_OF(OPENSSL_STRING) *rr_to,
int rr_allorfirst, int rr_allorfirst,
STACK_OF(STRING) *rr_from) STACK_OF(OPENSSL_STRING) *rr_from)
{ {
STACK_OF(GENERAL_NAMES) *rct_to, *rct_from; STACK_OF(GENERAL_NAMES) *rct_to, *rct_from;
CMS_ReceiptRequest *rr; CMS_ReceiptRequest *rr;

View File

@@ -81,6 +81,9 @@ static const char *crl_usage[]={
" -in arg - input file - default stdin\n", " -in arg - input file - default stdin\n",
" -out arg - output file - default stdout\n", " -out arg - output file - default stdout\n",
" -hash - print hash value\n", " -hash - print hash value\n",
#ifndef OPENSSL_NO_MD5
" -hash_old - print old-style (MD5) hash value\n",
#endif
" -fingerprint - print the crl fingerprint\n", " -fingerprint - print the crl fingerprint\n",
" -issuer - print issuer DN\n", " -issuer - print issuer DN\n",
" -lastupdate - lastUpdate field\n", " -lastupdate - lastUpdate field\n",
@@ -108,6 +111,9 @@ int MAIN(int argc, char **argv)
int informat,outformat; int informat,outformat;
char *infile=NULL,*outfile=NULL; char *infile=NULL,*outfile=NULL;
int hash=0,issuer=0,lastupdate=0,nextupdate=0,noout=0,text=0; int hash=0,issuer=0,lastupdate=0,nextupdate=0,noout=0,text=0;
#ifndef OPENSSL_NO_MD5
int hash_old=0;
#endif
int fingerprint = 0, crlnumber = 0; int fingerprint = 0, crlnumber = 0;
const char **pp; const char **pp;
X509_STORE *store = NULL; X509_STORE *store = NULL;
@@ -192,6 +198,10 @@ int MAIN(int argc, char **argv)
text = 1; text = 1;
else if (strcmp(*argv,"-hash") == 0) else if (strcmp(*argv,"-hash") == 0)
hash= ++num; hash= ++num;
#ifndef OPENSSL_NO_MD5
else if (strcmp(*argv,"-hash_old") == 0)
hash_old= ++num;
#endif
else if (strcmp(*argv,"-nameopt") == 0) else if (strcmp(*argv,"-nameopt") == 0)
{ {
if (--argc < 1) goto bad; if (--argc < 1) goto bad;
@@ -304,6 +314,14 @@ bad:
BIO_printf(bio_out,"%08lx\n", BIO_printf(bio_out,"%08lx\n",
X509_NAME_hash(X509_CRL_get_issuer(x))); X509_NAME_hash(X509_CRL_get_issuer(x)));
} }
#ifndef OPENSSL_NO_MD5
if (hash_old == i)
{
BIO_printf(bio_out,"%08lx\n",
X509_NAME_hash_old(
X509_CRL_get_issuer(x)));
}
#endif
if (lastupdate == i) if (lastupdate == i)
{ {
BIO_printf(bio_out,"lastUpdate="); BIO_printf(bio_out,"lastUpdate=");

View File

@@ -92,7 +92,7 @@ int MAIN(int argc, char **argv)
PKCS7 *p7 = NULL; PKCS7 *p7 = NULL;
PKCS7_SIGNED *p7s = NULL; PKCS7_SIGNED *p7s = NULL;
X509_CRL *crl=NULL; X509_CRL *crl=NULL;
STACK_OF(STRING) *certflst=NULL; STACK_OF(OPENSSL_STRING) *certflst=NULL;
STACK_OF(X509_CRL) *crl_stack=NULL; STACK_OF(X509_CRL) *crl_stack=NULL;
STACK_OF(X509) *cert_stack=NULL; STACK_OF(X509) *cert_stack=NULL;
int ret=1,nocrl=0; int ret=1,nocrl=0;
@@ -140,8 +140,14 @@ int MAIN(int argc, char **argv)
else if (strcmp(*argv,"-certfile") == 0) else if (strcmp(*argv,"-certfile") == 0)
{ {
if (--argc < 1) goto bad; if (--argc < 1) goto bad;
if(!certflst) certflst = sk_STRING_new_null(); if(!certflst) certflst = sk_OPENSSL_STRING_new_null();
sk_STRING_push(certflst,*(++argv)); if (!certflst)
goto end;
if (!sk_OPENSSL_STRING_push(certflst,*(++argv)))
{
sk_OPENSSL_STRING_free(certflst);
goto end;
}
} }
else else
{ {
@@ -226,8 +232,8 @@ bad:
if ((cert_stack=sk_X509_new_null()) == NULL) goto end; if ((cert_stack=sk_X509_new_null()) == NULL) goto end;
p7s->cert=cert_stack; p7s->cert=cert_stack;
if(certflst) for(i = 0; i < sk_STRING_num(certflst); i++) { if(certflst) for(i = 0; i < sk_OPENSSL_STRING_num(certflst); i++) {
certfile = sk_STRING_value(certflst, i); certfile = sk_OPENSSL_STRING_value(certflst, i);
if (add_certs_from_file(cert_stack,certfile) < 0) if (add_certs_from_file(cert_stack,certfile) < 0)
{ {
BIO_printf(bio_err, "error loading certificates\n"); BIO_printf(bio_err, "error loading certificates\n");
@@ -236,7 +242,7 @@ bad:
} }
} }
sk_STRING_free(certflst); sk_OPENSSL_STRING_free(certflst);
if (outfile == NULL) if (outfile == NULL)
{ {

View File

@@ -79,6 +79,26 @@ int do_fp(BIO *out, unsigned char *buf, BIO *bp, int sep, int binout,
const char *sig_name, const char *md_name, const char *sig_name, const char *md_name,
const char *file,BIO *bmd); const char *file,BIO *bmd);
static void list_md_fn(const EVP_MD *m,
const char *from, const char *to, void *arg)
{
const char *mname;
/* Skip aliases */
if (!m)
return;
mname = OBJ_nid2ln(EVP_MD_type(m));
/* Skip shortnames */
if (strcmp(from, mname))
return;
/* Skip clones */
if (EVP_MD_flags(m) & EVP_MD_FLAG_PKEY_DIGEST)
return;
if (strchr(mname, ' '))
mname= EVP_MD_name(m);
BIO_printf(arg, "-%-14s to use the %s message digest algorithm\n",
mname, mname);
}
int MAIN(int, char **); int MAIN(int, char **);
int MAIN(int argc, char **argv) int MAIN(int argc, char **argv)
@@ -107,7 +127,7 @@ int MAIN(int argc, char **argv)
#endif #endif
char *hmac_key=NULL; char *hmac_key=NULL;
char *mac_name=NULL; char *mac_name=NULL;
STACK_OF(STRING) *sigopts = NULL, *macopts = NULL; STACK_OF(OPENSSL_STRING) *sigopts = NULL, *macopts = NULL;
apps_startup(); apps_startup();
@@ -135,6 +155,8 @@ int MAIN(int argc, char **argv)
if ((*argv)[0] != '-') break; if ((*argv)[0] != '-') break;
if (strcmp(*argv,"-c") == 0) if (strcmp(*argv,"-c") == 0)
separator=1; separator=1;
else if (strcmp(*argv,"-r") == 0)
separator=2;
else if (strcmp(*argv,"-rand") == 0) else if (strcmp(*argv,"-rand") == 0)
{ {
if (--argc < 1) break; if (--argc < 1) break;
@@ -210,8 +232,8 @@ int MAIN(int argc, char **argv)
if (--argc < 1) if (--argc < 1)
break; break;
if (!sigopts) if (!sigopts)
sigopts = sk_STRING_new_null(); sigopts = sk_OPENSSL_STRING_new_null();
if (!sigopts || !sk_STRING_push(sigopts, *(++argv))) if (!sigopts || !sk_OPENSSL_STRING_push(sigopts, *(++argv)))
break; break;
} }
else if (strcmp(*argv,"-macopt") == 0) else if (strcmp(*argv,"-macopt") == 0)
@@ -219,8 +241,8 @@ int MAIN(int argc, char **argv)
if (--argc < 1) if (--argc < 1)
break; break;
if (!macopts) if (!macopts)
macopts = sk_STRING_new_null(); macopts = sk_OPENSSL_STRING_new_null();
if (!macopts || !sk_STRING_push(macopts, *(++argv))) if (!macopts || !sk_OPENSSL_STRING_push(macopts, *(++argv)))
break; break;
} }
else if ((m=EVP_get_digestbyname(&((*argv)[1]))) != NULL) else if ((m=EVP_get_digestbyname(&((*argv)[1]))) != NULL)
@@ -242,6 +264,7 @@ int MAIN(int argc, char **argv)
BIO_printf(bio_err,"unknown option '%s'\n",*argv); BIO_printf(bio_err,"unknown option '%s'\n",*argv);
BIO_printf(bio_err,"options are\n"); BIO_printf(bio_err,"options are\n");
BIO_printf(bio_err,"-c to output the digest with separating colons\n"); BIO_printf(bio_err,"-c to output the digest with separating colons\n");
BIO_printf(bio_err,"-r to output the digest in coreutils format\n");
BIO_printf(bio_err,"-d to output debug info\n"); BIO_printf(bio_err,"-d to output debug info\n");
BIO_printf(bio_err,"-hex output as hex dump\n"); BIO_printf(bio_err,"-hex output as hex dump\n");
BIO_printf(bio_err,"-binary output in binary form\n"); BIO_printf(bio_err,"-binary output in binary form\n");
@@ -249,43 +272,17 @@ int MAIN(int argc, char **argv)
BIO_printf(bio_err,"-verify file verify a signature using public key in file\n"); BIO_printf(bio_err,"-verify file verify a signature using public key in file\n");
BIO_printf(bio_err,"-prverify file verify a signature using private key in file\n"); BIO_printf(bio_err,"-prverify file verify a signature using private key in file\n");
BIO_printf(bio_err,"-keyform arg key file format (PEM or ENGINE)\n"); BIO_printf(bio_err,"-keyform arg key file format (PEM or ENGINE)\n");
BIO_printf(bio_err,"-out filename output to filename rather than stdout\n");
BIO_printf(bio_err,"-signature file signature to verify\n"); BIO_printf(bio_err,"-signature file signature to verify\n");
BIO_printf(bio_err,"-sigopt nm:v signature parameter\n"); BIO_printf(bio_err,"-sigopt nm:v signature parameter\n");
BIO_printf(bio_err,"-hmac key create hashed MAC with key\n"); BIO_printf(bio_err,"-hmac key create hashed MAC with key\n");
BIO_printf(bio_err,"-mac algorithm create MAC (not neccessarily HMAC)\n");
BIO_printf(bio_err,"-macopt nm:v MAC algorithm parameters or key\n");
#ifndef OPENSSL_NO_ENGINE #ifndef OPENSSL_NO_ENGINE
BIO_printf(bio_err,"-engine e use engine e, possibly a hardware device.\n"); BIO_printf(bio_err,"-engine e use engine e, possibly a hardware device.\n");
#endif #endif
BIO_printf(bio_err,"-%-14s to use the %s message digest algorithm (default)\n", EVP_MD_do_all_sorted(list_md_fn, bio_err);
LN_md5,LN_md5);
BIO_printf(bio_err,"-%-14s to use the %s message digest algorithm\n",
LN_md4,LN_md4);
BIO_printf(bio_err,"-%-14s to use the %s message digest algorithm\n",
LN_md2,LN_md2);
#ifndef OPENSSL_NO_SHA
BIO_printf(bio_err,"-%-14s to use the %s message digest algorithm\n",
LN_sha1,LN_sha1);
#ifndef OPENSSL_NO_SHA256
BIO_printf(bio_err,"-%-14s to use the %s message digest algorithm\n",
LN_sha224,LN_sha224);
BIO_printf(bio_err,"-%-14s to use the %s message digest algorithm\n",
LN_sha256,LN_sha256);
#endif
#ifndef OPENSSL_NO_SHA512
BIO_printf(bio_err,"-%-14s to use the %s message digest algorithm\n",
LN_sha384,LN_sha384);
BIO_printf(bio_err,"-%-14s to use the %s message digest algorithm\n",
LN_sha512,LN_sha512);
#endif
#endif
BIO_printf(bio_err,"-%-14s to use the %s message digest algorithm\n",
LN_mdc2,LN_mdc2);
BIO_printf(bio_err,"-%-14s to use the %s message digest algorithm\n",
LN_ripemd160,LN_ripemd160);
#ifndef OPENSSL_NO_WHIRLPOOL
BIO_printf(bio_err,"-%-14s to use the %s message digest algorithm\n",
SN_whirlpool,SN_whirlpool);
#endif
goto end; goto end;
} }
@@ -371,9 +368,9 @@ int MAIN(int argc, char **argv)
if (macopts) if (macopts)
{ {
char *macopt; char *macopt;
for (i = 0; i < sk_STRING_num(macopts); i++) for (i = 0; i < sk_OPENSSL_STRING_num(macopts); i++)
{ {
macopt = sk_STRING_value(macopts, i); macopt = sk_OPENSSL_STRING_value(macopts, i);
if (pkey_ctrl_string(mac_ctx, macopt) <= 0) if (pkey_ctrl_string(mac_ctx, macopt) <= 0)
{ {
BIO_printf(bio_err, BIO_printf(bio_err,
@@ -418,9 +415,9 @@ int MAIN(int argc, char **argv)
goto end; goto end;
} }
if (do_verify) if (do_verify)
r = EVP_DigestVerifyInit(mctx, &pctx, md, e, sigkey); r = EVP_DigestVerifyInit(mctx, &pctx, md, NULL, sigkey);
else else
r = EVP_DigestSignInit(mctx, &pctx, md, e, sigkey); r = EVP_DigestSignInit(mctx, &pctx, md, NULL, sigkey);
if (!r) if (!r)
{ {
BIO_printf(bio_err, "Error setting context\n"); BIO_printf(bio_err, "Error setting context\n");
@@ -430,9 +427,9 @@ int MAIN(int argc, char **argv)
if (sigopts) if (sigopts)
{ {
char *sigopt; char *sigopt;
for (i = 0; i < sk_STRING_num(sigopts); i++) for (i = 0; i < sk_OPENSSL_STRING_num(sigopts); i++)
{ {
sigopt = sk_STRING_value(sigopts, i); sigopt = sk_OPENSSL_STRING_value(sigopts, i);
if (pkey_ctrl_string(pctx, sigopt) <= 0) if (pkey_ctrl_string(pctx, sigopt) <= 0)
{ {
BIO_printf(bio_err, BIO_printf(bio_err,
@@ -537,9 +534,9 @@ end:
BIO_free_all(out); BIO_free_all(out);
EVP_PKEY_free(sigkey); EVP_PKEY_free(sigkey);
if (sigopts) if (sigopts)
sk_STRING_free(sigopts); sk_OPENSSL_STRING_free(sigopts);
if (macopts) if (macopts)
sk_STRING_free(macopts); sk_OPENSSL_STRING_free(macopts);
if(sigbuf) OPENSSL_free(sigbuf); if(sigbuf) OPENSSL_free(sigbuf);
if (bmd != NULL) BIO_free(bmd); if (bmd != NULL) BIO_free(bmd);
apps_shutdown(); apps_shutdown();
@@ -600,7 +597,7 @@ int do_fp(BIO *out, unsigned char *buf, BIO *bp, int sep, int binout,
else else
{ {
len=BIO_gets(bp,(char *)buf,BUFSIZE); len=BIO_gets(bp,(char *)buf,BUFSIZE);
if (len <0) if ((int)len <0)
{ {
ERR_print_errors(bio_err); ERR_print_errors(bio_err);
return 1; return 1;
@@ -608,6 +605,12 @@ int do_fp(BIO *out, unsigned char *buf, BIO *bp, int sep, int binout,
} }
if(binout) BIO_write(out, buf, len); if(binout) BIO_write(out, buf, len);
else if (sep == 2)
{
for (i=0; i<(int)len; i++)
BIO_printf(out, "%02x",buf[i]);
BIO_printf(out, " *%s\n", file);
}
else else
{ {
if (sig_name) if (sig_name)

View File

@@ -88,9 +88,6 @@ int MAIN(int, char **);
int MAIN(int argc, char **argv) int MAIN(int argc, char **argv)
{ {
#ifndef OPENSSL_NO_ENGINE
ENGINE *e = NULL;
#endif
DH *dh=NULL; DH *dh=NULL;
int i,badops=0,text=0; int i,badops=0,text=0;
BIO *in=NULL,*out=NULL; BIO *in=NULL,*out=NULL;
@@ -189,7 +186,7 @@ bad:
ERR_load_crypto_strings(); ERR_load_crypto_strings();
#ifndef OPENSSL_NO_ENGINE #ifndef OPENSSL_NO_ENGINE
e = setup_engine(bio_err, engine, 0); setup_engine(bio_err, engine, 0);
#endif #endif
in=BIO_new(BIO_s_file()); in=BIO_new(BIO_s_file());
@@ -349,4 +346,10 @@ end:
apps_shutdown(); apps_shutdown();
OPENSSL_EXIT(ret); OPENSSL_EXIT(ret);
} }
#else /* !OPENSSL_NO_DH */
# if PEDANTIC
static void *dummy=&dummy;
# endif
#endif #endif

View File

@@ -149,9 +149,6 @@ int MAIN(int, char **);
int MAIN(int argc, char **argv) int MAIN(int argc, char **argv)
{ {
#ifndef OPENSSL_NO_ENGINE
ENGINE *e = NULL;
#endif
DH *dh=NULL; DH *dh=NULL;
int i,badops=0,text=0; int i,badops=0,text=0;
#ifndef OPENSSL_NO_DSA #ifndef OPENSSL_NO_DSA
@@ -270,7 +267,7 @@ bad:
ERR_load_crypto_strings(); ERR_load_crypto_strings();
#ifndef OPENSSL_NO_ENGINE #ifndef OPENSSL_NO_ENGINE
e = setup_engine(bio_err, engine, 0); setup_engine(bio_err, engine, 0);
#endif #endif
if (g && !num) if (g && !num)
@@ -335,7 +332,6 @@ bad:
BIO_printf(bio_err,"This is going to take a long time\n"); BIO_printf(bio_err,"This is going to take a long time\n");
if(!dh || !DH_generate_parameters_ex(dh, num, g, &cb)) if(!dh || !DH_generate_parameters_ex(dh, num, g, &cb))
{ {
if(dh) DH_free(dh);
ERR_print_errors(bio_err); ERR_print_errors(bio_err);
goto end; goto end;
} }
@@ -554,4 +550,10 @@ static int MS_CALLBACK dh_cb(int p, int n, BN_GENCB *cb)
return 1; return 1;
} }
#else /* !OPENSSL_NO_DH */
# if PEDANTIC
static void *dummy=&dummy;
# endif
#endif #endif

View File

@@ -334,6 +334,7 @@ bad:
i=PEM_write_bio_DSA_PUBKEY(out,dsa); i=PEM_write_bio_DSA_PUBKEY(out,dsa);
else i=PEM_write_bio_DSAPrivateKey(out,dsa,enc, else i=PEM_write_bio_DSAPrivateKey(out,dsa,enc,
NULL,0,NULL, passout); NULL,0,NULL, passout);
#if !defined(OPENSSL_NO_RSA) && !defined(OPENSSL_NO_RC4)
} else if (outformat == FORMAT_MSBLOB || outformat == FORMAT_PVK) { } else if (outformat == FORMAT_MSBLOB || outformat == FORMAT_PVK) {
EVP_PKEY *pk; EVP_PKEY *pk;
pk = EVP_PKEY_new(); pk = EVP_PKEY_new();
@@ -345,11 +346,12 @@ bad:
else else
i = i2b_PrivateKey_bio(out, pk); i = i2b_PrivateKey_bio(out, pk);
EVP_PKEY_free(pk); EVP_PKEY_free(pk);
#endif
} else { } else {
BIO_printf(bio_err,"bad output format specified for outfile\n"); BIO_printf(bio_err,"bad output format specified for outfile\n");
goto end; goto end;
} }
if (!i) if (i <= 0)
{ {
BIO_printf(bio_err,"unable to write private key\n"); BIO_printf(bio_err,"unable to write private key\n");
ERR_print_errors(bio_err); ERR_print_errors(bio_err);
@@ -365,4 +367,10 @@ end:
apps_shutdown(); apps_shutdown();
OPENSSL_EXIT(ret); OPENSSL_EXIT(ret);
} }
#else /* !OPENSSL_NO_DSA */
# if PEDANTIC
static void *dummy=&dummy;
# endif
#endif #endif

View File

@@ -111,9 +111,6 @@ int MAIN(int, char **);
int MAIN(int argc, char **argv) int MAIN(int argc, char **argv)
{ {
#ifndef OPENSSL_NO_ENGINE
ENGINE *e = NULL;
#endif
DSA *dsa=NULL; DSA *dsa=NULL;
int i,badops=0,text=0; int i,badops=0,text=0;
BIO *in=NULL,*out=NULL; BIO *in=NULL,*out=NULL;
@@ -278,7 +275,7 @@ bad:
} }
#ifndef OPENSSL_NO_ENGINE #ifndef OPENSSL_NO_ENGINE
e = setup_engine(bio_err, engine, 0); setup_engine(bio_err, engine, 0);
#endif #endif
if (need_rand) if (need_rand)
@@ -357,12 +354,10 @@ bad:
if (C) if (C)
{ {
unsigned char *data; unsigned char *data;
int l,len,bits_p,bits_q,bits_g; int l,len,bits_p;
len=BN_num_bytes(dsa->p); len=BN_num_bytes(dsa->p);
bits_p=BN_num_bits(dsa->p); bits_p=BN_num_bits(dsa->p);
bits_q=BN_num_bits(dsa->q);
bits_g=BN_num_bits(dsa->g);
data=(unsigned char *)OPENSSL_malloc(len+20); data=(unsigned char *)OPENSSL_malloc(len+20);
if (data == NULL) if (data == NULL)
{ {
@@ -475,4 +470,10 @@ static int MS_CALLBACK dsa_cb(int p, int n, BN_GENCB *cb)
#endif #endif
return 1; return 1;
} }
#else /* !OPENSSL_NO_DSA */
# if PEDANTIC
static void *dummy=&dummy;
# endif
#endif #endif

View File

@@ -85,9 +85,6 @@ int MAIN(int, char **);
int MAIN(int argc, char **argv) int MAIN(int argc, char **argv)
{ {
#ifndef OPENSSL_NO_ENGINE
ENGINE *e = NULL;
#endif
int ret = 1; int ret = 1;
EC_KEY *eckey = NULL; EC_KEY *eckey = NULL;
const EC_GROUP *group; const EC_GROUP *group;
@@ -254,7 +251,7 @@ bad:
ERR_load_crypto_strings(); ERR_load_crypto_strings();
#ifndef OPENSSL_NO_ENGINE #ifndef OPENSSL_NO_ENGINE
e = setup_engine(bio_err, engine, 0); setup_engine(bio_err, engine, 0);
#endif #endif
if(!app_passwd(bio_err, passargin, passargout, &passin, &passout)) if(!app_passwd(bio_err, passargin, passargout, &passin, &passout))
@@ -400,4 +397,10 @@ end:
apps_shutdown(); apps_shutdown();
OPENSSL_EXIT(ret); OPENSSL_EXIT(ret);
} }
#else /* !OPENSSL_NO_EC */
# if PEDANTIC
static void *dummy=&dummy;
# endif
#endif #endif

View File

@@ -105,7 +105,7 @@
* in the asn1 der encoding * in the asn1 der encoding
* possible values: named_curve (default) * possible values: named_curve (default)
* explicit * explicit
* -no_seed - if 'explicit' parameters are choosen do not use the seed * -no_seed - if 'explicit' parameters are chosen do not use the seed
* -genkey - generate ec key * -genkey - generate ec key
* -rand file - files to use for random number input * -rand file - files to use for random number input
* -engine e - use engine e, possibly a hardware device * -engine e - use engine e, possibly a hardware device
@@ -129,9 +129,6 @@ int MAIN(int argc, char **argv)
char *infile = NULL, *outfile = NULL, *prog; char *infile = NULL, *outfile = NULL, *prog;
BIO *in = NULL, *out = NULL; BIO *in = NULL, *out = NULL;
int informat, outformat, noout = 0, C = 0, ret = 1; int informat, outformat, noout = 0, C = 0, ret = 1;
#ifndef OPENSSL_NO_ENGINE
ENGINE *e = NULL;
#endif
char *engine = NULL; char *engine = NULL;
BIGNUM *ec_p = NULL, *ec_a = NULL, *ec_b = NULL, BIGNUM *ec_p = NULL, *ec_a = NULL, *ec_b = NULL,
@@ -289,7 +286,7 @@ bad:
BIO_printf(bio_err, " " BIO_printf(bio_err, " "
" explicit\n"); " explicit\n");
BIO_printf(bio_err, " -no_seed if 'explicit'" BIO_printf(bio_err, " -no_seed if 'explicit'"
" parameters are choosen do not" " parameters are chosen do not"
" use the seed\n"); " use the seed\n");
BIO_printf(bio_err, " -genkey generate ec" BIO_printf(bio_err, " -genkey generate ec"
" key\n"); " key\n");
@@ -340,7 +337,7 @@ bad:
} }
#ifndef OPENSSL_NO_ENGINE #ifndef OPENSSL_NO_ENGINE
e = setup_engine(bio_err, engine, 0); setup_engine(bio_err, engine, 0);
#endif #endif
if (list_curves) if (list_curves)
@@ -725,4 +722,10 @@ static int ecparam_print_var(BIO *out, BIGNUM *in, const char *var,
BIO_printf(out, "\n\t};\n\n"); BIO_printf(out, "\n\t};\n\n");
return 1; return 1;
} }
#else /* !OPENSSL_NO_EC */
# if PEDANTIC
static void *dummy=&dummy;
# endif
#endif #endif

View File

@@ -67,7 +67,9 @@
#include <openssl/x509.h> #include <openssl/x509.h>
#include <openssl/rand.h> #include <openssl/rand.h>
#include <openssl/pem.h> #include <openssl/pem.h>
#ifndef OPENSSL_NO_COMP
#include <openssl/comp.h> #include <openssl/comp.h>
#endif
#include <ctype.h> #include <ctype.h>
int set_hex(char *in,unsigned char *out,int size); int set_hex(char *in,unsigned char *out,int size);
@@ -101,9 +103,6 @@ int MAIN(int, char **);
int MAIN(int argc, char **argv) int MAIN(int argc, char **argv)
{ {
#ifndef OPENSSL_NO_ENGINE
ENGINE *e = NULL;
#endif
static const char magic[]="Salted__"; static const char magic[]="Salted__";
char mbuf[sizeof magic-1]; char mbuf[sizeof magic-1];
char *strbuf=NULL; char *strbuf=NULL;
@@ -243,7 +242,12 @@ int MAIN(int argc, char **argv)
goto bad; goto bad;
} }
buf[0]='\0'; buf[0]='\0';
fgets(buf,sizeof buf,infile); if (!fgets(buf,sizeof buf,infile))
{
BIO_printf(bio_err,"unable to read key from '%s'\n",
file);
goto bad;
}
fclose(infile); fclose(infile);
i=strlen(buf); i=strlen(buf);
if ((i > 0) && if ((i > 0) &&
@@ -323,7 +327,7 @@ bad:
} }
#ifndef OPENSSL_NO_ENGINE #ifndef OPENSSL_NO_ENGINE
e = setup_engine(bio_err, engine, 0); setup_engine(bio_err, engine, 0);
#endif #endif
if (md && (dgst=EVP_get_digestbyname(md)) == NULL) if (md && (dgst=EVP_get_digestbyname(md)) == NULL)
@@ -391,8 +395,10 @@ bad:
if (inf == NULL) if (inf == NULL)
{ {
#ifndef OPENSSL_NO_SETVBUF_IONBF
if (bufsize != NULL) if (bufsize != NULL)
setvbuf(stdin, (char *)NULL, _IONBF, 0); setvbuf(stdin, (char *)NULL, _IONBF, 0);
#endif /* ndef OPENSSL_NO_SETVBUF_IONBF */
BIO_set_fp(in,stdin,BIO_NOCLOSE); BIO_set_fp(in,stdin,BIO_NOCLOSE);
} }
else else
@@ -445,8 +451,10 @@ bad:
if (outf == NULL) if (outf == NULL)
{ {
BIO_set_fp(out,stdout,BIO_NOCLOSE); BIO_set_fp(out,stdout,BIO_NOCLOSE);
#ifndef OPENSSL_NO_SETVBUF_IONBF
if (bufsize != NULL) if (bufsize != NULL)
setvbuf(stdout, (char *)NULL, _IONBF, 0); setvbuf(stdout, (char *)NULL, _IONBF, 0);
#endif /* ndef OPENSSL_NO_SETVBUF_IONBF */
#ifdef OPENSSL_SYS_VMS #ifdef OPENSSL_SYS_VMS
{ {
BIO *tmpbio = BIO_new(BIO_f_linebuffer()); BIO *tmpbio = BIO_new(BIO_f_linebuffer());

View File

@@ -200,7 +200,7 @@ static int util_verbose(ENGINE *e, int verbose, BIO *bio_out, const char *indent
char *desc = NULL; char *desc = NULL;
int flags; int flags;
int xpos = 0; int xpos = 0;
STACK_OF(STRING) *cmds = NULL; STACK_OF(OPENSSL_STRING) *cmds = NULL;
if(!ENGINE_ctrl(e, ENGINE_CTRL_HAS_CTRL_FUNCTION, 0, NULL, NULL) || if(!ENGINE_ctrl(e, ENGINE_CTRL_HAS_CTRL_FUNCTION, 0, NULL, NULL) ||
((num = ENGINE_ctrl(e, ENGINE_CTRL_GET_FIRST_CMD_TYPE, ((num = ENGINE_ctrl(e, ENGINE_CTRL_GET_FIRST_CMD_TYPE,
0, NULL, NULL)) <= 0)) 0, NULL, NULL)) <= 0))
@@ -211,7 +211,7 @@ static int util_verbose(ENGINE *e, int verbose, BIO *bio_out, const char *indent
return 1; return 1;
} }
cmds = sk_STRING_new_null(); cmds = sk_OPENSSL_STRING_new_null();
if(!cmds) if(!cmds)
goto err; goto err;
@@ -284,16 +284,16 @@ static int util_verbose(ENGINE *e, int verbose, BIO *bio_out, const char *indent
BIO_printf(bio_out, "\n"); BIO_printf(bio_out, "\n");
ret = 1; ret = 1;
err: err:
if(cmds) sk_STRING_pop_free(cmds, identity); if(cmds) sk_OPENSSL_STRING_pop_free(cmds, identity);
if(name) OPENSSL_free(name); if(name) OPENSSL_free(name);
if(desc) OPENSSL_free(desc); if(desc) OPENSSL_free(desc);
return ret; return ret;
} }
static void util_do_cmds(ENGINE *e, STACK_OF(STRING) *cmds, BIO *bio_out, static void util_do_cmds(ENGINE *e, STACK_OF(OPENSSL_STRING) *cmds,
const char *indent) BIO *bio_out, const char *indent)
{ {
int loop, res, num = sk_STRING_num(cmds); int loop, res, num = sk_OPENSSL_STRING_num(cmds);
if(num < 0) if(num < 0)
{ {
@@ -304,7 +304,7 @@ static void util_do_cmds(ENGINE *e, STACK_OF(STRING) *cmds, BIO *bio_out,
{ {
char buf[256]; char buf[256];
const char *cmd, *arg; const char *cmd, *arg;
cmd = sk_STRING_value(cmds, loop); cmd = sk_OPENSSL_STRING_value(cmds, loop);
res = 1; /* assume success */ res = 1; /* assume success */
/* Check if this command has no ":arg" */ /* Check if this command has no ":arg" */
if((arg = strstr(cmd, ":")) == NULL) if((arg = strstr(cmd, ":")) == NULL)
@@ -344,9 +344,9 @@ int MAIN(int argc, char **argv)
const char **pp; const char **pp;
int verbose=0, list_cap=0, test_avail=0, test_avail_noise = 0; int verbose=0, list_cap=0, test_avail=0, test_avail_noise = 0;
ENGINE *e; ENGINE *e;
STACK_OF(STRING) *engines = sk_STRING_new_null(); STACK_OF(OPENSSL_STRING) *engines = sk_OPENSSL_STRING_new_null();
STACK_OF(STRING) *pre_cmds = sk_STRING_new_null(); STACK_OF(OPENSSL_STRING) *pre_cmds = sk_OPENSSL_STRING_new_null();
STACK_OF(STRING) *post_cmds = sk_STRING_new_null(); STACK_OF(OPENSSL_STRING) *post_cmds = sk_OPENSSL_STRING_new_null();
int badops=1; int badops=1;
BIO *bio_out=NULL; BIO *bio_out=NULL;
const char *indent = " "; const char *indent = " ";
@@ -393,20 +393,20 @@ int MAIN(int argc, char **argv)
argc--; argv++; argc--; argv++;
if (argc == 0) if (argc == 0)
goto skip_arg_loop; goto skip_arg_loop;
sk_STRING_push(pre_cmds,*argv); sk_OPENSSL_STRING_push(pre_cmds,*argv);
} }
else if (strcmp(*argv,"-post") == 0) else if (strcmp(*argv,"-post") == 0)
{ {
argc--; argv++; argc--; argv++;
if (argc == 0) if (argc == 0)
goto skip_arg_loop; goto skip_arg_loop;
sk_STRING_push(post_cmds,*argv); sk_OPENSSL_STRING_push(post_cmds,*argv);
} }
else if ((strncmp(*argv,"-h",2) == 0) || else if ((strncmp(*argv,"-h",2) == 0) ||
(strcmp(*argv,"-?") == 0)) (strcmp(*argv,"-?") == 0))
goto skip_arg_loop; goto skip_arg_loop;
else else
sk_STRING_push(engines,*argv); sk_OPENSSL_STRING_push(engines,*argv);
argc--; argc--;
argv++; argv++;
} }
@@ -421,17 +421,17 @@ skip_arg_loop:
goto end; goto end;
} }
if (sk_STRING_num(engines) == 0) if (sk_OPENSSL_STRING_num(engines) == 0)
{ {
for(e = ENGINE_get_first(); e != NULL; e = ENGINE_get_next(e)) for(e = ENGINE_get_first(); e != NULL; e = ENGINE_get_next(e))
{ {
sk_STRING_push(engines,(char *)ENGINE_get_id(e)); sk_OPENSSL_STRING_push(engines,(char *)ENGINE_get_id(e));
} }
} }
for (i=0; i<sk_STRING_num(engines); i++) for (i=0; i<sk_OPENSSL_STRING_num(engines); i++)
{ {
const char *id = sk_STRING_value(engines,i); const char *id = sk_OPENSSL_STRING_value(engines,i);
if ((e = ENGINE_by_id(id)) != NULL) if ((e = ENGINE_by_id(id)) != NULL)
{ {
const char *name = ENGINE_get_name(e); const char *name = ENGINE_get_name(e);
@@ -533,9 +533,9 @@ skip_pmeths:
end: end:
ERR_print_errors(bio_err); ERR_print_errors(bio_err);
sk_STRING_pop_free(engines, identity); sk_OPENSSL_STRING_pop_free(engines, identity);
sk_STRING_pop_free(pre_cmds, identity); sk_OPENSSL_STRING_pop_free(pre_cmds, identity);
sk_STRING_pop_free(post_cmds, identity); sk_OPENSSL_STRING_pop_free(post_cmds, identity);
if (bio_out != NULL) BIO_free_all(bio_out); if (bio_out != NULL) BIO_free_all(bio_out);
apps_shutdown(); apps_shutdown();
OPENSSL_EXIT(ret); OPENSSL_EXIT(ret);

View File

@@ -89,9 +89,6 @@ int MAIN(int, char **);
int MAIN(int argc, char **argv) int MAIN(int argc, char **argv)
{ {
BN_GENCB cb; BN_GENCB cb;
#ifndef OPENSSL_NO_ENGINE
ENGINE *e = NULL;
#endif
DH *dh=NULL; DH *dh=NULL;
int ret=1,num=DEFBITS; int ret=1,num=DEFBITS;
int g=2; int g=2;
@@ -163,7 +160,7 @@ bad:
} }
#ifndef OPENSSL_NO_ENGINE #ifndef OPENSSL_NO_ENGINE
e = setup_engine(bio_err, engine, 0); setup_engine(bio_err, engine, 0);
#endif #endif
out=BIO_new(BIO_s_file()); out=BIO_new(BIO_s_file());
@@ -235,4 +232,10 @@ static int MS_CALLBACK dh_cb(int p, int n, BN_GENCB *cb)
#endif #endif
return 1; return 1;
} }
#else /* !OPENSSL_NO_DH */
# if PEDANTIC
static void *dummy=&dummy;
# endif
#endif #endif

View File

@@ -78,9 +78,6 @@ int MAIN(int, char **);
int MAIN(int argc, char **argv) int MAIN(int argc, char **argv)
{ {
#ifndef OPENSSL_NO_ENGINE
ENGINE *e = NULL;
#endif
DSA *dsa=NULL; DSA *dsa=NULL;
int ret=1; int ret=1;
char *outfile=NULL; char *outfile=NULL;
@@ -206,7 +203,7 @@ bad:
} }
#ifndef OPENSSL_NO_ENGINE #ifndef OPENSSL_NO_ENGINE
e = setup_engine(bio_err, engine, 0); setup_engine(bio_err, engine, 0);
#endif #endif
if(!app_passwd(bio_err, NULL, passargout, NULL, &passout)) { if(!app_passwd(bio_err, NULL, passargout, NULL, &passout)) {
@@ -279,4 +276,10 @@ end:
apps_shutdown(); apps_shutdown();
OPENSSL_EXIT(ret); OPENSSL_EXIT(ret);
} }
#else /* !OPENSSL_NO_DSA */
# if PEDANTIC
static void *dummy=&dummy;
# endif
#endif #endif

View File

@@ -105,9 +105,9 @@ int MAIN(int argc, char **argv)
char *inrand=NULL; char *inrand=NULL;
BIO *out=NULL; BIO *out=NULL;
BIGNUM *bn = BN_new(); BIGNUM *bn = BN_new();
RSA *rsa = RSA_new(); RSA *rsa = NULL;
if(!bn || !rsa) goto err; if(!bn) goto err;
apps_startup(); apps_startup();
BN_GENCB_set(&cb, genrsa_cb, bio_err); BN_GENCB_set(&cb, genrsa_cb, bio_err);
@@ -265,6 +265,13 @@ bad:
BIO_printf(bio_err,"Generating RSA private key, %d bit long modulus\n", BIO_printf(bio_err,"Generating RSA private key, %d bit long modulus\n",
num); num);
#ifdef OPENSSL_NO_ENGINE
rsa = RSA_new();
#else
rsa = RSA_new_method(e);
#endif
if (!rsa)
goto err;
if(!BN_set_word(bn, f4) || !RSA_generate_key_ex(rsa, num, bn, &cb)) if(!BN_set_word(bn, f4) || !RSA_generate_key_ex(rsa, num, bn, &cb))
goto err; goto err;

107
apps/install-apps.com Executable file
View File

@@ -0,0 +1,107 @@
$! INSTALL.COM -- Installs the files in a given directory tree
$!
$! Author: Richard Levitte <richard@levitte.org>
$! Time of creation: 22-MAY-1998 10:13
$!
$! P1 root of the directory tree
$! P2 "64" for 64-bit pointers.
$!
$!
$! Announce/identify.
$!
$ proc = f$environment( "procedure")
$ write sys$output "@@@ "+ -
f$parse( proc, , , "name")+ f$parse( proc, , , "type")
$!
$ on error then goto tidy
$ on control_c then goto tidy
$!
$ if (p1 .eqs. "")
$ then
$ write sys$output "First argument missing."
$ write sys$output -
"It should be the directory where you want things installed."
$ exit
$ endif
$!
$ if (f$getsyi("cpu") .lt. 128)
$ then
$ arch = "VAX"
$ else
$ arch = f$edit( f$getsyi( "arch_name"), "upcase")
$ if (arch .eqs. "") then arch = "UNK"
$ endif
$!
$ archd = arch
$!
$ if (p2 .nes. "")
$ then
$ if (p2 .eqs. "64")
$ then
$ archd = arch+ "_64"
$ else
$ if (p2 .nes. "32")
$ then
$ write sys$output "Second argument invalid."
$ write sys$output "It should be "32", "64", or nothing."
$ exit
$ endif
$ endif
$ endif
$!
$ root = f$parse( p1, "[]A.;0", , , "syntax_only, no_conceal") - "A.;0"
$ root_dev = f$parse(root,,,"device","syntax_only")
$ root_dir = f$parse(root,,,"directory","syntax_only") - -
"[000000." - "][" - "[" - "]"
$ root = root_dev + "[" + root_dir
$!
$ define /nolog wrk_sslroot 'root'.] /trans=conc
$ define /nolog wrk_sslxexe wrk_sslroot:['archd'_exe]
$!
$ if f$parse("wrk_sslroot:[000000]") .eqs. "" then -
create /directory /log wrk_sslroot:[000000]
$ if f$parse("wrk_sslxexe:") .eqs. "" then -
create /directory /log wrk_sslxexe:
$!
$ exe := openssl
$!
$ exe_dir := [-.'archd'.exe.apps]
$!
$! Executables.
$!
$ i = 0
$ loop_exe:
$ e = f$edit(f$element( i, ",", exe), "trim")
$ i = i + 1
$ if e .eqs. "," then goto loop_exe_end
$ set noon
$ file = exe_dir+ e+ ".exe"
$ if f$search( file) .nes. ""
$ then
$ copy /protection = w:re 'file' wrk_sslxexe: /log
$ endif
$ set on
$ goto loop_exe
$ loop_exe_end:
$!
$! Miscellaneous.
$!
$ set noon
$ copy /protection = w:re ca.com wrk_sslxexe:ca.com /log
$ copy /protection = w:re openssl-vms.cnf wrk_sslroot:[000000]openssl.cnf /log
$ set on
$!
$ tidy:
$!
$ call deass wrk_sslroot
$ call deass wrk_sslxexe
$!
$ exit
$!
$ deass: subroutine
$ if (f$trnlnm( p1, "LNM$PROCESS") .nes. "")
$ then
$ deassign /process 'p1'
$ endif
$ endsubroutine
$!

View File

@@ -1,69 +0,0 @@
$! INSTALL.COM -- Installs the files in a given directory tree
$!
$! Author: Richard Levitte <richard@levitte.org>
$! Time of creation: 22-MAY-1998 10:13
$!
$! P1 root of the directory tree
$!
$ IF P1 .EQS. ""
$ THEN
$ WRITE SYS$OUTPUT "First argument missing."
$ WRITE SYS$OUTPUT "Should be the directory where you want things installed."
$ EXIT
$ ENDIF
$
$ ROOT = F$PARSE(P1,"[]A.;0",,,"SYNTAX_ONLY,NO_CONCEAL") - "A.;0"
$ ROOT_DEV = F$PARSE(ROOT,,,"DEVICE","SYNTAX_ONLY")
$ ROOT_DIR = F$PARSE(ROOT,,,"DIRECTORY","SYNTAX_ONLY") -
- "[000000." - "][" - "[" - "]"
$ ROOT = ROOT_DEV + "[" + ROOT_DIR
$
$ DEFINE/NOLOG WRK_SSLROOT 'ROOT'.] /TRANS=CONC
$ DEFINE/NOLOG WRK_SSLVEXE WRK_SSLROOT:[VAX_EXE]
$ DEFINE/NOLOG WRK_SSLAEXE WRK_SSLROOT:[ALPHA_EXE]
$ DEFINE/NOLOG WRK_SSLLIB WRK_SSLROOT:[LIB]
$
$ IF F$PARSE("WRK_SSLROOT:[000000]") .EQS. "" THEN -
CREATE/DIR/LOG WRK_SSLROOT:[000000]
$ IF F$PARSE("WRK_SSLVEXE:") .EQS. "" THEN -
CREATE/DIR/LOG WRK_SSLVEXE:
$ IF F$PARSE("WRK_SSLAEXE:") .EQS. "" THEN -
CREATE/DIR/LOG WRK_SSLAEXE:
$ IF F$PARSE("WRK_SSLLIB:") .EQS. "" THEN -
CREATE/DIR/LOG WRK_SSLLIB:
$
$ EXE := openssl
$
$ VEXE_DIR := [-.VAX.EXE.APPS]
$ AEXE_DIR := [-.AXP.EXE.APPS]
$
$ I = 0
$ LOOP_EXE:
$ E = F$EDIT(F$ELEMENT(I, ",", EXE),"TRIM")
$ I = I + 1
$ IF E .EQS. "," THEN GOTO LOOP_EXE_END
$ SET NOON
$ IF F$SEARCH(VEXE_DIR+E+".EXE") .NES. ""
$ THEN
$ COPY 'VEXE_DIR''E'.EXE WRK_SSLVEXE:'E'.EXE/log
$ SET FILE/PROT=W:RE WRK_SSLVEXE:'E'.EXE
$ ENDIF
$ IF F$SEARCH(AEXE_DIR+E+".EXE") .NES. ""
$ THEN
$ COPY 'AEXE_DIR''E'.EXE WRK_SSLAEXE:'E'.EXE/log
$ SET FILE/PROT=W:RE WRK_SSLAEXE:'E'.EXE
$ ENDIF
$ SET ON
$ GOTO LOOP_EXE
$ LOOP_EXE_END:
$
$ SET NOON
$ COPY CA.COM WRK_SSLAEXE:CA.COM/LOG
$ SET FILE/PROT=W:RE WRK_SSLAEXE:CA.COM
$ COPY CA.COM WRK_SSLVEXE:CA.COM/LOG
$ SET FILE/PROT=W:RE WRK_SSLVEXE:CA.COM
$ COPY OPENSSL-VMS.CNF WRK_SSLROOT:[000000]OPENSSL.CNF/LOG
$ SET FILE/PROT=W:R WRK_SSLROOT:[000000]OPENSSL.CNF
$ SET ON
$
$ EXIT

View File

@@ -6,11 +6,12 @@ $! A-Com Computing, Inc.
$! byer@mail.all-net.net $! byer@mail.all-net.net
$! $!
$! Changes by Richard Levitte <richard@levitte.org> $! Changes by Richard Levitte <richard@levitte.org>
$! Zoltan Arpadffy <zoli@polarhome.com>
$! $!
$! This command files compiles and creates all the various different $! This command files compiles and creates all the various different
$! "application" programs for the different types of encryption for OpenSSL. $! "application" programs for the different types of encryption for OpenSSL.
$! The EXE's are placed in the directory [.xxx.EXE.APPS] where "xxx" denotes $! The EXE's are placed in the directory [.xxx.EXE.APPS] where "xxx" denotes
$! either AXP or VAX depending on your machine architecture. $! ALPHA, IA64 or VAX, depending on your machine architecture.
$! $!
$! It was written so it would try to determine what "C" compiler to $! It was written so it would try to determine what "C" compiler to
$! use or you can specify which "C" compiler to use. $! use or you can specify which "C" compiler to use.
@@ -24,7 +25,7 @@ $! VAXC For VAX C.
$! DECC For DEC C. $! DECC For DEC C.
$! GNUC For GNU C. $! GNUC For GNU C.
$! $!
$! If you don't speficy a compiler, it will try to determine which $! If you don't specify a compiler, it will try to determine which
$! "C" compiler to use. $! "C" compiler to use.
$! $!
$! P3, if defined, sets a TCP/IP library to use, through one of the following $! P3, if defined, sets a TCP/IP library to use, through one of the following
@@ -38,33 +39,63 @@ $! P4, if defined, sets a compiler thread NOT needed on OpenVMS 7.1 (and up)
$! $!
$! P5, if defined, sets a choice of programs to compile. $! P5, if defined, sets a choice of programs to compile.
$! $!
$! P6, if defined, specifies the C pointer size. Ignored on VAX.
$! ("64=ARGV" gives more efficient code with HP C V7.3 or newer.)
$! Supported values are:
$!
$! "" Compile with default (/NOPOINTER_SIZE)
$! 32 Compile with /POINTER_SIZE=32 (SHORT)
$! 64 Compile with /POINTER_SIZE=64[=ARGV] (LONG[=ARGV])
$! (Automatically select ARGV if compiler supports it.)
$! 64= Compile with /POINTER_SIZE=64 (LONG).
$! 64=ARGV Compile with /POINTER_SIZE=64=ARGV (LONG=ARGV).
$!
$! P7, if defined, specifies a directory where ZLIB files (zlib.h,
$! libz.olb) may be found. Optionally, a non-default object library
$! name may be included ("dev:[dir]libz_64.olb", for example).
$!
$!
$! Announce/identify.
$!
$ proc = f$environment( "procedure")
$ write sys$output "@@@ "+ -
f$parse( proc, , , "name")+ f$parse( proc, , , "type")
$!
$ on control_c then goto exit
$! $!
$! Define A TCP/IP Library That We Will Need To Link To. $! Define A TCP/IP Library That We Will Need To Link To.
$! (That Is, If We Need To Link To One.) $! (That Is, If We Need To Link To One.)
$! $!
$ TCPIP_LIB = "" $ TCPIP_LIB = ""
$ ZLIB_LIB = ""
$! $!
$! Check What Architecture We Are Using. $! Check What Architecture We Are Using.
$! $!
$ IF (F$GETSYI("CPU").GE.128) $ IF (F$GETSYI("CPU").LT.128)
$ THEN $ THEN
$! $!
$! The Architecture Is AXP. $! The Architecture Is VAX.
$! $!
$ ARCH := AXP $ ARCH = "VAX"
$! $!
$! Else... $! Else...
$! $!
$ ELSE $ ELSE
$! $!
$! The Architecture Is VAX. $! The Architecture Is Alpha, IA64 or whatever comes in the future.
$! $!
$ ARCH := VAX $ ARCH = F$EDIT( F$GETSYI( "ARCH_NAME"), "UPCASE")
$ IF (ARCH .EQS. "") THEN ARCH = "UNK"
$! $!
$! End The Architecture Check. $! End The Architecture Check.
$! $!
$ ENDIF $ ENDIF
$! $!
$ ARCHD = ARCH
$ LIB32 = "32"
$ OPT_FILE = ""
$ POINTER_SIZE = ""
$!
$! Define what programs should be compiled $! Define what programs should be compiled
$! $!
$ PROGRAMS := OPENSSL $ PROGRAMS := OPENSSL
@@ -73,25 +104,40 @@ $! Check To Make Sure We Have Valid Command Line Parameters.
$! $!
$ GOSUB CHECK_OPTIONS $ GOSUB CHECK_OPTIONS
$! $!
$! Define The CRYPTO Library.
$!
$ CRYPTO_LIB := SYS$DISK:[-.'ARCHD'.EXE.CRYPTO]SSL_LIBCRYPTO'LIB32'.OLB
$!
$! Define The SSL Library.
$!
$ SSL_LIB := SYS$DISK:[-.'ARCHD'.EXE.SSL]SSL_LIBSSL'LIB32'.OLB
$!
$! Define The OBJ and EXE Directories.
$!
$ OBJ_DIR := SYS$DISK:[-.'ARCHD'.OBJ.APPS]
$ EXE_DIR := SYS$DISK:[-.'ARCHD'.EXE.APPS]
$!
$! Specify the destination directory in any /MAP option.
$!
$ if (LINKMAP .eqs. "MAP")
$ then
$ LINKMAP = LINKMAP+ "=''EXE_DIR'"
$ endif
$!
$! Add the location prefix to the linker options file name.
$!
$ if (OPT_FILE .nes. "")
$ then
$ OPT_FILE = EXE_DIR+ OPT_FILE
$ endif
$!
$! Initialise logical names and such $! Initialise logical names and such
$! $!
$ GOSUB INITIALISE $ GOSUB INITIALISE
$! $!
$! Tell The User What Kind of Machine We Run On. $! Tell The User What Kind of Machine We Run On.
$! $!
$ WRITE SYS$OUTPUT "Compiling On A ",ARCH," Machine." $ WRITE SYS$OUTPUT "Host system architecture: ''ARCHD'"
$!
$! Define The CRYPTO Library.
$!
$ CRYPTO_LIB := SYS$DISK:[-.'ARCH'.EXE.CRYPTO]LIBCRYPTO.OLB
$!
$! Define The SSL Library.
$!
$ SSL_LIB := SYS$DISK:[-.'ARCH'.EXE.SSL]LIBSSL.OLB
$!
$! Define The OBJ Directory.
$!
$ OBJ_DIR := SYS$DISK:[-.'ARCH'.OBJ.APPS]
$! $!
$! Check To See If The OBJ Directory Exists. $! Check To See If The OBJ Directory Exists.
$! $!
@@ -106,10 +152,6 @@ $! End The OBJ Directory Check.
$! $!
$ ENDIF $ ENDIF
$! $!
$! Define The EXE Directory.
$!
$ EXE_DIR := SYS$DISK:[-.'ARCH'.EXE.APPS]
$!
$! Check To See If The EXE Directory Exists. $! Check To See If The EXE Directory Exists.
$! $!
$ IF (F$PARSE(EXE_DIR).EQS."") $ IF (F$PARSE(EXE_DIR).EQS."")
@@ -132,6 +174,9 @@ $!
$ GOSUB CHECK_OPT_FILE $ GOSUB CHECK_OPT_FILE
$! $!
$! Define The Application Files. $! Define The Application Files.
$! NOTE: Some might think this list ugly. However, it's made this way to
$! reflect the E_OBJ variable in Makefile as closely as possible, thereby
$! making it fairly easy to verify that the lists are the same.
$! $!
$ LIB_OPENSSL = "VERIFY,ASN1PARS,REQ,DGST,DH,DHPARAM,ENC,PASSWD,GENDH,ERRSTR,"+- $ LIB_OPENSSL = "VERIFY,ASN1PARS,REQ,DGST,DH,DHPARAM,ENC,PASSWD,GENDH,ERRSTR,"+-
"CA,PKCS7,CRL2P7,CRL,"+- "CA,PKCS7,CRL2P7,CRL,"+-
@@ -140,13 +185,16 @@ $ LIB_OPENSSL = "VERIFY,ASN1PARS,REQ,DGST,DH,DHPARAM,ENC,PASSWD,GENDH,ERRSTR,"+-
"S_TIME,APPS,S_CB,S_SOCKET,APP_RAND,VERSION,SESS_ID,"+- "S_TIME,APPS,S_CB,S_SOCKET,APP_RAND,VERSION,SESS_ID,"+-
"CIPHERS,NSEQ,PKCS12,PKCS8,PKEY,PKEYPARAM,PKEYUTL,"+ - "CIPHERS,NSEQ,PKCS12,PKCS8,PKEY,PKEYPARAM,PKEYUTL,"+ -
"SPKAC,SMIME,CMS,RAND,ENGINE,OCSP,PRIME,TS" "SPKAC,SMIME,CMS,RAND,ENGINE,OCSP,PRIME,TS"
$!
$ LIB_OPENSSL = LIB_OPENSSL+ ",VMS_DECC_INIT"
$!
$ TCPIP_PROGRAMS = ",," $ TCPIP_PROGRAMS = ",,"
$ IF COMPILER .EQS. "VAXC" THEN - $ IF COMPILER .EQS. "VAXC" THEN -
TCPIP_PROGRAMS = ",OPENSSL," TCPIP_PROGRAMS = ",OPENSSL,"
$! $!
$! Setup exceptional compilations $! Setup exceptional compilations
$! $!
$ COMPILEWITH_CC2 = ",S_SERVER,S_CLIENT," $ COMPILEWITH_CC2 = ",S_SOCKET,S_SERVER,S_CLIENT,"
$! $!
$ PHASE := LIB $ PHASE := LIB
$! $!
@@ -164,6 +212,10 @@ $! Make The Application File Name
$! $!
$ CURRENT_APP = F$EDIT(F$ELEMENT(APP_COUNTER,",",PROGRAMS),"TRIM") $ CURRENT_APP = F$EDIT(F$ELEMENT(APP_COUNTER,",",PROGRAMS),"TRIM")
$! $!
$! Create The Executable File Name.
$!
$ EXE_FILE = EXE_DIR + CURRENT_APP + ".EXE"
$!
$! Check To See If We Are At The End Of The File List. $! Check To See If We Are At The End Of The File List.
$! $!
$ IF (CURRENT_APP.EQS.",") $ IF (CURRENT_APP.EQS.",")
@@ -193,7 +245,7 @@ $ LIB_COUNTER = -1
$! $!
$! Create a .OPT file for the object files $! Create a .OPT file for the object files
$! $!
$ OPEN/WRITE OBJECTS 'EXE_DIR''CURRENT_APP'.OPT $ OPEN /WRITE OBJECTS 'EXE_DIR''CURRENT_APP'.OPT
$! $!
$! Top Of The File Loop. $! Top Of The File Loop.
$! $!
@@ -227,10 +279,6 @@ $!
$! Create The Object File Name. $! Create The Object File Name.
$! $!
$ OBJECT_FILE = OBJ_DIR + FILE_NAME + ".OBJ" $ OBJECT_FILE = OBJ_DIR + FILE_NAME + ".OBJ"
$!
$! Create The Executable File Name.
$!
$ EXE_FILE = EXE_DIR + FILE_NAME + ".EXE"
$ ON WARNING THEN GOTO NEXT_LIB $ ON WARNING THEN GOTO NEXT_LIB
$! $!
$! Check To See If The File We Want To Compile Actually Exists. $! Check To See If The File We Want To Compile Actually Exists.
@@ -284,34 +332,18 @@ $ GOTO NEXT_APP
$ ENDIF $ ENDIF
$! $!
$! Link The Program. $! Link The Program.
$! Check To See If We Are To Link With A Specific TCP/IP Library.
$! $!
$ ON WARNING THEN GOTO NEXT_APP $ ON WARNING THEN GOTO NEXT_APP
$! $!
$ IF (TCPIP_LIB.NES."")
$ THEN
$!
$! Don't Link With The RSAREF Routines And TCP/IP Library. $! Don't Link With The RSAREF Routines And TCP/IP Library.
$! $!
$ LINK/'DEBUGGER'/'TRACEBACK' /EXE='EXE_FILE' - $ LINK /'DEBUGGER' /'LINKMAP' /'TRACEBACK' /EXE='EXE_FILE' -
'EXE_DIR''CURRENT_APP'.OPT/OPTION, - 'EXE_DIR''CURRENT_APP'.OPT /OPTIONS, -
'SSL_LIB'/LIBRARY,'CRYPTO_LIB'/LIBRARY, - 'SSL_LIB' /LIBRARY, -
'TCPIP_LIB','OPT_FILE'/OPTION 'CRYPTO_LIB' /LIBRARY -
$! 'TCPIP_LIB' -
$! Else... 'ZLIB_LIB' -
$! ,'OPT_FILE' /OPTIONS
$ ELSE
$!
$! Don't Link With The RSAREF Routines And Link With A TCP/IP Library.
$!
$ LINK/'DEBUGGER'/'TRACEBACK' /EXE='EXE_FILE' -
'EXE_DIR''CURRENT_APP'.OPT/OPTION, -
'SSL_LIB'/LIBRARY,'CRYPTO_LIB'/LIBRARY, -
'OPT_FILE'/OPTION
$!
$! End The TCP/IP Library Check.
$!
$ ENDIF
$! $!
$! Go Back And Do It Again. $! Go Back And Do It Again.
$! $!
@@ -346,7 +378,7 @@ $!
$ CREATE 'OPT_FILE' $ CREATE 'OPT_FILE'
$DECK $DECK
! !
! Default System Options File To Link Agianst ! Default System Options File To Link Against
! The Sharable VAX C Runtime Library. ! The Sharable VAX C Runtime Library.
! !
SYS$SHARE:VAXCRTL.EXE/SHARE SYS$SHARE:VAXCRTL.EXE/SHARE
@@ -375,7 +407,7 @@ $!
$ CREATE 'OPT_FILE' $ CREATE 'OPT_FILE'
$DECK $DECK
! !
! Default System Options File To Link Agianst ! Default System Options File To Link Against
! The Sharable C Runtime Library. ! The Sharable C Runtime Library.
! !
GNU_CC:[000000]GCCLIB/LIBRARY GNU_CC:[000000]GCCLIB/LIBRARY
@@ -410,7 +442,7 @@ $!
$ CREATE 'OPT_FILE' $ CREATE 'OPT_FILE'
$DECK $DECK
! !
! Default System Options File To Link Agianst ! Default System Options File To Link Against
! The Sharable DEC C Runtime Library. ! The Sharable DEC C Runtime Library.
! !
SYS$SHARE:DECC$SHR.EXE/SHARE SYS$SHARE:DECC$SHR.EXE/SHARE
@@ -420,19 +452,19 @@ $! Else...
$! $!
$ ELSE $ ELSE
$! $!
$! Create The AXP Linker Option File. $! Create The non-VAX Linker Option File.
$! $!
$ CREATE 'OPT_FILE' $ CREATE 'OPT_FILE'
$DECK $DECK
! !
! Default System Options File For AXP To Link Agianst ! Default System Options File For non-VAX To Link Against
! The Sharable C Runtime Library. ! The Sharable C Runtime Library.
! !
SYS$SHARE:CMA$OPEN_LIB_SHR/SHARE SYS$SHARE:CMA$OPEN_LIB_SHR/SHARE
SYS$SHARE:CMA$OPEN_RTL/SHARE SYS$SHARE:CMA$OPEN_RTL/SHARE
$EOD $EOD
$! $!
$! End The VAX/AXP DEC C Option File Check. $! End The DEC C Option File Check.
$! $!
$ ENDIF $ ENDIF
$! $!
@@ -509,14 +541,15 @@ $!
$ IF (P1.EQS."NODEBUG") $ IF (P1.EQS."NODEBUG")
$ THEN $ THEN
$! $!
$! P1 Is NODEBUG, So Compile Without Debugger Information. $! P1 Is NODEBUG, So Compile Without Debugger Information.
$! $!
$ DEBUGGER = "NODEBUG" $ DEBUGGER = "NODEBUG"
$ TRACEBACK = "NOTRACEBACK" $ LINKMAP = "NOMAP"
$ GCC_OPTIMIZE = "OPTIMIZE" $ TRACEBACK = "NOTRACEBACK"
$ CC_OPTIMIZE = "OPTIMIZE" $ GCC_OPTIMIZE = "OPTIMIZE"
$ WRITE SYS$OUTPUT "No Debugger Information Will Be Produced During Compile." $ CC_OPTIMIZE = "OPTIMIZE"
$ WRITE SYS$OUTPUT "Compiling With Compiler Optimization." $ WRITE SYS$OUTPUT "No Debugger Information Will Be Produced During Compile."
$ WRITE SYS$OUTPUT "Compiling With Compiler Optimization."
$! $!
$! Else... $! Else...
$! $!
@@ -530,6 +563,7 @@ $!
$! Compile With Debugger Information. $! Compile With Debugger Information.
$! $!
$ DEBUGGER = "DEBUG" $ DEBUGGER = "DEBUG"
$ LINKMAP = "MAP"
$ TRACEBACK = "TRACEBACK" $ TRACEBACK = "TRACEBACK"
$ GCC_OPTIMIZE = "NOOPTIMIZE" $ GCC_OPTIMIZE = "NOOPTIMIZE"
$ CC_OPTIMIZE = "NOOPTIMIZE" $ CC_OPTIMIZE = "NOOPTIMIZE"
@@ -537,7 +571,7 @@ $ WRITE SYS$OUTPUT "Debugger Information Will Be Produced During Compile."
$ WRITE SYS$OUTPUT "Compiling Without Compiler Optimization." $ WRITE SYS$OUTPUT "Compiling Without Compiler Optimization."
$ ELSE $ ELSE
$! $!
$! Tell The User Entered An Invalid Option.. $! Tell The User Entered An Invalid Option.
$! $!
$ WRITE SYS$OUTPUT "" $ WRITE SYS$OUTPUT ""
$ WRITE SYS$OUTPUT "The Option ",P1," Is Invalid. The Valid Options Are:" $ WRITE SYS$OUTPUT "The Option ",P1," Is Invalid. The Valid Options Are:"
@@ -550,7 +584,7 @@ $! Time To EXIT.
$! $!
$ EXIT $ EXIT
$! $!
$! End The Valid Arguement Check. $! End The Valid Argument Check.
$! $!
$ ENDIF $ ENDIF
$! $!
@@ -558,6 +592,87 @@ $! End The P1 Check.
$! $!
$ ENDIF $ ENDIF
$! $!
$! Check P6 (POINTER_SIZE).
$!
$ IF (P6 .NES. "") .AND. (ARCH .NES. "VAX")
$ THEN
$!
$ IF (P6 .EQS. "32")
$ THEN
$ POINTER_SIZE = " /POINTER_SIZE=32"
$ ELSE
$ POINTER_SIZE = F$EDIT( P6, "COLLAPSE, UPCASE")
$ IF ((POINTER_SIZE .EQS. "64") .OR. -
(POINTER_SIZE .EQS. "64=") .OR. -
(POINTER_SIZE .EQS. "64=ARGV"))
$ THEN
$ ARCHD = ARCH+ "_64"
$ LIB32 = ""
$ IF (F$EXTRACT( 2, 1, POINTER_SIZE) .EQS. "=")
$ THEN
$! Explicit user choice: "64" or "64=ARGV".
$ IF (POINTER_SIZE .EQS. "64=") THEN POINTER_SIZE = "64"
$ ELSE
$ SET NOON
$ DEFINE /USER_MODE SYS$OUTPUT NL:
$ DEFINE /USER_MODE SYS$ERROR NL:
$ CC /NOLIST /NOOBJECT /POINTER_SIZE=64=ARGV NL:
$ IF ($STATUS .AND. %X0FFF0000) .EQ. %X00030000
$ THEN
$ ! If we got here, it means DCL complained like this:
$ ! %DCL-W-NOVALU, value not allowed - remove value specification
$ ! \64=\
$ !
$ ! If the compiler was run, logicals defined in /USER would
$ ! have been deassigned automatically. However, when DCL
$ ! complains, they aren't, so we do it here (it might be
$ ! unnecessary, but just in case there will be another error
$ ! message further on that we don't want to miss)
$ DEASSIGN /USER_MODE SYS$ERROR
$ DEASSIGN /USER_MODE SYS$OUTPUT
$ ELSE
$ POINTER_SIZE = POINTER_SIZE + "=ARGV"
$ ENDIF
$ SET ON
$ ENDIF
$ POINTER_SIZE = " /POINTER_SIZE=''POINTER_SIZE'"
$!
$ ELSE
$!
$! Tell The User Entered An Invalid Option.
$!
$ WRITE SYS$OUTPUT ""
$ WRITE SYS$OUTPUT "The Option ", P6, -
" Is Invalid. The Valid Options Are:"
$ WRITE SYS$OUTPUT ""
$ WRITE SYS$OUTPUT -
" """" : Compile with default (short) pointers."
$ WRITE SYS$OUTPUT -
" 32 : Compile with 32-bit (short) pointers."
$ WRITE SYS$OUTPUT -
" 64 : Compile with 64-bit (long) pointers (auto ARGV)."
$ WRITE SYS$OUTPUT -
" 64= : Compile with 64-bit (long) pointers (no ARGV)."
$ WRITE SYS$OUTPUT -
" 64=ARGV : Compile with 64-bit (long) pointers (ARGV)."
$ WRITE SYS$OUTPUT ""
$!
$! Time To EXIT.
$!
$ EXIT
$!
$ ENDIF
$!
$ ENDIF
$!
$! End The P6 (POINTER_SIZE) Check.
$!
$ ENDIF
$!
$! Set basic C compiler /INCLUDE directories.
$!
$ CC_INCLUDES = "SYS$DISK:[-],SYS$DISK:[-.CRYPTO]"
$!
$! Check To See If P2 Is Blank. $! Check To See If P2 Is Blank.
$! $!
$ IF (P2.EQS."") $ IF (P2.EQS."")
@@ -581,7 +696,7 @@ $ ELSE
$! $!
$! Check To See If We Have VAXC Or DECC. $! Check To See If We Have VAXC Or DECC.
$! $!
$ IF (ARCH.EQS."AXP").OR.(F$TRNLNM("DECC$CC_DEFAULT").NES."") $ IF (ARCH.NES."VAX").OR.(F$TRNLNM("DECC$CC_DEFAULT").NES."")
$ THEN $ THEN
$! $!
$! Looks Like DECC, Set To Use DECC. $! Looks Like DECC, Set To Use DECC.
@@ -658,11 +773,67 @@ $ CCDEFS = "MONOLITH"
$ IF F$TYPE(USER_CCDEFS) .NES. "" THEN CCDEFS = CCDEFS + "," + USER_CCDEFS $ IF F$TYPE(USER_CCDEFS) .NES. "" THEN CCDEFS = CCDEFS + "," + USER_CCDEFS
$ CCEXTRAFLAGS = "" $ CCEXTRAFLAGS = ""
$ IF F$TYPE(USER_CCFLAGS) .NES. "" THEN CCEXTRAFLAGS = USER_CCFLAGS $ IF F$TYPE(USER_CCFLAGS) .NES. "" THEN CCEXTRAFLAGS = USER_CCFLAGS
$ CCDISABLEWARNINGS = "LONGLONGTYPE,LONGLONGSUFX,FOUNDCR" $ CCDISABLEWARNINGS = "" !!! "MAYLOSEDATA3" !!! "LONGLONGTYPE,LONGLONGSUFX,FOUNDCR"
$ IF F$TYPE(USER_CCDISABLEWARNINGS) .NES. "" THEN - $ IF F$TYPE(USER_CCDISABLEWARNINGS) .NES. ""
CCDISABLEWARNINGS = CCDISABLEWARNINGS + "," + USER_CCDISABLEWARNINGS $ THEN
$ IF CCDISABLEWARNINGS .NES. "" THEN CCDISABLEWARNINGS = CCDISABLEWARNINGS + ","
$ CCDISABLEWARNINGS = CCDISABLEWARNINGS + USER_CCDISABLEWARNINGS
$ ENDIF
$! $!
$! Check To See If The User Entered A Valid Paramter. $! Check To See If We Have A ZLIB Option.
$!
$ ZLIB = P7
$ IF (ZLIB .NES. "")
$ THEN
$!
$! Check for expected ZLIB files.
$!
$ err = 0
$ file1 = f$parse( "zlib.h", ZLIB, , , "SYNTAX_ONLY")
$ if (f$search( file1) .eqs. "")
$ then
$ WRITE SYS$OUTPUT ""
$ WRITE SYS$OUTPUT "The Option ", ZLIB, " Is Invalid."
$ WRITE SYS$OUTPUT " Can't find header: ''file1'"
$ err = 1
$ endif
$ file1 = f$parse( "A.;", ZLIB)- "A.;"
$!
$ file2 = f$parse( ZLIB, "libz.olb", , , "SYNTAX_ONLY")
$ if (f$search( file2) .eqs. "")
$ then
$ if (err .eq. 0)
$ then
$ WRITE SYS$OUTPUT ""
$ WRITE SYS$OUTPUT "The Option ", ZLIB, " Is Invalid."
$ endif
$ WRITE SYS$OUTPUT " Can't find library: ''file2'"
$ WRITE SYS$OUTPUT ""
$ err = err+ 2
$ endif
$ if (err .eq. 1)
$ then
$ WRITE SYS$OUTPUT ""
$ endif
$!
$ if (err .ne. 0)
$ then
$ EXIT
$ endif
$!
$ CCDEFS = """ZLIB=1"", "+ CCDEFS
$ CC_INCLUDES = CC_INCLUDES+ ", "+ file1
$ ZLIB_LIB = ", ''file2' /library"
$!
$! Print info
$!
$ WRITE SYS$OUTPUT "ZLIB library spec: ", file2
$!
$! End The ZLIB Check.
$!
$ ENDIF
$!
$! Check To See If The User Entered A Valid Parameter.
$! $!
$ IF (P2.EQS."VAXC").OR.(P2.EQS."DECC").OR.(P2.EQS."GNUC") $ IF (P2.EQS."VAXC").OR.(P2.EQS."DECC").OR.(P2.EQS."GNUC")
$ THEN $ THEN
@@ -685,13 +856,13 @@ $!
$ CC = "CC" $ CC = "CC"
$ IF ARCH.EQS."VAX" .AND. F$TRNLNM("DECC$CC_DEFAULT").NES."/DECC" - $ IF ARCH.EQS."VAX" .AND. F$TRNLNM("DECC$CC_DEFAULT").NES."/DECC" -
THEN CC = "CC/DECC" THEN CC = "CC/DECC"
$ CC = CC + "/''CC_OPTIMIZE'/''DEBUGGER'/STANDARD=ANSI89" + - $ CC = CC + " /''CC_OPTIMIZE' /''DEBUGGER' /STANDARD=RELAXED"+ -
"/NOLIST/PREFIX=ALL" + - "''POINTER_SIZE' /NOLIST /PREFIX=ALL" + -
"/INCLUDE=(SYS$DISK:[-],SYS$DISK:[-.CRYPTO])" + CCEXTRAFLAGS " /INCLUDE=(''CC_INCLUDES') " + CCEXTRAFLAGS
$! $!
$! Define The Linker Options File Name. $! Define The Linker Options File Name.
$! $!
$ OPT_FILE = "SYS$DISK:[]VAX_DECC_OPTIONS.OPT" $ OPT_FILE = "VAX_DECC_OPTIONS.OPT"
$! $!
$! End DECC Check. $! End DECC Check.
$! $!
@@ -712,14 +883,14 @@ $!
$! Compile Using VAXC. $! Compile Using VAXC.
$! $!
$ CC = "CC" $ CC = "CC"
$ IF ARCH.EQS."AXP" $ IF ARCH.NES."VAX"
$ THEN $ THEN
$ WRITE SYS$OUTPUT "There is no VAX C on Alpha!" $ WRITE SYS$OUTPUT "There is no VAX C on ''ARCH'!"
$ EXIT $ EXIT
$ ENDIF $ ENDIF
$ IF F$TRNLNM("DECC$CC_DEFAULT").EQS."/DECC" THEN CC = "CC/VAXC" $ IF F$TRNLNM("DECC$CC_DEFAULT").EQS."/DECC" THEN CC = "CC/VAXC"
$ CC = CC + "/''CC_OPTIMIZE'/''DEBUGGER'/NOLIST" + - $ CC = CC + "/''CC_OPTIMIZE'/''DEBUGGER'/NOLIST" + -
"/INCLUDE=(SYS$DISK:[-],SYS$DISK:[-.CRYPTO])" + CCEXTRAFLAGS "/INCLUDE=(''CC_INCLUDES')" + CCEXTRAFLAGS
$ CCDEFS = CCDEFS + ",""VAXC""" $ CCDEFS = CCDEFS + ",""VAXC"""
$! $!
$! Define <sys> As SYS$COMMON:[SYSLIB] $! Define <sys> As SYS$COMMON:[SYSLIB]
@@ -728,7 +899,7 @@ $ DEFINE/NOLOG SYS SYS$COMMON:[SYSLIB]
$! $!
$! Define The Linker Options File Name. $! Define The Linker Options File Name.
$! $!
$ OPT_FILE = "SYS$DISK:[]VAX_VAXC_OPTIONS.OPT" $ OPT_FILE = "VAX_VAXC_OPTIONS.OPT"
$! $!
$! End VAXC Check $! End VAXC Check
$! $!
@@ -751,11 +922,11 @@ $! Use GNU C...
$! $!
$ IF F$TYPE(GCC) .EQS. "" THEN GCC := GCC $ IF F$TYPE(GCC) .EQS. "" THEN GCC := GCC
$ CC = GCC+"/NOCASE_HACK/''GCC_OPTIMIZE'/''DEBUGGER'/NOLIST" + - $ CC = GCC+"/NOCASE_HACK/''GCC_OPTIMIZE'/''DEBUGGER'/NOLIST" + -
"/INCLUDE=(SYS$DISK:[-],SYS$DISK:[-.CRYPTO])" + CCEXTRAFLAGS "/INCLUDE=(''CC_INCLUDES')" + CCEXTRAFLAGS
$! $!
$! Define The Linker Options File Name. $! Define The Linker Options File Name.
$! $!
$ OPT_FILE = "SYS$DISK:[]VAX_GNUC_OPTIONS.OPT" $ OPT_FILE = "VAX_GNUC_OPTIONS.OPT"
$! $!
$! End The GNU C Check. $! End The GNU C Check.
$! $!
@@ -765,7 +936,7 @@ $! Set up default defines
$! $!
$ CCDEFS = """FLAT_INC=1""," + CCDEFS $ CCDEFS = """FLAT_INC=1""," + CCDEFS
$! $!
$! Else The User Entered An Invalid Arguement. $! Else The User Entered An Invalid Argument.
$! $!
$ ELSE $ ELSE
$! $!
@@ -797,7 +968,7 @@ $ THEN
$! $!
$! Set the library to use SOCKETSHR $! Set the library to use SOCKETSHR
$! $!
$ TCPIP_LIB = "SYS$DISK:[-.VMS]SOCKETSHR_SHR.OPT/OPT" $ TCPIP_LIB = ",SYS$DISK:[-.VMS]SOCKETSHR_SHR.OPT /OPTIONS"
$! $!
$! Done with SOCKETSHR $! Done with SOCKETSHR
$! $!
@@ -823,13 +994,13 @@ $ THEN
$! $!
$! Set the library to use UCX. $! Set the library to use UCX.
$! $!
$ TCPIP_LIB = "SYS$DISK:[-.VMS]UCX_SHR_DECC.OPT/OPT" $ TCPIP_LIB = ",SYS$DISK:[-.VMS]UCX_SHR_DECC.OPT /OPTIONS"
$ IF F$TRNLNM("UCX$IPC_SHR") .NES. "" $ IF F$TRNLNM("UCX$IPC_SHR") .NES. ""
$ THEN $ THEN
$ TCPIP_LIB = "SYS$DISK:[-.VMS]UCX_SHR_DECC_LOG.OPT/OPT" $ TCPIP_LIB = ",SYS$DISK:[-.VMS]UCX_SHR_DECC_LOG.OPT /OPTIONS"
$ ELSE $ ELSE
$ IF COMPILER .NES. "DECC" .AND. ARCH .EQS. "VAX" THEN - $ IF COMPILER .NES. "DECC" .AND. ARCH .EQS. "VAX" THEN -
TCPIP_LIB = "SYS$DISK:[-.VMS]UCX_SHR_VAXC.OPT/OPT" TCPIP_LIB = ",SYS$DISK:[-.VMS]UCX_SHR_VAXC.OPT /OPTIONS"
$ ENDIF $ ENDIF
$! $!
$! Done with UCX $! Done with UCX
@@ -843,7 +1014,7 @@ $ THEN
$! $!
$! Set the library to use TCPIP. $! Set the library to use TCPIP.
$! $!
$ TCPIP_LIB = "SYS$DISK:[-.VMS]TCPIP_SHR_DECC.OPT/OPT" $ TCPIP_LIB = ",SYS$DISK:[-.VMS]TCPIP_SHR_DECC.OPT /OPTIONS"
$! $!
$! Done with TCPIP $! Done with TCPIP
$! $!
@@ -868,9 +1039,9 @@ $ CCDEFS = CCDEFS + ",TCPIP_TYPE_''P3'"
$! $!
$! Print info $! Print info
$! $!
$ WRITE SYS$OUTPUT "TCP/IP library spec: ", TCPIP_LIB $ WRITE SYS$OUTPUT "TCP/IP library spec: ", TCPIP_LIB- ","
$! $!
$! Else The User Entered An Invalid Arguement. $! Else The User Entered An Invalid Argument.
$! $!
$ ELSE $ ELSE
$! $!
@@ -896,15 +1067,27 @@ $! Finish up the definition of CC.
$! $!
$ IF COMPILER .EQS. "DECC" $ IF COMPILER .EQS. "DECC"
$ THEN $ THEN
$! Not all compiler versions support MAYLOSEDATA3.
$ OPT_TEST = "MAYLOSEDATA3"
$ DEFINE /USER_MODE SYS$ERROR NL:
$ DEFINE /USER_MODE SYS$OUTPUT NL:
$ 'CC' /NOCROSS_REFERENCE /NOLIST /NOOBJECT -
/WARNINGS = DISABLE = ('OPT_TEST', EMPTYFILE) NL:
$ IF ($SEVERITY)
$ THEN
$ IF CCDISABLEWARNINGS .NES. "" THEN -
CCDISABLEWARNINGS = CCDISABLEWARNINGS+ ","
$ CCDISABLEWARNINGS = CCDISABLEWARNINGS+ OPT_TEST
$ ENDIF
$ IF CCDISABLEWARNINGS .NES. "" $ IF CCDISABLEWARNINGS .NES. ""
$ THEN $ THEN
$ CCDISABLEWARNINGS = "/WARNING=(DISABLE=(" + CCDISABLEWARNINGS + "))" $ CCDISABLEWARNINGS = " /WARNING=(DISABLE=(" + CCDISABLEWARNINGS + "))"
$ ENDIF $ ENDIF
$ ELSE $ ELSE
$ CCDISABLEWARNINGS = "" $ CCDISABLEWARNINGS = ""
$ ENDIF $ ENDIF
$ CC2 = CC + "/DEFINE=(" + CCDEFS + ",_POSIX_C_SOURCE)" + CCDISABLEWARNINGS $ CC2 = CC + " /DEFINE=(" + CCDEFS + ",_POSIX_C_SOURCE)" + CCDISABLEWARNINGS
$ CC = CC + "/DEFINE=(" + CCDEFS + ")" + CCDISABLEWARNINGS $ CC = CC + " /DEFINE=(" + CCDEFS + ")" + CCDISABLEWARNINGS
$! $!
$! Show user the result $! Show user the result
$! $!
@@ -970,7 +1153,7 @@ $ __INCLUDE = __TOP + "INCLUDE.OPENSSL]"
$! $!
$! Set up the logical name OPENSSL to point at the include directory $! Set up the logical name OPENSSL to point at the include directory
$! $!
$ DEFINE OPENSSL/NOLOG '__INCLUDE' $ DEFINE OPENSSL /NOLOG '__INCLUDE'
$! $!
$! Done $! Done
$! $!
@@ -978,15 +1161,24 @@ $ RETURN
$! $!
$ CLEANUP: $ CLEANUP:
$! $!
$! Restore the logical name OPENSSL if it had a value $! Restore the saved logical name OPENSSL, if it had a value.
$! $!
$ IF __SAVE_OPENSSL .EQS. "" $ if (f$type( __SAVE_OPENSSL) .nes. "")
$ THEN $ then
$ DEASSIGN OPENSSL $ IF __SAVE_OPENSSL .EQS. ""
$ ELSE $ THEN
$ DEFINE/NOLOG OPENSSL '__SAVE_OPENSSL' $ DEASSIGN OPENSSL
$ ENDIF $ ELSE
$ DEFINE /NOLOG OPENSSL '__SAVE_OPENSSL'
$ ENDIF
$ endif
$!
$! Close any open files.
$!
$ if (f$trnlnm( "objects", "LNM$PROCESS", 0, "SUPERVISOR") .nes. "") then -
close objects
$! $!
$! Done $! Done
$! $!
$ RETURN $ RETURN
$!

View File

@@ -62,6 +62,8 @@
on OpenVMS */ on OpenVMS */
#endif #endif
#define USE_SOCKETS
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
@@ -73,6 +75,7 @@
#include <openssl/ssl.h> #include <openssl/ssl.h>
#include <openssl/evp.h> #include <openssl/evp.h>
#include <openssl/bn.h> #include <openssl/bn.h>
#include <openssl/x509v3.h>
#if defined(NETWARE_CLIB) #if defined(NETWARE_CLIB)
# ifdef NETWARE_BSDSOCK # ifdef NETWARE_BSDSOCK
@@ -97,7 +100,7 @@ static int add_ocsp_cert(OCSP_REQUEST **req, X509 *cert, const EVP_MD *cert_id_m
static int add_ocsp_serial(OCSP_REQUEST **req, char *serial, const EVP_MD * cert_id_md, X509 *issuer, static int add_ocsp_serial(OCSP_REQUEST **req, char *serial, const EVP_MD * cert_id_md, X509 *issuer,
STACK_OF(OCSP_CERTID) *ids); STACK_OF(OCSP_CERTID) *ids);
static int print_ocsp_summary(BIO *out, OCSP_BASICRESP *bs, OCSP_REQUEST *req, static int print_ocsp_summary(BIO *out, OCSP_BASICRESP *bs, OCSP_REQUEST *req,
STACK_OF(STRING) *names, STACK_OF(OPENSSL_STRING) *names,
STACK_OF(OCSP_CERTID) *ids, long nsec, STACK_OF(OCSP_CERTID) *ids, long nsec,
long maxage); long maxage);
@@ -111,6 +114,7 @@ static BIO *init_responder(char *port);
static int do_responder(OCSP_REQUEST **preq, BIO **pcbio, BIO *acbio, 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); static int send_ocsp_response(BIO *cbio, OCSP_RESPONSE *resp);
static OCSP_RESPONSE *query_responder(BIO *err, BIO *cbio, char *path, static OCSP_RESPONSE *query_responder(BIO *err, BIO *cbio, char *path,
STACK_OF(CONF_VALUE) *headers,
OCSP_REQUEST *req, int req_timeout); OCSP_REQUEST *req, int req_timeout);
#undef PROG #undef PROG
@@ -123,12 +127,14 @@ int MAIN(int argc, char **argv)
ENGINE *e = NULL; ENGINE *e = NULL;
char **args; char **args;
char *host = NULL, *port = NULL, *path = "/"; char *host = NULL, *port = NULL, *path = "/";
char *thost = NULL, *tport = NULL, *tpath = NULL;
char *reqin = NULL, *respin = NULL; char *reqin = NULL, *respin = NULL;
char *reqout = NULL, *respout = NULL; char *reqout = NULL, *respout = NULL;
char *signfile = NULL, *keyfile = NULL; char *signfile = NULL, *keyfile = NULL;
char *rsignfile = NULL, *rkeyfile = NULL; char *rsignfile = NULL, *rkeyfile = NULL;
char *outfile = NULL; char *outfile = NULL;
int add_nonce = 1, noverify = 0, use_ssl = -1; int add_nonce = 1, noverify = 0, use_ssl = -1;
STACK_OF(CONF_VALUE) *headers = NULL;
OCSP_REQUEST *req = NULL; OCSP_REQUEST *req = NULL;
OCSP_RESPONSE *resp = NULL; OCSP_RESPONSE *resp = NULL;
OCSP_BASICRESP *bs = NULL; OCSP_BASICRESP *bs = NULL;
@@ -151,7 +157,7 @@ int MAIN(int argc, char **argv)
int badarg = 0; int badarg = 0;
int i; int i;
int ignore_err = 0; int ignore_err = 0;
STACK_OF(STRING) *reqnames = NULL; STACK_OF(OPENSSL_STRING) *reqnames = NULL;
STACK_OF(OCSP_CERTID) *ids = NULL; STACK_OF(OCSP_CERTID) *ids = NULL;
X509 *rca_cert = NULL; X509 *rca_cert = NULL;
@@ -168,7 +174,7 @@ int MAIN(int argc, char **argv)
SSL_load_error_strings(); SSL_load_error_strings();
OpenSSL_add_ssl_algorithms(); OpenSSL_add_ssl_algorithms();
args = argv + 1; args = argv + 1;
reqnames = sk_STRING_new_null(); reqnames = sk_OPENSSL_STRING_new_null();
ids = sk_OCSP_CERTID_new_null(); ids = sk_OCSP_CERTID_new_null();
while (!badarg && *args && *args[0] == '-') while (!badarg && *args && *args[0] == '-')
{ {
@@ -199,6 +205,12 @@ int MAIN(int argc, char **argv)
} }
else if (!strcmp(*args, "-url")) else if (!strcmp(*args, "-url"))
{ {
if (thost)
OPENSSL_free(thost);
if (tport)
OPENSSL_free(tport);
if (tpath)
OPENSSL_free(tpath);
if (args[1]) if (args[1])
{ {
args++; args++;
@@ -207,6 +219,9 @@ int MAIN(int argc, char **argv)
BIO_printf(bio_err, "Error parsing URL\n"); BIO_printf(bio_err, "Error parsing URL\n");
badarg = 1; badarg = 1;
} }
thost = host;
tport = port;
tpath = path;
} }
else badarg = 1; else badarg = 1;
} }
@@ -228,6 +243,16 @@ int MAIN(int argc, char **argv)
} }
else badarg = 1; else badarg = 1;
} }
else if (!strcmp(*args, "-header"))
{
if (args[1] && args[2])
{
if (!X509V3_add_value(args[1], args[2], &headers))
goto end;
args += 2;
}
else badarg = 1;
}
else if (!strcmp(*args, "-ignore_err")) else if (!strcmp(*args, "-ignore_err"))
ignore_err = 1; ignore_err = 1;
else if (!strcmp(*args, "-noverify")) else if (!strcmp(*args, "-noverify"))
@@ -430,7 +455,7 @@ int MAIN(int argc, char **argv)
if (!cert_id_md) cert_id_md = EVP_sha1(); if (!cert_id_md) cert_id_md = EVP_sha1();
if(!add_ocsp_cert(&req, cert, cert_id_md, issuer, ids)) if(!add_ocsp_cert(&req, cert, cert_id_md, issuer, ids))
goto end; goto end;
if(!sk_STRING_push(reqnames, *args)) if(!sk_OPENSSL_STRING_push(reqnames, *args))
goto end; goto end;
} }
else badarg = 1; else badarg = 1;
@@ -443,7 +468,7 @@ int MAIN(int argc, char **argv)
if (!cert_id_md) cert_id_md = EVP_sha1(); if (!cert_id_md) cert_id_md = EVP_sha1();
if(!add_ocsp_serial(&req, *args, cert_id_md, issuer, ids)) if(!add_ocsp_serial(&req, *args, cert_id_md, issuer, ids))
goto end; goto end;
if(!sk_STRING_push(reqnames, *args)) if(!sk_OPENSSL_STRING_push(reqnames, *args))
goto end; goto end;
} }
else badarg = 1; else badarg = 1;
@@ -558,51 +583,52 @@ int MAIN(int argc, char **argv)
BIO_printf (bio_err, "OCSP utility\n"); BIO_printf (bio_err, "OCSP utility\n");
BIO_printf (bio_err, "Usage ocsp [options]\n"); BIO_printf (bio_err, "Usage ocsp [options]\n");
BIO_printf (bio_err, "where options are\n"); BIO_printf (bio_err, "where options are\n");
BIO_printf (bio_err, "-out file output filename\n"); BIO_printf (bio_err, "-out file output filename\n");
BIO_printf (bio_err, "-issuer file issuer certificate\n"); BIO_printf (bio_err, "-issuer file issuer certificate\n");
BIO_printf (bio_err, "-cert file certificate to check\n"); BIO_printf (bio_err, "-cert file certificate to check\n");
BIO_printf (bio_err, "-serial n serial number to check\n"); BIO_printf (bio_err, "-serial n serial number to check\n");
BIO_printf (bio_err, "-signer file certificate to sign OCSP request with\n"); BIO_printf (bio_err, "-signer file certificate to sign OCSP request with\n");
BIO_printf (bio_err, "-signkey file private key to sign OCSP request with\n"); BIO_printf (bio_err, "-signkey file private key to sign OCSP request with\n");
BIO_printf (bio_err, "-sign_other file additional certificates to include in signed request\n"); BIO_printf (bio_err, "-sign_other file additional certificates to include in signed request\n");
BIO_printf (bio_err, "-no_certs don't include any certificates in signed request\n"); BIO_printf (bio_err, "-no_certs don't include any certificates in signed request\n");
BIO_printf (bio_err, "-req_text print text form of request\n"); BIO_printf (bio_err, "-req_text print text form of request\n");
BIO_printf (bio_err, "-resp_text print text form of response\n"); BIO_printf (bio_err, "-resp_text print text form of response\n");
BIO_printf (bio_err, "-text print text form of request and response\n"); BIO_printf (bio_err, "-text print text form of request and response\n");
BIO_printf (bio_err, "-reqout file write DER encoded OCSP request to \"file\"\n"); BIO_printf (bio_err, "-reqout file write DER encoded OCSP request to \"file\"\n");
BIO_printf (bio_err, "-respout file write DER encoded OCSP reponse to \"file\"\n"); BIO_printf (bio_err, "-respout file write DER encoded OCSP reponse to \"file\"\n");
BIO_printf (bio_err, "-reqin file read DER encoded OCSP request from \"file\"\n"); BIO_printf (bio_err, "-reqin file read DER encoded OCSP request from \"file\"\n");
BIO_printf (bio_err, "-respin file read DER encoded OCSP reponse from \"file\"\n"); BIO_printf (bio_err, "-respin file read DER encoded OCSP reponse from \"file\"\n");
BIO_printf (bio_err, "-nonce add OCSP nonce to request\n"); BIO_printf (bio_err, "-nonce add OCSP nonce to request\n");
BIO_printf (bio_err, "-no_nonce don't add OCSP nonce to request\n"); BIO_printf (bio_err, "-no_nonce don't add OCSP nonce to request\n");
BIO_printf (bio_err, "-url URL OCSP responder URL\n"); BIO_printf (bio_err, "-url URL OCSP responder URL\n");
BIO_printf (bio_err, "-host host:n send OCSP request to host on port n\n"); BIO_printf (bio_err, "-host host:n send OCSP request to host on port n\n");
BIO_printf (bio_err, "-path path to use in OCSP request\n"); BIO_printf (bio_err, "-path path to use in OCSP request\n");
BIO_printf (bio_err, "-CApath dir trusted certificates directory\n"); BIO_printf (bio_err, "-CApath dir trusted certificates directory\n");
BIO_printf (bio_err, "-CAfile file trusted certificates file\n"); BIO_printf (bio_err, "-CAfile file trusted certificates file\n");
BIO_printf (bio_err, "-VAfile file validator certificates file\n"); BIO_printf (bio_err, "-VAfile file validator certificates file\n");
BIO_printf (bio_err, "-validity_period n maximum validity discrepancy in seconds\n"); BIO_printf (bio_err, "-validity_period n maximum validity discrepancy in seconds\n");
BIO_printf (bio_err, "-status_age n maximum status age in seconds\n"); BIO_printf (bio_err, "-status_age n maximum status age in seconds\n");
BIO_printf (bio_err, "-noverify don't verify response at all\n"); BIO_printf (bio_err, "-noverify don't verify response at all\n");
BIO_printf (bio_err, "-verify_other file additional certificates to search for signer\n"); BIO_printf (bio_err, "-verify_other file additional certificates to search for signer\n");
BIO_printf (bio_err, "-trust_other don't verify additional certificates\n"); BIO_printf (bio_err, "-trust_other don't verify additional certificates\n");
BIO_printf (bio_err, "-no_intern don't search certificates contained in response for signer\n"); BIO_printf (bio_err, "-no_intern don't search certificates contained in response for signer\n");
BIO_printf (bio_err, "-no_signature_verify don't check signature on response\n"); BIO_printf (bio_err, "-no_signature_verify don't check signature on response\n");
BIO_printf (bio_err, "-no_cert_verify don't check signing certificate\n"); BIO_printf (bio_err, "-no_cert_verify don't check signing certificate\n");
BIO_printf (bio_err, "-no_chain don't chain verify response\n"); BIO_printf (bio_err, "-no_chain don't chain verify response\n");
BIO_printf (bio_err, "-no_cert_checks don't do additional checks on signing certificate\n"); BIO_printf (bio_err, "-no_cert_checks don't do additional checks on signing certificate\n");
BIO_printf (bio_err, "-port num port to run responder on\n"); BIO_printf (bio_err, "-port num port to run responder on\n");
BIO_printf (bio_err, "-index file certificate status index file\n"); BIO_printf (bio_err, "-index file certificate status index file\n");
BIO_printf (bio_err, "-CA file CA certificate\n"); BIO_printf (bio_err, "-CA file CA certificate\n");
BIO_printf (bio_err, "-rsigner file responder certificate to sign responses with\n"); BIO_printf (bio_err, "-rsigner file responder certificate to sign responses with\n");
BIO_printf (bio_err, "-rkey file responder key to sign responses with\n"); BIO_printf (bio_err, "-rkey file responder key to sign responses with\n");
BIO_printf (bio_err, "-rother file other certificates to include in response\n"); BIO_printf (bio_err, "-rother file other certificates to include in response\n");
BIO_printf (bio_err, "-resp_no_certs don't include any certificates in response\n"); BIO_printf (bio_err, "-resp_no_certs don't include any certificates in response\n");
BIO_printf (bio_err, "-nmin n number of minutes before next update\n"); BIO_printf (bio_err, "-nmin n number of minutes before next update\n");
BIO_printf (bio_err, "-ndays n number of days before next update\n"); BIO_printf (bio_err, "-ndays n number of days before next update\n");
BIO_printf (bio_err, "-resp_key_id identify reponse by signing certificate key ID\n"); BIO_printf (bio_err, "-resp_key_id identify reponse by signing certificate key ID\n");
BIO_printf (bio_err, "-nrequest n number of requests to accept (default unlimited)\n"); BIO_printf (bio_err, "-nrequest n number of requests to accept (default unlimited)\n");
BIO_printf (bio_err, "-<dgst alg> use specified digest in the request"); BIO_printf (bio_err, "-<dgst alg> use specified digest in the request\n");
BIO_printf (bio_err, "-timeout n timeout connection to OCSP responder after n seconds\n");
goto end; goto end;
} }
@@ -754,7 +780,7 @@ int MAIN(int argc, char **argv)
{ {
#ifndef OPENSSL_NO_SOCK #ifndef OPENSSL_NO_SOCK
resp = process_responder(bio_err, req, host, path, resp = process_responder(bio_err, req, host, path,
port, use_ssl, req_timeout); port, use_ssl, headers, req_timeout);
if (!resp) if (!resp)
goto end; goto end;
#else #else
@@ -899,17 +925,18 @@ end:
OCSP_REQUEST_free(req); OCSP_REQUEST_free(req);
OCSP_RESPONSE_free(resp); OCSP_RESPONSE_free(resp);
OCSP_BASICRESP_free(bs); OCSP_BASICRESP_free(bs);
sk_STRING_free(reqnames); sk_OPENSSL_STRING_free(reqnames);
sk_OCSP_CERTID_free(ids); sk_OCSP_CERTID_free(ids);
sk_X509_pop_free(sign_other, X509_free); sk_X509_pop_free(sign_other, X509_free);
sk_X509_pop_free(verify_other, X509_free); sk_X509_pop_free(verify_other, X509_free);
sk_CONF_VALUE_pop_free(headers, X509V3_conf_free);
if (use_ssl != -1) if (thost)
{ OPENSSL_free(thost);
OPENSSL_free(host); if (tport)
OPENSSL_free(port); OPENSSL_free(tport);
OPENSSL_free(path); if (tpath)
} OPENSSL_free(tpath);
OPENSSL_EXIT(ret); OPENSSL_EXIT(ret);
} }
@@ -969,7 +996,7 @@ static int add_ocsp_serial(OCSP_REQUEST **req, char *serial,const EVP_MD *cert_i
} }
static int print_ocsp_summary(BIO *out, OCSP_BASICRESP *bs, OCSP_REQUEST *req, static int print_ocsp_summary(BIO *out, OCSP_BASICRESP *bs, OCSP_REQUEST *req,
STACK_OF(STRING) *names, STACK_OF(OPENSSL_STRING) *names,
STACK_OF(OCSP_CERTID) *ids, long nsec, STACK_OF(OCSP_CERTID) *ids, long nsec,
long maxage) long maxage)
{ {
@@ -981,13 +1008,13 @@ static int print_ocsp_summary(BIO *out, OCSP_BASICRESP *bs, OCSP_REQUEST *req,
ASN1_GENERALIZEDTIME *rev, *thisupd, *nextupd; ASN1_GENERALIZEDTIME *rev, *thisupd, *nextupd;
if (!bs || !req || !sk_STRING_num(names) || !sk_OCSP_CERTID_num(ids)) if (!bs || !req || !sk_OPENSSL_STRING_num(names) || !sk_OCSP_CERTID_num(ids))
return 1; return 1;
for (i = 0; i < sk_OCSP_CERTID_num(ids); i++) for (i = 0; i < sk_OCSP_CERTID_num(ids); i++)
{ {
id = sk_OCSP_CERTID_value(ids, i); id = sk_OCSP_CERTID_value(ids, i);
name = sk_STRING_value(names, i); name = sk_OPENSSL_STRING_value(names, i);
BIO_printf(out, "%s: ", name); BIO_printf(out, "%s: ", name);
if(!OCSP_resp_find_status(bs, id, &status, &reason, if(!OCSP_resp_find_status(bs, id, &status, &reason,
@@ -1258,10 +1285,12 @@ static int send_ocsp_response(BIO *cbio, OCSP_RESPONSE *resp)
} }
static OCSP_RESPONSE *query_responder(BIO *err, BIO *cbio, char *path, static OCSP_RESPONSE *query_responder(BIO *err, BIO *cbio, char *path,
STACK_OF(CONF_VALUE) *headers,
OCSP_REQUEST *req, int req_timeout) OCSP_REQUEST *req, int req_timeout)
{ {
int fd; int fd;
int rv; int rv;
int i;
OCSP_REQ_CTX *ctx = NULL; OCSP_REQ_CTX *ctx = NULL;
OCSP_RESPONSE *rsp = NULL; OCSP_RESPONSE *rsp = NULL;
fd_set confds; fd_set confds;
@@ -1278,16 +1307,13 @@ static OCSP_RESPONSE *query_responder(BIO *err, BIO *cbio, char *path,
return NULL; return NULL;
} }
if (req_timeout == -1)
return OCSP_sendreq_bio(cbio, path, req);
if (BIO_get_fd(cbio, &fd) <= 0) if (BIO_get_fd(cbio, &fd) <= 0)
{ {
BIO_puts(err, "Can't get connection fd\n"); BIO_puts(err, "Can't get connection fd\n");
goto err; goto err;
} }
if (rv <= 0) if (req_timeout != -1 && rv <= 0)
{ {
FD_ZERO(&confds); FD_ZERO(&confds);
openssl_fdset(fd, &confds); openssl_fdset(fd, &confds);
@@ -1302,15 +1328,27 @@ static OCSP_RESPONSE *query_responder(BIO *err, BIO *cbio, char *path,
} }
ctx = OCSP_sendreq_new(cbio, path, req, -1); ctx = OCSP_sendreq_new(cbio, path, NULL, -1);
if (!ctx) if (!ctx)
return NULL; return NULL;
for (i = 0; i < sk_CONF_VALUE_num(headers); i++)
{
CONF_VALUE *hdr = sk_CONF_VALUE_value(headers, i);
if (!OCSP_REQ_CTX_add1_header(ctx, hdr->name, hdr->value))
goto err;
}
if (!OCSP_REQ_CTX_set1_req(ctx, req))
goto err;
for (;;) for (;;)
{ {
rv = OCSP_sendreq_nbio(&rsp, ctx); rv = OCSP_sendreq_nbio(&rsp, ctx);
if (rv != -1) if (rv != -1)
break; break;
if (req_timeout == -1)
continue;
FD_ZERO(&confds); FD_ZERO(&confds);
openssl_fdset(fd, &confds); openssl_fdset(fd, &confds);
tv.tv_usec = 0; tv.tv_usec = 0;
@@ -1334,7 +1372,7 @@ static OCSP_RESPONSE *query_responder(BIO *err, BIO *cbio, char *path,
BIO_puts(err, "Select error\n"); BIO_puts(err, "Select error\n");
break; break;
} }
} }
err: err:
if (ctx) if (ctx)
@@ -1345,6 +1383,7 @@ static OCSP_RESPONSE *query_responder(BIO *err, BIO *cbio, char *path,
OCSP_RESPONSE *process_responder(BIO *err, OCSP_REQUEST *req, OCSP_RESPONSE *process_responder(BIO *err, OCSP_REQUEST *req,
char *host, char *path, char *port, int use_ssl, char *host, char *path, char *port, int use_ssl,
STACK_OF(CONF_VALUE) *headers,
int req_timeout) int req_timeout)
{ {
BIO *cbio = NULL; BIO *cbio = NULL;
@@ -1379,14 +1418,14 @@ OCSP_RESPONSE *process_responder(BIO *err, OCSP_REQUEST *req,
sbio = BIO_new_ssl(ctx, 1); sbio = BIO_new_ssl(ctx, 1);
cbio = BIO_push(sbio, cbio); cbio = BIO_push(sbio, cbio);
} }
resp = query_responder(err, cbio, path, req, req_timeout); resp = query_responder(err, cbio, path, headers, req, req_timeout);
if (!resp) if (!resp)
BIO_printf(bio_err, "Error querying OCSP responsder\n"); BIO_printf(bio_err, "Error querying OCSP responder\n");
end: end:
if (ctx)
SSL_CTX_free(ctx);
if (cbio) if (cbio)
BIO_free_all(cbio); BIO_free_all(cbio);
if (ctx)
SSL_CTX_free(ctx);
return resp; return resp;
} }

View File

@@ -145,7 +145,7 @@ localityName = Locality Name (eg, city)
organizationalUnitName = Organizational Unit Name (eg, section) organizationalUnitName = Organizational Unit Name (eg, section)
#organizationalUnitName_default = #organizationalUnitName_default =
commonName = Common Name (eg, YOUR name) commonName = Common Name (e.g. server FQDN or YOUR name)
commonName_max = 64 commonName_max = 64
emailAddress = Email Address emailAddress = Email Address
@@ -231,7 +231,7 @@ keyUsage = nonRepudiation, digitalSignature, keyEncipherment
subjectKeyIdentifier=hash subjectKeyIdentifier=hash
authorityKeyIdentifier=keyid:always,issuer:always authorityKeyIdentifier=keyid:always,issuer
# This is what PKIX recommends but some broken software chokes on critical # This is what PKIX recommends but some broken software chokes on critical
# extensions. # extensions.
@@ -264,7 +264,7 @@ basicConstraints = CA:true
# Only issuerAltName and authorityKeyIdentifier make any sense in a CRL. # Only issuerAltName and authorityKeyIdentifier make any sense in a CRL.
# issuerAltName=issuer:copy # issuerAltName=issuer:copy
authorityKeyIdentifier=keyid:always,issuer:always authorityKeyIdentifier=keyid:always
[ proxy_cert_ext ] [ proxy_cert_ext ]
# These extensions should be added when creating a proxy certificate # These extensions should be added when creating a proxy certificate
@@ -297,7 +297,7 @@ nsComment = "OpenSSL Generated Certificate"
# PKIX recommendations harmless if included in all certificates. # PKIX recommendations harmless if included in all certificates.
subjectKeyIdentifier=hash subjectKeyIdentifier=hash
authorityKeyIdentifier=keyid,issuer:always authorityKeyIdentifier=keyid,issuer
# This stuff is for subjectAltName and issuerAltname. # This stuff is for subjectAltName and issuerAltname.
# Import the email address. # Import the email address.

View File

@@ -212,8 +212,13 @@ static void lock_dbg_cb(int mode, int type, const char *file, int line)
} }
} }
#if defined( OPENSSL_SYS_VMS) && (__INITIAL_POINTER_SIZE == 64)
# define ARGV _Argv
#else
# define ARGV Argv
#endif
int main(int Argc, char *Argv[]) int main(int Argc, char *ARGV[])
{ {
ARGS arg; ARGS arg;
#define PROG_NAME_SIZE 39 #define PROG_NAME_SIZE 39
@@ -227,7 +232,55 @@ int main(int Argc, char *Argv[])
char **argv,*p; char **argv,*p;
LHASH_OF(FUNCTION) *prog=NULL; LHASH_OF(FUNCTION) *prog=NULL;
long errline; long errline;
#if defined( OPENSSL_SYS_VMS) && (__INITIAL_POINTER_SIZE == 64)
/* 2011-03-22 SMS.
* If we have 32-bit pointers everywhere, then we're safe, and
* we bypass this mess, as on non-VMS systems. (See ARGV,
* above.)
* Problem 1: Compaq/HP C before V7.3 always used 32-bit
* pointers for argv[].
* Fix 1: For a 32-bit argv[], when we're using 64-bit pointers
* everywhere else, we always allocate and use a 64-bit
* duplicate of argv[].
* Problem 2: Compaq/HP C V7.3 (Alpha, IA64) before ECO1 failed
* to NULL-terminate a 64-bit argv[]. (As this was written, the
* compiler ECO was available only on IA64.)
* Fix 2: Unless advised not to (VMS_TRUST_ARGV), we test a
* 64-bit argv[argc] for NULL, and, if necessary, use a
* (properly) NULL-terminated (64-bit) duplicate of argv[].
* The same code is used in either case to duplicate argv[].
* Some of these decisions could be handled in preprocessing,
* but the code tends to get even uglier, and the penalty for
* deciding at compile- or run-time is tiny.
*/
char **Argv = NULL;
int free_Argv = 0;
if ((sizeof( _Argv) < 8) /* 32-bit argv[]. */
# if !defined( VMS_TRUST_ARGV)
|| (_Argv[ Argc] != NULL) /* Untrusted argv[argc] not NULL. */
# endif
)
{
int i;
Argv = OPENSSL_malloc( (Argc+ 1)* sizeof( char *));
if (Argv == NULL)
{ ret = -1; goto end; }
for(i = 0; i < Argc; i++)
Argv[i] = _Argv[i];
Argv[ Argc] = NULL; /* Certain NULL termination. */
free_Argv = 1;
}
else
{
/* Use the known-good 32-bit argv[] (which needs the
* type cast to satisfy the compiler), or the trusted or
* tested-good 64-bit argv[] as-is. */
Argv = (char **)_Argv;
}
#endif /* defined( OPENSSL_SYS_VMS) && (__INITIAL_POINTER_SIZE == 64) */
arg.data=NULL; arg.data=NULL;
arg.count=0; arg.count=0;
@@ -330,7 +383,8 @@ int main(int Argc, char *Argv[])
else prompt="OpenSSL> "; else prompt="OpenSSL> ";
fputs(prompt,stdout); fputs(prompt,stdout);
fflush(stdout); fflush(stdout);
fgets(p,n,stdin); if (!fgets(p,n,stdin))
goto end;
if (p[0] == '\0') goto end; if (p[0] == '\0') goto end;
i=strlen(p); i=strlen(p);
if (i <= 1) break; if (i <= 1) break;
@@ -372,6 +426,13 @@ end:
BIO_free(bio_err); BIO_free(bio_err);
bio_err=NULL; bio_err=NULL;
} }
#if defined( OPENSSL_SYS_VMS) && (__INITIAL_POINTER_SIZE == 64)
/* Free any duplicate Argv[] storage. */
if (free_Argv)
{
OPENSSL_free(Argv);
}
#endif
OPENSSL_EXIT(ret); OPENSSL_EXIT(ret);
} }

View File

@@ -145,7 +145,7 @@ localityName = Locality Name (eg, city)
organizationalUnitName = Organizational Unit Name (eg, section) organizationalUnitName = Organizational Unit Name (eg, section)
#organizationalUnitName_default = #organizationalUnitName_default =
commonName = Common Name (eg, YOUR name) commonName = Common Name (e.g. server FQDN or YOUR name)
commonName_max = 64 commonName_max = 64
emailAddress = Email Address emailAddress = Email Address
@@ -231,7 +231,7 @@ keyUsage = nonRepudiation, digitalSignature, keyEncipherment
subjectKeyIdentifier=hash subjectKeyIdentifier=hash
authorityKeyIdentifier=keyid:always,issuer:always authorityKeyIdentifier=keyid:always,issuer
# This is what PKIX recommends but some broken software chokes on critical # This is what PKIX recommends but some broken software chokes on critical
# extensions. # extensions.
@@ -264,7 +264,7 @@ basicConstraints = CA:true
# Only issuerAltName and authorityKeyIdentifier make any sense in a CRL. # Only issuerAltName and authorityKeyIdentifier make any sense in a CRL.
# issuerAltName=issuer:copy # issuerAltName=issuer:copy
authorityKeyIdentifier=keyid:always,issuer:always authorityKeyIdentifier=keyid:always
[ proxy_cert_ext ] [ proxy_cert_ext ]
# These extensions should be added when creating a proxy certificate # These extensions should be added when creating a proxy certificate
@@ -297,7 +297,7 @@ nsComment = "OpenSSL Generated Certificate"
# PKIX recommendations harmless if included in all certificates. # PKIX recommendations harmless if included in all certificates.
subjectKeyIdentifier=hash subjectKeyIdentifier=hash
authorityKeyIdentifier=keyid,issuer:always authorityKeyIdentifier=keyid,issuer
# This stuff is for subjectAltName and issuerAltname. # This stuff is for subjectAltName and issuerAltname.
# Import the email address. # Import the email address.

View File

@@ -117,7 +117,7 @@ int MAIN(int argc, char **argv)
int ret = 1; int ret = 1;
int macver = 1; int macver = 1;
int noprompt = 0; int noprompt = 0;
STACK_OF(STRING) *canames = NULL; STACK_OF(OPENSSL_STRING) *canames = NULL;
char *cpass = NULL, *mpass = NULL; char *cpass = NULL, *mpass = NULL;
char *passargin = NULL, *passargout = NULL, *passarg = NULL; char *passargin = NULL, *passargout = NULL, *passarg = NULL;
char *passin = NULL, *passout = NULL; char *passin = NULL, *passout = NULL;
@@ -222,8 +222,8 @@ int MAIN(int argc, char **argv)
} else if (!strcmp (*args, "-caname")) { } else if (!strcmp (*args, "-caname")) {
if (args[1]) { if (args[1]) {
args++; args++;
if (!canames) canames = sk_STRING_new_null(); if (!canames) canames = sk_OPENSSL_STRING_new_null();
sk_STRING_push(canames, *args); sk_OPENSSL_STRING_push(canames, *args);
} else badarg = 1; } else badarg = 1;
} else if (!strcmp (*args, "-in")) { } else if (!strcmp (*args, "-in")) {
if (args[1]) { if (args[1]) {
@@ -549,9 +549,9 @@ int MAIN(int argc, char **argv)
/* Add any CA names */ /* Add any CA names */
for (i = 0; i < sk_STRING_num(canames); i++) for (i = 0; i < sk_OPENSSL_STRING_num(canames); i++)
{ {
catmp = (unsigned char *)sk_STRING_value(canames, i); catmp = (unsigned char *)sk_OPENSSL_STRING_value(canames, i);
X509_alias_set1(sk_X509_value(certs, i), catmp, -1); X509_alias_set1(sk_X509_value(certs, i), catmp, -1);
} }
@@ -647,7 +647,7 @@ int MAIN(int argc, char **argv)
if (!twopass) BUF_strlcpy(macpass, pass, sizeof macpass); 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 ((options & INFO) && p12->mac) BIO_printf (bio_err, "MAC Iteration %ld\n", p12->mac->iter ? ASN1_INTEGER_get (p12->mac->iter) : 1);
if(macver) { if(macver) {
#ifdef CRYPTO_MDEBUG #ifdef CRYPTO_MDEBUG
CRYPTO_push_info("verify MAC"); CRYPTO_push_info("verify MAC");
@@ -687,7 +687,7 @@ int MAIN(int argc, char **argv)
#endif #endif
BIO_free(in); BIO_free(in);
BIO_free_all(out); BIO_free_all(out);
if (canames) sk_STRING_free(canames); if (canames) sk_OPENSSL_STRING_free(canames);
if(passin) OPENSSL_free(passin); if(passin) OPENSSL_free(passin);
if(passout) OPENSSL_free(passout); if(passout) OPENSSL_free(passout);
apps_shutdown(); apps_shutdown();
@@ -923,7 +923,7 @@ int print_attribs (BIO *out, STACK_OF(X509_ATTRIBUTE) *attrlst,const char *name)
av = sk_ASN1_TYPE_value(attr->value.set, 0); av = sk_ASN1_TYPE_value(attr->value.set, 0);
switch(av->type) { switch(av->type) {
case V_ASN1_BMPSTRING: case V_ASN1_BMPSTRING:
value = uni2asc(av->value.bmpstring->data, value = OPENSSL_uni2asc(av->value.bmpstring->data,
av->value.bmpstring->length); av->value.bmpstring->length);
BIO_printf(out, "%s\n", value); BIO_printf(out, "%s\n", value);
OPENSSL_free(value); OPENSSL_free(value);

View File

@@ -82,9 +82,6 @@ int MAIN(int, char **);
int MAIN(int argc, char **argv) int MAIN(int argc, char **argv)
{ {
#ifndef OPENSSL_NO_ENGINE
ENGINE *e = NULL;
#endif
PKCS7 *p7=NULL; PKCS7 *p7=NULL;
int i,badops=0; int i,badops=0;
BIO *in=NULL,*out=NULL; BIO *in=NULL,*out=NULL;
@@ -182,7 +179,7 @@ bad:
ERR_load_crypto_strings(); ERR_load_crypto_strings();
#ifndef OPENSSL_NO_ENGINE #ifndef OPENSSL_NO_ENGINE
e = setup_engine(bio_err, engine, 0); setup_engine(bio_err, engine, 0);
#endif #endif
in=BIO_new(BIO_s_file()); in=BIO_new(BIO_s_file());

View File

@@ -275,7 +275,6 @@ int MAIN(int argc, char **argv)
} }
if (topk8) if (topk8)
{ {
BIO_free(in); /* Not needed in this section */
pkey = load_key(bio_err, infile, informat, 1, pkey = load_key(bio_err, infile, informat, 1,
passin, e, "key"); passin, e, "key");
if (!pkey) if (!pkey)
@@ -404,6 +403,10 @@ int MAIN(int argc, char **argv)
BIO_printf(bio_err, "DSA public key include in PrivateKey\n"); BIO_printf(bio_err, "DSA public key include in PrivateKey\n");
break; break;
case PKCS8_NEG_PRIVKEY:
BIO_printf(bio_err, "DSA private key value is negative\n");
break;
default: default:
BIO_printf(bio_err, "Unknown broken type\n"); BIO_printf(bio_err, "Unknown broken type\n");
break; break;

View File

@@ -74,7 +74,6 @@ int MAIN(int argc, char **argv)
EVP_PKEY *pkey=NULL; EVP_PKEY *pkey=NULL;
int badarg = 0; int badarg = 0;
#ifndef OPENSSL_NO_ENGINE #ifndef OPENSSL_NO_ENGINE
ENGINE *e = NULL;
char *engine=NULL; char *engine=NULL;
#endif #endif
int ret = 1; int ret = 1;
@@ -141,7 +140,7 @@ int MAIN(int argc, char **argv)
} }
#ifndef OPENSSL_NO_ENGINE #ifndef OPENSSL_NO_ENGINE
e = setup_engine(bio_err, engine, 0); setup_engine(bio_err, engine, 0);
#endif #endif
if (infile) if (infile)
@@ -179,7 +178,7 @@ int MAIN(int argc, char **argv)
pkey = PEM_read_bio_Parameters(in, NULL); pkey = PEM_read_bio_Parameters(in, NULL);
if (!pkey) if (!pkey)
{ {
BIO_printf(bio_err, "Error reading paramters\n"); BIO_printf(bio_err, "Error reading parameters\n");
ERR_print_errors(bio_err); ERR_print_errors(bio_err);
goto end; goto end;
} }

View File

@@ -119,17 +119,17 @@ int MAIN(int argc, char **argv)
if (!strcmp(*argv,"-in")) if (!strcmp(*argv,"-in"))
{ {
if (--argc < 1) badarg = 1; if (--argc < 1) badarg = 1;
infile= *(++argv); else infile= *(++argv);
} }
else if (!strcmp(*argv,"-out")) else if (!strcmp(*argv,"-out"))
{ {
if (--argc < 1) badarg = 1; if (--argc < 1) badarg = 1;
outfile= *(++argv); else outfile= *(++argv);
} }
else if (!strcmp(*argv,"-sigfile")) else if (!strcmp(*argv,"-sigfile"))
{ {
if (--argc < 1) badarg = 1; if (--argc < 1) badarg = 1;
sigfile= *(++argv); else sigfile= *(++argv);
} }
else if(!strcmp(*argv, "-inkey")) else if(!strcmp(*argv, "-inkey"))
{ {
@@ -159,17 +159,17 @@ int MAIN(int argc, char **argv)
else if (!strcmp(*argv,"-passin")) else if (!strcmp(*argv,"-passin"))
{ {
if (--argc < 1) badarg = 1; if (--argc < 1) badarg = 1;
passargin= *(++argv); else passargin= *(++argv);
} }
else if (strcmp(*argv,"-peerform") == 0) else if (strcmp(*argv,"-peerform") == 0)
{ {
if (--argc < 1) badarg = 1; if (--argc < 1) badarg = 1;
peerform=str2fmt(*(++argv)); else peerform=str2fmt(*(++argv));
} }
else if (strcmp(*argv,"-keyform") == 0) else if (strcmp(*argv,"-keyform") == 0)
{ {
if (--argc < 1) badarg = 1; if (--argc < 1) badarg = 1;
keyform=str2fmt(*(++argv)); else keyform=str2fmt(*(++argv));
} }
#ifndef OPENSSL_NO_ENGINE #ifndef OPENSSL_NO_ENGINE
else if(!strcmp(*argv, "-engine")) else if(!strcmp(*argv, "-engine"))
@@ -390,7 +390,7 @@ static void usage()
BIO_printf(bio_err, "Usage: pkeyutl [options]\n"); BIO_printf(bio_err, "Usage: pkeyutl [options]\n");
BIO_printf(bio_err, "-in file input file\n"); BIO_printf(bio_err, "-in file input file\n");
BIO_printf(bio_err, "-out file output file\n"); BIO_printf(bio_err, "-out file output file\n");
BIO_printf(bio_err, "-signature file signature file (verify operation only)\n"); BIO_printf(bio_err, "-sigfile file signature file (verify operation only)\n");
BIO_printf(bio_err, "-inkey file input key\n"); BIO_printf(bio_err, "-inkey file input key\n");
BIO_printf(bio_err, "-keyform arg private key format - default PEM\n"); BIO_printf(bio_err, "-keyform arg private key format - default PEM\n");
BIO_printf(bio_err, "-pubin input is a public key\n"); BIO_printf(bio_err, "-pubin input is a public key\n");

View File

@@ -106,16 +106,16 @@ FUNCTION functions[] = {
{FUNC_TYPE_GENERAL,"gendsa",gendsa_main}, {FUNC_TYPE_GENERAL,"gendsa",gendsa_main},
#endif #endif
{FUNC_TYPE_GENERAL,"genpkey",genpkey_main}, {FUNC_TYPE_GENERAL,"genpkey",genpkey_main},
#if !defined(OPENSSL_NO_SOCK) && !(defined(OPENSSL_NO_SSL2) && defined(OPENSSL_NO_SSL3)) #if !defined(OPENSSL_NO_SOCK)
{FUNC_TYPE_GENERAL,"s_server",s_server_main}, {FUNC_TYPE_GENERAL,"s_server",s_server_main},
#endif #endif
#if !defined(OPENSSL_NO_SOCK) && !(defined(OPENSSL_NO_SSL2) && defined(OPENSSL_NO_SSL3)) #if !defined(OPENSSL_NO_SOCK)
{FUNC_TYPE_GENERAL,"s_client",s_client_main}, {FUNC_TYPE_GENERAL,"s_client",s_client_main},
#endif #endif
#ifndef OPENSSL_NO_SPEED #ifndef OPENSSL_NO_SPEED
{FUNC_TYPE_GENERAL,"speed",speed_main}, {FUNC_TYPE_GENERAL,"speed",speed_main},
#endif #endif
#if !defined(OPENSSL_NO_SOCK) && !(defined(OPENSSL_NO_SSL2) && defined(OPENSSL_NO_SSL3)) #if !defined(OPENSSL_NO_SOCK)
{FUNC_TYPE_GENERAL,"s_time",s_time_main}, {FUNC_TYPE_GENERAL,"s_time",s_time_main},
#endif #endif
{FUNC_TYPE_GENERAL,"version",version_main}, {FUNC_TYPE_GENERAL,"version",version_main},
@@ -125,7 +125,7 @@ FUNCTION functions[] = {
#endif #endif
{FUNC_TYPE_GENERAL,"crl2pkcs7",crl2pkcs7_main}, {FUNC_TYPE_GENERAL,"crl2pkcs7",crl2pkcs7_main},
{FUNC_TYPE_GENERAL,"sess_id",sess_id_main}, {FUNC_TYPE_GENERAL,"sess_id",sess_id_main},
#if !defined(OPENSSL_NO_SOCK) && !(defined(OPENSSL_NO_SSL2) && defined(OPENSSL_NO_SSL3)) #if !defined(OPENSSL_NO_SOCK)
{FUNC_TYPE_GENERAL,"ciphers",ciphers_main}, {FUNC_TYPE_GENERAL,"ciphers",ciphers_main},
#endif #endif
{FUNC_TYPE_GENERAL,"nseq",nseq_main}, {FUNC_TYPE_GENERAL,"nseq",nseq_main},
@@ -142,7 +142,9 @@ FUNCTION functions[] = {
#ifndef OPENSSL_NO_ENGINE #ifndef OPENSSL_NO_ENGINE
{FUNC_TYPE_GENERAL,"engine",engine_main}, {FUNC_TYPE_GENERAL,"engine",engine_main},
#endif #endif
#ifndef OPENSSL_NO_OCSP
{FUNC_TYPE_GENERAL,"ocsp",ocsp_main}, {FUNC_TYPE_GENERAL,"ocsp",ocsp_main},
#endif
{FUNC_TYPE_GENERAL,"prime",prime_main}, {FUNC_TYPE_GENERAL,"prime",prime_main},
{FUNC_TYPE_GENERAL,"ts",ts_main}, {FUNC_TYPE_GENERAL,"ts",ts_main},
#ifndef OPENSSL_NO_MD2 #ifndef OPENSSL_NO_MD2

View File

@@ -22,6 +22,7 @@ typedef struct {
const char *name; const char *name;
int (*func)(int argc,char *argv[]); int (*func)(int argc,char *argv[]);
} FUNCTION; } FUNCTION;
DECLARE_LHASH_OF(FUNCTION);
FUNCTION functions[] = { FUNCTION functions[] = {
EOF EOF
@@ -31,7 +32,7 @@ foreach (@ARGV)
push(@files,$_); push(@files,$_);
$str="\t{FUNC_TYPE_GENERAL,\"$_\",${_}_main},\n"; $str="\t{FUNC_TYPE_GENERAL,\"$_\",${_}_main},\n";
if (($_ =~ /^s_/) || ($_ =~ /^ciphers$/)) if (($_ =~ /^s_/) || ($_ =~ /^ciphers$/))
{ print "#if !defined(OPENSSL_NO_SOCK) && !(defined(OPENSSL_NO_SSL2) && defined(OPENSSL_NO_SSL3))\n${str}#endif\n"; } { print "#if !defined(OPENSSL_NO_SOCK)\n${str}#endif\n"; }
elsif ( ($_ =~ /^speed$/)) elsif ( ($_ =~ /^speed$/))
{ print "#ifndef OPENSSL_NO_SPEED\n${str}#endif\n"; } { print "#ifndef OPENSSL_NO_SPEED\n${str}#endif\n"; }
elsif ( ($_ =~ /^engine$/)) elsif ( ($_ =~ /^engine$/))
@@ -48,6 +49,8 @@ foreach (@ARGV)
{ print "#if !defined(OPENSSL_NO_DES) && !defined(OPENSSL_NO_SHA1)\n${str}#endif\n"; } { print "#if !defined(OPENSSL_NO_DES) && !defined(OPENSSL_NO_SHA1)\n${str}#endif\n"; }
elsif ( ($_ =~ /^cms$/)) elsif ( ($_ =~ /^cms$/))
{ print "#ifndef OPENSSL_NO_CMS\n${str}#endif\n"; } { print "#ifndef OPENSSL_NO_CMS\n${str}#endif\n"; }
elsif ( ($_ =~ /^ocsp$/))
{ print "#ifndef OPENSSL_NO_OCSP\n${str}#endif\n"; }
else else
{ print $str; } { print $str; }
} }

View File

@@ -77,9 +77,6 @@ int MAIN(int, char **);
int MAIN(int argc, char **argv) int MAIN(int argc, char **argv)
{ {
#ifndef OPENSSL_NO_ENGINE
ENGINE *e = NULL;
#endif
int i, r, ret = 1; int i, r, ret = 1;
int badopt; int badopt;
char *outfile = NULL; char *outfile = NULL;
@@ -178,7 +175,7 @@ int MAIN(int argc, char **argv)
} }
#ifndef OPENSSL_NO_ENGINE #ifndef OPENSSL_NO_ENGINE
e = setup_engine(bio_err, engine, 0); setup_engine(bio_err, engine, 0);
#endif #endif
app_RAND_load_file(NULL, bio_err, (inrand != NULL)); app_RAND_load_file(NULL, bio_err, (inrand != NULL));

View File

@@ -165,7 +165,7 @@ int MAIN(int argc, char **argv)
EVP_PKEY_CTX *genctx = NULL; EVP_PKEY_CTX *genctx = NULL;
const char *keyalg = NULL; const char *keyalg = NULL;
char *keyalgstr = NULL; char *keyalgstr = NULL;
STACK_OF(STRING) *pkeyopts = NULL; STACK_OF(OPENSSL_STRING) *pkeyopts = NULL;
EVP_PKEY *pkey=NULL; EVP_PKEY *pkey=NULL;
int i=0,badops=0,newreq=0,verbose=0,pkey_type=-1; int i=0,badops=0,newreq=0,verbose=0,pkey_type=-1;
long newkey = -1; long newkey = -1;
@@ -306,8 +306,8 @@ int MAIN(int argc, char **argv)
if (--argc < 1) if (--argc < 1)
goto bad; goto bad;
if (!pkeyopts) if (!pkeyopts)
pkeyopts = sk_STRING_new_null(); pkeyopts = sk_OPENSSL_STRING_new_null();
if (!pkeyopts || !sk_STRING_push(pkeyopts, *(++argv))) if (!pkeyopts || !sk_OPENSSL_STRING_push(pkeyopts, *(++argv)))
goto bad; goto bad;
} }
else if (strcmp(*argv,"-batch") == 0) else if (strcmp(*argv,"-batch") == 0)
@@ -365,11 +365,6 @@ int MAIN(int argc, char **argv)
serial = s2i_ASN1_INTEGER(NULL, *(++argv)); serial = s2i_ASN1_INTEGER(NULL, *(++argv));
if (!serial) goto bad; if (!serial) goto bad;
} }
else if ((md_alg=EVP_get_digestbyname(&((*argv)[1]))) != NULL)
{
/* ok */
digest=md_alg;
}
else if (strcmp(*argv,"-extensions") == 0) else if (strcmp(*argv,"-extensions") == 0)
{ {
if (--argc < 1) goto bad; if (--argc < 1) goto bad;
@@ -380,6 +375,11 @@ int MAIN(int argc, char **argv)
if (--argc < 1) goto bad; if (--argc < 1) goto bad;
req_exts = *(++argv); req_exts = *(++argv);
} }
else if ((md_alg=EVP_get_digestbyname(&((*argv)[1]))) != NULL)
{
/* ok */
digest=md_alg;
}
else else
{ {
BIO_printf(bio_err,"unknown option %s\n",*argv); BIO_printf(bio_err,"unknown option %s\n",*argv);
@@ -635,6 +635,11 @@ bad:
if (inrand) if (inrand)
app_RAND_load_files(inrand); app_RAND_load_files(inrand);
if (!NCONF_get_number(req_conf,SECTION,BITS, &newkey))
{
newkey=DEFAULT_KEY_LENGTH;
}
if (keyalg) if (keyalg)
{ {
genctx = set_keygen_ctx(bio_err, keyalg, &pkey_type, &newkey, genctx = set_keygen_ctx(bio_err, keyalg, &pkey_type, &newkey,
@@ -643,12 +648,6 @@ bad:
goto end; goto end;
} }
if (newkey <= 0)
{
if (!NCONF_get_number(req_conf,SECTION,BITS, &newkey))
newkey=DEFAULT_KEY_LENGTH;
}
if (newkey < MIN_KEY_LENGTH && (pkey_type == EVP_PKEY_RSA || pkey_type == EVP_PKEY_DSA)) if (newkey < MIN_KEY_LENGTH && (pkey_type == EVP_PKEY_RSA || pkey_type == EVP_PKEY_DSA))
{ {
BIO_printf(bio_err,"private key length is too short,\n"); BIO_printf(bio_err,"private key length is too short,\n");
@@ -667,9 +666,9 @@ bad:
if (pkeyopts) if (pkeyopts)
{ {
char *genopt; char *genopt;
for (i = 0; i < sk_STRING_num(pkeyopts); i++) for (i = 0; i < sk_OPENSSL_STRING_num(pkeyopts); i++)
{ {
genopt = sk_STRING_value(pkeyopts, i); genopt = sk_OPENSSL_STRING_value(pkeyopts, i);
if (pkey_ctrl_string(genctx, genopt) <= 0) if (pkey_ctrl_string(genctx, genopt) <= 0)
{ {
BIO_printf(bio_err, BIO_printf(bio_err,
@@ -1083,7 +1082,7 @@ end:
if (genctx) if (genctx)
EVP_PKEY_CTX_free(genctx); EVP_PKEY_CTX_free(genctx);
if (pkeyopts) if (pkeyopts)
sk_STRING_free(pkeyopts); sk_OPENSSL_STRING_free(pkeyopts);
#ifndef OPENSSL_NO_ENGINE #ifndef OPENSSL_NO_ENGINE
if (gen_eng) if (gen_eng)
ENGINE_free(gen_eng); ENGINE_free(gen_eng);
@@ -1336,11 +1335,17 @@ start2: for (;;)
BIO_snprintf(buf,sizeof buf,"%s_min",type); BIO_snprintf(buf,sizeof buf,"%s_min",type);
if (!NCONF_get_number(req_conf,attr_sect,buf, &n_min)) if (!NCONF_get_number(req_conf,attr_sect,buf, &n_min))
{
ERR_clear_error();
n_min = -1; n_min = -1;
}
BIO_snprintf(buf,sizeof buf,"%s_max",type); BIO_snprintf(buf,sizeof buf,"%s_max",type);
if (!NCONF_get_number(req_conf,attr_sect,buf, &n_max)) if (!NCONF_get_number(req_conf,attr_sect,buf, &n_max))
{
ERR_clear_error();
n_max = -1; n_max = -1;
}
if (!add_attribute_object(req, if (!add_attribute_object(req,
v->value,def,value,nid,n_min,n_max, chtype)) v->value,def,value,nid,n_min,n_max, chtype))
@@ -1441,7 +1446,8 @@ start:
buf[0]='\0'; buf[0]='\0';
if (!batch) if (!batch)
{ {
fgets(buf,sizeof buf,stdin); if (!fgets(buf,sizeof buf,stdin))
return 0;
} }
else else
{ {
@@ -1470,7 +1476,13 @@ start:
#ifdef CHARSET_EBCDIC #ifdef CHARSET_EBCDIC
ebcdic2ascii(buf, buf, i); ebcdic2ascii(buf, buf, i);
#endif #endif
if(!req_check_len(i, n_min, n_max)) goto start; if(!req_check_len(i, n_min, n_max))
{
if (batch || value)
return 0;
goto start;
}
if (!X509_NAME_add_entry_by_NID(n,nid, chtype, if (!X509_NAME_add_entry_by_NID(n,nid, chtype,
(unsigned char *) buf, -1,-1,mval)) goto err; (unsigned char *) buf, -1,-1,mval)) goto err;
ret=1; ret=1;
@@ -1499,7 +1511,8 @@ start:
buf[0]='\0'; buf[0]='\0';
if (!batch) if (!batch)
{ {
fgets(buf,sizeof buf,stdin); if (!fgets(buf,sizeof buf,stdin))
return 0;
} }
else else
{ {
@@ -1528,7 +1541,12 @@ start:
#ifdef CHARSET_EBCDIC #ifdef CHARSET_EBCDIC
ebcdic2ascii(buf, buf, i); ebcdic2ascii(buf, buf, i);
#endif #endif
if(!req_check_len(i, n_min, n_max)) goto start; if(!req_check_len(i, n_min, n_max))
{
if (batch || value)
return 0;
goto start;
}
if(!X509_REQ_add1_attr_by_NID(req, nid, chtype, if(!X509_REQ_add1_attr_by_NID(req, nid, chtype,
(unsigned char *)buf, -1)) { (unsigned char *)buf, -1)) {
@@ -1628,6 +1646,8 @@ static EVP_PKEY_CTX *set_keygen_ctx(BIO *err, const char *gstr, int *pkey_type,
keylen = atol(p + 1); keylen = atol(p + 1);
*pkeylen = keylen; *pkeylen = keylen;
} }
else
keylen = *pkeylen;
} }
else if (p) else if (p)
paramfile = p + 1; paramfile = p + 1;
@@ -1715,7 +1735,7 @@ static EVP_PKEY_CTX *set_keygen_ctx(BIO *err, const char *gstr, int *pkey_type,
ERR_print_errors(err); ERR_print_errors(err);
return NULL; return NULL;
} }
#ifndef OPENSSL_NO_RSA
if ((*pkey_type == EVP_PKEY_RSA) && (keylen != -1)) if ((*pkey_type == EVP_PKEY_RSA) && (keylen != -1))
{ {
if (EVP_PKEY_CTX_set_rsa_keygen_bits(gctx, keylen) <= 0) if (EVP_PKEY_CTX_set_rsa_keygen_bits(gctx, keylen) <= 0)
@@ -1726,6 +1746,7 @@ static EVP_PKEY_CTX *set_keygen_ctx(BIO *err, const char *gstr, int *pkey_type,
return NULL; return NULL;
} }
} }
#endif
return gctx; return gctx;
} }

View File

@@ -409,6 +409,7 @@ bad:
} }
else i=PEM_write_bio_RSAPrivateKey(out,rsa, else i=PEM_write_bio_RSAPrivateKey(out,rsa,
enc,NULL,0,NULL,passout); enc,NULL,0,NULL,passout);
#if !defined(OPENSSL_NO_DSA) && !defined(OPENSSL_NO_RC4)
} else if (outformat == FORMAT_MSBLOB || outformat == FORMAT_PVK) { } else if (outformat == FORMAT_MSBLOB || outformat == FORMAT_PVK) {
EVP_PKEY *pk; EVP_PKEY *pk;
pk = EVP_PKEY_new(); pk = EVP_PKEY_new();
@@ -420,11 +421,12 @@ bad:
else else
i = i2b_PrivateKey_bio(out, pk); i = i2b_PrivateKey_bio(out, pk);
EVP_PKEY_free(pk); EVP_PKEY_free(pk);
#endif
} else { } else {
BIO_printf(bio_err,"bad output format specified for outfile\n"); BIO_printf(bio_err,"bad output format specified for outfile\n");
goto end; goto end;
} }
if (!i) if (i <= 0)
{ {
BIO_printf(bio_err,"unable to write key\n"); BIO_printf(bio_err,"unable to write key\n");
ERR_print_errors(bio_err); ERR_print_errors(bio_err);

View File

@@ -342,4 +342,10 @@ static void usage()
} }
#else /* !OPENSSL_NO_RSA */
# if PEDANTIC
static void *dummy=&dummy;
# endif
#endif #endif

View File

@@ -171,3 +171,6 @@ void MS_CALLBACK tlsext_cb(SSL *s, int client_server, int type,
unsigned char *data, int len, unsigned char *data, int len,
void *arg); void *arg);
#endif #endif
int MS_CALLBACK generate_cookie_callback(SSL *ssl, unsigned char *cookie, unsigned int *cookie_len);
int MS_CALLBACK verify_cookie_callback(SSL *ssl, unsigned char *cookie, unsigned int cookie_len);

View File

@@ -117,17 +117,21 @@
#undef NON_MAIN #undef NON_MAIN
#undef USE_SOCKETS #undef USE_SOCKETS
#include <openssl/err.h> #include <openssl/err.h>
#include <openssl/rand.h>
#include <openssl/x509.h> #include <openssl/x509.h>
#include <openssl/ssl.h> #include <openssl/ssl.h>
#include "s_apps.h" #include "s_apps.h"
#define COOKIE_SECRET_LENGTH 16
int verify_depth=0; int verify_depth=0;
int verify_error=X509_V_OK; int verify_error=X509_V_OK;
int verify_return_error=0; int verify_return_error=0;
unsigned char cookie_secret[COOKIE_SECRET_LENGTH];
int cookie_initialized=0;
int MS_CALLBACK verify_callback(int ok, X509_STORE_CTX *ctx) int MS_CALLBACK verify_callback(int ok, X509_STORE_CTX *ctx)
{ {
char buf[256];
X509 *err_cert; X509 *err_cert;
int err,depth; int err,depth;
@@ -135,8 +139,15 @@ int MS_CALLBACK verify_callback(int ok, X509_STORE_CTX *ctx)
err= X509_STORE_CTX_get_error(ctx); err= X509_STORE_CTX_get_error(ctx);
depth= X509_STORE_CTX_get_error_depth(ctx); depth= X509_STORE_CTX_get_error_depth(ctx);
X509_NAME_oneline(X509_get_subject_name(err_cert),buf,sizeof buf); BIO_printf(bio_err,"depth=%d ",depth);
BIO_printf(bio_err,"depth=%d %s\n",depth,buf); if (err_cert)
{
X509_NAME_print_ex(bio_err, X509_get_subject_name(err_cert),
0, XN_FLAG_ONELINE);
BIO_puts(bio_err, "\n");
}
else
BIO_puts(bio_err, "<no cert>\n");
if (!ok) if (!ok)
{ {
BIO_printf(bio_err,"verify error:num=%d:%s\n",err, BIO_printf(bio_err,"verify error:num=%d:%s\n",err,
@@ -153,25 +164,33 @@ int MS_CALLBACK verify_callback(int ok, X509_STORE_CTX *ctx)
verify_error=X509_V_ERR_CERT_CHAIN_TOO_LONG; verify_error=X509_V_ERR_CERT_CHAIN_TOO_LONG;
} }
} }
switch (ctx->error) switch (err)
{ {
case X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT: case X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT:
X509_NAME_oneline(X509_get_issuer_name(ctx->current_cert),buf,sizeof buf); BIO_puts(bio_err,"issuer= ");
BIO_printf(bio_err,"issuer= %s\n",buf); X509_NAME_print_ex(bio_err, X509_get_issuer_name(err_cert),
0, XN_FLAG_ONELINE);
BIO_puts(bio_err, "\n");
break; break;
case X509_V_ERR_CERT_NOT_YET_VALID: case X509_V_ERR_CERT_NOT_YET_VALID:
case X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD: case X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD:
BIO_printf(bio_err,"notBefore="); BIO_printf(bio_err,"notBefore=");
ASN1_TIME_print(bio_err,X509_get_notBefore(ctx->current_cert)); ASN1_TIME_print(bio_err,X509_get_notBefore(err_cert));
BIO_printf(bio_err,"\n"); BIO_printf(bio_err,"\n");
break; break;
case X509_V_ERR_CERT_HAS_EXPIRED: case X509_V_ERR_CERT_HAS_EXPIRED:
case X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD: case X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD:
BIO_printf(bio_err,"notAfter="); BIO_printf(bio_err,"notAfter=");
ASN1_TIME_print(bio_err,X509_get_notAfter(ctx->current_cert)); ASN1_TIME_print(bio_err,X509_get_notAfter(err_cert));
BIO_printf(bio_err,"\n"); BIO_printf(bio_err,"\n");
break; break;
case X509_V_ERR_NO_EXPLICIT_POLICY:
policies_print(bio_err, ctx);
break;
} }
if (err == X509_V_OK && ok == 2)
policies_print(bio_err, ctx);
BIO_printf(bio_err,"verify return:%d\n",ok); BIO_printf(bio_err,"verify return:%d\n",ok);
return(ok); return(ok);
} }
@@ -338,6 +357,12 @@ void MS_CALLBACK msg_cb(int write_p, int version, int content_type, const void *
case TLS1_VERSION: case TLS1_VERSION:
str_version = "TLS 1.0 "; str_version = "TLS 1.0 ";
break; break;
case DTLS1_VERSION:
str_version = "DTLS 1.0 ";
break;
case DTLS1_BAD_VER:
str_version = "DTLS 1.0 (bad) ";
break;
default: default:
str_version = "???"; str_version = "???";
} }
@@ -403,7 +428,10 @@ void MS_CALLBACK msg_cb(int write_p, int version, int content_type, const void *
} }
} }
if (version == SSL3_VERSION || version == TLS1_VERSION) if (version == SSL3_VERSION ||
version == TLS1_VERSION ||
version == DTLS1_VERSION ||
version == DTLS1_BAD_VER)
{ {
switch (content_type) switch (content_type)
{ {
@@ -542,6 +570,9 @@ void MS_CALLBACK msg_cb(int write_p, int version, int content_type, const void *
case 2: case 2:
str_details1 = ", ServerHello"; str_details1 = ", ServerHello";
break; break;
case 3:
str_details1 = ", HelloVerifyRequest";
break;
case 11: case 11:
str_details1 = ", Certificate"; str_details1 = ", Certificate";
break; break;
@@ -638,6 +669,10 @@ void MS_CALLBACK tlsext_cb(SSL *s, int client_server, int type,
extname = "server ticket"; extname = "server ticket";
break; break;
case TLSEXT_TYPE_renegotiate:
extname = "renegotiate";
break;
#ifdef TLSEXT_TYPE_opaque_prf_input #ifdef TLSEXT_TYPE_opaque_prf_input
case TLSEXT_TYPE_opaque_prf_input: case TLSEXT_TYPE_opaque_prf_input:
extname = "opaque PRF input"; extname = "opaque PRF input";
@@ -656,3 +691,172 @@ void MS_CALLBACK tlsext_cb(SSL *s, int client_server, int type,
BIO_dump(bio, (char *)data, len); BIO_dump(bio, (char *)data, len);
(void)BIO_flush(bio); (void)BIO_flush(bio);
} }
int MS_CALLBACK generate_cookie_callback(SSL *ssl, unsigned char *cookie, unsigned int *cookie_len)
{
unsigned char *buffer, result[EVP_MAX_MD_SIZE];
unsigned int length, resultlength;
union {
struct sockaddr sa;
struct sockaddr_in s4;
#if OPENSSL_USE_IPV6
struct sockaddr_in6 s6;
#endif
} peer;
/* Initialize a random secret */
if (!cookie_initialized)
{
if (!RAND_bytes(cookie_secret, COOKIE_SECRET_LENGTH))
{
BIO_printf(bio_err,"error setting random cookie secret\n");
return 0;
}
cookie_initialized = 1;
}
/* Read peer information */
(void)BIO_dgram_get_peer(SSL_get_rbio(ssl), &peer);
/* Create buffer with peer's address and port */
length = 0;
switch (peer.sa.sa_family)
{
case AF_INET:
length += sizeof(struct in_addr);
length += sizeof(peer.s4.sin_port);
break;
#if OPENSSL_USE_IPV6
case AF_INET6:
length += sizeof(struct in6_addr);
length += sizeof(peer.s6.sin6_port);
break;
#endif
default:
OPENSSL_assert(0);
break;
}
buffer = OPENSSL_malloc(length);
if (buffer == NULL)
{
BIO_printf(bio_err,"out of memory\n");
return 0;
}
switch (peer.sa.sa_family)
{
case AF_INET:
memcpy(buffer,
&peer.s4.sin_port,
sizeof(peer.s4.sin_port));
memcpy(buffer + sizeof(peer.s4.sin_port),
&peer.s4.sin_addr,
sizeof(struct in_addr));
break;
#if OPENSSL_USE_IPV6
case AF_INET6:
memcpy(buffer,
&peer.s6.sin6_port,
sizeof(peer.s6.sin6_port));
memcpy(buffer + sizeof(peer.s6.sin6_port),
&peer.s6.sin6_addr,
sizeof(struct in6_addr));
break;
#endif
default:
OPENSSL_assert(0);
break;
}
/* Calculate HMAC of buffer using the secret */
HMAC(EVP_sha1(), cookie_secret, COOKIE_SECRET_LENGTH,
buffer, length, result, &resultlength);
OPENSSL_free(buffer);
memcpy(cookie, result, resultlength);
*cookie_len = resultlength;
return 1;
}
int MS_CALLBACK verify_cookie_callback(SSL *ssl, unsigned char *cookie, unsigned int cookie_len)
{
unsigned char *buffer, result[EVP_MAX_MD_SIZE];
unsigned int length, resultlength;
union {
struct sockaddr sa;
struct sockaddr_in s4;
#if OPENSSL_USE_IPV6
struct sockaddr_in6 s6;
#endif
} peer;
/* If secret isn't initialized yet, the cookie can't be valid */
if (!cookie_initialized)
return 0;
/* Read peer information */
(void)BIO_dgram_get_peer(SSL_get_rbio(ssl), &peer);
/* Create buffer with peer's address and port */
length = 0;
switch (peer.sa.sa_family)
{
case AF_INET:
length += sizeof(struct in_addr);
length += sizeof(peer.s4.sin_port);
break;
#if OPENSSL_USE_IPV6
case AF_INET6:
length += sizeof(struct in6_addr);
length += sizeof(peer.s6.sin6_port);
break;
#endif
default:
OPENSSL_assert(0);
break;
}
buffer = OPENSSL_malloc(length);
if (buffer == NULL)
{
BIO_printf(bio_err,"out of memory\n");
return 0;
}
switch (peer.sa.sa_family)
{
case AF_INET:
memcpy(buffer,
&peer.s4.sin_port,
sizeof(peer.s4.sin_port));
memcpy(buffer + sizeof(peer.s4.sin_port),
&peer.s4.sin_addr,
sizeof(struct in_addr));
break;
#if OPENSSL_USE_IPV6
case AF_INET6:
memcpy(buffer,
&peer.s6.sin6_port,
sizeof(peer.s6.sin6_port));
memcpy(buffer + sizeof(peer.s6.sin6_port),
&peer.s6.sin6_addr,
sizeof(struct in6_addr));
break;
#endif
default:
OPENSSL_assert(0);
break;
}
/* Calculate HMAC of buffer using the secret */
HMAC(EVP_sha1(), cookie_secret, COOKIE_SECRET_LENGTH,
buffer, length, result, &resultlength);
OPENSSL_free(buffer);
if (cookie_len == resultlength && memcmp(result, cookie, resultlength) == 0)
return 1;
return 0;
}

View File

@@ -284,6 +284,7 @@ static void sc_usage(void)
BIO_printf(bio_err," -connect host:port - who to connect to (default is %s:%s)\n",SSL_HOST_NAME,PORT_STR); BIO_printf(bio_err," -connect host:port - who to connect to (default is %s:%s)\n",SSL_HOST_NAME,PORT_STR);
BIO_printf(bio_err," -verify arg - turn on peer certificate verification\n"); BIO_printf(bio_err," -verify arg - turn on peer certificate verification\n");
BIO_printf(bio_err," -verify_return_error - return verification errors\n");
BIO_printf(bio_err," -cert arg - certificate file to use, PEM format assumed\n"); BIO_printf(bio_err," -cert arg - certificate file to use, PEM format assumed\n");
BIO_printf(bio_err," -certform arg - certificate format (PEM or DER) PEM default\n"); BIO_printf(bio_err," -certform arg - certificate format (PEM or DER) PEM default\n");
BIO_printf(bio_err," -key arg - Private key file to use, in cert file if\n"); BIO_printf(bio_err," -key arg - Private key file to use, in cert file if\n");
@@ -294,6 +295,7 @@ static void sc_usage(void)
BIO_printf(bio_err," -CAfile arg - PEM format file of CA's\n"); BIO_printf(bio_err," -CAfile arg - PEM format file of CA's\n");
BIO_printf(bio_err," -reconnect - Drop and re-make the connection with the same Session-ID\n"); BIO_printf(bio_err," -reconnect - Drop and re-make the connection with the same Session-ID\n");
BIO_printf(bio_err," -pause - sleep(1) after each read(2) and write(2) system call\n"); BIO_printf(bio_err," -pause - sleep(1) after each read(2) and write(2) system call\n");
BIO_printf(bio_err," -prexit - print session information even on connection failure\n");
BIO_printf(bio_err," -showcerts - show all certificates in the chain\n"); BIO_printf(bio_err," -showcerts - show all certificates in the chain\n");
BIO_printf(bio_err," -debug - extra output\n"); BIO_printf(bio_err," -debug - extra output\n");
#ifdef WATT32 #ifdef WATT32
@@ -320,7 +322,8 @@ static void sc_usage(void)
BIO_printf(bio_err," -ssl3 - just use SSLv3\n"); BIO_printf(bio_err," -ssl3 - just use SSLv3\n");
BIO_printf(bio_err," -tls1 - just use TLSv1\n"); BIO_printf(bio_err," -tls1 - just use TLSv1\n");
BIO_printf(bio_err," -dtls1 - just use DTLSv1\n"); BIO_printf(bio_err," -dtls1 - just use DTLSv1\n");
BIO_printf(bio_err," -mtu - set the MTU\n"); BIO_printf(bio_err," -fallback_scsv - send TLS_FALLBACK_SCSV\n");
BIO_printf(bio_err," -mtu - set the link layer MTU\n");
BIO_printf(bio_err," -no_tls1/-no_ssl3/-no_ssl2 - turn off that protocol\n"); BIO_printf(bio_err," -no_tls1/-no_ssl3/-no_ssl2 - turn off that protocol\n");
BIO_printf(bio_err," -bugs - Switch on all SSL implementation bug workarounds\n"); BIO_printf(bio_err," -bugs - Switch on all SSL implementation bug workarounds\n");
BIO_printf(bio_err," -serverpref - Use server's cipher preferences (only SSLv2)\n"); BIO_printf(bio_err," -serverpref - Use server's cipher preferences (only SSLv2)\n");
@@ -343,6 +346,7 @@ static void sc_usage(void)
BIO_printf(bio_err," -status - request certificate status from server\n"); BIO_printf(bio_err," -status - request certificate status from server\n");
BIO_printf(bio_err," -no_ticket - disable use of RFC4507bis session tickets\n"); BIO_printf(bio_err," -no_ticket - disable use of RFC4507bis session tickets\n");
#endif #endif
BIO_printf(bio_err," -legacy_renegotiation - enable use of legacy renegotiation (dangerous)\n");
} }
#ifndef OPENSSL_NO_TLSEXT #ifndef OPENSSL_NO_TLSEXT
@@ -381,9 +385,8 @@ int MAIN(int, char **);
int MAIN(int argc, char **argv) int MAIN(int argc, char **argv)
{ {
int off=0; unsigned int off=0, clr=0;
SSL *con=NULL; SSL *con=NULL;
X509_STORE *store = NULL;
int s,k,width,state=0; int s,k,width,state=0;
char *cbuf=NULL,*sbuf=NULL,*mbuf=NULL; char *cbuf=NULL,*sbuf=NULL,*mbuf=NULL;
int cbuf_len,cbuf_off; int cbuf_len,cbuf_off;
@@ -404,12 +407,15 @@ int MAIN(int argc, char **argv)
SSL_CTX *ctx=NULL; SSL_CTX *ctx=NULL;
int ret=1,in_init=1,i,nbio_test=0; int ret=1,in_init=1,i,nbio_test=0;
int starttls_proto = PROTO_OFF; int starttls_proto = PROTO_OFF;
int prexit = 0, vflags = 0; int prexit = 0;
X509_VERIFY_PARAM *vpm = NULL;
int badarg = 0;
const SSL_METHOD *meth=NULL; const SSL_METHOD *meth=NULL;
int socket_type=SOCK_STREAM; int socket_type=SOCK_STREAM;
BIO *sbio; BIO *sbio;
char *inrand=NULL; char *inrand=NULL;
int mbuf_len=0; int mbuf_len=0;
struct timeval timeout, *timeoutp;
#ifndef OPENSSL_NO_ENGINE #ifndef OPENSSL_NO_ENGINE
char *engine_id=NULL; char *engine_id=NULL;
char *ssl_client_engine_id=NULL; char *ssl_client_engine_id=NULL;
@@ -431,19 +437,14 @@ int MAIN(int argc, char **argv)
char *sess_out = NULL; char *sess_out = NULL;
struct sockaddr peer; struct sockaddr peer;
int peerlen = sizeof(peer); int peerlen = sizeof(peer);
int fallback_scsv = 0;
int enable_timeouts = 0 ; int enable_timeouts = 0 ;
long socket_mtu = 0; long socket_mtu = 0;
#ifndef OPENSSL_NO_JPAKE #ifndef OPENSSL_NO_JPAKE
char *jpake_secret = NULL; char *jpake_secret = NULL;
#endif #endif
#if !defined(OPENSSL_NO_SSL2) && !defined(OPENSSL_NO_SSL3)
meth=SSLv23_client_method(); meth=SSLv23_client_method();
#elif !defined(OPENSSL_NO_SSL3)
meth=SSLv3_client_method();
#elif !defined(OPENSSL_NO_SSL2)
meth=SSLv2_client_method();
#endif
apps_startup(); apps_startup();
c_Pause=0; c_Pause=0;
@@ -521,10 +522,12 @@ int MAIN(int argc, char **argv)
if (--argc < 1) goto bad; if (--argc < 1) goto bad;
cert_format = str2fmt(*(++argv)); cert_format = str2fmt(*(++argv));
} }
else if (strcmp(*argv,"-crl_check") == 0) else if (args_verify(&argv, &argc, &badarg, bio_err, &vpm))
vflags |= X509_V_FLAG_CRL_CHECK; {
else if (strcmp(*argv,"-crl_check_all") == 0) if (badarg)
vflags |= X509_V_FLAG_CRL_CHECK|X509_V_FLAG_CRL_CHECK_ALL; goto bad;
continue;
}
else if (strcmp(*argv,"-verify_return_error") == 0) else if (strcmp(*argv,"-verify_return_error") == 0)
verify_return_error = 1; verify_return_error = 1;
else if (strcmp(*argv,"-prexit") == 0) else if (strcmp(*argv,"-prexit") == 0)
@@ -576,7 +579,7 @@ int MAIN(int argc, char **argv)
psk_key=*(++argv); psk_key=*(++argv);
for (j = 0; j < strlen(psk_key); j++) for (j = 0; j < strlen(psk_key); j++)
{ {
if (isxdigit((int)psk_key[j])) if (isxdigit((unsigned char)psk_key[j]))
continue; continue;
BIO_printf(bio_err,"Not a hex number '%s'\n",*argv); BIO_printf(bio_err,"Not a hex number '%s'\n",*argv);
goto bad; goto bad;
@@ -609,6 +612,10 @@ int MAIN(int argc, char **argv)
socket_mtu = atol(*(++argv)); socket_mtu = atol(*(++argv));
} }
#endif #endif
else if (strcmp(*argv,"-fallback_scsv") == 0)
{
fallback_scsv = 1;
}
else if (strcmp(*argv,"-bugs") == 0) else if (strcmp(*argv,"-bugs") == 0)
bugs=1; bugs=1;
else if (strcmp(*argv,"-keyform") == 0) else if (strcmp(*argv,"-keyform") == 0)
@@ -654,6 +661,12 @@ int MAIN(int argc, char **argv)
#endif #endif
else if (strcmp(*argv,"-serverpref") == 0) else if (strcmp(*argv,"-serverpref") == 0)
off|=SSL_OP_CIPHER_SERVER_PREFERENCE; off|=SSL_OP_CIPHER_SERVER_PREFERENCE;
else if (strcmp(*argv,"-legacy_renegotiation") == 0)
off|=SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION;
else if (strcmp(*argv,"-legacy_server_connect") == 0)
{ off|=SSL_OP_LEGACY_SERVER_CONNECT; }
else if (strcmp(*argv,"-no_legacy_server_connect") == 0)
{ clr|=SSL_OP_LEGACY_SERVER_CONNECT; }
else if (strcmp(*argv,"-cipher") == 0) else if (strcmp(*argv,"-cipher") == 0)
{ {
if (--argc < 1) goto bad; if (--argc < 1) goto bad;
@@ -738,14 +751,13 @@ bad:
goto end; goto end;
} }
psk_identity = "JPAKE"; psk_identity = "JPAKE";
if (cipher)
{
BIO_printf(bio_err, "JPAKE sets cipher to PSK\n");
goto end;
}
cipher = "PSK";
} }
if (cipher)
{
BIO_printf(bio_err, "JPAKE sets cipher to PSK\n");
goto end;
}
cipher = "PSK";
#endif #endif
OpenSSL_add_ssl_algorithms(); OpenSSL_add_ssl_algorithms();
@@ -831,6 +843,9 @@ bad:
goto end; goto end;
} }
if (vpm)
SSL_CTX_set1_param(ctx, vpm);
#ifndef OPENSSL_NO_ENGINE #ifndef OPENSSL_NO_ENGINE
if (ssl_client_engine) if (ssl_client_engine)
{ {
@@ -861,6 +876,9 @@ bad:
SSL_CTX_set_options(ctx,SSL_OP_ALL|off); SSL_CTX_set_options(ctx,SSL_OP_ALL|off);
else else
SSL_CTX_set_options(ctx,off); SSL_CTX_set_options(ctx,off);
if (clr)
SSL_CTX_clear_options(ctx, clr);
/* DTLS: partial reads end up discarding unread UDP bytes :-( /* DTLS: partial reads end up discarding unread UDP bytes :-(
* Setting read ahead solves this problem. * Setting read ahead solves this problem.
*/ */
@@ -890,8 +908,6 @@ bad:
/* goto end; */ /* goto end; */
} }
store = SSL_CTX_get_cert_store(ctx);
X509_STORE_set_flags(store, vflags);
#ifndef OPENSSL_NO_TLSEXT #ifndef OPENSSL_NO_TLSEXT
if (servername != NULL) if (servername != NULL)
{ {
@@ -925,6 +941,10 @@ bad:
SSL_set_session(con, sess); SSL_set_session(con, sess);
SSL_SESSION_free(sess); SSL_SESSION_free(sess);
} }
if (fallback_scsv)
SSL_set_mode(con, SSL_MODE_SEND_FALLBACK_SCSV);
#ifndef OPENSSL_NO_TLSEXT #ifndef OPENSSL_NO_TLSEXT
if (servername != NULL) if (servername != NULL)
{ {
@@ -975,7 +995,6 @@ re_start:
if ( SSL_version(con) == DTLS1_VERSION) if ( SSL_version(con) == DTLS1_VERSION)
{ {
struct timeval timeout;
sbio=BIO_new_dgram(s,BIO_NOCLOSE); sbio=BIO_new_dgram(s,BIO_NOCLOSE);
if (getsockname(s, &peer, (void *)&peerlen) < 0) if (getsockname(s, &peer, (void *)&peerlen) < 0)
@@ -999,10 +1018,22 @@ re_start:
BIO_ctrl(sbio, BIO_CTRL_DGRAM_SET_SEND_TIMEOUT, 0, &timeout); BIO_ctrl(sbio, BIO_CTRL_DGRAM_SET_SEND_TIMEOUT, 0, &timeout);
} }
if (socket_mtu > 0) if (socket_mtu)
{ {
if(socket_mtu < DTLS_get_link_min_mtu(con))
{
BIO_printf(bio_err,"MTU too small. Must be at least %ld\n",
DTLS_get_link_min_mtu(con));
BIO_free(sbio);
goto shut;
}
SSL_set_options(con, SSL_OP_NO_QUERY_MTU); SSL_set_options(con, SSL_OP_NO_QUERY_MTU);
SSL_set_mtu(con, socket_mtu); if(!DTLS_set_link_mtu(con, socket_mtu))
{
BIO_printf(bio_err, "Failed to set MTU\n");
BIO_free(sbio);
goto shut;
}
} }
else else
/* want to do MTU discovery */ /* want to do MTU discovery */
@@ -1192,6 +1223,12 @@ SSL_set_tlsext_status_ids(con, ids);
FD_ZERO(&readfds); FD_ZERO(&readfds);
FD_ZERO(&writefds); FD_ZERO(&writefds);
if ((SSL_version(con) == DTLS1_VERSION) &&
DTLSv1_get_timeout(con, &timeout))
timeoutp = &timeout;
else
timeoutp = NULL;
if (SSL_in_init(con) && !SSL_total_renegotiations(con)) if (SSL_in_init(con) && !SSL_total_renegotiations(con))
{ {
in_init=1; in_init=1;
@@ -1296,7 +1333,7 @@ SSL_set_tlsext_status_ids(con, ids);
if(!i && (!((_kbhit()) || (WAIT_OBJECT_0 == WaitForSingleObject(GetStdHandle(STD_INPUT_HANDLE), 0))) || !read_tty) ) continue; if(!i && (!((_kbhit()) || (WAIT_OBJECT_0 == WaitForSingleObject(GetStdHandle(STD_INPUT_HANDLE), 0))) || !read_tty) ) continue;
#endif #endif
} else i=select(width,(void *)&readfds,(void *)&writefds, } else i=select(width,(void *)&readfds,(void *)&writefds,
NULL,NULL); NULL,timeoutp);
} }
#elif defined(OPENSSL_SYS_NETWARE) #elif defined(OPENSSL_SYS_NETWARE)
if(!write_tty) { if(!write_tty) {
@@ -1306,7 +1343,7 @@ SSL_set_tlsext_status_ids(con, ids);
i=select(width,(void *)&readfds,(void *)&writefds, i=select(width,(void *)&readfds,(void *)&writefds,
NULL,&tv); NULL,&tv);
} else i=select(width,(void *)&readfds,(void *)&writefds, } else i=select(width,(void *)&readfds,(void *)&writefds,
NULL,NULL); NULL,timeoutp);
} }
#elif defined(OPENSSL_SYS_BEOS_R5) #elif defined(OPENSSL_SYS_BEOS_R5)
/* Under BeOS-R5 the situation is similar to DOS */ /* Under BeOS-R5 the situation is similar to DOS */
@@ -1324,12 +1361,12 @@ SSL_set_tlsext_status_ids(con, ids);
if (!i && (stdin_set != 1 || !read_tty)) if (!i && (stdin_set != 1 || !read_tty))
continue; continue;
} else i=select(width,(void *)&readfds,(void *)&writefds, } else i=select(width,(void *)&readfds,(void *)&writefds,
NULL,NULL); NULL,timeoutp);
} }
(void)fcntl(fileno(stdin), F_SETFL, 0); (void)fcntl(fileno(stdin), F_SETFL, 0);
#else #else
i=select(width,(void *)&readfds,(void *)&writefds, i=select(width,(void *)&readfds,(void *)&writefds,
NULL,NULL); NULL,timeoutp);
#endif #endif
if ( i < 0) if ( i < 0)
{ {
@@ -1340,6 +1377,11 @@ SSL_set_tlsext_status_ids(con, ids);
} }
} }
if ((SSL_version(con) == DTLS1_VERSION) && DTLSv1_handle_timeout(con) > 0)
{
BIO_printf(bio_err,"TIMEOUT occured\n");
}
if (!ssl_pending && FD_ISSET(SSL_get_fd(con),&writefds)) if (!ssl_pending && FD_ISSET(SSL_get_fd(con),&writefds))
{ {
k=SSL_write(con,&(cbuf[cbuf_off]), k=SSL_write(con,&(cbuf[cbuf_off]),
@@ -1578,6 +1620,8 @@ end:
EVP_PKEY_free(key); EVP_PKEY_free(key);
if (pass) if (pass)
OPENSSL_free(pass); OPENSSL_free(pass);
if (vpm)
X509_VERIFY_PARAM_free(vpm);
if (cbuf != NULL) { OPENSSL_cleanse(cbuf,BUFSIZZ); OPENSSL_free(cbuf); } if (cbuf != NULL) { OPENSSL_cleanse(cbuf,BUFSIZZ); OPENSSL_free(cbuf); }
if (sbuf != NULL) { OPENSSL_cleanse(sbuf,BUFSIZZ); OPENSSL_free(sbuf); } if (sbuf != NULL) { OPENSSL_cleanse(sbuf,BUFSIZZ); OPENSSL_free(sbuf); }
if (mbuf != NULL) { OPENSSL_cleanse(mbuf,BUFSIZZ); OPENSSL_free(mbuf); } if (mbuf != NULL) { OPENSSL_cleanse(mbuf,BUFSIZZ); OPENSSL_free(mbuf); }
@@ -1707,6 +1751,8 @@ static void print_stuff(BIO *bio, SSL *s, int full)
EVP_PKEY_bits(pktmp)); EVP_PKEY_bits(pktmp));
EVP_PKEY_free(pktmp); EVP_PKEY_free(pktmp);
} }
BIO_printf(bio, "Secure Renegotiation IS%s supported\n",
SSL_get_secure_renegotiation_support(s) ? "" : " NOT");
#ifndef OPENSSL_NO_COMP #ifndef OPENSSL_NO_COMP
comp=SSL_get_current_compression(s); comp=SSL_get_current_compression(s);
expansion=SSL_get_current_expansion(s); expansion=SSL_get_current_expansion(s);

View File

@@ -298,7 +298,9 @@ static const char *session_id_prefix=NULL;
static int enable_timeouts = 0; static int enable_timeouts = 0;
static long socket_mtu; static long socket_mtu;
#ifndef OPENSSL_NO_DTLS1
static int cert_chain = 0; static int cert_chain = 0;
#endif
#ifndef OPENSSL_NO_PSK #ifndef OPENSSL_NO_PSK
static char *psk_identity="Client_identity"; static char *psk_identity="Client_identity";
@@ -408,6 +410,7 @@ static void sv_usage(void)
BIO_printf(bio_err," -context arg - set session ID context\n"); BIO_printf(bio_err," -context arg - set session ID context\n");
BIO_printf(bio_err," -verify arg - turn on peer certificate verification\n"); BIO_printf(bio_err," -verify arg - turn on peer certificate verification\n");
BIO_printf(bio_err," -Verify arg - turn on peer certificate verification, must have a cert.\n"); BIO_printf(bio_err," -Verify arg - turn on peer certificate verification, must have a cert.\n");
BIO_printf(bio_err," -verify_return_error - return verification errors\n");
BIO_printf(bio_err," -cert arg - certificate file to use\n"); BIO_printf(bio_err," -cert arg - certificate file to use\n");
BIO_printf(bio_err," (default is %s)\n",TEST_CERT); BIO_printf(bio_err," (default is %s)\n",TEST_CERT);
BIO_printf(bio_err," -crl_check - check the peer certificate has not been revoked by its CA.\n" \ BIO_printf(bio_err," -crl_check - check the peer certificate has not been revoked by its CA.\n" \
@@ -459,7 +462,7 @@ static void sv_usage(void)
BIO_printf(bio_err," -tls1 - Just talk TLSv1\n"); BIO_printf(bio_err," -tls1 - Just talk TLSv1\n");
BIO_printf(bio_err," -dtls1 - Just talk DTLSv1\n"); BIO_printf(bio_err," -dtls1 - Just talk DTLSv1\n");
BIO_printf(bio_err," -timeout - Enable timeouts\n"); BIO_printf(bio_err," -timeout - Enable timeouts\n");
BIO_printf(bio_err," -mtu - Set MTU\n"); BIO_printf(bio_err," -mtu - Set link layer MTU\n");
BIO_printf(bio_err," -chain - Read a certificate chain\n"); BIO_printf(bio_err," -chain - Read a certificate chain\n");
BIO_printf(bio_err," -no_ssl2 - Just disable SSLv2\n"); BIO_printf(bio_err," -no_ssl2 - Just disable SSLv2\n");
BIO_printf(bio_err," -no_ssl3 - Just disable SSLv3\n"); BIO_printf(bio_err," -no_ssl3 - Just disable SSLv3\n");
@@ -471,6 +474,7 @@ static void sv_usage(void)
BIO_printf(bio_err," -no_ecdhe - Disable ephemeral ECDH\n"); BIO_printf(bio_err," -no_ecdhe - Disable ephemeral ECDH\n");
#endif #endif
BIO_printf(bio_err," -bugs - Turn on SSL bug compatibility\n"); BIO_printf(bio_err," -bugs - Turn on SSL bug compatibility\n");
BIO_printf(bio_err," -hack - workaround for early Netscape code\n");
BIO_printf(bio_err," -www - Respond to a 'GET /' with a status page\n"); BIO_printf(bio_err," -www - Respond to a 'GET /' with a status page\n");
BIO_printf(bio_err," -WWW - Respond to a 'GET /<path> HTTP/1.0' with file ./<path>\n"); BIO_printf(bio_err," -WWW - Respond to a 'GET /<path> HTTP/1.0' with file ./<path>\n");
BIO_printf(bio_err," -HTTP - Respond to a 'GET /<path> HTTP/1.0' with file ./<path>\n"); BIO_printf(bio_err," -HTTP - Respond to a 'GET /<path> HTTP/1.0' with file ./<path>\n");
@@ -489,7 +493,12 @@ static void sv_usage(void)
BIO_printf(bio_err," not specified (default is %s)\n",TEST_CERT2); BIO_printf(bio_err," not specified (default is %s)\n",TEST_CERT2);
BIO_printf(bio_err," -tlsextdebug - hex dump of all TLS extensions received\n"); BIO_printf(bio_err," -tlsextdebug - hex dump of all TLS extensions received\n");
BIO_printf(bio_err," -no_ticket - disable use of RFC4507bis session tickets\n"); BIO_printf(bio_err," -no_ticket - disable use of RFC4507bis session tickets\n");
BIO_printf(bio_err," -legacy_renegotiation - enable use of legacy renegotiation (dangerous)\n");
#endif #endif
BIO_printf(bio_err," -status - respond to certificate status requests\n");
BIO_printf(bio_err," -status_verbose - enable status request verbose printout\n");
BIO_printf(bio_err," -status_timeout n - status request responder timeout\n");
BIO_printf(bio_err," -status_url URL - status request fallback URL\n");
} }
static int local_argc=0; static int local_argc=0;
@@ -667,11 +676,11 @@ static int MS_CALLBACK ssl_servername_cb(SSL *s, int *ad, void *arg)
if (servername) if (servername)
{ {
if (strcmp(servername,p->servername)) if (strcasecmp(servername,p->servername))
return p->extension_error; return p->extension_error;
if (ctx2) if (ctx2)
{ {
BIO_printf(p->biodebug,"Swiching server context.\n"); BIO_printf(p->biodebug,"Switching server context.\n");
SSL_set_SSL_CTX(s,ctx2); SSL_set_SSL_CTX(s,ctx2);
} }
} }
@@ -710,7 +719,7 @@ static int cert_status_cb(SSL *s, void *arg)
int use_ssl; int use_ssl;
unsigned char *rspder = NULL; unsigned char *rspder = NULL;
int rspderlen; int rspderlen;
STACK_OF(STRING) *aia = NULL; STACK_OF(OPENSSL_STRING) *aia = NULL;
X509 *x = NULL; X509 *x = NULL;
X509_STORE_CTX inctx; X509_STORE_CTX inctx;
X509_OBJECT obj; X509_OBJECT obj;
@@ -732,7 +741,7 @@ BIO_printf(err, "cert_status: received %d ids\n", sk_OCSP_RESPID_num(ids));
aia = X509_get1_ocsp(x); aia = X509_get1_ocsp(x);
if (aia) if (aia)
{ {
if (!OCSP_parse_url(sk_STRING_value(aia, 0), if (!OCSP_parse_url(sk_OPENSSL_STRING_value(aia, 0),
&host, &port, &path, &use_ssl)) &host, &port, &path, &use_ssl))
{ {
BIO_puts(err, "cert_status: can't parse AIA URL\n"); BIO_puts(err, "cert_status: can't parse AIA URL\n");
@@ -740,7 +749,7 @@ BIO_printf(err, "cert_status: received %d ids\n", sk_OCSP_RESPID_num(ids));
} }
if (srctx->verbose) if (srctx->verbose)
BIO_printf(err, "cert_status: AIA URL: %s\n", BIO_printf(err, "cert_status: AIA URL: %s\n",
sk_STRING_value(aia, 0)); sk_OPENSSL_STRING_value(aia, 0));
} }
else else
{ {
@@ -785,7 +794,7 @@ BIO_printf(err, "cert_status: received %d ids\n", sk_OCSP_RESPID_num(ids));
if (!OCSP_REQUEST_add_ext(req, ext, -1)) if (!OCSP_REQUEST_add_ext(req, ext, -1))
goto err; goto err;
} }
resp = process_responder(err, req, host, path, port, use_ssl, resp = process_responder(err, req, host, path, port, use_ssl, NULL,
srctx->timeout); srctx->timeout);
if (!resp) if (!resp)
{ {
@@ -833,8 +842,8 @@ static char *jpake_secret = NULL;
int MAIN(int argc, char *argv[]) int MAIN(int argc, char *argv[])
{ {
X509_STORE *store = NULL; X509_VERIFY_PARAM *vpm = NULL;
int vflags = 0; int badarg = 0;
short port=PORT; short port=PORT;
char *CApath=NULL,*CAfile=NULL; char *CApath=NULL,*CAfile=NULL;
unsigned char *context = NULL; unsigned char *context = NULL;
@@ -857,6 +866,7 @@ int MAIN(int argc, char *argv[])
int s_dcert_format = FORMAT_PEM, s_dkey_format = FORMAT_PEM; int s_dcert_format = FORMAT_PEM, s_dkey_format = FORMAT_PEM;
X509 *s_cert = NULL, *s_dcert = NULL; X509 *s_cert = NULL, *s_dcert = NULL;
EVP_PKEY *s_key = NULL, *s_dkey = NULL; EVP_PKEY *s_key = NULL, *s_dkey = NULL;
int no_cache = 0;
#ifndef OPENSSL_NO_TLSEXT #ifndef OPENSSL_NO_TLSEXT
EVP_PKEY *s_key2 = NULL; EVP_PKEY *s_key2 = NULL;
X509 *s_cert2 = NULL; X509 *s_cert2 = NULL;
@@ -868,13 +878,7 @@ int MAIN(int argc, char *argv[])
/* by default do not send a PSK identity hint */ /* by default do not send a PSK identity hint */
static char *psk_identity_hint=NULL; static char *psk_identity_hint=NULL;
#endif #endif
#if !defined(OPENSSL_NO_SSL2) && !defined(OPENSSL_NO_SSL3)
meth=SSLv23_server_method(); meth=SSLv23_server_method();
#elif !defined(OPENSSL_NO_SSL3)
meth=SSLv3_server_method();
#elif !defined(OPENSSL_NO_SSL2)
meth=SSLv2_server_method();
#endif
local_argc=argc; local_argc=argc;
local_argv=argv; local_argv=argv;
@@ -999,18 +1003,20 @@ int MAIN(int argc, char *argv[])
if (--argc < 1) goto bad; if (--argc < 1) goto bad;
CApath= *(++argv); CApath= *(++argv);
} }
else if (strcmp(*argv,"-crl_check") == 0) else if (strcmp(*argv,"-no_cache") == 0)
no_cache = 1;
else if (args_verify(&argv, &argc, &badarg, bio_err, &vpm))
{ {
vflags |= X509_V_FLAG_CRL_CHECK; if (badarg)
} goto bad;
else if (strcmp(*argv,"-crl_check_all") == 0) continue;
{
vflags |= X509_V_FLAG_CRL_CHECK|X509_V_FLAG_CRL_CHECK_ALL;
} }
else if (strcmp(*argv,"-verify_return_error") == 0) else if (strcmp(*argv,"-verify_return_error") == 0)
verify_return_error = 1; verify_return_error = 1;
else if (strcmp(*argv,"-serverpref") == 0) else if (strcmp(*argv,"-serverpref") == 0)
{ off|=SSL_OP_CIPHER_SERVER_PREFERENCE; } { off|=SSL_OP_CIPHER_SERVER_PREFERENCE; }
else if (strcmp(*argv,"-legacy_renegotiation") == 0)
off|=SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION;
else if (strcmp(*argv,"-cipher") == 0) else if (strcmp(*argv,"-cipher") == 0)
{ {
if (--argc < 1) goto bad; if (--argc < 1) goto bad;
@@ -1097,7 +1103,7 @@ int MAIN(int argc, char *argv[])
psk_key=*(++argv); psk_key=*(++argv);
for (i=0; i<strlen(psk_key); i++) for (i=0; i<strlen(psk_key); i++)
{ {
if (isxdigit((int)psk_key[i])) if (isxdigit((unsigned char)psk_key[i]))
continue; continue;
BIO_printf(bio_err,"Not a hex number '%s'\n",*argv); BIO_printf(bio_err,"Not a hex number '%s'\n",*argv);
goto bad; goto bad;
@@ -1209,6 +1215,14 @@ bad:
sv_usage(); sv_usage();
goto end; goto end;
} }
#ifndef OPENSSL_NO_DTLS1
if (www && socket_type == SOCK_DGRAM)
{
BIO_printf(bio_err,
"Can't use -HTTP, -www or -WWW with DTLS\n");
goto end;
}
#endif
#if !defined(OPENSSL_NO_JPAKE) && !defined(OPENSSL_NO_PSK) #if !defined(OPENSSL_NO_JPAKE) && !defined(OPENSSL_NO_PSK)
if (jpake_secret) if (jpake_secret)
@@ -1388,8 +1402,10 @@ bad:
if (socket_type == SOCK_DGRAM) SSL_CTX_set_read_ahead(ctx, 1); if (socket_type == SOCK_DGRAM) SSL_CTX_set_read_ahead(ctx, 1);
if (state) SSL_CTX_set_info_callback(ctx,apps_ssl_info_callback); if (state) SSL_CTX_set_info_callback(ctx,apps_ssl_info_callback);
if (no_cache)
SSL_CTX_sess_set_cache_size(ctx,128); SSL_CTX_set_session_cache_mode(ctx, SSL_SESS_CACHE_OFF);
else
SSL_CTX_sess_set_cache_size(ctx,128);
#if 0 #if 0
if (cipher == NULL) cipher=getenv("SSL_CIPHER"); if (cipher == NULL) cipher=getenv("SSL_CIPHER");
@@ -1410,8 +1426,8 @@ bad:
ERR_print_errors(bio_err); ERR_print_errors(bio_err);
/* goto end; */ /* goto end; */
} }
store = SSL_CTX_get_cert_store(ctx); if (vpm)
X509_STORE_set_flags(store, vflags); SSL_CTX_set1_param(ctx, vpm);
#ifndef OPENSSL_NO_TLSEXT #ifndef OPENSSL_NO_TLSEXT
if (s_cert2) if (s_cert2)
@@ -1455,15 +1471,18 @@ bad:
if (state) SSL_CTX_set_info_callback(ctx2,apps_ssl_info_callback); if (state) SSL_CTX_set_info_callback(ctx2,apps_ssl_info_callback);
SSL_CTX_sess_set_cache_size(ctx2,128); if (no_cache)
SSL_CTX_set_session_cache_mode(ctx2,SSL_SESS_CACHE_OFF);
else
SSL_CTX_sess_set_cache_size(ctx2,128);
if ((!SSL_CTX_load_verify_locations(ctx2,CAfile,CApath)) || if ((!SSL_CTX_load_verify_locations(ctx2,CAfile,CApath)) ||
(!SSL_CTX_set_default_verify_paths(ctx2))) (!SSL_CTX_set_default_verify_paths(ctx2)))
{ {
ERR_print_errors(bio_err); ERR_print_errors(bio_err);
} }
store = SSL_CTX_get_cert_store(ctx2); if (vpm)
X509_STORE_set_flags(store, vflags); SSL_CTX_set1_param(ctx2, vpm);
} }
#endif #endif
@@ -1654,6 +1673,10 @@ bad:
SSL_CTX_set_session_id_context(ctx,(void*)&s_server_session_id_context, SSL_CTX_set_session_id_context(ctx,(void*)&s_server_session_id_context,
sizeof s_server_session_id_context); sizeof s_server_session_id_context);
/* Set DTLS cookie generation and verification callbacks */
SSL_CTX_set_cookie_generate_cb(ctx, generate_cookie_callback);
SSL_CTX_set_cookie_verify_cb(ctx, verify_cookie_callback);
#ifndef OPENSSL_NO_TLSEXT #ifndef OPENSSL_NO_TLSEXT
if (ctx2) if (ctx2)
{ {
@@ -1700,7 +1723,15 @@ end:
OPENSSL_free(pass); OPENSSL_free(pass);
if (dpass) if (dpass)
OPENSSL_free(dpass); OPENSSL_free(dpass);
if (vpm)
X509_VERIFY_PARAM_free(vpm);
#ifndef OPENSSL_NO_TLSEXT #ifndef OPENSSL_NO_TLSEXT
if (tlscstatp.host)
OPENSSL_free(tlscstatp.host);
if (tlscstatp.port)
OPENSSL_free(tlscstatp.port);
if (tlscstatp.path)
OPENSSL_free(tlscstatp.path);
if (ctx2 != NULL) SSL_CTX_free(ctx2); if (ctx2 != NULL) SSL_CTX_free(ctx2);
if (s_cert2) if (s_cert2)
X509_free(s_cert2); X509_free(s_cert2);
@@ -1750,8 +1781,11 @@ static int sv_body(char *hostname, int s, unsigned char *context)
unsigned long l; unsigned long l;
SSL *con=NULL; SSL *con=NULL;
BIO *sbio; BIO *sbio;
struct timeval timeout;
#if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_MSDOS) || defined(OPENSSL_SYS_NETWARE) || defined(OPENSSL_SYS_BEOS_R5) #if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_MSDOS) || defined(OPENSSL_SYS_NETWARE) || defined(OPENSSL_SYS_BEOS_R5)
struct timeval tv; struct timeval tv;
#else
struct timeval *timeoutp;
#endif #endif
if ((buf=OPENSSL_malloc(bufsize)) == NULL) if ((buf=OPENSSL_malloc(bufsize)) == NULL)
@@ -1808,7 +1842,6 @@ static int sv_body(char *hostname, int s, unsigned char *context)
if (SSL_version(con) == DTLS1_VERSION) if (SSL_version(con) == DTLS1_VERSION)
{ {
struct timeval timeout;
sbio=BIO_new_dgram(s,BIO_NOCLOSE); sbio=BIO_new_dgram(s,BIO_NOCLOSE);
@@ -1823,10 +1856,24 @@ static int sv_body(char *hostname, int s, unsigned char *context)
BIO_ctrl(sbio, BIO_CTRL_DGRAM_SET_SEND_TIMEOUT, 0, &timeout); BIO_ctrl(sbio, BIO_CTRL_DGRAM_SET_SEND_TIMEOUT, 0, &timeout);
} }
if (socket_mtu > 0) if (socket_mtu)
{ {
if(socket_mtu < DTLS_get_link_min_mtu(con))
{
BIO_printf(bio_err,"MTU too small. Must be at least %ld\n",
DTLS_get_link_min_mtu(con));
ret = -1;
BIO_free(sbio);
goto err;
}
SSL_set_options(con, SSL_OP_NO_QUERY_MTU); SSL_set_options(con, SSL_OP_NO_QUERY_MTU);
SSL_set_mtu(con, socket_mtu); if(!DTLS_set_link_mtu(con, socket_mtu))
{
BIO_printf(bio_err, "Failed to set MTU\n");
ret = -1;
BIO_free(sbio);
goto err;
}
} }
else else
/* want to do MTU discovery */ /* want to do MTU discovery */
@@ -1919,7 +1966,19 @@ static int sv_body(char *hostname, int s, unsigned char *context)
read_from_terminal = 1; read_from_terminal = 1;
(void)fcntl(fileno(stdin), F_SETFL, 0); (void)fcntl(fileno(stdin), F_SETFL, 0);
#else #else
i=select(width,(void *)&readfds,NULL,NULL,NULL); if ((SSL_version(con) == DTLS1_VERSION) &&
DTLSv1_get_timeout(con, &timeout))
timeoutp = &timeout;
else
timeoutp = NULL;
i=select(width,(void *)&readfds,NULL,NULL,timeoutp);
if ((SSL_version(con) == DTLS1_VERSION) && DTLSv1_handle_timeout(con) > 0)
{
BIO_printf(bio_err,"TIMEOUT occured\n");
}
if (i <= 0) continue; if (i <= 0) continue;
if (FD_ISSET(fileno(stdin),&readfds)) if (FD_ISSET(fileno(stdin),&readfds))
read_from_terminal = 1; read_from_terminal = 1;
@@ -2180,6 +2239,8 @@ static int init_ssl_connection(SSL *con)
con->kssl_ctx->client_princ); con->kssl_ctx->client_princ);
} }
#endif /* OPENSSL_NO_KRB5 */ #endif /* OPENSSL_NO_KRB5 */
BIO_printf(bio_s_out, "Secure Renegotiation IS%s supported\n",
SSL_get_secure_renegotiation_support(con) ? "" : " NOT");
return(1); return(1);
} }
@@ -2223,11 +2284,10 @@ static int www_body(char *hostname, int s, unsigned char *context)
{ {
char *buf=NULL; char *buf=NULL;
int ret=1; int ret=1;
int i,j,k,blank,dot; int i,j,k,dot;
SSL *con; SSL *con;
const SSL_CIPHER *c; const SSL_CIPHER *c;
BIO *io,*ssl_bio,*sbio; BIO *io,*ssl_bio,*sbio;
long total_bytes;
buf=OPENSSL_malloc(bufsize); buf=OPENSSL_malloc(bufsize);
if (buf == NULL) return(0); if (buf == NULL) return(0);
@@ -2298,7 +2358,6 @@ static int www_body(char *hostname, int s, unsigned char *context)
SSL_set_msg_callback_arg(con, bio_s_out); SSL_set_msg_callback_arg(con, bio_s_out);
} }
blank=0;
for (;;) for (;;)
{ {
if (hack) if (hack)
@@ -2528,7 +2587,6 @@ static int www_body(char *hostname, int s, unsigned char *context)
BIO_puts(io,"HTTP/1.0 200 ok\r\nContent-type: text/plain\r\n\r\n"); BIO_puts(io,"HTTP/1.0 200 ok\r\nContent-type: text/plain\r\n\r\n");
} }
/* send the file */ /* send the file */
total_bytes=0;
for (;;) for (;;)
{ {
i=BIO_read(file,buf,bufsize); i=BIO_read(file,buf,bufsize);

View File

@@ -62,6 +62,12 @@
#include <errno.h> #include <errno.h>
#include <signal.h> #include <signal.h>
#ifdef FLAT_INC
#include "e_os2.h"
#else
#include "../e_os2.h"
#endif
/* With IPv6, it looks like Digital has mixed up the proper order of /* With IPv6, it looks like Digital has mixed up the proper order of
recursive header file inclusion, resulting in the compiler complaining recursive header file inclusion, resulting in the compiler complaining
that u_int isn't defined, but only if _POSIX_C_SOURCE is defined, which that u_int isn't defined, but only if _POSIX_C_SOURCE is defined, which
@@ -269,7 +275,7 @@ static int init_client_ip(int *sock, unsigned char ip[4], int port, int type)
{ {
i=0; i=0;
i=setsockopt(s,SOL_SOCKET,SO_KEEPALIVE,(char *)&i,sizeof(i)); i=setsockopt(s,SOL_SOCKET,SO_KEEPALIVE,(char *)&i,sizeof(i));
if (i < 0) { perror("keepalive"); return(0); } if (i < 0) { closesocket(s); perror("keepalive"); return(0); }
} }
#endif #endif
@@ -321,7 +327,7 @@ static int init_server_long(int *sock, int port, char *ip, int type)
{ {
int ret=0; int ret=0;
struct sockaddr_in server; struct sockaddr_in server;
int s= -1,i; int s= -1;
if (!ssl_sock_init()) return(0); if (!ssl_sock_init()) return(0);
@@ -360,7 +366,6 @@ static int init_server_long(int *sock, int port, char *ip, int type)
} }
/* Make it 128 for linux */ /* Make it 128 for linux */
if (type==SOCK_STREAM && listen(s,128) == -1) goto err; if (type==SOCK_STREAM && listen(s,128) == -1) goto err;
i=0;
*sock=s; *sock=s;
ret=1; ret=1;
err: err:
@@ -378,7 +383,7 @@ static int init_server(int *sock, int port, int type)
static int do_accept(int acc_sock, int *sock, char **host) static int do_accept(int acc_sock, int *sock, char **host)
{ {
int ret,i; int ret;
struct hostent *h1,*h2; struct hostent *h1,*h2;
static struct sockaddr_in from; static struct sockaddr_in from;
int len; int len;
@@ -401,6 +406,7 @@ redoit:
if (ret == INVALID_SOCKET) if (ret == INVALID_SOCKET)
{ {
#if defined(OPENSSL_SYS_WINDOWS) || (defined(OPENSSL_SYS_NETWARE) && !defined(NETWARE_BSDSOCK)) #if defined(OPENSSL_SYS_WINDOWS) || (defined(OPENSSL_SYS_NETWARE) && !defined(NETWARE_BSDSOCK))
int i;
i=WSAGetLastError(); i=WSAGetLastError();
BIO_printf(bio_err,"accept error %d\n",i); BIO_printf(bio_err,"accept error %d\n",i);
#else #else
@@ -445,6 +451,7 @@ redoit:
if ((*host=(char *)OPENSSL_malloc(strlen(h1->h_name)+1)) == NULL) if ((*host=(char *)OPENSSL_malloc(strlen(h1->h_name)+1)) == NULL)
{ {
perror("OPENSSL_malloc"); perror("OPENSSL_malloc");
closesocket(ret);
return(0); return(0);
} }
BUF_strlcpy(*host,h1->h_name,strlen(h1->h_name)+1); BUF_strlcpy(*host,h1->h_name,strlen(h1->h_name)+1);
@@ -453,12 +460,13 @@ redoit:
if (h2 == NULL) if (h2 == NULL)
{ {
BIO_printf(bio_err,"gethostbyname failure\n"); BIO_printf(bio_err,"gethostbyname failure\n");
closesocket(ret);
return(0); return(0);
} }
i=0;
if (h2->h_addrtype != AF_INET) if (h2->h_addrtype != AF_INET)
{ {
BIO_printf(bio_err,"gethostbyname addr is not AF_INET\n"); BIO_printf(bio_err,"gethostbyname addr is not AF_INET\n");
closesocket(ret);
return(0); return(0);
} }
} }

View File

@@ -93,7 +93,7 @@ int MAIN(int argc, char **argv)
const char *inmode = "r", *outmode = "w"; const char *inmode = "r", *outmode = "w";
char *infile = NULL, *outfile = NULL; char *infile = NULL, *outfile = NULL;
char *signerfile = NULL, *recipfile = NULL; char *signerfile = NULL, *recipfile = NULL;
STACK_OF(STRING) *sksigners = NULL, *skkeys = NULL; STACK_OF(OPENSSL_STRING) *sksigners = NULL, *skkeys = NULL;
char *certfile = NULL, *keyfile = NULL, *contfile=NULL; char *certfile = NULL, *keyfile = NULL, *contfile=NULL;
const EVP_CIPHER *cipher = NULL; const EVP_CIPHER *cipher = NULL;
PKCS7 *p7 = NULL; PKCS7 *p7 = NULL;
@@ -260,13 +260,13 @@ int MAIN(int argc, char **argv)
if (signerfile) if (signerfile)
{ {
if (!sksigners) if (!sksigners)
sksigners = sk_STRING_new_null(); sksigners = sk_OPENSSL_STRING_new_null();
sk_STRING_push(sksigners, signerfile); sk_OPENSSL_STRING_push(sksigners, signerfile);
if (!keyfile) if (!keyfile)
keyfile = signerfile; keyfile = signerfile;
if (!skkeys) if (!skkeys)
skkeys = sk_STRING_new_null(); skkeys = sk_OPENSSL_STRING_new_null();
sk_STRING_push(skkeys, keyfile); sk_OPENSSL_STRING_push(skkeys, keyfile);
keyfile = NULL; keyfile = NULL;
} }
signerfile = *++args; signerfile = *++args;
@@ -302,12 +302,12 @@ int MAIN(int argc, char **argv)
goto argerr; goto argerr;
} }
if (!sksigners) if (!sksigners)
sksigners = sk_STRING_new_null(); sksigners = sk_OPENSSL_STRING_new_null();
sk_STRING_push(sksigners, signerfile); sk_OPENSSL_STRING_push(sksigners, signerfile);
signerfile = NULL; signerfile = NULL;
if (!skkeys) if (!skkeys)
skkeys = sk_STRING_new_null(); skkeys = sk_OPENSSL_STRING_new_null();
sk_STRING_push(skkeys, keyfile); sk_OPENSSL_STRING_push(skkeys, keyfile);
} }
keyfile = *++args; keyfile = *++args;
} }
@@ -389,13 +389,13 @@ int MAIN(int argc, char **argv)
if (signerfile) if (signerfile)
{ {
if (!sksigners) if (!sksigners)
sksigners = sk_STRING_new_null(); sksigners = sk_OPENSSL_STRING_new_null();
sk_STRING_push(sksigners, signerfile); sk_OPENSSL_STRING_push(sksigners, signerfile);
if (!skkeys) if (!skkeys)
skkeys = sk_STRING_new_null(); skkeys = sk_OPENSSL_STRING_new_null();
if (!keyfile) if (!keyfile)
keyfile = signerfile; keyfile = signerfile;
sk_STRING_push(skkeys, keyfile); sk_OPENSSL_STRING_push(skkeys, keyfile);
} }
if (!sksigners) if (!sksigners)
{ {
@@ -541,8 +541,8 @@ int MAIN(int argc, char **argv)
{ {
if (!cipher) if (!cipher)
{ {
#ifndef OPENSSL_NO_RC2 #ifndef OPENSSL_NO_DES
cipher = EVP_rc2_40_cbc(); cipher = EVP_des_ede3_cbc();
#else #else
BIO_printf(bio_err, "No cipher selected\n"); BIO_printf(bio_err, "No cipher selected\n");
goto end; goto end;
@@ -671,7 +671,7 @@ int MAIN(int argc, char **argv)
{ {
if (!(store = setup_verify(bio_err, CAfile, CApath))) if (!(store = setup_verify(bio_err, CAfile, CApath)))
goto end; goto end;
X509_STORE_set_verify_cb_func(store, smime_cb); X509_STORE_set_verify_cb(store, smime_cb);
if (vpm) if (vpm)
X509_STORE_set1_param(store, vpm); X509_STORE_set1_param(store, vpm);
} }
@@ -707,10 +707,10 @@ int MAIN(int argc, char **argv)
} }
else else
flags |= PKCS7_REUSE_DIGEST; flags |= PKCS7_REUSE_DIGEST;
for (i = 0; i < sk_STRING_num(sksigners); i++) for (i = 0; i < sk_OPENSSL_STRING_num(sksigners); i++)
{ {
signerfile = sk_STRING_value(sksigners, i); signerfile = sk_OPENSSL_STRING_value(sksigners, i);
keyfile = sk_STRING_value(skkeys, i); keyfile = sk_OPENSSL_STRING_value(skkeys, i);
signer = load_cert(bio_err, signerfile,FORMAT_PEM, NULL, signer = load_cert(bio_err, signerfile,FORMAT_PEM, NULL,
e, "signer certificate"); e, "signer certificate");
if (!signer) if (!signer)
@@ -807,9 +807,9 @@ end:
if (vpm) if (vpm)
X509_VERIFY_PARAM_free(vpm); X509_VERIFY_PARAM_free(vpm);
if (sksigners) if (sksigners)
sk_STRING_free(sksigners); sk_OPENSSL_STRING_free(sksigners);
if (skkeys) if (skkeys)
sk_STRING_free(skkeys); sk_OPENSSL_STRING_free(skkeys);
X509_STORE_free(store); X509_STORE_free(store);
X509_free(cert); X509_free(cert);
X509_free(recip); X509_free(recip);

View File

@@ -184,8 +184,18 @@
#include <openssl/ecdh.h> #include <openssl/ecdh.h>
#endif #endif
#if !defined(OPENSSL_SYS_VMS) && !defined(OPENSSL_SYS_WINDOWS) && !defined(OPENSSL_SYS_MACINTOSH_CLASSIC) && !defined(OPENSSL_SYS_OS2) && !defined(OPENSSL_SYS_NETWARE) #ifndef HAVE_FORK
# define HAVE_FORK 1 # if defined(OPENSSL_SYS_VMS) || defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_MACINTOSH_CLASSIC) || defined(OPENSSL_SYS_OS2) || defined(OPENSSL_SYS_NETWARE)
# define HAVE_FORK 0
# else
# define HAVE_FORK 1
# endif
#endif
#if HAVE_FORK
#undef NO_FORK
#else
#define NO_FORK
#endif #endif
#undef BUFSIZE #undef BUFSIZE
@@ -200,7 +210,7 @@ static void print_message(const char *s,long num,int length);
static void pkey_print_message(const char *str, const char *str2, static void pkey_print_message(const char *str, const char *str2,
long num, int bits, int sec); long num, int bits, int sec);
static void print_result(int alg,int run_no,int count,double time_used); static void print_result(int alg,int run_no,int count,double time_used);
#ifdef HAVE_FORK #ifndef NO_FORK
static int do_multi(int multi); static int do_multi(int multi);
#endif #endif
@@ -222,8 +232,12 @@ static const char *names[ALGOR_NUM]={
"aes-128 ige","aes-192 ige","aes-256 ige"}; "aes-128 ige","aes-192 ige","aes-256 ige"};
static double results[ALGOR_NUM][SIZE_NUM]; static double results[ALGOR_NUM][SIZE_NUM];
static int lengths[SIZE_NUM]={16,64,256,1024,8*1024}; static int lengths[SIZE_NUM]={16,64,256,1024,8*1024};
#ifndef OPENSSL_NO_RSA
static double rsa_results[RSA_NUM][2]; static double rsa_results[RSA_NUM][2];
#endif
#ifndef OPENSSL_NO_DSA
static double dsa_results[DSA_NUM][2]; static double dsa_results[DSA_NUM][2];
#endif
#ifndef OPENSSL_NO_ECDSA #ifndef OPENSSL_NO_ECDSA
static double ecdsa_results[EC_NUM][2]; static double ecdsa_results[EC_NUM][2];
#endif #endif
@@ -320,9 +334,6 @@ int MAIN(int, char **);
int MAIN(int argc, char **argv) int MAIN(int argc, char **argv)
{ {
#ifndef OPENSSL_NO_ENGINE
ENGINE *e = NULL;
#endif
unsigned char *buf=NULL,*buf2=NULL; unsigned char *buf=NULL,*buf2=NULL;
int mret=1; int mret=1;
long count=0,save_count=0; long count=0,save_count=0;
@@ -416,7 +427,6 @@ int MAIN(int argc, char **argv)
unsigned char DES_iv[8]; unsigned char DES_iv[8];
unsigned char iv[2*MAX_BLOCK_SIZE/8]; unsigned char iv[2*MAX_BLOCK_SIZE/8];
#ifndef OPENSSL_NO_DES #ifndef OPENSSL_NO_DES
DES_cblock *buf_as_des_cblock = NULL;
static DES_cblock key ={0x12,0x34,0x56,0x78,0x9a,0xbc,0xde,0xf0}; static DES_cblock key ={0x12,0x34,0x56,0x78,0x9a,0xbc,0xde,0xf0};
static DES_cblock key2={0x34,0x56,0x78,0x9a,0xbc,0xde,0xf0,0x12}; static DES_cblock key2={0x34,0x56,0x78,0x9a,0xbc,0xde,0xf0,0x12};
static DES_cblock key3={0x56,0x78,0x9a,0xbc,0xde,0xf0,0x12,0x34}; static DES_cblock key3={0x56,0x78,0x9a,0xbc,0xde,0xf0,0x12,0x34};
@@ -587,7 +597,7 @@ int MAIN(int argc, char **argv)
const EVP_CIPHER *evp_cipher=NULL; const EVP_CIPHER *evp_cipher=NULL;
const EVP_MD *evp_md=NULL; const EVP_MD *evp_md=NULL;
int decrypt=0; int decrypt=0;
#ifdef HAVE_FORK #ifndef NO_FORK
int multi=0; int multi=0;
#endif #endif
@@ -630,9 +640,6 @@ int MAIN(int argc, char **argv)
BIO_printf(bio_err,"out of memory\n"); BIO_printf(bio_err,"out of memory\n");
goto end; goto end;
} }
#ifndef OPENSSL_NO_DES
buf_as_des_cblock = (DES_cblock *)buf;
#endif
if ((buf2=(unsigned char *)OPENSSL_malloc((int)BUFSIZE)) == NULL) if ((buf2=(unsigned char *)OPENSSL_malloc((int)BUFSIZE)) == NULL)
{ {
BIO_printf(bio_err,"out of memory\n"); BIO_printf(bio_err,"out of memory\n");
@@ -707,7 +714,7 @@ int MAIN(int argc, char **argv)
BIO_printf(bio_err,"no engine given\n"); BIO_printf(bio_err,"no engine given\n");
goto end; goto end;
} }
e = setup_engine(bio_err, *argv, 0); setup_engine(bio_err, *argv, 0);
/* j will be increased again further down. We just /* j will be increased again further down. We just
don't want speed to confuse an engine with an don't want speed to confuse an engine with an
algorithm, especially when none is given (which algorithm, especially when none is given (which
@@ -715,7 +722,7 @@ int MAIN(int argc, char **argv)
j--; j--;
} }
#endif #endif
#ifdef HAVE_FORK #ifndef NO_FORK
else if ((argc > 0) && (strcmp(*argv,"-multi") == 0)) else if ((argc > 0) && (strcmp(*argv,"-multi") == 0))
{ {
argc--; argc--;
@@ -1103,7 +1110,7 @@ int MAIN(int argc, char **argv)
BIO_printf(bio_err,"-evp e use EVP e.\n"); BIO_printf(bio_err,"-evp e use EVP e.\n");
BIO_printf(bio_err,"-decrypt time decryption instead of encryption (only EVP).\n"); BIO_printf(bio_err,"-decrypt time decryption instead of encryption (only EVP).\n");
BIO_printf(bio_err,"-mr produce machine readable output.\n"); BIO_printf(bio_err,"-mr produce machine readable output.\n");
#ifdef HAVE_FORK #ifndef NO_FORK
BIO_printf(bio_err,"-multi n run n benchmarks in parallel.\n"); BIO_printf(bio_err,"-multi n run n benchmarks in parallel.\n");
#endif #endif
goto end; goto end;
@@ -1113,7 +1120,7 @@ int MAIN(int argc, char **argv)
j++; j++;
} }
#ifdef HAVE_FORK #ifndef NO_FORK
if(multi && do_multi(multi)) if(multi && do_multi(multi))
goto show_res; goto show_res;
#endif #endif
@@ -1129,6 +1136,14 @@ int MAIN(int argc, char **argv)
rsa_doit[i]=1; rsa_doit[i]=1;
for (i=0; i<DSA_NUM; i++) for (i=0; i<DSA_NUM; i++)
dsa_doit[i]=1; dsa_doit[i]=1;
#ifndef OPENSSL_NO_ECDSA
for (i=0; i<EC_NUM; i++)
ecdsa_doit[i]=1;
#endif
#ifndef OPENSSL_NO_ECDH
for (i=0; i<EC_NUM; i++)
ecdh_doit[i]=1;
#endif
} }
for (i=0; i<ALGOR_NUM; i++) for (i=0; i<ALGOR_NUM; i++)
if (doit[i]) pr_header++; if (doit[i]) pr_header++;
@@ -1215,7 +1230,8 @@ int MAIN(int argc, char **argv)
count*=2; count*=2;
Time_F(START); Time_F(START);
for (it=count; it; it--) for (it=count; it; it--)
DES_ecb_encrypt(buf_as_des_cblock,buf_as_des_cblock, DES_ecb_encrypt((DES_cblock *)buf,
(DES_cblock *)buf,
&sch,DES_ENCRYPT); &sch,DES_ENCRYPT);
d=Time_F(STOP); d=Time_F(STOP);
} while (d <3); } while (d <3);
@@ -2324,7 +2340,7 @@ int MAIN(int argc, char **argv)
} }
if (rnd_fake) RAND_cleanup(); if (rnd_fake) RAND_cleanup();
#endif #endif
#ifdef HAVE_FORK #ifndef NO_FORK
show_res: show_res:
#endif #endif
if(!mr) if(!mr)
@@ -2550,7 +2566,7 @@ static void print_result(int alg,int run_no,int count,double time_used)
results[alg][run_no]=((double)count)/time_used*lengths[run_no]; results[alg][run_no]=((double)count)/time_used*lengths[run_no];
} }
#ifdef HAVE_FORK #ifndef NO_FORK
static char *sstrsep(char **string, const char *delim) static char *sstrsep(char **string, const char *delim)
{ {
char isdelim[256]; char isdelim[256];
@@ -2592,7 +2608,11 @@ static int do_multi(int multi)
fds=malloc(multi*sizeof *fds); fds=malloc(multi*sizeof *fds);
for(n=0 ; n < multi ; ++n) for(n=0 ; n < multi ; ++n)
{ {
pipe(fd); if (pipe(fd) == -1)
{
fprintf(stderr, "pipe failure\n");
exit(1);
}
fflush(stdout); fflush(stdout);
fflush(stderr); fflush(stderr);
if(fork()) if(fork())
@@ -2604,7 +2624,11 @@ static int do_multi(int multi)
{ {
close(fd[0]); close(fd[0]);
close(1); close(1);
dup(fd[1]); if (dup(fd[1]) == -1)
{
fprintf(stderr, "dup failed\n");
exit(1);
}
close(fd[1]); close(fd[1]);
mr=1; mr=1;
usertime=0; usertime=0;
@@ -2666,27 +2690,7 @@ static int do_multi(int multi)
else else
rsa_results[k][1]=d; rsa_results[k][1]=d;
} }
else if(!strncmp(buf,"+F2:",4)) #ifndef OPENSSL_NO_DSA
{
int k;
double d;
p=buf+4;
k=atoi(sstrsep(&p,sep));
sstrsep(&p,sep);
d=atof(sstrsep(&p,sep));
if(n)
rsa_results[k][0]=1/(1/rsa_results[k][0]+1/d);
else
rsa_results[k][0]=d;
d=atof(sstrsep(&p,sep));
if(n)
rsa_results[k][1]=1/(1/rsa_results[k][1]+1/d);
else
rsa_results[k][1]=d;
}
else if(!strncmp(buf,"+F3:",4)) else if(!strncmp(buf,"+F3:",4))
{ {
int k; int k;
@@ -2708,6 +2712,7 @@ static int do_multi(int multi)
else else
dsa_results[k][1]=d; dsa_results[k][1]=d;
} }
#endif
#ifndef OPENSSL_NO_ECDSA #ifndef OPENSSL_NO_ECDSA
else if(!strncmp(buf,"+F4:",4)) else if(!strncmp(buf,"+F4:",4))
{ {

View File

@@ -165,6 +165,9 @@ int MAIN(int argc, char **argv)
BIO_set_fp(bio_err, stderr, BIO_NOCLOSE | BIO_FP_TEXT); BIO_set_fp(bio_err, stderr, BIO_NOCLOSE | BIO_FP_TEXT);
} }
if (!load_config(bio_err, NULL))
goto cleanup;
for (argc--, argv++; argc > 0; argc--, argv++) for (argc--, argv++; argc > 0; argc--, argv++)
{ {
if (strcmp(*argv, "-config") == 0) if (strcmp(*argv, "-config") == 0)
@@ -646,7 +649,7 @@ static ASN1_INTEGER *create_nonce(int bits)
/* Generating random byte sequence. */ /* Generating random byte sequence. */
if (len > (int)sizeof(buf)) goto err; if (len > (int)sizeof(buf)) goto err;
if (!RAND_bytes(buf, len)) goto err; if (RAND_bytes(buf, len) <= 0) goto err;
/* Find the first non-zero byte and creating ASN1_INTEGER object. */ /* Find the first non-zero byte and creating ASN1_INTEGER object. */
for (i = 0; i < len && !buf[i]; ++i); for (i = 0; i < len && !buf[i]; ++i);
@@ -1080,7 +1083,7 @@ static X509_STORE *create_cert_store(char *ca_path, char *ca_file)
cert_ctx = X509_STORE_new(); cert_ctx = X509_STORE_new();
/* Setting the callback for certificate chain verification. */ /* Setting the callback for certificate chain verification. */
X509_STORE_set_verify_cb_func(cert_ctx, verify_cb); X509_STORE_set_verify_cb(cert_ctx, verify_cb);
/* Adding a trusted certificate directory source. */ /* Adding a trusted certificate directory source. */
if (ca_path) if (ca_path)

View File

@@ -1,13 +1,13 @@
#!/usr/bin/perl -w #!/usr/bin/perl -w
# Written by Zoltan Glozik <zglozik@stones.com>. # Written by Zoltan Glozik <zglozik@stones.com>.
# Copyright (c) 2002 The OpenTSA Project. All rights reserved. # Copyright (c) 2002 The OpenTSA Project. All rights reserved.
$::version = '$Id: tsget,v 1.1 2006/02/12 23:11:21 ulf Exp $'; $::version = '$Id: tsget,v 1.1.2.2 2009/09/07 17:57:02 steve Exp $';
use strict; use strict;
use IO::Handle; use IO::Handle;
use Getopt::Std; use Getopt::Std;
use File::Basename; use File::Basename;
use WWW::Curl::easy; use WWW::Curl::Easy;
use vars qw(%options); use vars qw(%options);
@@ -37,7 +37,7 @@ sub create_curl {
my $url = shift; my $url = shift;
# Create Curl object. # Create Curl object.
my $curl = WWW::Curl::easy::new(); my $curl = WWW::Curl::Easy::new();
# Error-handling related options. # Error-handling related options.
$curl->setopt(CURLOPT_VERBOSE, 1) if $options{d}; $curl->setopt(CURLOPT_VERBOSE, 1) if $options{d};
@@ -49,7 +49,7 @@ sub create_curl {
$curl->setopt(CURLOPT_CUSTOMREQUEST, "POST"); $curl->setopt(CURLOPT_CUSTOMREQUEST, "POST");
$curl->setopt(CURLOPT_HTTPHEADER, $curl->setopt(CURLOPT_HTTPHEADER,
["Content-Type: application/timestamp-query", ["Content-Type: application/timestamp-query",
"Accept: application/timestamp-reply"]); "Accept: application/timestamp-reply,application/timestamp-response"]);
$curl->setopt(CURLOPT_READFUNCTION, \&read_body); $curl->setopt(CURLOPT_READFUNCTION, \&read_body);
$curl->setopt(CURLOPT_HEADERFUNCTION, sub { return length($_[0]); }); $curl->setopt(CURLOPT_HEADERFUNCTION, sub { return length($_[0]); });
@@ -102,7 +102,8 @@ sub get_timestamp {
$error_string .= " ($::error_buf)" if defined($::error_buf); $error_string .= " ($::error_buf)" if defined($::error_buf);
} else { } else {
my $ct = $curl->getinfo(CURLINFO_CONTENT_TYPE); my $ct = $curl->getinfo(CURLINFO_CONTENT_TYPE);
if (lc($ct) ne "application/timestamp-reply") { if (lc($ct) ne "application/timestamp-reply"
&& lc($ct) ne "application/timestamp-response") {
$error_string = "unexpected content type returned: $ct"; $error_string = "unexpected content type returned: $ct";
} }
} }
@@ -192,4 +193,4 @@ REQUEST: foreach (@ARGV) {
STDERR->printflush(", $output written.\n") if $options{v}; STDERR->printflush(", $output written.\n") if $options{v};
} }
$curl->cleanup(); $curl->cleanup();
WWW::Curl::easy::global_cleanup(); WWW::Curl::Easy::global_cleanup();

View File

@@ -70,8 +70,9 @@
#define PROG verify_main #define PROG verify_main
static int MS_CALLBACK cb(int ok, X509_STORE_CTX *ctx); static int MS_CALLBACK cb(int ok, X509_STORE_CTX *ctx);
static int check(X509_STORE *ctx, char *file, STACK_OF(X509) *uchain, STACK_OF(X509) *tchain, int purpose, ENGINE *e); static int check(X509_STORE *ctx, char *file,
static STACK_OF(X509) *load_untrusted(char *file); STACK_OF(X509) *uchain, STACK_OF(X509) *tchain,
STACK_OF(X509_CRL) *crls, ENGINE *e);
static int v_verbose=0, vflags = 0; static int v_verbose=0, vflags = 0;
int MAIN(int, char **); int MAIN(int, char **);
@@ -80,10 +81,10 @@ int MAIN(int argc, char **argv)
{ {
ENGINE *e = NULL; ENGINE *e = NULL;
int i,ret=1, badarg = 0; int i,ret=1, badarg = 0;
int purpose = -1;
char *CApath=NULL,*CAfile=NULL; char *CApath=NULL,*CAfile=NULL;
char *untfile = NULL, *trustfile = NULL; char *untfile = NULL, *trustfile = NULL, *crlfile = NULL;
STACK_OF(X509) *untrusted = NULL, *trusted = NULL; STACK_OF(X509) *untrusted = NULL, *trusted = NULL;
STACK_OF(X509_CRL) *crls = NULL;
X509_STORE *cert_ctx=NULL; X509_STORE *cert_ctx=NULL;
X509_LOOKUP *lookup=NULL; X509_LOOKUP *lookup=NULL;
X509_VERIFY_PARAM *vpm = NULL; X509_VERIFY_PARAM *vpm = NULL;
@@ -93,7 +94,7 @@ int MAIN(int argc, char **argv)
cert_ctx=X509_STORE_new(); cert_ctx=X509_STORE_new();
if (cert_ctx == NULL) goto end; if (cert_ctx == NULL) goto end;
X509_STORE_set_verify_cb_func(cert_ctx,cb); X509_STORE_set_verify_cb(cert_ctx,cb);
ERR_load_crypto_strings(); ERR_load_crypto_strings();
@@ -139,6 +140,11 @@ int MAIN(int argc, char **argv)
if (argc-- < 1) goto end; if (argc-- < 1) goto end;
trustfile= *(++argv); trustfile= *(++argv);
} }
else if (strcmp(*argv,"-CRLfile") == 0)
{
if (argc-- < 1) goto end;
crlfile= *(++argv);
}
#ifndef OPENSSL_NO_ENGINE #ifndef OPENSSL_NO_ENGINE
else if (strcmp(*argv,"-engine") == 0) else if (strcmp(*argv,"-engine") == 0)
{ {
@@ -192,26 +198,34 @@ int MAIN(int argc, char **argv)
ERR_clear_error(); ERR_clear_error();
if(untfile) { if(untfile)
if(!(untrusted = load_untrusted(untfile))) { {
BIO_printf(bio_err, "Error loading untrusted file %s\n", untfile); untrusted = load_certs(bio_err, untfile, FORMAT_PEM,
ERR_print_errors(bio_err); NULL, e, "untrusted certificates");
if(!untrusted)
goto end; goto end;
} }
}
if(trustfile) { if(trustfile)
if(!(trusted = load_untrusted(trustfile))) { {
BIO_printf(bio_err, "Error loading untrusted file %s\n", trustfile); trusted = load_certs(bio_err, trustfile, FORMAT_PEM,
ERR_print_errors(bio_err); NULL, e, "trusted certificates");
if(!trusted)
goto end; goto end;
} }
}
if (argc < 1) check(cert_ctx, NULL, untrusted, trusted, purpose, e); if(crlfile)
{
crls = load_crls(bio_err, crlfile, FORMAT_PEM,
NULL, e, "other CRLs");
if(!crls)
goto end;
}
if (argc < 1) check(cert_ctx, NULL, untrusted, trusted, crls, e);
else else
for (i=0; i<argc; i++) for (i=0; i<argc; i++)
check(cert_ctx,argv[i], untrusted, trusted, purpose, e); check(cert_ctx,argv[i], untrusted, trusted, crls, e);
ret=0; ret=0;
end: end:
if (ret == 1) { if (ret == 1) {
@@ -232,11 +246,14 @@ end:
if (cert_ctx != NULL) X509_STORE_free(cert_ctx); if (cert_ctx != NULL) X509_STORE_free(cert_ctx);
sk_X509_pop_free(untrusted, X509_free); sk_X509_pop_free(untrusted, X509_free);
sk_X509_pop_free(trusted, X509_free); sk_X509_pop_free(trusted, X509_free);
sk_X509_CRL_pop_free(crls, X509_CRL_free);
apps_shutdown(); apps_shutdown();
OPENSSL_EXIT(ret); OPENSSL_EXIT(ret);
} }
static int check(X509_STORE *ctx, char *file, STACK_OF(X509) *uchain, STACK_OF(X509) *tchain, int purpose, ENGINE *e) static int check(X509_STORE *ctx, char *file,
STACK_OF(X509) *uchain, STACK_OF(X509) *tchain,
STACK_OF(X509_CRL) *crls, ENGINE *e)
{ {
X509 *x=NULL; X509 *x=NULL;
int i=0,ret=0; int i=0,ret=0;
@@ -260,7 +277,8 @@ static int check(X509_STORE *ctx, char *file, STACK_OF(X509) *uchain, STACK_OF(X
goto end; goto end;
} }
if(tchain) X509_STORE_CTX_trusted_stack(csc, tchain); if(tchain) X509_STORE_CTX_trusted_stack(csc, tchain);
if(purpose >= 0) X509_STORE_CTX_set_purpose(csc, purpose); if (crls)
X509_STORE_CTX_set0_crls(csc, crls);
i=X509_verify_cert(csc); i=X509_verify_cert(csc);
X509_STORE_CTX_free(csc); X509_STORE_CTX_free(csc);
@@ -278,90 +296,53 @@ end:
return(ret); return(ret);
} }
static STACK_OF(X509) *load_untrusted(char *certfile)
{
STACK_OF(X509_INFO) *sk=NULL;
STACK_OF(X509) *stack=NULL, *ret=NULL;
BIO *in=NULL;
X509_INFO *xi;
if(!(stack = sk_X509_new_null())) {
BIO_printf(bio_err,"memory allocation failure\n");
goto end;
}
if(!(in=BIO_new_file(certfile, "r"))) {
BIO_printf(bio_err,"error opening the file, %s\n",certfile);
goto end;
}
/* This loads from a file, a stack of x509/crl/pkey sets */
if(!(sk=PEM_X509_INFO_read_bio(in,NULL,NULL,NULL))) {
BIO_printf(bio_err,"error reading the file, %s\n",certfile);
goto end;
}
/* scan over it and pull out the certs */
while (sk_X509_INFO_num(sk))
{
xi=sk_X509_INFO_shift(sk);
if (xi->x509 != NULL)
{
sk_X509_push(stack,xi->x509);
xi->x509=NULL;
}
X509_INFO_free(xi);
}
if(!sk_X509_num(stack)) {
BIO_printf(bio_err,"no certificates in file, %s\n",certfile);
sk_X509_free(stack);
goto end;
}
ret=stack;
end:
BIO_free(in);
sk_X509_INFO_free(sk);
return(ret);
}
static int MS_CALLBACK cb(int ok, X509_STORE_CTX *ctx) static int MS_CALLBACK cb(int ok, X509_STORE_CTX *ctx)
{ {
char buf[256]; int cert_error = X509_STORE_CTX_get_error(ctx);
X509 *current_cert = X509_STORE_CTX_get_current_cert(ctx);
if (!ok) if (!ok)
{ {
if (ctx->current_cert) if (current_cert)
{ {
X509_NAME_oneline( X509_NAME_print_ex_fp(stdout,
X509_get_subject_name(ctx->current_cert),buf, X509_get_subject_name(current_cert),
sizeof buf); 0, XN_FLAG_ONELINE);
printf("%s\n",buf); printf("\n");
}
printf("%serror %d at %d depth lookup:%s\n",
X509_STORE_CTX_get0_parent_ctx(ctx) ? "[CRL path]" : "",
cert_error,
X509_STORE_CTX_get_error_depth(ctx),
X509_verify_cert_error_string(cert_error));
switch(cert_error)
{
case X509_V_ERR_NO_EXPLICIT_POLICY:
policies_print(NULL, ctx);
case X509_V_ERR_CERT_HAS_EXPIRED:
/* since we are just checking the certificates, it is
* ok if they are self signed. But we should still warn
* the user.
*/
case X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT:
/* Continue after extension errors too */
case X509_V_ERR_INVALID_CA:
case X509_V_ERR_INVALID_NON_CA:
case X509_V_ERR_PATH_LENGTH_EXCEEDED:
case X509_V_ERR_INVALID_PURPOSE:
case X509_V_ERR_CRL_HAS_EXPIRED:
case X509_V_ERR_CRL_NOT_YET_VALID:
case X509_V_ERR_UNHANDLED_CRITICAL_EXTENSION:
ok = 1;
} }
printf("error %d at %d depth lookup:%s\n",ctx->error,
ctx->error_depth,
X509_verify_cert_error_string(ctx->error));
if (ctx->error == X509_V_ERR_CERT_HAS_EXPIRED) ok=1;
/* since we are just checking the certificates, it is
* ok if they are self signed. But we should still warn
* the user.
*/
if (ctx->error == X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT) ok=1;
/* Continue after extension errors too */
if (ctx->error == X509_V_ERR_INVALID_CA) ok=1;
if (ctx->error == X509_V_ERR_INVALID_NON_CA) ok=1;
if (ctx->error == X509_V_ERR_PATH_LENGTH_EXCEEDED) ok=1;
if (ctx->error == X509_V_ERR_INVALID_PURPOSE) ok=1;
if (ctx->error == X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT) ok=1;
if (ctx->error == X509_V_ERR_CRL_HAS_EXPIRED) ok=1;
if (ctx->error == X509_V_ERR_CRL_NOT_YET_VALID) ok=1;
if (ctx->error == X509_V_ERR_UNHANDLED_CRITICAL_EXTENSION) ok=1;
if (ctx->error == X509_V_ERR_NO_EXPLICIT_POLICY)
policies_print(NULL, ctx);
return ok; return ok;
} }
if ((ctx->error == X509_V_OK) && (ok == 2)) if (cert_error == X509_V_OK && ok == 2)
policies_print(NULL, ctx); policies_print(NULL, ctx);
if (!v_verbose) if (!v_verbose)
ERR_clear_error(); ERR_clear_error();

188
apps/vms_decc_init.c Executable file
View File

@@ -0,0 +1,188 @@
#if defined( __VMS) && !defined( OPENSSL_NO_DECC_INIT) && \
defined( __DECC) && !defined( __VAX) && (__CRTL_VER >= 70301000)
# define USE_DECC_INIT 1
#endif
#ifdef USE_DECC_INIT
/*
* 2010-04-26 SMS.
*
*----------------------------------------------------------------------
*
* decc_init()
*
* On non-VAX systems, uses LIB$INITIALIZE to set a collection of C
* RTL features without using the DECC$* logical name method.
*
*----------------------------------------------------------------------
*/
#include <stdio.h>
#include <stdlib.h>
#include <unixlib.h>
/* Global storage. */
/* Flag to sense if decc_init() was called. */
int decc_init_done = -1;
/* Structure to hold a DECC$* feature name and its desired value. */
typedef struct
{
char *name;
int value;
} decc_feat_t;
/* Array of DECC$* feature names and their desired values.
* Note: DECC$ARGV_PARSE_STYLE is the urgent one.
*/
decc_feat_t decc_feat_array[] =
{
/* Preserve command-line case with SET PROCESS/PARSE_STYLE=EXTENDED */
{ "DECC$ARGV_PARSE_STYLE", 1 },
/* Preserve case for file names on ODS5 disks. */
{ "DECC$EFS_CASE_PRESERVE", 1 },
/* Enable multiple dots (and most characters) in ODS5 file names,
* while preserving VMS-ness of ";version".
*/
{ "DECC$EFS_CHARSET", 1 },
/* List terminator. */
{ (char *)NULL, 0 }
};
/* LIB$INITIALIZE initialization function. */
static void decc_init( void)
{
char *openssl_debug_decc_init;
int verbose = 0;
int feat_index;
int feat_value;
int feat_value_max;
int feat_value_min;
int i;
int sts;
/* Get debug option. */
openssl_debug_decc_init = getenv( "OPENSSL_DEBUG_DECC_INIT");
if (openssl_debug_decc_init != NULL)
{
verbose = strtol( openssl_debug_decc_init, NULL, 10);
if (verbose <= 0)
{
verbose = 1;
}
}
/* Set the global flag to indicate that LIB$INITIALIZE worked. */
decc_init_done = 1;
/* Loop through all items in the decc_feat_array[]. */
for (i = 0; decc_feat_array[ i].name != NULL; i++)
{
/* Get the feature index. */
feat_index = decc$feature_get_index( decc_feat_array[ i].name);
if (feat_index >= 0)
{
/* Valid item. Collect its properties. */
feat_value = decc$feature_get_value( feat_index, 1);
feat_value_min = decc$feature_get_value( feat_index, 2);
feat_value_max = decc$feature_get_value( feat_index, 3);
/* Check the validity of our desired value. */
if ((decc_feat_array[ i].value >= feat_value_min) &&
(decc_feat_array[ i].value <= feat_value_max))
{
/* Valid value. Set it if necessary. */
if (feat_value != decc_feat_array[ i].value)
{
sts = decc$feature_set_value( feat_index,
1,
decc_feat_array[ i].value);
if (verbose > 1)
{
fprintf( stderr, " %s = %d, sts = %d.\n",
decc_feat_array[ i].name,
decc_feat_array[ i].value,
sts);
}
}
}
else
{
/* Invalid DECC feature value. */
fprintf( stderr,
" INVALID DECC$FEATURE VALUE, %d: %d <= %s <= %d.\n",
feat_value,
feat_value_min, decc_feat_array[ i].name, feat_value_max);
}
}
else
{
/* Invalid DECC feature name. */
fprintf( stderr,
" UNKNOWN DECC$FEATURE: %s.\n", decc_feat_array[ i].name);
}
}
if (verbose > 0)
{
fprintf( stderr, " DECC_INIT complete.\n");
}
}
/* Get "decc_init()" into a valid, loaded LIB$INITIALIZE PSECT. */
#pragma nostandard
/* Establish the LIB$INITIALIZE PSECTs, with proper alignment and
* other attributes. Note that "nopic" is significant only on VAX.
*/
#pragma extern_model save
#if __INITIAL_POINTER_SIZE == 64
# define PSECT_ALIGN 3
#else
# define PSECT_ALIGN 2
#endif
#pragma extern_model strict_refdef "LIB$INITIALIZ" PSECT_ALIGN, nopic, nowrt
const int spare[ 8] = { 0 };
#pragma extern_model strict_refdef "LIB$INITIALIZE" PSECT_ALIGN, nopic, nowrt
void (*const x_decc_init)() = decc_init;
#pragma extern_model restore
/* Fake reference to ensure loading the LIB$INITIALIZE PSECT. */
#pragma extern_model save
int LIB$INITIALIZE( void);
#pragma extern_model strict_refdef
int dmy_lib$initialize = (int) LIB$INITIALIZE;
#pragma extern_model restore
#pragma standard
#else /* def USE_DECC_INIT */
/* Dummy code to avoid a %CC-W-EMPTYFILE complaint. */
int decc_init_dummy( void);
#endif /* def USE_DECC_INIT */

View File

@@ -99,7 +99,13 @@ static const char *x509_usage[]={
" -passin arg - private key password source\n", " -passin arg - private key password source\n",
" -serial - print serial number value\n", " -serial - print serial number value\n",
" -subject_hash - print subject hash value\n", " -subject_hash - print subject hash value\n",
#ifndef OPENSSL_NO_MD5
" -subject_hash_old - print old-style (MD5) subject hash value\n",
#endif
" -issuer_hash - print issuer hash value\n", " -issuer_hash - print issuer hash value\n",
#ifndef OPENSSL_NO_MD5
" -issuer_hash_old - print old-style (MD5) issuer hash value\n",
#endif
" -hash - synonym for -subject_hash\n", " -hash - synonym for -subject_hash\n",
" -subject - print subject DN\n", " -subject - print subject DN\n",
" -issuer - print issuer DN\n", " -issuer - print issuer DN\n",
@@ -179,6 +185,9 @@ int MAIN(int argc, char **argv)
int text=0,serial=0,subject=0,issuer=0,startdate=0,enddate=0; int text=0,serial=0,subject=0,issuer=0,startdate=0,enddate=0;
int next_serial=0; int next_serial=0;
int subject_hash=0,issuer_hash=0,ocspid=0; int subject_hash=0,issuer_hash=0,ocspid=0;
#ifndef OPENSSL_NO_MD5
int subject_hash_old=0,issuer_hash_old=0;
#endif
int noout=0,sign_flag=0,CA_flag=0,CA_createserial=0,email=0; int noout=0,sign_flag=0,CA_flag=0,CA_createserial=0,email=0;
int ocsp_uri=0; int ocsp_uri=0;
int trustout=0,clrtrust=0,clrreject=0,aliasout=0,clrext=0; int trustout=0,clrtrust=0,clrreject=0,aliasout=0,clrext=0;
@@ -225,7 +234,7 @@ int MAIN(int argc, char **argv)
ctx=X509_STORE_new(); ctx=X509_STORE_new();
if (ctx == NULL) goto end; if (ctx == NULL) goto end;
X509_STORE_set_verify_cb_func(ctx,callb); X509_STORE_set_verify_cb(ctx,callb);
argc--; argc--;
argv++; argv++;
@@ -397,8 +406,16 @@ int MAIN(int argc, char **argv)
else if (strcmp(*argv,"-hash") == 0 else if (strcmp(*argv,"-hash") == 0
|| strcmp(*argv,"-subject_hash") == 0) || strcmp(*argv,"-subject_hash") == 0)
subject_hash= ++num; subject_hash= ++num;
#ifndef OPENSSL_NO_MD5
else if (strcmp(*argv,"-subject_hash_old") == 0)
subject_hash_old= ++num;
#endif
else if (strcmp(*argv,"-issuer_hash") == 0) else if (strcmp(*argv,"-issuer_hash") == 0)
issuer_hash= ++num; issuer_hash= ++num;
#ifndef OPENSSL_NO_MD5
else if (strcmp(*argv,"-issuer_hash_old") == 0)
issuer_hash_old= ++num;
#endif
else if (strcmp(*argv,"-subject") == 0) else if (strcmp(*argv,"-subject") == 0)
subject= ++num; subject= ++num;
else if (strcmp(*argv,"-issuer") == 0) else if (strcmp(*argv,"-issuer") == 0)
@@ -539,7 +556,6 @@ bad:
if (reqfile) if (reqfile)
{ {
EVP_PKEY *pkey; EVP_PKEY *pkey;
X509_CINF *ci;
BIO *in; BIO *in;
if (!sign_flag && !CA_flag) if (!sign_flag && !CA_flag)
@@ -607,7 +623,6 @@ bad:
print_name(bio_err, "subject=", X509_REQ_get_subject_name(req), nmflag); print_name(bio_err, "subject=", X509_REQ_get_subject_name(req), nmflag);
if ((x=X509_new()) == NULL) goto end; if ((x=X509_new()) == NULL) goto end;
ci=x->cert_info;
if (sno == NULL) if (sno == NULL)
{ {
@@ -626,7 +641,7 @@ bad:
if (!X509_set_subject_name(x,req->req_info->subject)) goto end; if (!X509_set_subject_name(x,req->req_info->subject)) goto end;
X509_gmtime_adj(X509_get_notBefore(x),0); X509_gmtime_adj(X509_get_notBefore(x),0);
X509_gmtime_adj(X509_get_notAfter(x),(long)60*60*24*days); X509_time_adj_ex(X509_get_notAfter(x),days, 0, NULL);
pkey = X509_REQ_get_pubkey(req); pkey = X509_REQ_get_pubkey(req);
X509_set_pubkey(x,pkey); X509_set_pubkey(x,pkey);
@@ -738,14 +753,14 @@ bad:
else if ((email == i) || (ocsp_uri == i)) else if ((email == i) || (ocsp_uri == i))
{ {
int j; int j;
STACK_OF(STRING) *emlst; STACK_OF(OPENSSL_STRING) *emlst;
if (email == i) if (email == i)
emlst = X509_get1_email(x); emlst = X509_get1_email(x);
else else
emlst = X509_get1_ocsp(x); emlst = X509_get1_ocsp(x);
for (j = 0; j < sk_STRING_num(emlst); j++) for (j = 0; j < sk_OPENSSL_STRING_num(emlst); j++)
BIO_printf(STDout, "%s\n", BIO_printf(STDout, "%s\n",
sk_STRING_value(emlst, j)); sk_OPENSSL_STRING_value(emlst, j));
X509_email_free(emlst); X509_email_free(emlst);
} }
else if (aliasout == i) else if (aliasout == i)
@@ -759,10 +774,22 @@ bad:
{ {
BIO_printf(STDout,"%08lx\n",X509_subject_name_hash(x)); BIO_printf(STDout,"%08lx\n",X509_subject_name_hash(x));
} }
#ifndef OPENSSL_NO_MD5
else if (subject_hash_old == i)
{
BIO_printf(STDout,"%08lx\n",X509_subject_name_hash_old(x));
}
#endif
else if (issuer_hash == i) else if (issuer_hash == i)
{ {
BIO_printf(STDout,"%08lx\n",X509_issuer_name_hash(x)); BIO_printf(STDout,"%08lx\n",X509_issuer_name_hash(x));
} }
#ifndef OPENSSL_NO_MD5
else if (issuer_hash_old == i)
{
BIO_printf(STDout,"%08lx\n",X509_issuer_name_hash_old(x));
}
#endif
else if (pprint == i) else if (pprint == i)
{ {
X509_PURPOSE *ptmp; X509_PURPOSE *ptmp;
@@ -960,7 +987,7 @@ bad:
else else
{ {
pk=load_key(bio_err, pk=load_key(bio_err,
keyfile, FORMAT_PEM, 0, keyfile, keyformat, 0,
passin, e, "request key"); passin, e, "request key");
if (pk == NULL) goto end; if (pk == NULL) goto end;
} }
@@ -1130,6 +1157,7 @@ static int x509_certify(X509_STORE *ctx, char *CAfile, const EVP_MD *digest,
/* NOTE: this certificate can/should be self signed, unless it was /* NOTE: this certificate can/should be self signed, unless it was
* a certificate request in which case it is not. */ * a certificate request in which case it is not. */
X509_STORE_CTX_set_cert(&xsc,x); X509_STORE_CTX_set_cert(&xsc,x);
X509_STORE_CTX_set_flags(&xsc, X509_V_FLAG_CHECK_SS_SIGNATURE);
if (!reqfile && X509_verify_cert(&xsc) <= 0) if (!reqfile && X509_verify_cert(&xsc) <= 0)
goto end; goto end;
@@ -1146,7 +1174,7 @@ static int x509_certify(X509_STORE *ctx, char *CAfile, const EVP_MD *digest,
goto end; goto end;
/* hardwired expired */ /* hardwired expired */
if (X509_gmtime_adj(X509_get_notAfter(x),(long)60*60*24*days) == NULL) if (X509_time_adj_ex(X509_get_notAfter(x),days, 0, NULL) == NULL)
goto end; goto end;
if (clrext) if (clrext)

28
config
View File

@@ -48,10 +48,10 @@ done
# First get uname entries that we use below # First get uname entries that we use below
MACHINE=`(uname -m) 2>/dev/null` || MACHINE="unknown" [ "$MACHINE" ] || MACHINE=`(uname -m) 2>/dev/null` || MACHINE="unknown"
RELEASE=`(uname -r) 2>/dev/null` || RELEASE="unknown" [ "$RELEASE" ] || RELEASE=`(uname -r) 2>/dev/null` || RELEASE="unknown"
SYSTEM=`(uname -s) 2>/dev/null` || SYSTEM="unknown" [ "$SYSTEM" ] || SYSTEM=`(uname -s) 2>/dev/null` || SYSTEM="unknown"
VERSION=`(uname -v) 2>/dev/null` || VERSION="unknown" [ "$BUILD" ] || VERSION=`(uname -v) 2>/dev/null` || VERSION="unknown"
# Now test for ISC and SCO, since it is has a braindamaged uname. # Now test for ISC and SCO, since it is has a braindamaged uname.
@@ -496,6 +496,12 @@ echo Operating system: $GUESSOS
# script above so we end up with values in vars but that would take # script above so we end up with values in vars but that would take
# more time that I want to waste at the moment # more time that I want to waste at the moment
case "$GUESSOS" in case "$GUESSOS" in
uClinux*64*)
OUT=uClinux-dist64
;;
uClinux*)
OUT=uClinux-dist
;;
mips2-sgi-irix) mips2-sgi-irix)
CPU=`(hinv -t cpu) 2>/dev/null | head -1 | sed 's/^CPU:[^R]*R\([0-9]*\).*/\1/'` CPU=`(hinv -t cpu) 2>/dev/null | head -1 | sed 's/^CPU:[^R]*R\([0-9]*\).*/\1/'`
CPU=${CPU:-0} CPU=${CPU:-0}
@@ -700,7 +706,7 @@ case "$GUESSOS" in
libc=/usr/lib/libc.so libc=/usr/lib/libc.so
else # OpenBSD else # OpenBSD
# ld searches for highest libc.so.* and so do we # ld searches for highest libc.so.* and so do we
libc=`(ls /usr/lib/libc.so.* | tail -1) 2>/dev/null` libc=`(ls /usr/lib/libc.so.* /lib/libc.so.* | tail -1) 2>/dev/null`
fi fi
case "`(file -L $libc) 2>/dev/null`" in case "`(file -L $libc) 2>/dev/null`" in
*ELF*) OUT="BSD-x86-elf" ;; *ELF*) OUT="BSD-x86-elf" ;;
@@ -769,6 +775,10 @@ case "$GUESSOS" in
OBJECT_MODE=${OBJECT_MODE:-32} OBJECT_MODE=${OBJECT_MODE:-32}
if [ "$CC" = "gcc" ]; then if [ "$CC" = "gcc" ]; then
OUT="aix-gcc" OUT="aix-gcc"
if [ $OBJECT_MODE -eq 64 ]; then
echo 'Your $OBJECT_MODE was found to be set to 64'
OUT="aix64-gcc"
fi
elif [ $OBJECT_MODE -eq 64 ]; then elif [ $OBJECT_MODE -eq 64 ]; then
echo 'Your $OBJECT_MODE was found to be set to 64' echo 'Your $OBJECT_MODE was found to be set to 64'
OUT="aix64-cc" OUT="aix64-cc"
@@ -798,6 +808,8 @@ case "$GUESSOS" in
j90-cray-unicos) OUT="cray-j90" ;; j90-cray-unicos) OUT="cray-j90" ;;
nsr-tandem-nsk) OUT="tandem-c89" ;; nsr-tandem-nsk) OUT="tandem-c89" ;;
beos-*) OUT="$GUESSOS" ;; beos-*) OUT="$GUESSOS" ;;
x86pc-*-qnx6) OUT="QNX6-i386" ;;
*-*-qnx6) OUT="QNX6" ;;
*) OUT=`echo $GUESSOS | awk -F- '{print $3}'`;; *) OUT=`echo $GUESSOS | awk -F- '{print $3}'`;;
esac esac
@@ -813,6 +825,12 @@ esac
# options="$options -DATALLA" # options="$options -DATALLA"
#fi #fi
if expr "$options" : '.*no\-asm' > /dev/null; then :; else
sh -c "$CROSS_COMPILE${CC:-gcc} -Wa,--help -c -o /tmp/null.$$.o -x assembler /dev/null && rm /tmp/null.$$.o" 2>&1 | \
grep \\--noexecstack >/dev/null && \
options="$options -Wa,--noexecstack"
fi
# gcc < 2.8 does not support -march=ultrasparc # gcc < 2.8 does not support -march=ultrasparc
if [ "$OUT" = solaris-sparcv9-gcc -a $GCCVER -lt 28 ] if [ "$OUT" = solaris-sparcv9-gcc -a $GCCVER -lt 28 ]
then then

View File

@@ -1,4 +1,3 @@
/* $LP: LPlib/source/LPdir_vms.c,v 1.20 2004/08/26 13:36:05 _cvs_levitte Exp $ */
/* /*
* Copyright (c) 2004, Richard Levitte <richard@levitte.org> * Copyright (c) 2004, Richard Levitte <richard@levitte.org>
* All rights reserved. * All rights reserved.
@@ -40,22 +39,18 @@
#ifndef LPDIR_H #ifndef LPDIR_H
#include "LPdir.h" #include "LPdir.h"
#endif #endif
#include "vms_rms.h"
/* Because some compiler options hide this macor */ /* Some compiler options hide EVMSERR. */
#ifndef EVMSERR #ifndef EVMSERR
#define EVMSERR 65535 /* error for non-translatable VMS errors */ # define EVMSERR 65535 /* error for non-translatable VMS errors */
#endif #endif
struct LP_dir_context_st struct LP_dir_context_st
{ {
unsigned long VMS_context; unsigned long VMS_context;
#ifdef NAML$C_MAXRSS char filespec[ NAMX_MAXRSS+ 1];
char filespec[NAML$C_MAXRSS+1]; char result[ NAMX_MAXRSS+ 1];
char result[NAML$C_MAXRSS+1];
#else
char filespec[256];
char result[256];
#endif
struct dsc$descriptor_d filespec_dsc; struct dsc$descriptor_d filespec_dsc;
struct dsc$descriptor_d result_dsc; struct dsc$descriptor_d result_dsc;
}; };
@@ -66,6 +61,16 @@ const char *LP_find_file(LP_DIR_CTX **ctx, const char *directory)
char *p, *r; char *p, *r;
size_t l; size_t l;
unsigned long flags = 0; unsigned long flags = 0;
/* Arrange 32-bit pointer to (copied) string storage, if needed. */
#if __INITIAL_POINTER_SIZE == 64
# pragma pointer_size save
# pragma pointer_size 32
char *ctx_filespec_32p;
# pragma pointer_size restore
char ctx_filespec_32[ NAMX_MAXRSS+ 1];
#endif /* __INITIAL_POINTER_SIZE == 64 */
#ifdef NAML$C_MAXRSS #ifdef NAML$C_MAXRSS
flags |= LIB$M_FIL_LONG_NAMES; flags |= LIB$M_FIL_LONG_NAMES;
#endif #endif
@@ -82,6 +87,12 @@ const char *LP_find_file(LP_DIR_CTX **ctx, const char *directory)
size_t filespeclen = strlen(directory); size_t filespeclen = strlen(directory);
char *filespec = NULL; char *filespec = NULL;
if (filespeclen == 0)
{
errno = ENOENT;
return 0;
}
/* MUST be a VMS directory specification! Let's estimate if it is. */ /* MUST be a VMS directory specification! Let's estimate if it is. */
if (directory[filespeclen-1] != ']' if (directory[filespeclen-1] != ']'
&& directory[filespeclen-1] != '>' && directory[filespeclen-1] != '>'
@@ -93,13 +104,7 @@ const char *LP_find_file(LP_DIR_CTX **ctx, const char *directory)
filespeclen += 4; /* "*.*;" */ filespeclen += 4; /* "*.*;" */
if (filespeclen > if (filespeclen > NAMX_MAXRSS)
#ifdef NAML$C_MAXRSS
NAML$C_MAXRSS
#else
255
#endif
)
{ {
errno = ENAMETOOLONG; errno = ENAMETOOLONG;
return 0; return 0;
@@ -115,14 +120,21 @@ const char *LP_find_file(LP_DIR_CTX **ctx, const char *directory)
strcpy((*ctx)->filespec,directory); strcpy((*ctx)->filespec,directory);
strcat((*ctx)->filespec,"*.*;"); strcat((*ctx)->filespec,"*.*;");
/* Arrange 32-bit pointer to (copied) string storage, if needed. */
#if __INITIAL_POINTER_SIZE == 64
# define CTX_FILESPEC ctx_filespec_32p
/* Copy the file name to storage with a 32-bit pointer. */
ctx_filespec_32p = ctx_filespec_32;
strcpy( ctx_filespec_32p, (*ctx)->filespec);
#else /* __INITIAL_POINTER_SIZE == 64 */
# define CTX_FILESPEC (*ctx)->filespec
#endif /* __INITIAL_POINTER_SIZE == 64 [else] */
(*ctx)->filespec_dsc.dsc$w_length = filespeclen; (*ctx)->filespec_dsc.dsc$w_length = filespeclen;
(*ctx)->filespec_dsc.dsc$b_dtype = DSC$K_DTYPE_T; (*ctx)->filespec_dsc.dsc$b_dtype = DSC$K_DTYPE_T;
(*ctx)->filespec_dsc.dsc$b_class = DSC$K_CLASS_S; (*ctx)->filespec_dsc.dsc$b_class = DSC$K_CLASS_S;
(*ctx)->filespec_dsc.dsc$a_pointer = (*ctx)->filespec; (*ctx)->filespec_dsc.dsc$a_pointer = CTX_FILESPEC;
(*ctx)->result_dsc.dsc$w_length = 0;
(*ctx)->result_dsc.dsc$b_dtype = DSC$K_DTYPE_T;
(*ctx)->result_dsc.dsc$b_class = DSC$K_CLASS_D;
(*ctx)->result_dsc.dsc$a_pointer = 0;
} }
(*ctx)->result_dsc.dsc$w_length = 0; (*ctx)->result_dsc.dsc$w_length = 0;

View File

@@ -1,4 +1,3 @@
/* $LP: LPlib/source/LPdir_win.c,v 1.10 2004/08/26 13:36:05 _cvs_levitte Exp $ */
/* /*
* Copyright (c) 2004, Richard Levitte <richard@levitte.org> * Copyright (c) 2004, Richard Levitte <richard@levitte.org>
* All rights reserved. * All rights reserved.
@@ -37,7 +36,7 @@
#if defined(LP_SYS_WINCE) && !defined(FindFirstFile) #if defined(LP_SYS_WINCE) && !defined(FindFirstFile)
# define FindFirstFile FindFirstFileW # define FindFirstFile FindFirstFileW
#endif #endif
#if defined(LP_SYS_WINCE) && !defined(FindFirstFile) #if defined(LP_SYS_WINCE) && !defined(FindNextFile)
# define FindNextFile FindNextFileW # define FindNextFile FindNextFileW
#endif #endif
@@ -63,6 +62,16 @@ const char *LP_find_file(LP_DIR_CTX **ctx, const char *directory)
errno = 0; errno = 0;
if (*ctx == NULL) if (*ctx == NULL)
{ {
const char *extdir = directory;
char *extdirbuf = NULL;
size_t dirlen = strlen (directory);
if (dirlen == 0)
{
errno = ENOENT;
return 0;
}
*ctx = (LP_DIR_CTX *)malloc(sizeof(LP_DIR_CTX)); *ctx = (LP_DIR_CTX *)malloc(sizeof(LP_DIR_CTX));
if (*ctx == NULL) if (*ctx == NULL)
{ {
@@ -71,15 +80,35 @@ const char *LP_find_file(LP_DIR_CTX **ctx, const char *directory)
} }
memset(*ctx, '\0', sizeof(LP_DIR_CTX)); memset(*ctx, '\0', sizeof(LP_DIR_CTX));
if (directory[dirlen-1] != '*')
{
extdirbuf = (char *)malloc(dirlen + 3);
if (extdirbuf == NULL)
{
free(*ctx);
*ctx = NULL;
errno = ENOMEM;
return 0;
}
if (directory[dirlen-1] != '/' && directory[dirlen-1] != '\\')
extdir = strcat(strcpy (extdirbuf,directory),"/*");
else
extdir = strcat(strcpy (extdirbuf,directory),"*");
}
if (sizeof(TCHAR) != sizeof(char)) if (sizeof(TCHAR) != sizeof(char))
{ {
TCHAR *wdir = NULL; TCHAR *wdir = NULL;
/* len_0 denotes string length *with* trailing 0 */ /* len_0 denotes string length *with* trailing 0 */
size_t index = 0,len_0 = strlen(directory) + 1; size_t index = 0,len_0 = strlen(extdir) + 1;
wdir = (TCHAR *)malloc(len_0 * sizeof(TCHAR)); wdir = (TCHAR *)calloc(len_0, sizeof(TCHAR));
if (wdir == NULL) if (wdir == NULL)
{ {
if (extdirbuf != NULL)
{
free (extdirbuf);
}
free(*ctx); free(*ctx);
*ctx = NULL; *ctx = NULL;
errno = ENOMEM; errno = ENOMEM;
@@ -87,17 +116,23 @@ const char *LP_find_file(LP_DIR_CTX **ctx, const char *directory)
} }
#ifdef LP_MULTIBYTE_AVAILABLE #ifdef LP_MULTIBYTE_AVAILABLE
if (!MultiByteToWideChar(CP_ACP, 0, directory, len_0, (WCHAR *)wdir, len_0)) if (!MultiByteToWideChar(CP_ACP, 0, extdir, len_0, (WCHAR *)wdir, len_0))
#endif #endif
for (index = 0; index < len_0; index++) for (index = 0; index < len_0; index++)
wdir[index] = (TCHAR)directory[index]; wdir[index] = (TCHAR)extdir[index];
(*ctx)->handle = FindFirstFile(wdir, &(*ctx)->ctx); (*ctx)->handle = FindFirstFile(wdir, &(*ctx)->ctx);
free(wdir); free(wdir);
} }
else else
(*ctx)->handle = FindFirstFile((TCHAR *)directory, &(*ctx)->ctx); {
(*ctx)->handle = FindFirstFile((TCHAR *)extdir, &(*ctx)->ctx);
}
if (extdirbuf != NULL)
{
free (extdirbuf);
}
if ((*ctx)->handle == INVALID_HANDLE_VALUE) if ((*ctx)->handle == INVALID_HANDLE_VALUE)
{ {
@@ -114,7 +149,6 @@ const char *LP_find_file(LP_DIR_CTX **ctx, const char *directory)
return 0; return 0;
} }
} }
if (sizeof(TCHAR) != sizeof(char)) if (sizeof(TCHAR) != sizeof(char))
{ {
TCHAR *wdir = (*ctx)->ctx.cFileName; TCHAR *wdir = (*ctx)->ctx.cFileName;

View File

@@ -5,9 +5,9 @@
DIR= crypto DIR= crypto
TOP= .. TOP= ..
CC= cc CC= cc
INCLUDE= -I. -I$(TOP) -I../include INCLUDE= -I. -I$(TOP) -I../include $(ZLIB_INCLUDE)
# INCLUDES targets sudbirs! # INCLUDES targets sudbirs!
INCLUDES= -I.. -I../.. -I../asn1 -I../evp -I../../include INCLUDES= -I.. -I../.. -I../asn1 -I../evp -I../../include $(ZLIB_INCLUDE)
CFLAG= -g CFLAG= -g
MAKEDEPPROG= makedepend MAKEDEPPROG= makedepend
MAKEDEPEND= $(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG) MAKEDEPEND= $(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG)
@@ -31,6 +31,7 @@ CPUID_OBJ=mem_clr.o
LIBS= LIBS=
GENERAL=Makefile README crypto-lib.com install.com GENERAL=Makefile README crypto-lib.com install.com
TEST=constant_time_test.c
LIB= $(TOP)/libcrypto.a LIB= $(TOP)/libcrypto.a
SHARED_LIB= libcrypto$(SHLIB_EXT) SHARED_LIB= libcrypto$(SHLIB_EXT)
@@ -41,7 +42,8 @@ SRC= $(LIBSRC)
EXHEADER= crypto.h opensslv.h opensslconf.h ebcdic.h symhacks.h \ EXHEADER= crypto.h opensslv.h opensslconf.h ebcdic.h symhacks.h \
ossl_typ.h ossl_typ.h
HEADER= cryptlib.h buildinf.h md32_common.h o_time.h o_str.h o_dir.h $(EXHEADER) HEADER= cryptlib.h buildinf.h md32_common.h o_time.h o_str.h o_dir.h \
constant_time_locl.h $(EXHEADER)
ALL= $(GENERAL) $(SRC) $(HEADER) ALL= $(GENERAL) $(SRC) $(HEADER)
@@ -51,12 +53,7 @@ top:
all: shared all: shared
buildinf.h: ../Makefile buildinf.h: ../Makefile
( echo "#ifndef MK1MF_BUILD"; \ $(PERL) $(TOP)/util/mkbuildinf.pl "$(CC) $(CFLAGS)" "$(PLATFORM)" >buildinf.h
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`\""; \
echo '#endif' ) >buildinf.h
x86cpuid.s: x86cpuid.pl perlasm/x86asm.pl x86cpuid.s: x86cpuid.pl perlasm/x86asm.pl
$(PERL) x86cpuid.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) > $@ $(PERL) x86cpuid.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) > $@
@@ -74,7 +71,9 @@ x86_64cpuid.s: x86_64cpuid.pl
$(PERL) x86_64cpuid.pl $(PERLASM_SCHEME) > $@ $(PERL) x86_64cpuid.pl $(PERLASM_SCHEME) > $@
ia64cpuid.s: ia64cpuid.S ia64cpuid.s: ia64cpuid.S
$(CC) $(CFLAGS) -E ia64cpuid.S > $@ $(CC) $(CFLAGS) -E ia64cpuid.S > $@
ppccpuid.s: ppccpuid.pl; $(PERL) ppccpuid.pl $(PERLASM_SCHEME) $@ ppccpuid.s: ppccpuid.pl; $(PERL) ppccpuid.pl $(PERLASM_SCHEME) $@
alphacpuid.s: alphacpuid.pl
$(PERL) $< | $(CC) -E - | tee $@ > /dev/null
testapps: testapps:
[ -z "$(THIS)" ] || ( if echo $(SDIRS) | fgrep ' des '; \ [ -z "$(THIS)" ] || ( if echo $(SDIRS) | fgrep ' des '; \

View File

@@ -85,9 +85,9 @@ int AES_wrap_key(AES_KEY *key, const unsigned char *iv,
A[7] ^= (unsigned char)(t & 0xff); A[7] ^= (unsigned char)(t & 0xff);
if (t > 0xff) if (t > 0xff)
{ {
A[6] ^= (unsigned char)((t & 0xff) >> 8); A[6] ^= (unsigned char)((t >> 8) & 0xff);
A[5] ^= (unsigned char)((t & 0xff) >> 16); A[5] ^= (unsigned char)((t >> 16) & 0xff);
A[4] ^= (unsigned char)((t & 0xff) >> 24); A[4] ^= (unsigned char)((t >> 24) & 0xff);
} }
memcpy(R, B + 8, 8); memcpy(R, B + 8, 8);
} }
@@ -119,9 +119,9 @@ int AES_unwrap_key(AES_KEY *key, const unsigned char *iv,
A[7] ^= (unsigned char)(t & 0xff); A[7] ^= (unsigned char)(t & 0xff);
if (t > 0xff) if (t > 0xff)
{ {
A[6] ^= (unsigned char)((t & 0xff) >> 8); A[6] ^= (unsigned char)((t >> 8) & 0xff);
A[5] ^= (unsigned char)((t & 0xff) >> 16); A[5] ^= (unsigned char)((t >> 16) & 0xff);
A[4] ^= (unsigned char)((t & 0xff) >> 24); A[4] ^= (unsigned char)((t >> 24) & 0xff);
} }
memcpy(B + 8, R, 8); memcpy(B + 8, R, 8);
AES_decrypt(B, B, key); AES_decrypt(B, B, key);

View File

@@ -16,12 +16,20 @@
# allows to merge logical or arithmetic operation with shift or rotate # allows to merge logical or arithmetic operation with shift or rotate
# in one instruction and emit combined result every cycle. The module # in one instruction and emit combined result every cycle. The module
# is endian-neutral. The performance is ~42 cycles/byte for 128-bit # is endian-neutral. The performance is ~42 cycles/byte for 128-bit
# key. # key [on single-issue Xscale PXA250 core].
# May 2007. # May 2007.
# #
# AES_set_[en|de]crypt_key is added. # AES_set_[en|de]crypt_key is added.
# July 2010.
#
# Rescheduling for dual-issue pipeline resulted in 12% improvement on
# Cortex A8 core and ~25 cycles per byte processed with 128-bit key.
while (($output=shift) && ($output!~/^\w[\w\-]*\.\w+$/)) {}
open STDOUT,">$output";
$s0="r0"; $s0="r0";
$s1="r1"; $s1="r1";
$s2="r2"; $s2="r2";
@@ -164,24 +172,24 @@ AES_encrypt:
ldrb $t2,[$rounds,#1] ldrb $t2,[$rounds,#1]
ldrb $t3,[$rounds,#0] ldrb $t3,[$rounds,#0]
orr $s0,$s0,$t1,lsl#8 orr $s0,$s0,$t1,lsl#8
orr $s0,$s0,$t2,lsl#16
orr $s0,$s0,$t3,lsl#24
ldrb $s1,[$rounds,#7] ldrb $s1,[$rounds,#7]
orr $s0,$s0,$t2,lsl#16
ldrb $t1,[$rounds,#6] ldrb $t1,[$rounds,#6]
orr $s0,$s0,$t3,lsl#24
ldrb $t2,[$rounds,#5] ldrb $t2,[$rounds,#5]
ldrb $t3,[$rounds,#4] ldrb $t3,[$rounds,#4]
orr $s1,$s1,$t1,lsl#8 orr $s1,$s1,$t1,lsl#8
orr $s1,$s1,$t2,lsl#16
orr $s1,$s1,$t3,lsl#24
ldrb $s2,[$rounds,#11] ldrb $s2,[$rounds,#11]
orr $s1,$s1,$t2,lsl#16
ldrb $t1,[$rounds,#10] ldrb $t1,[$rounds,#10]
orr $s1,$s1,$t3,lsl#24
ldrb $t2,[$rounds,#9] ldrb $t2,[$rounds,#9]
ldrb $t3,[$rounds,#8] ldrb $t3,[$rounds,#8]
orr $s2,$s2,$t1,lsl#8 orr $s2,$s2,$t1,lsl#8
orr $s2,$s2,$t2,lsl#16
orr $s2,$s2,$t3,lsl#24
ldrb $s3,[$rounds,#15] ldrb $s3,[$rounds,#15]
orr $s2,$s2,$t2,lsl#16
ldrb $t1,[$rounds,#14] ldrb $t1,[$rounds,#14]
orr $s2,$s2,$t3,lsl#24
ldrb $t2,[$rounds,#13] ldrb $t2,[$rounds,#13]
ldrb $t3,[$rounds,#12] ldrb $t3,[$rounds,#12]
orr $s3,$s3,$t1,lsl#8 orr $s3,$s3,$t1,lsl#8
@@ -196,24 +204,24 @@ AES_encrypt:
mov $t3,$s0,lsr#8 mov $t3,$s0,lsr#8
strb $t1,[$rounds,#0] strb $t1,[$rounds,#0]
strb $t2,[$rounds,#1] strb $t2,[$rounds,#1]
strb $t3,[$rounds,#2]
strb $s0,[$rounds,#3]
mov $t1,$s1,lsr#24 mov $t1,$s1,lsr#24
strb $t3,[$rounds,#2]
mov $t2,$s1,lsr#16 mov $t2,$s1,lsr#16
strb $s0,[$rounds,#3]
mov $t3,$s1,lsr#8 mov $t3,$s1,lsr#8
strb $t1,[$rounds,#4] strb $t1,[$rounds,#4]
strb $t2,[$rounds,#5] strb $t2,[$rounds,#5]
strb $t3,[$rounds,#6]
strb $s1,[$rounds,#7]
mov $t1,$s2,lsr#24 mov $t1,$s2,lsr#24
strb $t3,[$rounds,#6]
mov $t2,$s2,lsr#16 mov $t2,$s2,lsr#16
strb $s1,[$rounds,#7]
mov $t3,$s2,lsr#8 mov $t3,$s2,lsr#8
strb $t1,[$rounds,#8] strb $t1,[$rounds,#8]
strb $t2,[$rounds,#9] strb $t2,[$rounds,#9]
strb $t3,[$rounds,#10]
strb $s2,[$rounds,#11]
mov $t1,$s3,lsr#24 mov $t1,$s3,lsr#24
strb $t3,[$rounds,#10]
mov $t2,$s3,lsr#16 mov $t2,$s3,lsr#16
strb $s2,[$rounds,#11]
mov $t3,$s3,lsr#8 mov $t3,$s3,lsr#8
strb $t1,[$rounds,#12] strb $t1,[$rounds,#12]
strb $t2,[$rounds,#13] strb $t2,[$rounds,#13]
@@ -230,141 +238,137 @@ AES_encrypt:
.align 2 .align 2
_armv4_AES_encrypt: _armv4_AES_encrypt:
str lr,[sp,#-4]! @ push lr str lr,[sp,#-4]! @ push lr
ldr $t1,[$key],#16 ldmia $key!,{$t1-$i1}
ldr $t2,[$key,#-12]
ldr $t3,[$key,#-8]
ldr $i1,[$key,#-4]
ldr $rounds,[$key,#240-16]
eor $s0,$s0,$t1 eor $s0,$s0,$t1
ldr $rounds,[$key,#240-16]
eor $s1,$s1,$t2 eor $s1,$s1,$t2
eor $s2,$s2,$t3 eor $s2,$s2,$t3
eor $s3,$s3,$i1 eor $s3,$s3,$i1
sub $rounds,$rounds,#1 sub $rounds,$rounds,#1
mov lr,#255 mov lr,#255
.Lenc_loop: and $i1,lr,$s0
and $i2,lr,$s0,lsr#8 and $i2,lr,$s0,lsr#8
and $i3,lr,$s0,lsr#16 and $i3,lr,$s0,lsr#16
and $i1,lr,$s0
mov $s0,$s0,lsr#24 mov $s0,$s0,lsr#24
.Lenc_loop:
ldr $t1,[$tbl,$i1,lsl#2] @ Te3[s0>>0] ldr $t1,[$tbl,$i1,lsl#2] @ Te3[s0>>0]
ldr $s0,[$tbl,$s0,lsl#2] @ Te0[s0>>24]
ldr $t2,[$tbl,$i2,lsl#2] @ Te2[s0>>8]
ldr $t3,[$tbl,$i3,lsl#2] @ Te1[s0>>16]
and $i1,lr,$s1,lsr#16 @ i0 and $i1,lr,$s1,lsr#16 @ i0
ldr $t2,[$tbl,$i2,lsl#2] @ Te2[s0>>8]
and $i2,lr,$s1 and $i2,lr,$s1
ldr $t3,[$tbl,$i3,lsl#2] @ Te1[s0>>16]
and $i3,lr,$s1,lsr#8 and $i3,lr,$s1,lsr#8
ldr $s0,[$tbl,$s0,lsl#2] @ Te0[s0>>24]
mov $s1,$s1,lsr#24 mov $s1,$s1,lsr#24
ldr $i1,[$tbl,$i1,lsl#2] @ Te1[s1>>16] ldr $i1,[$tbl,$i1,lsl#2] @ Te1[s1>>16]
ldr $s1,[$tbl,$s1,lsl#2] @ Te0[s1>>24]
ldr $i2,[$tbl,$i2,lsl#2] @ Te3[s1>>0] ldr $i2,[$tbl,$i2,lsl#2] @ Te3[s1>>0]
ldr $i3,[$tbl,$i3,lsl#2] @ Te2[s1>>8] ldr $i3,[$tbl,$i3,lsl#2] @ Te2[s1>>8]
eor $s0,$s0,$i1,ror#8 eor $s0,$s0,$i1,ror#8
eor $s1,$s1,$t1,ror#24 ldr $s1,[$tbl,$s1,lsl#2] @ Te0[s1>>24]
eor $t2,$t2,$i2,ror#8
eor $t3,$t3,$i3,ror#8
and $i1,lr,$s2,lsr#8 @ i0 and $i1,lr,$s2,lsr#8 @ i0
eor $t2,$t2,$i2,ror#8
and $i2,lr,$s2,lsr#16 @ i1 and $i2,lr,$s2,lsr#16 @ i1
eor $t3,$t3,$i3,ror#8
and $i3,lr,$s2 and $i3,lr,$s2
mov $s2,$s2,lsr#24 eor $s1,$s1,$t1,ror#24
ldr $i1,[$tbl,$i1,lsl#2] @ Te2[s2>>8] ldr $i1,[$tbl,$i1,lsl#2] @ Te2[s2>>8]
mov $s2,$s2,lsr#24
ldr $i2,[$tbl,$i2,lsl#2] @ Te1[s2>>16] ldr $i2,[$tbl,$i2,lsl#2] @ Te1[s2>>16]
ldr $s2,[$tbl,$s2,lsl#2] @ Te0[s2>>24]
ldr $i3,[$tbl,$i3,lsl#2] @ Te3[s2>>0] ldr $i3,[$tbl,$i3,lsl#2] @ Te3[s2>>0]
eor $s0,$s0,$i1,ror#16 eor $s0,$s0,$i1,ror#16
eor $s1,$s1,$i2,ror#8 ldr $s2,[$tbl,$s2,lsl#2] @ Te0[s2>>24]
eor $s2,$s2,$t2,ror#16
eor $t3,$t3,$i3,ror#16
and $i1,lr,$s3 @ i0 and $i1,lr,$s3 @ i0
eor $s1,$s1,$i2,ror#8
and $i2,lr,$s3,lsr#8 @ i1 and $i2,lr,$s3,lsr#8 @ i1
eor $t3,$t3,$i3,ror#16
and $i3,lr,$s3,lsr#16 @ i2 and $i3,lr,$s3,lsr#16 @ i2
mov $s3,$s3,lsr#24 eor $s2,$s2,$t2,ror#16
ldr $i1,[$tbl,$i1,lsl#2] @ Te3[s3>>0] ldr $i1,[$tbl,$i1,lsl#2] @ Te3[s3>>0]
mov $s3,$s3,lsr#24
ldr $i2,[$tbl,$i2,lsl#2] @ Te2[s3>>8] ldr $i2,[$tbl,$i2,lsl#2] @ Te2[s3>>8]
ldr $i3,[$tbl,$i3,lsl#2] @ Te1[s3>>16] ldr $i3,[$tbl,$i3,lsl#2] @ Te1[s3>>16]
ldr $s3,[$tbl,$s3,lsl#2] @ Te0[s3>>24]
eor $s0,$s0,$i1,ror#24 eor $s0,$s0,$i1,ror#24
ldr $s3,[$tbl,$s3,lsl#2] @ Te0[s3>>24]
eor $s1,$s1,$i2,ror#16 eor $s1,$s1,$i2,ror#16
ldr $i1,[$key],#16
eor $s2,$s2,$i3,ror#8 eor $s2,$s2,$i3,ror#8
ldr $t1,[$key,#-12]
eor $s3,$s3,$t3,ror#8 eor $s3,$s3,$t3,ror#8
ldr $t1,[$key],#16 ldr $t2,[$key,#-8]
ldr $t2,[$key,#-12] eor $s0,$s0,$i1
ldr $t3,[$key,#-8] ldr $t3,[$key,#-4]
ldr $i1,[$key,#-4] and $i1,lr,$s0
eor $s0,$s0,$t1 eor $s1,$s1,$t1
eor $s1,$s1,$t2 and $i2,lr,$s0,lsr#8
eor $s2,$s2,$t3 eor $s2,$s2,$t2
eor $s3,$s3,$i1 and $i3,lr,$s0,lsr#16
eor $s3,$s3,$t3
mov $s0,$s0,lsr#24
subs $rounds,$rounds,#1 subs $rounds,$rounds,#1
bne .Lenc_loop bne .Lenc_loop
add $tbl,$tbl,#2 add $tbl,$tbl,#2
and $i1,lr,$s0
and $i2,lr,$s0,lsr#8
and $i3,lr,$s0,lsr#16
mov $s0,$s0,lsr#24
ldrb $t1,[$tbl,$i1,lsl#2] @ Te4[s0>>0] ldrb $t1,[$tbl,$i1,lsl#2] @ Te4[s0>>0]
ldrb $s0,[$tbl,$s0,lsl#2] @ Te4[s0>>24]
ldrb $t2,[$tbl,$i2,lsl#2] @ Te4[s0>>8]
ldrb $t3,[$tbl,$i3,lsl#2] @ Te4[s0>>16]
and $i1,lr,$s1,lsr#16 @ i0 and $i1,lr,$s1,lsr#16 @ i0
ldrb $t2,[$tbl,$i2,lsl#2] @ Te4[s0>>8]
and $i2,lr,$s1 and $i2,lr,$s1
ldrb $t3,[$tbl,$i3,lsl#2] @ Te4[s0>>16]
and $i3,lr,$s1,lsr#8 and $i3,lr,$s1,lsr#8
ldrb $s0,[$tbl,$s0,lsl#2] @ Te4[s0>>24]
mov $s1,$s1,lsr#24 mov $s1,$s1,lsr#24
ldrb $i1,[$tbl,$i1,lsl#2] @ Te4[s1>>16] ldrb $i1,[$tbl,$i1,lsl#2] @ Te4[s1>>16]
ldrb $s1,[$tbl,$s1,lsl#2] @ Te4[s1>>24]
ldrb $i2,[$tbl,$i2,lsl#2] @ Te4[s1>>0] ldrb $i2,[$tbl,$i2,lsl#2] @ Te4[s1>>0]
ldrb $i3,[$tbl,$i3,lsl#2] @ Te4[s1>>8] ldrb $i3,[$tbl,$i3,lsl#2] @ Te4[s1>>8]
eor $s0,$i1,$s0,lsl#8 eor $s0,$i1,$s0,lsl#8
eor $s1,$t1,$s1,lsl#24 ldrb $s1,[$tbl,$s1,lsl#2] @ Te4[s1>>24]
eor $t2,$i2,$t2,lsl#8
eor $t3,$i3,$t3,lsl#8
and $i1,lr,$s2,lsr#8 @ i0 and $i1,lr,$s2,lsr#8 @ i0
eor $t2,$i2,$t2,lsl#8
and $i2,lr,$s2,lsr#16 @ i1 and $i2,lr,$s2,lsr#16 @ i1
eor $t3,$i3,$t3,lsl#8
and $i3,lr,$s2 and $i3,lr,$s2
mov $s2,$s2,lsr#24 eor $s1,$t1,$s1,lsl#24
ldrb $i1,[$tbl,$i1,lsl#2] @ Te4[s2>>8] ldrb $i1,[$tbl,$i1,lsl#2] @ Te4[s2>>8]
mov $s2,$s2,lsr#24
ldrb $i2,[$tbl,$i2,lsl#2] @ Te4[s2>>16] ldrb $i2,[$tbl,$i2,lsl#2] @ Te4[s2>>16]
ldrb $s2,[$tbl,$s2,lsl#2] @ Te4[s2>>24]
ldrb $i3,[$tbl,$i3,lsl#2] @ Te4[s2>>0] ldrb $i3,[$tbl,$i3,lsl#2] @ Te4[s2>>0]
eor $s0,$i1,$s0,lsl#8 eor $s0,$i1,$s0,lsl#8
eor $s1,$s1,$i2,lsl#16 ldrb $s2,[$tbl,$s2,lsl#2] @ Te4[s2>>24]
eor $s2,$t2,$s2,lsl#24
eor $t3,$i3,$t3,lsl#8
and $i1,lr,$s3 @ i0 and $i1,lr,$s3 @ i0
eor $s1,$s1,$i2,lsl#16
and $i2,lr,$s3,lsr#8 @ i1 and $i2,lr,$s3,lsr#8 @ i1
eor $t3,$i3,$t3,lsl#8
and $i3,lr,$s3,lsr#16 @ i2 and $i3,lr,$s3,lsr#16 @ i2
mov $s3,$s3,lsr#24 eor $s2,$t2,$s2,lsl#24
ldrb $i1,[$tbl,$i1,lsl#2] @ Te4[s3>>0] ldrb $i1,[$tbl,$i1,lsl#2] @ Te4[s3>>0]
mov $s3,$s3,lsr#24
ldrb $i2,[$tbl,$i2,lsl#2] @ Te4[s3>>8] ldrb $i2,[$tbl,$i2,lsl#2] @ Te4[s3>>8]
ldrb $i3,[$tbl,$i3,lsl#2] @ Te4[s3>>16] ldrb $i3,[$tbl,$i3,lsl#2] @ Te4[s3>>16]
ldrb $s3,[$tbl,$s3,lsl#2] @ Te4[s3>>24]
eor $s0,$i1,$s0,lsl#8 eor $s0,$i1,$s0,lsl#8
ldrb $s3,[$tbl,$s3,lsl#2] @ Te4[s3>>24]
ldr $i1,[$key,#0]
eor $s1,$s1,$i2,lsl#8 eor $s1,$s1,$i2,lsl#8
ldr $t1,[$key,#4]
eor $s2,$s2,$i3,lsl#16 eor $s2,$s2,$i3,lsl#16
ldr $t2,[$key,#8]
eor $s3,$t3,$s3,lsl#24 eor $s3,$t3,$s3,lsl#24
ldr $t3,[$key,#12]
ldr lr,[sp],#4 @ pop lr eor $s0,$s0,$i1
ldr $t1,[$key,#0] eor $s1,$s1,$t1
ldr $t2,[$key,#4] eor $s2,$s2,$t2
ldr $t3,[$key,#8] eor $s3,$s3,$t3
ldr $i1,[$key,#12]
eor $s0,$s0,$t1
eor $s1,$s1,$t2
eor $s2,$s2,$t3
eor $s3,$s3,$i1
sub $tbl,$tbl,#2 sub $tbl,$tbl,#2
mov pc,lr @ return ldr pc,[sp],#4 @ pop and return
.size _armv4_AES_encrypt,.-_armv4_AES_encrypt .size _armv4_AES_encrypt,.-_armv4_AES_encrypt
.global AES_set_encrypt_key .global AES_set_encrypt_key
@@ -399,31 +403,31 @@ AES_set_encrypt_key:
ldrb $t2,[$rounds,#1] ldrb $t2,[$rounds,#1]
ldrb $t3,[$rounds,#0] ldrb $t3,[$rounds,#0]
orr $s0,$s0,$t1,lsl#8 orr $s0,$s0,$t1,lsl#8
orr $s0,$s0,$t2,lsl#16
orr $s0,$s0,$t3,lsl#24
ldrb $s1,[$rounds,#7] ldrb $s1,[$rounds,#7]
orr $s0,$s0,$t2,lsl#16
ldrb $t1,[$rounds,#6] ldrb $t1,[$rounds,#6]
orr $s0,$s0,$t3,lsl#24
ldrb $t2,[$rounds,#5] ldrb $t2,[$rounds,#5]
ldrb $t3,[$rounds,#4] ldrb $t3,[$rounds,#4]
orr $s1,$s1,$t1,lsl#8 orr $s1,$s1,$t1,lsl#8
orr $s1,$s1,$t2,lsl#16
orr $s1,$s1,$t3,lsl#24
ldrb $s2,[$rounds,#11] ldrb $s2,[$rounds,#11]
orr $s1,$s1,$t2,lsl#16
ldrb $t1,[$rounds,#10] ldrb $t1,[$rounds,#10]
orr $s1,$s1,$t3,lsl#24
ldrb $t2,[$rounds,#9] ldrb $t2,[$rounds,#9]
ldrb $t3,[$rounds,#8] ldrb $t3,[$rounds,#8]
orr $s2,$s2,$t1,lsl#8 orr $s2,$s2,$t1,lsl#8
orr $s2,$s2,$t2,lsl#16
orr $s2,$s2,$t3,lsl#24
ldrb $s3,[$rounds,#15] ldrb $s3,[$rounds,#15]
orr $s2,$s2,$t2,lsl#16
ldrb $t1,[$rounds,#14] ldrb $t1,[$rounds,#14]
orr $s2,$s2,$t3,lsl#24
ldrb $t2,[$rounds,#13] ldrb $t2,[$rounds,#13]
ldrb $t3,[$rounds,#12] ldrb $t3,[$rounds,#12]
orr $s3,$s3,$t1,lsl#8 orr $s3,$s3,$t1,lsl#8
orr $s3,$s3,$t2,lsl#16
orr $s3,$s3,$t3,lsl#24
str $s0,[$key],#16 str $s0,[$key],#16
orr $s3,$s3,$t2,lsl#16
str $s1,[$key,#-12] str $s1,[$key,#-12]
orr $s3,$s3,$t3,lsl#24
str $s2,[$key,#-8] str $s2,[$key,#-8]
str $s3,[$key,#-4] str $s3,[$key,#-4]
@@ -437,27 +441,26 @@ AES_set_encrypt_key:
.L128_loop: .L128_loop:
and $t2,lr,$s3,lsr#24 and $t2,lr,$s3,lsr#24
and $i1,lr,$s3,lsr#16 and $i1,lr,$s3,lsr#16
and $i2,lr,$s3,lsr#8
and $i3,lr,$s3
ldrb $t2,[$tbl,$t2] ldrb $t2,[$tbl,$t2]
and $i2,lr,$s3,lsr#8
ldrb $i1,[$tbl,$i1] ldrb $i1,[$tbl,$i1]
and $i3,lr,$s3
ldrb $i2,[$tbl,$i2] ldrb $i2,[$tbl,$i2]
ldrb $i3,[$tbl,$i3]
ldr $t1,[$t3],#4 @ rcon[i++]
orr $t2,$t2,$i1,lsl#24 orr $t2,$t2,$i1,lsl#24
ldrb $i3,[$tbl,$i3]
orr $t2,$t2,$i2,lsl#16 orr $t2,$t2,$i2,lsl#16
ldr $t1,[$t3],#4 @ rcon[i++]
orr $t2,$t2,$i3,lsl#8 orr $t2,$t2,$i3,lsl#8
eor $t2,$t2,$t1 eor $t2,$t2,$t1
eor $s0,$s0,$t2 @ rk[4]=rk[0]^... eor $s0,$s0,$t2 @ rk[4]=rk[0]^...
eor $s1,$s1,$s0 @ rk[5]=rk[1]^rk[4] eor $s1,$s1,$s0 @ rk[5]=rk[1]^rk[4]
eor $s2,$s2,$s1 @ rk[6]=rk[2]^rk[5]
eor $s3,$s3,$s2 @ rk[7]=rk[3]^rk[6]
str $s0,[$key],#16 str $s0,[$key],#16
eor $s2,$s2,$s1 @ rk[6]=rk[2]^rk[5]
str $s1,[$key,#-12] str $s1,[$key,#-12]
eor $s3,$s3,$s2 @ rk[7]=rk[3]^rk[6]
str $s2,[$key,#-8] str $s2,[$key,#-8]
str $s3,[$key,#-4]
subs $rounds,$rounds,#1 subs $rounds,$rounds,#1
str $s3,[$key,#-4]
bne .L128_loop bne .L128_loop
sub r2,$key,#176 sub r2,$key,#176
b .Ldone b .Ldone
@@ -468,16 +471,16 @@ AES_set_encrypt_key:
ldrb $t2,[$rounds,#17] ldrb $t2,[$rounds,#17]
ldrb $t3,[$rounds,#16] ldrb $t3,[$rounds,#16]
orr $i2,$i2,$t1,lsl#8 orr $i2,$i2,$t1,lsl#8
orr $i2,$i2,$t2,lsl#16
orr $i2,$i2,$t3,lsl#24
ldrb $i3,[$rounds,#23] ldrb $i3,[$rounds,#23]
orr $i2,$i2,$t2,lsl#16
ldrb $t1,[$rounds,#22] ldrb $t1,[$rounds,#22]
orr $i2,$i2,$t3,lsl#24
ldrb $t2,[$rounds,#21] ldrb $t2,[$rounds,#21]
ldrb $t3,[$rounds,#20] ldrb $t3,[$rounds,#20]
orr $i3,$i3,$t1,lsl#8 orr $i3,$i3,$t1,lsl#8
orr $i3,$i3,$t2,lsl#16 orr $i3,$i3,$t2,lsl#16
orr $i3,$i3,$t3,lsl#24
str $i2,[$key],#8 str $i2,[$key],#8
orr $i3,$i3,$t3,lsl#24
str $i3,[$key,#-4] str $i3,[$key,#-4]
teq lr,#192 teq lr,#192
@@ -491,27 +494,26 @@ AES_set_encrypt_key:
.L192_loop: .L192_loop:
and $t2,lr,$i3,lsr#24 and $t2,lr,$i3,lsr#24
and $i1,lr,$i3,lsr#16 and $i1,lr,$i3,lsr#16
and $i2,lr,$i3,lsr#8
and $i3,lr,$i3
ldrb $t2,[$tbl,$t2] ldrb $t2,[$tbl,$t2]
and $i2,lr,$i3,lsr#8
ldrb $i1,[$tbl,$i1] ldrb $i1,[$tbl,$i1]
and $i3,lr,$i3
ldrb $i2,[$tbl,$i2] ldrb $i2,[$tbl,$i2]
ldrb $i3,[$tbl,$i3]
ldr $t1,[$t3],#4 @ rcon[i++]
orr $t2,$t2,$i1,lsl#24 orr $t2,$t2,$i1,lsl#24
ldrb $i3,[$tbl,$i3]
orr $t2,$t2,$i2,lsl#16 orr $t2,$t2,$i2,lsl#16
ldr $t1,[$t3],#4 @ rcon[i++]
orr $t2,$t2,$i3,lsl#8 orr $t2,$t2,$i3,lsl#8
eor $i3,$t2,$t1 eor $i3,$t2,$t1
eor $s0,$s0,$i3 @ rk[6]=rk[0]^... eor $s0,$s0,$i3 @ rk[6]=rk[0]^...
eor $s1,$s1,$s0 @ rk[7]=rk[1]^rk[6] eor $s1,$s1,$s0 @ rk[7]=rk[1]^rk[6]
eor $s2,$s2,$s1 @ rk[8]=rk[2]^rk[7]
eor $s3,$s3,$s2 @ rk[9]=rk[3]^rk[8]
str $s0,[$key],#24 str $s0,[$key],#24
eor $s2,$s2,$s1 @ rk[8]=rk[2]^rk[7]
str $s1,[$key,#-20] str $s1,[$key,#-20]
eor $s3,$s3,$s2 @ rk[9]=rk[3]^rk[8]
str $s2,[$key,#-16] str $s2,[$key,#-16]
str $s3,[$key,#-12]
subs $rounds,$rounds,#1 subs $rounds,$rounds,#1
str $s3,[$key,#-12]
subeq r2,$key,#216 subeq r2,$key,#216
beq .Ldone beq .Ldone
@@ -529,16 +531,16 @@ AES_set_encrypt_key:
ldrb $t2,[$rounds,#25] ldrb $t2,[$rounds,#25]
ldrb $t3,[$rounds,#24] ldrb $t3,[$rounds,#24]
orr $i2,$i2,$t1,lsl#8 orr $i2,$i2,$t1,lsl#8
orr $i2,$i2,$t2,lsl#16
orr $i2,$i2,$t3,lsl#24
ldrb $i3,[$rounds,#31] ldrb $i3,[$rounds,#31]
orr $i2,$i2,$t2,lsl#16
ldrb $t1,[$rounds,#30] ldrb $t1,[$rounds,#30]
orr $i2,$i2,$t3,lsl#24
ldrb $t2,[$rounds,#29] ldrb $t2,[$rounds,#29]
ldrb $t3,[$rounds,#28] ldrb $t3,[$rounds,#28]
orr $i3,$i3,$t1,lsl#8 orr $i3,$i3,$t1,lsl#8
orr $i3,$i3,$t2,lsl#16 orr $i3,$i3,$t2,lsl#16
orr $i3,$i3,$t3,lsl#24
str $i2,[$key],#8 str $i2,[$key],#8
orr $i3,$i3,$t3,lsl#24
str $i3,[$key,#-4] str $i3,[$key,#-4]
mov $rounds,#14 mov $rounds,#14
@@ -550,52 +552,51 @@ AES_set_encrypt_key:
.L256_loop: .L256_loop:
and $t2,lr,$i3,lsr#24 and $t2,lr,$i3,lsr#24
and $i1,lr,$i3,lsr#16 and $i1,lr,$i3,lsr#16
and $i2,lr,$i3,lsr#8
and $i3,lr,$i3
ldrb $t2,[$tbl,$t2] ldrb $t2,[$tbl,$t2]
and $i2,lr,$i3,lsr#8
ldrb $i1,[$tbl,$i1] ldrb $i1,[$tbl,$i1]
and $i3,lr,$i3
ldrb $i2,[$tbl,$i2] ldrb $i2,[$tbl,$i2]
ldrb $i3,[$tbl,$i3]
ldr $t1,[$t3],#4 @ rcon[i++]
orr $t2,$t2,$i1,lsl#24 orr $t2,$t2,$i1,lsl#24
ldrb $i3,[$tbl,$i3]
orr $t2,$t2,$i2,lsl#16 orr $t2,$t2,$i2,lsl#16
ldr $t1,[$t3],#4 @ rcon[i++]
orr $t2,$t2,$i3,lsl#8 orr $t2,$t2,$i3,lsl#8
eor $i3,$t2,$t1 eor $i3,$t2,$t1
eor $s0,$s0,$i3 @ rk[8]=rk[0]^... eor $s0,$s0,$i3 @ rk[8]=rk[0]^...
eor $s1,$s1,$s0 @ rk[9]=rk[1]^rk[8] eor $s1,$s1,$s0 @ rk[9]=rk[1]^rk[8]
eor $s2,$s2,$s1 @ rk[10]=rk[2]^rk[9]
eor $s3,$s3,$s2 @ rk[11]=rk[3]^rk[10]
str $s0,[$key],#32 str $s0,[$key],#32
eor $s2,$s2,$s1 @ rk[10]=rk[2]^rk[9]
str $s1,[$key,#-28] str $s1,[$key,#-28]
eor $s3,$s3,$s2 @ rk[11]=rk[3]^rk[10]
str $s2,[$key,#-24] str $s2,[$key,#-24]
str $s3,[$key,#-20]
subs $rounds,$rounds,#1 subs $rounds,$rounds,#1
str $s3,[$key,#-20]
subeq r2,$key,#256 subeq r2,$key,#256
beq .Ldone beq .Ldone
and $t2,lr,$s3 and $t2,lr,$s3
and $i1,lr,$s3,lsr#8 and $i1,lr,$s3,lsr#8
and $i2,lr,$s3,lsr#16
and $i3,lr,$s3,lsr#24
ldrb $t2,[$tbl,$t2] ldrb $t2,[$tbl,$t2]
and $i2,lr,$s3,lsr#16
ldrb $i1,[$tbl,$i1] ldrb $i1,[$tbl,$i1]
and $i3,lr,$s3,lsr#24
ldrb $i2,[$tbl,$i2] ldrb $i2,[$tbl,$i2]
ldrb $i3,[$tbl,$i3]
orr $t2,$t2,$i1,lsl#8 orr $t2,$t2,$i1,lsl#8
ldrb $i3,[$tbl,$i3]
orr $t2,$t2,$i2,lsl#16 orr $t2,$t2,$i2,lsl#16
ldr $t1,[$key,#-48]
orr $t2,$t2,$i3,lsl#24 orr $t2,$t2,$i3,lsl#24
ldr $t1,[$key,#-48]
ldr $i1,[$key,#-44] ldr $i1,[$key,#-44]
ldr $i2,[$key,#-40] ldr $i2,[$key,#-40]
ldr $i3,[$key,#-36]
eor $t1,$t1,$t2 @ rk[12]=rk[4]^... eor $t1,$t1,$t2 @ rk[12]=rk[4]^...
ldr $i3,[$key,#-36]
eor $i1,$i1,$t1 @ rk[13]=rk[5]^rk[12] eor $i1,$i1,$t1 @ rk[13]=rk[5]^rk[12]
eor $i2,$i2,$i1 @ rk[14]=rk[6]^rk[13]
eor $i3,$i3,$i2 @ rk[15]=rk[7]^rk[14]
str $t1,[$key,#-16] str $t1,[$key,#-16]
eor $i2,$i2,$i1 @ rk[14]=rk[6]^rk[13]
str $i1,[$key,#-12] str $i1,[$key,#-12]
eor $i3,$i3,$i2 @ rk[15]=rk[7]^rk[14]
str $i2,[$key,#-8] str $i2,[$key,#-8]
str $i3,[$key,#-4] str $i3,[$key,#-4]
b .L256_loop b .L256_loop
@@ -816,24 +817,24 @@ AES_decrypt:
ldrb $t2,[$rounds,#1] ldrb $t2,[$rounds,#1]
ldrb $t3,[$rounds,#0] ldrb $t3,[$rounds,#0]
orr $s0,$s0,$t1,lsl#8 orr $s0,$s0,$t1,lsl#8
orr $s0,$s0,$t2,lsl#16
orr $s0,$s0,$t3,lsl#24
ldrb $s1,[$rounds,#7] ldrb $s1,[$rounds,#7]
orr $s0,$s0,$t2,lsl#16
ldrb $t1,[$rounds,#6] ldrb $t1,[$rounds,#6]
orr $s0,$s0,$t3,lsl#24
ldrb $t2,[$rounds,#5] ldrb $t2,[$rounds,#5]
ldrb $t3,[$rounds,#4] ldrb $t3,[$rounds,#4]
orr $s1,$s1,$t1,lsl#8 orr $s1,$s1,$t1,lsl#8
orr $s1,$s1,$t2,lsl#16
orr $s1,$s1,$t3,lsl#24
ldrb $s2,[$rounds,#11] ldrb $s2,[$rounds,#11]
orr $s1,$s1,$t2,lsl#16
ldrb $t1,[$rounds,#10] ldrb $t1,[$rounds,#10]
orr $s1,$s1,$t3,lsl#24
ldrb $t2,[$rounds,#9] ldrb $t2,[$rounds,#9]
ldrb $t3,[$rounds,#8] ldrb $t3,[$rounds,#8]
orr $s2,$s2,$t1,lsl#8 orr $s2,$s2,$t1,lsl#8
orr $s2,$s2,$t2,lsl#16
orr $s2,$s2,$t3,lsl#24
ldrb $s3,[$rounds,#15] ldrb $s3,[$rounds,#15]
orr $s2,$s2,$t2,lsl#16
ldrb $t1,[$rounds,#14] ldrb $t1,[$rounds,#14]
orr $s2,$s2,$t3,lsl#24
ldrb $t2,[$rounds,#13] ldrb $t2,[$rounds,#13]
ldrb $t3,[$rounds,#12] ldrb $t3,[$rounds,#12]
orr $s3,$s3,$t1,lsl#8 orr $s3,$s3,$t1,lsl#8
@@ -848,24 +849,24 @@ AES_decrypt:
mov $t3,$s0,lsr#8 mov $t3,$s0,lsr#8
strb $t1,[$rounds,#0] strb $t1,[$rounds,#0]
strb $t2,[$rounds,#1] strb $t2,[$rounds,#1]
strb $t3,[$rounds,#2]
strb $s0,[$rounds,#3]
mov $t1,$s1,lsr#24 mov $t1,$s1,lsr#24
strb $t3,[$rounds,#2]
mov $t2,$s1,lsr#16 mov $t2,$s1,lsr#16
strb $s0,[$rounds,#3]
mov $t3,$s1,lsr#8 mov $t3,$s1,lsr#8
strb $t1,[$rounds,#4] strb $t1,[$rounds,#4]
strb $t2,[$rounds,#5] strb $t2,[$rounds,#5]
strb $t3,[$rounds,#6]
strb $s1,[$rounds,#7]
mov $t1,$s2,lsr#24 mov $t1,$s2,lsr#24
strb $t3,[$rounds,#6]
mov $t2,$s2,lsr#16 mov $t2,$s2,lsr#16
strb $s1,[$rounds,#7]
mov $t3,$s2,lsr#8 mov $t3,$s2,lsr#8
strb $t1,[$rounds,#8] strb $t1,[$rounds,#8]
strb $t2,[$rounds,#9] strb $t2,[$rounds,#9]
strb $t3,[$rounds,#10]
strb $s2,[$rounds,#11]
mov $t1,$s3,lsr#24 mov $t1,$s3,lsr#24
strb $t3,[$rounds,#10]
mov $t2,$s3,lsr#16 mov $t2,$s3,lsr#16
strb $s2,[$rounds,#11]
mov $t3,$s3,lsr#8 mov $t3,$s3,lsr#8
strb $t1,[$rounds,#12] strb $t1,[$rounds,#12]
strb $t2,[$rounds,#13] strb $t2,[$rounds,#13]
@@ -882,149 +883,148 @@ AES_decrypt:
.align 2 .align 2
_armv4_AES_decrypt: _armv4_AES_decrypt:
str lr,[sp,#-4]! @ push lr str lr,[sp,#-4]! @ push lr
ldr $t1,[$key],#16 ldmia $key!,{$t1-$i1}
ldr $t2,[$key,#-12]
ldr $t3,[$key,#-8]
ldr $i1,[$key,#-4]
ldr $rounds,[$key,#240-16]
eor $s0,$s0,$t1 eor $s0,$s0,$t1
ldr $rounds,[$key,#240-16]
eor $s1,$s1,$t2 eor $s1,$s1,$t2
eor $s2,$s2,$t3 eor $s2,$s2,$t3
eor $s3,$s3,$i1 eor $s3,$s3,$i1
sub $rounds,$rounds,#1 sub $rounds,$rounds,#1
mov lr,#255 mov lr,#255
.Ldec_loop:
and $i1,lr,$s0,lsr#16 and $i1,lr,$s0,lsr#16
and $i2,lr,$s0,lsr#8 and $i2,lr,$s0,lsr#8
and $i3,lr,$s0 and $i3,lr,$s0
mov $s0,$s0,lsr#24 mov $s0,$s0,lsr#24
.Ldec_loop:
ldr $t1,[$tbl,$i1,lsl#2] @ Td1[s0>>16] ldr $t1,[$tbl,$i1,lsl#2] @ Td1[s0>>16]
ldr $s0,[$tbl,$s0,lsl#2] @ Td0[s0>>24]
ldr $t2,[$tbl,$i2,lsl#2] @ Td2[s0>>8]
ldr $t3,[$tbl,$i3,lsl#2] @ Td3[s0>>0]
and $i1,lr,$s1 @ i0 and $i1,lr,$s1 @ i0
ldr $t2,[$tbl,$i2,lsl#2] @ Td2[s0>>8]
and $i2,lr,$s1,lsr#16 and $i2,lr,$s1,lsr#16
ldr $t3,[$tbl,$i3,lsl#2] @ Td3[s0>>0]
and $i3,lr,$s1,lsr#8 and $i3,lr,$s1,lsr#8
ldr $s0,[$tbl,$s0,lsl#2] @ Td0[s0>>24]
mov $s1,$s1,lsr#24 mov $s1,$s1,lsr#24
ldr $i1,[$tbl,$i1,lsl#2] @ Td3[s1>>0] ldr $i1,[$tbl,$i1,lsl#2] @ Td3[s1>>0]
ldr $s1,[$tbl,$s1,lsl#2] @ Td0[s1>>24]
ldr $i2,[$tbl,$i2,lsl#2] @ Td1[s1>>16] ldr $i2,[$tbl,$i2,lsl#2] @ Td1[s1>>16]
ldr $i3,[$tbl,$i3,lsl#2] @ Td2[s1>>8] ldr $i3,[$tbl,$i3,lsl#2] @ Td2[s1>>8]
eor $s0,$s0,$i1,ror#24 eor $s0,$s0,$i1,ror#24
eor $s1,$s1,$t1,ror#8 ldr $s1,[$tbl,$s1,lsl#2] @ Td0[s1>>24]
eor $t2,$i2,$t2,ror#8
eor $t3,$i3,$t3,ror#8
and $i1,lr,$s2,lsr#8 @ i0 and $i1,lr,$s2,lsr#8 @ i0
eor $t2,$i2,$t2,ror#8
and $i2,lr,$s2 @ i1 and $i2,lr,$s2 @ i1
eor $t3,$i3,$t3,ror#8
and $i3,lr,$s2,lsr#16 and $i3,lr,$s2,lsr#16
mov $s2,$s2,lsr#24 eor $s1,$s1,$t1,ror#8
ldr $i1,[$tbl,$i1,lsl#2] @ Td2[s2>>8] ldr $i1,[$tbl,$i1,lsl#2] @ Td2[s2>>8]
mov $s2,$s2,lsr#24
ldr $i2,[$tbl,$i2,lsl#2] @ Td3[s2>>0] ldr $i2,[$tbl,$i2,lsl#2] @ Td3[s2>>0]
ldr $s2,[$tbl,$s2,lsl#2] @ Td0[s2>>24]
ldr $i3,[$tbl,$i3,lsl#2] @ Td1[s2>>16] ldr $i3,[$tbl,$i3,lsl#2] @ Td1[s2>>16]
eor $s0,$s0,$i1,ror#16 eor $s0,$s0,$i1,ror#16
eor $s1,$s1,$i2,ror#24 ldr $s2,[$tbl,$s2,lsl#2] @ Td0[s2>>24]
eor $s2,$s2,$t2,ror#8
eor $t3,$i3,$t3,ror#8
and $i1,lr,$s3,lsr#16 @ i0 and $i1,lr,$s3,lsr#16 @ i0
eor $s1,$s1,$i2,ror#24
and $i2,lr,$s3,lsr#8 @ i1 and $i2,lr,$s3,lsr#8 @ i1
eor $t3,$i3,$t3,ror#8
and $i3,lr,$s3 @ i2 and $i3,lr,$s3 @ i2
mov $s3,$s3,lsr#24 eor $s2,$s2,$t2,ror#8
ldr $i1,[$tbl,$i1,lsl#2] @ Td1[s3>>16] ldr $i1,[$tbl,$i1,lsl#2] @ Td1[s3>>16]
mov $s3,$s3,lsr#24
ldr $i2,[$tbl,$i2,lsl#2] @ Td2[s3>>8] ldr $i2,[$tbl,$i2,lsl#2] @ Td2[s3>>8]
ldr $i3,[$tbl,$i3,lsl#2] @ Td3[s3>>0] ldr $i3,[$tbl,$i3,lsl#2] @ Td3[s3>>0]
ldr $s3,[$tbl,$s3,lsl#2] @ Td0[s3>>24]
eor $s0,$s0,$i1,ror#8 eor $s0,$s0,$i1,ror#8
ldr $s3,[$tbl,$s3,lsl#2] @ Td0[s3>>24]
eor $s1,$s1,$i2,ror#16 eor $s1,$s1,$i2,ror#16
eor $s2,$s2,$i3,ror#24 eor $s2,$s2,$i3,ror#24
ldr $i1,[$key],#16
eor $s3,$s3,$t3,ror#8 eor $s3,$s3,$t3,ror#8
ldr $t1,[$key],#16 ldr $t1,[$key,#-12]
ldr $t2,[$key,#-12] ldr $t2,[$key,#-8]
ldr $t3,[$key,#-8] eor $s0,$s0,$i1
ldr $i1,[$key,#-4] ldr $t3,[$key,#-4]
eor $s0,$s0,$t1 and $i1,lr,$s0,lsr#16
eor $s1,$s1,$t2 eor $s1,$s1,$t1
eor $s2,$s2,$t3 and $i2,lr,$s0,lsr#8
eor $s3,$s3,$i1 eor $s2,$s2,$t2
and $i3,lr,$s0
eor $s3,$s3,$t3
mov $s0,$s0,lsr#24
subs $rounds,$rounds,#1 subs $rounds,$rounds,#1
bne .Ldec_loop bne .Ldec_loop
add $tbl,$tbl,#1024 add $tbl,$tbl,#1024
ldr $t1,[$tbl,#0] @ prefetch Td4 ldr $t2,[$tbl,#0] @ prefetch Td4
ldr $t2,[$tbl,#32] ldr $t3,[$tbl,#32]
ldr $t3,[$tbl,#64] ldr $t1,[$tbl,#64]
ldr $i1,[$tbl,#96] ldr $t2,[$tbl,#96]
ldr $i2,[$tbl,#128] ldr $t3,[$tbl,#128]
ldr $i3,[$tbl,#160] ldr $t1,[$tbl,#160]
ldr $t1,[$tbl,#192] ldr $t2,[$tbl,#192]
ldr $t2,[$tbl,#224] ldr $t3,[$tbl,#224]
and $i1,lr,$s0,lsr#16 ldrb $s0,[$tbl,$s0] @ Td4[s0>>24]
and $i2,lr,$s0,lsr#8
and $i3,lr,$s0
ldrb $s0,[$tbl,$s0,lsr#24] @ Td4[s0>>24]
ldrb $t1,[$tbl,$i1] @ Td4[s0>>16] ldrb $t1,[$tbl,$i1] @ Td4[s0>>16]
ldrb $t2,[$tbl,$i2] @ Td4[s0>>8]
ldrb $t3,[$tbl,$i3] @ Td4[s0>>0]
and $i1,lr,$s1 @ i0 and $i1,lr,$s1 @ i0
ldrb $t2,[$tbl,$i2] @ Td4[s0>>8]
and $i2,lr,$s1,lsr#16 and $i2,lr,$s1,lsr#16
ldrb $t3,[$tbl,$i3] @ Td4[s0>>0]
and $i3,lr,$s1,lsr#8 and $i3,lr,$s1,lsr#8
ldrb $i1,[$tbl,$i1] @ Td4[s1>>0] ldrb $i1,[$tbl,$i1] @ Td4[s1>>0]
ldrb $s1,[$tbl,$s1,lsr#24] @ Td4[s1>>24] ldrb $s1,[$tbl,$s1,lsr#24] @ Td4[s1>>24]
ldrb $i2,[$tbl,$i2] @ Td4[s1>>16] ldrb $i2,[$tbl,$i2] @ Td4[s1>>16]
ldrb $i3,[$tbl,$i3] @ Td4[s1>>8]
eor $s0,$i1,$s0,lsl#24 eor $s0,$i1,$s0,lsl#24
ldrb $i3,[$tbl,$i3] @ Td4[s1>>8]
eor $s1,$t1,$s1,lsl#8 eor $s1,$t1,$s1,lsl#8
eor $t2,$t2,$i2,lsl#8
eor $t3,$t3,$i3,lsl#8
and $i1,lr,$s2,lsr#8 @ i0 and $i1,lr,$s2,lsr#8 @ i0
eor $t2,$t2,$i2,lsl#8
and $i2,lr,$s2 @ i1 and $i2,lr,$s2 @ i1
and $i3,lr,$s2,lsr#16 eor $t3,$t3,$i3,lsl#8
ldrb $i1,[$tbl,$i1] @ Td4[s2>>8] ldrb $i1,[$tbl,$i1] @ Td4[s2>>8]
and $i3,lr,$s2,lsr#16
ldrb $i2,[$tbl,$i2] @ Td4[s2>>0] ldrb $i2,[$tbl,$i2] @ Td4[s2>>0]
ldrb $s2,[$tbl,$s2,lsr#24] @ Td4[s2>>24] ldrb $s2,[$tbl,$s2,lsr#24] @ Td4[s2>>24]
ldrb $i3,[$tbl,$i3] @ Td4[s2>>16]
eor $s0,$s0,$i1,lsl#8 eor $s0,$s0,$i1,lsl#8
ldrb $i3,[$tbl,$i3] @ Td4[s2>>16]
eor $s1,$i2,$s1,lsl#16 eor $s1,$i2,$s1,lsl#16
eor $s2,$t2,$s2,lsl#16
eor $t3,$t3,$i3,lsl#16
and $i1,lr,$s3,lsr#16 @ i0 and $i1,lr,$s3,lsr#16 @ i0
eor $s2,$t2,$s2,lsl#16
and $i2,lr,$s3,lsr#8 @ i1 and $i2,lr,$s3,lsr#8 @ i1
and $i3,lr,$s3 @ i2 eor $t3,$t3,$i3,lsl#16
ldrb $i1,[$tbl,$i1] @ Td4[s3>>16] ldrb $i1,[$tbl,$i1] @ Td4[s3>>16]
and $i3,lr,$s3 @ i2
ldrb $i2,[$tbl,$i2] @ Td4[s3>>8] ldrb $i2,[$tbl,$i2] @ Td4[s3>>8]
ldrb $i3,[$tbl,$i3] @ Td4[s3>>0] ldrb $i3,[$tbl,$i3] @ Td4[s3>>0]
ldrb $s3,[$tbl,$s3,lsr#24] @ Td4[s3>>24] ldrb $s3,[$tbl,$s3,lsr#24] @ Td4[s3>>24]
eor $s0,$s0,$i1,lsl#16 eor $s0,$s0,$i1,lsl#16
ldr $i1,[$key,#0]
eor $s1,$s1,$i2,lsl#8 eor $s1,$s1,$i2,lsl#8
ldr $t1,[$key,#4]
eor $s2,$i3,$s2,lsl#8 eor $s2,$i3,$s2,lsl#8
ldr $t2,[$key,#8]
eor $s3,$t3,$s3,lsl#24 eor $s3,$t3,$s3,lsl#24
ldr $t3,[$key,#12]
ldr lr,[sp],#4 @ pop lr eor $s0,$s0,$i1
ldr $t1,[$key,#0] eor $s1,$s1,$t1
ldr $t2,[$key,#4] eor $s2,$s2,$t2
ldr $t3,[$key,#8] eor $s3,$s3,$t3
ldr $i1,[$key,#12]
eor $s0,$s0,$t1
eor $s1,$s1,$t2
eor $s2,$s2,$t3
eor $s3,$s3,$i1
sub $tbl,$tbl,#1024 sub $tbl,$tbl,#1024
mov pc,lr @ return ldr pc,[sp],#4 @ pop and return
.size _armv4_AES_decrypt,.-_armv4_AES_decrypt .size _armv4_AES_decrypt,.-_armv4_AES_decrypt
.asciz "AES for ARMv4, CRYPTOGAMS by <appro\@openssl.org>" .asciz "AES for ARMv4, CRYPTOGAMS by <appro\@openssl.org>"
.align 2
___ ___
$code =~ s/\bbx\s+lr\b/.word\t0xe12fff1e/gm; # make it possible to compile with -march=armv4 $code =~ s/\bbx\s+lr\b/.word\t0xe12fff1e/gm; # make it possible to compile with -march=armv4
print $code; print $code;
close STDOUT; # enforce flush

View File

@@ -16,6 +16,19 @@
# at 1/2 of ppc_AES_encrypt speed, while ppc_AES_decrypt_compact - # at 1/2 of ppc_AES_encrypt speed, while ppc_AES_decrypt_compact -
# at 1/3 of ppc_AES_decrypt. # at 1/3 of ppc_AES_decrypt.
# February 2010
#
# Rescheduling instructions to favour Power6 pipeline gives 10%
# performance improvement on the platfrom in question (and marginal
# improvement even on others). It should be noted that Power6 fails
# to process byte in 18 cycles, only in 23, because it fails to issue
# 4 load instructions in two cycles, only in 3. As result non-compact
# block subroutines are 25% slower than one would expect. Compact
# functions scale better, because they have pure computational part,
# which scales perfectly with clock frequency. To be specific
# ppc_AES_encrypt_compact operates at 42 cycles per byte, while
# ppc_AES_decrypt_compact - at 55 (in 64-bit build).
$flavour = shift; $flavour = shift;
if ($flavour =~ /64/) { if ($flavour =~ /64/) {
@@ -376,7 +389,7 @@ $code.=<<___;
addi $sp,$sp,$FRAME addi $sp,$sp,$FRAME
blr blr
.align 4 .align 5
Lppc_AES_encrypt: Lppc_AES_encrypt:
lwz $acc00,240($key) lwz $acc00,240($key)
lwz $t0,0($key) lwz $t0,0($key)
@@ -397,46 +410,46 @@ Lppc_AES_encrypt:
Lenc_loop: Lenc_loop:
rlwinm $acc00,$s0,`32-24+3`,21,28 rlwinm $acc00,$s0,`32-24+3`,21,28
rlwinm $acc01,$s1,`32-24+3`,21,28 rlwinm $acc01,$s1,`32-24+3`,21,28
lwz $t0,0($key)
lwz $t1,4($key)
rlwinm $acc02,$s2,`32-24+3`,21,28 rlwinm $acc02,$s2,`32-24+3`,21,28
rlwinm $acc03,$s3,`32-24+3`,21,28 rlwinm $acc03,$s3,`32-24+3`,21,28
lwz $t2,8($key) lwz $t0,0($key)
lwz $t3,12($key) lwz $t1,4($key)
rlwinm $acc04,$s1,`32-16+3`,21,28 rlwinm $acc04,$s1,`32-16+3`,21,28
rlwinm $acc05,$s2,`32-16+3`,21,28 rlwinm $acc05,$s2,`32-16+3`,21,28
lwzx $acc00,$Tbl0,$acc00 lwz $t2,8($key)
lwzx $acc01,$Tbl0,$acc01 lwz $t3,12($key)
rlwinm $acc06,$s3,`32-16+3`,21,28 rlwinm $acc06,$s3,`32-16+3`,21,28
rlwinm $acc07,$s0,`32-16+3`,21,28 rlwinm $acc07,$s0,`32-16+3`,21,28
lwzx $acc02,$Tbl0,$acc02 lwzx $acc00,$Tbl0,$acc00
lwzx $acc03,$Tbl0,$acc03 lwzx $acc01,$Tbl0,$acc01
rlwinm $acc08,$s2,`32-8+3`,21,28 rlwinm $acc08,$s2,`32-8+3`,21,28
rlwinm $acc09,$s3,`32-8+3`,21,28 rlwinm $acc09,$s3,`32-8+3`,21,28
lwzx $acc04,$Tbl1,$acc04 lwzx $acc02,$Tbl0,$acc02
lwzx $acc05,$Tbl1,$acc05 lwzx $acc03,$Tbl0,$acc03
rlwinm $acc10,$s0,`32-8+3`,21,28 rlwinm $acc10,$s0,`32-8+3`,21,28
rlwinm $acc11,$s1,`32-8+3`,21,28 rlwinm $acc11,$s1,`32-8+3`,21,28
lwzx $acc06,$Tbl1,$acc06 lwzx $acc04,$Tbl1,$acc04
lwzx $acc07,$Tbl1,$acc07 lwzx $acc05,$Tbl1,$acc05
rlwinm $acc12,$s3,`0+3`,21,28 rlwinm $acc12,$s3,`0+3`,21,28
rlwinm $acc13,$s0,`0+3`,21,28 rlwinm $acc13,$s0,`0+3`,21,28
lwzx $acc08,$Tbl2,$acc08 lwzx $acc06,$Tbl1,$acc06
lwzx $acc09,$Tbl2,$acc09 lwzx $acc07,$Tbl1,$acc07
rlwinm $acc14,$s1,`0+3`,21,28 rlwinm $acc14,$s1,`0+3`,21,28
rlwinm $acc15,$s2,`0+3`,21,28 rlwinm $acc15,$s2,`0+3`,21,28
lwzx $acc10,$Tbl2,$acc10 lwzx $acc08,$Tbl2,$acc08
lwzx $acc11,$Tbl2,$acc11 lwzx $acc09,$Tbl2,$acc09
xor $t0,$t0,$acc00 xor $t0,$t0,$acc00
xor $t1,$t1,$acc01 xor $t1,$t1,$acc01
lwzx $acc12,$Tbl3,$acc12 lwzx $acc10,$Tbl2,$acc10
lwzx $acc13,$Tbl3,$acc13 lwzx $acc11,$Tbl2,$acc11
xor $t2,$t2,$acc02 xor $t2,$t2,$acc02
xor $t3,$t3,$acc03 xor $t3,$t3,$acc03
lwzx $acc14,$Tbl3,$acc14 lwzx $acc12,$Tbl3,$acc12
lwzx $acc15,$Tbl3,$acc15 lwzx $acc13,$Tbl3,$acc13
xor $t0,$t0,$acc04 xor $t0,$t0,$acc04
xor $t1,$t1,$acc05 xor $t1,$t1,$acc05
lwzx $acc14,$Tbl3,$acc14
lwzx $acc15,$Tbl3,$acc15
xor $t2,$t2,$acc06 xor $t2,$t2,$acc06
xor $t3,$t3,$acc07 xor $t3,$t3,$acc07
xor $t0,$t0,$acc08 xor $t0,$t0,$acc08
@@ -452,60 +465,60 @@ Lenc_loop:
addi $Tbl2,$Tbl0,2048 addi $Tbl2,$Tbl0,2048
nop nop
lwz $acc08,`2048+0`($Tbl0) ! prefetch Te4
lwz $acc09,`2048+32`($Tbl0)
lwz $acc10,`2048+64`($Tbl0)
lwz $acc11,`2048+96`($Tbl0)
lwz $acc08,`2048+128`($Tbl0)
lwz $acc09,`2048+160`($Tbl0)
lwz $acc10,`2048+192`($Tbl0)
lwz $acc11,`2048+224`($Tbl0)
rlwinm $acc00,$s0,`32-24`,24,31
rlwinm $acc01,$s1,`32-24`,24,31
lwz $t0,0($key) lwz $t0,0($key)
lwz $t1,4($key) lwz $t1,4($key)
rlwinm $acc02,$s2,`32-24`,24,31 rlwinm $acc00,$s0,`32-24`,24,31
rlwinm $acc03,$s3,`32-24`,24,31 rlwinm $acc01,$s1,`32-24`,24,31
lwz $t2,8($key) lwz $t2,8($key)
lwz $t3,12($key) lwz $t3,12($key)
rlwinm $acc02,$s2,`32-24`,24,31
rlwinm $acc03,$s3,`32-24`,24,31
lwz $acc08,`2048+0`($Tbl0) ! prefetch Te4
lwz $acc09,`2048+32`($Tbl0)
rlwinm $acc04,$s1,`32-16`,24,31 rlwinm $acc04,$s1,`32-16`,24,31
rlwinm $acc05,$s2,`32-16`,24,31 rlwinm $acc05,$s2,`32-16`,24,31
lbzx $acc00,$Tbl2,$acc00 lwz $acc10,`2048+64`($Tbl0)
lbzx $acc01,$Tbl2,$acc01 lwz $acc11,`2048+96`($Tbl0)
rlwinm $acc06,$s3,`32-16`,24,31 rlwinm $acc06,$s3,`32-16`,24,31
rlwinm $acc07,$s0,`32-16`,24,31 rlwinm $acc07,$s0,`32-16`,24,31
lbzx $acc02,$Tbl2,$acc02 lwz $acc12,`2048+128`($Tbl0)
lbzx $acc03,$Tbl2,$acc03 lwz $acc13,`2048+160`($Tbl0)
rlwinm $acc08,$s2,`32-8`,24,31 rlwinm $acc08,$s2,`32-8`,24,31
rlwinm $acc09,$s3,`32-8`,24,31 rlwinm $acc09,$s3,`32-8`,24,31
lbzx $acc04,$Tbl2,$acc04 lwz $acc14,`2048+192`($Tbl0)
lbzx $acc05,$Tbl2,$acc05 lwz $acc15,`2048+224`($Tbl0)
rlwinm $acc10,$s0,`32-8`,24,31 rlwinm $acc10,$s0,`32-8`,24,31
rlwinm $acc11,$s1,`32-8`,24,31 rlwinm $acc11,$s1,`32-8`,24,31
lbzx $acc06,$Tbl2,$acc06 lbzx $acc00,$Tbl2,$acc00
lbzx $acc07,$Tbl2,$acc07 lbzx $acc01,$Tbl2,$acc01
rlwinm $acc12,$s3,`0`,24,31 rlwinm $acc12,$s3,`0`,24,31
rlwinm $acc13,$s0,`0`,24,31 rlwinm $acc13,$s0,`0`,24,31
lbzx $acc08,$Tbl2,$acc08 lbzx $acc02,$Tbl2,$acc02
lbzx $acc09,$Tbl2,$acc09 lbzx $acc03,$Tbl2,$acc03
rlwinm $acc14,$s1,`0`,24,31 rlwinm $acc14,$s1,`0`,24,31
rlwinm $acc15,$s2,`0`,24,31 rlwinm $acc15,$s2,`0`,24,31
lbzx $acc10,$Tbl2,$acc10 lbzx $acc04,$Tbl2,$acc04
lbzx $acc11,$Tbl2,$acc11 lbzx $acc05,$Tbl2,$acc05
rlwinm $s0,$acc00,24,0,7 rlwinm $s0,$acc00,24,0,7
rlwinm $s1,$acc01,24,0,7 rlwinm $s1,$acc01,24,0,7
lbzx $acc12,$Tbl2,$acc12 lbzx $acc06,$Tbl2,$acc06
lbzx $acc13,$Tbl2,$acc13 lbzx $acc07,$Tbl2,$acc07
rlwinm $s2,$acc02,24,0,7 rlwinm $s2,$acc02,24,0,7
rlwinm $s3,$acc03,24,0,7 rlwinm $s3,$acc03,24,0,7
lbzx $acc14,$Tbl2,$acc14 lbzx $acc08,$Tbl2,$acc08
lbzx $acc15,$Tbl2,$acc15 lbzx $acc09,$Tbl2,$acc09
rlwimi $s0,$acc04,16,8,15 rlwimi $s0,$acc04,16,8,15
rlwimi $s1,$acc05,16,8,15 rlwimi $s1,$acc05,16,8,15
lbzx $acc10,$Tbl2,$acc10
lbzx $acc11,$Tbl2,$acc11
rlwimi $s2,$acc06,16,8,15 rlwimi $s2,$acc06,16,8,15
rlwimi $s3,$acc07,16,8,15 rlwimi $s3,$acc07,16,8,15
lbzx $acc12,$Tbl2,$acc12
lbzx $acc13,$Tbl2,$acc13
rlwimi $s0,$acc08,8,16,23 rlwimi $s0,$acc08,8,16,23
rlwimi $s1,$acc09,8,16,23 rlwimi $s1,$acc09,8,16,23
lbzx $acc14,$Tbl2,$acc14
lbzx $acc15,$Tbl2,$acc15
rlwimi $s2,$acc10,8,16,23 rlwimi $s2,$acc10,8,16,23
rlwimi $s3,$acc11,8,16,23 rlwimi $s3,$acc11,8,16,23
or $s0,$s0,$acc12 or $s0,$s0,$acc12
@@ -542,40 +555,40 @@ Lenc_compact_loop:
rlwinm $acc01,$s1,`32-24`,24,31 rlwinm $acc01,$s1,`32-24`,24,31
rlwinm $acc02,$s2,`32-24`,24,31 rlwinm $acc02,$s2,`32-24`,24,31
rlwinm $acc03,$s3,`32-24`,24,31 rlwinm $acc03,$s3,`32-24`,24,31
lbzx $acc00,$Tbl1,$acc00
lbzx $acc01,$Tbl1,$acc01
rlwinm $acc04,$s1,`32-16`,24,31 rlwinm $acc04,$s1,`32-16`,24,31
rlwinm $acc05,$s2,`32-16`,24,31 rlwinm $acc05,$s2,`32-16`,24,31
lbzx $acc02,$Tbl1,$acc02
lbzx $acc03,$Tbl1,$acc03
rlwinm $acc06,$s3,`32-16`,24,31 rlwinm $acc06,$s3,`32-16`,24,31
rlwinm $acc07,$s0,`32-16`,24,31 rlwinm $acc07,$s0,`32-16`,24,31
lbzx $acc04,$Tbl1,$acc04 lbzx $acc00,$Tbl1,$acc00
lbzx $acc05,$Tbl1,$acc05 lbzx $acc01,$Tbl1,$acc01
rlwinm $acc08,$s2,`32-8`,24,31 rlwinm $acc08,$s2,`32-8`,24,31
rlwinm $acc09,$s3,`32-8`,24,31 rlwinm $acc09,$s3,`32-8`,24,31
lbzx $acc06,$Tbl1,$acc06 lbzx $acc02,$Tbl1,$acc02
lbzx $acc07,$Tbl1,$acc07 lbzx $acc03,$Tbl1,$acc03
rlwinm $acc10,$s0,`32-8`,24,31 rlwinm $acc10,$s0,`32-8`,24,31
rlwinm $acc11,$s1,`32-8`,24,31 rlwinm $acc11,$s1,`32-8`,24,31
lbzx $acc08,$Tbl1,$acc08 lbzx $acc04,$Tbl1,$acc04
lbzx $acc09,$Tbl1,$acc09 lbzx $acc05,$Tbl1,$acc05
rlwinm $acc12,$s3,`0`,24,31 rlwinm $acc12,$s3,`0`,24,31
rlwinm $acc13,$s0,`0`,24,31 rlwinm $acc13,$s0,`0`,24,31
lbzx $acc10,$Tbl1,$acc10 lbzx $acc06,$Tbl1,$acc06
lbzx $acc11,$Tbl1,$acc11 lbzx $acc07,$Tbl1,$acc07
rlwinm $acc14,$s1,`0`,24,31 rlwinm $acc14,$s1,`0`,24,31
rlwinm $acc15,$s2,`0`,24,31 rlwinm $acc15,$s2,`0`,24,31
lbzx $acc12,$Tbl1,$acc12 lbzx $acc08,$Tbl1,$acc08
lbzx $acc13,$Tbl1,$acc13 lbzx $acc09,$Tbl1,$acc09
rlwinm $s0,$acc00,24,0,7 rlwinm $s0,$acc00,24,0,7
rlwinm $s1,$acc01,24,0,7 rlwinm $s1,$acc01,24,0,7
lbzx $acc14,$Tbl1,$acc14 lbzx $acc10,$Tbl1,$acc10
lbzx $acc15,$Tbl1,$acc15 lbzx $acc11,$Tbl1,$acc11
rlwinm $s2,$acc02,24,0,7 rlwinm $s2,$acc02,24,0,7
rlwinm $s3,$acc03,24,0,7 rlwinm $s3,$acc03,24,0,7
lbzx $acc12,$Tbl1,$acc12
lbzx $acc13,$Tbl1,$acc13
rlwimi $s0,$acc04,16,8,15 rlwimi $s0,$acc04,16,8,15
rlwimi $s1,$acc05,16,8,15 rlwimi $s1,$acc05,16,8,15
lbzx $acc14,$Tbl1,$acc14
lbzx $acc15,$Tbl1,$acc15
rlwimi $s2,$acc06,16,8,15 rlwimi $s2,$acc06,16,8,15
rlwimi $s3,$acc07,16,8,15 rlwimi $s3,$acc07,16,8,15
rlwimi $s0,$acc08,8,16,23 rlwimi $s0,$acc08,8,16,23
@@ -725,7 +738,7 @@ Lenc_compact_done:
addi $sp,$sp,$FRAME addi $sp,$sp,$FRAME
blr blr
.align 4 .align 5
Lppc_AES_decrypt: Lppc_AES_decrypt:
lwz $acc00,240($key) lwz $acc00,240($key)
lwz $t0,0($key) lwz $t0,0($key)
@@ -746,46 +759,46 @@ Lppc_AES_decrypt:
Ldec_loop: Ldec_loop:
rlwinm $acc00,$s0,`32-24+3`,21,28 rlwinm $acc00,$s0,`32-24+3`,21,28
rlwinm $acc01,$s1,`32-24+3`,21,28 rlwinm $acc01,$s1,`32-24+3`,21,28
lwz $t0,0($key)
lwz $t1,4($key)
rlwinm $acc02,$s2,`32-24+3`,21,28 rlwinm $acc02,$s2,`32-24+3`,21,28
rlwinm $acc03,$s3,`32-24+3`,21,28 rlwinm $acc03,$s3,`32-24+3`,21,28
lwz $t2,8($key) lwz $t0,0($key)
lwz $t3,12($key) lwz $t1,4($key)
rlwinm $acc04,$s3,`32-16+3`,21,28 rlwinm $acc04,$s3,`32-16+3`,21,28
rlwinm $acc05,$s0,`32-16+3`,21,28 rlwinm $acc05,$s0,`32-16+3`,21,28
lwzx $acc00,$Tbl0,$acc00 lwz $t2,8($key)
lwzx $acc01,$Tbl0,$acc01 lwz $t3,12($key)
rlwinm $acc06,$s1,`32-16+3`,21,28 rlwinm $acc06,$s1,`32-16+3`,21,28
rlwinm $acc07,$s2,`32-16+3`,21,28 rlwinm $acc07,$s2,`32-16+3`,21,28
lwzx $acc02,$Tbl0,$acc02 lwzx $acc00,$Tbl0,$acc00
lwzx $acc03,$Tbl0,$acc03 lwzx $acc01,$Tbl0,$acc01
rlwinm $acc08,$s2,`32-8+3`,21,28 rlwinm $acc08,$s2,`32-8+3`,21,28
rlwinm $acc09,$s3,`32-8+3`,21,28 rlwinm $acc09,$s3,`32-8+3`,21,28
lwzx $acc04,$Tbl1,$acc04 lwzx $acc02,$Tbl0,$acc02
lwzx $acc05,$Tbl1,$acc05 lwzx $acc03,$Tbl0,$acc03
rlwinm $acc10,$s0,`32-8+3`,21,28 rlwinm $acc10,$s0,`32-8+3`,21,28
rlwinm $acc11,$s1,`32-8+3`,21,28 rlwinm $acc11,$s1,`32-8+3`,21,28
lwzx $acc06,$Tbl1,$acc06 lwzx $acc04,$Tbl1,$acc04
lwzx $acc07,$Tbl1,$acc07 lwzx $acc05,$Tbl1,$acc05
rlwinm $acc12,$s1,`0+3`,21,28 rlwinm $acc12,$s1,`0+3`,21,28
rlwinm $acc13,$s2,`0+3`,21,28 rlwinm $acc13,$s2,`0+3`,21,28
lwzx $acc08,$Tbl2,$acc08 lwzx $acc06,$Tbl1,$acc06
lwzx $acc09,$Tbl2,$acc09 lwzx $acc07,$Tbl1,$acc07
rlwinm $acc14,$s3,`0+3`,21,28 rlwinm $acc14,$s3,`0+3`,21,28
rlwinm $acc15,$s0,`0+3`,21,28 rlwinm $acc15,$s0,`0+3`,21,28
lwzx $acc10,$Tbl2,$acc10 lwzx $acc08,$Tbl2,$acc08
lwzx $acc11,$Tbl2,$acc11 lwzx $acc09,$Tbl2,$acc09
xor $t0,$t0,$acc00 xor $t0,$t0,$acc00
xor $t1,$t1,$acc01 xor $t1,$t1,$acc01
lwzx $acc12,$Tbl3,$acc12 lwzx $acc10,$Tbl2,$acc10
lwzx $acc13,$Tbl3,$acc13 lwzx $acc11,$Tbl2,$acc11
xor $t2,$t2,$acc02 xor $t2,$t2,$acc02
xor $t3,$t3,$acc03 xor $t3,$t3,$acc03
lwzx $acc14,$Tbl3,$acc14 lwzx $acc12,$Tbl3,$acc12
lwzx $acc15,$Tbl3,$acc15 lwzx $acc13,$Tbl3,$acc13
xor $t0,$t0,$acc04 xor $t0,$t0,$acc04
xor $t1,$t1,$acc05 xor $t1,$t1,$acc05
lwzx $acc14,$Tbl3,$acc14
lwzx $acc15,$Tbl3,$acc15
xor $t2,$t2,$acc06 xor $t2,$t2,$acc06
xor $t3,$t3,$acc07 xor $t3,$t3,$acc07
xor $t0,$t0,$acc08 xor $t0,$t0,$acc08
@@ -801,56 +814,56 @@ Ldec_loop:
addi $Tbl2,$Tbl0,2048 addi $Tbl2,$Tbl0,2048
nop nop
lwz $acc08,`2048+0`($Tbl0) ! prefetch Td4
lwz $acc09,`2048+32`($Tbl0)
lwz $acc10,`2048+64`($Tbl0)
lwz $acc11,`2048+96`($Tbl0)
lwz $acc08,`2048+128`($Tbl0)
lwz $acc09,`2048+160`($Tbl0)
lwz $acc10,`2048+192`($Tbl0)
lwz $acc11,`2048+224`($Tbl0)
rlwinm $acc00,$s0,`32-24`,24,31
rlwinm $acc01,$s1,`32-24`,24,31
lwz $t0,0($key) lwz $t0,0($key)
lwz $t1,4($key) lwz $t1,4($key)
rlwinm $acc02,$s2,`32-24`,24,31 rlwinm $acc00,$s0,`32-24`,24,31
rlwinm $acc03,$s3,`32-24`,24,31 rlwinm $acc01,$s1,`32-24`,24,31
lwz $t2,8($key) lwz $t2,8($key)
lwz $t3,12($key) lwz $t3,12($key)
rlwinm $acc02,$s2,`32-24`,24,31
rlwinm $acc03,$s3,`32-24`,24,31
lwz $acc08,`2048+0`($Tbl0) ! prefetch Td4
lwz $acc09,`2048+32`($Tbl0)
rlwinm $acc04,$s3,`32-16`,24,31 rlwinm $acc04,$s3,`32-16`,24,31
rlwinm $acc05,$s0,`32-16`,24,31 rlwinm $acc05,$s0,`32-16`,24,31
lwz $acc10,`2048+64`($Tbl0)
lwz $acc11,`2048+96`($Tbl0)
lbzx $acc00,$Tbl2,$acc00 lbzx $acc00,$Tbl2,$acc00
lbzx $acc01,$Tbl2,$acc01 lbzx $acc01,$Tbl2,$acc01
lwz $acc12,`2048+128`($Tbl0)
lwz $acc13,`2048+160`($Tbl0)
rlwinm $acc06,$s1,`32-16`,24,31 rlwinm $acc06,$s1,`32-16`,24,31
rlwinm $acc07,$s2,`32-16`,24,31 rlwinm $acc07,$s2,`32-16`,24,31
lbzx $acc02,$Tbl2,$acc02 lwz $acc14,`2048+192`($Tbl0)
lbzx $acc03,$Tbl2,$acc03 lwz $acc15,`2048+224`($Tbl0)
rlwinm $acc08,$s2,`32-8`,24,31 rlwinm $acc08,$s2,`32-8`,24,31
rlwinm $acc09,$s3,`32-8`,24,31 rlwinm $acc09,$s3,`32-8`,24,31
lbzx $acc04,$Tbl2,$acc04 lbzx $acc02,$Tbl2,$acc02
lbzx $acc05,$Tbl2,$acc05 lbzx $acc03,$Tbl2,$acc03
rlwinm $acc10,$s0,`32-8`,24,31 rlwinm $acc10,$s0,`32-8`,24,31
rlwinm $acc11,$s1,`32-8`,24,31 rlwinm $acc11,$s1,`32-8`,24,31
lbzx $acc06,$Tbl2,$acc06 lbzx $acc04,$Tbl2,$acc04
lbzx $acc07,$Tbl2,$acc07 lbzx $acc05,$Tbl2,$acc05
rlwinm $acc12,$s1,`0`,24,31 rlwinm $acc12,$s1,`0`,24,31
rlwinm $acc13,$s2,`0`,24,31 rlwinm $acc13,$s2,`0`,24,31
lbzx $acc08,$Tbl2,$acc08 lbzx $acc06,$Tbl2,$acc06
lbzx $acc09,$Tbl2,$acc09 lbzx $acc07,$Tbl2,$acc07
rlwinm $acc14,$s3,`0`,24,31 rlwinm $acc14,$s3,`0`,24,31
rlwinm $acc15,$s0,`0`,24,31 rlwinm $acc15,$s0,`0`,24,31
lbzx $acc10,$Tbl2,$acc10 lbzx $acc08,$Tbl2,$acc08
lbzx $acc11,$Tbl2,$acc11 lbzx $acc09,$Tbl2,$acc09
rlwinm $s0,$acc00,24,0,7 rlwinm $s0,$acc00,24,0,7
rlwinm $s1,$acc01,24,0,7 rlwinm $s1,$acc01,24,0,7
lbzx $acc12,$Tbl2,$acc12 lbzx $acc10,$Tbl2,$acc10
lbzx $acc13,$Tbl2,$acc13 lbzx $acc11,$Tbl2,$acc11
rlwinm $s2,$acc02,24,0,7 rlwinm $s2,$acc02,24,0,7
rlwinm $s3,$acc03,24,0,7 rlwinm $s3,$acc03,24,0,7
lbzx $acc14,$Tbl2,$acc14 lbzx $acc12,$Tbl2,$acc12
lbzx $acc15,$Tbl2,$acc15 lbzx $acc13,$Tbl2,$acc13
rlwimi $s0,$acc04,16,8,15 rlwimi $s0,$acc04,16,8,15
rlwimi $s1,$acc05,16,8,15 rlwimi $s1,$acc05,16,8,15
lbzx $acc14,$Tbl2,$acc14
lbzx $acc15,$Tbl2,$acc15
rlwimi $s2,$acc06,16,8,15 rlwimi $s2,$acc06,16,8,15
rlwimi $s3,$acc07,16,8,15 rlwimi $s3,$acc07,16,8,15
rlwimi $s0,$acc08,8,16,23 rlwimi $s0,$acc08,8,16,23
@@ -897,40 +910,40 @@ Ldec_compact_loop:
rlwinm $acc01,$s1,`32-24`,24,31 rlwinm $acc01,$s1,`32-24`,24,31
rlwinm $acc02,$s2,`32-24`,24,31 rlwinm $acc02,$s2,`32-24`,24,31
rlwinm $acc03,$s3,`32-24`,24,31 rlwinm $acc03,$s3,`32-24`,24,31
lbzx $acc00,$Tbl1,$acc00
lbzx $acc01,$Tbl1,$acc01
rlwinm $acc04,$s3,`32-16`,24,31 rlwinm $acc04,$s3,`32-16`,24,31
rlwinm $acc05,$s0,`32-16`,24,31 rlwinm $acc05,$s0,`32-16`,24,31
lbzx $acc02,$Tbl1,$acc02
lbzx $acc03,$Tbl1,$acc03
rlwinm $acc06,$s1,`32-16`,24,31 rlwinm $acc06,$s1,`32-16`,24,31
rlwinm $acc07,$s2,`32-16`,24,31 rlwinm $acc07,$s2,`32-16`,24,31
lbzx $acc04,$Tbl1,$acc04 lbzx $acc00,$Tbl1,$acc00
lbzx $acc05,$Tbl1,$acc05 lbzx $acc01,$Tbl1,$acc01
rlwinm $acc08,$s2,`32-8`,24,31 rlwinm $acc08,$s2,`32-8`,24,31
rlwinm $acc09,$s3,`32-8`,24,31 rlwinm $acc09,$s3,`32-8`,24,31
lbzx $acc06,$Tbl1,$acc06 lbzx $acc02,$Tbl1,$acc02
lbzx $acc07,$Tbl1,$acc07 lbzx $acc03,$Tbl1,$acc03
rlwinm $acc10,$s0,`32-8`,24,31 rlwinm $acc10,$s0,`32-8`,24,31
rlwinm $acc11,$s1,`32-8`,24,31 rlwinm $acc11,$s1,`32-8`,24,31
lbzx $acc08,$Tbl1,$acc08 lbzx $acc04,$Tbl1,$acc04
lbzx $acc09,$Tbl1,$acc09 lbzx $acc05,$Tbl1,$acc05
rlwinm $acc12,$s1,`0`,24,31 rlwinm $acc12,$s1,`0`,24,31
rlwinm $acc13,$s2,`0`,24,31 rlwinm $acc13,$s2,`0`,24,31
lbzx $acc10,$Tbl1,$acc10 lbzx $acc06,$Tbl1,$acc06
lbzx $acc11,$Tbl1,$acc11 lbzx $acc07,$Tbl1,$acc07
rlwinm $acc14,$s3,`0`,24,31 rlwinm $acc14,$s3,`0`,24,31
rlwinm $acc15,$s0,`0`,24,31 rlwinm $acc15,$s0,`0`,24,31
lbzx $acc12,$Tbl1,$acc12 lbzx $acc08,$Tbl1,$acc08
lbzx $acc13,$Tbl1,$acc13 lbzx $acc09,$Tbl1,$acc09
rlwinm $s0,$acc00,24,0,7 rlwinm $s0,$acc00,24,0,7
rlwinm $s1,$acc01,24,0,7 rlwinm $s1,$acc01,24,0,7
lbzx $acc14,$Tbl1,$acc14 lbzx $acc10,$Tbl1,$acc10
lbzx $acc15,$Tbl1,$acc15 lbzx $acc11,$Tbl1,$acc11
rlwinm $s2,$acc02,24,0,7 rlwinm $s2,$acc02,24,0,7
rlwinm $s3,$acc03,24,0,7 rlwinm $s3,$acc03,24,0,7
lbzx $acc12,$Tbl1,$acc12
lbzx $acc13,$Tbl1,$acc13
rlwimi $s0,$acc04,16,8,15 rlwimi $s0,$acc04,16,8,15
rlwimi $s1,$acc05,16,8,15 rlwimi $s1,$acc05,16,8,15
lbzx $acc14,$Tbl1,$acc14
lbzx $acc15,$Tbl1,$acc15
rlwimi $s2,$acc06,16,8,15 rlwimi $s2,$acc06,16,8,15
rlwimi $s3,$acc07,16,8,15 rlwimi $s3,$acc07,16,8,15
rlwimi $s0,$acc08,8,16,23 rlwimi $s0,$acc08,8,16,23

View File

@@ -765,6 +765,11 @@ $code.=<<___ if (!$softonly);
srl %r5,6 srl %r5,6
ar %r5,%r0 ar %r5,%r0
larl %r1,OPENSSL_s390xcap_P
lg %r0,0(%r1)
tmhl %r0,0x4000 # check for message-security assist
jz .Lekey_internal
lghi %r0,0 # query capability vector lghi %r0,0 # query capability vector
la %r1,16($sp) la %r1,16($sp)
.long 0xb92f0042 # kmc %r4,%r2 .long 0xb92f0042 # kmc %r4,%r2
@@ -1323,6 +1328,7 @@ $code.=<<___;
4: ex $len,0($s1) 4: ex $len,0($s1)
j .Lcbc_dec_exit j .Lcbc_dec_exit
.size AES_cbc_encrypt,.-AES_cbc_encrypt .size AES_cbc_encrypt,.-AES_cbc_encrypt
.comm OPENSSL_s390xcap_P,8,8
___ ___
} }
$code.=<<___; $code.=<<___;

View File

@@ -1176,6 +1176,7 @@ ___
# As UltraSPARC T1, a.k.a. Niagara, has shared FPU, FP nops can have # As UltraSPARC T1, a.k.a. Niagara, has shared FPU, FP nops can have
# undesired effect, so just omit them and sacrifice some portion of # undesired effect, so just omit them and sacrifice some portion of
# percent in performance... # percent in performance...
$code =~ s/fmovs.*$//gem; $code =~ s/fmovs.*$//gm;
print $code; print $code;
close STDOUT; # ensure flush

View File

@@ -36,7 +36,8 @@ $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1;
( $xlate="${dir}../../perlasm/x86_64-xlate.pl" and -f $xlate) or ( $xlate="${dir}../../perlasm/x86_64-xlate.pl" and -f $xlate) or
die "can't locate x86_64-xlate.pl"; die "can't locate x86_64-xlate.pl";
open STDOUT,"| $^X $xlate $flavour $output"; open OUT,"| \"$^X\" $xlate $flavour $output";
*STDOUT=*OUT;
$verticalspin=1; # unlike 32-bit version $verticalspin performs $verticalspin=1; # unlike 32-bit version $verticalspin performs
# ~15% better on both AMD and Intel cores # ~15% better on both AMD and Intel cores

View File

@@ -1,3 +1,5 @@
#!/usr/bin/env perl
print <<'___';
.text .text
.set noat .set noat
@@ -68,9 +70,9 @@ OPENSSL_wipe_cpu:
OPENSSL_atomic_add: OPENSSL_atomic_add:
.frame $30,0,$26 .frame $30,0,$26
.prologue 0 .prologue 0
1: ldl_l $0,($16) 1: ldl_l $0,0($16)
addl $0,$17,$1 addl $0,$17,$1
stl_c $1,($16) stl_c $1,0($16)
beq $1,1b beq $1,1b
addl $0,$17,$0 addl $0,$17,$0
ret ($26) ret ($26)
@@ -90,25 +92,26 @@ OPENSSL_rdtsc:
OPENSSL_cleanse: OPENSSL_cleanse:
.frame $30,0,$26 .frame $30,0,$26
.prologue 0 .prologue 0
beq $17,.Ldone
and $16,7,$0 and $16,7,$0
bic $17,7,$at bic $17,7,$at
beq $at,.Little beq $at,.Little
beq $0,.Laligned beq $0,.Laligned
.Little: .Little:
subq $0,8,$0
ldq_u $1,0($16) ldq_u $1,0($16)
mov $16,$2 mov $16,$2
.Lalign: .Lalign:
mskbl $1,$16,$1 mskbl $1,$16,$1
lda $16,1($16) lda $16,1($16)
subq $17,1,$17 subq $17,1,$17
subq $0,1,$0 addq $0,1,$0
beq $17,.Lout beq $17,.Lout
bne $0,.Lalign bne $0,.Lalign
.Lout: stq_u $1,0($2) .Lout: stq_u $1,0($2)
beq $17,.Ldone beq $17,.Ldone
bic $17,7,$at bic $17,7,$at
mov $17,$0
beq $at,.Little beq $at,.Little
.Laligned: .Laligned:
@@ -117,8 +120,7 @@ OPENSSL_cleanse:
lda $16,8($16) lda $16,8($16)
bic $17,7,$at bic $17,7,$at
bne $at,.Laligned bne $at,.Laligned
beq $17,.Ldone bne $17,.Little
mov $17,$0
br .Little
.Ldone: ret ($26) .Ldone: ret ($26)
.end OPENSSL_cleanse .end OPENSSL_cleanse
___

View File

@@ -136,11 +136,16 @@ ASN1_BIT_STRING *c2i_ASN1_BIT_STRING(ASN1_BIT_STRING **a,
p= *pp; p= *pp;
i= *(p++); i= *(p++);
if (i > 7)
{
i=ASN1_R_INVALID_BIT_STRING_BITS_LEFT;
goto err;
}
/* We do this to preserve the settings. If we modify /* We do this to preserve the settings. If we modify
* the settings, via the _set_bit function, we will recalculate * the settings, via the _set_bit function, we will recalculate
* on output */ * on output */
ret->flags&= ~(ASN1_STRING_FLAG_BITS_LEFT|0x07); /* clear */ ret->flags&= ~(ASN1_STRING_FLAG_BITS_LEFT|0x07); /* clear */
ret->flags|=(ASN1_STRING_FLAG_BITS_LEFT|(i&0x07)); /* set */ ret->flags|=(ASN1_STRING_FLAG_BITS_LEFT|i); /* set */
if (len-- > 1) /* using one because of the bits left byte */ if (len-- > 1) /* using one because of the bits left byte */
{ {

View File

@@ -57,6 +57,7 @@
*/ */
#include <stdio.h> #include <stdio.h>
#include <limits.h>
#include "cryptlib.h" #include "cryptlib.h"
#include <openssl/buffer.h> #include <openssl/buffer.h>
#include <openssl/asn1_mac.h> #include <openssl/asn1_mac.h>
@@ -143,17 +144,11 @@ static int asn1_d2i_read_bio(BIO *in, BUF_MEM **pb)
BUF_MEM *b; BUF_MEM *b;
unsigned char *p; unsigned char *p;
int i; int i;
int ret=-1;
ASN1_const_CTX c; ASN1_const_CTX c;
int want=HEADER_SIZE; size_t want=HEADER_SIZE;
int eos=0; int eos=0;
#if defined(__GNUC__) && defined(__ia64) size_t off=0;
/* pathetic compiler bug in all known versions as of Nov. 2002 */ size_t len=0;
long off=0;
#else
int off=0;
#endif
int len=0;
b=BUF_MEM_new(); b=BUF_MEM_new();
if (b == NULL) if (b == NULL)
@@ -169,7 +164,7 @@ static int asn1_d2i_read_bio(BIO *in, BUF_MEM **pb)
{ {
want-=(len-off); want-=(len-off);
if (!BUF_MEM_grow_clean(b,len+want)) if (len + want < len || !BUF_MEM_grow_clean(b,len+want))
{ {
ASN1err(ASN1_F_ASN1_D2I_READ_BIO,ERR_R_MALLOC_FAILURE); ASN1err(ASN1_F_ASN1_D2I_READ_BIO,ERR_R_MALLOC_FAILURE);
goto err; goto err;
@@ -181,7 +176,14 @@ static int asn1_d2i_read_bio(BIO *in, BUF_MEM **pb)
goto err; goto err;
} }
if (i > 0) if (i > 0)
{
if (len+i < len)
{
ASN1err(ASN1_F_ASN1_D2I_READ_BIO,ASN1_R_TOO_LONG);
goto err;
}
len+=i; len+=i;
}
} }
/* else data already loaded */ /* else data already loaded */
@@ -206,6 +208,11 @@ static int asn1_d2i_read_bio(BIO *in, BUF_MEM **pb)
{ {
/* no data body so go round again */ /* no data body so go round again */
eos++; eos++;
if (eos < 0)
{
ASN1err(ASN1_F_ASN1_D2I_READ_BIO,ASN1_R_HEADER_TOO_LONG);
goto err;
}
want=HEADER_SIZE; want=HEADER_SIZE;
} }
else if (eos && (c.slen == 0) && (c.tag == V_ASN1_EOC)) else if (eos && (c.slen == 0) && (c.tag == V_ASN1_EOC))
@@ -220,10 +227,16 @@ static int asn1_d2i_read_bio(BIO *in, BUF_MEM **pb)
else else
{ {
/* suck in c.slen bytes of data */ /* suck in c.slen bytes of data */
want=(int)c.slen; want=c.slen;
if (want > (len-off)) if (want > (len-off))
{ {
want-=(len-off); want-=(len-off);
if (want > INT_MAX /* BIO_read takes an int length */ ||
len+want < len)
{
ASN1err(ASN1_F_ASN1_D2I_READ_BIO,ASN1_R_TOO_LONG);
goto err;
}
if (!BUF_MEM_grow_clean(b,len+want)) if (!BUF_MEM_grow_clean(b,len+want))
{ {
ASN1err(ASN1_F_ASN1_D2I_READ_BIO,ERR_R_MALLOC_FAILURE); ASN1err(ASN1_F_ASN1_D2I_READ_BIO,ERR_R_MALLOC_FAILURE);
@@ -238,11 +251,18 @@ static int asn1_d2i_read_bio(BIO *in, BUF_MEM **pb)
ASN1_R_NOT_ENOUGH_DATA); ASN1_R_NOT_ENOUGH_DATA);
goto err; goto err;
} }
/* This can't overflow because
* |len+want| didn't overflow. */
len+=i; len+=i;
want -= i; want-=i;
} }
} }
off+=(int)c.slen; if (off + c.slen < off)
{
ASN1err(ASN1_F_ASN1_D2I_READ_BIO,ASN1_R_TOO_LONG);
goto err;
}
off+=c.slen;
if (eos <= 0) if (eos <= 0)
{ {
break; break;
@@ -252,9 +272,15 @@ static int asn1_d2i_read_bio(BIO *in, BUF_MEM **pb)
} }
} }
if (off > INT_MAX)
{
ASN1err(ASN1_F_ASN1_D2I_READ_BIO,ASN1_R_TOO_LONG);
goto err;
}
*pb = b; *pb = b;
return off; return off;
err: err:
if (b != NULL) BUF_MEM_free(b); if (b != NULL) BUF_MEM_free(b);
return(ret); return -1;
} }

View File

@@ -62,7 +62,7 @@
#ifndef NO_OLD_ASN1 #ifndef NO_OLD_ASN1
void *ASN1_dup(i2d_of_void *i2d, d2i_of_void *d2i, char *x) void *ASN1_dup(i2d_of_void *i2d, d2i_of_void *d2i, void *x)
{ {
unsigned char *b,*p; unsigned char *b,*p;
const unsigned char *p2; const unsigned char *p2;

View File

@@ -243,7 +243,7 @@ ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_adj(ASN1_GENERALIZEDTIME *s,
p=OPENSSL_malloc(len); p=OPENSSL_malloc(len);
if (p == NULL) if (p == NULL)
{ {
ASN1err(ASN1_F_ASN1_GENERALIZEDTIME_SET, ASN1err(ASN1_F_ASN1_GENERALIZEDTIME_ADJ,
ERR_R_MALLOC_FAILURE); ERR_R_MALLOC_FAILURE);
return(NULL); return(NULL);
} }

View File

@@ -116,7 +116,7 @@ int i2c_ASN1_INTEGER(ASN1_INTEGER *a, unsigned char **pp)
int pad=0,ret,i,neg; int pad=0,ret,i,neg;
unsigned char *p,*n,pb=0; unsigned char *p,*n,pb=0;
if ((a == NULL) || (a->data == NULL)) return(0); if (a == NULL) return(0);
neg=a->type & V_ASN1_NEG; neg=a->type & V_ASN1_NEG;
if (a->length == 0) if (a->length == 0)
ret=1; ret=1;
@@ -273,7 +273,7 @@ ASN1_INTEGER *d2i_ASN1_UINTEGER(ASN1_INTEGER **a, const unsigned char **pp,
{ {
ASN1_INTEGER *ret=NULL; ASN1_INTEGER *ret=NULL;
const unsigned char *p; const unsigned char *p;
unsigned char *to,*s; unsigned char *s;
long len; long len;
int inf,tag,xclass; int inf,tag,xclass;
int i; int i;
@@ -308,7 +308,6 @@ ASN1_INTEGER *d2i_ASN1_UINTEGER(ASN1_INTEGER **a, const unsigned char **pp,
i=ERR_R_MALLOC_FAILURE; i=ERR_R_MALLOC_FAILURE;
goto err; goto err;
} }
to=s;
ret->type=V_ASN1_INTEGER; ret->type=V_ASN1_INTEGER;
if(len) { if(len) {
if ((*p == 0) && (len != 1)) if ((*p == 0) && (len != 1))
@@ -387,8 +386,8 @@ long ASN1_INTEGER_get(const ASN1_INTEGER *a)
if (a->length > (int)sizeof(long)) if (a->length > (int)sizeof(long))
{ {
/* hmm... a bit ugly */ /* hmm... a bit ugly, return all ones */
return(0xffffffffL); return -1;
} }
if (a->data == NULL) if (a->data == NULL)
return 0; return 0;

View File

@@ -93,7 +93,7 @@ int ASN1_mbstring_ncopy(ASN1_STRING **out, const unsigned char *in, int len,
int str_type; int str_type;
int ret; int ret;
char free_out; char free_out;
int outform, outlen; int outform, outlen = 0;
ASN1_STRING *dest; ASN1_STRING *dest;
unsigned char *p; unsigned char *p;
int nchar; int nchar;

View File

@@ -139,7 +139,7 @@ int a2d_ASN1_OBJECT(unsigned char *out, int olen, const char *buf, int num)
ASN1err(ASN1_F_A2D_ASN1_OBJECT,ASN1_R_INVALID_DIGIT); ASN1err(ASN1_F_A2D_ASN1_OBJECT,ASN1_R_INVALID_DIGIT);
goto err; goto err;
} }
if (!use_bn && l > (ULONG_MAX / 10L)) if (!use_bn && l >= ((ULONG_MAX - 80) / 10L))
{ {
use_bn = 1; use_bn = 1;
if (!bl) if (!bl)
@@ -283,13 +283,36 @@ err:
ASN1err(ASN1_F_D2I_ASN1_OBJECT,i); ASN1err(ASN1_F_D2I_ASN1_OBJECT,i);
return(NULL); return(NULL);
} }
ASN1_OBJECT *c2i_ASN1_OBJECT(ASN1_OBJECT **a, const unsigned char **pp, ASN1_OBJECT *c2i_ASN1_OBJECT(ASN1_OBJECT **a, const unsigned char **pp,
long len) long len)
{ {
ASN1_OBJECT *ret=NULL; ASN1_OBJECT *ret=NULL;
const unsigned char *p; const unsigned char *p;
unsigned char *data; unsigned char *data;
int i; int i, length;
/* Sanity check OID encoding.
* Need at least one content octet.
* MSB must be clear in the last octet.
* can't have leading 0x80 in subidentifiers, see: X.690 8.19.2
*/
if (len <= 0 || len > INT_MAX || pp == NULL || (p = *pp) == NULL ||
p[len - 1] & 0x80)
{
ASN1err(ASN1_F_C2I_ASN1_OBJECT,ASN1_R_INVALID_OBJECT_ENCODING);
return NULL;
}
/* Now 0 < len <= INT_MAX, so the cast is safe. */
length = (int)len;
for (i = 0; i < length; i++, p++)
{
if (*p == 0x80 && (!i || !(p[-1] & 0x80)))
{
ASN1err(ASN1_F_C2I_ASN1_OBJECT,ASN1_R_INVALID_OBJECT_ENCODING);
return NULL;
}
}
/* only the ASN1_OBJECTs from the 'table' will have values /* only the ASN1_OBJECTs from the 'table' will have values
* for ->sn or ->ln */ * for ->sn or ->ln */
@@ -305,23 +328,23 @@ ASN1_OBJECT *c2i_ASN1_OBJECT(ASN1_OBJECT **a, const unsigned char **pp,
data = (unsigned char *)ret->data; data = (unsigned char *)ret->data;
ret->data = NULL; ret->data = NULL;
/* once detached we can change it */ /* once detached we can change it */
if ((data == NULL) || (ret->length < len)) if ((data == NULL) || (ret->length < length))
{ {
ret->length=0; ret->length=0;
if (data != NULL) OPENSSL_free(data); if (data != NULL) OPENSSL_free(data);
data=(unsigned char *)OPENSSL_malloc(len ? (int)len : 1); data=(unsigned char *)OPENSSL_malloc(length);
if (data == NULL) if (data == NULL)
{ i=ERR_R_MALLOC_FAILURE; goto err; } { i=ERR_R_MALLOC_FAILURE; goto err; }
ret->flags|=ASN1_OBJECT_FLAG_DYNAMIC_DATA; ret->flags|=ASN1_OBJECT_FLAG_DYNAMIC_DATA;
} }
memcpy(data,p,(int)len); memcpy(data,p,length);
/* reattach data to object, after which it remains const */ /* reattach data to object, after which it remains const */
ret->data =data; ret->data =data;
ret->length=(int)len; ret->length=length;
ret->sn=NULL; ret->sn=NULL;
ret->ln=NULL; ret->ln=NULL;
/* ret->flags=ASN1_OBJECT_FLAG_DYNAMIC; we know it is dynamic */ /* ret->flags=ASN1_OBJECT_FLAG_DYNAMIC; we know it is dynamic */
p+=len; p+=length;
if (a != NULL) (*a)=ret; if (a != NULL) (*a)=ret;
*pp=p; *pp=p;

View File

@@ -85,7 +85,7 @@ static int SetBlobCmp(const void *elem1, const void *elem2 )
} }
/* int is_set: if TRUE, then sort the contents (i.e. it isn't a SEQUENCE) */ /* int is_set: if TRUE, then sort the contents (i.e. it isn't a SEQUENCE) */
int i2d_ASN1_SET(STACK_OF(BLOCK) *a, unsigned char **pp, int i2d_ASN1_SET(STACK_OF(OPENSSL_BLOCK) *a, unsigned char **pp,
i2d_of_void *i2d, int ex_tag, int ex_class, i2d_of_void *i2d, int ex_tag, int ex_class,
int is_set) int is_set)
{ {
@@ -97,8 +97,8 @@ int i2d_ASN1_SET(STACK_OF(BLOCK) *a, unsigned char **pp,
int totSize; int totSize;
if (a == NULL) return(0); if (a == NULL) return(0);
for (i=sk_BLOCK_num(a)-1; i>=0; i--) for (i=sk_OPENSSL_BLOCK_num(a)-1; i>=0; i--)
ret+=i2d(sk_BLOCK_value(a,i),NULL); ret+=i2d(sk_OPENSSL_BLOCK_value(a,i),NULL);
r=ASN1_object_size(1,ret,ex_tag); r=ASN1_object_size(1,ret,ex_tag);
if (pp == NULL) return(r); if (pp == NULL) return(r);
@@ -109,10 +109,10 @@ int i2d_ASN1_SET(STACK_OF(BLOCK) *a, unsigned char **pp,
/* And then again by Ben */ /* And then again by Ben */
/* And again by Steve */ /* And again by Steve */
if(!is_set || (sk_BLOCK_num(a) < 2)) if(!is_set || (sk_OPENSSL_BLOCK_num(a) < 2))
{ {
for (i=0; i<sk_BLOCK_num(a); i++) for (i=0; i<sk_OPENSSL_BLOCK_num(a); i++)
i2d(sk_BLOCK_value(a,i),&p); i2d(sk_OPENSSL_BLOCK_value(a,i),&p);
*pp=p; *pp=p;
return(r); return(r);
@@ -120,17 +120,17 @@ int i2d_ASN1_SET(STACK_OF(BLOCK) *a, unsigned char **pp,
pStart = p; /* Catch the beg of Setblobs*/ pStart = p; /* Catch the beg of Setblobs*/
/* In this array we will store the SET blobs */ /* In this array we will store the SET blobs */
rgSetBlob = OPENSSL_malloc(sk_BLOCK_num(a) * sizeof(MYBLOB)); rgSetBlob = OPENSSL_malloc(sk_OPENSSL_BLOCK_num(a) * sizeof(MYBLOB));
if (rgSetBlob == NULL) if (rgSetBlob == NULL)
{ {
ASN1err(ASN1_F_I2D_ASN1_SET,ERR_R_MALLOC_FAILURE); ASN1err(ASN1_F_I2D_ASN1_SET,ERR_R_MALLOC_FAILURE);
return(0); return(0);
} }
for (i=0; i<sk_BLOCK_num(a); i++) for (i=0; i<sk_OPENSSL_BLOCK_num(a); i++)
{ {
rgSetBlob[i].pbData = p; /* catch each set encode blob */ rgSetBlob[i].pbData = p; /* catch each set encode blob */
i2d(sk_BLOCK_value(a,i),&p); i2d(sk_OPENSSL_BLOCK_value(a,i),&p);
rgSetBlob[i].cbData = p - rgSetBlob[i].pbData; /* Length of this rgSetBlob[i].cbData = p - rgSetBlob[i].pbData; /* Length of this
SetBlob SetBlob
*/ */
@@ -140,7 +140,7 @@ SetBlob
/* Now we have to sort the blobs. I am using a simple algo. /* Now we have to sort the blobs. I am using a simple algo.
*Sort ptrs *Copy to temp-mem *Copy from temp-mem to user-mem*/ *Sort ptrs *Copy to temp-mem *Copy from temp-mem to user-mem*/
qsort( rgSetBlob, sk_BLOCK_num(a), sizeof(MYBLOB), SetBlobCmp); qsort( rgSetBlob, sk_OPENSSL_BLOCK_num(a), sizeof(MYBLOB), SetBlobCmp);
if (!(pTempMem = OPENSSL_malloc(totSize))) if (!(pTempMem = OPENSSL_malloc(totSize)))
{ {
ASN1err(ASN1_F_I2D_ASN1_SET,ERR_R_MALLOC_FAILURE); ASN1err(ASN1_F_I2D_ASN1_SET,ERR_R_MALLOC_FAILURE);
@@ -149,7 +149,7 @@ SetBlob
/* Copy to temp mem */ /* Copy to temp mem */
p = pTempMem; p = pTempMem;
for(i=0; i<sk_BLOCK_num(a); ++i) for(i=0; i<sk_OPENSSL_BLOCK_num(a); ++i)
{ {
memcpy(p, rgSetBlob[i].pbData, rgSetBlob[i].cbData); memcpy(p, rgSetBlob[i].pbData, rgSetBlob[i].cbData);
p += rgSetBlob[i].cbData; p += rgSetBlob[i].cbData;
@@ -163,17 +163,18 @@ SetBlob
return(r); return(r);
} }
STACK_OF(BLOCK) *d2i_ASN1_SET(STACK_OF(BLOCK) **a, const unsigned char **pp, STACK_OF(OPENSSL_BLOCK) *d2i_ASN1_SET(STACK_OF(OPENSSL_BLOCK) **a,
const unsigned char **pp,
long length, d2i_of_void *d2i, long length, d2i_of_void *d2i,
void (*free_func)(BLOCK), int ex_tag, void (*free_func)(OPENSSL_BLOCK), int ex_tag,
int ex_class) int ex_class)
{ {
ASN1_const_CTX c; ASN1_const_CTX c;
STACK_OF(BLOCK) *ret=NULL; STACK_OF(OPENSSL_BLOCK) *ret=NULL;
if ((a == NULL) || ((*a) == NULL)) if ((a == NULL) || ((*a) == NULL))
{ {
if ((ret=sk_BLOCK_new_null()) == NULL) if ((ret=sk_OPENSSL_BLOCK_new_null()) == NULL)
{ {
ASN1err(ASN1_F_D2I_ASN1_SET,ERR_R_MALLOC_FAILURE); ASN1err(ASN1_F_D2I_ASN1_SET,ERR_R_MALLOC_FAILURE);
goto err; goto err;
@@ -221,7 +222,7 @@ STACK_OF(BLOCK) *d2i_ASN1_SET(STACK_OF(BLOCK) **a, const unsigned char **pp,
asn1_add_error(*pp,(int)(c.p- *pp)); asn1_add_error(*pp,(int)(c.p- *pp));
goto err; goto err;
} }
if (!sk_BLOCK_push(ret,s)) goto err; if (!sk_OPENSSL_BLOCK_push(ret,s)) goto err;
} }
if (a != NULL) (*a)=ret; if (a != NULL) (*a)=ret;
*pp=c.p; *pp=c.p;
@@ -230,9 +231,9 @@ err:
if ((ret != NULL) && ((a == NULL) || (*a != ret))) if ((ret != NULL) && ((a == NULL) || (*a != ret)))
{ {
if (free_func != NULL) if (free_func != NULL)
sk_BLOCK_pop_free(ret,free_func); sk_OPENSSL_BLOCK_pop_free(ret,free_func);
else else
sk_BLOCK_free(ret); sk_OPENSSL_BLOCK_free(ret);
} }
return(NULL); return(NULL);
} }

View File

@@ -74,6 +74,11 @@
#define CHARTYPE_BS_ESC (ASN1_STRFLGS_ESC_2253 | CHARTYPE_FIRST_ESC_2253 | CHARTYPE_LAST_ESC_2253) #define CHARTYPE_BS_ESC (ASN1_STRFLGS_ESC_2253 | CHARTYPE_FIRST_ESC_2253 | CHARTYPE_LAST_ESC_2253)
#define ESC_FLAGS (ASN1_STRFLGS_ESC_2253 | \
ASN1_STRFLGS_ESC_QUOTE | \
ASN1_STRFLGS_ESC_CTRL | \
ASN1_STRFLGS_ESC_MSB)
/* Three IO functions for sending data to memory, a BIO and /* Three IO functions for sending data to memory, a BIO and
* and a FILE pointer. * and a FILE pointer.
@@ -148,6 +153,13 @@ static int do_esc_char(unsigned long c, unsigned char flags, char *do_quotes, ch
if(!io_ch(arg, tmphex, 3)) return -1; if(!io_ch(arg, tmphex, 3)) return -1;
return 3; return 3;
} }
/* If we get this far and do any escaping at all must escape
* the escape character itself: backslash.
*/
if (chtmp == '\\' && flags & ESC_FLAGS) {
if(!io_ch(arg, "\\\\", 2)) return -1;
return 2;
}
if(!io_ch(arg, &chtmp, 1)) return -1; if(!io_ch(arg, &chtmp, 1)) return -1;
return 1; return 1;
} }
@@ -292,11 +304,6 @@ static const signed char tag2nbyte[] = {
4, -1, 2 /* 28-30 */ 4, -1, 2 /* 28-30 */
}; };
#define ESC_FLAGS (ASN1_STRFLGS_ESC_2253 | \
ASN1_STRFLGS_ESC_QUOTE | \
ASN1_STRFLGS_ESC_CTRL | \
ASN1_STRFLGS_ESC_MSB)
/* This is the main function, print out an /* This is the main function, print out an
* ASN1_STRING taking note of various escape * ASN1_STRING taking note of various escape
* and display options. Returns number of * and display options. Returns number of
@@ -560,6 +567,7 @@ int ASN1_STRING_to_UTF8(unsigned char **out, ASN1_STRING *in)
if(mbflag == -1) return -1; if(mbflag == -1) return -1;
mbflag |= MBSTRING_FLAG; mbflag |= MBSTRING_FLAG;
stmp.data = NULL; stmp.data = NULL;
stmp.length = 0;
ret = ASN1_mbstring_copy(&str, in->data, in->length, mbflag, B_ASN1_UTF8STRING); ret = ASN1_mbstring_copy(&str, in->data, in->length, mbflag, B_ASN1_UTF8STRING);
if(ret < 0) return ret; if(ret < 0) return ret;
*out = stmp.data; *out = stmp.data;

View File

@@ -74,7 +74,7 @@ static int sk_table_cmp(const ASN1_STRING_TABLE * const *a,
* certain software (e.g. Netscape) has problems with them. * certain software (e.g. Netscape) has problems with them.
*/ */
static unsigned long global_mask = 0xFFFFFFFFL; static unsigned long global_mask = B_ASN1_UTF8STRING;
void ASN1_STRING_set_default_mask(unsigned long mask) void ASN1_STRING_set_default_mask(unsigned long mask)
{ {
@@ -95,7 +95,7 @@ unsigned long ASN1_STRING_get_default_mask(void)
* default: the default value, Printable, T61, BMP. * default: the default value, Printable, T61, BMP.
*/ */
int ASN1_STRING_set_default_mask_asc(char *p) int ASN1_STRING_set_default_mask_asc(const char *p)
{ {
unsigned long mask; unsigned long mask;
char *end; char *end;

View File

@@ -112,7 +112,7 @@ ASN1_TIME *ASN1_TIME_adj(ASN1_TIME *s, time_t t,
ts=OPENSSL_gmtime(&t,&data); ts=OPENSSL_gmtime(&t,&data);
if (ts == NULL) if (ts == NULL)
{ {
ASN1err(ASN1_F_ASN1_TIME_SET, ASN1_R_ERROR_GETTING_TIME); ASN1err(ASN1_F_ASN1_TIME_ADJ, ASN1_R_ERROR_GETTING_TIME);
return NULL; return NULL;
} }
if (offset_day || offset_sec) if (offset_day || offset_sec)
@@ -180,6 +180,7 @@ int ASN1_TIME_set_string(ASN1_TIME *s, const char *str)
t.length = strlen(str); t.length = strlen(str);
t.data = (unsigned char *)str; t.data = (unsigned char *)str;
t.flags = 0;
t.type = V_ASN1_UTCTIME; t.type = V_ASN1_UTCTIME;

View File

@@ -113,7 +113,7 @@ IMPLEMENT_STACK_OF(ASN1_TYPE)
IMPLEMENT_ASN1_SET_OF(ASN1_TYPE) IMPLEMENT_ASN1_SET_OF(ASN1_TYPE)
/* Returns 0 if they are equal, != 0 otherwise. */ /* Returns 0 if they are equal, != 0 otherwise. */
int ASN1_TYPE_cmp(ASN1_TYPE *a, ASN1_TYPE *b) int ASN1_TYPE_cmp(const ASN1_TYPE *a, const ASN1_TYPE *b)
{ {
int result = -1; int result = -1;

View File

@@ -196,24 +196,29 @@ ASN1_UTCTIME *ASN1_UTCTIME_adj(ASN1_UTCTIME *s, time_t t,
struct tm *ts; struct tm *ts;
struct tm data; struct tm data;
size_t len = 20; size_t len = 20;
int free_s = 0;
if (s == NULL) if (s == NULL)
{
free_s = 1;
s=M_ASN1_UTCTIME_new(); s=M_ASN1_UTCTIME_new();
}
if (s == NULL) if (s == NULL)
return(NULL); goto err;
ts=OPENSSL_gmtime(&t, &data); ts=OPENSSL_gmtime(&t, &data);
if (ts == NULL) if (ts == NULL)
return(NULL); goto err;
if (offset_day || offset_sec) if (offset_day || offset_sec)
{ {
if (!OPENSSL_gmtime_adj(ts, offset_day, offset_sec)) if (!OPENSSL_gmtime_adj(ts, offset_day, offset_sec))
return NULL; goto err;
} }
if((ts->tm_year < 50) || (ts->tm_year >= 150)) if((ts->tm_year < 50) || (ts->tm_year >= 150))
return NULL; goto err;
p=(char *)s->data; p=(char *)s->data;
if ((p == NULL) || ((size_t)s->length < len)) if ((p == NULL) || ((size_t)s->length < len))
@@ -221,8 +226,8 @@ ASN1_UTCTIME *ASN1_UTCTIME_adj(ASN1_UTCTIME *s, time_t t,
p=OPENSSL_malloc(len); p=OPENSSL_malloc(len);
if (p == NULL) if (p == NULL)
{ {
ASN1err(ASN1_F_ASN1_UTCTIME_SET,ERR_R_MALLOC_FAILURE); ASN1err(ASN1_F_ASN1_UTCTIME_ADJ,ERR_R_MALLOC_FAILURE);
return(NULL); goto err;
} }
if (s->data != NULL) if (s->data != NULL)
OPENSSL_free(s->data); OPENSSL_free(s->data);
@@ -237,6 +242,10 @@ ASN1_UTCTIME *ASN1_UTCTIME_adj(ASN1_UTCTIME *s, time_t t,
ebcdic2ascii(s->data, s->data, s->length); ebcdic2ascii(s->data, s->data, s->length);
#endif #endif
return(s); return(s);
err:
if (free_s && s)
M_ASN1_UTCTIME_free(s);
return NULL;
} }

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