summaryrefslogtreecommitdiffstats
path: root/pica-client/accountswindow.cpp
diff options
context:
space:
mode:
authorme_desk <me_desk@fb96df88-216d-11de-830c-f3023f12d8ac>2012-08-11 03:05:26 +0000
committerme_desk <me_desk@fb96df88-216d-11de-830c-f3023f12d8ac>2012-08-11 03:05:26 +0000
commit9dc4d874c743def8c77af20ecc060e74c3009ca4 (patch)
tree989a0f7b6676a36def50ff1c80a8d9064b841b40 /pica-client/accountswindow.cpp
parentcc2105b2b261f557838fec640d201d93f4c89665 (diff)
downloadpica-pica-9dc4d874c743def8c77af20ecc060e74c3009ca4.tar.gz
pica-pica-9dc4d874c743def8c77af20ecc060e74c3009ca4.zip
client certificate with user id == 0 is considered invalid from now, for error detection purposes (like a NULL pointer)
git-svn-id: svn://localhost/project_picapica/trunk@159 fb96df88-216d-11de-830c-f3023f12d8ac
Diffstat (limited to 'pica-client/accountswindow.cpp')
-rw-r--r--pica-client/accountswindow.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/pica-client/accountswindow.cpp b/pica-client/accountswindow.cpp
index b38b5c0..4ad1c75 100644
--- a/pica-client/accountswindow.cpp
+++ b/pica-client/accountswindow.cpp
@@ -109,8 +109,17 @@ void AccountsWindow::login_click()
void AccountsWindow::CreateAccount(QString CertFilename, QString PkeyFilename, bool copyfiles)
{
quint32 id;
+ int ret;
- PICA_get_id_from_cert(CertFilename.toUtf8().constData(),&id);
+ ret = PICA_get_id_from_cert(CertFilename.toUtf8().constData(),&id);
+
+ if (0 == id || 0 == ret)
+ {
+ QMessageBox mbx;
+ mbx.setText("Invalid certificate");
+ mbx.exec();
+ return;
+ }
QString name = OpenSSLTool::NameFromCertFile(CertFilename);