Skip to content
  1. Jan 09, 2018
  2. Jan 08, 2018
  3. Jan 07, 2018
  4. Jan 06, 2018
  5. Jan 04, 2018
  6. Jan 02, 2018
  7. Dec 28, 2017
    • Andy Polyakov's avatar
      ec/curve25519.c: "double" ecdhx25519 performance on 64-bit platforms. · cfc32a1e
      Andy Polyakov authored
      
      
      "Double" is in quotes because improvement coefficient varies
      significantly depending on platform and compiler. You're likely
      to measure ~2x improvement on popular desktop and server processors,
      but not so much on mobile ones, even minor regression on ARM
      Cortex series. Latter is because they have rather "weak" umulh
      instruction. On low-end x86_64 problem is that contemporary gcc
      and clang tend to opt for double-precision shift for >>51, which
      can be devastatingly slow on some processors.
      
      Just in case for reference, trick is to use 2^51 radix [currently
      only for DH].
      
      Reviewed-by: default avatarRich Salz <rsalz@openssl.org>
      cfc32a1e
  8. Dec 27, 2017
  9. Dec 23, 2017
  10. Dec 22, 2017
  11. Dec 18, 2017
  12. Dec 17, 2017
  13. Dec 15, 2017
  14. Dec 14, 2017
  15. Dec 13, 2017
  16. Dec 12, 2017
    • Ben Kaduk's avatar
      Fix more OCSP_resp_get0_signer() nits · eb48052e
      Ben Kaduk authored
      
      
      Fix a typo for "retrieve" and some indentation.
      
      Reviewed-by: default avatarKurt Roeckx <kurt@roeckx.be>
      (Merged from https://github.com/openssl/openssl/pull/4919)
      eb48052e
    • Patrick Steuer's avatar
    • Richard Levitte's avatar
      Fix leak in ERR_get_state() when OPENSSL_init_crypto() isn't called yet · aef84bb4
      Richard Levitte authored
      
      
      If OPENSSL_init_crypto() hasn't been called yet when ERR_get_state()
      is called, it need to be called early, so the base initialization is
      done.  On some platforms (those who support DSO functionality and
      don't define OPENSSL_USE_NODELETE), that includes a call of
      ERR_set_mark(), which calls this function again.
      Furthermore, we know that ossl_init_thread_start(), which is called
      later in ERR_get_state(), calls OPENSSL_init_crypto(0, NULL), except
      that's too late.
      Here's what happens without an early call of OPENSSL_init_crypto():
      
          => ERR_get_state():
               => CRYPTO_THREAD_get_local():
               <= NULL;
               # no state is found, so it gets allocated.
               => ossl_init_thread_start():
                    => OPENSSL_init_crypto():
                         # Here, base_inited is set to 1
                         # before ERR_set_mark() call
                         => ERR_set_mark():
                              => ERR_get_state():
                                   => CRYPTO_THREAD_get_local():
                                   <= NULL;
                                   # no state is found, so it gets allocated!!!!!
                                   => ossl_init_thread_start():
                                        => OPENSSL_init_crypto():
                                             # base_inited is 1,
                                             # so no more init to be done
                                        <= 1
                                   <=
                                   => CRYPTO_thread_set_local():
                                   <=
                              <=
                         <=
                    <= 1
               <=
               => CRYPTO_thread_set_local()      # previous value removed!
          <=
      
      Result: double allocation, and we have a leak.
      
      By calling the base OPENSSL_init_crypto() early, we get this instead:
      
          => ERR_get_state():
               => OPENSSL_init_crypto():
                    # Here, base_inited is set to 1
                    # before ERR_set_mark() call
                    => ERR_set_mark():
                         => ERR_get_state():
                              => OPENSSL_init_crypto():
                                   # base_inited is 1,
                                   # so no more init to be done
                              <= 1
                              => CRYPTO_THREAD_get_local():
                              <= NULL;
                              # no state is found, so it gets allocated
                              # let's assume we got 0xDEADBEEF
                              => ossl_init_thread_start():
                                   => OPENSSL_init_crypto():
                                        # base_inited is 1,
                                        # so no more init to be done
                                   <= 1
                              <= 1
                              => CRYPTO_thread_set_local():
                              <=
                         <=
                    <=
               <= 1
               => CRYPTO_THREAD_get_local():
               <= 0xDEADBEEF
          <= 0xDEADBEEF
      
      Result: no leak.
      
      Reviewed-by: default avatarRich Salz <rsalz@openssl.org>
      (Merged from https://github.com/openssl/openssl/pull/4913)
      aef84bb4