DSAerr(DH_F_DH_NEW_METHOD, ERR_R_ENGINE_LIB);
DHerr(DH_F_DH_NEW_METHOD, ERR_R_ENGINE_LIB);
DH *DH_new_method(ENGINE *engine)	{	DH *ret;	ret=(DH *)OPENSSL_malloc(sizeof(DH));	if (ret == NULL)		{		DHerr(DH_F_DH_NEW_METHOD,ERR_R_MALLOC_FAILURE);		return(NULL);		}	ret->meth = DH_get_default_method();	if (engine)		{		if (!ENGINE_init(engine))			{			DSAerr(DH_F_DH_NEW_METHOD, ERR_R_ENGINE_LIB);			OPENSSL_free(ret);			return NULL;			}		ret->engine = engine;		}	else		ret->engine = ENGINE_get_default_DH();	if(ret->engine)		{		ret->meth = ENGINE_get_DH(ret->engine);		if(!ret->meth)			{			DHerr(DH_F_DH_NEW_METHOD,ERR_R_ENGINE_LIB);			ENGINE_finish(ret->engine);			OPENSSL_free(ret);			return NULL;			}		}	ret->pad=0;	ret->version=0;	ret->p=NULL;	ret->g=NULL;	ret->length=0;	ret->pub_key=NULL;	ret->priv_key=NULL;	ret->q=NULL;	ret->j=NULL;	ret->seed = NULL;	ret->seedlen = 0;	ret->counter = NULL;	ret->method_mont_p=NULL;	ret->references = 1;	ret->flags=ret->meth->flags;	CRYPTO_new_ex_data(CRYPTO_EX_INDEX_DH, ret, &ret->ex_data);	if ((ret->meth->init != NULL) && !ret->meth->init(ret))		{		if (ret->engine)			ENGINE_finish(ret->engine);		CRYPTO_free_ex_data(CRYPTO_EX_INDEX_DH, ret, &ret->ex_data);		OPENSSL_free(ret);		ret=NULL;		}	return(ret);	}