diff options
Diffstat (limited to 'pica-client/openssllib.cpp')
| -rw-r--r-- | pica-client/openssllib.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/pica-client/openssllib.cpp b/pica-client/openssllib.cpp index 1dc5ad1..694eef2 100644 --- a/pica-client/openssllib.cpp +++ b/pica-client/openssllib.cpp @@ -30,7 +30,7 @@ #include <openssl/dh.h> #include <QFile> -#include <QRegExp> +#include <QRegularExpression> #include <QThread> #define REGEXOLD "CN = [0-9]+\\#([^\\#\\$&\"\'=\\(\\)\\\\/\\|`!<>\\{\\}\\[\\]\\+\r\n]+)" @@ -154,18 +154,17 @@ static QString SubjectLine(X509 *cert) static QString NameFromSubjectLine(QString subject_line) { - QRegExp rxOld(REGEXOLD); - QRegExp rx(REGEXNEW); + QRegularExpressionMatch m; QString name = subject_line; - if (name.contains(rxOld)) + if ((m = QRegularExpression(REGEXOLD).match(name)).hasMatch()) { - name = rxOld.cap(1); + name = m.captured(1); } - else if (name.contains(rx)) + else if ((m = QRegularExpression(REGEXNEW).match(name)).hasMatch()) { - name = rx.cap(1); + name = m.captured(1); } return name; @@ -302,7 +301,7 @@ void OpenSSLLibWorker::RunGenRSAKey() quint32 numbits; /* - * Generate random-sized key with min size 4096 and multiply of 8. + * Generate random-sized key with min size 4096 and multiple of 8. * Max size is limited to 4096 + 99*8. * See https://blog.josefsson.org/2016/11/03/why-i-dont-use-2048-or-4096-rsa-key-sizes/ * "Why I don’t Use 2048 or 4096 RSA Key Sizes" |
