Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
dbc17a7e
Unverified
Commit
dbc17a7e
authored
Sep 21, 2019
by
Etienne Samson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
negotiate: use GSS.framework on macOS
parent
0eecb660
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
91 additions
and
11 deletions
+91
-11
cmake/Modules/FindGSSFramework.cmake
+28
-0
cmake/Modules/SelectGSSAPI.cmake
+53
-0
src/CMakeLists.txt
+3
-9
src/features.h.in
+1
-0
src/transports/auth_negotiate.c
+5
-1
src/transports/auth_negotiate.h
+1
-1
No files found.
cmake/Modules/FindGSSFramework.cmake
0 → 100644
View file @
dbc17a7e
# Find GSS.framework
# This will define :
#
# GSSFRAMEWORK_FOUND
# GSSFRAMEWORK_INCLUDE_DIR
# GSSFRAMEWORK_LIBRARIES
# GSSFRAMEWORK_LDFLAGS
#
FIND_PATH
(
GSSFRAMEWORK_INCLUDE_DIR NAMES GSS.h
)
FIND_LIBRARY
(
GSSFRAMEWORK_LIBRARIES NAMES GSS
)
IF
(
GSSFRAMEWORK_INCLUDE_DIR AND GSSFRAMEWORK_LIBRARIES
)
IF
(
NOT CoreFoundation_FIND_QUIETLY
)
MESSAGE
(
STATUS
"Found GSS.framework
${
GSSFRAMEWORK_LIBRARIES
}
"
)
ENDIF
()
SET
(
GSSFRAMEWORK_FOUND TRUE
)
SET
(
GSSFRAMEWORK_LDFLAGS
"-framework GSS"
)
ENDIF
()
IF
(
GSS_FIND_REQUIRED AND NOT GSSFRAMEWORK_FOUND
)
MESSAGE
(
FATAL_ERROR
"CoreFoundation not found"
)
ENDIF
()
MARK_AS_ADVANCED
(
GSSFRAMEWORK_INCLUDE_DIR
GSSFRAMEWORK_LIBRARIES
GSSFRAMEWORK_LDFLAGS
)
cmake/Modules/SelectGSSAPI.cmake
0 → 100644
View file @
dbc17a7e
# Select the backend to use
# We try to find any packages our backends might use
FIND_PACKAGE
(
GSSAPI
)
IF
(
CMAKE_SYSTEM_NAME MATCHES
"Darwin"
)
INCLUDE
(
FindGSSFramework
)
ENDIF
()
# Auto-select GSS backend
IF
(
USE_GSSAPI STREQUAL ON
)
IF
(
GSSFRAMEWORK_FOUND
)
SET
(
GSS_BACKEND
"GSS.framework"
)
ELSEIF
(
GSSAPI_FOUND
)
SET
(
GSS_BACKEND
"gssapi"
)
ELSE
()
MESSAGE
(
FATAL_ERROR
"Unable to autodetect a usable GSS backend."
"Please pass the backend name explicitly (-DUSE_GSS=backend)"
)
ENDIF
()
ELSEIF
(
USE_GSSAPI
)
# Backend was explicitly set
SET
(
GSS_BACKEND
${
USE_GSSAPI
}
)
ELSE
()
SET
(
GSS_BACKEND NO
)
ENDIF
()
IF
(
GSS_BACKEND
)
# Check that we can find what's required for the selected backend
IF
(
GSS_BACKEND STREQUAL
"GSS.framework"
)
IF
(
NOT GSSFRAMEWORK_FOUND
)
MESSAGE
(
FATAL_ERROR
"Asked for GSS.framework backend, but it wasn't found"
)
ENDIF
()
LIST
(
APPEND LIBGIT2_LIBS
${
GSSFRAMEWORK_LIBRARIES
}
)
SET
(
GIT_GSSFRAMEWORK 1
)
ADD_FEATURE_INFO
(
SPNEGO GIT_GSSFRAMEWORK
"SPNEGO authentication support (
${
GSS_BACKEND
}
)"
)
ELSEIF
(
GSS_BACKEND STREQUAL
"gssapi"
)
IF
(
NOT GSSAPI_FOUND
)
MESSAGE
(
FATAL_ERROR
"Asked for gssapi GSS backend, but it wasn't found"
)
ENDIF
()
LIST
(
APPEND LIBGIT2_LIBS
${
GSSAPI_LIBRARIES
}
)
SET
(
GIT_GSSAPI 1
)
ADD_FEATURE_INFO
(
SPNEGO GIT_GSSAPI
"SPNEGO authentication support (
${
GSS_BACKEND
}
)"
)
ELSE
()
MESSAGE
(
FATAL_ERROR
"Asked for backend
${
GSS_BACKEND
}
but it wasn't found"
)
ENDIF
()
ELSE
()
SET
(
GIT_GSSAPI 0
)
ADD_FEATURE_INFO
(
SPNEGO NO
""
)
ENDIF
()
src/CMakeLists.txt
View file @
dbc17a7e
...
...
@@ -233,15 +233,9 @@ IF (USE_NTLMCLIENT)
ENDIF
()
ADD_FEATURE_INFO
(
ntlmclient GIT_NTLM
"NTLM authentication support for Unix"
)
# Optional external dependency: libgssapi
IF
(
USE_GSSAPI
)
FIND_PACKAGE
(
GSSAPI
)
ENDIF
()
IF
(
GSSAPI_FOUND
)
SET
(
GIT_GSSAPI 1
)
LIST
(
APPEND LIBGIT2_LIBS
${
GSSAPI_LIBRARIES
}
)
ENDIF
()
ADD_FEATURE_INFO
(
SPNEGO GIT_GSSAPI
"SPNEGO authentication support"
)
# Optional external dependency: GSSAPI
INCLUDE
(
SelectGSSAPI
)
# Optional external dependency: iconv
IF
(
USE_ICONV
)
...
...
src/features.h.in
View file @
dbc17a7e
...
...
@@ -27,6 +27,7 @@
#cmakedefine GIT_NTLM 1
#cmakedefine GIT_GSSAPI 1
#cmakedefine GIT_GSSFRAMEWORK 1
#cmakedefine GIT_WINHTTP 1
#cmakedefine GIT_HTTPS 1
...
...
src/transports/auth_negotiate.c
View file @
dbc17a7e
...
...
@@ -7,15 +7,19 @@
#include "auth_negotiate.h"
#if
def GIT_GSSAPI
#if
defined(GIT_GSSAPI) || defined(GIT_GSSFRAMEWORK)
#include "git2.h"
#include "buffer.h"
#include "auth.h"
#include "git2/sys/cred.h"
#ifdef GIT_GSSFRAMEWORK
#import <GSS/GSS.h>
#elif defined(GIT_GSSAPI)
#include <gssapi.h>
#include <krb5.h>
#endif
static
gss_OID_desc
negotiate_oid_spnego
=
{
6
,
(
void
*
)
"
\x2b\x06\x01\x05\x05\x02
"
};
...
...
src/transports/auth_negotiate.h
View file @
dbc17a7e
...
...
@@ -12,7 +12,7 @@
#include "git2.h"
#include "auth.h"
#if
def GIT_GSSAPI
#if
defined(GIT_GSSAPI) || defined(GIT_GSSFRAMEWORK)
extern
int
git_http_auth_negotiate
(
git_http_auth_context
**
out
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment