s->cert->dh_tmp_cb = (DH *(*)(SSL *, int, int))parg;
{ union dh_fn_to_char_u dh_tmp_cb;  dh_tmp_cb.char_p = parg; s->cert->dh_tmp_cb = dh_tmp_cb.fn_p; }
long ssl3_ctrl(SSL *s, int cmd, long larg, char *parg)	{	int ret=0;#if !defined(NO_DSA) || !defined(NO_RSA)	if (#ifndef NO_RSA	    cmd == SSL_CTRL_SET_TMP_RSA ||	    cmd == SSL_CTRL_SET_TMP_RSA_CB ||#endif#ifndef NO_DSA	    cmd == SSL_CTRL_SET_TMP_DH ||	    cmd == SSL_CTRL_SET_TMP_DH_CB ||#endif		0)		{		if (!ssl_cert_inst(&s->cert))		    	{			SSLerr(SSL_F_SSL3_CTRL, ERR_R_MALLOC_FAILURE);			return(0);			}		}#endif	switch (cmd)		{	case SSL_CTRL_GET_SESSION_REUSED:		ret=s->hit;		break;	case SSL_CTRL_GET_CLIENT_CERT_REQUEST:		break;	case SSL_CTRL_GET_NUM_RENEGOTIATIONS:		ret=s->s3->num_renegotiations;		break;	case SSL_CTRL_CLEAR_NUM_RENEGOTIATIONS:		ret=s->s3->num_renegotiations;		s->s3->num_renegotiations=0;		break;	case SSL_CTRL_GET_TOTAL_RENEGOTIATIONS:		ret=s->s3->total_renegotiations;		break;	case SSL_CTRL_GET_FLAGS:		ret=(int)(s->s3->flags);		break;#ifndef NO_RSA	case SSL_CTRL_NEED_TMP_RSA:		if ((s->cert != NULL) && (s->cert->rsa_tmp == NULL) &&		    ((s->cert->pkeys[SSL_PKEY_RSA_ENC].privatekey == NULL) ||		     (EVP_PKEY_size(s->cert->pkeys[SSL_PKEY_RSA_ENC].privatekey) > (512/8))))			ret = 1;		break;	case SSL_CTRL_SET_TMP_RSA:		{			RSA *rsa = (RSA *)parg;			if (rsa == NULL) {				SSLerr(SSL_F_SSL3_CTRL, ERR_R_PASSED_NULL_PARAMETER);				return(ret);			}			if ((rsa = RSAPrivateKey_dup(rsa)) == NULL) {				SSLerr(SSL_F_SSL3_CTRL, ERR_R_RSA_LIB);				return(ret);			}			if (s->cert->rsa_tmp != NULL)				RSA_free(s->cert->rsa_tmp);			s->cert->rsa_tmp = rsa;			ret = 1;		}		break;	case SSL_CTRL_SET_TMP_RSA_CB:		s->cert->rsa_tmp_cb = (RSA *(*)(SSL *, int, int))parg;		break;#endif#ifndef NO_DH	case SSL_CTRL_SET_TMP_DH:		{			DH *dh = (DH *)parg;			if (dh == NULL) {				SSLerr(SSL_F_SSL3_CTRL, ERR_R_PASSED_NULL_PARAMETER);				return(ret);			}			if ((dh = DHparams_dup(dh)) == NULL) {				SSLerr(SSL_F_SSL3_CTRL, ERR_R_DH_LIB);				return(ret);			}			if (!DH_generate_key(dh)) {				DH_free(dh);				SSLerr(SSL_F_SSL3_CTRL, ERR_R_DH_LIB);				return(ret);			}			if (s->cert->dh_tmp != NULL)				DH_free(s->cert->dh_tmp);			s->cert->dh_tmp = dh;			ret = 1;		}		break;	case SSL_CTRL_SET_TMP_DH_CB:		s->cert->dh_tmp_cb = (DH *(*)(SSL *, int, int))parg;		break;#endif	default:		break;		}	return(ret);	}