summaryrefslogtreecommitdiffstats
path: root/pica-client/openssltool.cpp
diff options
context:
space:
mode:
authorme_desk <me_desk@fb96df88-216d-11de-830c-f3023f12d8ac>2013-08-30 13:34:02 +0000
committerme_desk <me_desk@fb96df88-216d-11de-830c-f3023f12d8ac>2013-08-30 13:34:02 +0000
commit0ef7c1d7471ce20fe54729c27858db864aedee91 (patch)
tree3a71b713febdbea19fc7358af68d9f6cfa3c3158 /pica-client/openssltool.cpp
parentbfd5528f28264772a245dc29f41d4bb5d29fb1eb (diff)
downloadpica-pica-0ef7c1d7471ce20fe54729c27858db864aedee91.tar.gz
pica-pica-0ef7c1d7471ce20fe54729c27858db864aedee91.zip
updated pica-client to make it handle new id format. quint32 type for id is replaced with QByteArray in most places. Implemented verification callbacks in client and node that allow self-signed certificates
git-svn-id: svn://localhost/project_picapica/trunk@266 fb96df88-216d-11de-830c-f3023f12d8ac
Diffstat (limited to 'pica-client/openssltool.cpp')
-rw-r--r--pica-client/openssltool.cpp20
1 files changed, 14 insertions, 6 deletions
diff --git a/pica-client/openssltool.cpp b/pica-client/openssltool.cpp
index 2c19223..705437e 100644
--- a/pica-client/openssltool.cpp
+++ b/pica-client/openssltool.cpp
@@ -20,12 +20,16 @@ QString OpenSSLTool::NameFromCertFile(QString cert_file)
return QString();
QByteArray result = openssl.readAll();
- QRegExp rx("CN = [0-9]+\\#([^\\s\\#]+)");
-
+ QRegExp rxOld("CN = [0-9]+\\#([^\\s\\#]+)");
+ QRegExp rx("CN = ([^\\s\\#]+)");
QString name=QString::fromUtf8( result.constData());
- if (name.contains(rx))
+ if (name.contains(rxOld))
+ {
+ name=rxOld.cap(1);
+ }
+ else if (name.contains(rx))
{
name=rx.cap(1);
}
@@ -48,12 +52,16 @@ QString OpenSSLTool::NameFromCertString(QString cert_pem)
return QString();
QByteArray result = openssl.readAll();
- QRegExp rx("CN = [0-9]+\\#([^\\s\\#]+)");
-
+ QRegExp rxOld("CN = [0-9]+\\#([^\\s\\#]+)");
+ QRegExp rx("CN = ([^\\s\\#]+)");
QString name=QString::fromUtf8( result.constData());
- if (name.contains(rx))
+ if (name.contains(rxOld))
+ {
+ name=rxOld.cap(1);
+ }
+ else if (name.contains(rx))
{
name=rx.cap(1);
}