openssl.git
4 years agoremove unnecessary OPENSSL_FIPS reference
Dr. Stephen Henson [Sat, 18 Oct 2014 23:22:10 +0000 (00:22 +0100)]
remove unnecessary OPENSSL_FIPS reference

Reviewed-by: Tim Hudson <tjh@openssl.org>
4 years agoRemove OPENSSL_FIPSCANISTER code.
Dr. Stephen Henson [Sat, 18 Oct 2014 22:59:37 +0000 (23:59 +0100)]
Remove OPENSSL_FIPSCANISTER code.

OPENSSL_FIPSCANISTER is only set if the fips module is being built
(as opposed to being used). Since the fips module wont be built in
master this is redundant.
Reviewed-by: Tim Hudson <tjh@openssl.org>
4 years agoRemove FIPSCANISTERINTERNAL reference.
Dr. Stephen Henson [Sat, 18 Oct 2014 22:59:11 +0000 (23:59 +0100)]
Remove FIPSCANISTERINTERNAL reference.

Reviewed-by: Tim Hudson <tjh@openssl.org>
4 years agoRemove fips utility build rules from test/Makefile
Dr. Stephen Henson [Sat, 18 Oct 2014 22:56:45 +0000 (23:56 +0100)]
Remove fips utility build rules from test/Makefile

The fips test utilities are only build if an FIPS module is being
built from source. As this isn't done in master these are redundant.
Reviewed-by: Tim Hudson <tjh@openssl.org>
4 years agoRemove fipscanister build functionality from makefiles.
Dr. Stephen Henson [Sat, 18 Oct 2014 22:47:03 +0000 (23:47 +0100)]
Remove fipscanister build functionality from makefiles.

Reviewed-by: Tim Hudson <tjh@openssl.org>
4 years agoRemove fipscanister from Configure, delete fips directory
Dr. Stephen Henson [Sat, 18 Oct 2014 22:46:00 +0000 (23:46 +0100)]
Remove fipscanister from Configure, delete fips directory

Reviewed-by: Tim Hudson <tjh@openssl.org>
4 years agoRemove some unnecessary OPENSSL_FIPS references
Dr. Stephen Henson [Sat, 18 Oct 2014 19:14:36 +0000 (20:14 +0100)]
Remove some unnecessary OPENSSL_FIPS references

FIPS_mode() exists in all versions of OpenSSL but always returns 0 if OpenSSL is not FIPS
capable.
Reviewed-by: Tim Hudson <tjh@openssl.org>
4 years agoAdd CHANGES entry for OCB
Matt Caswell [Mon, 8 Dec 2014 00:04:25 +0000 (00:04 +0000)]
Add CHANGES entry for OCB

Reviewed-by: Tim Hudson <tjh@openssl.org>
4 years agoAdded OPENSSL_NO_OCB guards
Matt Caswell [Sun, 7 Dec 2014 23:53:22 +0000 (23:53 +0000)]
Added OPENSSL_NO_OCB guards

Reviewed-by: Tim Hudson <tjh@openssl.org>
4 years agoAdd documentation for OCB mode
Matt Caswell [Sat, 6 Dec 2014 20:55:53 +0000 (20:55 +0000)]
Add documentation for OCB mode

Reviewed-by: Tim Hudson <tjh@openssl.org>
4 years agoAdd tests for OCB mode
Matt Caswell [Sat, 6 Dec 2014 20:55:36 +0000 (20:55 +0000)]
Add tests for OCB mode

Reviewed-by: Tim Hudson <tjh@openssl.org>
4 years agoAdd EVP support for OCB mode
Matt Caswell [Sat, 6 Dec 2014 20:55:10 +0000 (20:55 +0000)]
Add EVP support for OCB mode

Reviewed-by: Tim Hudson <tjh@openssl.org>
4 years agoAdd support for OCB mode as per RFC7253
Matt Caswell [Sat, 6 Dec 2014 20:53:35 +0000 (20:53 +0000)]
Add support for OCB mode as per RFC7253

Reviewed-by: Tim Hudson <tjh@openssl.org>
4 years agoClarify the return values for SSL_get_shared_curve.
Emilia Kasper [Thu, 4 Dec 2014 14:00:11 +0000 (15:00 +0100)]
Clarify the return values for SSL_get_shared_curve.

Reviewed-by: Matt Caswell <matt@openssl.org>
4 years agoAdd extra checks for odd-length EC curve lists.
Emilia Kasper [Mon, 1 Dec 2014 15:55:55 +0000 (16:55 +0100)]
Add extra checks for odd-length EC curve lists.

