summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2019-09-19 10:27:33 +0200
committerGitHub <noreply@github.com>2019-09-19 10:27:33 +0200
commit68cfb580e19c419992ba0b0a299e5fd6dc60ed99 (patch)
tree6061dedb9dfa99a8c5c49ccea34cfb975b045628 /src
parentc97cf08ae3c1b1deb6a6eb557132ed5424aa4450 (diff)
parent71ca3dc7713ff40b11aebc41274c7be6cae42350 (diff)
downloadlibgit2-68cfb580e19c419992ba0b0a299e5fd6dc60ed99.tar.gz
Merge pull request #5223 from tiennou/fix/transport-header-split
Circular header splitting
Diffstat (limited to 'src')
-rw-r--r--src/transports/auth.c1
-rw-r--r--src/transports/auth_ntlm.c1
-rw-r--r--src/transports/cred.c8
-rw-r--r--src/transports/cred.h16
-rw-r--r--src/transports/http.c1
-rw-r--r--src/transports/ssh.c6
-rw-r--r--src/transports/winhttp.c1
7 files changed, 12 insertions, 22 deletions
diff --git a/src/transports/auth.c b/src/transports/auth.c
index 4fcf73cb5..19127379f 100644
--- a/src/transports/auth.c
+++ b/src/transports/auth.c
@@ -9,6 +9,7 @@
#include "git2.h"
#include "buffer.h"
+#include "git2/sys/cred.h"
static int basic_next_token(
git_buf *out,
diff --git a/src/transports/auth_ntlm.c b/src/transports/auth_ntlm.c
index eff09bd8a..240c9ed81 100644
--- a/src/transports/auth_ntlm.c
+++ b/src/transports/auth_ntlm.c
@@ -10,6 +10,7 @@
#include "buffer.h"
#include "auth.h"
#include "auth_ntlm.h"
+#include "git2/sys/cred.h"
#ifdef GIT_NTLM
diff --git a/src/transports/cred.c b/src/transports/cred.c
index 621cae027..80c4d3698 100644
--- a/src/transports/cred.c
+++ b/src/transports/cred.c
@@ -5,10 +5,10 @@
* a Linking Exception. For full terms see the included COPYING file.
*/
-#include "cred.h"
+#include "common.h"
-#include "git2.h"
-#include "smart.h"
+#include "git2/cred.h"
+#include "git2/sys/cred.h"
#include "git2/cred_helpers.h"
static int git_cred_ssh_key_type_new(
@@ -27,7 +27,7 @@ int git_cred_has_username(git_cred *cred)
return 1;
}
-const char *git_cred__username(git_cred *cred)
+const char *git_cred_get_username(git_cred *cred)
{
switch (cred->credtype) {
case GIT_CREDTYPE_USERNAME:
diff --git a/src/transports/cred.h b/src/transports/cred.h
deleted file mode 100644
index ed5821c55..000000000
--- a/src/transports/cred.h
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
- * Copyright (C) the libgit2 contributors. All rights reserved.
- *
- * This file is part of libgit2, distributed under the GNU GPL v2 with
- * a Linking Exception. For full terms see the included COPYING file.
- */
-#ifndef INCLUDE_transports_cred_h__
-#define INCLUDE_transports_cred_h__
-
-#include "common.h"
-
-#include "git2/transport.h"
-
-const char *git_cred__username(git_cred *cred);
-
-#endif
diff --git a/src/transports/http.c b/src/transports/http.c
index 78458655b..47094f700 100644
--- a/src/transports/http.c
+++ b/src/transports/http.c
@@ -16,6 +16,7 @@
#include "netops.h"
#include "global.h"
#include "remote.h"
+#include "git2/sys/cred.h"
#include "smart.h"
#include "auth.h"
#include "http.h"
diff --git a/src/transports/ssh.c b/src/transports/ssh.c
index caa3a17f5..21594181b 100644
--- a/src/transports/ssh.c
+++ b/src/transports/ssh.c
@@ -17,9 +17,11 @@
#include "net.h"
#include "netops.h"
#include "smart.h"
-#include "cred.h"
#include "streams/socket.h"
+#include "git2/cred.h"
+#include "git2/sys/cred.h"
+
#ifdef GIT_SSH
#define OWNING_SUBTRANSPORT(s) ((ssh_subtransport *)(s)->parent.subtransport)
@@ -629,7 +631,7 @@ post_extract:
if ((error = request_creds(&cred, t, urldata.username, auth_methods)) < 0)
goto done;
- if (strcmp(urldata.username, git_cred__username(cred))) {
+ if (strcmp(urldata.username, git_cred_get_username(cred))) {
git_error_set(GIT_ERROR_SSH, "username does not match previous request");
error = -1;
goto done;
diff --git a/src/transports/winhttp.c b/src/transports/winhttp.c
index 3cab5d700..a7c075906 100644
--- a/src/transports/winhttp.c
+++ b/src/transports/winhttp.c
@@ -19,6 +19,7 @@
#include "repository.h"
#include "global.h"
#include "http.h"
+#include "git2/sys/cred.h"
#include <wincrypt.h>
#include <winhttp.h>