1. 11 3月, 2021 1 次提交
  2. 09 9月, 2020 1 次提交
  3. 17 3月, 2020 2 次提交
  4. 14 3月, 2020 1 次提交
    • B
      Add test that changes ciphers on CCS · 2f0dab7e
      Benjamin Kaduk 提交于
      The TLS (pre-1.3) ChangeCipherState message is usually used to indicate
      the switch from the unencrypted to encrypted part of the handshake.
      However, it can also be used in cases where there is an existing
      session (such as during resumption handshakes) or when changing from
      one cipher to a different one (such as during renegotiation when the
      cipher list offered by the client has changed).  This test serves
      to exercise such situations, allowing us to detect whether session
      objects are being modified in cases when they must remain immutable
      for thread-safety purposes.
      Reviewed-by: NTomas Mraz <tmraz@fedoraproject.org>
      (Merged from https://github.com/openssl/openssl/pull/10943)
      
      (cherry picked from commit 3cd14e5e65011660ad8e3603cf871c8366b565fd)
      2f0dab7e
  5. 11 3月, 2020 2 次提交
  6. 27 2月, 2020 1 次提交
  7. 16 2月, 2020 2 次提交
  8. 12 2月, 2020 1 次提交
  9. 06 2月, 2020 3 次提交
  10. 31 1月, 2020 1 次提交
  11. 25 1月, 2020 2 次提交
    • K
      Check that the default signature type is allowed · cc7c6eb8
      Kurt Roeckx 提交于
      TLS < 1.2 has fixed signature algorithms: MD5+SHA1 for RSA and SHA1 for the
      others. TLS 1.2 sends a list of supported ciphers, but allows not sending
      it in which case SHA1 is used. TLS 1.3 makes sending the list mandatory.
      
      When we didn't receive a list from the client, we always used the
      defaults without checking that they are allowed by the configuration.
      Reviewed-by: NPaul Dale <paul.dale@oracle.com>
      GH: #10784
      (cherry picked from commit b0031e5dc2c8c99a6c04bc7625aa00d3d20a59a5)
      cc7c6eb8
    • K
      Replace apps/server.pem with certificate with a sha256 signature. · 2dbcdb69
      Kurt Roeckx 提交于
      It replaces apps/server.pem that used a sha1 signature with a copy of
      test/certs/servercert.pem that is uses sha256.
      
      This caused the dtlstest to start failing. It's testing connection
      sbetween a dtls client and server. In particular it was checking that if
      we drop a record that the handshake recovers and still completes
      successfully. The test iterates a number of times. The first time
      through it drops the first record. The second time it drops the second
      one, and so on. In order to do this it has a hard-coded value for the
      expected number of records it should see in a handshake. That's ok
      because we completely control both sides of the handshake and know what
      records we expect to see. Small changes in message size would be
      tolerated because that is unlikely to have an impact on the number of
      records. Larger changes in message size however could increase or
      decrease the number of records and hence cause the test to fail.
      
      This particular test uses a mem bio which doesn't have all the CTRLs
      that the dgram BIO has. When we are using a dgram BIO we query that BIO
      to determine the MTU size. The smaller the MTU the more fragmented
      handshakes become. Since the mem BIO doesn't report an MTU we use a
      rather small default value and get quite a lot of records in our
      handshake. This has the tendency to increase the likelihood of the
      number of records changing in the test if the message size changes.
      
      It so happens that the new server certificate is smaller than the old
      one. AFAICT this is probably because the DNs for the Subject and Issuer
      are significantly shorter than previously. The result is that the number
      of records used to transmit the Certificate message is one less than it
      was before. This actually has a knock on impact for subsequent messages
      and how we fragment them resulting in one less ServerKeyExchange record
      too (the actual size of the ServerKeyExchange message hasn't changed,
      but where in that message it gets fragmented has). In total the number
      of records used in the handshake has decreased by 2 with the new
      server.pem file.
      Reviewed-by: NPaul Dale <paul.dale@oracle.com>
      GH: #10784
      (cherry picked from commit 5fd72d96a592c3c4ef28ff11c6ef334a856b0cd1)
      2dbcdb69
  12. 21 1月, 2020 1 次提交
  13. 07 1月, 2020 1 次提交
    • M
      Don't store an HMAC key for longer than we need · 16d92fa8
      Matt Caswell 提交于
      The HMAC_CTX structure stores the original key in case the ctx is reused
      without changing the key.
      
      However, HMAC_Init_ex() checks its parameters such that the only code path
      where the stored key is ever used is in the case where HMAC_Init_ex is
      called with a NULL key and an explicit md is provided which is the same as
      the md that was provided previously. But in that case we can actually reuse
      the pre-digested key that we calculated last time, so we can refactor the
      code not to use the stored key at all.
      
      With that refactor done it is no longer necessary to store the key in the
      ctx at all. This means that long running ctx's will not keep the key in
      memory for any longer than required. Note though that the digested key
      *is* still kept in memory for the duration of the life of the ctx.
      
      Fixes #10743
      Reviewed-by: NPaul Dale <paul.dale@oracle.com>
      Reviewed-by: NTomas Mraz <tmraz@fedoraproject.org>
      (Merged from https://github.com/openssl/openssl/pull/10763)
      16d92fa8
  14. 23 12月, 2019 1 次提交
  15. 16 12月, 2019 1 次提交
  16. 06 12月, 2019 1 次提交
  17. 29 11月, 2019 1 次提交
  18. 20 11月, 2019 1 次提交
  19. 15 11月, 2019 1 次提交
  20. 14 11月, 2019 1 次提交
  21. 13 11月, 2019 1 次提交
  22. 10 11月, 2019 1 次提交
  23. 08 11月, 2019 1 次提交
  24. 02 11月, 2019 1 次提交
  25. 17 10月, 2019 1 次提交
  26. 15 10月, 2019 1 次提交
  27. 28 9月, 2019 3 次提交
    • D
      Fix header file include guard names · fbbfd128
      Dr. Matthias St. Pierre 提交于
      Make the include guards consistent by renaming them systematically according
      to the naming conventions below
      
      The public header files (in the 'include/openssl' directory) are not changed
      in 1.1.1, because it is a stable release.
      
      For the private header files files, the guard names try to match the path
      specified in the include directives, with all letters converted to upper case
      and '/' and '.' replaced by '_'. An extra 'OSSL_' is added as prefix.
      Reviewed-by: NRichard Levitte <levitte@openssl.org>
      (Merged from https://github.com/openssl/openssl/pull/9681)
      fbbfd128
    • D
      Reorganize local header files · b5acbf91
      Dr. Matthias St. Pierre 提交于
      Apart from public and internal header files, there is a third type called
      local header files, which are located next to source files in the source
      directory. Currently, they have different suffixes like
      
        '*_lcl.h', '*_local.h', or '*_int.h'
      
      This commit changes the different suffixes to '*_local.h' uniformly.
      Reviewed-by: NRichard Levitte <levitte@openssl.org>
      (Merged from https://github.com/openssl/openssl/pull/9681)
      b5acbf91
    • D
      Reorganize private crypto header files · 0c994d54
      Dr. Matthias St. Pierre 提交于
      Currently, there are two different directories which contain internal
      header files of libcrypto which are meant to be shared internally:
      
      While header files in 'include/internal' are intended to be shared
      between libcrypto and libssl, the files in 'crypto/include/internal'
      are intended to be shared inside libcrypto only.
      
      To make things complicated, the include search path is set up in such
      a way that the directive #include "internal/file.h" could refer to
      a file in either of these two directoroes. This makes it necessary
      in some cases to add a '_int.h' suffix to some files to resolve this
      ambiguity:
      
        #include "internal/file.h"      # located in 'include/internal'
        #include "internal/file_int.h"  # located in 'crypto/include/internal'
      
      This commit moves the private crypto headers from
      
        'crypto/include/internal'  to  'include/crypto'
      
      As a result, the include directives become unambiguous
      
        #include "internal/file.h"       # located in 'include/internal'
        #include "crypto/file.h"         # located in 'include/crypto'
      
      hence the superfluous '_int.h' suffixes can be stripped.
      
      The files 'store_int.h' and 'store.h' need to be treated specially;
      they are joined into a single file.
      Reviewed-by: NRichard Levitte <levitte@openssl.org>
      (Merged from https://github.com/openssl/openssl/pull/9681)
      0c994d54
  28. 10 9月, 2019 2 次提交
  29. 09 9月, 2019 3 次提交
    • B
      [test] ECC: check the bounds for auto computing cofactor · 73a683b7
      Billy Brumley 提交于
      Reviewed-by: NMatt Caswell <matt@openssl.org>
      Reviewed-by: NNicola Tuveri <nic.tuv@gmail.com>
      (Merged from https://github.com/openssl/openssl/pull/9821)
      
      (cherry picked from commit 1d3cd983f56e0a580ee4216692ee3c9c7bf14de9)
      73a683b7
    • N
      Fix spacing nit in test/ectest.c · 288241b6
      Nicola Tuveri 提交于
      (cherry picked from commit 65936a56461fe09e8c81bca45122af5adcfabb00)
      Reviewed-by: NMatt Caswell <matt@openssl.org>
      Reviewed-by: NBernd Edlinger <bernd.edlinger@hotmail.de>
      (Merged from https://github.com/openssl/openssl/pull/9813)
      288241b6
    • N
      [ec] Match built-in curves on EC_GROUP_new_from_ecparameters · 9a43a733
      Nicola Tuveri 提交于
      Description
      -----------
      
      Upon `EC_GROUP_new_from_ecparameters()` check if the parameters match any
      of the built-in curves. If that is the case, return a new
      `EC_GROUP_new_by_curve_name()` object instead of the explicit parameters
      `EC_GROUP`.
      
      This affects all users of `EC_GROUP_new_from_ecparameters()`:
      - direct calls to `EC_GROUP_new_from_ecparameters()`
      - direct calls to `EC_GROUP_new_from_ecpkparameters()` with an explicit
        parameters argument
      - ASN.1 parsing of explicit parameters keys (as it eventually
        ends up calling `EC_GROUP_new_from_ecpkparameters()`)
      
      A parsed explicit parameter key will still be marked with the
      `OPENSSL_EC_EXPLICIT_CURVE` ASN.1 flag on load, so, unless
      programmatically forced otherwise, if the key is eventually serialized
      the output will still be encoded with explicit parameters, even if
      internally it is treated as a named curve `EC_GROUP`.
      
      Before this change, creating any `EC_GROUP` object using
      `EC_GROUP_new_from_ecparameters()`, yielded an object associated with
      the default generic `EC_METHOD`, but this was never guaranteed in the
      documentation.
      After this commit, users of the library that intentionally want to
      create an `EC_GROUP` object using a specific `EC_METHOD` can still
      explicitly call `EC_GROUP_new(foo_method)` and then manually set the
      curve parameters using `EC_GROUP_set_*()`.
      
      Motivation
      ----------
      
      This has obvious performance benefits for the built-in curves with
      specialized `EC_METHOD`s and subtle but important security benefits:
      - the specialized methods have better security hardening than the
        generic implementations
      - optional fields in the parameter encoding, like the `cofactor`, cannot
        be leveraged by an attacker to force execution of the less secure
        code-paths for single point scalar multiplication
      - in general, this leads to reducing the attack surface
      
      Check the manuscript at https://arxiv.org/abs/1909.01785 for an in depth
      analysis of the issues related to this commit.
      
      It should be noted that `libssl` does not allow to negotiate explicit
      parameters (as per RFC 8422), so it is not directly affected by the
      consequences of using explicit parameters that this commit fixes.
      On the other hand, we detected external applications and users in the
      wild that use explicit parameters by default (and sometimes using 0 as
      the cofactor value, which is technically not a valid value per the
      specification, but is tolerated by parsers for wider compatibility given
      that the field is optional).
      These external users of `libcrypto` are exposed to these vulnerabilities
      and their security will benefit from this commit.
      
      Related commits
      ---------------
      
      While this commit is beneficial for users using built-in curves and
      explicit parameters encoding for serialized keys, commit
      b783beeadf6b80bc431e6f3230b5d5585c87ef87 (and its equivalents for the
      1.0.2, 1.1.0 and 1.1.1 stable branches) fixes the consequences of the
      invalid cofactor values more in general also for other curves
      (CVE-2019-1547).
      
      The following list covers commits in `master` that are related to the
      vulnerabilities presented in the manuscript motivating this commit:
      
      - d2baf88c43 [crypto/rsa] Set the constant-time flag in multi-prime RSA too
      - 311e903d84 [crypto/asn1] Fix multiple SCA vulnerabilities during RSA key validation.
      - b783beeadf [crypto/ec] for ECC parameters with NULL or zero cofactor, compute it
      - 724339ff44 Fix SCA vulnerability when using PVK and MSBLOB key formats
      
      Note that the PRs that contributed the listed commits also include other
      commits providing related testing and documentation, in addition to
      links to PRs and commits backporting the fixes to the 1.0.2, 1.1.0 and
      1.1.1 branches.
      
      This commit includes a partial backport of
      https://github.com/openssl/openssl/pull/8555
      (commit 8402cd5f75f8c2f60d8bd39775b24b03dd8b3b38)
      for which the main author is Shane Lontis.
      
      Responsible Disclosure
      ----------------------
      
      This and the other issues presented in https://arxiv.org/abs/1909.01785
      were reported by Cesar Pereida García, Sohaib ul Hassan, Nicola Tuveri,
      Iaroslav Gridin, Alejandro Cabrera Aldaya and Billy Bob Brumley from the
      NISEC group at Tampere University, FINLAND.
      
      The OpenSSL Security Team evaluated the security risk for this
      vulnerability as low, and encouraged to propose fixes using public Pull
      Requests.
      
      _______________________________________________________________________________
      Co-authored-by: NShane Lontis <shane.lontis@oracle.com>
      
      (Backport from https://github.com/openssl/openssl/pull/9808)
      Reviewed-by: NMatt Caswell <matt@openssl.org>
      (Merged from https://github.com/openssl/openssl/pull/9809)
      9a43a733