1. 24 10月, 2017 1 次提交
    • M
      Don't make any changes to the lhash structure if we are going to fail · 4ce8bebc
      Matt Caswell 提交于
      The lhash expand() function can fail if realloc fails. The previous
      implementation made changes to the structure and then attempted to do a
      realloc. If the realloc failed then it attempted to undo the changes it
      had just made. Unfortunately changes to lh->p were not undone correctly,
      ultimately causing subsequent expand() calls to increment num_nodes to a
      value higher than num_alloc_nodes, which can cause out-of-bounds reads/
      writes. This is not considered a security issue because an attacker cannot
      cause realloc to fail.
      
      This commit moves the realloc call to near the beginning of the function
      before any other changes are made to the lhash structure. That way if a
      failure occurs we can immediately fail without having to undo anything.
      
      Thanks to Pavel Kopyl (Samsung) for reporting this issue.
      Reviewed-by: NBernd Edlinger <bernd.edlinger@hotmail.de>
      Reviewed-by: NViktor Dukhovni <viktor@openssl.org>
      (Merged from https://github.com/openssl/openssl/pull/4550)
      4ce8bebc
  2. 09 10月, 2017 1 次提交
  3. 13 7月, 2017 1 次提交
  4. 07 6月, 2017 1 次提交
  5. 01 3月, 2017 1 次提交
  6. 21 9月, 2016 1 次提交
  7. 01 7月, 2016 2 次提交
  8. 20 5月, 2016 1 次提交
    • R
      Rename lh_xxx,sk_xxx tp OPENSSL_{LH,SK}_xxx · 739a1eb1
      Rich Salz 提交于
      Rename sk_xxx to OPENSSL_sk_xxx and _STACK to OPENSSL_STACK
      Rename lh_xxx API to OPENSSL_LH_xxx and LHASH_NODE to OPENSSL_LH_NODE
      Make lhash stuff opaque.
      Use typedefs for function pointers; makes the code simpler.
      Remove CHECKED_xxx macros.
      Add documentation; remove old X509-oriented doc.
      Add API-compat names for entire old API
      Reviewed-by: NDr. Stephen Henson <steve@openssl.org>
      739a1eb1
  9. 18 5月, 2016 1 次提交
  10. 27 1月, 2016 1 次提交
    • R
      Remove /* foo.c */ comments · 34980760
      Rich Salz 提交于
      This was done by the following
              find . -name '*.[ch]' | /tmp/pl
      where /tmp/pl is the following three-line script:
              print unless $. == 1 && m@/\* .*\.[ch] \*/@;
              close ARGV if eof; # Close file to reset $.
      
      And then some hand-editing of other files.
      Reviewed-by: NViktor Dukhovni <viktor@openssl.org>
      34980760
  11. 12 1月, 2016 1 次提交
    • D
      Inline LHASH_OF · e6b5c341
      Dr. Stephen Henson 提交于
      Make LHASH_OF use static inline functions.
      
      Add new lh_get_down_load and lh_set_down_load functions and their
      typesafe inline equivalents.
      
      Make lh_error a function instead of a macro.
      Reviewed-by: NRich Salz <rsalz@openssl.org>
      e6b5c341
  12. 04 9月, 2015 1 次提交
  13. 11 8月, 2015 1 次提交
  14. 05 5月, 2015 1 次提交
    • R
      Use safer sizeof variant in malloc · b4faea50
      Rich Salz 提交于
      For a local variable:
              TYPE *p;
      Allocations like this are "risky":
              p = OPENSSL_malloc(sizeof(TYPE));
      if the type of p changes, and the malloc call isn't updated, you
      could get memory corruption.  Instead do this:
              p = OPENSSL_malloc(sizeof(*p));
      Also fixed a few memset() calls that I noticed while doing this.
      Reviewed-by: NRichard Levitte <levitte@openssl.org>
      b4faea50
  15. 29 4月, 2015 1 次提交
  16. 27 1月, 2015 1 次提交
    • R
      OPENSSL_NO_xxx cleanup: many removals · a00ae6c4
      Rich Salz 提交于
      The following compile options (#ifdef's) are removed:
          OPENSSL_NO_BIO OPENSSL_NO_BUFFER OPENSSL_NO_CHAIN_VERIFY
          OPENSSL_NO_EVP OPENSSL_NO_FIPS_ERR OPENSSL_NO_HASH_COMP
          OPENSSL_NO_LHASH OPENSSL_NO_OBJECT OPENSSL_NO_SPEED OPENSSL_NO_STACK
          OPENSSL_NO_X509 OPENSSL_NO_X509_VERIFY
      
      This diff is big because of updating the indents on preprocessor lines.
      Reviewed-by: NRichard Levitte <levitte@openssl.org>
      a00ae6c4
  17. 22 1月, 2015 3 次提交
  18. 31 12月, 2014 1 次提交
  19. 09 12月, 2009 2 次提交
  20. 26 5月, 2008 1 次提交
  21. 21 1月, 2007 1 次提交
  22. 09 7月, 2006 1 次提交
  23. 05 4月, 2005 1 次提交
  24. 31 3月, 2005 1 次提交
  25. 29 10月, 2003 1 次提交
  26. 08 7月, 2001 1 次提交
  27. 20 2月, 2001 2 次提交
    • R
      Use 0 instead of NULL, at least for function casts, since there are · 5af18f65
      Richard Levitte 提交于
      variants of stdio.h that define NULL in such a way that it's "unsafe"
      to use for function pointer casting.
      5af18f65
    • R
      Make all configuration macros available for application by making · cf1b7d96
      Richard Levitte 提交于
      sure they are available in opensslconf.h, by giving them names starting
      with "OPENSSL_" to avoid conflicts with other packages and by making
      sure e_os2.h will cover all platform-specific cases together with
      opensslconf.h.
      
      I've checked fairly well that nothing breaks with this (apart from
      external software that will adapt if they have used something like
      NO_KRB5), but I can't guarantee it completely, so a review of this
      change would be a good thing.
      cf1b7d96
  28. 09 1月, 2001 1 次提交
    • G
      This adds macros to implement (and/or declare) type-safe wrapper functions · 18602745
      Geoff Thorpe 提交于
      around the callbacks required in the LHASH code for the "doall" functions.
      
      Also - fix the evil function pointer casting in the two lh_doall functions
      by deferring to a static utility function. Previously lh_doall() was
      invoking lh_doall_arg() by casting the callback to the 2-parameter
      prototype and passing in a NULL argument. This appears to have been working
      thus far but it's not a hot idea. If the extra level of indirection becomes
      a performance hit, we can just provide two virtually identical
      implementations for each variant later on.
      18602745
  29. 14 12月, 2000 1 次提交
  30. 02 12月, 2000 1 次提交
    • G
      First step in tidying up the LHASH code. The callback prototypes (and · 385d8138
      Geoff Thorpe 提交于
      casts) used in the lhash code are about as horrible and evil as they can
      be. For starters, the callback prototypes contain empty parameter lists.
      Yuck.
      
      This first change defines clearer prototypes - including "typedef"'d
      function pointer types to use as "hash" and "compare" callbacks, as well as
      the callbacks passed to the lh_doall and lh_doall_arg iteration functions.
      Now at least more explicit (and clear) casting is required in all of the
      dependant code - and that should be included in this commit.
      
      The next step will be to hunt down and obliterate some of the function
      pointer casting being used when it's not necessary - a particularly evil
      variant exists in the implementation of lh_doall.
      385d8138
  31. 08 11月, 2000 1 次提交
  32. 02 6月, 2000 1 次提交
    • R
      There have been a number of complaints from a number of sources that names · 26a3a48d
      Richard Levitte 提交于
      like Malloc, Realloc and especially Free conflict with already existing names
      on some operating systems or other packages.  That is reason enough to change
      the names of the OpenSSL memory allocation macros to something that has a
      better chance of being unique, like prepending them with OPENSSL_.
      
      This change includes all the name changes needed throughout all C files.
      26a3a48d
  33. 18 3月, 2000 1 次提交
  34. 04 3月, 2000 1 次提交
  35. 04 2月, 2000 1 次提交