oweals/openssl.git
11 years agoRework tls1_change_cipher_state.
Adam Langley [Tue, 1 Oct 2013 15:18:10 +0000 (11:18 -0400)]
Rework tls1_change_cipher_state.

The previous version of the function made adding AEAD changes very
difficult. This change should be a semantic no-op - it should be purely
a cleanup.

11 years agoConstification.
Ben Laurie [Tue, 1 Oct 2013 13:51:04 +0000 (14:51 +0100)]
Constification.

11 years agoUpdate cms docs.
Dr. Stephen Henson [Mon, 5 Aug 2013 14:56:01 +0000 (15:56 +0100)]
Update cms docs.
(cherry picked from commit dfcb42c68eac61b35d52f2fc53771c0f27dd9c29)

11 years agoCorrectly test for no-ec.
Ben Laurie [Wed, 21 Aug 2013 03:21:57 +0000 (04:21 +0100)]
Correctly test for no-ec.
(cherry picked from commit d5605699a15d870457f96b3e1795135228547324)

11 years agoDon't run ECDH CMS tests if EC disabled.
Dr. Stephen Henson [Sat, 17 Aug 2013 16:39:48 +0000 (17:39 +0100)]
Don't run ECDH CMS tests if EC disabled.
(cherry picked from commit b85f8afe3735eb77073481ffff2a4c972a6c3b21)

11 years agoAdd X9.42 DH test.
Dr. Stephen Henson [Fri, 2 Aug 2013 14:57:54 +0000 (15:57 +0100)]
Add X9.42 DH test.
(cherry picked from commit bbc098ffb3c0b09e0bbeca787e20efddc3242ec1)

11 years agoNew CMS tests.
Dr. Stephen Henson [Wed, 17 Jul 2013 17:20:29 +0000 (18:20 +0100)]
New CMS tests.

Add some ECDH CMS tests.
(cherry picked from commit 5cdc25a7545e44523b1f15418146bbda8eb03015)

11 years agoAdd X9.42 DH certificate to S/MIME test
Dr. Stephen Henson [Fri, 2 Aug 2013 14:51:46 +0000 (15:51 +0100)]
Add X9.42 DH certificate to S/MIME test
(cherry picked from commit 75787fd833a11798e09b027991aabc5b7dafa335)

11 years agoScripts to recreate S/MIME test certificates.
Dr. Stephen Henson [Wed, 17 Jul 2013 15:30:04 +0000 (16:30 +0100)]
Scripts to recreate S/MIME test certificates.

Add a script to generate keys and certificates for the S/MIME and CMS
tests.

Update certificates and add EC examples.
(cherry picked from commit a0957d55059f0b6052235737f7441fc35da41afd)

11 years agoCustom key wrap option for cms utility.
Dr. Stephen Henson [Wed, 17 Jul 2013 14:21:31 +0000 (15:21 +0100)]
Custom key wrap option for cms utility.
(cherry picked from commit 5711885a2b31bfb623fb3738ce92a4cce4316bc7)

11 years agoadd cofactor ECDH support from fips branch
Dr. Stephen Henson [Sat, 10 Dec 2011 13:35:11 +0000 (13:35 +0000)]
add cofactor ECDH support from fips branch
(cherry picked from commit a3a2e3a43d13d8486c5e100e1bef7fec8e61b27b)

11 years agoFix compile errors.
Ben Laurie [Wed, 21 Aug 2013 03:21:42 +0000 (04:21 +0100)]
Fix compile errors.
(cherry picked from commit a0aaa5660a29f0faa86e5e51ce889299c5f3098b)

11 years agoCMS RFC2631 X9.42 DH enveloped data support.
Dr. Stephen Henson [Sat, 20 Jul 2013 20:31:10 +0000 (21:31 +0100)]
CMS RFC2631 X9.42 DH enveloped data support.
(cherry picked from commit bd59f2b91db8fab86e8610de4565b5ab8de2b44b)

Conflicts:

crypto/dh/dh.h
crypto/dh/dh_err.c

Sync error codes with 1.0.1.

11 years agoMinor optimisation to KDF algorithm.
Dr. Stephen Henson [Thu, 1 Aug 2013 14:48:44 +0000 (15:48 +0100)]
Minor optimisation to KDF algorithm.

Don't need to use temporary buffer if remaining length equals digest length.
(cherry picked from commit 3f6b6f0b8cbd7173b6c007b07caa6ec34cda08c5)

