1. 23 Oct, 2017 2 commits
  2. 03 Jul, 2017 1 commit
    • Make sure to always include "common.h" first · 0c7f49dd
      Next to including several files, our "common.h" header also declares
      various macros which are then used throughout the project. As such, we
      have to make sure to always include this file first in all
      implementation files. Otherwise, we might encounter problems or even
      silent behavioural differences due to macros or defines not being
      defined as they should be. So in fact, our header and implementation
      files should make sure to always include "common.h" first.
      
      This commit does so by establishing a common include pattern. Header
      files inside of "src" will now always include "common.h" as its first
      other file, separated by a newline from all the other includes to make
      it stand out as special. There are two cases for the implementation
      files. If they do have a matching header file, they will always include
      this one first, leading to "common.h" being transitively included as
      first file. If they do not have a matching header file, they instead
      include "common.h" as first file themselves.
      
      This fixes the outlined problems and will become our standard practice
      for header and source files inside of the "src/" from now on.
      Patrick Steinhardt committed
  3. 07 Jun, 2017 1 commit
    • openssl_stream: fix building with libressl · f28744a5
      OpenSSL v1.1 has introduced a new way of initializing the library
      without having to call various functions of different subsystems. In
      libgit2, we have been adapting to that change with 88520151
      (openssl_stream: use new initialization function on OpenSSL version
      >=1.1, 2017-04-07), where we added an #ifdef depending on the OpenSSL
      version. This change broke building with libressl, though, which has not
      changed its API in the same way.
      
      Fix the issue by expanding the #ifdef condition to use the old way of
      initializing with libressl.
      
      Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
      Marc-Antoine Perennou committed
  4. 10 Apr, 2017 2 commits
    • openssl_stream: use new initialization function on OpenSSL version >=1.1 · 88520151
      Previous to OpenSSL version 1.1, the user had to initialize at least the error
      strings as well as the SSL algorithms by himself. OpenSSL version 1.1 instead
      provides a new function `OPENSSL_init_ssl`, which handles initialization of all
      subsystems. As the new API call will by default load error strings and
      initialize the SSL algorithms, we can safely replace these calls when compiling
      against version 1.1 or later.
      
      This fixes a compiler error when compiling against OpenSSL version 1.1 which has
      been built without stubs for deprecated syntax.
      Patrick Steinhardt committed
    • openssl_stream: remove locking initialization on OpenSSL version >=1.1 · 29081c2f
      Up to version 1.0, OpenSSL required us to provide a callback which implements
      a locking mechanism. Due to problems in the API design though this mechanism was
      inherently broken, especially regarding that the locking callback cannot report
      errors in an obvious way. Due to this shortcoming, the locking initialization
      has been completely removed in OpenSSL version 1.1. As the library has also been
      refactored to not make any use of these callback functions, we can safely remove
      all initialization of the locking subsystem if compiling against OpenSSL version
      1.1 or higher.
      
      This fixes a compilation error when compiling against OpenSSL version 1.1 which
      has been built without stubs for deprecated syntax.
      Patrick Steinhardt committed
  5. 20 Mar, 2017 1 commit
    • openssl_stream: fix releasing OpenSSL locks · dd0b1e8c
      The OpenSSL library may require multiple locks to work correctly, where
      it is the caller's responsibility to initialize and release the locks.
      While we correctly initialized up to `n` locks, as determined by
      `CRYPTO_num_locks`, we were repeatedly freeing the same mutex in our
      shutdown procedure.
      
      Fix the issue by freeing locks at the correct index.
      Patrick Steinhardt committed
  6. 29 Dec, 2016 1 commit
  7. 02 Nov, 2016 2 commits
  8. 31 Oct, 2016 1 commit
  9. 12 Oct, 2016 1 commit
  10. 27 Apr, 2016 1 commit
  11. 26 Apr, 2016 1 commit
  12. 19 Apr, 2016 1 commit
  13. 14 Mar, 2016 1 commit
  14. 24 Feb, 2016 2 commits
  15. 23 Feb, 2016 2 commits
  16. 19 Feb, 2016 2 commits
  17. 09 Feb, 2016 1 commit
  18. 30 Sep, 2015 1 commit
  19. 10 Jul, 2015 1 commit
  20. 07 Jul, 2015 1 commit
    • Fix undefined reference with old versions of openssl · febc8c46
      Versions prior to 0.9.8f  did not have this function, rhel/centos5 are still on a
      heavily backported version of 0.9.8e and theoretically supported until March 2017
      
      Without this ifdef, I get the following link failure:
      ```
      CMakeFiles/libgit2_clar.dir/src/openssl_stream.c.o: In function `openssl_connect':
      openssl_stream.c:(.text+0x45a): undefined reference to `SSL_set_tlsext_host_name'
      collect2: error: ld returned 1 exit status
      make[6]: *** [libgit2_clar] Error 1
      ```
      Tony Kelman committed
  21. 29 Jun, 2015 1 commit
  22. 26 Jun, 2015 1 commit
  23. 24 Jun, 2015 2 commits
  24. 21 May, 2015 1 commit
  25. 20 May, 2015 1 commit
  26. 09 May, 2015 1 commit
  27. 23 Apr, 2015 2 commits
  28. 02 Mar, 2015 2 commits
  29. 24 Jan, 2015 1 commit
    • openssl: Add all required includes for AF_INET6 and in6_addr. · 3cda6be7
      This fixes the build at least on FreeBSD, where those types were not
      defined indirectly:
      
      src/openssl_stream.c:100:18: error: variable has incomplete type 'struct in6_addr'
              struct in6_addr addr6;
                              ^
      src/openssl_stream.c:100:9: note: forward declaration of 'struct in6_addr'
              struct in6_addr addr6;
                     ^
      src/openssl_stream.c:111:18: error: use of undeclared identifier 'AF_INET'
              if (p_inet_pton(AF_INET, host, &addr4)) {
                              ^
      src/unix/posix.h:31:40: note: expanded from macro 'p_inet_pton'
                                             ^
      src/openssl_stream.c:115:18: error: use of undeclared identifier 'AF_INET6'
                      if(p_inet_pton(AF_INET6, host, &addr6)) {
                                     ^
      src/unix/posix.h:31:40: note: expanded from macro 'p_inet_pton'
                                             ^
      Raphael Kubo da Costa committed
  30. 10 Dec, 2014 2 commits