cryptosense / pkcs11

OCaml bindings for the PKCS#11 cryptographic API
BSD 2-Clause "Simplified" License
22 stars 6 forks source link

FreeBSD support #37

Closed hannesm closed 7 years ago

hannesm commented 7 years ago

There are two changes needed to get PKCS11 (and the example application) to work on FreeBSD:

The second item is done at runtime, after investigating the output of uname -s. Since Pkcs11.load_driver is called rarely, I guess spawning a new process which runs uname -s is ok.

emillon commented 7 years ago

Thanks for the patches. I think it's possible to remove the unconditional RTLD_DEEPBIND and make it an optional argument of load_driver, I'll have to check if that works with our use cases.

hannesm commented 7 years ago

I don't have a linux system to test, but the RTLD_DEEPBIND may actually not be needed at all...

hannesm commented 7 years ago

(NB, with this PR and https://github.com/Yubico/yubico-piv-tool/pull/113 being merged, I can successfully sign using a Yubikey NEO/.. using RSA-PSS. mission accomplished :) Thank you so much for this library and the example application!)

emillon commented 7 years ago

Re. deepbind: that was to work around a bug when using both forwards and reverse binding at the same time. I don't remember what the exact problem was so I'll check whether that works without this flag.

Glad that this library is helpful!

emillon commented 7 years ago

Those lwt test failures are a bit annoying. Restarting the build!

emillon commented 7 years ago

Thanks!

hannesm commented 7 years ago

thanks for merging -- btw your review comments (on the uname etc.) just appeared today -- maybe you forgot earlier to finish the review?

emillon commented 7 years ago

That's possible, that's the first time I'm using this feature so I didn't know it was necessary to submit. I'll know it for next time!

hannesm commented 7 years ago

any chance you can make a new release of pkcs11?

emillon commented 7 years ago

I have a couple patches I'd like to squeeze into this release, but that should be done by the end of the week.

emillon commented 7 years ago

Pull-requested! https://github.com/ocaml/opam-repository/pull/8976