11 years agoAdd KDF for DH.
Dr. Stephen Henson [Tue, 30 Jul 2013 17:05:08 +0000 (18:05 +0100)]
Add KDF for DH.

Add X9.42 DH KDF. Move sharedinfo generation code to CMS library as the
same structure is used by DH and ECDH.

Move ASN1_OBJECT typedef to ossl_typ.h so it can be picked up by dh headers
without the need to use ASN1.
(cherry picked from commit dc1ce3bc64845d16314af1f11acf5384e4ae9b34)

11 years agoReturn correct enveloped data type in ASN1 methods.
Dr. Stephen Henson [Wed, 17 Jul 2013 14:18:01 +0000 (15:18 +0100)]
Return correct enveloped data type in ASN1 methods.

For RSA and DSA keys return an appropriate RecipientInfo type. By setting
CMS_RECIPINFO_NONE for DSA keys an appropriate error is returned if
an attempt is made to use DSA with enveloped data.
(cherry picked from commit 41b920ef01abeb4c4b1c0f11e647370ae6533d02)

11 years agoAlgorithm parameter support.
Dr. Stephen Henson [Mon, 5 Aug 2013 14:40:50 +0000 (15:40 +0100)]
Algorithm parameter support.

Check and set AlgorithmIdenfier parameters for key wrap algorithms.
Currently these just set parameters to NULL.
(cherry picked from commit e61f5d55bc0072e75023be8971ae6e849643f466)

11 years agoAdd support for ECDH KARI.
Dr. Stephen Henson [Wed, 17 Jul 2013 14:13:37 +0000 (15:13 +0100)]
Add support for ECDH KARI.

Add support for ECDH in enveloped data. The CMS ctrls for the EC ASN1
method decode/encode the appropriate parameters from the CMS ASN1 data
and send appropriate data to the EC public key method.
(cherry picked from commit 88e20b8584a78c803eca7aa9fcf8c46ff0ece4ae)

11 years agoAdd support for X9.62 KDF.
Dr. Stephen Henson [Wed, 17 Jul 2013 14:01:08 +0000 (15:01 +0100)]
Add support for X9.62 KDF.

Add X9.62 KDF to EC EVP_PKEY_METHOD.
(cherry picked from commit 25af7a5dbc05c7359d1d7f472d50d65a9d876b7e)

11 years agoCMS support for key agreeement recipient info.
Dr. Stephen Henson [Wed, 17 Jul 2013 13:36:39 +0000 (14:36 +0100)]
CMS support for key agreeement recipient info.

Add hooks to support key agreement recipient info type (KARI) using
algorithm specific code in the relevant public key ASN1 method.
(cherry picked from commit 17c2764d2e6fc5a010ad3c12662068689ed2ad17)

11 years agoAdd new CMS tests.
Dr. Stephen Henson [Wed, 19 Jun 2013 17:26:27 +0000 (18:26 +0100)]
Add new CMS tests.

Add new tests to cms-test.pl covering PSS and OAEP.
(cherry picked from commit 32b18e0338a326723680c7c347d3f04bf4e24b40)

11 years agoAdd -keyopt option to cms utility.
Dr. Stephen Henson [Wed, 19 Jun 2013 17:24:00 +0000 (18:24 +0100)]
Add -keyopt option to cms utility.

Add support for custom public key parameters in the cms utility using
the -keyopt switch. Works for -sign and also -encrypt if -recip is used.
(cherry picked from commit 02498cc885b801f38f33c0a0d08d4603fd6350c7)

11 years agoUpdate cms docs.
Dr. Stephen Henson [Fri, 21 Jun 2013 22:24:25 +0000 (23:24 +0100)]
Update cms docs.

Document use of -keyopt to use RSA-PSS and RSA-OAEP modes.
(cherry picked from commit 4bf4a6501c6ca3fa1853f07c82e0e9cfe22dee45)

11 years agoCMS RSA-OAEP and RSA-PSS support.
Dr. Stephen Henson [Wed, 19 Jun 2013 17:21:37 +0000 (18:21 +0100)]
CMS RSA-OAEP and RSA-PSS support.

Extend RSA ASN1 method to support CMS PSS signatures for both sign
and verify.

For signing the EVP_PKEY_CTX parameters are read and the appropriate
CMS structures set up.

For verification the CMS structures are analysed and the corresponding
parameters in the EVP_PKEY_CTX set.

Also add RSA-OAEP support.

For encrypt the EVP_PKEY_CTX parameters are used.

