|
@@ -2221,7 +2221,6 @@ struct InitializerInitMKTask : ITaskSp {
|
|
|
instanceReq.MKD_NEW1.site = initMKReq.MKD_NEW1.site;
|
|
|
instanceReq.MKD_NEW1.terminalNo = initMKReq.MKD_NEW1.terminalNo;
|
|
|
|
|
|
-
|
|
|
instanceReq.MKD_REQ2.branchNo = initMKReq.MKD_REQ2.branchNo;
|
|
|
instanceReq.MKD_REQ2.kmcData = initMKReq.MKD_REQ2.kmcData;
|
|
|
instanceReq.MKD_REQ2.subBankNo = initMKReq.MKD_REQ2.subBankNo;
|
|
@@ -2232,6 +2231,7 @@ struct InitializerInitMKTask : ITaskSp {
|
|
|
item.modal = initMKReq.MKD_REQ3[i]->modal;
|
|
|
item.factory = initMKReq.MKD_REQ3[i]->factory;
|
|
|
item.version = initMKReq.MKD_REQ3[i]->version;
|
|
|
+ instanceReq.MKD_REQ3.push_back(item);
|
|
|
}
|
|
|
|
|
|
instanceReq.MKD_REQ4.fingerPrint = initMKReq.MKD_REQ4.fingerPrint;
|
|
@@ -2267,6 +2267,7 @@ struct InitializerInitMKTask : ITaskSp {
|
|
|
config.PreDo();
|
|
|
client.Do(&config, &result);
|
|
|
if (result.ResponseOK()) {
|
|
|
+ Dbg("InitializerInitMKTask Connect Success.");
|
|
|
SP::Module::Restful::CommResponseJson responseStatus;
|
|
|
SP::Module::Restful::GetStatusFromDebranchResponse(result.content, responseStatus);
|
|
|
if (!responseStatus.IsOperatedOK()) {
|
|
@@ -2274,11 +2275,14 @@ struct InitializerInitMKTask : ITaskSp {
|
|
|
m_entity->EndInitMK(ERR_INITIALIZER_INIT_EXCEPTION, responseStatus.errorMsg.c_str());
|
|
|
} else {
|
|
|
if (m_entity->HasPinPad()) {
|
|
|
- SP::Module::Restful::ExtractDataFromDebranchResponse(result.content, instanceAns);
|
|
|
- if (m_entity->LoadKeysToPinPadACS(instanceAns.TMK, instanceAns.TPK, instanceAns.EDK, instanceAns.index) == Error_Succeed)
|
|
|
- m_entity->EndInitMK(Error_Succeed, "");
|
|
|
- else
|
|
|
+ const bool testResult = SP::Module::Restful::ExtractDataFromDebranchResponse(result.content, instanceAns);
|
|
|
+ Dbg("ExtractDataFromDebranchResponse returned: %d", testResult);
|
|
|
+ if (m_entity->LoadKeysToPinPadACS(instanceAns.TMK, instanceAns.TPK, instanceAns.EDK, instanceAns.index) == Error_Succeed) {
|
|
|
+ m_entity->EndInitMK(Error_Succeed, "");
|
|
|
+ }
|
|
|
+ else {
|
|
|
m_entity->EndInitMK(ERR_INITIALIZER_INIT_EXCEPTION, "加载秘钥到密码键盘失败");//,待完善细化错误码oiltest
|
|
|
+ }
|
|
|
} else {
|
|
|
m_entity->EndInitMK(Error_Succeed, "");
|
|
|
}
|
|
@@ -2763,16 +2767,10 @@ ErrorCodeEnum CInitializerEntity::LoadKeysToPinPadACS(string TMK, string TPK, st
|
|
|
char* pxx = new char[1024];
|
|
|
memset(pxx, 0, 1024);
|
|
|
HexBuf2StrBuf((BYTE*)pDecryptPrivateKey, &pxx, decryprtLen);
|
|
|
- //char* pEncodeTMK = MyBase64::Str2Hex(TMK.c_str(), TMK.size());
|
|
|
PBYTE pBt = new BYTE[512];
|
|
|
memset(pBt, 0, 512);
|
|
|
StrBuf2HexBuf(TMK.c_str(), &pBt);
|
|
|
|
|
|
- //if (DecWithSM2PriKey(pBt, 258 / 2, (BYTE*)pPlainTMK, &plainKeyLen, (BYTE*)pDecryptPrivateKey, decryprtLen))
|
|
|
- // Dbg("ok");
|
|
|
- //else
|
|
|
- // Dbg("not ok");
|
|
|
- //return Error_Unexpect;
|
|
|
if (!DecWithSM2PriKey(pBt, TMK.size()/2, (BYTE*)pPlainTMK, &plainKeyLen, (BYTE*)pDecryptPrivateKey, decryprtLen)) {
|
|
|
Dbg("使用私钥解密TMK失败!");
|
|
|
return Error_Unexpect;
|