engine_openssl.rsa_meth = RSA_get_default_openssl_method(); engine_openssl.dsa_meth = DSA_get_default_openssl_method(); engine_openssl.dh_meth = DH_get_default_openssl_method(); engine_openssl.rand_meth = RAND_SSLeay(); engine_openssl.bn_mod_exp = BN_mod_exp; return &engine_openssl;
ENGINE *ret = ENGINE_new(); if(!ret) return NULL; if(!ENGINE_set_id(ret, engine_openssl_id) || !ENGINE_set_name(ret, engine_openssl_name) || !ENGINE_set_RSA(ret, RSA_get_default_openssl_method()) || !ENGINE_set_DSA(ret, DSA_get_default_openssl_method()) || !ENGINE_set_DH(ret, DH_get_default_openssl_method()) || !ENGINE_set_RAND(ret, RAND_SSLeay()) || !ENGINE_set_BN_mod_exp(ret, BN_mod_exp) || !ENGINE_set_BN_mod_exp_crt(ret, openssl_mod_exp_crt)) { ENGINE_free(ret); return NULL; } return ret;
ENGINE *ENGINE_openssl()	{	/* We need to populate our structure with the software pointers	 * that we want to steal. */	engine_openssl.rsa_meth = RSA_get_default_openssl_method();	engine_openssl.dsa_meth = DSA_get_default_openssl_method();	engine_openssl.dh_meth = DH_get_default_openssl_method();	engine_openssl.rand_meth = RAND_SSLeay();	engine_openssl.bn_mod_exp = BN_mod_exp;	return &engine_openssl;	}