Commit graph

19560 commits

Author SHA1 Message Date
Matt Caswell
18d20b5eb6 Ensure dhparams can handle X9.42 params in DER
dhparams correctly handles X9.42 params in PEM format. However it failed
to correctly processes them when reading/writing DER format.

Fixes #3102

Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3111)
2017-04-03 20:04:06 +01:00
Matt Caswell
ff79a24402 Add missing macros for DHxparams
DHparams has d2i_DHparams_fp, d2i_DHxparams_bio etc, but the equivalent
macros for DHxparams were omitted.

Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3111)
2017-04-03 20:04:06 +01:00
Matt Caswell
508fafd8ef Add documentation for SSL_get_server_tmp_key()
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3114)
2017-04-03 19:18:47 +01:00
Matt Caswell
090c8118e8 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)
2017-04-03 19:18:47 +01:00
Matt Caswell
a0cb628b17 Tweak a style issue
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3091)
2017-04-03 19:07:29 +01:00
Matt Caswell
90049cea23 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)
2017-04-03 19:07:29 +01:00
Tatsuhiro Tsujikawa
bbea9f2c5f 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)
2017-04-03 19:07:29 +01:00
Matt Caswell
f8a303fa7d 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)
2017-04-03 19:07:29 +01:00
Matt Caswell
59cebcf9f6 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)
2017-04-03 19:07:29 +01:00
Kazuki Yamaguchi
a8e75d5680 Fix a typo in the SSL_get_max_early_data() declarations
SSL_get_max_early_data() recently added by 3fc8d85610 ("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)
2017-04-03 13:45:39 +01:00
Richard Levitte
a4750ce55e 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)
2017-04-02 21:53:06 +02:00
Richard Levitte
92e2ed5689 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)
2017-04-02 21:51:47 +02:00
Richard Levitte
3c12582e8f 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)
2017-04-02 21:51:47 +02:00
Andy Polyakov
0bd93bbe4a 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>
2017-04-02 20:45:59 +02:00
Andy Polyakov
d83112b7fd 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>
2017-04-01 15:50:12 +02:00
Andy Polyakov
c27778d8ad e_afalg.[ch]: fix --strict-warnings with gcc 4.x and 32-bit build.
Reviewed-by: Richard Levitte <levitte@openssl.org>
2017-04-01 15:47:02 +02:00
Andy Polyakov
15b337fa58 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>
2017-04-01 15:40:43 +02:00
Jon Spillett
e6f648fd88 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)
2017-03-31 11:43:42 -04:00
Matt Caswell
36abb6a270 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)
2017-03-31 11:14:13 +01:00
Andy Polyakov
5f5840139e 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)
2017-03-30 19:34:24 +02:00
Andy Polyakov
7d672984f4 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)
2017-03-30 19:34:18 +02:00
Andy Polyakov
74d9519a68 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)
2017-03-30 19:33:32 +02:00
Matt Caswell
12557a3445 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)
2017-03-30 16:16:38 +01:00
Matt Caswell
9b5c865df0 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)
2017-03-30 15:45:45 +01:00
Matt Caswell
116d0da5e8 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)
2017-03-30 15:45:45 +01:00
Jon Spillett
1c7ae3dd9e 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)
2017-03-30 14:18:11 +02:00
Pauli
c4de074e63 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)
2017-03-30 14:16:41 +02:00
Matt Caswell
3cb47b4ec1 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)
2017-03-30 09:13:13 +01:00
Matt Caswell
39ef78210c 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)
2017-03-30 09:09:21 +01:00
Pauli
3fd5ece39b 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)
2017-03-30 00:40:31 +02:00
Andy Polyakov
c141782130 bio/b_print.c: fix %z failure in 32-bit build.
Reviewed-by: Richard Levitte <levitte@openssl.org>
2017-03-29 23:51:57 +02:00
Richard Levitte
6e6aa5a9db Add a simple test for the z modifier
Reviewed-by: Andy Polyakov <appro@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3064)
2017-03-29 16:16:25 +02:00
Richard Levitte
1bcf7d45c6 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)
2017-03-29 16:16:25 +02:00
Richard Levitte
1e53a9fd1a 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)
2017-03-29 16:16:25 +02:00
Emilia Kasper
6edc714564 cipherbytes_test: remove unused includes
cipherbytes_test does not use the testutil / test_main test framework.

Reviewed-by: Andy Polyakov <appro@openssl.org>
2017-03-29 12:48:41 +02:00
Andy Polyakov
8ab9af5e28 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)
2017-03-29 11:52:27 +02:00
Andy Polyakov
3a5b64b2f0 engines/e_capi.c: adhere to CryptAcquireContextW unconditionally.
Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
2017-03-29 11:52:13 +02:00
Andy Polyakov
8f0e5888ea engine/e_capi.c: more formatting and styling fixes.
Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
2017-03-29 11:51:17 +02:00
Pauli
d7735c1eec 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)
2017-03-29 09:43:04 +01:00
Pauli
829e4d5582 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)
2017-03-29 09:40:56 +01:00
Steven Collison
209fac9f8a 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)
2017-03-29 09:31:39 +01:00
Steven Collison
254b58fd73 doc: Add missing options in s_{server,client}
These were added to the help in ad775e04f6 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)
2017-03-29 09:25:44 +01:00
Qin Long
dc8da7b1b8 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)
2017-03-29 07:37:02 +02:00
Qin Long
cff55b90e9 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)
2017-03-29 07:35:59 +02:00
Benjamin Kaduk
0acee5045a Further de-obfuscation
A similar change that probably should have been wrapped into
commit e0926ef49d.

Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3010)
2017-03-29 07:33:39 +02:00
Jon Spillett
8c55c46147 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)
2017-03-29 07:26:41 +02:00
Rich Salz
a01dbac232 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)
2017-03-29 07:18:57 +02:00
FdaSilvaYY
69687aa829 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)
2017-03-29 07:14:29 +02:00
Jon Spillett
7bd278957d 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)
2017-03-29 07:10:18 +02:00
Jon Spillett
edb79c3a34 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)
2017-03-29 07:10:18 +02:00