- /* Load DH parameters into the context */
- dh = DH_new();
- if (!dh) {
- lprintf(3, "init_ssl() can't allocate a DH object: %s\n",
- ERR_reason_error_string(ERR_get_error()));
- SSL_CTX_free(ssl_ctx);
- ssl_ctx = NULL;
- return;
- }
- if (!(BN_hex2bn(&(dh->p), DH_P))) {
- lprintf(3, "init_ssl() can't assign DH_P: %s\n",
- ERR_reason_error_string(ERR_get_error()));
- SSL_CTX_free(ssl_ctx);
- ssl_ctx = NULL;
- return;
- }
- if (!(BN_hex2bn(&(dh->g), DH_G))) {
- lprintf(3, "init_ssl() can't assign DH_G: %s\n",
- ERR_reason_error_string(ERR_get_error()));
- SSL_CTX_free(ssl_ctx);
- ssl_ctx = NULL;
- return;
- }
- dh->length = DH_L;
- SSL_CTX_set_tmp_dh(ssl_ctx, dh);
- DH_free(dh);
-