For decrypt the CMS structure is uses to set the appropriate EVP_PKEY_CTX
parameters.
(cherry picked from commit 0574cadf857b19485465b9d71b7dec9549857a4d)

Also sync error codes with OpenSSL 1.0.1 and add new ones.

11 years agoUpdate to OAEP support.
Dr. Stephen Henson [Thu, 20 Jun 2013 16:02:14 +0000 (17:02 +0100)]
Update to OAEP support.

Add OAEP ctrls to retrieve MD and label. Return errors if
an attempt is made to set or retrieve OAEP parameters when
padding mode is not OAEP.
(cherry picked from commit 211a14f6279f127f7a5a59948819bd939131b0b6)

11 years agoExetended OAEP support.
Dr. Stephen Henson [Tue, 21 May 2013 22:55:50 +0000 (23:55 +0100)]
Exetended OAEP support.

Extend OAEP support. Generalise the OAEP padding functions to support
arbitrary digests. Extend EVP_PKEY RSA method to handle the new OAEP
padding functions and add ctrls to set the additional parameters.
(cherry picked from commit 271fef0ef39a1c0cb5233a5adf3ff8733abb375e)

Conflicts:

CHANGES

11 years agoAdd FIPS RSA error code.
Dr. Stephen Henson [Fri, 20 Sep 2013 12:24:08 +0000 (13:24 +0100)]
Add FIPS RSA error code.

Add some RSA error codes used by the FIPS module.

11 years agoSet CMS EnvelopedData version correctly.
Dr. Stephen Henson [Wed, 10 Jul 2013 17:36:37 +0000 (18:36 +0100)]
Set CMS EnvelopedData version correctly.
(cherry picked from commit ff7b6ce9db329eb48775bb81e0ecbbd2a9b23c1c)

11 years agoInitialise CMS signature buffer length properly.
Dr. Stephen Henson [Tue, 2 Jul 2013 21:11:27 +0000 (22:11 +0100)]
Initialise CMS signature buffer length properly.
(cherry picked from commit e0f7cfda68881da6829ea39430e1a5c28ed05ece)

11 years agoCMS public key parameter support.
Dr. Stephen Henson [Wed, 19 Jun 2013 17:17:14 +0000 (18:17 +0100)]
CMS public key parameter support.

Add support for customisation of CMS handling of signed and enveloped
data from custom public key parameters.

This will provide support for RSA-PSS and RSA-OAEP but could also be
applied to other algorithms.
(cherry picked from commit e365352d6a6368039392fed14a328f8c0bf955c3)

11 years agoAdd control to retrieve signature MD.
Dr. Stephen Henson [Wed, 19 Jun 2013 17:20:03 +0000 (18:20 +0100)]
Add control to retrieve signature MD.
(cherry picked from commit 810639536cfa66df0c232fa4f15a7e5f00f31ce8)

11 years agoAdd new OIDs from RFC5753
Dr. Stephen Henson [Wed, 17 Jul 2013 13:54:00 +0000 (14:54 +0100)]
Add new OIDs from RFC5753

Add OIDs for KDF schemes from RFC5753 and add cross references for
each type and the appropriate digest to use.
(cherry picked from commit 6af440ced43d766e418c2eb0cda1525eecd3e62b)

Conflicts:

crypto/objects/obj_dat.h
crypto/objects/obj_mac.num

11 years agoAdd new OID to pSpecified from PKCS#1
Dr. Stephen Henson [Fri, 21 Jun 2013 10:59:04 +0000 (11:59 +0100)]
Add new OID to pSpecified from PKCS#1
(cherry picked from commit e423c360fd2670b151c8e61439b36a77c77f77c3)

Conflicts:

crypto/objects/obj_dat.h
crypto/objects/obj_mac.num

11 years agoAdd FIPS 186-2 DSA parameter generation algorithm.
Dr. Stephen Henson [Wed, 18 Sep 2013 13:18:46 +0000 (14:18 +0100)]
Add FIPS 186-2 DSA parameter generation algorithm.

Backport support for FIPS 186-2 DSA parameter generation from
HEAD. Redirect to FIPS in FIPS mode and workaround prototype error.

11 years agoExtend DH parameter generation support.
Dr. Stephen Henson [Wed, 31 Jul 2013 17:10:16 +0000 (18:10 +0100)]
Extend DH parameter generation support.

Add support for DH parameter generation using DSA methods including
FIPS 186-3.
(cherry picked from commit 3909087801729bebb3a1182936a855a47e4ee9c9)

11 years agoEnhance DH dup functions.
Dr. Stephen Henson [Sat, 20 Jul 2013 20:25:50 +0000 (21:25 +0100)]
Enhance DH dup functions.

Make DHparams_dup work properly with X9.42 DH parameters.
(cherry picked from commit d3cc91eee2cba07d8908f0fea531c62863ed3ccf)

11 years agoIf present print j, seed and counter values for DH
Dr. Stephen Henson [Fri, 2 Aug 2013 13:40:00 +0000 (14:40 +0100)]
If present print j, seed and counter values for DH
(cherry picked from commit c9577ab5eae56cb00c17a0eb724229f0bc1397a0)

Conflicts:

crypto/dh/dh_ameth.c

11 years agoEVP support for wrapping algorithms.
Dr. Stephen Henson [Wed, 17 Jul 2013 13:05:19 +0000 (14:05 +0100)]
EVP support for wrapping algorithms.

Add support for key wrap algorithms via EVP interface.

Generalise AES wrap algorithm and add to modes, making existing
AES wrap algorithm a special case.

Move test code to evptests.txt
(cherry picked from commit 97cf1f6c2854a3a955fd7dd3a1f113deba00c9ef)

Conflicts:

CHANGES

11 years agoevptests.txt: add XTS test vectors
Andy Polyakov [Thu, 4 Apr 2013 13:53:01 +0000 (15:53 +0200)]
evptests.txt: add XTS test vectors
(cherry picked from commit c9a8e3d1c754cee8551d36cd54a1ea675ee8d055)

11 years agoevptests.txt: additional GCM test vectors.
Andy Polyakov [Wed, 6 Mar 2013 18:24:05 +0000 (19:24 +0100)]
evptests.txt: additional GCM test vectors.
(cherry picked from commit ca303d333bb3ff61a946f92b2569ee98ae18c3cb)

11 years agoFix warnings.
Ben Laurie [Sat, 23 Mar 2013 19:04:46 +0000 (19:04 +0000)]
Fix warnings.
(cherry picked from commit 282a480a352e2aac4fad6e75932d951659bff62d)

11 years agoGCM and CCM test support
Dr. Stephen Henson [Wed, 6 Mar 2013 15:45:15 +0000 (15:45 +0000)]
GCM and CCM test support

Add code to support GCM an CCM modes in evp_test. On encrypt this
will compare the expected ciphertext and tag. On decrypt it will
compare the expected plaintext: tag comparison is done internally.

Add a simple CCM test case and convert all tests from crypto/modes/gcm128.c
(cherry picked from commit 15652f9825de25481676767aa73945409f9c82e2)

11 years agoAdd CCM ciphers to tables.
Dr. Stephen Henson [Wed, 6 Mar 2013 15:41:29 +0000 (15:41 +0000)]
Add CCM ciphers to tables.
(cherry picked from commit 95248de327cb468d2ead36930fdf3d05d10d7b6a)

11 years agoNew SP 800-56A compliant version of DH_compute_key().
Dr. Stephen Henson [Tue, 8 Mar 2011 19:07:26 +0000 (19:07 +0000)]
New SP 800-56A compliant version of DH_compute_key().
(cherry picked from commit bc91494e064ebdcff68f987947f97e404fbca0b5)

11 years agoTypo.
Dr. Stephen Henson [Wed, 17 Jul 2013 13:19:40 +0000 (14:19 +0100)]
Typo.
(cherry picked from commit 415ece73015a0e24ea934ecfb857d022952bb65b)

11 years agoRe-add accidentally deleted #endif.
Ben Laurie [Tue, 1 Oct 2013 11:34:44 +0000 (12:34 +0100)]
Re-add accidentally deleted #endif.

11 years agoMerge remote-tracking branch 'agl/1.0.2alpn' into agl-alpn
Ben Laurie [Tue, 1 Oct 2013 11:20:02 +0000 (12:20 +0100)]
Merge remote-tracking branch 'agl/1.0.2alpn' into agl-alpn

Conflicts:
ssl/ssl3.h
ssl/t1_lib.c

11 years agoProduce PEM we would consume.
Ben Laurie [Wed, 25 Sep 2013 12:55:06 +0000 (13:55 +0100)]
Produce PEM we would consume.

11 years agoShow useful errors.
Ben Laurie [Tue, 24 Sep 2013 22:13:22 +0000 (23:13 +0100)]
Show useful errors.

