Commit b116d29c by 李定达

1.ver2.0极其以后版本

parent 617c143f
...@@ -91,7 +91,8 @@ public: ...@@ -91,7 +91,8 @@ public:
unsigned int len; unsigned int len;
unsigned int length = 0; unsigned int length = 0;
BIO* in = NULL; BIO* in = NULL;
unsigned char sha1[20] = { '\0' }; //unsigned char sha1[20] = { '\0' };
unsigned char sha1[33] = { '\0' };
char tmpprivatekey[MAX_RSA_KEY_LEN] = {0}; char tmpprivatekey[MAX_RSA_KEY_LEN] = {0};
...@@ -118,7 +119,8 @@ public: ...@@ -118,7 +119,8 @@ public:
return 0; return 0;
} }
SHA1((const unsigned char *)text, strlen(text), sha1); //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_sha1, sha1, 20, sig, &len, rsa)) {
free(sig); free(sig);
RSA_free(rsa); RSA_free(rsa);
...@@ -143,7 +145,8 @@ public: ...@@ -143,7 +145,8 @@ public:
RSA *rsa; RSA *rsa;
BIO* in = NULL; BIO* in = NULL;
char * sig_debase = NULL; char * sig_debase = NULL;
unsigned char sha1[20]; //unsigned char sha1[20];
unsigned char sha1[33];
char tmppublickey[MAX_RSA_KEY_LEN] = {0}; char tmppublickey[MAX_RSA_KEY_LEN] = {0};
...@@ -172,7 +175,8 @@ public: ...@@ -172,7 +175,8 @@ public:
} }
SHA1((const unsigned char *)text, strlen(text), sha1); //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_sha1, sha1, 20, (unsigned char *)sig_debase, 128, rsa)) {
free(sig_debase); free(sig_debase);
RSA_free(rsa); RSA_free(rsa);
......
...@@ -71,7 +71,7 @@ ...@@ -71,7 +71,7 @@
#define JSON_KEY_BEGINTIME "beginTime" #define JSON_KEY_BEGINTIME "beginTime"
#define JSON_KEY_ENDTIME "endTime" #define JSON_KEY_ENDTIME "endTime"
#define DEFAULT_JSON_VER_VALUE 1 #define DEFAULT_JSON_VER_VALUE 2
#define DEFAULT_JSON_PRODUCTS_NORMAL "NORMAL" #define DEFAULT_JSON_PRODUCTS_NORMAL "NORMAL"
#define DEFAULT_JSON_PRODUCTS_FREE "FREE" #define DEFAULT_JSON_PRODUCTS_FREE "FREE"
......
...@@ -15,7 +15,7 @@ include("./DataProcess/DataProcess.pri") ...@@ -15,7 +15,7 @@ include("./DataProcess/DataProcess.pri")
LIBS += -L$$PWD/lib -llibeay32 -lssleay32 LIBS += -L$$PWD/lib -llibeay32 -lssleay32
CONFIG += C++11 SBKDLL CONFIG += C++11
include($$PWD/qtwinmigrate/src/qtwinmigrate.pri) include($$PWD/qtwinmigrate/src/qtwinmigrate.pri)
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject> <!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 3.5.1, 2017-09-12T14:58:21. --> <!-- Written by QtCreator 3.5.1, 2017-09-12T15:59:20. -->
<qtcreator> <qtcreator>
<data> <data>
<variable>EnvironmentId</variable> <variable>EnvironmentId</variable>
...@@ -226,12 +226,14 @@ ...@@ -226,12 +226,14 @@
</valuelist> </valuelist>
<value type="int" key="PE.EnvironmentAspect.Base">2</value> <value type="int" key="PE.EnvironmentAspect.Base">2</value>
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/> <valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
<value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.Arguments"></value> <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">sbkpay</value>
<value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.Executable"></value>
<value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.WorkingDirectory">%{buildDir}</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">自定义执行档</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.CustomExecutableRunConfiguration</value> <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:D:/gitcode/sbkpay/sbkpay/sbkpay.pro</value>
<value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.CommandLineArguments"></value>
<value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.ProFile">sbkpay.pro</value>
<value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseDyldImageSuffix">false</value>
<value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseTerminal">false</value>
<value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory"></value>
<value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value> <value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value>
<value type="bool" key="RunConfiguration.UseCppDebugger">false</value> <value type="bool" key="RunConfiguration.UseCppDebugger">false</value>
<value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value> <value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</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