Odd-length lists should be rejected everywhere upon parsing. Nevertheless,
be extra careful and add guards against off-by-one reads.

Also, drive-by replace inexplicable double-negation with an explicit comparison.

Reviewed-by: Matt Caswell <matt@openssl.org>
4 years agoReject elliptic curve lists of odd lengths.
Emilia Kasper [Mon, 1 Dec 2014 14:04:02 +0000 (15:04 +0100)]
Reject elliptic curve lists of odd lengths.

The Supported Elliptic Curves extension contains a vector of NamedCurves
of 2 bytes each, so the total length must be even. Accepting odd-length
lists was observed to lead to a non-exploitable one-byte out-of-bounds
read in the latest development branches (1.0.2 and master). Released
versions of OpenSSL are not affected.

Thanks to Felix Groebert of the Google Security Team for reporting this issue.

Reviewed-by: Matt Caswell <matt@openssl.org>
4 years agoFix broken build
Emilia Kasper [Fri, 5 Dec 2014 15:08:12 +0000 (16:08 +0100)]
Fix broken build

Add includes missing from commit 33eab3f6af51c6d7fe68ee4960930df4f1616bd5

Reviewed-by: Geoff Thorpe <geoff@openssl.org>
4 years agoReplace GOST_R_MALLOC_FAILURE and GOST_R_NO_MEMORY with ERR_R_MALLOC_FAILURE
Kurt Roeckx [Thu, 4 Dec 2014 17:34:29 +0000 (18:34 +0100)]
Replace GOST_R_MALLOC_FAILURE and GOST_R_NO_MEMORY with ERR_R_MALLOC_FAILURE

Reviewed-by: Richard Levitte <levitte@openssl.org>
4 years agocapi_get_provname: Check return values
Kurt Roeckx [Thu, 4 Dec 2014 17:16:42 +0000 (18:16 +0100)]
capi_get_provname: Check return values

Reviewed-by: Richard Levitte <levitte@openssl.org>
4 years agossl_create_cipher_list: check whether push onto cipherstack succeeds
Jonas Maebe [Mon, 2 Dec 2013 21:04:47 +0000 (22:04 +0100)]
ssl_create_cipher_list: check whether push onto cipherstack succeeds

Signed-off-by: Kurt Roeckx <kurt@roeckx.be>
Reviewed-by: Richard Levitte <levitte@openssl.org>
4 years agossl_cert_dup: Fix memory leak
Jonas Maebe [Mon, 2 Dec 2013 20:46:46 +0000 (21:46 +0100)]
ssl_cert_dup: Fix memory leak

Always use goto err on failure and call ssl_cert_free() on the error path so all
fields and "ret" itself are freed

Signed-off-by: Kurt Roeckx <kurt@roeckx.be>
Reviewed-by: Richard Levitte <levitte@openssl.org>
4 years agodtls1_new: free s on error path
Kurt Roeckx [Mon, 2 Dec 2013 17:07:14 +0000 (18:07 +0100)]
dtls1_new: free s on error path

Reviewed-by: Richard Levitte <levitte@openssl.org>
4 years agodtls1_heartbeat: check for NULL after allocating s->cert->ctypes
Jonas Maebe [Sun, 8 Dec 2013 22:29:43 +0000 (23:29 +0100)]
dtls1_heartbeat: check for NULL after allocating s->cert->ctypes

Signed-off-by: Kurt Roeckx <kurt@roeckx.be>
Reviewed-by: Richard Levitte <levitte@openssl.org>
4 years agodtls1_process_heartbeat: check for NULL after allocating buffer
Jonas Maebe [Sun, 8 Dec 2013 22:29:17 +0000 (23:29 +0100)]
dtls1_process_heartbeat: check for NULL after allocating buffer

Signed-off-by: Kurt Roeckx <kurt@roeckx.be>
Reviewed-by: Richard Levitte <levitte@openssl.org>
4 years agocapi_get_key: check for NULL after allocating key
Jonas Maebe [Sun, 8 Dec 2013 22:05:56 +0000 (23:05 +0100)]
capi_get_key: check for NULL after allocating key

Signed-off-by: Kurt Roeckx <kurt@roeckx.be>
Reviewed-by: Richard Levitte <levitte@openssl.org>
4 years agocapi_cert_get_fname: check for NULL after allocating wfname
Jonas Maebe [Sun, 8 Dec 2013 22:05:23 +0000 (23:05 +0100)]
capi_cert_get_fname: check for NULL after allocating wfname

