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
fcb7b8f8
Commit
fcb7b8f8
authored
12 years ago
by
Tristan Matthews
Browse files
Options
Downloads
Patches
Plain Diff
* #9847: don't use assertions for input coming from DBus
parent
d7300288
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
daemon/src/dbus/configurationmanager.cpp
+9
-13
9 additions, 13 deletions
daemon/src/dbus/configurationmanager.cpp
daemon/src/sip/sipaccount.cpp
+12
-8
12 additions, 8 deletions
daemon/src/sip/sipaccount.cpp
daemon/src/sip/sipaccount.h
+3
-1
3 additions, 1 deletion
daemon/src/sip/sipaccount.h
with
24 additions
and
22 deletions
daemon/src/dbus/configurationmanager.cpp
+
9
−
13
View file @
fcb7b8f8
...
...
@@ -56,12 +56,12 @@ std::map<std::string, std::string> ConfigurationManager::getIp2IpDetails()
SIPAccount
*
sipaccount
=
Manager
::
instance
().
getIP2IPAccount
();
if
(
!
sipaccount
)
{
ERROR
(
"ConfigurationManager: could not find account"
);
ERROR
(
"ConfigurationManager: could not find
IP2IP
account"
);
return
ip2ipAccountDetails
;
}
else
return
sipaccount
->
getIp2IpDetails
();
std
::
map
<
std
::
string
,
std
::
string
>
tlsSettings
=
getTlsSettings
();
std
::
map
<
std
::
string
,
std
::
string
>
tlsSettings
(
getTlsSettings
()
)
;
std
::
copy
(
tlsSettings
.
begin
(),
tlsSettings
.
end
(),
std
::
inserter
(
ip2ipAccountDetails
,
ip2ipAccountDetails
.
end
()));
...
...
@@ -442,23 +442,19 @@ void ConfigurationManager::setShortcuts(
std
::
vector
<
std
::
map
<
std
::
string
,
std
::
string
>
>
ConfigurationManager
::
getCredentials
(
const
std
::
string
&
accountID
)
{
Account
*
account
=
Manager
::
instance
().
getAccount
(
accountID
);
SIP
Account
*
account
=
dynamic_cast
<
SIPAccount
*>
(
Manager
::
instance
().
getAccount
(
accountID
)
)
;
std
::
vector
<
std
::
map
<
std
::
string
,
std
::
string
>
>
credentialInformation
;
if
(
!
account
or
account
->
getType
()
!=
"SIP"
)
if
(
!
account
)
return
credentialInformation
;
SIPAccount
*
sipaccount
=
static_cast
<
SIPAccount
*>
(
account
);
return
sipaccount
->
getCredentials
();
else
return
account
->
getCredentials
();
}
void
ConfigurationManager
::
setCredentials
(
const
std
::
string
&
accountID
,
const
std
::
vector
<
std
::
map
<
std
::
string
,
std
::
string
>
>&
details
)
{
Account
*
account
=
Manager
::
instance
().
getAccount
(
accountID
);
if
(
account
and
account
->
getType
()
==
"SIP"
)
{
SIPAccount
*
sipaccount
=
static_cast
<
SIPAccount
*>
(
account
);
sipaccount
->
setCredentials
(
details
);
}
SIPAccount
*
account
=
dynamic_cast
<
SIPAccount
*>
(
Manager
::
instance
().
getAccount
(
accountID
));
if
(
account
)
account
->
setCredentials
(
details
);
}
This diff is collapsed.
Click to expand it.
daemon/src/sip/sipaccount.cpp
+
12
−
8
View file @
fcb7b8f8
...
...
@@ -42,9 +42,8 @@
#include
"manager.h"
#include
<pwd.h>
#include
<sstream>
#include
<cassert>
const
char
*
const
SIPAccount
::
IP2IP_PROFILE
=
"IP2IP"
;
const
char
*
const
SIPAccount
::
IP2IP_PROFILE
=
"IP2IP"
;
const
char
*
const
SIPAccount
::
OVERRTP_STR
=
"overrtp"
;
const
char
*
const
SIPAccount
::
SIPINFO_STR
=
"sipinfo"
;
...
...
@@ -872,6 +871,7 @@ std::string computeMd5HashFromCredential(const std::string& username,
MD5_APPEND
(
&
pms
,
realm
.
data
(),
realm
.
length
());
MD5_APPEND
(
&
pms
,
":"
,
1
);
MD5_APPEND
(
&
pms
,
password
.
data
(),
password
.
length
());
#undef MD5_APPEND
unsigned
char
digest
[
16
];
pj_md5_final
(
&
pms
,
digest
);
...
...
@@ -887,14 +887,18 @@ std::string computeMd5HashFromCredential(const std::string& username,
void
SIPAccount
::
setCredentials
(
const
std
::
vector
<
std
::
map
<
std
::
string
,
std
::
string
>
>&
creds
)
{
// we can not authenticate without credentials
if
(
creds
.
empty
())
{
ERROR
(
"SIPAccount: Cannot authenticate with empty credentials list"
);
return
;
}
using
std
::
vector
;
using
std
::
string
;
using
std
::
map
;
bool
md5HashingEnabled
=
Manager
::
instance
().
preferences
.
getMd5Hash
();
assert
(
not
creds
.
empty
());
// we can not authenticate without credentials
credentials_
=
creds
;
/* md5 hashing */
...
...
@@ -951,7 +955,8 @@ void SIPAccount::setCredentials(const std::vector<std::map<std::string, std::str
}
}
const
std
::
vector
<
std
::
map
<
std
::
string
,
std
::
string
>
>
&
SIPAccount
::
getCredentials
()
const
std
::
vector
<
std
::
map
<
std
::
string
,
std
::
string
>
>
&
SIPAccount
::
getCredentials
()
const
{
return
credentials_
;
}
...
...
@@ -983,8 +988,7 @@ std::map<std::string, std::string> SIPAccount::getIp2IpDetails() const
portstr
<<
localPort_
;
ip2ipAccountDetails
[
CONFIG_LOCAL_PORT
]
=
portstr
.
str
();
std
::
map
<
std
::
string
,
std
::
string
>
tlsSettings
;
tlsSettings
=
getTlsSettings
();
std
::
map
<
std
::
string
,
std
::
string
>
tlsSettings
(
getTlsSettings
());
std
::
copy
(
tlsSettings
.
begin
(),
tlsSettings
.
end
(),
std
::
inserter
(
ip2ipAccountDetails
,
ip2ipAccountDetails
.
end
()));
...
...
@@ -993,8 +997,8 @@ std::map<std::string, std::string> SIPAccount::getIp2IpDetails() const
std
::
map
<
std
::
string
,
std
::
string
>
SIPAccount
::
getTlsSettings
()
const
{
std
::
map
<
std
::
string
,
std
::
string
>
tlsSettings
;
assert
(
isIP2IP
());
std
::
map
<
std
::
string
,
std
::
string
>
tlsSettings
;
std
::
stringstream
portstr
;
portstr
<<
tlsListenerPort_
;
...
...
This diff is collapsed.
Click to expand it.
daemon/src/sip/sipaccount.h
+
3
−
1
View file @
fcb7b8f8
...
...
@@ -205,7 +205,9 @@ class SIPAccount : public Account {
}
void
setCredentials
(
const
std
::
vector
<
std
::
map
<
std
::
string
,
std
::
string
>
>&
details
);
const
std
::
vector
<
std
::
map
<
std
::
string
,
std
::
string
>
>
&
getCredentials
();
const
std
::
vector
<
std
::
map
<
std
::
string
,
std
::
string
>
>
&
getCredentials
()
const
;
/**
* A client sendings a REGISTER request MAY suggest an expiration
...
...
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