William Swanson
d0cf1040c7
Correctly handle getaddrinfo return result
...
The getaddrinfo function indicates failure with a non-zero return code,
but this code is not necessarily negative. On platforms like Android
where the code is positive, a failed call causes libgit2 to segfault.
2014-09-24 12:01:14 -07:00
Carlos Martín Nieto
2cd3cb8e03
Add a note about cert check in the CHANGELOG
2014-09-24 10:22:03 +02:00
Vicent Marti
14556cbff7
Merge pull request #2567 from cirosantilli/factor-41
...
Factor 40 and 41 constants from source.
2014-09-17 17:13:25 +02:00
Carlos Martín Nieto
6340e8f5d0
travis: another attempt at multiple allowed failures
...
It looks like what Travis wants is a list of hashes, rather than a hash
with a list.
2014-09-17 15:52:01 +02:00
Vicent Marti
276d9ea3a6
Merge pull request #2571 from libgit2/vmg/walk-up-path
...
Fix `git_path_walk_up` to work with non-rooted paths
2014-09-17 15:39:57 +02:00
The rugged tests are fragile
74240afb9c
repository: Do not double-free config
2014-09-17 15:35:50 +02:00
Carlos Martín Nieto
5c22c4a205
travis: fix allowed failures list
2014-09-17 15:35:15 +02:00
Vicent Marti
4592b62ee5
Merge pull request #2572 from cirosantilli/factor-void
...
Replace void casts with GIT_UNUSED.
2014-09-17 15:26:48 +02:00
The rugged tests are fragile
4e96411748
Style
2014-09-17 15:24:56 +02:00
The rugged tests are fragile
a2b4407dc3
attr: Do not walk path if we're at the root
2014-09-17 15:24:17 +02:00
Ciro Santilli
c5cf8cade3
Replace void casts with GIT_UNUSED.
2014-09-17 15:19:08 +02:00
The rugged tests are fragile
4cb7c4a4c7
attr: Add an extra test for files under a subfolder
2014-09-17 15:08:16 +02:00
The rugged tests are fragile
bbb988a519
path: Fix git_path_walk_up
to work with non-rooted paths
2014-09-17 15:00:12 +02:00
Vicent Marti
1312f87b68
Merge pull request #2464 from libgit2/cmn/host-cert-info
...
Provide a callback for certificate validation
2014-09-17 14:56:39 +02:00
Carlos Martín Nieto
25abbc27a7
Clean up some leaks in the test suite
2014-09-17 03:19:40 +02:00
Vicent Marti
ecef28d55c
Merge pull request #2569 from libgit2/cmn/valgrind-once
...
travis: run valgrind only once
2014-09-16 17:46:32 +02:00
Carlos Martín Nieto
570452e31a
travis: run valgrind only once
...
Instead of running valgrind on each job, half of which are in release
mode and don't have much usable information for valgrind, perform an
debug build as part of allowed_failures and run valgrind on that one,
which should speed up the feedback we get from the builds.
2014-09-16 17:38:03 +02:00
Carlos Martín Nieto
52e09724fd
ssh: skip the localhost cert check earlier
...
Skip it before we attempt to clone, as we would exit with -1 on systems
which do not have sshd running.
2014-09-16 17:13:58 +02:00
Carlos Martín Nieto
4fe5b771b5
winhttp: get rid of the cert ignore flag
...
This brings us back in line with the other transports.
2014-09-16 17:02:33 +02:00
Carlos Martín Nieto
1e0aa105fa
ssh: expose both hashes
...
The user may have the data hashed as MD5 or SHA-1, so we should provide
both types for consumption.
2014-09-16 17:02:33 +02:00
Carlos Martín Nieto
286369a81f
ssh: provide our own types for host key lengths
...
Instead of using the libssh2 defines, provide our own, which eases usage
as we do not need to check whether libgit2 was built with libssh2 or not.
2014-09-16 17:02:32 +02:00
Carlos Martín Nieto
ebda097076
script: use a parallel build on Travis
2014-09-16 17:02:32 +02:00
Carlos Martín Nieto
0782fc43f8
net: use only structs to pass information about cert
...
Instead of spreading the data in function arguments, some of which
aren't used for ssh and having a struct only for ssh, use a struct for
both, using a common parent to pass to the callback.
2014-09-16 17:02:32 +02:00
Carlos Martín Nieto
0fef38999a
Merge remote-tracking branch 'upstream/master' into cmn/host-cert-info
2014-09-16 17:02:28 +02:00
Carlos Martín Nieto
bf8756d6a2
ssh: add test for host key
...
Test that the certificate check callback gets the right fingerprint from
the host we're connecting to.
2014-09-16 17:01:32 +02:00
Carlos Martín Nieto
41698f22f6
net: remove support for outright ignoring certificates
...
This option make it easy to ignore anything about the server we're
connecting to, which is bad security practice. This was necessary as we
didn't use to expose detailed information about the certificate, but now
that we do, we should get rid of this.
If the user wants to ignore everything, they can still provide a
callback which ignores all the information passed.
2014-09-16 17:01:32 +02:00
Carlos Martín Nieto
2aee4642ef
transport: move the cert type enum to types.h
...
This should make the mingw compiler happy.
2014-09-16 17:01:32 +02:00
Carlos Martín Nieto
7c8acc54be
winhttp: set ignore security flags on user command
...
If the user returns 0 from the certificate check and we had certificate issues, set the options to ignore certificate errors and resend the request.
2014-09-16 17:01:32 +02:00
Carlos Martín Nieto
67c84e06f3
winhttp: bring together request sending
...
We need to call WinHttpSendRequest() in three different places. Unify all in a single function to have a single place for the certificate check.
2014-09-16 17:01:31 +02:00
Carlos Martín Nieto
5f2cf732ab
winhttp: only do certificate check for SSL
...
If we're not using SSL, don't call the user's certificate check callback.
2014-09-16 17:01:31 +02:00
Carlos Martín Nieto
08545d366b
winhttp: credential check on successful connect
...
On successful connection, still ask the user whether they accept the server's certificate, indicating that WinHTTP would let it though.
2014-09-16 17:01:31 +02:00
Carlos Martín Nieto
23ca0ad5eb
Bring certificate check back to the normal return code
...
Returning 0 lets the certificate check succeed. An error code is bubbled
up to the user.
2014-09-16 17:01:31 +02:00
Carlos Martín Nieto
2f5864c50c
ssh: do ssh cert info before asking for credentials
...
We know the host's key as soon as we connect, so we should perform the
check as soon as we can, before we bother with the user's credentials.
2014-09-16 17:01:31 +02:00
Carlos Martín Nieto
17491f6e56
transport: always call the certificate check callback
...
We should let the user decide whether to cancel the connection or not
regardless of whether our checks have decided that the certificate is
fine. We provide our own assessment to the callback to let the user fall
back to our checks if they so desire.
2014-09-16 17:01:30 +02:00
Carlos Martín Nieto
85acc56262
remote: add tests for the certificate callback
2014-09-16 17:01:30 +02:00
Carlos Martín Nieto
ec1ce4584a
http: send the DER-encoded cert to the callback
...
Instead of the parsed data, we can ask OpenSSL to give us the
DER-encoded version of the certificate, which the user can then parse
and validate.
2014-09-16 17:01:30 +02:00
Carlos Martín Nieto
9b9405865e
Provide a callback for certificate validation
...
If the certificate validation fails (or always in the case of ssh),
let the user decide whether to allow the connection.
The data structure passed to the user is the native certificate
information from the underlying implementation, namely OpenSSL or
WinHTTP.
2014-09-16 17:01:30 +02:00
Vicent Marti
73dd663876
Merge pull request #2565 from linquize/typo
...
Fix typo
2014-09-16 13:24:52 +02:00
Vicent Marti
903a76168e
Merge pull request #2561 from jacquesg/merge-skip
...
No files merged may result in bogus merge conflict error
2014-09-16 13:22:40 +02:00
The rugged tests are fragile
52e9120c77
attr: Cleanup the containing dir logic
2014-09-16 13:20:58 +02:00
Vicent Marti
6259576408
Merge pull request #2566 from libgit2/rb/attr-with-bare
...
Fix attribute lookup in index for bare repos
2014-09-16 13:17:08 +02:00
Ciro Santilli
3b2cb2c91e
Factor 40 and 41 constants from source.
2014-09-16 13:07:04 +02:00
Russell Belfer
1fbeb2f04c
Fix attribute lookup in index for bare repos
...
When using a bare repo with an index, libgit2 attempts to read
files from the index. It caches those files based on the path
to the file, specifically the path to the directory that contains
the file.
If there is no working directory, we use `git_path_dirname_r` to
get the path to the containing directory. However, for the
`.gitattributes` file in the root of the repository, this ends up
normalizing the containing path to `"."` instead of the empty
string and the lookup the `.gitattributes` data fails.
This adds a test of attribute lookups on bare repos and also
fixes the problem by simply rewriting `"."` to be `""`.
2014-09-15 21:59:23 -07:00
Linquize
2c22193ba0
Fix typo
2014-09-16 08:56:33 +08:00
Vicent Marti
910cd2daa6
Merge pull request #2563 from alexcrichton/rust-bindings
...
Add Rust to the language bindings list
2014-09-15 21:28:12 +02:00
Alex Crichton
b4913705fb
Add Rust to the language bindings list
2014-09-15 12:11:48 -07:00
Vicent Marti
a7fcac13a5
Merge pull request #2554 from linquize/fetch-head-tag
...
When auto follow tags, FETCH_HEAD should list only newly followed tags
2014-09-15 20:26:12 +02:00
Jacques Germishuys
dc68ee8d15
Remove local unused index_repo variable
2014-09-12 22:54:05 +02:00
Jacques Germishuys
a565f364ab
Only check for workdir conflicts if the index has merged files
...
Passing 0 as the length of the paths to check to git_diff_index_to_workdir
results in all files being treated as conflicting, that is, all untracked or
modified files in the worktree is reported as conflicting
2014-09-12 22:53:56 +02:00
Jacques Germishuys
493c340cef
Added test case to illustrate bogus conflicts detected if no files were merged, and untracked files exist in the workdir.
2014-09-12 22:01:22 +02:00