On Fri, Jun 25, 2010, Nacho lvarez wrote: > Hello, > > I am building a PKCS#11 engine to an HSM. When I run: > > openssl rsautl -sign -inkey <id-of-private-key> -keyform engine -in > <file-data> -out <file-sign> -engine <My-engine-id> > > The engine executes the rsa_priv_enc function (I thought the engine would > execute rsa_sign, but this is not the problem). The problem is when the > rsa_priv_enc ends, OpenSSL always throws and exception (I am using OpenSSL > in Windows). In the rsa_priv_enc I read data from "from" (flen bytes) I > wirte the result in "to" and return 1. Where is the problem? What would I do > to avoid it?. >
You only get rsa_sign() called if you sign a digest (or the MD5+SHA1 SSL/TLS signature) which you'll see if you use "dgst" to sign data. You should resturn the length of the data written to the destination buffer, not 1. Steve. -- Dr Stephen N. Henson. OpenSSL project core developer. Commercial tech support now available see: http://www.openssl.org ______________________________________________________________________ OpenSSL Project http://www.openssl.org User Support Mailing List openssl-users@openssl.org Automated List Manager majord...@openssl.org