15 if (!SSL_CTX_need_tmp_RSA(
ctx))
return 1;
20 BN_set_word(
e,RSA_F4);
22 res = (long) RSA_generate_key_ex(rsa,len,
e,NULL);
25 if (res == -1)
return 0;
29 res = SSL_CTX_set_tmp_rsa(
ctx,rsa);
44 bio = BIO_new_file(
dhfile,
"r");
46 dh = PEM_read_bio_DHparams(bio,0,0,0);
49 if (!SSL_CTX_set_tmp_dh(
ctx,dh))
return 0;
59 SSL_CTX_set_options(
ctx, SSL_OP_SINGLE_ECDH_USE);
60#ifdef SSL_CTRL_SET_ECDH_AUTO
61 SSL_CTX_set_ecdh_auto(
ctx,1);
64 ecdh = EC_KEY_new_by_curve_name(NID_secp521r1);
67 ecdh = EC_KEY_new_by_curve_name(NID_secp384r1);
71 ecdh = EC_KEY_new_by_curve_name(NID_X9_62_prime256v1);
74 SSL_CTX_set_tmp_ecdh(
ctx,ecdh);
Header file to be used with sqmail; previously called ssl.h. (name clash)
int ssl_params_dh(SSL_CTX *ctx, const char *dhfile)
int ssl_params_rsa(SSL_CTX *ctx, int len)
int ssl_params_ecdh(SSL_CTX *ctx, const char *ecdhfile)