Signed-off-by: Kurt Roeckx <kurt@roeckx.be>
Reviewed-by: Richard Levitte <levitte@openssl.org>
4 years agocapi_get_provname: free name on error if it was malloc'ed
Jonas Maebe [Sun, 8 Dec 2013 22:04:54 +0000 (23:04 +0100)]
capi_get_provname: free name on error if it was malloc'ed

Signed-off-by: Kurt Roeckx <kurt@roeckx.be>
Reviewed-by: Richard Levitte <levitte@openssl.org>
4 years agopkey_gost_mac_keygen: check for NULL after allocating keydata
Jonas Maebe [Sun, 8 Dec 2013 21:54:58 +0000 (22:54 +0100)]
pkey_gost_mac_keygen: check for NULL after allocating keydata

Signed-off-by: Kurt Roeckx <kurt@roeckx.be>
Reviewed-by: Richard Levitte <levitte@openssl.org>
4 years agopkey_gost_ctrl: check for NULL after allocating pctx->shared_ukm
Jonas Maebe [Sun, 8 Dec 2013 21:54:33 +0000 (22:54 +0100)]
pkey_gost_ctrl: check for NULL after allocating pctx->shared_ukm

Signed-off-by: Kurt Roeckx <kurt@roeckx.be>
Reviewed-by: Richard Levitte <levitte@openssl.org>
4 years agoUpdate changes to indicate that SSLv2 support has been removed
Kurt Roeckx [Thu, 4 Dec 2014 14:50:03 +0000 (15:50 +0100)]
Update changes to indicate that SSLv2 support has been removed

Reviewed-by: Matt Caswell <matt@openssl.org>
4 years agoRemove incorrect code inadvertently introduced through commit 59669b6ab.
Matt Caswell [Thu, 4 Dec 2014 09:22:50 +0000 (09:22 +0000)]
Remove incorrect code inadvertently introduced through commit 59669b6ab.

Reviewed-by: Tim Hudson <tjh@openssl.org>
4 years agoRemove SSLv2 support
Kurt Roeckx [Sun, 30 Nov 2014 14:35:22 +0000 (15:35 +0100)]
Remove SSLv2 support

The only support for SSLv2 left is receiving a SSLv2 compatible client hello.

Reviewed-by: Richard Levitte <levitte@openssl.org>
4 years agoNew location on website for binaries.
Rich Salz [Wed, 3 Dec 2014 15:55:31 +0000 (10:55 -0500)]
New location on website for binaries.

Reviewed-by: Bodo Moeller <bodo@openssl.org>
4 years agoRemove "#if 0" code
Matt Caswell [Wed, 3 Dec 2014 09:21:09 +0000 (09:21 +0000)]
Remove "#if 0" code

