Hi Peter, On October 5, 2004 12:38 pm, Peter 'Luna' Runestig wrote: > I've managed to hack together a custom RSA_METHOD, based on Microsoft > CryptoAPI (on Windows XP in my test case), to use a smart card for > authentication. And it actually works, as far as I have managed to test > it anyway. But I'm a little puzzled: When I'm running it, the only > (crypto-related) RSA_METHOD callback that gets called, is > rsa_priv_enc(), once. Even with a negotiated crypto like AES256-SHA, > that, AFAICS, uses RSA for key exchange. Is this as expected, or is > there other test cases that might trigger other callbacks (that needs > to be implemented then)?
This makes sense if you're using SSL/TLS with "simple" cipher-suites and configs (ie. no client authentication, no ephemeral key-exchange, etc.) Essentially, the server needs to be able to sign (for RSA, this is priv_enc) some data using the private key corresponding to the public key that's already been sent to the client via the certificate. Glad you got this working with CryptoAPI BTW ;-) > BTW, RSA_new_method() isn't called with a RSA_METHOD*, but with an > ENGINE*. Confusing? Well a lot of things are confusing when you're trailing around legacy APIs and trying to stick to the nomenclature. :-) RSA_METHOD used to be the be-all-and-end-all wrapper for plug-in RSA implementations. The problem is that they're assumed to be statically linked and always-on (ie. no initialisation required, etc). ENGINE is a modular wrapper around RSA_METHOD and various other interfaces that takes care of these extra admin details. If you provide a NULL engine to RSA_new_method(), it'll pick "the default" (as is/was the case with RSA_METHOD). If you provide a non-NULL engine, it'll try to use that ENGINE's RSA_METHOD implementation - however it'll also make sure to verify the implementation is initialised, bump the reference count for use by the newly generated RSA object, etc etc etc. Cheers, Geoff -- Geoff Thorpe [EMAIL PROTECTED] http://www.geoffthorpe.net/ ______________________________________________________________________ OpenSSL Project http://www.openssl.org User Support Mailing List [EMAIL PROTECTED] Automated List Manager [EMAIL PROTECTED]
