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
6a0fa7a7
Commit
6a0fa7a7
authored
12 years ago
by
Alexandre Savard
Browse files
Options
Downloads
Patches
Plain Diff
#13961: Fix cipher handling to be compatible with pjsip 1.14.2
parent
6476643e
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
daemon/src/sip/sipaccount.cpp
+20
-4
20 additions, 4 deletions
daemon/src/sip/sipaccount.cpp
daemon/src/sip/sipaccount.h
+7
-0
7 additions, 0 deletions
daemon/src/sip/sipaccount.h
with
27 additions
and
4 deletions
daemon/src/sip/sipaccount.cpp
+
20
−
4
View file @
6a0fa7a7
...
@@ -75,6 +75,7 @@ SIPAccount::SIPAccount(const std::string& accountID)
...
@@ -75,6 +75,7 @@ SIPAccount::SIPAccount(const std::string& accountID)
,
transportType_
(
PJSIP_TRANSPORT_UNSPECIFIED
)
,
transportType_
(
PJSIP_TRANSPORT_UNSPECIFIED
)
,
cred_
()
,
cred_
()
,
tlsSetting_
()
,
tlsSetting_
()
,
ciphers
(
100
)
,
contactHeader_
()
,
contactHeader_
()
,
contactUpdateEnabled_
(
false
)
,
contactUpdateEnabled_
(
false
)
,
stunServerName_
()
,
stunServerName_
()
...
@@ -189,7 +190,7 @@ void SIPAccount::serialize(Conf::YamlEmitter &emitter)
...
@@ -189,7 +190,7 @@ void SIPAccount::serialize(Conf::YamlEmitter &emitter)
ScalarNode
tlsport
(
portstr
.
str
());
ScalarNode
tlsport
(
portstr
.
str
());
ScalarNode
certificate
(
tlsCertificateFile_
);
ScalarNode
certificate
(
tlsCertificateFile_
);
ScalarNode
calist
(
tlsCaListFile_
);
ScalarNode
calist
(
tlsCaListFile_
);
ScalarNode
ciphers
(
tlsCiphers_
);
ScalarNode
ciphers
Node
(
tlsCiphers_
);
ScalarNode
tlsenabled
(
tlsEnable_
);
ScalarNode
tlsenabled
(
tlsEnable_
);
ScalarNode
tlsmethod
(
tlsMethod_
);
ScalarNode
tlsmethod
(
tlsMethod_
);
ScalarNode
timeout
(
tlsNegotiationTimeoutSec_
);
ScalarNode
timeout
(
tlsNegotiationTimeoutSec_
);
...
@@ -253,7 +254,7 @@ void SIPAccount::serialize(Conf::YamlEmitter &emitter)
...
@@ -253,7 +254,7 @@ void SIPAccount::serialize(Conf::YamlEmitter &emitter)
tlsmap
.
setKeyValue
(
TLS_PORT_KEY
,
&
tlsport
);
tlsmap
.
setKeyValue
(
TLS_PORT_KEY
,
&
tlsport
);
tlsmap
.
setKeyValue
(
CERTIFICATE_KEY
,
&
certificate
);
tlsmap
.
setKeyValue
(
CERTIFICATE_KEY
,
&
certificate
);
tlsmap
.
setKeyValue
(
CALIST_KEY
,
&
calist
);
tlsmap
.
setKeyValue
(
CALIST_KEY
,
&
calist
);
tlsmap
.
setKeyValue
(
CIPHERS_KEY
,
&
ciphers
);
tlsmap
.
setKeyValue
(
CIPHERS_KEY
,
&
ciphers
Node
);
tlsmap
.
setKeyValue
(
TLS_ENABLE_KEY
,
&
tlsenabled
);
tlsmap
.
setKeyValue
(
TLS_ENABLE_KEY
,
&
tlsenabled
);
tlsmap
.
setKeyValue
(
METHOD_KEY
,
&
tlsmethod
);
tlsmap
.
setKeyValue
(
METHOD_KEY
,
&
tlsmethod
);
tlsmap
.
setKeyValue
(
TIMEOUT_KEY
,
&
timeout
);
tlsmap
.
setKeyValue
(
TIMEOUT_KEY
,
&
timeout
);
...
@@ -723,6 +724,18 @@ pjsip_ssl_method SIPAccount::sslMethodStringToPjEnum(const std::string& method)
...
@@ -723,6 +724,18 @@ pjsip_ssl_method SIPAccount::sslMethodStringToPjEnum(const std::string& method)
void
SIPAccount
::
initTlsConfiguration
()
void
SIPAccount
::
initTlsConfiguration
()
{
{
pj_status_t
status
;
unsigned
cipherNum
;
// Determine the cipher list supported on this machine
cipherNum
=
PJ_ARRAY_SIZE
(
ciphers
);
status
=
pj_ssl_cipher_get_availables
(
&
ciphers
.
front
(),
&
cipherNum
);
if
(
status
!=
PJ_SUCCESS
)
{
ERROR
(
"Could not determine cipher list on this system"
);
}
ciphers
.
resize
(
cipherNum
);
// TLS listener is unique and should be only modified through IP2IP_PROFILE
// TLS listener is unique and should be only modified through IP2IP_PROFILE
pjsip_tls_setting_default
(
&
tlsSetting_
);
pjsip_tls_setting_default
(
&
tlsSetting_
);
...
@@ -731,8 +744,8 @@ void SIPAccount::initTlsConfiguration()
...
@@ -731,8 +744,8 @@ void SIPAccount::initTlsConfiguration()
pj_cstr
(
&
tlsSetting_
.
privkey_file
,
tlsPrivateKeyFile_
.
c_str
());
pj_cstr
(
&
tlsSetting_
.
privkey_file
,
tlsPrivateKeyFile_
.
c_str
());
pj_cstr
(
&
tlsSetting_
.
password
,
tlsPassword_
.
c_str
());
pj_cstr
(
&
tlsSetting_
.
password
,
tlsPassword_
.
c_str
());
tlsSetting_
.
method
=
sslMethodStringToPjEnum
(
tlsMethod_
);
tlsSetting_
.
method
=
sslMethodStringToPjEnum
(
tlsMethod_
);
pj_cstr
(
&
tlsSetting_
.
ciphers
,
tlsCiphers_
.
c_str
()
);
tlsSetting_
.
ciphers
_num
=
ciphers
.
size
(
);
pj_cstr
(
&
tlsSetting_
.
server_name
,
tlsServerName_
.
c_str
()
);
tlsSetting_
.
ciphers
=
&
ciphers
.
front
(
);
tlsSetting_
.
verify_server
=
tlsVerifyServer_
?
PJ_TRUE
:
PJ_FALSE
;
tlsSetting_
.
verify_server
=
tlsVerifyServer_
?
PJ_TRUE
:
PJ_FALSE
;
tlsSetting_
.
verify_client
=
tlsVerifyClient_
?
PJ_TRUE
:
PJ_FALSE
;
tlsSetting_
.
verify_client
=
tlsVerifyClient_
?
PJ_TRUE
:
PJ_FALSE
;
...
@@ -740,6 +753,9 @@ void SIPAccount::initTlsConfiguration()
...
@@ -740,6 +753,9 @@ void SIPAccount::initTlsConfiguration()
tlsSetting_
.
timeout
.
sec
=
atol
(
tlsNegotiationTimeoutSec_
.
c_str
());
tlsSetting_
.
timeout
.
sec
=
atol
(
tlsNegotiationTimeoutSec_
.
c_str
());
tlsSetting_
.
timeout
.
msec
=
atol
(
tlsNegotiationTimeoutMsec_
.
c_str
());
tlsSetting_
.
timeout
.
msec
=
atol
(
tlsNegotiationTimeoutMsec_
.
c_str
());
tlsSetting_
.
qos_type
=
PJ_QOS_TYPE_BEST_EFFORT
;
tlsSetting_
.
qos_ignore_error
=
PJ_TRUE
;
}
}
void
SIPAccount
::
initStunConfiguration
()
void
SIPAccount
::
initStunConfiguration
()
...
...
This diff is collapsed.
Click to expand it.
daemon/src/sip/sipaccount.h
+
7
−
0
View file @
6a0fa7a7
...
@@ -43,6 +43,8 @@
...
@@ -43,6 +43,8 @@
#include
"pjsip-ua/sip_regc.h"
#include
"pjsip-ua/sip_regc.h"
#include
"noncopyable.h"
#include
"noncopyable.h"
typedef
std
::
vector
<
pj_ssl_cipher
>
CipherArray
;
namespace
Conf
{
namespace
Conf
{
class
YamlEmitter
;
class
YamlEmitter
;
class
MappingNode
;
class
MappingNode
;
...
@@ -638,6 +640,11 @@ class SIPAccount : public Account {
...
@@ -638,6 +640,11 @@ class SIPAccount : public Account {
*/
*/
pjsip_tls_setting
tlsSetting_
;
pjsip_tls_setting
tlsSetting_
;
/**
* Allocate a static array to be used by pjsip to store the supported ciphers on this system.
*/
CipherArray
ciphers
;
/**
/**
* The CONTACT header used for registration as provided by the registrar, this value could differ
* The CONTACT header used for registration as provided by the registrar, this value could differ
* from the host name in case the registrar is inside a subnetwork (such as a VPN).
* from the host name in case the registrar is inside a subnetwork (such as a VPN).
...
...
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