Go to file
Bryan Donlan 082193ef2b Fix issues in ia32 RDRAND asm leading to reduced entropy
This patch fixes two issues in the ia32 RDRAND assembly code that result in a
(possibly significant) loss of entropy.

The first, less significant, issue is that, by returning success as 0 from
OPENSSL_ia32_rdrand() and OPENSSL_ia32_rdseed(), a subtle bias was introduced.
Specifically, because the assembly routine copied the remaining number of
retries over the result when RDRAND/RDSEED returned 'successful but zero', a
bias towards values 1-8 (primarily 8) was introduced.

The second, more worrying issue was that, due to a mixup in registers, when a
buffer that was not size 0 or 1 mod 8 was passed to OPENSSL_ia32_rdrand_bytes
or OPENSSL_ia32_rdseed_bytes, the last (n mod 8) bytes were all the same value.
This issue impacts only the 64-bit variant of the assembly.

This change fixes both issues by first eliminating the only use of
OPENSSL_ia32_rdrand, replacing it with OPENSSL_ia32_rdrand_bytes, and fixes the
register mixup in OPENSSL_ia32_rdrand_bytes. It also adds a sanity test for
OPENSSL_ia32_rdrand_bytes and OPENSSL_ia32_rdseed_bytes to help catch problems
of this nature in the future.

Reviewed-by: Andy Polyakov <appro@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/5342)
2018-03-08 10:27:49 -05:00
.github
apps Implement multi-process OCSP responder. 2018-03-07 11:03:43 -05:00
boringssl@2070f8ad91
Configurations Configurations/unix-Makefile.tmpl: remove assignment of AS and ASFLAGS 2018-03-07 16:27:48 +01:00
crypto Fix issues in ia32 RDRAND asm leading to reduced entropy 2018-03-08 10:27:49 -05:00
demos Add "friendly name" extractor 2017-11-30 14:53:46 -05:00
doc Fixed several readability issues in DH_generate_parameters.pod 2018-03-08 09:35:29 -05:00
engines Harmonize the make variables across all known platforms families 2018-02-14 17:13:53 +01:00
external/perl
fuzz Add GOST OIDs for Edwards parameter sets 2018-03-07 13:14:59 -05:00
include Add GOST OIDs for Edwards parameter sets 2018-03-07 13:14:59 -05:00
krb5@b9ad6c4950
ms Remove unused num.pl,segregnam scripts 2018-02-22 15:36:27 -05:00
os-dep
pyca-cryptography@c1f8e46033
ssl If not sending key_share (no TLSv1.3), return appropriately. 2018-03-05 13:16:33 +00:00
test Fix issues in ia32 RDRAND asm leading to reduced entropy 2018-03-08 10:27:49 -05:00
tools
util util/dofile.pl: only quote stuff that actually needs quoting 2018-03-06 21:18:33 +01:00
VMS
.gitattributes
.gitignore Remove test-runs dir, adjust .gitignore 2017-12-15 19:27:42 +01:00
.gitmodules
.travis-apt-pin.preferences
.travis-create-release.sh
.travis.yml Revert ".travis.yml: remove osx from build matrix." 2018-02-09 10:03:40 +01:00
ACKNOWLEDGEMENTS
appveyor.yml appveyor.yml: omit makedepend step. 2018-02-24 14:17:24 +01:00
AUTHORS
build.info VMS build.info: uppercase args to perl modules must be quoted 2017-12-18 07:49:53 +01:00
CHANGES Implement multi-process OCSP responder. 2018-03-07 11:03:43 -05:00
config Make sure ./config passes options to ./Configure correctly 2017-12-08 00:36:21 +01:00
config.com Update copyright year 2018-02-13 13:59:25 +00:00
Configure Configure: fix small spelling error 2018-03-06 21:18:33 +01:00
CONTRIBUTING
e_os.h Update copyright year 2018-02-27 13:59:42 +00:00
FAQ
INSTALL Some minor tweaks following TLSv1.3 becoming default 2018-02-12 14:56:45 +00:00
LICENSE Update the license end year 2018-01-20 10:02:23 +01:00
NEWS OpenSSL 1.1.1 is now in pre release 2018-02-13 13:59:25 +00:00
NOTES.DJGPP
NOTES.PERL
NOTES.UNIX NOTES.UNIX: add additional note about --enable-new-dtags 2018-02-15 10:58:31 +01:00
NOTES.VMS
NOTES.WIN
README Prepare for 1.1.1-pre3-dev 2018-02-27 13:59:51 +00:00
README.ECC
README.ENGINE
README.FIPS

 OpenSSL 1.1.1-pre3-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.