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
d9d45fb3
Unverified
Commit
d9d45fb3
authored
Feb 14, 2023
by
Edward Thomson
Committed by
GitHub
Feb 14, 2023
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #6471 from libgit2/ethomson/openssl3
Support OpenSSL 3 in dynamic loading mode
parents
bf42228b
b379c401
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
7 deletions
+12
-7
src/libgit2/streams/openssl.c
+1
-1
src/libgit2/streams/openssl_dynamic.c
+7
-3
src/util/hash/openssl.c
+4
-3
No files found.
src/libgit2/streams/openssl.c
View file @
d9d45fb3
...
...
@@ -198,7 +198,7 @@ static int openssl_ensure_initialized(void)
if
((
error
=
git_openssl_stream_dynamic_init
())
==
0
)
error
=
openssl_init
();
openssl_initialized
=
true
;
openssl_initialized
=
!
error
;
}
error
|=
git_mutex_unlock
(
&
openssl_mutex
);
...
...
src/libgit2/streams/openssl_dynamic.c
View file @
d9d45fb3
...
...
@@ -91,7 +91,7 @@ int (*sk_num)(const void *sk);
void
*
(
*
sk_value
)(
const
void
*
sk
,
int
i
);
void
(
*
sk_free
)(
void
*
sk
);
void
*
openssl_handle
;
static
void
*
openssl_handle
;
GIT_INLINE
(
void
*
)
openssl_sym
(
int
*
err
,
const
char
*
name
,
bool
required
)
{
...
...
@@ -125,7 +125,8 @@ int git_openssl_stream_dynamic_init(void)
(
openssl_handle
=
dlopen
(
"libssl.1.1.dylib"
,
RTLD_NOW
))
==
NULL
&&
(
openssl_handle
=
dlopen
(
"libssl.so.1.0.0"
,
RTLD_NOW
))
==
NULL
&&
(
openssl_handle
=
dlopen
(
"libssl.1.0.0.dylib"
,
RTLD_NOW
))
==
NULL
&&
(
openssl_handle
=
dlopen
(
"libssl.so.10"
,
RTLD_NOW
))
==
NULL
)
{
(
openssl_handle
=
dlopen
(
"libssl.so.10"
,
RTLD_NOW
))
==
NULL
&&
(
openssl_handle
=
dlopen
(
"libssl.so.3"
,
RTLD_NOW
))
==
NULL
)
{
git_error_set
(
GIT_ERROR_SSL
,
"could not load ssl libraries"
);
return
-
1
;
}
...
...
@@ -175,7 +176,6 @@ int git_openssl_stream_dynamic_init(void)
SSL_connect
=
(
int
(
*
)(
SSL
*
))
openssl_sym
(
&
err
,
"SSL_connect"
,
true
);
SSL_ctrl
=
(
long
(
*
)(
SSL
*
,
int
,
long
,
void
*
))
openssl_sym
(
&
err
,
"SSL_ctrl"
,
true
);
SSL_get_peer_certificate
=
(
X509
*
(
*
)(
const
SSL
*
))
openssl_sym
(
&
err
,
"SSL_get_peer_certificate"
,
true
);
SSL_library_init
=
(
int
(
*
)(
void
))
openssl_sym
(
&
err
,
"SSL_library_init"
,
false
);
SSL_free
=
(
void
(
*
)(
SSL
*
))
openssl_sym
(
&
err
,
"SSL_free"
,
true
);
SSL_get_error
=
(
int
(
*
)(
SSL
*
,
int
))
openssl_sym
(
&
err
,
"SSL_get_error"
,
true
);
...
...
@@ -187,6 +187,10 @@ int git_openssl_stream_dynamic_init(void)
SSL_shutdown
=
(
int
(
*
)(
SSL
*
ssl
))
openssl_sym
(
&
err
,
"SSL_shutdown"
,
true
);
SSL_write
=
(
int
(
*
)(
SSL
*
,
const
void
*
,
int
))
openssl_sym
(
&
err
,
"SSL_write"
,
true
);
if
(
!
(
SSL_get_peer_certificate
=
(
X509
*
(
*
)(
const
SSL
*
))
openssl_sym
(
&
err
,
"SSL_get_peer_certificate"
,
false
)))
{
SSL_get_peer_certificate
=
(
X509
*
(
*
)(
const
SSL
*
))
openssl_sym
(
&
err
,
"SSL_get1_peer_certificate"
,
true
);
}
SSL_CTX_ctrl
=
(
long
(
*
)(
SSL_CTX
*
,
int
,
long
,
void
*
))
openssl_sym
(
&
err
,
"SSL_CTX_ctrl"
,
true
);
SSL_CTX_free
=
(
void
(
*
)(
SSL_CTX
*
))
openssl_sym
(
&
err
,
"SSL_CTX_free"
,
true
);
SSL_CTX_new
=
(
SSL_CTX
*
(
*
)(
const
SSL_METHOD
*
))
openssl_sym
(
&
err
,
"SSL_CTX_new"
,
true
);
...
...
src/util/hash/openssl.c
View file @
d9d45fb3
...
...
@@ -10,8 +10,8 @@
#ifdef GIT_OPENSSL_DYNAMIC
# include <dlfcn.h>
int
handle_count
;
void
*
openssl_handle
;
static
int
handle_count
;
static
void
*
openssl_handle
;
static
int
git_hash_openssl_global_shutdown
(
void
)
{
...
...
@@ -30,7 +30,8 @@ static int git_hash_openssl_global_init(void)
(
openssl_handle
=
dlopen
(
"libssl.1.1.dylib"
,
RTLD_NOW
))
==
NULL
&&
(
openssl_handle
=
dlopen
(
"libssl.so.1.0.0"
,
RTLD_NOW
))
==
NULL
&&
(
openssl_handle
=
dlopen
(
"libssl.1.0.0.dylib"
,
RTLD_NOW
))
==
NULL
&&
(
openssl_handle
=
dlopen
(
"libssl.so.10"
,
RTLD_NOW
))
==
NULL
)
{
(
openssl_handle
=
dlopen
(
"libssl.so.10"
,
RTLD_NOW
))
==
NULL
&&
(
openssl_handle
=
dlopen
(
"libssl.so.3"
,
RTLD_NOW
))
==
NULL
)
{
git_error_set
(
GIT_ERROR_SSL
,
"could not load ssl libraries"
);
return
-
1
;
}
...
...
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