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?. Thanks.