diff options
| author | me_desk <me_desk@fb96df88-216d-11de-830c-f3023f12d8ac> | 2012-06-17 21:15:12 +0000 |
|---|---|---|
| committer | me_desk <me_desk@fb96df88-216d-11de-830c-f3023f12d8ac> | 2012-06-17 21:15:12 +0000 |
| commit | 8df9466ada46e4b07990b9cb7e8b1cd61b96844a (patch) | |
| tree | 2cb652e5839bed672133ffa90e7ad477f55cfb6b /pica-client/dialogs/forgedcertdialog.cpp | |
| download | pica-pica-8df9466ada46e4b07990b9cb7e8b1cd61b96844a.tar.gz pica-pica-8df9466ada46e4b07990b9cb7e8b1cd61b96844a.zip | |
todo list update
git-svn-id: svn://localhost/project_picapica/trunk@128 fb96df88-216d-11de-830c-f3023f12d8ac
Diffstat (limited to 'pica-client/dialogs/forgedcertdialog.cpp')
| -rw-r--r-- | pica-client/dialogs/forgedcertdialog.cpp | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/pica-client/dialogs/forgedcertdialog.cpp b/pica-client/dialogs/forgedcertdialog.cpp new file mode 100644 index 0000000..5ca7f23 --- /dev/null +++ b/pica-client/dialogs/forgedcertdialog.cpp @@ -0,0 +1,53 @@ +#include "forgedcertdialog.h" +#include "viewcertdialog.h" +#include <QGridLayout> +#include <QLabel> + +ForgedCertDialog::ForgedCertDialog(quint32 peer_id, QString received_cert, QString stored_cert, QWidget *parent) : + QDialog(parent), + received_cert_(received_cert), + stored_cert_(stored_cert) +{ + QGridLayout *grid = new QGridLayout(this); + + QLabel *scary_text = new QLabel(tr( +"Previously stored and currently present certificates for user %1 do not match.\n\ +This means that probably someone is trying to eavesdrop your communication\n\ +using man-in-the-middle attack or impersonate the user.\n\ +Connection aborted.").arg(peer_id)); + + btOK = new QPushButton(tr("OK")); + btShow_stored_cert = new QPushButton(tr("View Stored Certificate...")); + btShow_received_cert = new QPushButton(tr("View Received Certificate...")); + + grid->addWidget(scary_text, 0,0, 1, 3, Qt::AlignCenter); + grid->addWidget(btShow_stored_cert, 1, 0, Qt::AlignCenter); + grid->addWidget(btShow_received_cert, 1, 2, Qt::AlignCenter); + grid->addWidget(btOK, 2, 1, Qt::AlignCenter); + + + setLayout(grid); + + connect(btOK, SIGNAL(clicked()), this, SLOT(OK())); + connect(btShow_stored_cert, SIGNAL(clicked()), this, SLOT(StoredCert())); + connect(btShow_received_cert, SIGNAL(clicked()), this, SLOT(ReceivedCert())); +} + +void ForgedCertDialog::OK() +{ + done(0); +} + +void ForgedCertDialog::ReceivedCert() +{ + ViewCertDialog vcd; + vcd.SetCert(received_cert_); + vcd.exec(); +} + +void ForgedCertDialog::StoredCert() +{ + ViewCertDialog vcd; + vcd.SetCert(stored_cert_); + vcd.exec(); +} |
