1. 30 3月, 2018 1 次提交
  2. 17 3月, 2018 2 次提交
  3. 16 3月, 2018 1 次提交
  4. 10 3月, 2018 1 次提交
    • D
      RAND_DRBG: add a function for setting the reseeding defaults · 4917e911
      Dr. Matthias St. Pierre 提交于
      The introduction of thread local public and private DRBG instances (#5547)
      makes it very cumbersome to change the reseeding (time) intervals for
      those instances. This commit provides a function to set the default
      values for all subsequently created DRBG instances.
      
       int RAND_DRBG_set_reseed_defaults(
                                         unsigned int master_reseed_interval,
                                         unsigned int slave_reseed_interval,
                                         time_t master_reseed_time_interval,
                                         time_t slave_reseed_time_interval
                                         );
      
      The function is intended only to be used during application initialization,
      before any threads are created and before any random bytes are generated.
      Reviewed-by: NRich Salz <rsalz@openssl.org>
      (Merged from https://github.com/openssl/openssl/pull/5576)
      4917e911
  5. 22 2月, 2018 1 次提交
  6. 15 2月, 2018 1 次提交
    • D
      DRBG: make locking api truly private · 812b1537
      Dr. Matthias St. Pierre 提交于
      In PR #5295 it was decided that the locking api should remain private
      and used only inside libcrypto. However, the locking functions were added
      back to `libcrypto.num` by `mkdef.pl`, because the function prototypes
      were still listed in `internal/rand.h`. (This header contains functions
      which are internal, but shared between libcrypto and libssl.)
      
      This commit moves the prototypes to `rand_lcl.h` and changes the names
      to lowercase, following the convention therein. It also corrects an
      outdated documenting comment.
      Reviewed-by: NRichard Levitte <levitte@openssl.org>
      (Merged from https://github.com/openssl/openssl/pull/5375)
      812b1537
  7. 14 2月, 2018 3 次提交
    • D
      DRBG: make the derivation function the default for ctr_drbg · 8164d91d
      Dr. Matthias St. Pierre 提交于
      The NIST standard presents two alternative ways for seeding the
      CTR DRBG, depending on whether a derivation function is used or not.
      In Section 10.2.1 of NIST SP800-90Ar1 the following is assessed:
      
        The use of the derivation function is optional if either an
        approved RBG or an entropy source provides full entropy output
        when entropy input is requested by the DRBG mechanism.
        Otherwise, the derivation function shall be used.
      
      Since the OpenSSL DRBG supports being reseeded from low entropy random
      sources (using RAND_POOL), the use of a derivation function is mandatory.
      For that reason we change the default and replace the opt-in flag
      RAND_DRBG_FLAG_CTR_USE_DF with an opt-out flag RAND_DRBG_FLAG_CTR_NO_DF.
      This change simplifies the RAND_DRBG_new() calls.
      Reviewed-by: NRich Salz <rsalz@openssl.org>
      (Merged from https://github.com/openssl/openssl/pull/5294)
      8164d91d
    • D
      DRBG: unify initialization and cleanup code · 4f9dabbf
      Dr. Matthias St. Pierre 提交于
      The functions drbg_setup() and drbg_cleanup() used to duplicate a lot of
      code from RAND_DRBG_new() and RAND_DRBG_free(). This duplication has been
      removed, which simplifies drbg_setup() and makes drbg_cleanup() obsolete.
      Reviewed-by: NRich Salz <rsalz@openssl.org>
      (Merged from https://github.com/openssl/openssl/pull/5294)
      4f9dabbf
    • D
      DRBG: add locking api · 3ce1c27b
      Dr. Matthias St. Pierre 提交于
      This commit adds three new accessors to the internal DRBG lock
      
         int RAND_DRBG_lock(RAND_DRBG *drbg)
         int RAND_DRBG_unlock(RAND_DRBG *drbg)
         int RAND_DRBG_enable_locking(RAND_DRBG *drbg)
      
      The three shared DRBGs are intended to be used concurrently, so they
      have locking enabled by default. It is the callers responsibility to
      guard access to the shared DRBGs by calls to RAND_DRBG_lock() and
      RAND_DRBG_unlock().
      
      All other DRBG instances don't have locking enabled by default, because
      they are intendended to be used by a single thread. If it is desired,
      locking can be enabled by using RAND_DRBG_enable_locking().
      Reviewed-by: NRich Salz <rsalz@openssl.org>
      (Merged from https://github.com/openssl/openssl/pull/5294)
      3ce1c27b
  8. 13 2月, 2018 1 次提交
  9. 29 1月, 2018 1 次提交
  10. 18 12月, 2017 2 次提交
  11. 18 10月, 2017 1 次提交
    • D
      Fix reseeding issues of the public RAND_DRBG · c16de9d8
      Dr. Matthias St. Pierre 提交于
      Reseeding is handled very differently by the classic RAND_METHOD API
      and the new RAND_DRBG api. These differences led to some problems when
      the new RAND_DRBG was made the default OpenSSL RNG. In particular,
      RAND_add() did not work as expected anymore. These issues are discussed
      on the thread '[openssl-dev] Plea for a new public OpenSSL RNG API'
      and in Pull Request #4328. This commit fixes the mentioned issues,
      introducing the following changes:
      
      - Replace the fixed size RAND_BYTES_BUFFER by a new RAND_POOL API which
        facilitates collecting entropy by the get_entropy() callback.
      - Don't use RAND_poll()/RAND_add() for collecting entropy from the
        get_entropy() callback anymore. Instead, replace RAND_poll() by
        RAND_POOL_acquire_entropy().
      - Add a new function rand_drbg_restart() which tries to get the DRBG
        in an instantiated state by all means, regardless of the current
        state (uninstantiated, error, ...) the DRBG is in. If the caller
        provides entropy or additional input, it will be used for reseeding.
      - Restore the original documented behaviour of RAND_add() and RAND_poll()
        (namely to reseed the DRBG immediately) by a new implementation based
        on rand_drbg_restart().
      - Add automatic error recovery from temporary failures of the entropy
        source to RAND_DRBG_generate() using the rand_drbg_restart() function.
      Reviewed-by: NPaul Dale <paul.dale@oracle.com>
      Reviewed-by: NKurt Roeckx <kurt@roeckx.be>
      Reviewed-by: NRich Salz <rsalz@openssl.org>
      Reviewed-by: NBen Kaduk <kaduk@mit.edu>
      (Merged from https://github.com/openssl/openssl/pull/4328)
      c16de9d8
  12. 29 8月, 2017 1 次提交
  13. 28 8月, 2017 1 次提交
  14. 03 8月, 2017 2 次提交
    • R
      Add a DRBG to each SSL object · ae3947de
      Rich Salz 提交于
      Give each SSL object it's own DRBG, chained to the parent global
      DRBG which is used only as a source of randomness into the per-SSL
      DRBG.  This is used for all session, ticket, and pre-master secret keys.
      It is NOT used for ECDH key generation which use only the global
      DRBG. (Doing that without changing the API is tricky, if not impossible.)
      Reviewed-by: NPaul Dale <paul.dale@oracle.com>
      (Merged from https://github.com/openssl/openssl/pull/4050)
      ae3947de
    • R
      Switch from ossl_rand to DRBG rand · 75e2c877
      Rich Salz 提交于
      If RAND_add wraps around, XOR with existing. Add test to drbgtest that
      does the wrap-around.
      
      Re-order seeding and stop after first success.
      
      Add RAND_poll_ex()
      
      Use the DF and therefore lower RANDOMNESS_NEEDED.  Also, for child DRBG's,
      mix in the address as the personalization bits.
      
      Centralize the entropy callbacks, from drbg_lib to rand_lib.
      (Conceptually, entropy is part of the enclosing application.)
      Thanks to Dr. Matthias St Pierre for the suggestion.
      
      Various code cleanups:
          -Make state an enum; inline RANDerr calls.
          -Add RAND_POLL_RETRIES (thanks Pauli for the idea)
          -Remove most RAND_seed calls from rest of library
          -Rename DRBG_CTX to RAND_DRBG, etc.
          -Move some code from drbg_lib to drbg_rand; drbg_lib is now only the
           implementation of NIST DRBG.
          -Remove blocklength
      Reviewed-by: NPaul Dale <paul.dale@oracle.com>
      (Merged from https://github.com/openssl/openssl/pull/4019)
      75e2c877
  15. 21 7月, 2017 1 次提交
  16. 20 7月, 2017 1 次提交
  17. 19 7月, 2017 1 次提交