mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 03:44:02 +02:00
warning, plus salting passphrase now
This commit is contained in:
parent
efdc340c5c
commit
bb07a586ca
1 changed files with 5 additions and 3 deletions
|
@ -55,9 +55,12 @@ QString imageFilePath() {
|
|||
// use the cached _passphrase if it exists, otherwise we need to prompt
|
||||
int passwordCallback(char* password, int maxPasswordSize, int rwFlag, void* u) {
|
||||
// just return a hardcoded pwd for now
|
||||
auto passphrase = DependencyManager::get<Wallet>()->getPassphrase();
|
||||
auto wallet = DependencyManager::get<Wallet>();
|
||||
auto passphrase = wallet->getPassphrase();
|
||||
if (passphrase && !passphrase->isEmpty()) {
|
||||
strcpy(password, passphrase->toLocal8Bit().constData());
|
||||
QString saltedPassphrase(*passphrase);
|
||||
saltedPassphrase.append(wallet->getSalt());
|
||||
strcpy(password, saltedPassphrase.toUtf8().constData());
|
||||
return static_cast<int>(passphrase->size());
|
||||
} else {
|
||||
// this shouldn't happen - so lets log it to tell us we have
|
||||
|
@ -254,7 +257,6 @@ RSA* readPrivateKey(const char* filename) {
|
|||
}
|
||||
return key;
|
||||
}
|
||||
static const unsigned char IVEC[16] = "IAmAnIVecYay123";
|
||||
|
||||
void initializeAESKeys(unsigned char* ivec, unsigned char* ckey, const QByteArray& salt) {
|
||||
// use the ones in the wallet
|
||||
|
|
Loading…
Reference in a new issue