rugged 0.27.10 → 0.27.10.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rugged/version.rb +1 -1
- data/vendor/libgit2/AUTHORS +0 -1
- data/vendor/libgit2/CMakeLists.txt +54 -98
- data/vendor/libgit2/COPYING +0 -28
- data/vendor/libgit2/cmake/Modules/AddCFlagIfSupported.cmake +1 -15
- data/vendor/libgit2/cmake/Modules/EnableWarnings.cmake +8 -9
- data/vendor/libgit2/cmake/Modules/FindCoreFoundation.cmake +2 -2
- data/vendor/libgit2/cmake/Modules/FindGSSAPI.cmake +1 -1
- data/vendor/libgit2/cmake/Modules/FindSecurity.cmake +2 -2
- data/vendor/libgit2/cmake/Modules/FindStatNsec.cmake +0 -6
- data/vendor/libgit2/deps/http-parser/CMakeLists.txt +0 -2
- data/vendor/libgit2/deps/http-parser/{COPYING → LICENSE-MIT} +0 -0
- data/vendor/libgit2/deps/http-parser/http_parser.c +6 -11
- data/vendor/libgit2/deps/regex/CMakeLists.txt +2 -0
- data/vendor/libgit2/deps/regex/config.h +7 -0
- data/vendor/libgit2/deps/regex/regcomp.c +3857 -0
- data/vendor/libgit2/deps/regex/regex.c +92 -0
- data/vendor/libgit2/deps/regex/regex.h +582 -0
- data/vendor/libgit2/deps/regex/regex_internal.c +1744 -0
- data/vendor/libgit2/deps/regex/regex_internal.h +819 -0
- data/vendor/libgit2/deps/regex/regexec.c +4369 -0
- data/vendor/libgit2/deps/zlib/CMakeLists.txt +0 -1
- data/vendor/libgit2/deps/zlib/adler32.c +7 -0
- data/vendor/libgit2/deps/zlib/crc32.c +7 -0
- data/vendor/libgit2/include/git2.h +0 -5
- data/vendor/libgit2/include/git2/annotated_commit.h +0 -9
- data/vendor/libgit2/include/git2/attr.h +20 -38
- data/vendor/libgit2/include/git2/blame.h +25 -42
- data/vendor/libgit2/include/git2/blob.h +13 -45
- data/vendor/libgit2/include/git2/branch.h +1 -1
- data/vendor/libgit2/include/git2/buffer.h +16 -22
- data/vendor/libgit2/include/git2/checkout.h +32 -65
- data/vendor/libgit2/include/git2/cherrypick.h +7 -9
- data/vendor/libgit2/include/git2/clone.h +10 -12
- data/vendor/libgit2/include/git2/commit.h +3 -53
- data/vendor/libgit2/include/git2/common.h +8 -60
- data/vendor/libgit2/include/git2/config.h +19 -30
- data/vendor/libgit2/include/git2/describe.h +9 -32
- data/vendor/libgit2/include/git2/diff.h +156 -208
- data/vendor/libgit2/include/git2/errors.h +46 -54
- data/vendor/libgit2/include/git2/filter.h +0 -8
- data/vendor/libgit2/include/git2/ignore.h +2 -2
- data/vendor/libgit2/include/git2/index.h +52 -74
- data/vendor/libgit2/include/git2/indexer.h +6 -76
- data/vendor/libgit2/include/git2/inttypes.h +309 -0
- data/vendor/libgit2/include/git2/merge.h +18 -35
- data/vendor/libgit2/include/git2/net.h +5 -0
- data/vendor/libgit2/include/git2/notes.h +1 -1
- data/vendor/libgit2/include/git2/object.h +29 -17
- data/vendor/libgit2/include/git2/odb.h +11 -12
- data/vendor/libgit2/include/git2/odb_backend.h +9 -10
- data/vendor/libgit2/include/git2/oid.h +2 -2
- data/vendor/libgit2/include/git2/pack.h +3 -14
- data/vendor/libgit2/include/git2/proxy.h +8 -14
- data/vendor/libgit2/include/git2/rebase.h +6 -53
- data/vendor/libgit2/include/git2/refs.h +15 -33
- data/vendor/libgit2/include/git2/refspec.h +0 -17
- data/vendor/libgit2/include/git2/remote.h +24 -123
- data/vendor/libgit2/include/git2/repository.h +39 -76
- data/vendor/libgit2/include/git2/revert.h +4 -6
- data/vendor/libgit2/include/git2/revwalk.h +7 -7
- data/vendor/libgit2/include/git2/signature.h +2 -2
- data/vendor/libgit2/include/git2/stash.h +12 -15
- data/vendor/libgit2/include/git2/status.h +20 -33
- data/vendor/libgit2/include/git2/submodule.h +12 -30
- data/vendor/libgit2/include/git2/sys/commit.h +1 -1
- data/vendor/libgit2/include/git2/sys/config.h +13 -13
- data/vendor/libgit2/include/git2/sys/filter.h +6 -6
- data/vendor/libgit2/include/git2/sys/index.h +0 -3
- data/vendor/libgit2/include/git2/sys/mempack.h +35 -35
- data/vendor/libgit2/include/git2/sys/merge.h +4 -9
- data/vendor/libgit2/include/git2/sys/odb_backend.h +22 -66
- data/vendor/libgit2/include/git2/sys/refdb_backend.h +40 -76
- data/vendor/libgit2/include/git2/sys/repository.h +1 -5
- data/vendor/libgit2/include/git2/sys/stream.h +12 -92
- data/vendor/libgit2/include/git2/sys/time.h +31 -0
- data/vendor/libgit2/include/git2/sys/transport.h +83 -129
- data/vendor/libgit2/include/git2/tag.h +4 -13
- data/vendor/libgit2/include/git2/trace.h +2 -2
- data/vendor/libgit2/include/git2/transaction.h +0 -1
- data/vendor/libgit2/include/git2/transport.h +311 -11
- data/vendor/libgit2/include/git2/tree.h +4 -4
- data/vendor/libgit2/include/git2/types.h +111 -33
- data/vendor/libgit2/include/git2/version.h +4 -4
- data/vendor/libgit2/include/git2/worktree.h +13 -48
- data/vendor/libgit2/libgit2.pc.in +13 -0
- data/vendor/libgit2/src/CMakeLists.txt +164 -96
- data/vendor/libgit2/src/annotated_commit.c +8 -15
- data/vendor/libgit2/src/apply.c +31 -537
- data/vendor/libgit2/src/apply.h +1 -3
- data/vendor/libgit2/src/array.h +2 -2
- data/vendor/libgit2/src/attr.c +75 -81
- data/vendor/libgit2/src/attr_file.c +121 -207
- data/vendor/libgit2/src/attr_file.h +9 -9
- data/vendor/libgit2/src/attrcache.c +53 -51
- data/vendor/libgit2/src/attrcache.h +1 -2
- data/vendor/libgit2/src/blame.c +20 -47
- data/vendor/libgit2/src/blame.h +1 -2
- data/vendor/libgit2/src/blame_git.c +20 -37
- data/vendor/libgit2/src/blob.c +42 -128
- data/vendor/libgit2/src/blob.h +2 -19
- data/vendor/libgit2/src/branch.c +43 -67
- data/vendor/libgit2/src/buf_text.c +6 -7
- data/vendor/libgit2/src/buffer.c +57 -69
- data/vendor/libgit2/src/buffer.h +1 -1
- data/vendor/libgit2/src/cache.c +45 -38
- data/vendor/libgit2/src/cache.h +3 -3
- data/vendor/libgit2/src/cc-compat.h +3 -20
- data/vendor/libgit2/src/checkout.c +90 -109
- data/vendor/libgit2/src/cherrypick.c +9 -15
- data/vendor/libgit2/src/clone.c +27 -49
- data/vendor/libgit2/src/clone.h +0 -4
- data/vendor/libgit2/src/commit.c +49 -117
- data/vendor/libgit2/src/commit.h +0 -7
- data/vendor/libgit2/src/commit_list.c +78 -30
- data/vendor/libgit2/src/commit_list.h +2 -2
- data/vendor/libgit2/src/common.h +91 -27
- data/vendor/libgit2/src/config.c +176 -194
- data/vendor/libgit2/src/config.h +20 -8
- data/vendor/libgit2/src/config_cache.c +35 -41
- data/vendor/libgit2/src/config_file.c +753 -439
- data/vendor/libgit2/src/config_file.h +73 -0
- data/vendor/libgit2/src/config_parse.c +63 -114
- data/vendor/libgit2/src/config_parse.h +16 -17
- data/vendor/libgit2/src/crlf.c +190 -219
- data/vendor/libgit2/src/delta.c +18 -25
- data/vendor/libgit2/src/describe.c +41 -42
- data/vendor/libgit2/src/diff.c +68 -53
- data/vendor/libgit2/src/diff.h +1 -2
- data/vendor/libgit2/src/diff_driver.c +49 -47
- data/vendor/libgit2/src/diff_file.c +17 -19
- data/vendor/libgit2/src/diff_file.h +1 -1
- data/vendor/libgit2/src/diff_generate.c +106 -162
- data/vendor/libgit2/src/diff_generate.h +3 -3
- data/vendor/libgit2/src/diff_parse.c +4 -4
- data/vendor/libgit2/src/diff_print.c +30 -42
- data/vendor/libgit2/src/diff_stats.c +7 -22
- data/vendor/libgit2/src/diff_tform.c +16 -16
- data/vendor/libgit2/src/diff_xdiff.c +3 -15
- data/vendor/libgit2/src/errors.c +39 -51
- data/vendor/libgit2/src/features.h.in +3 -11
- data/vendor/libgit2/src/fetch.c +5 -10
- data/vendor/libgit2/src/fetchhead.c +17 -17
- data/vendor/libgit2/src/filebuf.c +36 -32
- data/vendor/libgit2/src/filebuf.h +2 -2
- data/vendor/libgit2/src/{futils.c → fileops.c} +73 -80
- data/vendor/libgit2/src/{futils.h → fileops.h} +6 -6
- data/vendor/libgit2/src/filter.c +38 -46
- data/vendor/libgit2/src/filter.h +10 -0
- data/vendor/libgit2/src/fnmatch.c +248 -0
- data/vendor/libgit2/src/fnmatch.h +48 -0
- data/vendor/libgit2/src/global.c +63 -48
- data/vendor/libgit2/src/global.h +2 -0
- data/vendor/libgit2/src/hash.c +0 -61
- data/vendor/libgit2/src/hash.h +19 -20
- data/vendor/libgit2/src/hash/hash_collisiondetect.h +47 -0
- data/vendor/libgit2/src/hash/{sha1/common_crypto.c → hash_common_crypto.h} +17 -17
- data/vendor/libgit2/src/hash/{sha1/generic.c → hash_generic.c} +10 -22
- data/vendor/libgit2/src/hash/{sha1/generic.h → hash_generic.h} +10 -4
- data/vendor/libgit2/src/hash/hash_openssl.h +59 -0
- data/vendor/libgit2/src/hash/{sha1/win32.c → hash_win32.c} +37 -47
- data/vendor/libgit2/src/hash/{sha1/win32.h → hash_win32.h} +19 -6
- data/vendor/libgit2/src/hash/{sha1/sha1dc → sha1dc}/sha1.c +3 -14
- data/vendor/libgit2/src/hash/{sha1/sha1dc → sha1dc}/sha1.h +0 -0
- data/vendor/libgit2/src/hash/{sha1/sha1dc → sha1dc}/ubc_check.c +0 -0
- data/vendor/libgit2/src/hash/{sha1/sha1dc → sha1dc}/ubc_check.h +0 -0
- data/vendor/libgit2/src/hashsig.c +5 -5
- data/vendor/libgit2/src/idxmap.c +61 -107
- data/vendor/libgit2/src/idxmap.h +31 -153
- data/vendor/libgit2/src/ignore.c +47 -43
- data/vendor/libgit2/src/index.c +232 -337
- data/vendor/libgit2/src/index.h +1 -17
- data/vendor/libgit2/src/indexer.c +175 -346
- data/vendor/libgit2/src/integer.h +26 -71
- data/vendor/libgit2/src/iterator.c +70 -142
- data/vendor/libgit2/src/iterator.h +0 -15
- data/vendor/libgit2/src/khash.h +1 -3
- data/vendor/libgit2/src/map.h +1 -1
- data/vendor/libgit2/src/merge.c +100 -144
- data/vendor/libgit2/src/merge_driver.c +11 -11
- data/vendor/libgit2/src/merge_file.c +2 -2
- data/vendor/libgit2/src/mwindow.c +29 -24
- data/vendor/libgit2/src/mwindow.h +4 -4
- data/vendor/libgit2/src/netops.c +156 -55
- data/vendor/libgit2/src/netops.h +23 -3
- data/vendor/libgit2/src/notes.c +11 -16
- data/vendor/libgit2/src/object.c +69 -120
- data/vendor/libgit2/src/object.h +9 -22
- data/vendor/libgit2/src/object_api.c +8 -8
- data/vendor/libgit2/src/odb.c +93 -116
- data/vendor/libgit2/src/odb.h +7 -8
- data/vendor/libgit2/src/odb_loose.c +55 -62
- data/vendor/libgit2/src/odb_mempack.c +34 -21
- data/vendor/libgit2/src/odb_pack.c +14 -18
- data/vendor/libgit2/src/offmap.c +35 -53
- data/vendor/libgit2/src/offmap.h +21 -108
- data/vendor/libgit2/src/oid.c +7 -12
- data/vendor/libgit2/src/oidmap.c +47 -49
- data/vendor/libgit2/src/oidmap.h +24 -101
- data/vendor/libgit2/src/pack-objects.c +87 -88
- data/vendor/libgit2/src/pack-objects.h +8 -2
- data/vendor/libgit2/src/pack.c +101 -99
- data/vendor/libgit2/src/pack.h +19 -17
- data/vendor/libgit2/src/parse.c +0 -10
- data/vendor/libgit2/src/parse.h +3 -3
- data/vendor/libgit2/src/patch.c +4 -4
- data/vendor/libgit2/src/patch_generate.c +20 -20
- data/vendor/libgit2/src/patch_parse.c +63 -151
- data/vendor/libgit2/src/path.c +104 -117
- data/vendor/libgit2/src/path.h +71 -3
- data/vendor/libgit2/src/pathspec.c +19 -19
- data/vendor/libgit2/src/pool.c +22 -26
- data/vendor/libgit2/src/pool.h +7 -7
- data/vendor/libgit2/src/posix.c +10 -10
- data/vendor/libgit2/src/posix.h +1 -12
- data/vendor/libgit2/src/proxy.c +3 -8
- data/vendor/libgit2/src/push.c +31 -37
- data/vendor/libgit2/src/push.h +1 -2
- data/vendor/libgit2/src/rebase.c +59 -115
- data/vendor/libgit2/src/refdb.c +3 -15
- data/vendor/libgit2/src/refdb_fs.c +254 -381
- data/vendor/libgit2/src/reflog.c +15 -13
- data/vendor/libgit2/src/refs.c +88 -118
- data/vendor/libgit2/src/refs.h +3 -5
- data/vendor/libgit2/src/refspec.c +37 -56
- data/vendor/libgit2/src/refspec.h +1 -1
- data/vendor/libgit2/src/remote.c +215 -266
- data/vendor/libgit2/src/remote.h +2 -11
- data/vendor/libgit2/src/repository.c +225 -280
- data/vendor/libgit2/src/repository.h +40 -52
- data/vendor/libgit2/src/reset.c +8 -8
- data/vendor/libgit2/src/revert.c +9 -14
- data/vendor/libgit2/src/revparse.c +48 -47
- data/vendor/libgit2/src/revwalk.c +57 -120
- data/vendor/libgit2/src/revwalk.h +1 -22
- data/vendor/libgit2/src/settings.c +10 -47
- data/vendor/libgit2/src/signature.c +11 -11
- data/vendor/libgit2/src/sortedcache.c +36 -22
- data/vendor/libgit2/src/sortedcache.h +1 -1
- data/vendor/libgit2/src/stash.c +99 -125
- data/vendor/libgit2/src/status.c +22 -28
- data/vendor/libgit2/src/stream.h +2 -17
- data/vendor/libgit2/src/streams/curl.c +385 -0
- data/vendor/libgit2/src/{allocators/stdalloc.h → streams/curl.h} +5 -5
- data/vendor/libgit2/src/streams/openssl.c +114 -224
- data/vendor/libgit2/src/streams/openssl.h +108 -4
- data/vendor/libgit2/src/streams/socket.c +30 -55
- data/vendor/libgit2/src/streams/stransport.c +32 -57
- data/vendor/libgit2/src/streams/stransport.h +0 -5
- data/vendor/libgit2/src/streams/tls.c +19 -50
- data/vendor/libgit2/src/streams/tls.h +4 -12
- data/vendor/libgit2/src/strmap.c +74 -47
- data/vendor/libgit2/src/strmap.h +33 -108
- data/vendor/libgit2/src/submodule.c +216 -272
- data/vendor/libgit2/src/submodule.h +1 -1
- data/vendor/libgit2/src/sysdir.c +19 -29
- data/vendor/libgit2/src/tag.c +28 -41
- data/vendor/libgit2/src/tag.h +1 -2
- data/vendor/libgit2/src/trace.c +2 -2
- data/vendor/libgit2/src/trace.h +3 -3
- data/vendor/libgit2/src/trailer.c +38 -52
- data/vendor/libgit2/src/transaction.c +29 -30
- data/vendor/libgit2/src/transport.c +5 -5
- data/vendor/libgit2/src/transports/auth.c +11 -15
- data/vendor/libgit2/src/transports/auth.h +3 -10
- data/vendor/libgit2/src/transports/auth_negotiate.c +18 -33
- data/vendor/libgit2/src/transports/auth_negotiate.h +2 -2
- data/vendor/libgit2/src/transports/cred.c +24 -24
- data/vendor/libgit2/src/{allocators/win32_crtdbg.h → transports/cred.h} +4 -5
- data/vendor/libgit2/src/transports/git.c +31 -26
- data/vendor/libgit2/src/transports/http.c +348 -881
- data/vendor/libgit2/src/transports/http.h +0 -2
- data/vendor/libgit2/src/transports/local.c +35 -35
- data/vendor/libgit2/src/transports/smart.c +47 -70
- data/vendor/libgit2/src/transports/smart.h +4 -3
- data/vendor/libgit2/src/transports/smart_pkt.c +40 -43
- data/vendor/libgit2/src/transports/smart_protocol.c +116 -96
- data/vendor/libgit2/src/transports/ssh.c +66 -77
- data/vendor/libgit2/src/transports/winhttp.c +314 -318
- data/vendor/libgit2/src/tree-cache.c +12 -19
- data/vendor/libgit2/src/tree.c +142 -103
- data/vendor/libgit2/src/tree.h +12 -1
- data/vendor/libgit2/src/unix/map.c +3 -3
- data/vendor/libgit2/src/unix/posix.h +11 -1
- data/vendor/libgit2/src/userdiff.h +1 -3
- data/vendor/libgit2/src/util.c +56 -70
- data/vendor/libgit2/src/util.h +156 -28
- data/vendor/libgit2/src/vector.c +4 -4
- data/vendor/libgit2/src/win32/dir.c +3 -3
- data/vendor/libgit2/src/win32/findfile.c +3 -3
- data/vendor/libgit2/src/win32/map.c +11 -9
- data/vendor/libgit2/src/win32/msvc-compat.h +0 -6
- data/vendor/libgit2/src/win32/path_w32.c +9 -113
- data/vendor/libgit2/src/win32/path_w32.h +29 -18
- data/vendor/libgit2/src/win32/posix.h +4 -1
- data/vendor/libgit2/src/win32/posix_w32.c +45 -70
- data/vendor/libgit2/src/win32/precompiled.h +2 -0
- data/vendor/libgit2/src/win32/thread.c +10 -5
- data/vendor/libgit2/src/win32/w32_buffer.c +5 -9
- data/vendor/libgit2/src/win32/w32_crtdbg_stacktrace.c +2 -3
- data/vendor/libgit2/src/win32/w32_crtdbg_stacktrace.h +75 -26
- data/vendor/libgit2/src/win32/w32_stack.c +11 -6
- data/vendor/libgit2/src/win32/w32_stack.h +3 -3
- data/vendor/libgit2/src/win32/w32_util.c +64 -27
- data/vendor/libgit2/src/win32/w32_util.h +49 -5
- data/vendor/libgit2/src/worktree.c +60 -95
- data/vendor/libgit2/src/worktree.h +0 -2
- data/vendor/libgit2/src/xdiff/xdiffi.c +5 -7
- data/vendor/libgit2/src/xdiff/xhistogram.c +1 -1
- data/vendor/libgit2/src/xdiff/xmerge.c +15 -27
- data/vendor/libgit2/src/xdiff/xpatience.c +0 -3
- data/vendor/libgit2/src/zstream.c +4 -4
- metadata +33 -122
- data/vendor/libgit2/cmake/Modules/FindGSSFramework.cmake +0 -28
- data/vendor/libgit2/cmake/Modules/FindPCRE.cmake +0 -38
- data/vendor/libgit2/cmake/Modules/FindPCRE2.cmake +0 -37
- data/vendor/libgit2/cmake/Modules/FindmbedTLS.cmake +0 -93
- data/vendor/libgit2/cmake/Modules/PkgBuildConfig.cmake +0 -110
- data/vendor/libgit2/cmake/Modules/SelectGSSAPI.cmake +0 -53
- data/vendor/libgit2/cmake/Modules/SelectHTTPSBackend.cmake +0 -124
- data/vendor/libgit2/cmake/Modules/SelectHashes.cmake +0 -66
- data/vendor/libgit2/deps/ntlmclient/CMakeLists.txt +0 -21
- data/vendor/libgit2/deps/ntlmclient/compat.h +0 -33
- data/vendor/libgit2/deps/ntlmclient/crypt.h +0 -64
- data/vendor/libgit2/deps/ntlmclient/crypt_commoncrypto.c +0 -120
- data/vendor/libgit2/deps/ntlmclient/crypt_commoncrypto.h +0 -18
- data/vendor/libgit2/deps/ntlmclient/crypt_mbedtls.c +0 -145
- data/vendor/libgit2/deps/ntlmclient/crypt_mbedtls.h +0 -18
- data/vendor/libgit2/deps/ntlmclient/crypt_openssl.c +0 -130
- data/vendor/libgit2/deps/ntlmclient/crypt_openssl.h +0 -21
- data/vendor/libgit2/deps/ntlmclient/ntlm.c +0 -1420
- data/vendor/libgit2/deps/ntlmclient/ntlm.h +0 -174
- data/vendor/libgit2/deps/ntlmclient/ntlmclient.h +0 -320
- data/vendor/libgit2/deps/ntlmclient/unicode.h +0 -36
- data/vendor/libgit2/deps/ntlmclient/unicode_builtin.c +0 -445
- data/vendor/libgit2/deps/ntlmclient/unicode_iconv.c +0 -201
- data/vendor/libgit2/deps/ntlmclient/utf8.h +0 -1257
- data/vendor/libgit2/deps/ntlmclient/util.c +0 -21
- data/vendor/libgit2/deps/ntlmclient/util.h +0 -14
- data/vendor/libgit2/deps/pcre/CMakeLists.txt +0 -140
- data/vendor/libgit2/deps/pcre/COPYING +0 -5
- data/vendor/libgit2/deps/pcre/cmake/COPYING-CMAKE-SCRIPTS +0 -22
- data/vendor/libgit2/deps/pcre/cmake/FindEditline.cmake +0 -17
- data/vendor/libgit2/deps/pcre/cmake/FindPackageHandleStandardArgs.cmake +0 -58
- data/vendor/libgit2/deps/pcre/cmake/FindReadline.cmake +0 -29
- data/vendor/libgit2/deps/pcre/config.h.in +0 -57
- data/vendor/libgit2/deps/pcre/pcre.h +0 -641
- data/vendor/libgit2/deps/pcre/pcre_byte_order.c +0 -319
- data/vendor/libgit2/deps/pcre/pcre_chartables.c +0 -198
- data/vendor/libgit2/deps/pcre/pcre_compile.c +0 -9800
- data/vendor/libgit2/deps/pcre/pcre_config.c +0 -190
- data/vendor/libgit2/deps/pcre/pcre_dfa_exec.c +0 -3676
- data/vendor/libgit2/deps/pcre/pcre_exec.c +0 -7173
- data/vendor/libgit2/deps/pcre/pcre_fullinfo.c +0 -245
- data/vendor/libgit2/deps/pcre/pcre_get.c +0 -669
- data/vendor/libgit2/deps/pcre/pcre_globals.c +0 -86
- data/vendor/libgit2/deps/pcre/pcre_internal.h +0 -2787
- data/vendor/libgit2/deps/pcre/pcre_jit_compile.c +0 -11913
- data/vendor/libgit2/deps/pcre/pcre_maketables.c +0 -156
- data/vendor/libgit2/deps/pcre/pcre_newline.c +0 -210
- data/vendor/libgit2/deps/pcre/pcre_ord2utf8.c +0 -94
- data/vendor/libgit2/deps/pcre/pcre_printint.c +0 -834
- data/vendor/libgit2/deps/pcre/pcre_refcount.c +0 -92
- data/vendor/libgit2/deps/pcre/pcre_string_utils.c +0 -211
- data/vendor/libgit2/deps/pcre/pcre_study.c +0 -1686
- data/vendor/libgit2/deps/pcre/pcre_tables.c +0 -727
- data/vendor/libgit2/deps/pcre/pcre_ucd.c +0 -3644
- data/vendor/libgit2/deps/pcre/pcre_valid_utf8.c +0 -301
- data/vendor/libgit2/deps/pcre/pcre_version.c +0 -98
- data/vendor/libgit2/deps/pcre/pcre_xclass.c +0 -268
- data/vendor/libgit2/deps/pcre/pcreposix.c +0 -421
- data/vendor/libgit2/deps/pcre/pcreposix.h +0 -117
- data/vendor/libgit2/deps/pcre/ucp.h +0 -224
- data/vendor/libgit2/deps/winhttp/COPYING.GPL +0 -993
- data/vendor/libgit2/deps/winhttp/COPYING.LGPL +0 -502
- data/vendor/libgit2/deps/zlib/COPYING +0 -27
- data/vendor/libgit2/include/git2/apply.h +0 -149
- data/vendor/libgit2/include/git2/cert.h +0 -135
- data/vendor/libgit2/include/git2/cred.h +0 -308
- data/vendor/libgit2/include/git2/deprecated.h +0 -493
- data/vendor/libgit2/include/git2/mailmap.h +0 -115
- data/vendor/libgit2/include/git2/sys/alloc.h +0 -101
- data/vendor/libgit2/include/git2/sys/cred.h +0 -90
- data/vendor/libgit2/include/git2/sys/path.h +0 -64
- data/vendor/libgit2/src/alloc.c +0 -43
- data/vendor/libgit2/src/alloc.h +0 -40
- data/vendor/libgit2/src/allocators/stdalloc.c +0 -119
- data/vendor/libgit2/src/allocators/win32_crtdbg.c +0 -118
- data/vendor/libgit2/src/config_backend.h +0 -96
- data/vendor/libgit2/src/config_entries.c +0 -229
- data/vendor/libgit2/src/config_entries.h +0 -24
- data/vendor/libgit2/src/config_mem.c +0 -220
- data/vendor/libgit2/src/config_snapshot.c +0 -206
- data/vendor/libgit2/src/errors.h +0 -81
- data/vendor/libgit2/src/hash/sha1.h +0 -38
- data/vendor/libgit2/src/hash/sha1/collisiondetect.c +0 -48
- data/vendor/libgit2/src/hash/sha1/collisiondetect.h +0 -19
- data/vendor/libgit2/src/hash/sha1/common_crypto.h +0 -19
- data/vendor/libgit2/src/hash/sha1/mbedtls.c +0 -46
- data/vendor/libgit2/src/hash/sha1/mbedtls.h +0 -19
- data/vendor/libgit2/src/hash/sha1/openssl.c +0 -59
- data/vendor/libgit2/src/hash/sha1/openssl.h +0 -19
- data/vendor/libgit2/src/mailmap.c +0 -485
- data/vendor/libgit2/src/mailmap.h +0 -35
- data/vendor/libgit2/src/net.c +0 -184
- data/vendor/libgit2/src/net.h +0 -36
- data/vendor/libgit2/src/reader.c +0 -265
- data/vendor/libgit2/src/reader.h +0 -107
- data/vendor/libgit2/src/regexp.c +0 -221
- data/vendor/libgit2/src/regexp.h +0 -97
- data/vendor/libgit2/src/streams/mbedtls.c +0 -483
- data/vendor/libgit2/src/streams/mbedtls.h +0 -23
- data/vendor/libgit2/src/streams/registry.c +0 -118
- data/vendor/libgit2/src/streams/registry.h +0 -19
- data/vendor/libgit2/src/transports/auth_ntlm.c +0 -223
- data/vendor/libgit2/src/transports/auth_ntlm.h +0 -35
- data/vendor/libgit2/src/wildmatch.c +0 -320
- data/vendor/libgit2/src/wildmatch.h +0 -23
- data/vendor/libgit2/src/win32/w32_common.h +0 -39
@@ -5,7 +5,9 @@
|
|
5
5
|
* a Linking Exception. For full terms see the included COPYING file.
|
6
6
|
*/
|
7
7
|
|
8
|
-
#include "
|
8
|
+
#include "hash_generic.h"
|
9
|
+
|
10
|
+
#include "hash.h"
|
9
11
|
|
10
12
|
#if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
|
11
13
|
|
@@ -111,7 +113,7 @@
|
|
111
113
|
#define T_40_59(t, A, B, C, D, E) SHA_ROUND(t, SHA_MIX, ((B&C)+(D&(B^C))) , 0x8f1bbcdc, A, B, C, D, E )
|
112
114
|
#define T_60_79(t, A, B, C, D, E) SHA_ROUND(t, SHA_MIX, (B^C^D) , 0xca62c1d6, A, B, C, D, E )
|
113
115
|
|
114
|
-
static void hash__block(
|
116
|
+
static void hash__block(git_hash_ctx *ctx, const unsigned int *data)
|
115
117
|
{
|
116
118
|
unsigned int A,B,C,D,E;
|
117
119
|
unsigned int array[16];
|
@@ -219,22 +221,7 @@ static void hash__block(git_hash_sha1_ctx *ctx, const unsigned int *data)
|
|
219
221
|
ctx->H[4] += E;
|
220
222
|
}
|
221
223
|
|
222
|
-
int
|
223
|
-
{
|
224
|
-
return 0;
|
225
|
-
}
|
226
|
-
|
227
|
-
int git_hash_sha1_ctx_init(git_hash_sha1_ctx *ctx)
|
228
|
-
{
|
229
|
-
return git_hash_sha1_init(ctx);
|
230
|
-
}
|
231
|
-
|
232
|
-
void git_hash_sha1_ctx_cleanup(git_hash_sha1_ctx *ctx)
|
233
|
-
{
|
234
|
-
GIT_UNUSED(ctx);
|
235
|
-
}
|
236
|
-
|
237
|
-
int git_hash_sha1_init(git_hash_sha1_ctx *ctx)
|
224
|
+
int git_hash_init(git_hash_ctx *ctx)
|
238
225
|
{
|
239
226
|
ctx->size = 0;
|
240
227
|
|
@@ -248,7 +235,7 @@ int git_hash_sha1_init(git_hash_sha1_ctx *ctx)
|
|
248
235
|
return 0;
|
249
236
|
}
|
250
237
|
|
251
|
-
int
|
238
|
+
int git_hash_update(git_hash_ctx *ctx, const void *data, size_t len)
|
252
239
|
{
|
253
240
|
unsigned int lenW = ctx->size & 63;
|
254
241
|
|
@@ -278,7 +265,7 @@ int git_hash_sha1_update(git_hash_sha1_ctx *ctx, const void *data, size_t len)
|
|
278
265
|
return 0;
|
279
266
|
}
|
280
267
|
|
281
|
-
int
|
268
|
+
int git_hash_final(git_oid *out, git_hash_ctx *ctx)
|
282
269
|
{
|
283
270
|
static const unsigned char pad[64] = { 0x80 };
|
284
271
|
unsigned int padlen[2];
|
@@ -289,8 +276,8 @@ int git_hash_sha1_final(git_oid *out, git_hash_sha1_ctx *ctx)
|
|
289
276
|
padlen[1] = htonl((uint32_t)(ctx->size << 3));
|
290
277
|
|
291
278
|
i = ctx->size & 63;
|
292
|
-
|
293
|
-
|
279
|
+
git_hash_update(ctx, pad, 1+ (63 & (55 - i)));
|
280
|
+
git_hash_update(ctx, padlen, 8);
|
294
281
|
|
295
282
|
/* Output hash */
|
296
283
|
for (i = 0; i < 5; i++)
|
@@ -298,3 +285,4 @@ int git_hash_sha1_final(git_oid *out, git_hash_sha1_ctx *ctx)
|
|
298
285
|
|
299
286
|
return 0;
|
300
287
|
}
|
288
|
+
|
@@ -5,15 +5,21 @@
|
|
5
5
|
* a Linking Exception. For full terms see the included COPYING file.
|
6
6
|
*/
|
7
7
|
|
8
|
-
#ifndef
|
9
|
-
#define
|
8
|
+
#ifndef INCLUDE_hash_hash_generic_h__
|
9
|
+
#define INCLUDE_hash_hash_generic_h__
|
10
10
|
|
11
|
-
#include "
|
11
|
+
#include "common.h"
|
12
12
|
|
13
|
-
|
13
|
+
#include "hash.h"
|
14
|
+
|
15
|
+
struct git_hash_ctx {
|
14
16
|
unsigned long long size;
|
15
17
|
unsigned int H[5];
|
16
18
|
unsigned int W[16];
|
17
19
|
};
|
18
20
|
|
21
|
+
#define git_hash_global_init() 0
|
22
|
+
#define git_hash_ctx_init(ctx) git_hash_init(ctx)
|
23
|
+
#define git_hash_ctx_cleanup(ctx)
|
24
|
+
|
19
25
|
#endif
|
@@ -0,0 +1,59 @@
|
|
1
|
+
/*
|
2
|
+
* Copyright (C) the libgit2 contributors. All rights reserved.
|
3
|
+
*
|
4
|
+
* This file is part of libgit2, distributed under the GNU GPL v2 with
|
5
|
+
* a Linking Exception. For full terms see the included COPYING file.
|
6
|
+
*/
|
7
|
+
|
8
|
+
#ifndef INCLUDE_hash_hash_openssl_h__
|
9
|
+
#define INCLUDE_hash_hash_openssl_h__
|
10
|
+
|
11
|
+
#include "hash.h"
|
12
|
+
|
13
|
+
#include <openssl/sha.h>
|
14
|
+
|
15
|
+
struct git_hash_ctx {
|
16
|
+
SHA_CTX c;
|
17
|
+
};
|
18
|
+
|
19
|
+
#define git_hash_global_init() 0
|
20
|
+
#define git_hash_ctx_init(ctx) git_hash_init(ctx)
|
21
|
+
#define git_hash_ctx_cleanup(ctx)
|
22
|
+
|
23
|
+
GIT_INLINE(int) git_hash_init(git_hash_ctx *ctx)
|
24
|
+
{
|
25
|
+
assert(ctx);
|
26
|
+
|
27
|
+
if (SHA1_Init(&ctx->c) != 1) {
|
28
|
+
giterr_set(GITERR_SHA1, "hash_openssl: failed to initialize hash context");
|
29
|
+
return -1;
|
30
|
+
}
|
31
|
+
|
32
|
+
return 0;
|
33
|
+
}
|
34
|
+
|
35
|
+
GIT_INLINE(int) git_hash_update(git_hash_ctx *ctx, const void *data, size_t len)
|
36
|
+
{
|
37
|
+
assert(ctx);
|
38
|
+
|
39
|
+
if (SHA1_Update(&ctx->c, data, len) != 1) {
|
40
|
+
giterr_set(GITERR_SHA1, "hash_openssl: failed to update hash");
|
41
|
+
return -1;
|
42
|
+
}
|
43
|
+
|
44
|
+
return 0;
|
45
|
+
}
|
46
|
+
|
47
|
+
GIT_INLINE(int) git_hash_final(git_oid *out, git_hash_ctx *ctx)
|
48
|
+
{
|
49
|
+
assert(ctx);
|
50
|
+
|
51
|
+
if (SHA1_Final(out->id, &ctx->c) != 1) {
|
52
|
+
giterr_set(GITERR_SHA1, "hash_openssl: failed to finalize hash");
|
53
|
+
return -1;
|
54
|
+
}
|
55
|
+
|
56
|
+
return 0;
|
57
|
+
}
|
58
|
+
|
59
|
+
#endif
|
@@ -5,25 +5,15 @@
|
|
5
5
|
* a Linking Exception. For full terms see the included COPYING file.
|
6
6
|
*/
|
7
7
|
|
8
|
-
#include "
|
8
|
+
#include "hash_win32.h"
|
9
9
|
|
10
10
|
#include "global.h"
|
11
|
+
#include "hash.h"
|
11
12
|
|
12
13
|
#include <wincrypt.h>
|
13
14
|
#include <strsafe.h>
|
14
15
|
|
15
|
-
|
16
|
-
|
17
|
-
/* BCRYPT_SHA1_ALGORITHM */
|
18
|
-
#define GIT_HASH_CNG_HASH_TYPE L"SHA1"
|
19
|
-
|
20
|
-
/* BCRYPT_OBJECT_LENGTH */
|
21
|
-
#define GIT_HASH_CNG_HASH_OBJECT_LEN L"ObjectLength"
|
22
|
-
|
23
|
-
/* BCRYPT_HASH_REUSEABLE_FLAGS */
|
24
|
-
#define GIT_HASH_CNG_HASH_REUSABLE 0x00000020
|
25
|
-
|
26
|
-
static git_hash_prov hash_prov = {0};
|
16
|
+
static struct git_hash_prov hash_prov = {0};
|
27
17
|
|
28
18
|
/* Hash initialization */
|
29
19
|
|
@@ -35,7 +25,7 @@ GIT_INLINE(int) hash_cng_prov_init(void)
|
|
35
25
|
|
36
26
|
/* Only use CNG on Windows 2008 / Vista SP1 or better (Windows 6.0 SP1) */
|
37
27
|
if (!git_has_win32_version(6, 0, 1)) {
|
38
|
-
|
28
|
+
giterr_set(GITERR_SHA1, "CryptoNG is not supported on this platform");
|
39
29
|
return -1;
|
40
30
|
}
|
41
31
|
|
@@ -45,7 +35,7 @@ GIT_INLINE(int) hash_cng_prov_init(void)
|
|
45
35
|
StringCchCat(dll_path, MAX_PATH, "\\") < 0 ||
|
46
36
|
StringCchCat(dll_path, MAX_PATH, GIT_HASH_CNG_DLL_NAME) < 0 ||
|
47
37
|
(hash_prov.prov.cng.dll = LoadLibrary(dll_path)) == NULL) {
|
48
|
-
|
38
|
+
giterr_set(GITERR_SHA1, "CryptoNG library could not be loaded");
|
49
39
|
return -1;
|
50
40
|
}
|
51
41
|
|
@@ -59,7 +49,7 @@ GIT_INLINE(int) hash_cng_prov_init(void)
|
|
59
49
|
(hash_prov.prov.cng.close_algorithm_provider = (hash_win32_cng_close_algorithm_provider_fn)GetProcAddress(hash_prov.prov.cng.dll, "BCryptCloseAlgorithmProvider")) == NULL) {
|
60
50
|
FreeLibrary(hash_prov.prov.cng.dll);
|
61
51
|
|
62
|
-
|
52
|
+
giterr_set(GITERR_OS, "CryptoNG functions could not be loaded");
|
63
53
|
return -1;
|
64
54
|
}
|
65
55
|
|
@@ -67,7 +57,7 @@ GIT_INLINE(int) hash_cng_prov_init(void)
|
|
67
57
|
if (hash_prov.prov.cng.open_algorithm_provider(&hash_prov.prov.cng.handle, GIT_HASH_CNG_HASH_TYPE, NULL, GIT_HASH_CNG_HASH_REUSABLE) < 0) {
|
68
58
|
FreeLibrary(hash_prov.prov.cng.dll);
|
69
59
|
|
70
|
-
|
60
|
+
giterr_set(GITERR_OS, "algorithm provider could not be initialized");
|
71
61
|
return -1;
|
72
62
|
}
|
73
63
|
|
@@ -76,7 +66,7 @@ GIT_INLINE(int) hash_cng_prov_init(void)
|
|
76
66
|
hash_prov.prov.cng.close_algorithm_provider(hash_prov.prov.cng.handle, 0);
|
77
67
|
FreeLibrary(hash_prov.prov.cng.dll);
|
78
68
|
|
79
|
-
|
69
|
+
giterr_set(GITERR_OS, "algorithm handle could not be found");
|
80
70
|
return -1;
|
81
71
|
}
|
82
72
|
|
@@ -96,7 +86,7 @@ GIT_INLINE(void) hash_cng_prov_shutdown(void)
|
|
96
86
|
GIT_INLINE(int) hash_cryptoapi_prov_init()
|
97
87
|
{
|
98
88
|
if (!CryptAcquireContext(&hash_prov.prov.cryptoapi.handle, NULL, 0, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT)) {
|
99
|
-
|
89
|
+
giterr_set(GITERR_OS, "legacy hash context could not be started");
|
100
90
|
return -1;
|
101
91
|
}
|
102
92
|
|
@@ -111,7 +101,7 @@ GIT_INLINE(void) hash_cryptoapi_prov_shutdown(void)
|
|
111
101
|
hash_prov.type = INVALID;
|
112
102
|
}
|
113
103
|
|
114
|
-
static void
|
104
|
+
static void git_hash_global_shutdown(void)
|
115
105
|
{
|
116
106
|
if (hash_prov.type == CNG)
|
117
107
|
hash_cng_prov_shutdown();
|
@@ -119,7 +109,7 @@ static void sha1_shutdown(void)
|
|
119
109
|
hash_cryptoapi_prov_shutdown();
|
120
110
|
}
|
121
111
|
|
122
|
-
int
|
112
|
+
int git_hash_global_init(void)
|
123
113
|
{
|
124
114
|
int error = 0;
|
125
115
|
|
@@ -129,29 +119,29 @@ int git_hash_sha1_global_init(void)
|
|
129
119
|
if ((error = hash_cng_prov_init()) < 0)
|
130
120
|
error = hash_cryptoapi_prov_init();
|
131
121
|
|
132
|
-
git__on_shutdown(
|
122
|
+
git__on_shutdown(git_hash_global_shutdown);
|
133
123
|
|
134
124
|
return error;
|
135
125
|
}
|
136
126
|
|
137
127
|
/* CryptoAPI: available in Windows XP and newer */
|
138
128
|
|
139
|
-
GIT_INLINE(int) hash_ctx_cryptoapi_init(
|
129
|
+
GIT_INLINE(int) hash_ctx_cryptoapi_init(git_hash_ctx *ctx)
|
140
130
|
{
|
141
131
|
ctx->type = CRYPTOAPI;
|
142
132
|
ctx->prov = &hash_prov;
|
143
133
|
|
144
|
-
return
|
134
|
+
return git_hash_init(ctx);
|
145
135
|
}
|
146
136
|
|
147
|
-
GIT_INLINE(int) hash_cryptoapi_init(
|
137
|
+
GIT_INLINE(int) hash_cryptoapi_init(git_hash_ctx *ctx)
|
148
138
|
{
|
149
139
|
if (ctx->ctx.cryptoapi.valid)
|
150
140
|
CryptDestroyHash(ctx->ctx.cryptoapi.hash_handle);
|
151
141
|
|
152
142
|
if (!CryptCreateHash(ctx->prov->prov.cryptoapi.handle, CALG_SHA1, 0, 0, &ctx->ctx.cryptoapi.hash_handle)) {
|
153
143
|
ctx->ctx.cryptoapi.valid = 0;
|
154
|
-
|
144
|
+
giterr_set(GITERR_OS, "legacy hash implementation could not be created");
|
155
145
|
return -1;
|
156
146
|
}
|
157
147
|
|
@@ -159,7 +149,7 @@ GIT_INLINE(int) hash_cryptoapi_init(git_hash_sha1_ctx *ctx)
|
|
159
149
|
return 0;
|
160
150
|
}
|
161
151
|
|
162
|
-
GIT_INLINE(int) hash_cryptoapi_update(
|
152
|
+
GIT_INLINE(int) hash_cryptoapi_update(git_hash_ctx *ctx, const void *_data, size_t len)
|
163
153
|
{
|
164
154
|
const BYTE *data = (BYTE *)_data;
|
165
155
|
|
@@ -169,7 +159,7 @@ GIT_INLINE(int) hash_cryptoapi_update(git_hash_sha1_ctx *ctx, const void *_data,
|
|
169
159
|
DWORD chunk = (len > MAXDWORD) ? MAXDWORD : (DWORD)len;
|
170
160
|
|
171
161
|
if (!CryptHashData(ctx->ctx.cryptoapi.hash_handle, data, chunk, 0)) {
|
172
|
-
|
162
|
+
giterr_set(GITERR_OS, "legacy hash data could not be updated");
|
173
163
|
return -1;
|
174
164
|
}
|
175
165
|
|
@@ -180,7 +170,7 @@ GIT_INLINE(int) hash_cryptoapi_update(git_hash_sha1_ctx *ctx, const void *_data,
|
|
180
170
|
return 0;
|
181
171
|
}
|
182
172
|
|
183
|
-
GIT_INLINE(int) hash_cryptoapi_final(git_oid *out,
|
173
|
+
GIT_INLINE(int) hash_cryptoapi_final(git_oid *out, git_hash_ctx *ctx)
|
184
174
|
{
|
185
175
|
DWORD len = 20;
|
186
176
|
int error = 0;
|
@@ -188,7 +178,7 @@ GIT_INLINE(int) hash_cryptoapi_final(git_oid *out, git_hash_sha1_ctx *ctx)
|
|
188
178
|
assert(ctx->ctx.cryptoapi.valid);
|
189
179
|
|
190
180
|
if (!CryptGetHashParam(ctx->ctx.cryptoapi.hash_handle, HP_HASHVAL, out->id, &len, 0)) {
|
191
|
-
|
181
|
+
giterr_set(GITERR_OS, "legacy hash data could not be finished");
|
192
182
|
error = -1;
|
193
183
|
}
|
194
184
|
|
@@ -198,7 +188,7 @@ GIT_INLINE(int) hash_cryptoapi_final(git_oid *out, git_hash_sha1_ctx *ctx)
|
|
198
188
|
return error;
|
199
189
|
}
|
200
190
|
|
201
|
-
GIT_INLINE(void) hash_ctx_cryptoapi_cleanup(
|
191
|
+
GIT_INLINE(void) hash_ctx_cryptoapi_cleanup(git_hash_ctx *ctx)
|
202
192
|
{
|
203
193
|
if (ctx->ctx.cryptoapi.valid)
|
204
194
|
CryptDestroyHash(ctx->ctx.cryptoapi.hash_handle);
|
@@ -206,7 +196,7 @@ GIT_INLINE(void) hash_ctx_cryptoapi_cleanup(git_hash_sha1_ctx *ctx)
|
|
206
196
|
|
207
197
|
/* CNG: Available in Windows Server 2008 and newer */
|
208
198
|
|
209
|
-
GIT_INLINE(int) hash_ctx_cng_init(
|
199
|
+
GIT_INLINE(int) hash_ctx_cng_init(git_hash_ctx *ctx)
|
210
200
|
{
|
211
201
|
if ((ctx->ctx.cng.hash_object = git__malloc(hash_prov.prov.cng.hash_object_size)) == NULL)
|
212
202
|
return -1;
|
@@ -214,7 +204,7 @@ GIT_INLINE(int) hash_ctx_cng_init(git_hash_sha1_ctx *ctx)
|
|
214
204
|
if (hash_prov.prov.cng.create_hash(hash_prov.prov.cng.handle, &ctx->ctx.cng.hash_handle, ctx->ctx.cng.hash_object, hash_prov.prov.cng.hash_object_size, NULL, 0, 0) < 0) {
|
215
205
|
git__free(ctx->ctx.cng.hash_object);
|
216
206
|
|
217
|
-
|
207
|
+
giterr_set(GITERR_OS, "hash implementation could not be created");
|
218
208
|
return -1;
|
219
209
|
}
|
220
210
|
|
@@ -224,7 +214,7 @@ GIT_INLINE(int) hash_ctx_cng_init(git_hash_sha1_ctx *ctx)
|
|
224
214
|
return 0;
|
225
215
|
}
|
226
216
|
|
227
|
-
GIT_INLINE(int) hash_cng_init(
|
217
|
+
GIT_INLINE(int) hash_cng_init(git_hash_ctx *ctx)
|
228
218
|
{
|
229
219
|
BYTE hash[GIT_OID_RAWSZ];
|
230
220
|
|
@@ -233,7 +223,7 @@ GIT_INLINE(int) hash_cng_init(git_hash_sha1_ctx *ctx)
|
|
233
223
|
|
234
224
|
/* CNG needs to be finished to restart */
|
235
225
|
if (ctx->prov->prov.cng.finish_hash(ctx->ctx.cng.hash_handle, hash, GIT_OID_RAWSZ, 0) < 0) {
|
236
|
-
|
226
|
+
giterr_set(GITERR_OS, "hash implementation could not be finished");
|
237
227
|
return -1;
|
238
228
|
}
|
239
229
|
|
@@ -242,7 +232,7 @@ GIT_INLINE(int) hash_cng_init(git_hash_sha1_ctx *ctx)
|
|
242
232
|
return 0;
|
243
233
|
}
|
244
234
|
|
245
|
-
GIT_INLINE(int) hash_cng_update(
|
235
|
+
GIT_INLINE(int) hash_cng_update(git_hash_ctx *ctx, const void *_data, size_t len)
|
246
236
|
{
|
247
237
|
PBYTE data = (PBYTE)_data;
|
248
238
|
|
@@ -250,7 +240,7 @@ GIT_INLINE(int) hash_cng_update(git_hash_sha1_ctx *ctx, const void *_data, size_
|
|
250
240
|
ULONG chunk = (len > ULONG_MAX) ? ULONG_MAX : (ULONG)len;
|
251
241
|
|
252
242
|
if (ctx->prov->prov.cng.hash_data(ctx->ctx.cng.hash_handle, data, chunk, 0) < 0) {
|
253
|
-
|
243
|
+
giterr_set(GITERR_OS, "hash could not be updated");
|
254
244
|
return -1;
|
255
245
|
}
|
256
246
|
|
@@ -261,10 +251,10 @@ GIT_INLINE(int) hash_cng_update(git_hash_sha1_ctx *ctx, const void *_data, size_
|
|
261
251
|
return 0;
|
262
252
|
}
|
263
253
|
|
264
|
-
GIT_INLINE(int) hash_cng_final(git_oid *out,
|
254
|
+
GIT_INLINE(int) hash_cng_final(git_oid *out, git_hash_ctx *ctx)
|
265
255
|
{
|
266
256
|
if (ctx->prov->prov.cng.finish_hash(ctx->ctx.cng.hash_handle, out->id, GIT_OID_RAWSZ, 0) < 0) {
|
267
|
-
|
257
|
+
giterr_set(GITERR_OS, "hash could not be finished");
|
268
258
|
return -1;
|
269
259
|
}
|
270
260
|
|
@@ -273,7 +263,7 @@ GIT_INLINE(int) hash_cng_final(git_oid *out, git_hash_sha1_ctx *ctx)
|
|
273
263
|
return 0;
|
274
264
|
}
|
275
265
|
|
276
|
-
GIT_INLINE(void) hash_ctx_cng_cleanup(
|
266
|
+
GIT_INLINE(void) hash_ctx_cng_cleanup(git_hash_ctx *ctx)
|
277
267
|
{
|
278
268
|
ctx->prov->prov.cng.destroy_hash(ctx->ctx.cng.hash_handle);
|
279
269
|
git__free(ctx->ctx.cng.hash_object);
|
@@ -281,7 +271,7 @@ GIT_INLINE(void) hash_ctx_cng_cleanup(git_hash_sha1_ctx *ctx)
|
|
281
271
|
|
282
272
|
/* Indirection between CryptoAPI and CNG */
|
283
273
|
|
284
|
-
int
|
274
|
+
int git_hash_ctx_init(git_hash_ctx *ctx)
|
285
275
|
{
|
286
276
|
int error = 0;
|
287
277
|
|
@@ -292,33 +282,33 @@ int git_hash_sha1_ctx_init(git_hash_sha1_ctx *ctx)
|
|
292
282
|
* initialized with git_libgit2_init. Otherwise, it must be initialized
|
293
283
|
* at first use.
|
294
284
|
*/
|
295
|
-
if (hash_prov.type == INVALID && (error =
|
285
|
+
if (hash_prov.type == INVALID && (error = git_hash_global_init()) < 0)
|
296
286
|
return error;
|
297
287
|
|
298
|
-
memset(ctx, 0x0, sizeof(
|
288
|
+
memset(ctx, 0x0, sizeof(git_hash_ctx));
|
299
289
|
|
300
290
|
return (hash_prov.type == CNG) ? hash_ctx_cng_init(ctx) : hash_ctx_cryptoapi_init(ctx);
|
301
291
|
}
|
302
292
|
|
303
|
-
int
|
293
|
+
int git_hash_init(git_hash_ctx *ctx)
|
304
294
|
{
|
305
295
|
assert(ctx && ctx->type);
|
306
296
|
return (ctx->type == CNG) ? hash_cng_init(ctx) : hash_cryptoapi_init(ctx);
|
307
297
|
}
|
308
298
|
|
309
|
-
int
|
299
|
+
int git_hash_update(git_hash_ctx *ctx, const void *data, size_t len)
|
310
300
|
{
|
311
301
|
assert(ctx && ctx->type);
|
312
302
|
return (ctx->type == CNG) ? hash_cng_update(ctx, data, len) : hash_cryptoapi_update(ctx, data, len);
|
313
303
|
}
|
314
304
|
|
315
|
-
int
|
305
|
+
int git_hash_final(git_oid *out, git_hash_ctx *ctx)
|
316
306
|
{
|
317
307
|
assert(ctx && ctx->type);
|
318
308
|
return (ctx->type == CNG) ? hash_cng_final(out, ctx) : hash_cryptoapi_final(out, ctx);
|
319
309
|
}
|
320
310
|
|
321
|
-
void
|
311
|
+
void git_hash_ctx_cleanup(git_hash_ctx *ctx)
|
322
312
|
{
|
323
313
|
assert(ctx);
|
324
314
|
|