1. 16 10月, 2019 1 次提交
    • R
      Add EVP_PKEY_CTX_new_provided() · a07c17ef
      Richard Levitte 提交于
      This works as much as possible EVP_PKEY_CTX_new_id(), except it takes
      data that's relevant for providers, algorithm name and property query
      string instead of NID and engine.
      
      Additionally, if EVP_PKEY_CTX_new() or EVP_PKEY_CTX_new_id() was
      called, the algorithm name in the EVP_PKEY context will be set to the
      short name of the given NID (explicit or the one of the given
      EVP_PKEY), thereby giving an easier transition from legacy methods to
      provided methods.
      
      The intent is that operations will use this information to fetch
      provider methods implicitly as needed.
      Reviewed-by: NTomas Mraz <tmraz@fedoraproject.org>
      (Merged from https://github.com/openssl/openssl/pull/10184)
      a07c17ef
  2. 06 10月, 2019 1 次提交
  3. 03 10月, 2019 2 次提交
  4. 25 9月, 2019 1 次提交
  5. 17 9月, 2019 1 次提交
  6. 13 9月, 2019 1 次提交
  7. 12 9月, 2019 2 次提交
  8. 10 9月, 2019 1 次提交
    • B
      Fix a padding oracle in PKCS7_dataDecode and CMS_decrypt_set1_pkey · 5840ed0c
      Bernd Edlinger 提交于
      An attack is simple, if the first CMS_recipientInfo is valid but the
      second CMS_recipientInfo is chosen ciphertext. If the second
      recipientInfo decodes to PKCS #1 v1.5 form plaintext, the correct
      encryption key will be replaced by garbage, and the message cannot be
      decoded, but if the RSA decryption fails, the correct encryption key is
      used and the recipient will not notice the attack.
      
      As a work around for this potential attack the length of the decrypted
      key must be equal to the cipher default key length, in case the
      certifiate is not given and all recipientInfo are tried out.
      
      The old behaviour can be re-enabled in the CMS code by setting the
      CMS_DEBUG_DECRYPT flag.
      Reviewed-by: NMatt Caswell <matt@openssl.org>
      (Merged from https://github.com/openssl/openssl/pull/9777)
      5840ed0c
  9. 09 9月, 2019 1 次提交
    • N
      [ec] Match built-in curves on EC_GROUP_new_from_ecparameters · bacaa618
      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
      b783beea (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:
      
      - d2baf88c [crypto/rsa] Set the constant-time flag in multi-prime RSA too
      - 311e903d [crypto/asn1] Fix multiple SCA vulnerabilities during RSA key validation.
      - b783beea [crypto/ec] for ECC parameters with NULL or zero cofactor, compute it
      - 724339ff 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.
      
      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.
      
      _______________________________________________________________________________
      Reviewed-by: NMatt Caswell <matt@openssl.org>
      Reviewed-by: NPaul Dale <paul.dale@oracle.com>
      (Merged from https://github.com/openssl/openssl/pull/9808)
      bacaa618
  10. 07 9月, 2019 1 次提交
  11. 30 8月, 2019 1 次提交
  12. 20 8月, 2019 1 次提交
    • P
      Start up DEVRANDOM entropy improvement for older Linux devices. · 3a577750
      Pauli 提交于
      Improve handling of low entropy at start up from /dev/urandom by waiting for
      a read(2) call on /dev/random to succeed.  Once one such call has succeeded,
      a shared memory segment is created and persisted as an indicator to other
      processes that /dev/urandom is properly seeded.
      
      This does not fully prevent against attacks weakening the entropy source.
      An attacker who has control of the machine early in its boot sequence
      could create the shared memory segment preventing detection of low entropy
      conditions.  However, this is no worse than the current situation.
      
      An attacker would also be capable of removing the shared memory segment
      and causing seeding to reoccur resulting in a denial of service attack.
      This is partially mitigated by keeping the shared memory alive for the
      duration of the process's existence.  Thus, an attacker would not only need
      to have called call shmctl(2) with the IPC_RMID command but the system
      must subsequently enter a state where no instances of libcrypto exist in
      any process.  Even one long running process will prevent this attack.
      
      The System V shared memory calls used here go back at least as far as
      Linux kernel 2.0.  Linux kernels 4.8 and later, don't have a reliable way
      to detect that /dev/urandom has been properly seeded, so a failure is raised
      for this case (i.e. the getentropy(2) call has already failed).
      Reviewed-by: NBernd Edlinger <bernd.edlinger@hotmail.de>
      (Merged from https://github.com/openssl/openssl/pull/9595)
      3a577750
  13. 09 8月, 2019 1 次提交
  14. 06 8月, 2019 1 次提交
  15. 02 8月, 2019 1 次提交
  16. 01 8月, 2019 1 次提交
  17. 31 7月, 2019 1 次提交
  18. 27 7月, 2019 1 次提交
  19. 24 7月, 2019 1 次提交
  20. 23 7月, 2019 2 次提交
  21. 22 7月, 2019 2 次提交
  22. 17 7月, 2019 1 次提交
  23. 16 7月, 2019 2 次提交
  24. 02 7月, 2019 4 次提交
  25. 01 7月, 2019 2 次提交
  26. 28 6月, 2019 1 次提交
  27. 12 6月, 2019 1 次提交
  28. 11 6月, 2019 2 次提交
  29. 10 6月, 2019 1 次提交
  30. 29 5月, 2019 1 次提交