Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
dcdb
dcdb
Commits
16a940c8
Commit
16a940c8
authored
May 28, 2020
by
Michael Ott
Browse files
Fix sha1 hashes for REST API passwords
parent
5e257fcc
Changes
4
Hide whitespace changes
Inline
Side-by-side
collectagent/config/collectagent.conf
View file @
16a940c8
...
...
@@ -19,7 +19,7 @@ restAPI {
dhFile
/
Users
/
di34bap
/
Projects
/
dcdb
-
devel
/
deps
/
openssl
-
1
.
1
.
1
c
/
crypto
/
dh
/
dh2048
.
pem
user
admin
{
password
d033e22ae348aeb5660fc214aec3585c4da997
password
d033e22ae348aeb5660fc214
0
aec3585
0
c4da997
PUT
GET
}
...
...
common/src/RESTHttpsServer.cpp
View file @
16a940c8
...
...
@@ -290,9 +290,8 @@ bool RESTHttpsServer::validateUser(const http::request<Body>& req, Send&& send)
unsigned
hash
[
5
]
=
{
0
};
sha1
.
get_digest
(
hash
);
std
::
stringstream
ss
;
ss
<<
std
::
hex
<<
std
::
setw
(
8
)
<<
std
::
setfill
(
' '
);
for
(
int
i
=
0
;
i
<
5
;
i
++
)
{
ss
<<
hash
[
i
];
ss
<<
std
::
hex
<<
std
::
setfill
(
'0'
)
<<
std
::
setw
(
8
)
<<
hash
[
i
];
}
if
(
ss
.
str
()
!=
userData
.
first
)
{
...
...
common/src/globalconfiguration.cpp
View file @
16a940c8
...
...
@@ -178,7 +178,7 @@ bool GlobalConfiguration::readRestAPIUsers(RESTHttpsServer* server) {
#endif
}
}
if
(
attributes
.
first
.
size
()
!=
38
)
{
if
(
attributes
.
first
.
size
()
!=
40
)
{
LOG
(
warning
)
<<
"User "
<<
username
<<
"'s password does not appear to be a sha1 hash!"
;
}
else
if
(
server
->
addUser
(
username
,
attributes
))
{
LOG
(
warning
)
<<
"User "
<<
username
<<
" already existed and was overwritten!"
;
...
...
dcdbpusher/config/dcdbpusher.conf
View file @
16a940c8
...
...
@@ -17,7 +17,7 @@ restAPI {
dhFile
../../
deps
/
openssl
-
1
.
1
.
1
c
/
crypto
/
dh
/
dh2048
.
pem
user
admin
{
password
d033e22ae348aeb5660fc214aec3585c4da997
password
d033e22ae348aeb5660fc214
0
aec3585
0
c4da997
PUT
GET
}
...
...
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