Commit 5883851a by NitefullWind

1. 整合onedatabase分支 [36666963] 代码。

parent 34af0b6b
...@@ -255,6 +255,10 @@ public: ...@@ -255,6 +255,10 @@ public:
qDebug() << sha1; qDebug() << sha1;
QByteArray array(sha1);
qDebug() << array.toBase64();
EVP_CIPHER_CTX_init(&ctx); EVP_CIPHER_CTX_init(&ctx);
EVP_EncryptInit_ex(&ctx, EVP_aes_256_cbc(), NULL, (const unsigned char *)sha1, (const unsigned char *)tmpiv); EVP_EncryptInit_ex(&ctx, EVP_aes_256_cbc(), NULL, (const unsigned char *)sha1, (const unsigned char *)tmpiv);
if(!EVP_EncryptUpdate(&ctx, (unsigned char*)tmp, &iOutLen, (const unsigned char *)in, inlen)) if(!EVP_EncryptUpdate(&ctx, (unsigned char*)tmp, &iOutLen, (const unsigned char *)in, inlen))
......
...@@ -58,7 +58,9 @@ void RollBack::RollWiteQuery(QSqlDatabase &_db, QSqlQuery &query) ...@@ -58,7 +58,9 @@ void RollBack::RollWiteQuery(QSqlDatabase &_db, QSqlQuery &query)
json[JSON_KEY_REQTYPE] = 3; json[JSON_KEY_REQTYPE] = 3;
json[JSON_KEY_VER] = DEFAULT_JSON_VER_VALUE; json[JSON_KEY_VER] = DEFAULT_JSON_VER_VALUE;
QString iv = json[JSON_KEY_RPARTNERID].toString() + json[JSON_KEY_RSTOREID].toString() + json[JSON_KEY_RSTATIONID].toString(); QString iv = QString::number(json[JSON_KEY_RPARTNERID].toInt()) + json[JSON_KEY_RSTOREID].toString() + json[JSON_KEY_RSTATIONID].toString();
QLOG_INFO() << "iv : " << iv;
if(!CretOperate::GetSign(json, iv)) if(!CretOperate::GetSign(json, iv))
{ {
......
...@@ -187,7 +187,8 @@ void Control::InitModel() ...@@ -187,7 +187,8 @@ void Control::InitModel()
bool Control::SendMessageToServer(const QJsonObject &json, QByteArray &outdata, QString &error) bool Control::SendMessageToServer(const QJsonObject &json, QByteArray &outdata, QString &error)
{ {
QString iv = json[JSON_KEY_PARTNERID].toString() + json[JSON_KEY_STOREID].toString() + json[JSON_KEY_STATIONID].toString(); QString iv = QString::number(json[JSON_KEY_PARTNERID].toInt()) + json[JSON_KEY_STOREID].toString() + json[JSON_KEY_STATIONID].toString();
QLOG_INFO() << "iv : " << iv;
QJsonObject tmpjson = json; QJsonObject tmpjson = json;
tmpjson[JSON_KEY_VER] = DEFAULT_JSON_VER_VALUE; tmpjson[JSON_KEY_VER] = DEFAULT_JSON_VER_VALUE;
CretOperate::GetMAC(tmpjson); CretOperate::GetMAC(tmpjson);
...@@ -473,8 +474,8 @@ bool Control::GetRSA(QString &error) ...@@ -473,8 +474,8 @@ bool Control::GetRSA(QString &error)
json.insert(JSON_KEY_STOREID, FMTool::GetJsonValue(_posReqJsonObj, JSON_KEY_STOREID).toString()); json.insert(JSON_KEY_STOREID, FMTool::GetJsonValue(_posReqJsonObj, JSON_KEY_STOREID).toString());
json.insert(JSON_KEY_STATIONID, FMTool::GetJsonValue(_posReqJsonObj, JSON_KEY_STATIONID).toString()); json.insert(JSON_KEY_STATIONID, FMTool::GetJsonValue(_posReqJsonObj, JSON_KEY_STATIONID).toString());
json.insert(JSON_KEY_PARTNERID, FMTool::GetJsonValue(_posReqJsonObj, JSON_KEY_PARTNERID).toInt()); json.insert(JSON_KEY_PARTNERID, FMTool::GetJsonValue(_posReqJsonObj, JSON_KEY_PARTNERID).toInt());
// iv = FMTool::GetString(_request.PlatNo, 4) + FMTool::GetString(_request.StoreNo, 20) + FMTool::GetString(_request.DeviceNo, 6);
iv = FMTool::GetString(_request.PlatNo, 4) + FMTool::GetString(_request.StoreNo, 20) + FMTool::GetString(_request.DeviceNo, 6); iv = QString::number(FMTool::GetJsonValue(_posReqJsonObj, JSON_KEY_PARTNERID).toInt()) + FMTool::GetJsonValue(_posReqJsonObj, JSON_KEY_STOREID).toString() + FMTool::GetJsonValue(_posReqJsonObj, JSON_KEY_STATIONID).toString();
QLOG_INFO() << "get iv : " << iv; QLOG_INFO() << "get iv : " << iv;
...@@ -606,7 +607,9 @@ void Control::Request(ReqType type, QStringList list) ...@@ -606,7 +607,9 @@ void Control::Request(ReqType type, QStringList list)
QByteArray tmparray; QByteArray tmparray;
QString tmperror; QString tmperror;
QString iv = json[JSON_KEY_PARTNERID].toString() + json[JSON_KEY_STOREID].toString() + json[JSON_KEY_STATIONID].toString(); QString iv = QString::number(json[JSON_KEY_PARTNERID].toInt()) + json[JSON_KEY_STOREID].toString() + json[JSON_KEY_STATIONID].toString();
QLOG_INFO() << "iv : " << iv;
QJsonObject tmpjson = json; QJsonObject tmpjson = json;
tmpjson[JSON_KEY_VER] = DEFAULT_JSON_VER_VALUE; tmpjson[JSON_KEY_VER] = DEFAULT_JSON_VER_VALUE;
......
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