Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Donald Haase
Cockatrice
Commits
2deabebc
Commit
2deabebc
authored
Jan 12, 2013
by
Max-Wilhelm Bruker
Browse files
added PasswordHasher::initialize() to make libgcrypt warnings go away
parent
2789116d
Changes
3
Hide whitespace changes
Inline
Side-by-side
servatrice/src/main.cpp
View file @
2deabebc
...
@@ -157,6 +157,8 @@ int main(int argc, char *argv[])
...
@@ -157,6 +157,8 @@ int main(int argc, char *argv[])
std
::
cerr
<<
"Servatrice "
<<
VERSION_STRING
<<
" starting."
<<
std
::
endl
;
std
::
cerr
<<
"Servatrice "
<<
VERSION_STRING
<<
" starting."
<<
std
::
endl
;
std
::
cerr
<<
"-------------------------"
<<
std
::
endl
;
std
::
cerr
<<
"-------------------------"
<<
std
::
endl
;
PasswordHasher
::
initialize
();
if
(
testRandom
)
if
(
testRandom
)
testRNG
();
testRNG
();
if
(
testHashFunction
)
if
(
testHashFunction
)
...
...
servatrice/src/passwordhasher.cpp
View file @
2deabebc
...
@@ -3,6 +3,14 @@
...
@@ -3,6 +3,14 @@
#include
<string.h>
#include
<string.h>
#include
<gcrypt.h>
#include
<gcrypt.h>
void
PasswordHasher
::
initialize
()
{
// These calls are required by libgcrypt before we use any of its functions.
gcry_check_version
(
0
);
gcry_control
(
GCRYCTL_DISABLE_SECMEM
,
0
);
gcry_control
(
GCRYCTL_INITIALIZATION_FINISHED
,
0
);
}
QString
PasswordHasher
::
computeHash
(
const
QString
&
password
,
const
QString
&
salt
)
QString
PasswordHasher
::
computeHash
(
const
QString
&
password
,
const
QString
&
salt
)
{
{
const
int
algo
=
GCRY_MD_SHA512
;
const
int
algo
=
GCRY_MD_SHA512
;
...
...
servatrice/src/passwordhasher.h
View file @
2deabebc
...
@@ -5,6 +5,7 @@
...
@@ -5,6 +5,7 @@
class
PasswordHasher
{
class
PasswordHasher
{
public:
public:
static
void
initialize
();
static
QString
computeHash
(
const
QString
&
password
,
const
QString
&
salt
);
static
QString
computeHash
(
const
QString
&
password
,
const
QString
&
salt
);
};
};
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment