wbond / oscrypto

Compiler-free Python crypto library backed by the OS, supporting CPython and PyPy
MIT License
320 stars 70 forks source link

fix OSError on MacOS 12+ #63

Closed magicrobotmonkey closed 1 year ago

magicrobotmonkey commented 2 years ago

add support for SecCertificateCopyKey, which replaces deprecated SecCertificateCopyPublicKey since MacOS 10.14

fixes #56

https://developer.apple.com/documentation/security/1396096-seccertificatecopypublickey

wbond commented 1 year ago

Thanks for your work on this!

Can you see if the test fails for you on an M1 with 222a558adb19876c42318c180e2eee52d42220b5?

The only other thing I think this code needs to handle is a null return from Security.SecCertificateCopyKey().

wbond commented 1 year ago

This should be all functioning properly on master, and I've added a check for the null return value