RSAerr(SUREWARE_F_SUREWAREHK_RSA_PRIV_DEC,RSA_R_UNKNOWN_PADDING_TYPE);
SUREWAREerr(SUREWARE_F_SUREWAREHK_RSA_PRIV_DEC,SUREWARE_R_UNKNOWN_PADDING_TYPE);
static int surewarehk_rsa_priv_dec(int flen,const unsigned char *from,unsigned char *to,			RSA *rsa,int padding){	int ret=0,tlen;	char *buf=NULL,*hptr=NULL;	char msg[64]="ENGINE_rsa_priv_dec";	if (!p_surewarehk_Rsa_Priv_Dec)	{		SUREWAREerr(SUREWARE_F_SUREWAREHK_RSA_PRIV_DEC,ENGINE_R_NOT_INITIALISED);	}	/* extract ref to private key */	else if (!(hptr=RSA_get_ex_data(rsa, rsaHndidx)))	{		SUREWAREerr(SUREWARE_F_SUREWAREHK_RSA_PRIV_DEC,SUREWARE_R_MISSING_KEY_COMPONENTS);		goto err;	}	/* analyse what padding we can do into the hardware */	if (padding==RSA_PKCS1_PADDING)	{		/* do it one shot */		ret=p_surewarehk_Rsa_Priv_Dec(msg,flen,(unsigned char *)from,&tlen,to,hptr,SUREWARE_PKCS1_PAD);		surewarehk_error_handling(msg,SUREWARE_F_SUREWAREHK_RSA_PRIV_DEC,ret);		if (ret!=1)			goto err;		ret=tlen;	}	else /* do with no padding into hardware */	{		ret=p_surewarehk_Rsa_Priv_Dec(msg,flen,(unsigned char *)from,&tlen,to,hptr,SUREWARE_NO_PAD);		surewarehk_error_handling(msg,SUREWARE_F_SUREWAREHK_RSA_PRIV_DEC,ret);		if (ret!=1)			goto err;		/* intermediate buffer for padding */		if ((buf=OPENSSL_malloc(tlen)) == NULL)		{			RSAerr(SUREWARE_F_SUREWAREHK_RSA_PRIV_DEC,ERR_R_MALLOC_FAILURE);			goto err;		}		memcpy(buf,to,tlen);/* transfert to into buf */		switch (padding) /* check padding in software */		{#ifndef OPENSSL_NO_SHA		case RSA_PKCS1_OAEP_PADDING:			ret=RSA_padding_check_PKCS1_OAEP(to,tlen,(unsigned char *)buf,tlen,tlen,NULL,0);			break;#endif 		case RSA_SSLV23_PADDING:			ret=RSA_padding_check_SSLv23(to,tlen,(unsigned char *)buf,flen,tlen);			break;		case RSA_NO_PADDING:			ret=RSA_padding_check_none(to,tlen,(unsigned char *)buf,flen,tlen);			break;		default:			RSAerr(SUREWARE_F_SUREWAREHK_RSA_PRIV_DEC,RSA_R_UNKNOWN_PADDING_TYPE);			goto err;		}		if (ret < 0)			RSAerr(SUREWARE_F_SUREWAREHK_RSA_PRIV_DEC,RSA_R_PADDING_CHECK_FAILED);	}err:	if (buf)	{		OPENSSL_cleanse(buf,tlen);		OPENSSL_free(buf);	}	return ret;}