Reviewed-by: Tim Hudson <tjh@openssl.org>
4 years agoOnly use the fallback mtu after 2 unsuccessful retransmissions if it is less
Matt Caswell [Tue, 2 Dec 2014 11:16:35 +0000 (11:16 +0000)]
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>
4 years agoUpdates to s_client and s_server to remove the constant 28 (for IPv4 header
Matt Caswell [Mon, 1 Dec 2014 23:57:44 +0000 (23:57 +0000)]
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>
4 years agoIf we really get a situation where the underlying mtu is less than the minimum
Matt Caswell [Tue, 2 Dec 2014 00:16:55 +0000 (00:16 +0000)]
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>
4 years agoFix dtls_query_mtu so that it will always either complete with an mtu that is
Matt Caswell [Mon, 1 Dec 2014 22:18:18 +0000 (22:18 +0000)]
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>
4 years agoRemove instances in libssl of the constant 28 (for size of IPv4 header + UDP)
Matt Caswell [Mon, 1 Dec 2014 23:58:05 +0000 (23:58 +0000)]
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>
4 years agoThere are a number of instances throughout the code where the constant 28 is
Matt Caswell [Mon, 1 Dec 2014 23:49:47 +0000 (23:49 +0000)]
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>
4 years agoThe first call to query the mtu in dtls1_do_write correctly checks that the
Matt Caswell [Mon, 1 Dec 2014 11:41:25 +0000 (11:41 +0000)]
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>
4 years agoThe SSL_OP_NO_QUERY_MTU option is supposed to stop the mtu from being
Matt Caswell [Mon, 1 Dec 2014 11:13:15 +0000 (11:13 +0000)]
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>
4 years agoVerify that we have a sensible message len and fail if not
Matt Caswell [Mon, 1 Dec 2014 11:10:38 +0000 (11:10 +0000)]
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>
4 years agoUse the SSLv23 method by default
Kurt Roeckx [Sat, 29 Nov 2014 15:17:54 +0000 (16:17 +0100)]
Use the SSLv23 method by default

If SSLv2 and SSLv3 are both disabled we still support SSL/TLS.

Reviewed-by: Richard Levitte <levitte@openssl.org>
4 years agoRemove all .cvsignore files
Rich Salz [Fri, 28 Nov 2014 23:24:53 +0000 (18:24 -0500)]
Remove all .cvsignore files

Reviewed-by: Tim Hudson <tjh@openssl.org>
4 years agoCheck for FindNextFile when defining it rather than FindFirstFile
Richard Levitte [Fri, 28 Nov 2014 22:06:20 +0000 (23:06 +0100)]
Check for FindNextFile when defining it rather than FindFirstFile

Reviewed-by: Matt Caswell <matt@openssl.org>
4 years ago[PR3597] Advance to the next state variant when reusing messages.
Richard Levitte [Fri, 28 Nov 2014 19:40:10 +0000 (20:40 +0100)]
[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>
4 years agoCorrect some layout issues, convert all remaining tabs to appropriate amounts of...
Richard Levitte [Fri, 28 Nov 2014 15:31:10 +0000 (16:31 +0100)]
Correct some layout issues, convert all remaining tabs to appropriate amounts of spaces.

Reviewed-by: Matt Caswell <matt@openssl.org>
4 years agoImproves the proxy certificates howto doc.
Alok Menghrajani [Fri, 14 Nov 2014 18:39:41 +0000 (10:39 -0800)]
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>
4 years agoFix warning in ssl2_enc
Matt Caswell [Thu, 27 Nov 2014 20:32:21 +0000 (20:32 +0000)]
Fix warning in ssl2_enc

Reviewed-by: Richard Levitte <levitte@openssl.org>
4 years agoRemove more references to dtls1_enc
Matt Caswell [Thu, 27 Nov 2014 20:31:59 +0000 (20:31 +0000)]
Remove more references to dtls1_enc

Reviewed-by: Richard Levitte <levitte@openssl.org>
4 years agoCheck EVP_Cipher return values for SSL2
Matt Caswell [Tue, 18 Nov 2014 15:03:55 +0000 (15:03 +0000)]
Check EVP_Cipher return values for SSL2

Reviewed-by: Richard Levitte <levitte@openssl.org>
4 years agoDelete unused file
Matt Caswell [Tue, 18 Nov 2014 13:51:20 +0000 (13:51 +0000)]
Delete unused file

Reviewed-by: Richard Levitte <levitte@openssl.org>
4 years agoAdd checks to the return value of EVP_Cipher to prevent silent encryption failure.
Matt Caswell [Tue, 18 Nov 2014 12:56:26 +0000 (12:56 +0000)]
Add checks to the return value of EVP_Cipher to prevent silent encryption failure.

PR#1767

Reviewed-by: Richard Levitte <levitte@openssl.org>
4 years agoRemove redundant checks in ssl_cert_dup. This was causing spurious error messages...
Matt Caswell [Thu, 27 Nov 2014 11:06:43 +0000 (11:06 +0000)]
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>
4 years agoTidy up ocsp help output
Matt Caswell [Thu, 27 Nov 2014 10:15:47 +0000 (10:15 +0000)]
Tidy up ocsp help output

Reviewed-by: Dr. Stephen Henson <steve@openssl.org>
4 years agoAdd documentation on -timeout option in the ocsp utility
André Guerreiro [Thu, 27 Nov 2014 10:11:33 +0000 (10:11 +0000)]
Add documentation on -timeout option in the ocsp utility

PR#3612

Reviewed-by: Dr. Stephen Henson <steve@openssl.org>
4 years agoNetWare compilation fix.
Guenter [Thu, 27 Nov 2014 13:33:47 +0000 (13:33 +0000)]
NetWare compilation fix.

Workaround for NetWare CodeWarrior compiler which doesn't properly lookup
includes when in same directory as the C file which includes it.

PR#3569
Reviewed-by: Stephen Henson <steve@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
4 years agoUpdates to X509_NAME_get_index_by_NID.pod submitted by user Bernardh via the wiki
Matt Caswell [Fri, 12 Sep 2014 05:00:26 +0000 (01:00 -0400)]
Updates to X509_NAME_get_index_by_NID.pod submitted by user Bernardh via the wiki
Minor changes made by Matt Caswell

Reviewed-by: Dr. Stephen Henson <steve@openssl.org>
4 years agoUpdates to X509_NAME_add_entry_by_txt.pod submitted by user Bernardh via the wiki
Matt Caswell [Sat, 6 Sep 2014 22:48:54 +0000 (23:48 +0100)]
Updates to X509_NAME_add_entry_by_txt.pod submitted by user Bernardh via the wiki
Minor changes made by Matt Caswell.

Reviewed-by: Dr. Stephen Henson <steve@openssl.org>
4 years agoUpdates to EVP_PKEY_encrypt.pod submitted by user Bernardh via the wiki
Matt Caswell [Sat, 6 Sep 2014 22:47:55 +0000 (23:47 +0100)]
Updates to EVP_PKEY_encrypt.pod submitted by user Bernardh via the wiki
Minor changes made by Matt Caswell.

Reviewed-by: Dr. Stephen Henson <steve@openssl.org>
4 years agoAdd include of ssl.h which is required by srtp.h
Matt Caswell [Thu, 27 Nov 2014 12:25:18 +0000 (12:25 +0000)]
Add include of ssl.h which is required by srtp.h

Reviewed-by: Dr. Stephen Henson <steve@openssl.org>
4 years agoFixed memory leak due to incorrect freeing of DTLS reassembly bit mask
Matt Caswell [Tue, 25 Nov 2014 13:36:00 +0000 (13:36 +0000)]
Fixed memory leak due to incorrect freeing of DTLS reassembly bit mask

PR#3608

Reviewed-by: Tim Hudson <tjh@openssl.org>
4 years agoCorrected comments in ssl.h about SSLv23_method and friends
Matt Caswell [Tue, 25 Nov 2014 17:23:24 +0000 (17:23 +0000)]
Corrected comments in ssl.h about SSLv23_method and friends

PR#3574

Reviewed-by: Dr. Stephen Henson <steve@openssl.org>
4 years agoPrint out Suite B status.
Dr. Stephen Henson [Thu, 20 Nov 2014 14:50:54 +0000 (14:50 +0000)]
Print out Suite B status.

When using the -xcert option to test certificate validity print out
if we pass Suite B compliance. We print out "not tested" if we aren't
in Suite B mode.
Reviewed-by: Matt Caswell <matt@openssl.org>
4 years agoFix SuiteB chain checking logic.
Dr. Stephen Henson [Thu, 20 Nov 2014 14:06:50 +0000 (14:06 +0000)]
Fix SuiteB chain checking logic.

Reviewed-by: Matt Caswell <matt@openssl.org>
4 years agoRT2679: Fix error if keysize too short
Annie Yousar [Mon, 8 Sep 2014 20:50:03 +0000 (16:50 -0400)]
RT2679: Fix error if keysize too short

In keygen, return KEY_SIZE_TOO_SMALL not INVALID_KEYBITS.

** I also increased the minimum from 256 to 512, which is now
documented in CHANGES file. **

Reviewed-by: Matt Caswell <matt@openssl.org>
4 years agoRT3488: Update doc for OPENSSL_config
Rich Salz [Tue, 9 Sep 2014 17:45:49 +0000 (13:45 -0400)]
RT3488: Update doc for OPENSSL_config

Fix CONF_load_modules to CONF_modules_load.
Document that it calls exit.
Advise against using it now.
Add an error print to stderr.

Reviewed-by: Matt Caswell <matt@openssl.org>
4 years agoDo not resume a session if the negotiated protocol version does not match
David Benjamin [Thu, 20 Nov 2014 15:22:40 +0000 (16:22 +0100)]
Do not resume a session if the negotiated protocol version does not match
the session's version (server).

See also BoringSSL's commit bdf5e72f50e25f0e45e825c156168766d8442dde.

Reviewed-by: Dr. Stephen Henson <steve@openssl.org>
4 years agoWhen using EVP_PKEY_derive with a KDF set, a negative error from
Matt Caswell [Wed, 19 Nov 2014 20:09:19 +0000 (20:09 +0000)]
When using EVP_PKEY_derive with a KDF set, a negative error from
ECDH_compute_key is silently ignored and the KDF is run on duff data

Thanks to github user tomykaira for the suggested fix.

Reviewed-by: Dr. Stephen Henson <steve@openssl.org>
4 years agoClean up CHANGES
Emilia Kasper [Thu, 20 Nov 2014 11:20:02 +0000 (12:20 +0100)]
Clean up CHANGES

Reviewed-by: Matt Caswell <matt@openssl.org>
4 years agoEnsure SSL3_FLAGS_CCS_OK (or d1->change_cipher_spec_ok for DTLS) is reset
Emilia Kasper [Wed, 19 Nov 2014 16:01:36 +0000 (17:01 +0100)]
Ensure SSL3_FLAGS_CCS_OK (or d1->change_cipher_spec_ok for DTLS) is reset
once the ChangeCipherSpec message is received. Previously, the server would
set the flag once at SSL3_ST_SR_CERT_VRFY and again at SSL3_ST_SR_FINISHED.
This would allow a second CCS to arrive and would corrupt the server state.

(Because the first CCS would latch the correct keys and subsequent CCS
messages would have to be encrypted, a MitM attacker cannot exploit this,
though.)

Thanks to Joeri de Ruiter for reporting this issue.

Reviewed-by: Matt Caswell <matt@openssl.org>
4 years agoAlways require an advertised NewSessionTicket message.
Emilia Kasper [Wed, 19 Nov 2014 15:40:27 +0000 (16:40 +0100)]
Always require an advertised NewSessionTicket message.

The server must send a NewSessionTicket message if it advertised one
in the ServerHello, so make a missing ticket message an alert
in the client.

An equivalent change was independently made in BoringSSL, see commit
6444287806d801b9a45baf1f6f02a0e3a16e144c.

Reviewed-by: Matt Caswell <matt@openssl.org>
4 years agoRemove ssl3_check_finished.
Emilia Kasper [Wed, 19 Nov 2014 15:28:11 +0000 (16:28 +0100)]
Remove ssl3_check_finished.

The client sends a session ID with the session ticket, and uses
the returned ID to detect resumption, so we do not need to peek
at handshake messages: s->hit tells us explicitly if we're resuming.

An equivalent change was independently made in BoringSSL, see commit
407886f589cf2dbaed82db0a44173036c3bc3317.

Reviewed-by: Matt Caswell <matt@openssl.org>
4 years agoSet s->hit when resuming from external pre-shared secret.
Emilia Kasper [Wed, 19 Nov 2014 14:56:27 +0000 (15:56 +0100)]
Set s->hit when resuming from external pre-shared secret.

The same change was independently made in BoringSSL, see commit
9eaeef81fa2d4fd6246dc02b6203fa936a5eaf67

Reviewed-by: Matt Caswell <matt@openssl.org>
4 years agoReset s->tlsext_ticket_expected in ssl_scan_serverhello_tlsext.
Emilia Kasper [Wed, 19 Nov 2014 14:42:43 +0000 (15:42 +0100)]
Reset s->tlsext_ticket_expected in ssl_scan_serverhello_tlsext.
This ensures that it's zeroed even if the SSL object is reused
(as in ssltest.c). It also ensures that it applies to DTLS, too.

Reviewed-by: Matt Caswell <matt@openssl.org>
4 years agoFix s_server -ssl2. Previously this reported "Error setting EC curve"
Matt Caswell [Wed, 19 Nov 2014 16:02:49 +0000 (16:02 +0000)]
Fix s_server -ssl2. Previously this reported "Error setting EC curve"

Reviewed-by: Dr. Stephen Henson <steve@openssl.org>
4 years agoFix excert logic.
Dr. Stephen Henson [Mon, 17 Nov 2014 16:30:51 +0000 (16:30 +0000)]
Fix excert logic.

If no keyfile has been specified use the certificate file instead.

Fix typo: we need to check the chain is not NULL, not the chain file.
Reviewed-by: Matt Caswell <matt@openssl.org>
(cherry picked from commit 786370b1b09b919d9306f27336e13783e4fe3fd0)

4 years agoNew option no-ssl3-method which removes SSLv3_*method
Dr. Stephen Henson [Wed, 29 Oct 2014 12:51:31 +0000 (12:51 +0000)]
New option no-ssl3-method which removes SSLv3_*method

When no-ssl3 is set only make SSLv3 disabled by default. Retain -ssl3
options for s_client/s_server/ssltest.

When no-ssl3-method is set SSLv3_*method() is removed and all -ssl3
options.

We should document this somewhere, e.g. wiki, FAQ or manual page.
Reviewed-by: Emilia Käsper <emilia@openssl.org>
4 years agoOnly handle RI extension for SSLv3
Dr. Stephen Henson [Mon, 3 Nov 2014 17:47:11 +0000 (17:47 +0000)]
Only handle RI extension for SSLv3

Don't send or parse any extensions other than RI (which is needed
to handle secure renegotation) for SSLv3.
Reviewed-by: Matt Caswell <matt@openssl.org>
4 years agoProcess signature algorithms before deciding on certificate.
Dr. Stephen Henson [Mon, 17 Nov 2014 16:52:59 +0000 (16:52 +0000)]
Process signature algorithms before deciding on certificate.

The supported signature algorithms extension needs to be processed before
the certificate to use is decided and before a cipher is selected (as the
set of shared signature algorithms supported may impact the choice).
Reviewed-by: Matt Caswell <matt@openssl.org>
(cherry picked from commit 56e8dc542bd693b2dccea8828b3d8e5fc6932d0c)

Conflicts:
ssl/ssl.h
ssl/ssl_err.c

4 years agoAdded references to RFC 7027
Matt Caswell [Mon, 17 Nov 2014 23:09:05 +0000 (23:09 +0000)]
Added references to RFC 7027

Reviewed-by: Dr. Stephen Henson <steve@openssl.org>
4 years agoPrevent use of binary curves when OPENSSL_NO_EC2M is defined
Dr. Stephen Henson [Mon, 17 Nov 2014 19:39:32 +0000 (19:39 +0000)]
Prevent use of binary curves when OPENSSL_NO_EC2M is defined

Reviewed-by: Matt Caswell <matt@openssl.org>
4 years agoFixed cms-test.pl for no-ec2m
Matt Caswell [Wed, 12 Nov 2014 10:05:01 +0000 (10:05 +0000)]
Fixed cms-test.pl for no-ec2m

Reviewed-by: Dr. Stephen Henson <steve@openssl.org>
4 years agoUpdated comment references to draft-ietf-tls-ecc-12 to refer to RFC4492 instead
Matt Caswell [Mon, 10 Nov 2014 23:29:44 +0000 (23:29 +0000)]
Updated comment references to draft-ietf-tls-ecc-12 to refer to RFC4492 instead

Reviewed-by: Dr. Stephen Henson <steve@openssl.org>
4 years agoDon't use msg on error.
Jan Hykel [Sun, 16 Nov 2014 16:51:17 +0000 (16:51 +0000)]
Don't use msg on error.

Don't attempt to access msg structure if recvmsg returns an error.

PR#3483
Reviewed-by: Stephen Henson <steve@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
4 years agoAdd whrlpool and camellia .s files to perlasm list
Mike Bland [Wed, 25 Jun 2014 19:28:38 +0000 (15:28 -0400)]
Add whrlpool and camellia .s files to perlasm list

Change-Id: I626d751f19f24df6b967c17498d6189cc0acb96c
Signed-off-by: Mike Bland <mbland@acm.org>
Signed-off-by: Geoff Thorpe <geoff@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
4 years agoAdd missing SRC variable
Mike Bland [Sun, 29 Jun 2014 14:00:43 +0000 (10:00 -0400)]
Add missing SRC variable

This is the only Makefile without SRC defined. This change enables a
standard Makefile include directive to cover crypto/jpake/*.d files.

This was automatically applied by AddSrcVarIfNeeded() in:
https://code.google.com/p/mike-bland/source/browse/openssl/update_makefiles.py

Change-Id: I030204a1bc873b5de5b06c8ddc0b94bb224c6650
Signed-off-by: Mike Bland <mbland@acm.org>
Signed-off-by: Geoff Thorpe <geoff@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
4 years agoRemove redundant test targets outside of test/
Mike Bland [Tue, 24 Jun 2014 17:03:49 +0000 (13:03 -0400)]
Remove redundant test targets outside of test/

These correspond to targets of the same name in test/Makefile that clash when
using the single-makefile build method using GitConfigure and GitMake.

Change-Id: If7e900c75f4341b446608b6916a3d76f202026ea
Signed-off-by: Mike Bland <mbland@acm.org>
Signed-off-by: Geoff Thorpe <geoff@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
4 years agoImprove variable parsing when generating MINFO
Mike Bland [Tue, 24 Jun 2014 04:39:33 +0000 (00:39 -0400)]
Improve variable parsing when generating MINFO

Before this change, variables for which a '=' appeared in the assignment would
be parsed as the entire string up until the final '='. For example:

  BUILD_CMD=shlib_target=; if [ -n "$(SHARED_LIBS)" ]; then \

would result in the variable name "BUILD_CMD=shlib_target". This doesn't
appear to harm the current generation of MINFO, but creates problems for other
Makefile-related work I'm attempting.

Change-Id: I1f3a606d67fd5464bb459e8f36c23b3e967b77e1
Signed-off-by: Mike Bland <mbland@acm.org>
Signed-off-by: Geoff Thorpe <geoff@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
4 years ago{,darwin64-}debug-test-64-clang Configure targets
Mike Bland [Sun, 8 Jun 2014 18:58:16 +0000 (14:58 -0400)]
{,darwin64-}debug-test-64-clang Configure targets

These are based on debug-ben-debug-64-clang and is intended to produce
consistent settings for folks involved in the unit testing effort detailed at:

http://wiki.openssl.org/index.php/Unit_Testing

-fsanitize has been removed from the set of clang flags for now. Apparently
clang 3.1, which ships with FreeBSD 9.1, completely ignores -fsanitize. Clang
3.3, which ships with FreeBSD 9.2, compiles with it, but fails to link due to
the absence of libasan:

http://lists.freebsd.org/pipermail/freebsd-hackers/2013-December/043995.html
https://www.mail-archive.com/cfe-commits@cs.uiuc.edu/msg92260.html
http://reviews.llvm.org/D2644

We need -Wno-error=unused-const-variable because of this error:
.../crypto/ec/ec_lib.c:74:19: error: unused variable 'EC_version' [-Werror,-Wunused-const-variable]
static const char EC_version[] = "EC" OPENSSL_VERSION_PTEXT;

Change-Id: I2cba53537137186114c083049ea1233550a741f9
Signed-off-by: Mike Bland <mbland@acm.org>
Signed-off-by: Geoff Thorpe <geoff@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
4 years agoEmit PERLASM_SCHEME to fix GitMake on OS X
Mike Bland [Tue, 24 Jun 2014 00:26:30 +0000 (20:26 -0400)]
Emit PERLASM_SCHEME to fix GitMake on OS X

This fixes the errors when trying to assemble .s files using GitMake on OS X.

Change-Id: I2221f558619302d22e0c57d7203173d634155678
Signed-off-by: Mike Bland <mbland@acm.org>
Signed-off-by: Geoff Thorpe <geoff@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
4 years agoAdd cscope.out and .d files to .gitignore
Mike Bland [Mon, 9 Jun 2014 00:27:20 +0000 (20:27 -0400)]
Add cscope.out and .d files to .gitignore

cscope.out is generated by cscope as described in:
http://wiki.openssl.org/index.php/Testing_and_Development_Tools_and_Tips

.d files are compiler-generated Makefile dependency files (e.g. using
'gcc -MMD -MP foo.c').

Change-Id: I2338858a6b6ee0527837d10a8b55cff1689023fd
Signed-off-by: Mike Bland <mbland@acm.org>
Signed-off-by: Geoff Thorpe <geoff@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
4 years agoAdditional output for ssltest.
Dr. Stephen Henson [Mon, 27 Oct 2014 14:39:37 +0000 (14:39 +0000)]
Additional output for ssltest.

Print out more details of the conection in ssltest specifically:
server certificate curve name for EC, server temporary key (if any)
and peer signing digest.
Reviewed-by: Matt Caswell <matt@openssl.org>
4 years agoAdd SSL_CONF support to ssltest.
Dr. Stephen Henson [Mon, 27 Oct 2014 14:07:12 +0000 (14:07 +0000)]
Add SSL_CONF support to ssltest.

Add command line support for SSL_CONF: server side arguments are
prefixed by -s_ (e.g. -s_no_ssl3) and client side with -c_.
Reviewed-by: Matt Caswell <matt@openssl.org>
4 years agoFix cross reference table generator.
Dr. Stephen Henson [Sat, 1 Nov 2014 00:10:56 +0000 (00:10 +0000)]
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>
4 years agoFixes a minor typo in the EVP docs.
Alok Menghrajani [Tue, 11 Nov 2014 22:39:11 +0000 (14:39 -0800)]
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>
4 years agoCorrect timestamp output when clock_precision_digits > 0
Michal Bozon [Wed, 12 Nov 2014 15:59:04 +0000 (15:59 +0000)]
Correct timestamp output when clock_precision_digits > 0

PR#3535

Reviewed-by: Stephen Henson <steve@openssl.org>
4 years agoFix free of garbage pointer. PR#3595
Matt Caswell [Wed, 12 Nov 2014 11:18:09 +0000 (11:18 +0000)]
Fix free of garbage pointer. PR#3595

Reviewed-by: Emilia Käsper <emilia@openssl.org>
4 years agoFix warning about negative unsigned intergers
Kurt Roeckx [Mon, 10 Nov 2014 18:03:03 +0000 (19:03 +0100)]
Fix warning about negative unsigned intergers

Reviewed-by: Richard Levitte <levitte@openssl.org>