|
|
@@ -279,24 +279,21 @@ ErrorCodeEnum CardIssuerImpl::ICCommand(CmdInfo sendBuf, CmdInfo& recvBuf)
|
|
|
{
|
|
|
ErrorCodeEnum err = Error_Succeed;
|
|
|
CmdInfoAns ans;
|
|
|
- memset(ans.data, 0, MAX_IC_BUFFER_SIZE);
|
|
|
|
|
|
err = SimulatorHttpFunction(EntityName, "ICCommand", ans);
|
|
|
LOG4VTM(INFO, "ICCommand err = " << err);
|
|
|
|
|
|
+ //将字符串转换成字节流数据
|
|
|
+ PBYTE buf = new BYTE[1024];
|
|
|
+ char* show = new char[1024];
|
|
|
+ StrBuf2HexBuf(ans.data.c_str(), &buf);
|
|
|
+
|
|
|
if (err == Error_Succeed) {
|
|
|
recvBuf.dwSize = ans.dwSize;
|
|
|
- memcpy(recvBuf.data, ans.data, sizeof(BYTE) * MAX_IC_BUFFER_SIZE);
|
|
|
+ memcpy(recvBuf.data, buf, sizeof(BYTE) * MAX_IC_BUFFER_SIZE);
|
|
|
}
|
|
|
|
|
|
- //DEBUG
|
|
|
- LPBYTE buf = new BYTE[1024];
|
|
|
- memcpy(buf, ans.data, sizeof(BYTE) * MAX_IC_BUFFER_SIZE);
|
|
|
- char* show = new char[1024];
|
|
|
- int lenRecv = recvBuf.dwSize;
|
|
|
- HexBuf2StrBuf(buf,&show,lenRecv);
|
|
|
- //DbgInfo(CSimpleStringA::Format("<BuildSupportedAppList>, [%s]", show));
|
|
|
- LOG4VTM(INFO, "<SimulaTrans> [" << show << "]");
|
|
|
+ LOG4VTM(INFO, "<SimulaTrans> [" << ans.data.c_str() << "]");
|
|
|
|
|
|
return err;
|
|
|
}
|
|
|
@@ -339,9 +336,14 @@ ErrorCodeEnum CardIssuerImpl::SAMCommand(CmdInfo sendBuf, CmdInfo& recvBuf)
|
|
|
err = SimulatorHttpFunction(EntityName, "SAMCommand", ans);
|
|
|
LOG4VTM(INFO, "SAMCommand err = " << err);
|
|
|
|
|
|
+ //将字符串转换成字节流数据
|
|
|
+ PBYTE buf = new BYTE[1024];
|
|
|
+ char* show = new char[1024];
|
|
|
+ StrBuf2HexBuf(ans.data.c_str(), &buf);
|
|
|
+
|
|
|
if (err == Error_Succeed) {
|
|
|
recvBuf.dwSize = ans.dwSize;
|
|
|
- memcpy(recvBuf.data, ans.data, sizeof(BYTE) * MAX_IC_BUFFER_SIZE);
|
|
|
+ memcpy(recvBuf.data, buf, sizeof(BYTE) * MAX_IC_BUFFER_SIZE);
|
|
|
}
|
|
|
|
|
|
return err;
|
|
|
@@ -381,9 +383,14 @@ ErrorCodeEnum CardIssuerImpl::ActiveICCardATR(CmdInfo& atrBuf)
|
|
|
err = SimulatorHttpFunction(EntityName, "ActiveICCardATR", ans);
|
|
|
LOG4VTM(INFO, "ActiveICCardATR err = " << err);
|
|
|
|
|
|
+ //将字符串转换成字节流数据
|
|
|
+ PBYTE buf = new BYTE[1024];
|
|
|
+ char* show = new char[1024];
|
|
|
+ StrBuf2HexBuf(ans.data.c_str(), &buf);
|
|
|
+
|
|
|
if (err == Error_Succeed) {
|
|
|
atrBuf.dwSize = ans.dwSize;
|
|
|
- memcpy(atrBuf.data, ans.data, sizeof(BYTE) * MAX_IC_BUFFER_SIZE);
|
|
|
+ memcpy(atrBuf.data, buf, sizeof(BYTE) * MAX_IC_BUFFER_SIZE);
|
|
|
}
|
|
|
|
|
|
return err;
|
|
|
@@ -432,9 +439,14 @@ ErrorCodeEnum CardIssuerImpl::RFTypeABCommand(CmdInfo sendBuf, CmdInfo& recvBuf)
|
|
|
err = SimulatorHttpFunction(EntityName, "RFTypeABCommand", ans);
|
|
|
LOG4VTM(INFO, "RFTypeABCommand err = " << err);
|
|
|
|
|
|
+ //将字符串转换成字节流数据
|
|
|
+ PBYTE buf = new BYTE[1024];
|
|
|
+ char* show = new char[1024];
|
|
|
+ StrBuf2HexBuf(ans.data.c_str(), &buf);
|
|
|
+
|
|
|
if (err == Error_Succeed) {
|
|
|
recvBuf.dwSize = ans.dwSize;
|
|
|
- memcpy(recvBuf.data, ans.data, sizeof(BYTE) * MAX_IC_BUFFER_SIZE);
|
|
|
+ memcpy(recvBuf.data, buf, sizeof(BYTE) * MAX_IC_BUFFER_SIZE);
|
|
|
}
|
|
|
|
|
|
return err;
|
|
|
@@ -469,9 +481,9 @@ ErrorCodeEnum CardIssuerImpl::TransferEnInit(int& iStatus, BYTE*& Cr1, int& lenR
|
|
|
lenR3 = ans.lenR3;
|
|
|
lenKey = ans.lenKey;
|
|
|
|
|
|
- memcpy(Cr1, ans.Cr1, 256);
|
|
|
- memcpy(Cr3, ans.Cr3, 256);
|
|
|
- memcpy(dKey, ans.dKey, 256);
|
|
|
+ memcpy(Cr1, ans.Cr1.c_str(), 256);
|
|
|
+ memcpy(Cr3, ans.Cr3.c_str(), 256);
|
|
|
+ memcpy(dKey, ans.dKey.c_str(), 256);
|
|
|
}
|
|
|
|
|
|
return err;
|