11 years agoMerge remote-tracking branch 'trevp/pempick' into OpenSSL_1_0_2-stable
Ben Laurie [Tue, 24 Sep 2013 11:47:54 +0000 (12:47 +0100)]
Merge remote-tracking branch 'trevp/pempick' into OpenSSL_1_0_2-stable

11 years agoDisable Dual EC DRBG.
Dr. Stephen Henson [Mon, 16 Sep 2013 04:23:44 +0000 (05:23 +0100)]
Disable Dual EC DRBG.

Return an error if an attempt is made to enable the Dual EC DRBG: it
is not used by default.
(cherry picked from commit a4870de5aaef562c0947494b410a2387f3a6d04d)

11 years agoMerge remote-tracking branch 'trevp/pemfix' into trev-pem-fix
Ben Laurie [Fri, 20 Sep 2013 13:39:33 +0000 (14:39 +0100)]
Merge remote-tracking branch 'trevp/pemfix' into trev-pem-fix

11 years agoFix warning.
Dr. Stephen Henson [Wed, 18 Sep 2013 13:45:59 +0000 (14:45 +0100)]
Fix warning.

11 years agoDTLS version usage fixes.
Dr. Stephen Henson [Tue, 17 Sep 2013 17:10:37 +0000 (18:10 +0100)]
DTLS version usage fixes.

Make DTLS behave like TLS when negotiating version: record layer has
DTLS 1.0, message version is 1.2.

Tolerate different version numbers if version hasn't been negotiated
yet.
(cherry picked from commit 40088d8b8190a2a33828a769c23bf35de542c7dc)

11 years agoDTLS trace support.
Dr. Stephen Henson [Fri, 8 Mar 2013 16:45:37 +0000 (16:45 +0000)]
DTLS trace support.

Add DTLS record header parsing, different client hello format and add
HelloVerifyRequest message type.

Add code to d1_pkt.c to send message headers to the message callback.
(cherry picked from commit 890f2f8b92b385ef3898cdb4a15a071ffcf8107f)

Conflicts:

ssl/ssl_locl.h

11 years agoSuite B support for DTLS 1.2
Dr. Stephen Henson [Tue, 9 Apr 2013 14:57:39 +0000 (15:57 +0100)]
Suite B support for DTLS 1.2

Check for Suite B support using method flags instead of version numbers:
anything supporting TLS 1.2 cipher suites will also support Suite B.

Return an error if an attempt to use DTLS 1.0 is made in Suite B mode.
(cherry picked from commit 4544f0a69161a37ee3edce3cc1bc34c3678a4d64)

11 years agoAlways return errors in ssl3_get_client_hello
Dr. Stephen Henson [Tue, 9 Apr 2013 14:53:38 +0000 (15:53 +0100)]
Always return errors in ssl3_get_client_hello

If we successfully match a cookie don't set return value to 2 as this
results in other error conditions returning 2 as well.

Instead set return value to -2 which can be checked later if everything
else is OK.
(cherry picked from commit c56f5b8edfbcec704f924870daddd96a5f768fbb)

11 years agoDual DTLS version methods.
Dr. Stephen Henson [Sat, 6 Apr 2013 14:50:12 +0000 (15:50 +0100)]
Dual DTLS version methods.

Add new methods DTLS_*_method() which support both DTLS 1.0 and DTLS 1.2 and
pick the highest version the peer supports during negotiation.

As with SSL/TLS options can change this behaviour specifically
SSL_OP_NO_DTLSv1 and SSL_OP_NO_DTLSv1_2.
(cherry picked from commit c6913eeb762edffddecaaba5c84909d7a7962927)

Conflicts:

CHANGES

11 years agoEnable TLS 1.2 ciphers in DTLS 1.2.
Dr. Stephen Henson [Wed, 27 Mar 2013 19:54:48 +0000 (19:54 +0000)]
Enable TLS 1.2 ciphers in DTLS 1.2.

Port TLS 1.2 GCM code to DTLS. Enable use of TLS 1.2 only ciphers when in
DTLS 1.2 mode too.
(cherry picked from commit 4221c0dd3004117c63b182af5e8ab345b7265902)

11 years agoUpdate fixed DH requirements.
Dr. Stephen Henson [Wed, 27 Mar 2013 16:05:10 +0000 (16:05 +0000)]
Update fixed DH requirements.

The relaxed signing requirements for fixed DH certificates apply to DTLS 1.2
too.
(cherry picked from commit fbbaaccaca32742f09dfb02e5e28dcd20f64a17f)

