Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
jami-daemon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
jami-daemon
Commits
dbe9efec
Commit
dbe9efec
authored
5 years ago
by
Adrien Béraud
Browse files
Options
Downloads
Patches
Plain Diff
peer_connection: cleanup
Change-Id: I1f1896164c468bbfe931b65508112b955a31675f
parent
fd08346f
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/peer_connection.cpp
+4
-5
4 additions, 5 deletions
src/peer_connection.cpp
with
4 additions
and
5 deletions
src/peer_connection.cpp
+
4
−
5
View file @
dbe9efec
...
@@ -383,9 +383,8 @@ public:
...
@@ -383,9 +383,8 @@ public:
Impl
(
AbstractSocketEndpoint
&
ep
,
const
dht
::
crypto
::
Certificate
&
peer_cert
)
Impl
(
AbstractSocketEndpoint
&
ep
,
const
dht
::
crypto
::
Certificate
&
peer_cert
)
:
tr
{
ep
},
peerCertificate
{
peer_cert
}
{}
:
tr
{
ep
},
peerCertificate
{
peer_cert
}
{}
Impl
(
AbstractSocketEndpoint
&
ep
,
Impl
(
AbstractSocketEndpoint
&
ep
,
std
::
function
<
bool
(
const
dht
::
crypto
::
Certificate
&
)
>&&
cert_check
)
std
::
function
<
bool
(
const
dht
::
crypto
::
Certificate
&
)
>
&&
cert_check
)
:
tr
{
ep
},
peerCertificateCheckFunc
{
std
::
move
(
cert_check
)},
peerCertificate
{
null_cert
}
{}
:
tr
{
ep
},
peerCertificateCheckFunc
{
std
::
make_unique
<
std
::
function
<
bool
(
const
dht
::
crypto
::
Certificate
&
)
>>
(
std
::
move
(
cert_check
))},
peerCertificate
{
null_cert
}
{}
// TLS callbacks
// TLS callbacks
int
verifyCertificate
(
gnutls_session_t
);
int
verifyCertificate
(
gnutls_session_t
);
...
@@ -397,7 +396,7 @@ public:
...
@@ -397,7 +396,7 @@ public:
AbstractSocketEndpoint
&
tr
;
AbstractSocketEndpoint
&
tr
;
const
dht
::
crypto
::
Certificate
&
peerCertificate
;
const
dht
::
crypto
::
Certificate
&
peerCertificate
;
dht
::
crypto
::
Certificate
null_cert
;
dht
::
crypto
::
Certificate
null_cert
;
std
::
unique_ptr
<
std
::
function
<
bool
(
const
dht
::
crypto
::
Certificate
&
)
>
>
peerCertificateCheckFunc
;
std
::
function
<
bool
(
const
dht
::
crypto
::
Certificate
&
)
>
peerCertificateCheckFunc
;
};
};
// Declaration at namespace scope is necessary (until C++17)
// Declaration at namespace scope is necessary (until C++17)
...
@@ -410,7 +409,7 @@ TlsSocketEndpoint::Impl::verifyCertificate(gnutls_session_t session)
...
@@ -410,7 +409,7 @@ TlsSocketEndpoint::Impl::verifyCertificate(gnutls_session_t session)
auto
verified
=
init_crt
(
session
,
crt
);
auto
verified
=
init_crt
(
session
,
crt
);
if
(
verified
!=
GNUTLS_E_SUCCESS
)
return
verified
;
if
(
verified
!=
GNUTLS_E_SUCCESS
)
return
verified
;
if
(
peerCertificateCheckFunc
)
{
if
(
peerCertificateCheckFunc
)
{
if
(
!
(
*
peerCertificateCheckFunc
)
(
crt
))
{
if
(
!
peerCertificateCheckFunc
(
crt
))
{
JAMI_ERR
()
<<
"[TLS-SOCKET] Unexpected peer certificate"
;
JAMI_ERR
()
<<
"[TLS-SOCKET] Unexpected peer certificate"
;
return
GNUTLS_E_CERTIFICATE_ERROR
;
return
GNUTLS_E_CERTIFICATE_ERROR
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment