Save hosts immediately after pairing concludes to ensure the server cert is persisted

This commit is contained in:
Cameron Gutman 2022-08-24 00:20:02 -05:00
parent 0ff8a44ec3
commit f4acd629a1
2 changed files with 7 additions and 1 deletions

View File

@ -455,7 +455,8 @@ class PendingPairingTask : public QObject, public QRunnable
public:
PendingPairingTask(ComputerManager* computerManager, NvComputer* computer, QString pin)
: m_Computer(computer),
: m_ComputerManager(computerManager),
m_Computer(computer),
m_Pin(pin)
{
connect(this, &PendingPairingTask::pairingCompleted,
@ -484,6 +485,9 @@ private:
emit pairingCompleted(m_Computer, "Another pairing attempt is already in progress.");
break;
case NvPairingManager::PairState::PAIRED:
// Persist the newly pinned server certificate for this host
m_ComputerManager->saveHosts();
emit pairingCompleted(m_Computer, nullptr);
break;
}
@ -494,6 +498,7 @@ private:
}
}
ComputerManager* m_ComputerManager;
NvComputer* m_Computer;
QString m_Pin;
};

View File

@ -166,6 +166,7 @@ class ComputerManager : public QObject
friend class DeferredHostDeletionTask;
friend class PendingAddTask;
friend class PendingPairingTask;
public:
explicit ComputerManager(QObject *parent = nullptr);