with change, nothing works any more; refs #82

master
Marc Wäckerlin 14 years ago
parent 804e625e14
commit bbe3f9343a
  1. 30
      swisssurfer/src/smartcardauth.hxx
  2. 16
      swisssurfer/src/swisssurfer_de.ts
  3. 16
      swisssurfer/src/swisssurfer_en.ts
  4. 16
      swisssurfer/src/swisssurfer_fr.ts
  5. 16
      swisssurfer/src/swisssurfer_it.ts

@ -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,21 +68,20 @@ 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_new_method(_e);
set(rsa->n, privateKey, CKA_MODULUS, "CKA_MODULUS");
set(rsa->e, privateKey, CKA_PUBLIC_EXPONENT, "CKA_PUBLIC_EXPONENT");
set(rsa->d, privateKey, CKA_PRIVATE_EXPONENT, "CKA_PRIVATE_EXPONENT");
set(rsa->p, privateKey, CKA_PRIME_1, "CKA_PRIME_1");
set(rsa->q, privateKey, CKA_PRIME_2, "CKA_PRIME_2");
set(rsa->dmp1, privateKey, CKA_EXPONENT_1, "CKA_EXPONENT_1");
set(rsa->dmq1, privateKey, CKA_EXPONENT_2, "CKA_EXPONENT_2");
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());
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");
set(rsa->d, privateKey, CKA_PRIVATE_EXPONENT, "CKA_PRIVATE_EXPONENT");
set(rsa->p, privateKey, CKA_PRIME_1, "CKA_PRIME_1");
set(rsa->q, privateKey, CKA_PRIME_2, "CKA_PRIME_2");
set(rsa->dmp1, privateKey, CKA_EXPONENT_1, "CKA_EXPONENT_1");
set(rsa->dmq1, privateKey, CKA_EXPONENT_2, "CKA_EXPONENT_2");
set(rsa->iqmp, privateKey, CKA_COEFFICIENT, "CKA_COEFFICIENT");
rsa->flags |= RSA_FLAG_SIGN_VER; // don't emulate with encrypt/decrypt
assert(!privkey.isNull());
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...] [&lt;url&gt; ...]
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...] [&lt;url&gt; ...]
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...] [&lt;url&gt; ...]
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...] [&lt;url&gt; ...]
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>

Loading…
Cancel
Save