kenh / keychain-pkcs11

A shared library that implements a PKCS#11 interface to the Apple Security framework
100 stars 10 forks source link

Fix bad memory access on modulus and exponent #10

Closed sighup1 closed 3 years ago

sighup1 commented 3 years ago

Hi Ken,

I added some guard statements before adding the modulus and exponent. I am having an issue where the keychain-pkcs11 library segfaults when I plug in a security key with a code signing certificate on it. The get_pubkey_info function returns false and the exponent and modulus variables are never set. However later on those variables are set on the private key object which then causes a segfault.

Let me know what you think?

kenh commented 3 years ago

I'll merge this later today. But I am curious ... does that code signing certificate have an ECDSA key instead of an RSA key? I suppose I should deal with ECDSA keys at some point; I just haven't seen them "in the wild" yet.

sighup1 commented 3 years ago

Sounds good, and yes it is an ECDSA key.