mirror of
https://github.com/chris2511/xca.git
synced 2026-09-12 19:51:05 +05:00
Fix Null pointer exception when importing PKCS#12 with OpenSSL 1.1.0
Setting the EVP_PKEY type deletes the key with OpenSSL 1.1.0 Reported by Perederyaev Ivan. Thank you.
This commit is contained in:
parent
eaabb2a28d
commit
27482fc080
@ -31,9 +31,8 @@ QString pki_evp::passHash = QString();
|
||||
|
||||
QPixmap *pki_evp::icon[2]= { NULL, NULL };
|
||||
|
||||
void pki_evp::init(int type)
|
||||
void pki_evp::init()
|
||||
{
|
||||
EVP_PKEY_set_type(key, type);
|
||||
class_name = "pki_evp";
|
||||
ownPass = ptCommon;
|
||||
dataVersion=2;
|
||||
@ -150,16 +149,17 @@ void pki_evp::generate(int bits, int type, QProgressBar *progress, int curve_nid
|
||||
pki_evp::pki_evp(const pki_evp *pk)
|
||||
:pki_key(pk)
|
||||
{
|
||||
init(pk->getKeyType());
|
||||
init();
|
||||
pki_openssl_error();
|
||||
ownPass = pk->ownPass;
|
||||
encKey = pk->encKey;
|
||||
}
|
||||
|
||||
pki_evp::pki_evp(const QString name, int type )
|
||||
pki_evp::pki_evp(const QString name, int type)
|
||||
:pki_key(name)
|
||||
{
|
||||
init(type);
|
||||
init();
|
||||
EVP_PKEY_set_type(key, type);
|
||||
pki_openssl_error();
|
||||
}
|
||||
|
||||
|
||||
@ -22,7 +22,7 @@ class pki_evp: public pki_key
|
||||
Q_OBJECT
|
||||
protected:
|
||||
QByteArray encKey;
|
||||
void init(int type = EVP_PKEY_RSA);
|
||||
void init();
|
||||
void veryOldFromData(unsigned char *p, int size);
|
||||
void openssl_pw_error(QString fname);
|
||||
public:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user