MicrochipTech / cryptoauth-openssl-engine

DEPRECATED: Use https://github.com/MicrochipTech/cryptoauthlib/wiki/PKCS11-Linux-Setup
Other
76 stars 49 forks source link

Copy engine pointer without increasing refcounter #19

Closed webconn closed 6 years ago

webconn commented 6 years ago

https://github.com/MicrochipTech/cryptoauth-openssl-engine/blob/0cc4a3a562f070e508fe21d476394e59e99e567b/cryptoauthlib/lib/openssl/eccx08_eckey_meth.c#L172

This code makes OpenSSL app fail on exit (e->funct_ref < 0).

According to other OpenSSL modules, it should be done like this:

if (!ENGINE_init(e)) {
    break;
}
pkey->engine = e;