11 years agoDTLS 1.2 cached record support.
Dr. Stephen Henson [Wed, 27 Mar 2013 15:50:42 +0000 (15:50 +0000)]
DTLS 1.2 cached record support.

Add DTLS1.2 support for cached records when computing handshake macs
instead of the MD5+SHA1 case for DTLS < 1.2 (this is a port of the
equivalent TLS 1.2 code to DTLS).
(cherry picked from commit 04fac50045929e7078cad4835478dd7f16b6d4bd)

11 years agoProvisional DTLS 1.2 support.
Dr. Stephen Henson [Wed, 20 Mar 2013 15:49:14 +0000 (15:49 +0000)]
Provisional DTLS 1.2 support.

Add correct flags for DTLS 1.2, update s_server and s_client to handle
DTLS 1.2 methods.

Currently no support for version negotiation: i.e. if client/server selects
DTLS 1.2 it is that or nothing.
(cherry picked from commit c3b344e36a088283731b4f65a70e85b100f55686)

Conflicts:

apps/s_server.c

11 years agoRemove versions test from dtls1_buffer_message
Dr. Stephen Henson [Tue, 26 Mar 2013 14:46:18 +0000 (14:46 +0000)]
Remove versions test from dtls1_buffer_message

Since this is always called from DTLS code it is safe to assume the header
length should be the DTLS value. This avoids the need to check the version
number and should work with any version of DTLS (not just 1.0).
(cherry picked from commit 9cf0f187542f080031f83c5e538d3e1872ac09d1)

11 years agoExtend DTLS method macros.
Dr. Stephen Henson [Tue, 19 Mar 2013 15:51:26 +0000 (15:51 +0000)]
Extend DTLS method macros.

Extend DTLS method creation macros to support version numbers and encryption
methods. Update existing code.
(cherry picked from commit cfd298b7aef2b095bee8d172a6a40d6c59d1574b)

11 years agoEnable various DTLS extensions.
Dr. Stephen Henson [Tue, 19 Mar 2013 15:49:35 +0000 (15:49 +0000)]
Enable various DTLS extensions.

Some TLS extensions were disabled for DTLS. Possibly because they caused
problems with the old duplicated code. Enable them again.
(cherry picked from commit 874a18cfadc6bac0ad73482325f2ca72dfccdb82)

11 years agoUse enc_flags when deciding protocol variations.
Dr. Stephen Henson [Wed, 13 Mar 2013 15:33:24 +0000 (15:33 +0000)]
Use enc_flags when deciding protocol variations.

Use the enc_flags field to determine whether we should use explicit IV,
signature algorithms or SHA256 default PRF instead of hard coding which
versions support each requirement.
(cherry picked from commit cbd64894ec687c6f37d8e43c16dff78e63f6be87)

Conflicts:

ssl/ssl_locl.h

11 years agoUse appropriate versions of SSL3_ENC_METHOD
Dr. Stephen Henson [Wed, 13 Mar 2013 13:30:44 +0000 (13:30 +0000)]
Use appropriate versions of SSL3_ENC_METHOD
(cherry picked from commit 6de2649a6b349bde9c9fb62c3a3d5d6344d8259c)

11 years agoDTLS revision.
Dr. Stephen Henson [Mon, 11 Mar 2013 15:34:28 +0000 (15:34 +0000)]
DTLS revision.

Revise DTLS code. There was a *lot* of code duplication in the
DTLS code that generates records. This makes it harder to maintain and
sometimes a TLS update is omitted by accident from the DTLS code.

Specifically almost all of the record generation functions have code like
this:

some_pointer = buffer + HANDSHAKE_HEADER_LENGTH;
... Record creation stuff ...
set_handshake_header(ssl, SSL_MT_SOMETHING, message_len);

...

write_handshake_message(ssl);

Where the "Record creation stuff" is identical between SSL/TLS and DTLS or
in some cases has very minor differences.

By adding a few fields to SSL3_ENC to include the header length, some flags
and function pointers for handshake header setting and handshake writing the
code can cope with both cases.

(cherry picked from commit 173e72e64c6a07ae97660c322396b66215009f33)

11 years agoAdd functions to set ECDSA_METHOD structure.
Dr. Stephen Henson [Tue, 17 Sep 2013 23:50:15 +0000 (00:50 +0100)]
Add functions to set ECDSA_METHOD structure.

Add various functions to allocate and set the fields of an ECDSA_METHOD
structure.
(cherry picked from commit 94c2f77a62be7079ab1893ab14b18a30157c4532)

