openssl.git
7 years agoFix calls to SSL_get_server_tmp_key() in TLSv1.3
Matt Caswell [Mon, 3 Apr 2017 14:24:06 +0000 (15:24 +0100)]
Fix calls to SSL_get_server_tmp_key() in TLSv1.3

The macro SSL_get_server_tmp_key() returns information about the temp key
used by the server during a handshake. This was returning NULL for TLSv1.3
and causing s_client to omit this information in its connection summary.

Fixes #3081

Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3114)

7 years agoTweak a style issue
Matt Caswell [Mon, 3 Apr 2017 13:22:26 +0000 (14:22 +0100)]
Tweak a style issue

Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3091)

7 years agoAdd a test for the problem fixed by the previous commit
Matt Caswell [Mon, 3 Apr 2017 13:18:24 +0000 (14:18 +0100)]
Add a test for the problem fixed by the previous commit

Make sure the server can write normal data after earlier writing early data.

Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3091)

7 years agoRestore s->early_data_state with the original value
Tatsuhiro Tsujikawa [Mon, 3 Apr 2017 13:17:58 +0000 (14:17 +0100)]
Restore s->early_data_state with the original value

Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3091)

7 years agoUpdate early data test for an even later arrival of CF
Matt Caswell [Thu, 30 Mar 2017 16:38:15 +0000 (17:38 +0100)]
Update early data test for an even later arrival of CF

Commit 9b5c865df introduced a synthetic delay between arrival of EoED and
CF. We actually want to delay the arrival of CF even further to demonstrate
that we can write early data even when "in init".

Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3091)

7 years agoDon't handle handshake messages when writing early data on server
Matt Caswell [Thu, 30 Mar 2017 16:35:55 +0000 (17:35 +0100)]
Don't handle handshake messages when writing early data on server

If we have received the EoED message but not yet had the CF then we are
"in init". Despite that we still want to write application data, so suppress
the "in init" check in ssl3_write_bytes() in that scenario.

Fixes #3041

Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3091)

7 years agoFix a typo in the SSL_get_max_early_data() declarations
Kazuki Yamaguchi [Thu, 30 Mar 2017 16:54:39 +0000 (01:54 +0900)]
Fix a typo in the SSL_get_max_early_data() declarations

SSL_get_max_early_data() recently added by 3fc8d856105e ("Construct the
ticket_early_data_info extension", 2017-02-17) is supposed to take an
SSL, but it doesn't.

Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3113)

7 years agoDisable 15-test_ecparam.t when configured no-ec2m
Richard Levitte [Sun, 2 Apr 2017 09:18:59 +0000 (11:18 +0200)]
Disable 15-test_ecparam.t when configured no-ec2m

This test doesn't actually fail completely, but there's no real
pattern to distinguish which data files should be omitted when no-ec2m
is configured and which should not.

Reviewed-by: Andy Polyakov <appro@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3103)

7 years agoRemind people to have 'Fixes #XXXX' in the commit message
Richard Levitte [Sun, 2 Apr 2017 09:38:23 +0000 (11:38 +0200)]
Remind people to have 'Fixes #XXXX' in the commit message

It's of course also possible to just add them to the PR description,
but having these lines in the commit messages provide better
automation.

Reviewed-by: Andy Polyakov <appro@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3104)

7 years agoFixup the github pull request template
Richard Levitte [Sun, 2 Apr 2017 09:28:04 +0000 (11:28 +0200)]
Fixup the github pull request template

When creating a single commit PR, github will now automatically
include the commit comment first in the pull request description, and
add the template content last.  That makes the description section at
the end useless.

Reviewed-by: Andy Polyakov <appro@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3104)

7 years agocrypto/ppccap.c: SIGILL-free processor capabilities detection on MacOS X.
Andy Polyakov [Sat, 1 Apr 2017 13:28:28 +0000 (15:28 +0200)]
crypto/ppccap.c: SIGILL-free processor capabilities detection on MacOS X.

It seems to be problematic to probe processor capabilities with SIGILL
on MacOS X. The problem should be limited to cases when application code
is debugged, but crashes were reported even during normal execution...

