|
@@ -477,6 +477,9 @@ struct UpdateWKTask : ITaskSp {
|
|
|
|
|
|
void Process()
|
|
|
{
|
|
|
+ LOG_FUNCTION();
|
|
|
+
|
|
|
+
|
|
|
if (m_fsm->GetmAccessAuthHost().IsNullOrEmpty())
|
|
|
{
|
|
|
LogWarn(Severity_Middle, Error_Unexpect, AccessAuthorization_UserErrorCode_AccessAuth_NULL, "UpdateWKTask:准入Url为空");
|
|
@@ -494,11 +497,11 @@ struct UpdateWKTask : ITaskSp {
|
|
|
|
|
|
struct UpdateWKAns
|
|
|
{
|
|
|
- string TMK;
|
|
|
- string TPK;
|
|
|
- string EDK;
|
|
|
+ string tmk;
|
|
|
+ string tpk;
|
|
|
+ string edk;
|
|
|
string index;
|
|
|
- JSONCONVERT2OBJECT_MEMEBER_REGISTER(TMK, TPK, EDK, index)
|
|
|
+ JSONCONVERT2OBJECT_MEMEBER_REGISTER(tmk, tpk, edk, index)
|
|
|
} updateWKAns;
|
|
|
|
|
|
updateWKReq.terminalNo = si.strTerminalID.GetData();
|
|
@@ -511,8 +514,10 @@ struct UpdateWKTask : ITaskSp {
|
|
|
|
|
|
RestfulClient client = RestfulClient::getInstance();
|
|
|
config.PreDo();
|
|
|
+ Dbg("to Post with new restful....");
|
|
|
client.Do(&config, &result);
|
|
|
if (result.ResponseOK()) {
|
|
|
+ Dbg("UpdateWKTask Connect With Restful Success.");
|
|
|
SP::Module::Restful::CommResponseJson responseStatus;
|
|
|
SP::Module::Restful::GetStatusFromDebranchResponse(result.content, responseStatus);
|
|
|
if (!responseStatus.IsOperatedOK()) {
|
|
@@ -522,7 +527,7 @@ struct UpdateWKTask : ITaskSp {
|
|
|
}
|
|
|
SP::Module::Restful::ExtractDataFromDebranchResponse(result.content, updateWKAns);
|
|
|
int len = 0;
|
|
|
- char* tmp = Hex2Str(updateWKAns.TMK.c_str(), len);
|
|
|
+ char* tmp = Hex2Str(updateWKAns.tmk.c_str(), len);
|
|
|
int textLen = 2 * len;
|
|
|
BYTE* text = new BYTE[textLen];
|
|
|
memset(text, 0, textLen);
|
|
@@ -532,16 +537,16 @@ struct UpdateWKTask : ITaskSp {
|
|
|
goto UpdateWKRetError;
|
|
|
}
|
|
|
|
|
|
- updateWKAns.TMK.assign((char*)text);
|
|
|
+ updateWKAns.tmk.assign((char*)text);
|
|
|
delete[] text;
|
|
|
delete tmp;
|
|
|
|
|
|
- Dbg("tmk=%s %d", updateWKAns.TMK.c_str(), updateWKAns.TMK.size());
|
|
|
- Dbg("tpk=%s %d", updateWKAns.TPK.c_str(), updateWKAns.TPK.size());
|
|
|
- Dbg("edk=%s %d", updateWKAns.EDK.c_str(), updateWKAns.EDK.size());
|
|
|
+ Dbg("tmk=%s %d", updateWKAns.tmk.c_str(), updateWKAns.tmk.size());
|
|
|
+ Dbg("tpk=%s %d", updateWKAns.tpk.c_str(), updateWKAns.tpk.size());
|
|
|
+ Dbg("edk=%s %d", updateWKAns.edk.c_str(), updateWKAns.edk.size());
|
|
|
Dbg("index=%s %d", updateWKAns.index.c_str(), updateWKAns.index.size());
|
|
|
|
|
|
- DWORD rc = m_entity->LoadKeysToPinPadNew(updateWKAns.TMK, updateWKAns.TPK, updateWKAns.EDK, updateWKAns.index);
|
|
|
+ DWORD rc = m_entity->LoadKeysToPinPadNew(updateWKAns.tmk, updateWKAns.tpk, updateWKAns.edk, updateWKAns.index);
|
|
|
if (rc == Error_Succeed) {
|
|
|
Dbg("UpdateWKTask LoadKeysToPinPadNew Success");
|
|
|
FSMEvent* pEvent = new FSMEvent(CAccessAuthFSM::Event_UpdateWKSucc);
|
|
@@ -1855,7 +1860,8 @@ ErrorCodeEnum CAccessAuthFSM::GetStrFromCS(const char* pcSection, const char* pc
|
|
|
return Error;
|
|
|
}
|
|
|
|
|
|
-bool CAccessAuthFSM::DecryptWithSessionKey(BYTE* encText, int encTextLen, BYTE * decTest,int &decTestLen) {
|
|
|
+bool CAccessAuthFSM::DecryptWithSessionKey(BYTE* encText, int encTextLen, BYTE * decTest,int &decTestLen)
|
|
|
+{
|
|
|
BYTE key[16] = { 0 };
|
|
|
memcpy(key, ((CAccessAuthEntity*)m_pEntity)->m_AuthSessionKey,16);
|
|
|
char* keyTmp = Str2Hex((char *)key,16);
|