diff options
-rw-r--r-- | CMakeLists.txt | 2 | ||||
-rw-r--r-- | deps/ntlmclient/compat.h | 34 | ||||
-rw-r--r-- | deps/ntlmclient/crypt_openssl.c | 2 | ||||
-rw-r--r-- | deps/ntlmclient/ntlm.c | 10 | ||||
-rw-r--r-- | deps/ntlmclient/util.c | 16 | ||||
-rw-r--r-- | deps/ntlmclient/util.h | 3 | ||||
-rw-r--r-- | docs/changelog.md | 89 | ||||
-rw-r--r-- | include/git2/version.h | 6 | ||||
-rw-r--r-- | package.json | 2 | ||||
-rw-r--r-- | src/thread-utils.h | 5 |
10 files changed, 122 insertions, 47 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index e745351b4..b6f23cf6b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,7 +13,7 @@ CMAKE_MINIMUM_REQUIRED(VERSION 3.5.1) -project(libgit2 VERSION "1.0.1" LANGUAGES C) +project(libgit2 VERSION "1.1.0" LANGUAGES C) # Add find modules to the path set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${libgit2_SOURCE_DIR}/cmake/") diff --git a/deps/ntlmclient/compat.h b/deps/ntlmclient/compat.h index 6e5ef6466..befc7cc4f 100644 --- a/deps/ntlmclient/compat.h +++ b/deps/ntlmclient/compat.h @@ -21,40 +21,6 @@ # include <stdbool.h> #endif -#if defined(_WIN32) || defined(__APPLE__) -/* winsock and macOS > 10.9 have htonll already */ -#elif defined(__linux__) -/* See man page endian(3) */ -# include <endian.h> -# define htonll htobe64 -#elif defined(__NetBSD__) || defined(__OpenBSD__) -/* See man page htobe64(3) */ -# include <endian.h> -# define htonll htobe64 -#elif defined(__FreeBSD__) -/* See man page bwaps64(9) */ -# include <sys/endian.h> -# define htonll htobe64 -#elif defined(sun) || defined(__sun) -/* See man page byteorder(3SOCKET) */ -# include <sys/types.h> -# include <netinet/in.h> -# include <inttypes.h> - -# if !defined(htonll) -# if defined(_BIG_ENDIAN) -# define htonll(x) (x) -# else -# define htonll(x) ((((uint64_t)htonl(x)) << 32) + htonl((uint64_t)(x) >> 32)) -# endif -# endif -#elif defined(__HAIKU__) -# include <ByteOrder.h> -# define htonll B_HOST_TO_BENDIAN_INT64 -#else -# error "Please implement htonll for your platform" -#endif - #ifndef MIN # define MIN(x, y) (((x) < (y)) ? (x) : (y)) #endif diff --git a/deps/ntlmclient/crypt_openssl.c b/deps/ntlmclient/crypt_openssl.c index 785be10e5..c0d36d891 100644 --- a/deps/ntlmclient/crypt_openssl.c +++ b/deps/ntlmclient/crypt_openssl.c @@ -71,7 +71,7 @@ static inline void HMAC_CTX_free(HMAC_CTX *ctx) static inline int HMAC_CTX_reset(HMAC_CTX *ctx) { HMAC_CTX_cleanup(ctx); - memzero(ctx, sizeof(HMAC_CTX)); + ntlm_memzero(ctx, sizeof(HMAC_CTX)); return 1; } diff --git a/deps/ntlmclient/ntlm.c b/deps/ntlmclient/ntlm.c index 74224bbea..470a90143 100644 --- a/deps/ntlmclient/ntlm.c +++ b/deps/ntlmclient/ntlm.c @@ -132,10 +132,10 @@ int ntlm_client_set_hostname( static void free_credentials(ntlm_client *ntlm) { if (ntlm->password) - memzero(ntlm->password, strlen(ntlm->password)); + ntlm_memzero(ntlm->password, strlen(ntlm->password)); if (ntlm->password_utf16) - memzero(ntlm->password_utf16, ntlm->password_utf16_len); + ntlm_memzero(ntlm->password_utf16, ntlm->password_utf16_len); free(ntlm->username); free(ntlm->username_upper); @@ -1125,7 +1125,7 @@ static bool generate_lm2_response(ntlm_client *ntlm, size_t lm2_len = 16; uint64_t local_nonce; - local_nonce = htonll(ntlm->nonce); + local_nonce = ntlm_htonll(ntlm->nonce); if (!ntlm_hmac_ctx_reset(ntlm->hmac_ctx) || !ntlm_hmac_md5_init(ntlm->hmac_ctx, @@ -1197,8 +1197,8 @@ static bool generate_ntlm2_response(ntlm_client *ntlm) /* the blob's integer values are in network byte order */ signature = htonl(0x01010000); - timestamp = htonll(ntlm->timestamp); - nonce = htonll(ntlm->nonce); + timestamp = ntlm_htonll(ntlm->timestamp); + nonce = ntlm_htonll(ntlm->nonce); /* construct the blob */ memcpy(&blob[0], &signature, 4); diff --git a/deps/ntlmclient/util.c b/deps/ntlmclient/util.c index d0e3e53be..07d10f6c6 100644 --- a/deps/ntlmclient/util.c +++ b/deps/ntlmclient/util.c @@ -8,14 +8,28 @@ #include <stdlib.h> #include <stdint.h> +#include <arpa/inet.h> #include "compat.h" #include "util.h" -void memzero(void *data, size_t size) +void ntlm_memzero(void *data, size_t size) { volatile uint8_t *scan = (volatile uint8_t *)data; while (size--) *scan++ = 0x0; } + +uint64_t ntlm_htonll(uint64_t value) +{ + static union { + uint32_t i; + char c[8]; + } test = { 0x01020304 }; + + if (test.c[0] == 0x01) + return value; + else + return ((uint64_t)htonl(value) << 32) | htonl((uint64_t)value >> 32); +} diff --git a/deps/ntlmclient/util.h b/deps/ntlmclient/util.h index 1c1806ba3..d4bb472cc 100644 --- a/deps/ntlmclient/util.h +++ b/deps/ntlmclient/util.h @@ -9,6 +9,7 @@ #ifndef PRIVATE_UTIL_H__ #define PRIVATE_UTIL_H__ -extern void memzero(void *data, size_t size); +extern void ntlm_memzero(void *data, size_t size); +extern uint64_t ntlm_htonll(uint64_t value); #endif /* PRIVATE_UTIL_H__ */ diff --git a/docs/changelog.md b/docs/changelog.md index 97cf94c6b..288ef2d11 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -1,3 +1,92 @@ +v1.1 +---- + +This is release v1.1, "Fernweh". + +### Changes or improvements + +* Our bundled PCRE dependency has been updated to 8.44. + +* The `refs/remotes/origin/HEAD` file will be created at clone time to + point to the origin's default branch. + +* libgit2 now uses the `__atomic_` intrinsics instead of `__sync_` + intrinsics on supported gcc and clang versions. + +* The `init.defaultBranch` setting is now respected and `master` is + no longer the hardcoded as the default branch name. + +* Patch files that do not contain an `index` line can now be parsed. + +* Configuration files with multi-line values can now contain quotes + split across multiple lines. + +* Windows clients now attempt to use TLS1.3 when available. + +* Servers that request an upgrade to a newer HTTP version are + silently ignored instead of erroneously failing. + +* Users can pass `NULL` to the options argument to + `git_describe_commit`. + +* Clones and fetches of very large packfiles now succeeds on 32-bit + platforms. + +* Custom reference database backends can now handle the repository's + `HEAD` correctly. + +* Repositories with a large number of packfiles no longer exhaust the + number of file descriptors. + +* The test framework now supports TAP output when the `-t` flag is + specified. + +* The test framework can now specify an exact match to a test + function using a trailing `$`. + +* All checkout types support `GIT_CHECKOUT_DISABLE_PATHSPEC_MATCH`. + +* `git_blame` now can ignore whitespace changes using the option + `GIT_BLAME_IGNORE_WHITESPACE`. + +* Several new examples have been created, including an examples for + commit, add and push. + +* Mode changes during rename are now supported in patch application. + +* `git_checkout_head` now correctly removes untracked files in a + subdirectory when the `FORCE | REMOVE_UNTRACKED` options are specified. + +v1.0.1 +------ + +This is a bugfix release with the following changes: + +- Calculating information about renamed files during merges is more + efficient because dissimilarity about files is now being cached and + no longer needs to be recomputed. + +- The `git_worktree_prune_init_options` has been correctly restored for + backward compatibility. In v1.0 it was incorrectly deprecated with a + typo. + +- The optional ntlmclient dependency now supports NetBSD. + +- A bug where attempting to stash on a bare repository may have failed + has been fixed. + +- Configuration files that are unreadable due to permissions are now + silently ignored, and treated as if they do not exist. This matches + git's behavior; previously this case would have been an error. + +- v4 index files are now correctly written; previously we would read + them correctly but would not write the prefix-compression accurately, + causing corruption. + +- A bug where the smart HTTP transport could not read large data packets + has been fixed. Previously, fetching from servers like Gerrit, that + sent large data packets, would error. + v1.0 ---- diff --git a/include/git2/version.h b/include/git2/version.h index b078e1ea2..c1020bbea 100644 --- a/include/git2/version.h +++ b/include/git2/version.h @@ -7,12 +7,12 @@ #ifndef INCLUDE_git_version_h__ #define INCLUDE_git_version_h__ -#define LIBGIT2_VERSION "1.0.0" +#define LIBGIT2_VERSION "1.1.0" #define LIBGIT2_VER_MAJOR 1 -#define LIBGIT2_VER_MINOR 0 +#define LIBGIT2_VER_MINOR 1 #define LIBGIT2_VER_REVISION 0 #define LIBGIT2_VER_PATCH 0 -#define LIBGIT2_SOVERSION "1.0" +#define LIBGIT2_SOVERSION "1.1" #endif diff --git a/package.json b/package.json index b4995b18f..5e74f3bd5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "libgit2", - "version": "1.0.0", + "version": "1.1.0", "repo": "https://github.com/libgit2/libgit2", "description": " A cross-platform, linkable library implementation of Git that you can use in your application.", "install": "mkdir build && cd build && cmake .. && cmake --build ." diff --git a/src/thread-utils.h b/src/thread-utils.h index ecb4909f5..3311672b4 100644 --- a/src/thread-utils.h +++ b/src/thread-utils.h @@ -311,6 +311,11 @@ GIT_INLINE(volatile void *) git___swap( return old; } +GIT_INLINE(volatile void *) git___load(void * volatile *ptr) +{ + return *ptr; +} + #ifdef GIT_ARCH_64 GIT_INLINE(int64_t) git_atomic64_add(git_atomic64 *a, int64_t addend) |