Commit 2dbc7ad8 by 李定达

1.2.0版本修改签名算法位RSA_SHA256并测试

parent b116d29c
#ifndef CRETOPT
#ifndef CRETOPT
#define CRETOPT
#include "dataprocess.h"
......@@ -215,9 +215,10 @@ private:
serpublickey = json[JSON_KEY_SERPBLICKEY].toString();
cleprivatekey = json[JSON_KEY_CLIENTPRIKEY].toString();
//QLOG_INFO() << "server public key : " << serpublickey;
//QLOG_INFO() << "client private key : " << cleprivatekey;
#ifdef FM_DEBUG
QLOG_INFO() << "server public key : " << serpublickey;
QLOG_INFO() << "client private key : " << cleprivatekey;
#endif
return true;
}
......
......@@ -92,7 +92,7 @@ public:
unsigned int length = 0;
BIO* in = NULL;
//unsigned char sha1[20] = { '\0' };
unsigned char sha1[33] = { '\0' };
unsigned char sha1[32] = { '\0' };
char tmpprivatekey[MAX_RSA_KEY_LEN] = {0};
......@@ -121,7 +121,7 @@ public:
//SHA1((const unsigned char *)text, strlen(text), sha1);
SHA256((const unsigned char *)text, strlen(text), sha1);
if (1 != RSA_sign(NID_sha1, sha1, 20, sig, &len, rsa)) {
if (1 != RSA_sign(NID_sha256, sha1, 32, sig, &len, rsa)) {
free(sig);
RSA_free(rsa);
printf("RSA_sign error.\n");
......@@ -146,7 +146,7 @@ public:
BIO* in = NULL;
char * sig_debase = NULL;
//unsigned char sha1[20];
unsigned char sha1[33];
unsigned char sha1[32];
char tmppublickey[MAX_RSA_KEY_LEN] = {0};
......@@ -177,7 +177,7 @@ public:
//SHA1((const unsigned char *)text, strlen(text), sha1);
SHA256((const unsigned char *)text, strlen(text), sha1);
if (1 != RSA_verify(NID_sha1, sha1, 20, (unsigned char *)sig_debase, 128, rsa)) {
if (1 != RSA_verify(NID_sha256, sha1, 32, (unsigned char *)sig_debase, 128, rsa)) {
free(sig_debase);
RSA_free(rsa);
printf("RSA_verify error.\n");
......
......@@ -86,8 +86,8 @@ void HostWidget::ShowWidget(QWidget *showwidget)
}
//this->show();
//this->move(1200, 500);
// this->show();
// this->move(1200, 500);
this->showFullScreen();
}
......
......@@ -15,7 +15,9 @@ include("./DataProcess/DataProcess.pri")
LIBS += -L$$PWD/lib -llibeay32 -lssleay32
CONFIG += C++11
CONFIG += C++11 SBKDLL
#DEFINES += FM_DEBUG
include($$PWD/qtwinmigrate/src/qtwinmigrate.pri)
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 3.5.1, 2017-09-12T15:59:20. -->
<!-- Written by QtCreator 3.5.1, 2017-09-12T16:12:07. -->
<qtcreator>
<data>
<variable>EnvironmentId</variable>
......
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