Reviewed-by: Kurt Roeckx <kurt@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
7 years agoConfigure: use 5.10.0, don't require...
Andy Polyakov [Fri, 31 Mar 2017 12:37:10 +0000 (14:37 +0200)]
Configure: use 5.10.0, don't require...

Configure started with 'require 5.10.0', but if executed by older perl
it failed with "might be runaway multi-line // string" instead of
naturally expected "Perl v5.10.0 required--this is only v5.x.y".

Reviewed-by: Richard Levitte <levitte@openssl.org>
7 years agoe_afalg.[ch]: fix --strict-warnings with gcc 4.x and 32-bit build.
Andy Polyakov [Thu, 30 Mar 2017 21:07:26 +0000 (23:07 +0200)]
e_afalg.[ch]: fix --strict-warnings with gcc 4.x and 32-bit build.

Reviewed-by: Richard Levitte <levitte@openssl.org>
7 years agobio/b_print.c: switch to int64_t as "greatest-width integer type".
Andy Polyakov [Thu, 30 Mar 2017 19:44:55 +0000 (21:44 +0200)]
bio/b_print.c: switch to int64_t as "greatest-width integer type".

Originally there was dependency on BN configuration parameters, but
it stemmed from times when "long long" support was optional. Today
we require 64-bit support from compiler, and there is no reason to
have "greatest-width integer" depend on BN configuration.

Reviewed-by: Richard Levitte <levitte@openssl.org>
7 years agoFix for #2730. Add CRLDP extension to list of supported extensions
Jon Spillett [Thu, 30 Mar 2017 04:13:44 +0000 (14:13 +1000)]
Fix for #2730. Add CRLDP extension to list of supported extensions

Reviewed-by: Andy Polyakov <appro@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3087)

7 years agoUpdate SSL_extension_supported()
Matt Caswell [Thu, 30 Mar 2017 23:26:23 +0000 (00:26 +0100)]
Update SSL_extension_supported()

Numerous changes have been made to the supported built-in extensions and
SSL_extension_supported() has not kept up.

Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3097)

7 years agoe_os.h: drop now-redundant PRIu64 [and fix OSSLzu].
Andy Polyakov [Wed, 29 Mar 2017 21:25:45 +0000 (23:25 +0200)]
e_os.h: drop now-redundant PRIu64 [and fix OSSLzu].

Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3083)

