Here is what I have done to test if sgx_ecc256 can work with Openssl or not:
2.Extract private key and public key from ec-priv.pem: "openssl ec -in ec-priv.pem -text -noout"
3.Using private key to sign some data inside SGX by calling function "sgx_ecdsa_sign" to get signature "sig"
4.Using public key and "sig" to verify the data by calling function "sgx_ecdsa_verify". Then I got return value SGX_EC_INVALID_SIGNATURE.
Did you generate the key inside the enclave using intel sgx openssl trusted library functions or using ssl command prompt. The problem seems to be with the key conversion from little endian to big endian.The steps you followed are correct but openssl keys are in BIG endian format there must be something wrong with the conversion.
Why don't you try using the sgx functions for signing. you can use sgx_ecc256_create_key_pair() for the key generation process. Or You can use the SGX trusted SSL library inside enclave for signing and verification.The related information is given in the below link: