TLS/SSL and crypto library
Find a file
Matt Caswell f426625b6a Prevent over long nonces in ChaCha20-Poly1305
ChaCha20-Poly1305 is an AEAD cipher, and requires a unique nonce input for
every encryption operation. RFC 7539 specifies that the nonce value (IV)
should be 96 bits (12 bytes). OpenSSL allows a variable nonce length and
front pads the nonce with 0 bytes if it is less than 12 bytes. However it
also incorrectly allows a nonce to be set of up to 16 bytes. In this case
only the last 12 bytes are significant and any additional leading bytes are
ignored.

It is a requirement of using this cipher that nonce values are unique.
Messages encrypted using a reused nonce value are susceptible to serious
confidentiality and integrity attacks. If an application changes the
default nonce length to be longer than 12 bytes and then makes a change to
the leading bytes of the nonce expecting the new value to be a new unique
nonce then such an application could inadvertently encrypt messages with a
reused nonce.

Additionally the ignored bytes in a long nonce are not covered by the
integrity guarantee of this cipher. Any application that relies on the
integrity of these ignored leading bytes of a long nonce may be further
affected.

Any OpenSSL internal use of this cipher, including in SSL/TLS, is safe
because no such use sets such a long nonce value. However user
applications that use this cipher directly and set a non-default nonce
length to be longer than 12 bytes may be vulnerable.

CVE-2019-1543

Fixes #8345

Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/8406)

(cherry picked from commit 2a3d0ee9d5)
2019-03-06 13:30:39 +00:00
.github Remind people to have 'Fixes #XXXX' in the commit message 2017-04-02 21:51:47 +02:00
apps Update copyright year 2019-02-26 14:05:09 +00:00
boringssl@2070f8ad91 Update ossl_config.json for later BoringSSL commit 2017-03-14 12:12:13 +00:00
Configurations Configuration: divide devteam flags into language specific sets 2019-02-28 13:08:04 +01:00
crypto Prevent over long nonces in ChaCha20-Poly1305 2019-03-06 13:30:39 +00:00
demos Remove unnecessary trailing whitespace 2019-02-05 16:29:17 +01:00
doc Fix trivial typo in EVP_DigestVerifyInit doc 2019-02-26 17:54:08 +02:00
engines Make the padlock engine build correctly 2019-02-27 11:34:40 +01:00
external/perl Update copyright year 2018-09-11 13:45:17 +01:00
fuzz Update copyright year 2018-11-20 13:27:36 +00:00
include Prepare for 1.1.1c-dev 2019-02-26 14:17:50 +00:00
krb5@b9ad6c4950 [extended tests] Enable krb5 tests in Travis 2017-04-18 19:10:25 +02:00
ms Update copyright year 2019-02-26 14:05:09 +00:00
os-dep Move Haiku configuration to separate config file to denote 2016-05-19 22:39:52 +02:00
pyca-cryptography@09403100de Update the pyca-cryptography submodule 2018-09-10 12:04:03 +01:00
ssl Don't write the tick_identity to the session 2019-03-05 14:28:27 +00:00
test Do buildtests on our public header files with C++ as well 2019-02-28 13:08:04 +01:00
tools Update copyright year 2018-03-20 13:08:46 +00:00
util Update copyright year 2019-02-26 14:05:09 +00:00
VMS Simplify the handling of shared library version numbers 2017-07-26 22:53:03 +02:00
.gitattributes Don't export the submodules 'boringssl', 'krb5' and 'pyca-cryptography' 2018-11-24 18:43:54 +01:00
.gitignore Add a compile time test to verify that openssl/rsa.h and complex.h can 2018-09-17 09:44:45 +10:00
.gitmodules [extended tests] Enable krb5 tests in Travis 2017-04-18 19:10:25 +02:00
.travis-apt-pin.preferences Fix travis clang-3.9 builds 2017-06-23 17:57:02 +01:00
.travis-create-release.sh Remove all 'make dist' artifacts 2018-11-23 12:42:21 +01:00
.travis.yml .travis.yml: change -std=c89 to -ansi 2019-02-28 13:08:04 +01:00
ACKNOWLEDGEMENTS
appveyor.yml CI config: no need to make both install and install_docs 2018-05-14 17:51:48 +02:00
AUTHORS Update AUTHORS list, add commentary 2018-07-08 20:32:04 -04:00
build.info Configurations/10-main.conf: replace -bexpall with explicit list on AIX. 2018-06-13 10:48:27 +02:00
CHANGES Prepare for 1.1.1c-dev 2019-02-26 14:17:50 +00:00
config Update copyright year 2019-02-26 14:05:09 +00:00
config.com Update copyright year 2018-02-13 13:59:25 +00:00
Configure Configure: support a few more "make variables" defaulting from env 2019-02-28 13:08:05 +01:00
CONTRIBUTING Remove unnecessary trailing whitespace 2019-02-05 16:29:17 +01:00
e_os.h Fix seeding from random device w/o getrandom syscall 2019-03-01 18:29:56 +01:00
FAQ
INSTALL Better phrasing around 1.1.0 2019-01-31 16:49:30 +01:00
LICENSE Update copyright year 2019-02-26 14:05:09 +00:00
NEWS Prepare for 1.1.1c-dev 2019-02-26 14:17:50 +00:00
NOTES.ANDROID Remove unnecessary trailing whitespace 2019-02-05 16:29:17 +01:00
NOTES.DJGPP Remove unnecessary trailing whitespace 2019-02-05 16:29:17 +01:00
NOTES.PERL Tweaks to NOTES.PERL 2016-06-03 17:10:16 +01:00
NOTES.UNIX NOTES.UNIX: add "Linking your application" paragraph 2018-06-26 12:28:06 +02:00
NOTES.VMS Remove unnecessary trailing whitespace 2019-02-05 16:29:17 +01:00
NOTES.WIN INSTALL,NOTES.WIN: classify no-asm as non-production option. 2018-07-25 15:47:12 +02:00
README Prepare for 1.1.1c-dev 2019-02-26 14:17:50 +00:00
README.ENGINE Remove bsd_cryptodev engine 2017-06-19 09:31:45 -04:00
README.FIPS

 OpenSSL 1.1.1c-dev

 Copyright (c) 1998-2018 The OpenSSL Project
 Copyright (c) 1995-1998 Eric A. Young, Tim J. Hudson
 All rights reserved.

 DESCRIPTION
 -----------

 The OpenSSL Project is a collaborative effort to develop a robust,
 commercial-grade, fully featured, and Open Source toolkit implementing the
 Transport Layer Security (TLS) protocols (including SSLv3) as well as a
 full-strength general purpose cryptographic library.

 OpenSSL is descended from the SSLeay library developed by Eric A. Young
 and Tim J. Hudson.  The OpenSSL toolkit is licensed under a dual-license (the
 OpenSSL license plus the SSLeay license), which means that you are free to
 get and use it for commercial and non-commercial purposes as long as you
 fulfill the conditions of both licenses.

 OVERVIEW
 --------

 The OpenSSL toolkit includes:

 libssl (with platform specific naming):
     Provides the client and server-side implementations for SSLv3 and TLS.

 libcrypto (with platform specific naming):
     Provides general cryptographic and X.509 support needed by SSL/TLS but
     not logically part of it.

 openssl:
     A command line tool that can be used for:
        Creation of key parameters
        Creation of X.509 certificates, CSRs and CRLs
        Calculation of message digests
        Encryption and decryption
        SSL/TLS client and server tests
        Handling of S/MIME signed or encrypted mail
        And more...

 INSTALLATION
 ------------

 See the appropriate file:
        INSTALL         Linux, Unix, Windows, OpenVMS, ...
        NOTES.*         INSTALL addendums for different platforms

 SUPPORT
 -------

 See the OpenSSL website www.openssl.org for details on how to obtain
 commercial technical support. Free community support is available through the
 openssl-users email list (see
 https://www.openssl.org/community/mailinglists.html for further details).

 If you have any problems with OpenSSL then please take the following steps
 first:

    - Download the latest version from the repository
      to see if the problem has already been addressed
    - Configure with no-asm
    - Remove compiler optimization flags

 If you wish to report a bug then please include the following information
 and create an issue on GitHub:

    - OpenSSL version: output of 'openssl version -a'
    - Configuration data: output of 'perl configdata.pm --dump'
    - OS Name, Version, Hardware platform
    - Compiler Details (name, version)
    - Application Details (name, version)
    - Problem Description (steps that will reproduce the problem, if known)
    - Stack Traceback (if the application dumps core)

 Just because something doesn't work the way you expect does not mean it
 is necessarily a bug in OpenSSL. Use the openssl-users email list for this type
 of query.

 HOW TO CONTRIBUTE TO OpenSSL
 ----------------------------

 See CONTRIBUTING

 LEGALITIES
 ----------

 A number of nations restrict the use or export of cryptography. If you
 are potentially subject to such restrictions you should seek competent
 professional legal advice before attempting to develop or distribute
 cryptographic code.