with change, nothing works any more; refs #82
This commit is contained in:
@@ -55,6 +55,7 @@ class CryptokiEngine: public QObject, public openssl::Engine {
|
||||
sslConfig.setLocalCertificate(localcert);
|
||||
assert(localcert.isValid());
|
||||
|
||||
//RSA_set_default_method(ENGINE_get_RSA(_e));
|
||||
QByteArray pem // empty dummy key for qt object instantiation
|
||||
("-----BEGIN RSA PRIVATE KEY-----\n"
|
||||
"MIIBOwIBAAJBAMH2yqAGeVNPdgeZ2GoHo31m9aUxZ7QfK2Go2qLTahLpQ3UL1C8G\n"
|
||||
@@ -67,9 +68,8 @@ class CryptokiEngine: public QObject, public openssl::Engine {
|
||||
"-----END RSA PRIVATE KEY-----\n");
|
||||
QSslKey privkey(pem, QSsl::Rsa, QSsl::Pem, QSsl::PrivateKey);
|
||||
RSA* rsa(0);
|
||||
do {
|
||||
rsa = ((RSA*)privkey.handle());
|
||||
//! @todo call RSA_free(rsa); later, see #82
|
||||
rsa = (RSA*)privkey.handle();
|
||||
if (rsa) RSA_free(rsa);
|
||||
rsa = RSA_new_method(_e);
|
||||
set(rsa->n, privateKey, CKA_MODULUS, "CKA_MODULUS");
|
||||
set(rsa->e, privateKey, CKA_PUBLIC_EXPONENT, "CKA_PUBLIC_EXPONENT");
|
||||
@@ -81,7 +81,7 @@ class CryptokiEngine: public QObject, public openssl::Engine {
|
||||
set(rsa->iqmp, privateKey, CKA_COEFFICIENT, "CKA_COEFFICIENT");
|
||||
rsa->flags |= RSA_FLAG_SIGN_VER; // don't emulate with encrypt/decrypt
|
||||
assert(!privkey.isNull());
|
||||
} while (rsa!=(RSA*)privkey.handle());
|
||||
assert(rsa==(RSA*)privkey.handle());
|
||||
sslConfig.setPrivateKey(privkey);
|
||||
QSslConfiguration::setDefaultConfiguration(sslConfig);
|
||||
} catch (const std::exception& e) {
|
||||
|
@@ -675,12 +675,12 @@ p, li { white-space: pre-wrap; }
|
||||
<context>
|
||||
<name>QMessageBox</name>
|
||||
<message>
|
||||
<location filename="smartcardauth.hxx" line="216"/>
|
||||
<location filename="smartcardauth.hxx" line="217"/>
|
||||
<source>Wrong PIN</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="smartcardauth.hxx" line="217"/>
|
||||
<location filename="smartcardauth.hxx" line="218"/>
|
||||
<source>Authentication failed, please try again.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
@@ -688,7 +688,7 @@ p, li { white-space: pre-wrap; }
|
||||
<context>
|
||||
<name>QObject</name>
|
||||
<message>
|
||||
<location filename="main.cxx" line="305"/>
|
||||
<location filename="main.cxx" line="307"/>
|
||||
<source>Usage: %1 [OPTIONS...] [<url> ...]
|
||||
Options:
|
||||
-h, --help show this help text
|
||||
@@ -736,27 +736,27 @@ Environment:
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main.cxx" line="350"/>
|
||||
<location filename="main.cxx" line="352"/>
|
||||
<source>Cannot read PEM certificate from file: %1</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main.cxx" line="356"/>
|
||||
<location filename="main.cxx" line="358"/>
|
||||
<source>Read PEM certificates from file: %1</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main.cxx" line="363"/>
|
||||
<location filename="main.cxx" line="365"/>
|
||||
<source>Cannot read PEM RSA key from file: %1</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main.cxx" line="368"/>
|
||||
<location filename="main.cxx" line="370"/>
|
||||
<source>Read private key from file: %1</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main.cxx" line="379"/>
|
||||
<location filename="main.cxx" line="381"/>
|
||||
<source>Too few arguments.
|
||||
Try: %1 --help</source>
|
||||
<translation type="unfinished"></translation>
|
||||
|
@@ -660,12 +660,12 @@ p, li { white-space: pre-wrap; }
|
||||
<context>
|
||||
<name>QMessageBox</name>
|
||||
<message>
|
||||
<location filename="smartcardauth.hxx" line="216"/>
|
||||
<location filename="smartcardauth.hxx" line="217"/>
|
||||
<source>Wrong PIN</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="smartcardauth.hxx" line="217"/>
|
||||
<location filename="smartcardauth.hxx" line="218"/>
|
||||
<source>Authentication failed, please try again.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
@@ -673,7 +673,7 @@ p, li { white-space: pre-wrap; }
|
||||
<context>
|
||||
<name>QObject</name>
|
||||
<message>
|
||||
<location filename="main.cxx" line="305"/>
|
||||
<location filename="main.cxx" line="307"/>
|
||||
<source>Usage: %1 [OPTIONS...] [<url> ...]
|
||||
Options:
|
||||
-h, --help show this help text
|
||||
@@ -699,27 +699,27 @@ Environment:
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main.cxx" line="350"/>
|
||||
<location filename="main.cxx" line="352"/>
|
||||
<source>Cannot read PEM certificate from file: %1</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main.cxx" line="356"/>
|
||||
<location filename="main.cxx" line="358"/>
|
||||
<source>Read PEM certificates from file: %1</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main.cxx" line="363"/>
|
||||
<location filename="main.cxx" line="365"/>
|
||||
<source>Cannot read PEM RSA key from file: %1</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main.cxx" line="368"/>
|
||||
<location filename="main.cxx" line="370"/>
|
||||
<source>Read private key from file: %1</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main.cxx" line="379"/>
|
||||
<location filename="main.cxx" line="381"/>
|
||||
<source>Too few arguments.
|
||||
Try: %1 --help</source>
|
||||
<translation type="unfinished"></translation>
|
||||
|
@@ -675,12 +675,12 @@ p, li { white-space: pre-wrap; }
|
||||
<context>
|
||||
<name>QMessageBox</name>
|
||||
<message>
|
||||
<location filename="smartcardauth.hxx" line="216"/>
|
||||
<location filename="smartcardauth.hxx" line="217"/>
|
||||
<source>Wrong PIN</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="smartcardauth.hxx" line="217"/>
|
||||
<location filename="smartcardauth.hxx" line="218"/>
|
||||
<source>Authentication failed, please try again.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
@@ -688,7 +688,7 @@ p, li { white-space: pre-wrap; }
|
||||
<context>
|
||||
<name>QObject</name>
|
||||
<message>
|
||||
<location filename="main.cxx" line="305"/>
|
||||
<location filename="main.cxx" line="307"/>
|
||||
<source>Usage: %1 [OPTIONS...] [<url> ...]
|
||||
Options:
|
||||
-h, --help show this help text
|
||||
@@ -736,27 +736,27 @@ Environment:
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main.cxx" line="350"/>
|
||||
<location filename="main.cxx" line="352"/>
|
||||
<source>Cannot read PEM certificate from file: %1</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main.cxx" line="356"/>
|
||||
<location filename="main.cxx" line="358"/>
|
||||
<source>Read PEM certificates from file: %1</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main.cxx" line="363"/>
|
||||
<location filename="main.cxx" line="365"/>
|
||||
<source>Cannot read PEM RSA key from file: %1</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main.cxx" line="368"/>
|
||||
<location filename="main.cxx" line="370"/>
|
||||
<source>Read private key from file: %1</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main.cxx" line="379"/>
|
||||
<location filename="main.cxx" line="381"/>
|
||||
<source>Too few arguments.
|
||||
Try: %1 --help</source>
|
||||
<translation type="unfinished"></translation>
|
||||
|
@@ -675,12 +675,12 @@ p, li { white-space: pre-wrap; }
|
||||
<context>
|
||||
<name>QMessageBox</name>
|
||||
<message>
|
||||
<location filename="smartcardauth.hxx" line="216"/>
|
||||
<location filename="smartcardauth.hxx" line="217"/>
|
||||
<source>Wrong PIN</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="smartcardauth.hxx" line="217"/>
|
||||
<location filename="smartcardauth.hxx" line="218"/>
|
||||
<source>Authentication failed, please try again.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
@@ -688,7 +688,7 @@ p, li { white-space: pre-wrap; }
|
||||
<context>
|
||||
<name>QObject</name>
|
||||
<message>
|
||||
<location filename="main.cxx" line="305"/>
|
||||
<location filename="main.cxx" line="307"/>
|
||||
<source>Usage: %1 [OPTIONS...] [<url> ...]
|
||||
Options:
|
||||
-h, --help show this help text
|
||||
@@ -736,27 +736,27 @@ Environment:
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main.cxx" line="350"/>
|
||||
<location filename="main.cxx" line="352"/>
|
||||
<source>Cannot read PEM certificate from file: %1</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main.cxx" line="356"/>
|
||||
<location filename="main.cxx" line="358"/>
|
||||
<source>Read PEM certificates from file: %1</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main.cxx" line="363"/>
|
||||
<location filename="main.cxx" line="365"/>
|
||||
<source>Cannot read PEM RSA key from file: %1</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main.cxx" line="368"/>
|
||||
<location filename="main.cxx" line="370"/>
|
||||
<source>Read private key from file: %1</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main.cxx" line="379"/>
|
||||
<location filename="main.cxx" line="381"/>
|
||||
<source>Too few arguments.
|
||||
Try: %1 --help</source>
|
||||
<translation type="unfinished"></translation>
|
||||
|
Reference in New Issue
Block a user