package sega.a7; import javacard.framework.Util; import javacard.security.MessageDigest; public class KeychipInfoRead extends AuthCommand { private static final short RECV_PACKET_SIZE = 46; private static final byte AUTH_LEVEL = 2; private static final short PARAM_SIZE = 142; public KeychipInfoRead(short cmd, AppData data, MakePacket packet, MessageDigest sha1, HmacSha1 hmacSha1, Crypt crypt) { super(cmd, RECV_PACKET_SIZE, PARAM_SIZE, AUTH_LEVEL, data, packet, sha1, hmacSha1, crypt); } public short core(byte[] dta, short dataOffset, short dataLength) { byte[] ee_keychipInfo = this.m_ee_data.getKeychipInfo_ee(); byte[] ramD_encKeychipInfo = this.m_ee_data.getGeneralBuffer_ramD(); if (ramD_encKeychipInfo.length < ee_keychipInfo.length) return AppConfig.A7_FAIL; short encSize = encData(ee_keychipInfo, (short) 0, (short) ee_keychipInfo.length, ramD_encKeychipInfo, (short) 0); if (ee_keychipInfo.length > encSize) return AppConfig.A7_FAIL; this.m_ramD_outDataInfo[0] = 0; this.m_ramD_outDataInfo[1] = encSize; Util.arrayCopyNonAtomic(ramD_encKeychipInfo, this.m_ramD_outDataInfo[0], this.m_ramD_outData, this.m_ramD_outDataInfo[0], this.m_ramD_outDataInfo[1]); return AppConfig.A7_SUCCESS; } }