SSH agent support

This commit is contained in:
Toni Spets
2017-10-29 17:17:24 +02:00
parent 248ae9d4ba
commit 4840c2c64f
32 changed files with 3466 additions and 1 deletions

View File

@@ -23,6 +23,7 @@
#include <QScopedPointer>
#include "gui/EditWidget.h"
#include "config-keepassx.h"
class AutoTypeAssociations;
class AutoTypeAssociationsModel;
@@ -39,10 +40,15 @@ class QButtonGroup;
class QMenu;
class QSortFilterProxyModel;
class QStackedLayout;
#ifdef WITH_XC_SSHAGENT
#include "sshagent/KeeAgentSettings.h"
class OpenSSHKey;
#endif
namespace Ui {
class EditEntryWidgetAdvanced;
class EditEntryWidgetAutoType;
class EditEntryWidgetSSHAgent;
class EditEntryWidgetMain;
class EditEntryWidgetHistory;
class EditWidget;
@@ -102,12 +108,24 @@ private slots:
void useExpiryPreset(QAction* action);
void updateAttachmentButtonsEnabled(const QModelIndex& current);
void toggleHideNotes(bool visible);
#ifdef WITH_XC_SSHAGENT
void updateSSHAgent();
void updateSSHAgentKeyInfo();
void browsePrivateKey();
void addKeyToAgent();
void removeKeyFromAgent();
void decryptPrivateKey();
void copyPublicKey();
#endif
private:
void setupMain();
void setupAdvanced();
void setupIcon();
void setupAutoType();
#ifdef WITH_XC_SSHAGENT
void setupSSHAgent();
#endif
void setupProperties();
void setupHistory();
@@ -115,6 +133,10 @@ private:
void setForms(const Entry* entry, bool restore = false);
QMenu* createPresetsMenu();
void updateEntryData(Entry* entry) const;
#ifdef WITH_XC_SSHAGENT
bool getOpenSSHKey(OpenSSHKey& key);
void saveSSHAgentConfig();
#endif
void displayAttribute(QModelIndex index, bool showProtected);
@@ -125,14 +147,20 @@ private:
bool m_create;
bool m_history;
#ifdef WITH_XC_SSHAGENT
bool m_sshAgentEnabled;
KeeAgentSettings m_sshAgentSettings;
#endif
const QScopedPointer<Ui::EditEntryWidgetMain> m_mainUi;
const QScopedPointer<Ui::EditEntryWidgetAdvanced> m_advancedUi;
const QScopedPointer<Ui::EditEntryWidgetAutoType> m_autoTypeUi;
const QScopedPointer<Ui::EditEntryWidgetSSHAgent> m_sshAgentUi;
const QScopedPointer<Ui::EditEntryWidgetHistory> m_historyUi;
QWidget* const m_mainWidget;
QWidget* const m_advancedWidget;
EditWidgetIcons* const m_iconsWidget;
QWidget* const m_autoTypeWidget;
QWidget* const m_sshAgentWidget;
EditWidgetProperties* const m_editWidgetProperties;
QWidget* const m_historyWidget;
EntryAttachments* const m_entryAttachments;