11 years agoMerge branch 'OpenSSL_1_0_2-stable' of openssl.net:openssl into OpenSSL_1_0_2-stable
Bodo Moeller [Tue, 17 Sep 2013 07:59:14 +0000 (09:59 +0200)]
Merge branch 'OpenSSL_1_0_2-stable' of openssl.net:openssl into OpenSSL_1_0_2-stable

11 years agoSync with version from master.
Bodo Moeller [Tue, 17 Sep 2013 07:55:27 +0000 (09:55 +0200)]
Sync with version from master.

11 years agoVarious custom extension fixes.
Trevor Perrin [Sun, 28 Jul 2013 06:10:14 +0000 (23:10 -0700)]
Various custom extension fixes.

Force no SSL2 when custom extensions in use.
Don't clear extension state when cert is set.
Clear on renegotiate.

Conflicts:
ssl/t1_lib.c

11 years agoUpdate CHANGES.
Rob Stradling [Thu, 12 Sep 2013 21:08:07 +0000 (22:08 +0100)]
Update CHANGES.

11 years agoTidy up comments.
Rob Stradling [Tue, 10 Sep 2013 10:50:05 +0000 (11:50 +0100)]
Tidy up comments.

11 years agoUse TLS version supplied by client when fingerprinting Safari.
Rob Stradling [Tue, 10 Sep 2013 10:46:42 +0000 (11:46 +0100)]
Use TLS version supplied by client when fingerprinting Safari.

11 years agoFix compilation with no-ec and/or no-tlsext.
Rob Stradling [Tue, 10 Sep 2013 10:45:37 +0000 (11:45 +0100)]
Fix compilation with no-ec and/or no-tlsext.

11 years agoDon't prefer ECDHE-ECDSA ciphers when the client appears to be Safari on OS X.
Rob Stradling [Mon, 9 Sep 2013 09:44:29 +0000 (10:44 +0100)]
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.

11 years agoSync CHANGES and NEWS files.
Bodo Moeller [Mon, 16 Sep 2013 12:54:34 +0000 (14:54 +0200)]
Sync CHANGES and NEWS files.

11 years agoMerge branch 'OpenSSL_1_0_2-stable' of /usr/local/google/home/bmoeller/openssl/openss...
Bodo Moeller [Mon, 16 Sep 2013 12:51:10 +0000 (14:51 +0200)]
Merge branch 'OpenSSL_1_0_2-stable' of /usr/local/google/home/bmoeller/openssl/openssl into OpenSSL_1_0_2-stable

11 years ago Fix overly lenient comparisons:
Bodo Moeller [Mon, 16 Sep 2013 11:03:27 +0000 (13:03 +0200)]
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)

11 years ago Fix overly lenient comparisons:
Bodo Moeller [Mon, 16 Sep 2013 11:03:27 +0000 (13:03 +0200)]
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)

11 years agoExtend OPENSSL_ia32cap_P (backport from HEAD).
Andy Polyakov [Sun, 15 Sep 2013 20:13:54 +0000 (22:13 +0200)]
Extend OPENSSL_ia32cap_P (backport from HEAD).

11 years agocrypto/armcap.c: fix typo in rdtsc subroutine.
Andy Polyakov [Sun, 15 Sep 2013 20:07:49 +0000 (22:07 +0200)]
crypto/armcap.c: fix typo in rdtsc subroutine.

PR: 3125
Submitted by: Kyle McMartin
(cherry picked from commit 8e52a9063a8a016bdac780005256994d26f9c2f9)

11 years agoadd -badsig option to corrupt CRL signatures for testing too
Dr. Stephen Henson [Sun, 2 Dec 2012 16:48:25 +0000 (16:48 +0000)]
add -badsig option to corrupt CRL signatures for testing too
(cherry picked from commit 139cd16cc58330840890f914c318f00de6bfd831)

11 years agoAdd missing code from SSL_CONF backport.
Dr. Stephen Henson [Fri, 13 Sep 2013 15:19:15 +0000 (16:19 +0100)]
Add missing code from SSL_CONF backport.

11 years agoInitialize next_proto in s_server - resolves incorrect attempts to free
Scott Deboy [Thu, 12 Sep 2013 00:22:00 +0000 (17:22 -0700)]
Initialize next_proto in s_server - resolves incorrect attempts to free

Cherry pick of b0d27cb9028cbf552612baa42255737cca0e32d2.

