Commit c1dc8f8f by 刘帅

更换密钥长度,添加版本信息

parent 2203ff59
......@@ -45,3 +45,5 @@ HEADERS += widget.h \
FORMS += widget.ui \
scanner.ui
RC_FILE += version.rc
......@@ -27,6 +27,8 @@
#include <cassert>
#include <sstream>
const char EVP_KEY[] = "wFLV2x3IWlkVRk5XaK4J1Kpo5cIlFPYS";
#pragma comment(lib, "ws2_32.lib")
#pragma comment(lib, "fmcrypt.lib")
//#pragma comment(lib, "DbgHelp.lib")
......@@ -797,7 +799,7 @@ void QFmClient::BackupPosReq(char * req)
char key[EVP_MAX_KEY_LENGTH] = {0};
strcpy_s(key, EVP_MAX_KEY_LENGTH, "fmclient");
strcpy_s(key, EVP_MAX_KEY_LENGTH, EVP_KEY);
int length = strlen(req);
char* out = new char[length + 64];
......@@ -829,7 +831,7 @@ int QFmClient::sendAESData2Proxy(int sock, char *buf, int length)
const char * lpsendBuf = buf;
char key[EVP_MAX_KEY_LENGTH] = {0};
strcpy_s(key, EVP_MAX_KEY_LENGTH, "fmclient");
strcpy_s(key, EVP_MAX_KEY_LENGTH, EVP_KEY);
int outl = length + (16 - length % 16);
size_t header_size = sizeof(FMSOCKHEADER);
......@@ -961,7 +963,7 @@ int QFmClient::recvAESDataFromProxy(int sock, char *buf, int maxBufferLength)
char key[EVP_MAX_KEY_LENGTH];
strcpy_s(key, EVP_MAX_KEY_LENGTH, "fmclient");
strcpy_s(key, EVP_MAX_KEY_LENGTH, EVP_KEY);
rlt = CEncrypt::AESDecode((unsigned char*)key, NULL, (unsigned char*)lpRcvBuffer, rcvedLength, (unsigned char*)lpRcvBuffer, rcvedLength);
......@@ -1046,7 +1048,9 @@ void QFmClient::run()
emit ShowUi();
}
if (reqtype == 52 && (!object.contains("fmId") || object["fmId"].isNull())) {
if (reqtype == 52 )
{
if (!object.contains("fmId") || object["fmId"].isNull()) {
emit ShowRefundUi();
QEventLoop evt;
QTimer t(this);
......@@ -1055,12 +1059,14 @@ void QFmClient::run()
connect(this, SIGNAL(ContinueRefund()), &evt, SLOT(quit()));
evt.exec();
object["fmId"] = _refundTransId;
QLOG_ERROR() << "refund fmId: " << _refundTransId;
}
if (!object.contains("station_id")) {
//! 给到客户的文档中, 缺少 station_id 字段
object["station_id"] = "1";
}
QLOG_ERROR() << "refund fmId: " << _refundTransId;
}
}
if (0 != Try2ConnectZhProxy())
{
......@@ -1228,7 +1234,7 @@ void QFmClient::CheckRollBackData()
// ZH_decodeBkData(_codeBuf, _sendbuf, readLen);
char key[EVP_MAX_KEY_LENGTH];
strcpy_s(key, EVP_MAX_KEY_LENGTH, "fmclient");
strcpy_s(key, EVP_MAX_KEY_LENGTH, EVP_KEY);
rlt = CEncrypt::AESDecode((unsigned char*)key, NULL, (unsigned char*)_codeBuf, readLen, (unsigned char*)_sendbuf, MAX_BUF_LEN);
......
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by version.rc
//
#define _USE_DECLSPECS_FOR_SAL 0
#define _USE_ATTRIBUTES_FOR_SAL 0
#define __drv_typeConst 0
#define __drv_typeCond 1
#define VS_VERSION_INFO 1
#define VFFF_ISSHAREDFILE 0x0001
#define VFF_CURNEDEST 0x0001
#define VIFF_FORCEINSTALL 0x0001
#define __drv_typeBitset 2
#define VFF_FILEINUSE 0x0002
#define VIFF_DONTDELETEOLD 0x0002
#define __drv_typeExpr 3
#define VFF_BUFFTOOSMALL 0x0004
#define VS_USER_DEFINED 100
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 101
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1000
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment