case REPLY_ERROR_OPERAND_INVALID: 
case REP82_ERROR_OPERAND_INVALID: 
convert_response(unsigned char *response, unsigned char *buffer,		 int *respbufflen_p, unsigned char *resp_buff){	struct ica_rsa_modexpo *icaMsg_p = (struct ica_rsa_modexpo *) buffer;	struct type82_hdr *t82h_p = (struct type82_hdr *) response;	struct type84_hdr *t84h_p = (struct type84_hdr *) response;	struct type86_fmt2_msg *t86m_p =  (struct type86_fmt2_msg *) response;	int reply_code, service_rc, service_rs, src_l;	unsigned char *src_p, *tgt_p;	struct CPRB *cprb_p;	struct CPRBX *cprbx_p;	src_p = 0;	reply_code = 0;	service_rc = 0;	service_rs = 0;	src_l = 0;	switch (t82h_p->type) {	case TYPE82_RSP_CODE:		reply_code = t82h_p->reply_code;		src_p = (unsigned char *)t82h_p;		PRINTK("Hardware error: Type 82 Message Header: "		       "%02x%02x%02x%02x%02x%02x%02x%02x\n",		       src_p[0], src_p[1], src_p[2], src_p[3],		       src_p[4], src_p[5], src_p[6], src_p[7]);		break;	case TYPE84_RSP_CODE:		src_l = icaMsg_p->outputdatalength;		src_p = response + (int)t84h_p->len - src_l;		break;	case TYPE86_RSP_CODE:		reply_code = t86m_p->hdr.reply_code;		if (reply_code != 0)			break;		cprb_p = (struct CPRB *)			(response + sizeof(struct type86_fmt2_msg));		cprbx_p = (struct CPRBX *) cprb_p;		if (cprb_p->cprb_ver_id != 0x02) {			le2toI(cprb_p->ccp_rtcode, &service_rc);			if (service_rc != 0) {				le2toI(cprb_p->ccp_rscode, &service_rs);				if ((service_rc == 8) && (service_rs == 66))					PDEBUG("Bad block format on PCICC\n");				else if ((service_rc == 8) && (service_rs == 770)) {					PDEBUG("Invalid key length on PCICC\n");					unset_ext_bitlens();					return REC_USE_PCICA;				}				else if ((service_rc == 8) && (service_rs == 783)) {					PDEBUG("Extended bitlengths not enabled"					       "on PCICC\n");					unset_ext_bitlens();					return REC_USE_PCICA;				}				else					PRINTK("service rc/rs: %d/%d\n",					       service_rc, service_rs);				return REC_OPERAND_INV;			}			src_p = (unsigned char *)cprb_p + sizeof(struct CPRB);			src_p += 4;			le2toI(src_p, &src_l);			src_l -= 2;			src_p += 2;		} else {			service_rc = (int)cprbx_p->ccp_rtcode;			if (service_rc != 0) {				service_rs = (int) cprbx_p->ccp_rscode;				if ((service_rc == 8) && (service_rs == 66))					PDEBUG("Bad block format on PCXICC\n");				else if ((service_rc == 8) && (service_rs == 770)) {					PDEBUG("Invalid key length on PCIXCC\n");					unset_ext_bitlens();					return REC_USE_PCICA;				}				else if ((service_rc == 8) && (service_rs == 783)) {					PDEBUG("Extended bitlengths not enabled"					       "on PCIXCC\n");					unset_ext_bitlens();					return REC_USE_PCICA;				}				else					PRINTK("service rc/rs: %d/%d\n",					       service_rc, service_rs);				return REC_OPERAND_INV;			}			src_p = (unsigned char *)				cprbx_p + sizeof(struct CPRBX);			src_p += 4;			src_l = (int)(*((short *) src_p));			src_l -= 2;			src_p += 2;		}		break;	default:		return REC_BAD_MESSAGE;	}	if (reply_code)		switch (reply_code) {		case REPLY_ERROR_OPERAND_INVALID:			return REC_OPERAND_INV;		case REPLY_ERROR_OPERAND_SIZE:			return REC_OPERAND_SIZE;		case REPLY_ERROR_EVEN_MOD_IN_OPND:			return REC_EVEN_MOD;		case REPLY_ERROR_MESSAGE_TYPE:			return WRONG_DEVICE_TYPE;		case REPLY_ERROR_TRANSPORT_FAIL:			PRINTKW("Transport failed (APFS = %02X%02X%02X%02X)\n",				t86m_p->apfs[0], t86m_p->apfs[1],				t86m_p->apfs[2], t86m_p->apfs[3]);			return REC_HARDWAR_ERR;		default:			PRINTKW("reply code = %d\n", reply_code);			return REC_HARDWAR_ERR;		}	if (service_rc != 0)		return REC_OPERAND_INV;	if ((src_l > icaMsg_p->outputdatalength) ||	    (src_l > RESPBUFFSIZE) ||	    (src_l <= 0))		return REC_OPERAND_SIZE;	PDEBUG("Length returned = %d\n", src_l);	tgt_p = resp_buff + icaMsg_p->outputdatalength - src_l;	memcpy(tgt_p, src_p, src_l);	if ((t82h_p->type == TYPE86_RSP_CODE) && (resp_buff < tgt_p)) {		memset(resp_buff, 0, icaMsg_p->outputdatalength - src_l);		if (pad_msg(resp_buff, icaMsg_p->outputdatalength, src_l))			return REC_INVALID_PAD;	}	*respbufflen_p = icaMsg_p->outputdatalength;	if (*respbufflen_p == 0)		PRINTK("Zero *respbufflen_p\n");	return 0;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/2dee702fcb197d80c1a94650fb611539dd8135ce/z90hardware.c/buggy/drivers/s390/crypto/z90hardware.c