11 years agoAdd tests for ALPN functionality.
Adam Langley [Mon, 15 Jul 2013 19:57:16 +0000 (15:57 -0400)]
Add tests for ALPN functionality.

Cherry-picked from a898936218bc279b5d7cdf76d58a25e7a2d419cb.

11 years agoSupport ALPN.
Adam Langley [Mon, 15 Apr 2013 22:07:47 +0000 (18:07 -0400)]
Support ALPN.

This change adds support for ALPN[1] in OpenSSL. ALPN is the IETF
blessed version of NPN and we'll be supporting both ALPN and NPN for
some time yet.

Cherry-picked from 6f017a8f9db3a79f3a3406cf8d493ccd346db691.

[1] https://tools.ietf.org/html/draft-ietf-tls-applayerprotoneg-00

11 years agoConstification.
Ben Laurie [Tue, 10 Sep 2013 16:58:44 +0000 (17:58 +0100)]
Constification.

11 years agocrypto/modes/asm/aesni-gcm-x86_64.pl: minor optimization.
Andy Polyakov [Mon, 9 Sep 2013 19:43:21 +0000 (21:43 +0200)]
crypto/modes/asm/aesni-gcm-x86_64.pl: minor optimization.

Avoid occasional up to 8% performance drops.
(cherry picked from commit 7a1a12232a84621271bf808107f3be9a2df5121a)

11 years agocrypto/bn/asm/x86_64-mont.pl: minor optimization.
Andy Polyakov [Mon, 9 Sep 2013 19:40:33 +0000 (21:40 +0200)]
crypto/bn/asm/x86_64-mont.pl: minor optimization.
(cherry picked from commit 72a158703bf2b33f4eba6920302941560f7a848d)

11 years agoRevert "x86cpuid.pl: fix extended feature flags detection."
Andy Polyakov [Mon, 9 Sep 2013 19:35:15 +0000 (21:35 +0200)]
Revert "x86cpuid.pl: fix extended feature flags detection."

This reverts commit 514f1a783515e9beb73b759a483c078813cf8ba0.

11 years agoRemove ancient PATENTS section and FAQ reference.
Dr. Stephen Henson [Sun, 8 Sep 2013 20:22:57 +0000 (21:22 +0100)]
Remove ancient PATENTS section and FAQ reference.
(cherry picked from commit ce4555967ec0fa7c0b9c15823be52dc23fd09a40)

11 years agoPartial path fix.
Dr. Stephen Henson [Sun, 8 Sep 2013 18:26:59 +0000 (19:26 +0100)]
Partial path fix.

When verifying a partial path always check to see if the EE certificate
is explicitly trusted: the path could contain other untrusted certificates.
(cherry picked from commit 52073b76753815ef1dcc3ab3f9dba75803f717f4)

11 years agoDocument supported curve functions.
Dr. Stephen Henson [Tue, 3 Sep 2013 14:42:40 +0000 (15:42 +0100)]
Document supported curve functions.
(cherry picked from commit c3eb33763bf2999843fe4124f3f39dea6edc26e6)

11 years agoDocument -force_pubkey option.
Dr. Stephen Henson [Wed, 21 Aug 2013 12:39:27 +0000 (13:39 +0100)]
Document -force_pubkey option.
(cherry picked from commit b093a06866bf632a97a9a0286e2d08f69c3cf7dd)

11 years agoCorrect ECDSA example.
Dr. Stephen Henson [Tue, 20 Aug 2013 15:33:02 +0000 (16:33 +0100)]
Correct ECDSA example.
(cherry picked from commit 3a918ea2bbf4175d9461f81be1403d3781b2c0dc)

11 years agofix printout of expiry days if -enddate is used in ca
Dr. Stephen Henson [Tue, 20 Nov 2012 15:22:15 +0000 (15:22 +0000)]
fix printout of expiry days if -enddate is used in ca
(cherry picked from commit f7ac0ec89d0daefdea2956c55c17f1246e81c0a6)

11 years agoTime difference functions.
Dr. Stephen Henson [Mon, 19 Nov 2012 15:12:07 +0000 (15:12 +0000)]
Time difference functions.

Backport of ASN1_TIME_diff and OPENSSL_gmtime_diff functions from master
branch.

11 years agonew command line option -stdname to ciphers utility
Dr. Stephen Henson [Fri, 16 Nov 2012 00:35:46 +0000 (00:35 +0000)]
new command line option -stdname to ciphers utility
(cherry picked from commit 51b9115b6dcaf94718de3c8b4d97b00f8cd63cd5)