mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
get earlier code changes to work
This commit is contained in:
parent
da72e46a15
commit
8b8f1e84b8
@ -307,14 +307,18 @@ namespace controller {
|
||||
if (-1 == user_backup->getModel()->getMnemonicType()) {
|
||||
continue;
|
||||
}
|
||||
auto key_pair = std::unique_ptr<KeyPairEd25519>(user_backup->createGradidoKeyPair());
|
||||
auto key_pair = user_backup->createGradidoKeyPair();
|
||||
|
||||
if (key_pair->isTheSame(user_model->getPublicKey())) {
|
||||
if (createdKeyPair) {
|
||||
*createdKeyPair = key_pair.get();
|
||||
*createdKeyPair = key_pair;
|
||||
}
|
||||
else {
|
||||
delete key_pair;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
delete key_pair;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -71,11 +71,11 @@ int SigningTransaction::run() {
|
||||
//auto privKey = mUser->getPrivKey();
|
||||
//if (!mUser->hasPrivKey()) {
|
||||
auto gradido_key_pair = mNewUser->getGradidoKeyPair();
|
||||
|
||||
KeyPairEd25519* recovered_gradido_key_pair = nullptr;
|
||||
if(!gradido_key_pair || !gradido_key_pair->hasPrivateKey()) {
|
||||
KeyPairEd25519** key_pair_ptr = nullptr;
|
||||
if (!mNewUser->tryLoadPassphraseUserBackup(key_pair_ptr)) {
|
||||
if(mNewUser->setGradidoKeyPair(*key_pair_ptr))
|
||||
|
||||
if (!mNewUser->tryLoadPassphraseUserBackup(&recovered_gradido_key_pair)) {
|
||||
if(mNewUser->setGradidoKeyPair(recovered_gradido_key_pair))
|
||||
{
|
||||
mNewUser->getModel()->updatePrivkey();
|
||||
}
|
||||
@ -97,7 +97,13 @@ int SigningTransaction::run() {
|
||||
}
|
||||
// sign
|
||||
//auto sign = mUser->sign((const unsigned char*)bodyBytes->data(), bodyBytes->size());
|
||||
auto sign = gradido_key_pair->sign(*bodyBytes);
|
||||
MemoryBin* sign = nullptr;
|
||||
if (gradido_key_pair) {
|
||||
sign = gradido_key_pair->sign(*bodyBytes);
|
||||
}
|
||||
else if (recovered_gradido_key_pair) {
|
||||
sign = recovered_gradido_key_pair->sign(*bodyBytes);
|
||||
}
|
||||
if (!sign) {
|
||||
ErrorManager::getInstance()->sendErrorsAsEmail();
|
||||
sendErrorsAsEmail();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user