1. 30 3月, 2018 1 次提交
  2. 29 3月, 2018 2 次提交
  3. 28 3月, 2018 1 次提交
  4. 22 3月, 2018 1 次提交
  5. 21 3月, 2018 1 次提交
  6. 20 3月, 2018 2 次提交
  7. 19 3月, 2018 1 次提交
  8. 17 3月, 2018 4 次提交
  9. 16 3月, 2018 1 次提交
  10. 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
  11. 07 3月, 2018 1 次提交
  12. 27 2月, 2018 1 次提交
  13. 22 2月, 2018 1 次提交
  14. 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
  15. 14 2月, 2018 4 次提交
  16. 09 2月, 2018 1 次提交
  17. 07 2月, 2018 2 次提交
  18. 06 2月, 2018 3 次提交
  19. 01 2月, 2018 2 次提交
    • B
      Revert the crypto "global lock" implementation · 63ab5ea1
      Benjamin Kaduk 提交于
      Conceptually, this is a squashed version of:
      
          Revert "Address feedback"
      
          This reverts commit 75551e07.
      
      and
      
          Revert "Add CRYPTO_thread_glock_new"
      
          This reverts commit ed6b2c79.
      
      But there were some intervening commits that made neither revert apply
      cleanly, so instead do it all as one shot.
      
      The crypto global locks were an attempt to cope with the awkward
      POSIX semantics for pthread_atfork(); its documentation (the "RATIONALE"
      section) indicates that the expected usage is to have the prefork handler
      lock all "global" locks, and the parent and child handlers release those
      locks, to ensure that forking happens with a consistent (lock) state.
      However, the set of functions available in the child process is limited
      to async-signal-safe functions, and pthread_mutex_unlock() is not on
      the list of async-signal-safe functions!  The only synchronization
      primitives that are async-signal-safe are the semaphore primitives,
      which are not really appropriate for general-purpose usage.
      
      However, the state consistency problem that the global locks were
      attempting to solve is not actually a serious problem, particularly for
      OpenSSL.  That is, we can consider four cases of forking application
      that might use OpenSSL:
      
      (1) Single-threaded, does not call into OpenSSL in the child (e.g.,
      the child calls exec() immediately)
      
      For this class of process, no locking is needed at all, since there is
      only ever a single thread of execution and the only reentrancy is due to
      signal handlers (which are themselves limited to async-signal-safe
      operation and should not be doing much work at all).
      
      (2) Single-threaded, calls into OpenSSL after fork()
      
      The application must ensure that it does not fork() with an unexpected
      lock held (that is, one that would get unlocked in the parent but
      accidentally remain locked in the child and cause deadlock).  Since
      OpenSSL does not expose any of its internal locks to the application
      and the application is single-threaded, the OpenSSL internal locks
      will be unlocked for the fork(), and the state will be consistent.
      (OpenSSL will need to reseed its PRNG in the child, but that is
      an orthogonal issue.)  If the application makes use of locks from
      libcrypto, proper handling for those locks is the responsibility of
      the application, as for any other locking primitive that is available
      for application programming.
      
      (3) Multi-threaded, does not call into OpenSSL after fork()
      
      As for (1), the OpenSSL state is only relevant in the parent, so
      no particular fork()-related handling is needed.  The internal locks
      are relevant, but there is no interaction with the child to consider.
      
      (4) Multi-threaded, calls into OpenSSL after fork()
      
      This is the case where the pthread_atfork() hooks to ensure that all
      global locks are in a known state across fork() would come into play,
      per the above discussion.  However, these "calls into OpenSSL after
      fork()" are still subject to the restriction to async-signal-safe
      functions.  Since OpenSSL uses all sorts of locking and libc functions
      that are not on the list of safe functions (e.g., malloc()), this
      case is not currently usable and is unlikely to ever be usable,
      independently of the locking situation.  So, there is no need to
      go through contortions to attempt to support this case in the one small
      area of locking interaction with fork().
      
      In light of the above analysis (thanks @davidben and @achernya), go
      back to the simpler implementation that does not need to distinguish
      "library-global" locks or to have complicated atfork handling for locks.
      Reviewed-by: NKurt Roeckx <kurt@roeckx.be>
      Reviewed-by: NMatthias St. Pierre <Matthias.St.Pierre@ncp-e.com>
      (Merged from https://github.com/openssl/openssl/pull/5089)
      63ab5ea1
    • D
      crypto/rand/rand_lib.c: fix undefined reference to `clock_gettime' · 2e230e86
      Dr. Matthias St. Pierre 提交于
      Some older glibc versions require the `-lrt` linker option for
      resolving the reference to `clock_gettime'. Since it is not desired
      to add new library dependencies in version 1.1.1, the call to
      clock_gettime() is replaced by a call to gettimeofday() for the
      moment. It will be added back in version 1.2.
      Signed-off-by: NDr. Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>
      Reviewed-by: NRichard Levitte <levitte@openssl.org>
      Reviewed-by: NPaul Dale <paul.dale@oracle.com>
      (Merged from https://github.com/openssl/openssl/pull/5199)
      2e230e86
  20. 29 1月, 2018 1 次提交
  21. 19 1月, 2018 1 次提交
  22. 16 1月, 2018 1 次提交
  23. 09 1月, 2018 1 次提交
  24. 04 1月, 2018 2 次提交
    • D
      crypto/rand: restore the generic DRBG implementation · 8212d505
      Dr. Matthias St. Pierre 提交于
      The DRGB concept described in NIST SP 800-90A provides for having different
      algorithms to generate random output. In fact, the FIPS object module used to
      implement three of them, CTR DRBG, HASH DRBG and HMAC DRBG.
      
      When the FIPS code was ported to master in #4019, two of the three algorithms
      were dropped, and together with those the entire code that made RAND_DRBG
      generic was removed, since only one concrete implementation was left.
      
      This commit restores the original generic implementation of the DRBG, making it
      possible again to add additional implementations using different algorithms
      (like RAND_DRBG_CHACHA20) in the future.
      Reviewed-by: NPaul Dale <paul.dale@oracle.com>
      Reviewed-by: NTim Hudson <tjh@openssl.org>
      (Merged from https://github.com/openssl/openssl/pull/4998)
      8212d505
    • D
      crypto/rand: rename drbg_rand.c to drbg_ctr.c · 4e585e72
      Dr. Matthias St. Pierre 提交于
      The generic part of the FIPS DRBG was implemented in fips_drbg_lib.c and the
      algorithm specific parts in fips_drbg_<alg>.c for <alg> in {ctr, hash, hmac}.
      Additionally, there was the module fips_drbg_rand.c which contained 'gluing'
      code between the RAND_METHOD api and the FIPS DRBG.
      
      When the FIPS code was ported to master in #4019, for some reason the ctr-drbg
      implementation from fips_drbg_ctr.c ended up in drbg_rand.c instead of drbg_ctr.c.
      
      This commit renames the module drbg_rand.c back to drbg_ctr.c, thereby restoring
      a simple relationship between the original fips modules and the drbg modules
      in master:
      
       fips_drbg_lib.c    =>  drbg_lib.c    /* generic part of implementation */
       fips_drbg_<alg>.c  =>  drbg_<alg>.c  /* algorithm specific implementations */
      Reviewed-by: NPaul Dale <paul.dale@oracle.com>
      Reviewed-by: NTim Hudson <tjh@openssl.org>
      (Merged from https://github.com/openssl/openssl/pull/4998)
      4e585e72
  25. 18 12月, 2017 3 次提交