From 9dc4d874c743def8c77af20ecc060e74c3009ca4 Mon Sep 17 00:00:00 2001 From: me_desk Date: Sat, 11 Aug 2012 03:05:26 +0000 Subject: 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 --- pica-client/accountswindow.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'pica-client') 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); -- cgit v1.2.1