On Sat, Nov 08, 2014, Lisa Matias (??????????????? ??????) wrote: > Correction, I accidentally omitted a couple of the external ECDSA signature > parameters, which specify the signature output. > Here is the correct declaration for it. > > int external_ecdsa_sign(const uint8_t *data, const int datalen, uint8_t > *sig, int *siglen); /* sign data */ > > Does anyone have any ideas on how to implement this as an ECDSA method for > OpenSSL engine? >
Initially you don't need an ENGINE: you do something like this... Obtain a custom ECDSA_METHOD structure using something like: my_meth = ECDSA_METHOD_new(ECDSA_OpenSSL()); This will get you a copy of the normal OpenSSL ECDSA method: you need to set a custom signing method for this. Write an ecdsa_sign function that takes the passed digest and returns an ECDSA_SIG stucture. Set the sign function in your custom method using ECDSA_METHOD_set_sign(). Create an EC_KEY structure and initialise it with the curve and public key details. Call ECDSA_set_method(key, my_meth); Now the EC_KEY structure should redirect and key operations to your custom routine. You can create an EVP_PKEY structure from the EC_KEY structure if you wish. 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