don't free the RSA*, it seems not to properly clean up old references; refs #82

This commit is contained in:
Marc Wäckerlin
2011-06-14 07:26:34 +00:00
parent 96a3f1e4fe
commit 4add551a10
6 changed files with 98 additions and 99 deletions

View File

@@ -69,8 +69,7 @@ class CryptokiEngine: public QObject, public openssl::Engine {
RSA* rsa(0);
do {
rsa = ((RSA*)privkey.handle());
RSA_free(rsa); //→ occasional crashes?
rsa = RSA_new_method(_e);
RSA_set_method(rsa, ENGINE_get_RSA(_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");