7 years agoapps/*.c: switch to platform-neutral format modifiers in BIO_print calls.
Andy Polyakov [Wed, 29 Mar 2017 21:23:56 +0000 (23:23 +0200)]
apps/*.c: switch to platform-neutral format modifiers in BIO_print calls.

Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3083)

7 years agobio/b_print.c: recognize even 'j' format modifier.
Andy Polyakov [Wed, 29 Mar 2017 21:10:08 +0000 (23:10 +0200)]
bio/b_print.c: recognize even 'j' format modifier.

'j' is specified as modifier for "greatest-width integer type", which in
practice means 64 bits on both 32- and 64-bit platforms. Since we rely
on __attribute__((__format__(__printf__,...))) to sanitize BIO_print
format, we can use it to denote [u]int64_t-s in platform-neutral manner.

Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3083)

7 years agoFix s_client early data indicator
Matt Caswell [Thu, 30 Mar 2017 15:06:29 +0000 (16:06 +0100)]
Fix s_client early data indicator

s_client was always saying that early_data was rejected even when it was
accepted. This was because it was using the wrong test to detect the end
of the handshake. It was using SSL_in_init() which only tells you whether
it is currently processing/sending/expecting handshake messages. It should
use SSL_is_init_finished() which tells you that no handshake messages are
being processed/sent/expected AND we have completed the handshake. In the
early data case we are not processing/sending handshake messages and we
are expecting early data (not a handshake message) - but the handshake has
not yet completed.

Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3090)

7 years agoProvide a test for pause between EoED and CF
Matt Caswell [Thu, 30 Mar 2017 14:26:23 +0000 (15:26 +0100)]
Provide a test for pause between EoED and CF

This tests the bug fixed in the previous commit. We introduce a synthetic
delay between the server receiving EoED and CF and check that we can still
send early data.

Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3089)

7 years agoFix early data bug with pause between EoED and CF
Matt Caswell [Thu, 30 Mar 2017 14:24:07 +0000 (15:24 +0100)]
Fix early data bug with pause between EoED and CF

If the server received EoED then SSL_read_early_data() will return
SSL_READ_EARLY_DATA_FINISH. However if the CF has not yet been processed
then SSL_is_init_finished() will still return 0. Therefore we should still
be able to write early data.

Fixes #3041

Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3089)

7 years agoAdd SSL_dup description
Jon Spillett [Wed, 29 Mar 2017 09:17:55 +0000 (19:17 +1000)]
Add SSL_dup description

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3085)

7 years agoDocumentation updates
Pauli [Wed, 29 Mar 2017 21:38:30 +0000 (07:38 +1000)]
Documentation updates

Fix capitilistion of list items.
Wrap long lines.
Add full stops to the ends of sentances.
Change ciphersuite to cipher suite in all of doc.

[skip ci]

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3082)

7 years agoAdd a test for the bug fixed in the previous commit
Matt Caswell [Wed, 29 Mar 2017 16:02:25 +0000 (17:02 +0100)]
Add a test for the bug fixed in the previous commit

We want to make sure that if we if are using SSL_MODE_AUTO_RETRY then
if SSL_read_early_data() hits EndOfEarlyData then it doesn't auto retry
and end up with normal data. The same issue could occur with read_ahead
which is what we use in this test.

Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3077)

7 years agoFix bug with SSL_read_early_data()
Matt Caswell [Wed, 29 Mar 2017 16:00:55 +0000 (17:00 +0100)]
Fix bug with SSL_read_early_data()

If read_ahead is set, or SSL_MODE_AUTO_RETRY is used then if
SSL_read_early_data() hits an EndOfEarlyData message then it will
immediately retry automatically, but this time read normal data instead
of early data!

Fixes #3041

Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3077)

7 years agoDocumentation cleanup for man1/enc.pod
Pauli [Wed, 29 Mar 2017 04:24:00 +0000 (14:24 +1000)]
Documentation cleanup for man1/enc.pod

[skip ci]

Reviewed-by: Andy Polyakov <appro@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3073)

7 years agobio/b_print.c: fix %z failure in 32-bit build.
Andy Polyakov [Wed, 29 Mar 2017 20:48:26 +0000 (22:48 +0200)]
bio/b_print.c: fix %z failure in 32-bit build.

Reviewed-by: Richard Levitte <levitte@openssl.org>
7 years agoAdd a simple test for the z modifier
Richard Levitte [Tue, 28 Mar 2017 17:42:53 +0000 (19:42 +0200)]
Add a simple test for the z modifier

Reviewed-by: Andy Polyakov <appro@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3064)

7 years agoUse the z modifier instead of OSSLzu with BIO_printf
Richard Levitte [Tue, 28 Mar 2017 15:04:43 +0000 (17:04 +0200)]
Use the z modifier instead of OSSLzu with BIO_printf

Reviewed-by: Andy Polyakov <appro@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3064)

7 years agoAdd z modifier parsing to the BIO_printf et all format string
Richard Levitte [Tue, 28 Mar 2017 14:57:41 +0000 (16:57 +0200)]
Add z modifier parsing to the BIO_printf et all format string

Reviewed-by: Andy Polyakov <appro@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3064)

7 years agocipherbytes_test: remove unused includes
Emilia Kasper [Wed, 29 Mar 2017 10:48:41 +0000 (12:48 +0200)]
cipherbytes_test: remove unused includes

cipherbytes_test does not use the testutil / test_main test framework.

Reviewed-by: Andy Polyakov <appro@openssl.org>
7 years agoengines/e_capi.c: slip in PROV_RSA_AES for interchangable CSP only.
Andy Polyakov [Sun, 26 Mar 2017 15:40:32 +0000 (17:40 +0200)]
engines/e_capi.c: slip in PROV_RSA_AES for interchangable CSP only.

Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3034)

7 years agoengines/e_capi.c: adhere to CryptAcquireContextW unconditionally.
Andy Polyakov [Sun, 26 Mar 2017 15:39:14 +0000 (17:39 +0200)]
engines/e_capi.c: adhere to CryptAcquireContextW unconditionally.

Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
7 years agoengine/e_capi.c: more formatting and styling fixes.
Andy Polyakov [Sun, 26 Mar 2017 14:12:10 +0000 (16:12 +0200)]
engine/e_capi.c: more formatting and styling fixes.

Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
7 years agoDocumentation cleanup for man1/nseq.pod
Pauli [Wed, 29 Mar 2017 04:39:16 +0000 (14:39 +1000)]
Documentation cleanup for man1/nseq.pod

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3074)

7 years agoDocumentation clean up for man1/list.pod
Pauli [Wed, 29 Mar 2017 04:18:34 +0000 (14:18 +1000)]
Documentation clean up for man1/list.pod

[skip ci]

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3072)

7 years agodoc: Add stitched ciphers to EVP_EncryptInit.pod
Steven Collison [Tue, 28 Mar 2017 19:46:07 +0000 (12:46 -0700)]
doc: Add stitched ciphers to EVP_EncryptInit.pod

These ciphers don't appear to be documented anywhere. Given the
performance[1] benefits I think it makes sense to expose them.

[1] https://software.intel.com/sites/default/files/open-ssl-performance-paper.pdf

Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3067)

7 years agodoc: Add missing options in s_{server,client}
Steven Collison [Tue, 28 Mar 2017 16:02:37 +0000 (09:02 -0700)]
doc: Add missing options in s_{server,client}

These were added to the help in ad775e04f6dab but not the pods.

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3065)

7 years agoFix the build warning under OPENSSL_NO_GOST
Qin Long [Wed, 15 Mar 2017 15:43:20 +0000 (23:43 +0800)]
Fix the build warning under OPENSSL_NO_GOST

Variable 'pktype' was set but not used under OPENSSL_NO_GOST. This change
will fix the build warning under [-Werror=unused-but-set-variable].

Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/2961)

7 years agoCleaning UEFI Build with additional OPENSSL_SYS_UEFI flags
Qin Long [Wed, 15 Mar 2017 15:33:57 +0000 (23:33 +0800)]
Cleaning UEFI Build with additional OPENSSL_SYS_UEFI flags

Add OPENSSL_SYS_UEFI to remove unused syslog and uid stuffs for
more clean UEFI build.

Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/2961)

7 years agoFurther de-obfuscation
Benjamin Kaduk [Tue, 21 Mar 2017 21:30:21 +0000 (16:30 -0500)]
Further de-obfuscation

A similar change that probably should have been wrapped into
commit e0926ef49df09a85117d7442db83f321aeb5b982.

Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3010)

7 years agoAdd documentation for SNI APIs
Jon Spillett [Tue, 28 Mar 2017 22:34:37 +0000 (08:34 +1000)]
Add documentation for SNI APIs

Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3071)

7 years agoRemove duplicate doc
Rich Salz [Tue, 28 Mar 2017 20:31:54 +0000 (16:31 -0400)]
Remove duplicate doc

Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3068)

7 years agoMore typo fixes
FdaSilvaYY [Tue, 28 Mar 2017 21:57:28 +0000 (23:57 +0200)]
More typo fixes

Fix some comments too
[skip ci]

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3069)

7 years agoTypo in SSL_CTX_sess_number.pod - started
Jon Spillett [Wed, 29 Mar 2017 01:45:29 +0000 (11:45 +1000)]
Typo in SSL_CTX_sess_number.pod - started

Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3070)

7 years agoTidy up the SSL options in SSL_CTX_set_options.pod
Jon Spillett [Wed, 29 Mar 2017 00:07:14 +0000 (10:07 +1000)]
Tidy up the SSL options in SSL_CTX_set_options.pod

Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3070)

7 years agoSSL_CTX_use_PrivateKey_file uses private key, not certificate
Jon Spillett [Tue, 28 Mar 2017 06:35:25 +0000 (16:35 +1000)]
SSL_CTX_use_PrivateKey_file uses private key, not certificate

Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3070)

7 years agoTypo in SSL_CONF_cmd_argv.pod
Jon Spillett [Tue, 28 Mar 2017 06:32:01 +0000 (16:32 +1000)]
Typo in SSL_CONF_cmd_argv.pod

Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3070)

7 years agoTypo in SSL_CONF_CTX_set1_prefix.pod - change SSL_CTX_cmd to SSL_CONF_cmd
Jon Spillett [Tue, 28 Mar 2017 06:30:43 +0000 (16:30 +1000)]
Typo in SSL_CONF_CTX_set1_prefix.pod - change SSL_CTX_cmd to SSL_CONF_cmd

Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3070)

7 years agoTypo in SSL_CONF_CTX_set_flags.pod
Jon Spillett [Tue, 28 Mar 2017 06:25:52 +0000 (16:25 +1000)]
Typo in SSL_CONF_CTX_set_flags.pod

Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3070)

7 years agoTest infrastructure additions.
Pauli [Wed, 22 Mar 2017 04:27:55 +0000 (14:27 +1000)]
Test infrastructure additions.

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Emilia Käsper <emilia@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3011)

7 years agoFix 0 -> NULL, indentation
FdaSilvaYY [Thu, 10 Nov 2016 00:22:17 +0000 (01:22 +0100)]
Fix 0 -> NULL, indentation

Reviewed-by: Andy Polyakov <appro@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3066)

7 years agoRefomat a few comments on 80 cols
FdaSilvaYY [Thu, 10 Nov 2016 00:16:27 +0000 (01:16 +0100)]
Refomat a few comments on 80 cols

Reviewed-by: Andy Polyakov <appro@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3066)

7 years agoSpelling fixes
FdaSilvaYY [Fri, 10 Feb 2017 22:17:00 +0000 (23:17 +0100)]
Spelling fixes

Reviewed-by: Andy Polyakov <appro@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3066)

7 years agoFix a few more typos
FdaSilvaYY [Fri, 17 Feb 2017 22:13:26 +0000 (23:13 +0100)]
Fix a few more typos

Reviewed-by: Andy Polyakov <appro@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3066)

7 years agoAdd documentation for SSL_*_ex_data() functions
Jon Spillett [Tue, 28 Mar 2017 06:22:07 +0000 (16:22 +1000)]
Add documentation for SSL_*_ex_data() functions

[skip ci]

Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3050)

7 years agoAdd documentation for SSL version methods
Jon Spillett [Tue, 28 Mar 2017 05:33:54 +0000 (15:33 +1000)]
Add documentation for SSL version methods

[skip ci]

Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3049)

7 years agoProvide documentation for some state machine related functions
Matt Caswell [Fri, 24 Mar 2017 17:37:23 +0000 (17:37 +0000)]
Provide documentation for some state machine related functions

Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3051)

7 years agoupdate README
Dr. Stephen Henson [Tue, 28 Mar 2017 14:17:15 +0000 (15:17 +0100)]
update README

Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3059)

7 years agoAdd X25519 doc
Dr. Stephen Henson [Mon, 27 Mar 2017 20:44:59 +0000 (21:44 +0100)]
Add X25519 doc

Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3059)

7 years agofix typo
Dr. Stephen Henson [Mon, 27 Mar 2017 21:01:41 +0000 (22:01 +0100)]
fix typo

Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3059)

7 years agoProvide documentation for missing SSL_SESSION_* functions
Matt Caswell [Fri, 24 Mar 2017 16:01:50 +0000 (16:01 +0000)]
Provide documentation for missing SSL_SESSION_* functions

Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3052)

7 years agoMove PRIu64, OSSLzu to e_os.h
Rich Salz [Mon, 27 Mar 2017 20:49:29 +0000 (16:49 -0400)]
Move PRIu64, OSSLzu to e_os.h

Those macros are private, not public.

Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3044)

7 years agoAdd enable-aria where rc5 and md2 are built.
Pauli [Mon, 27 Mar 2017 21:38:09 +0000 (07:38 +1000)]
Add enable-aria where rc5 and md2 are built.

Reviewed-by: Andy Polyakov <appro@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3046)

7 years agoasynctest: don't depend on apps
Emilia Kasper [Tue, 28 Mar 2017 11:08:07 +0000 (13:08 +0200)]
asynctest: don't depend on apps

Remove unnecessary include of apps.h. Tests shouldn't take a
dependency on apps. In this case, there is no dependency, the include
is unnecessary.

Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
7 years agoX509_cmp_time.pod: fix doc nits
Emilia Kasper [Tue, 28 Mar 2017 12:27:37 +0000 (14:27 +0200)]
X509_cmp_time.pod: fix doc nits

Reviewed-by: Richard Levitte <levitte@openssl.org>
7 years agoRemove redundant decl of 509_STORE_set_flags
Hannes Magnusson [Mon, 27 Mar 2017 23:26:33 +0000 (16:26 -0700)]
Remove redundant decl of 509_STORE_set_flags

a47bc283 accidentally adds another define for X509_STORE_set_flags
It is already defined 5lines prior

CLA: trivial

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3047)

7 years agoAdd documentation for X509 time functions
Emilia Kasper [Tue, 28 Mar 2017 09:39:52 +0000 (11:39 +0200)]
Add documentation for X509 time functions

[ci skip]

Reviewed-by: Tim Hudson <tjh@openssl.org>
7 years agoapps/passwd.c: 32 bits are sufficient to hold ROUNDS_MAX.
Andy Polyakov [Sun, 26 Mar 2017 20:38:05 +0000 (22:38 +0200)]
apps/passwd.c: 32 bits are sufficient to hold ROUNDS_MAX.

Even though C standard defines 'z' modifier, recent mingw compilers break
the contract by defining __STDC_VERSION__ with non-compliant MSVCRT.DLL.
In other words we can't use %zu with mingw, but insteadl of cooking

Reviewed-by: Tim Hudson <tjh@openssl.org>
7 years agoIn err_cleanup(), cleanup the thread local storage too
Richard Levitte [Sun, 26 Mar 2017 18:01:44 +0000 (20:01 +0200)]
In err_cleanup(), cleanup the thread local storage too

Fixes #3033

Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3035)

7 years agoaes/asm/bsaes-armv7.pl: relax stack alignment requirement.
Andy Polyakov [Sat, 25 Mar 2017 09:58:57 +0000 (10:58 +0100)]
aes/asm/bsaes-armv7.pl: relax stack alignment requirement.

Even though Apple refers to Procedure Call Standard for ARM Architecture
(AAPCS), they apparently adhere to custom version that doesn't follow
stack alignment constraints in the said standard. [Why or why? If it's
vendor lock-in thing, then it would be like worst spot ever.] And since
bsaes-armv7 relied on standard alignment, it became problematic to
execute the code on iOS.

Reviewed-by: Rich Salz <rsalz@openssl.org>
7 years agoengines/e_capi.c: formatting and styling fixes.
Andy Polyakov [Fri, 24 Mar 2017 15:00:31 +0000 (16:00 +0100)]
engines/e_capi.c: formatting and styling fixes.

Reviewed-by: Richard Levitte <levitte@openssl.org>
7 years agoDon't access memory before checking the correct length in aesni_cbc_hmac_sha256_ctrl...
Bernd Edlinger [Fri, 24 Mar 2017 08:03:54 +0000 (09:03 +0100)]
Don't access memory before checking the correct length in aesni_cbc_hmac_sha256_ctrl in case EVP_CTRL_AEAD_TLS1_AAD.

Reviewed-by: Andy Polyakov <appro@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3023)

7 years agoMove the downgrade sentinel declarations to a header file
Matt Caswell [Fri, 24 Mar 2017 09:57:21 +0000 (09:57 +0000)]
Move the downgrade sentinel declarations to a header file

Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3022)

7 years agoAdd a test for the TLSv1.3 downgrade mechanism
Matt Caswell [Thu, 23 Mar 2017 16:33:57 +0000 (16:33 +0000)]
Add a test for the TLSv1.3 downgrade mechanism

Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3022)

7 years agoMake the TLSv1.3 downgrade mechanism a configurable option
Matt Caswell [Wed, 22 Mar 2017 11:52:45 +0000 (11:52 +0000)]
Make the TLSv1.3 downgrade mechanism a configurable option

Make it disabled by default. When TLSv1.3 is out of draft we can remove
this option and have it enabled all the time.

Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3022)

7 years agoAdd client side support for TLSv1.3 downgrade mechanism
Matt Caswell [Wed, 22 Mar 2017 11:50:32 +0000 (11:50 +0000)]
Add client side support for TLSv1.3 downgrade mechanism

Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3022)

7 years agoAdd server side support for TLSv1.3 downgrade mechanism
Matt Caswell [Wed, 22 Mar 2017 08:52:54 +0000 (08:52 +0000)]
Add server side support for TLSv1.3 downgrade mechanism

Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3022)

7 years ago"any" instead of "and"
Zack Williams [Sat, 18 Mar 2017 01:43:53 +0000 (18:43 -0700)]
"any" instead of "and"

The "and" should be an "any"

Fixed in LibreSSL's docs: http://man.openbsd.org/man5/x509v3.cnf.5#Subject_alternative_name

CLA: trivial

Reviewed-by: Andy Polyakov <appro@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/2980)

7 years agoFix function documentation
Ian Spence [Fri, 17 Mar 2017 02:06:52 +0000 (19:06 -0700)]
Fix function documentation

CLA: trivial

Reviewed-by: Andy Polyakov <appro@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/2972)

7 years agobn/asm/sparcv9-mont.pl: fix squaring code path.
Andy Polyakov [Wed, 22 Mar 2017 09:51:25 +0000 (10:51 +0100)]
bn/asm/sparcv9-mont.pl: fix squaring code path.

This module is used only with odd input lengths, i.e. not used in normal
PKI cases, on contemporary processors. The problem was "illuminated" by
fuzzing tests.

Reviewed-by: Richard Levitte <levitte@openssl.org>
7 years agoLook for comma before - in POD pages
Rich Salz [Thu, 23 Mar 2017 17:04:52 +0000 (13:04 -0400)]
Look for comma before - in POD pages

[skip ci]

Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3021)

7 years agoFix find-doc-nits: { is significant in regexps
Richard Levitte [Thu, 23 Mar 2017 14:09:41 +0000 (15:09 +0100)]
Fix find-doc-nits: { is significant in regexps

Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3019)

7 years agoFix 80-test_ssl_old.t: only count the ciphers if there are any.
Richard Levitte [Wed, 22 Mar 2017 10:06:20 +0000 (11:06 +0100)]
Fix 80-test_ssl_old.t: only count the ciphers if there are any.

Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3014)

7 years agomodes/ocb128.c: fix misaligned access in ILP32 builds on 64-bit processors.
Andy Polyakov [Mon, 20 Mar 2017 11:47:08 +0000 (12:47 +0100)]
modes/ocb128.c: fix misaligned access in ILP32 builds on 64-bit processors.

One could have fixed the problem by arranging 64-bit alignment of
EVP_AES_OCB_CTX.aad_buf in evp/e_aes.c, but CRYPTO_ocb128_aad
prototype doesn't imply alignment and we have to honour it.

Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/2994)

7 years agoaes/asm/aesni-sha*-x86_64.pl: fix IV handling in SHAEXT paths.
Andy Polyakov [Mon, 20 Mar 2017 10:38:25 +0000 (11:38 +0100)]
aes/asm/aesni-sha*-x86_64.pl: fix IV handling in SHAEXT paths.

Initial IV was disregarded on SHAEXT-capable processors. Amazingly
enough bulk AES128-SHA* talk-to-yourself tests were passing.

Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/2992)

7 years agopoly1305/asm/poly1305-x86_64.pl: add poly1305_blocks_vpmadd52_8x.
Andy Polyakov [Sat, 18 Mar 2017 10:08:42 +0000 (11:08 +0100)]
poly1305/asm/poly1305-x86_64.pl: add poly1305_blocks_vpmadd52_8x.

As hinted by its name new subroutine processes 8 input blocks in
parallel by loading data to 512-bit registers. It still needs more
work, as it needs to handle some specific input lengths better.
In this sense it's yet another intermediate step...

Reviewed-by: Rich Salz <rsalz@openssl.org>
7 years agox86_64 assembly pack: add some Ryzen performance results.
Andy Polyakov [Sat, 18 Mar 2017 08:59:01 +0000 (09:59 +0100)]
x86_64 assembly pack: add some Ryzen performance results.

Reviewed-by: Tim Hudson <tjh@openssl.org>
7 years agoChange exit_checker comment on returned status
Richard Levitte [Wed, 22 Mar 2017 07:49:57 +0000 (08:49 +0100)]
Change exit_checker comment on returned status

Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3012)

7 years agoRefuse to run the PYCA external test if configured 'no-shared'
Richard Levitte [Tue, 21 Mar 2017 14:59:12 +0000 (15:59 +0100)]
Refuse to run the PYCA external test if configured 'no-shared'

[extended tests]

Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3007)

7 years agoTravis: make a separate job for external tests
Richard Levitte [Tue, 21 Mar 2017 14:57:03 +0000 (15:57 +0100)]
Travis: make a separate job for external tests

Some of the external tests do not run well with 'no-shared'

Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3007)

7 years ago95-test_external_pyca_data/cryptography.py: only install for testing
Richard Levitte [Tue, 21 Mar 2017 12:48:13 +0000 (13:48 +0100)]
95-test_external_pyca_data/cryptography.py: only install for testing

Also, be less silent when installing, so possible errors are shown.

[extended tests]

Fixes #3005

Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3007)

7 years agoAdapt 20-test_enc.t and 20-test_enc_more.t to use statusvar
Richard Levitte [Tue, 21 Mar 2017 10:26:28 +0000 (11:26 +0100)]
Adapt 20-test_enc.t and 20-test_enc_more.t to use statusvar

Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3004)

7 years agoAdapt 80-test_ssl_old.t to use statusvar
Richard Levitte [Tue, 21 Mar 2017 09:58:46 +0000 (10:58 +0100)]
Adapt 80-test_ssl_old.t to use statusvar

Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3004)

7 years agoOpenSSL::Test: add a statusvar option for run with capture => 1
Richard Levitte [Tue, 21 Mar 2017 09:53:56 +0000 (10:53 +0100)]
OpenSSL::Test: add a statusvar option for run with capture => 1

When using run() with capture => 1, there was no way to find out if
the command was successful or not.  This change adds a statusvar
option, that must refer to a scalar variable, for example:

    my $status = undef;
    my @line = run(["whatever"], capture => 1, statusvar => \$status);

$status will be 1 if the command "whatever" was successful, 0
otherwise.

Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3004)

7 years agoRemove duplicate X509_OBJECT free function.
David Benjamin [Tue, 21 Mar 2017 04:27:35 +0000 (00:27 -0400)]
Remove duplicate X509_OBJECT free function.

These two functions do the same thing.

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3001)

7 years agoAdd a test for resumption after HRR
Matt Caswell [Mon, 20 Mar 2017 18:21:54 +0000 (18:21 +0000)]
Add a test for resumption after HRR

Make sure we actually test resumption where an HRR has occurred.

Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/2996)

7 years agoFix resumption after HRR
Matt Caswell [Mon, 20 Mar 2017 18:03:34 +0000 (18:03 +0000)]
Fix resumption after HRR

Commit 6b1bb98fa moved the processing of ClientHello extensions into the
state machine post-processing stage. After processing s->init_num is reset
to 0, so by post-processing we cannot rely on its value. Unfortunately we
were using it to handle the PSK extension. This causes the handshake to
fail.

We were using init_num to figure out the length of ClientHello2 so we can
remove it from the handshake_buffer. The handshake_buffer holds the
transcript of all the messages sent so far. For PSK processing though we
only want to add in a partial ClientHello2. This commit changes things so
we just work out where ClientHello2 starts, working forward from the
beginning of handshake_buffer.

Fixes #2983

Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/2996)

7 years agoRework how protocol specific ciphers in 80-test_ssl_old.t are picked out
Richard Levitte [Wed, 15 Mar 2017 01:40:55 +0000 (02:40 +0100)]
Rework how protocol specific ciphers in 80-test_ssl_old.t are picked out

The code to do this incorrectly assumed that the protocol version
could be used as a valid cipher suite  for the 'openssl cipher'
command.  While this is true in some cases, that isn't something to be
trusted.  Replace that assumption with code that takes the full
'openssl ciphers' command output and parses it to find the ciphers we
look for.

Reviewed-by: Emilia Käsper <emilia@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/2956)