I am using both version of openssl 1.0.1 and openssl 1.0.2 : in openssl 1.0.2 have one function which is to set highest preference curve automatically.
But, in openSSL 1.0.1 there is no any function to set highest preference curve automatically.
I have to set manually curve. I dont have much knowledge of ECC so can anyone guide me which curve is best and more secured?
#if OPENSSL_VERSION_NUMBER >= 0x1000200fL
/* Set automatic curve selection for server ssl to onoff.If onoff is 1 then
the highest preference curve is automatically used for ECDH temporary keys
used during key exchange. */
(void)SSL_set_ecdh_auto(ssl, 1);
#elif OPENSSL_VERSION_NUMBER < 0x1000200fL
sECDH = EC_KEY_new_by_curve_name(NID_X9_62_prime256v1); // secp256r1 curve - referred as prime256v1
(void)SSL_set_tmp_ecdh(ssl, sECDH);
#endif
Thanks!