Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
sbkpay
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhenfei.zhang
sbkpay
Commits
2dbc7ad8
Commit
2dbc7ad8
authored
Sep 12, 2017
by
李定达
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.2.0版本修改签名算法位RSA_SHA256并测试
parent
b116d29c
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
15 additions
and
12 deletions
+15
-12
sbkpay/DataProcess/cretopt.h
+5
-4
sbkpay/DataProcess/dataprocess.h
+4
-4
sbkpay/hostwidget.cpp
+2
-2
sbkpay/sbkpay.pro
+3
-1
sbkpay/sbkpay.pro.user
+1
-1
No files found.
sbkpay/DataProcess/cretopt.h
View file @
2dbc7ad8
#ifndef CRETOPT
#
ifndef
CRETOPT
#define CRETOPT
#define CRETOPT
#include "dataprocess.h"
#include "dataprocess.h"
...
@@ -215,9 +215,10 @@ private:
...
@@ -215,9 +215,10 @@ private:
serpublickey
=
json
[
JSON_KEY_SERPBLICKEY
].
toString
();
serpublickey
=
json
[
JSON_KEY_SERPBLICKEY
].
toString
();
cleprivatekey
=
json
[
JSON_KEY_CLIENTPRIKEY
].
toString
();
cleprivatekey
=
json
[
JSON_KEY_CLIENTPRIKEY
].
toString
();
#ifdef FM_DEBUG
//QLOG_INFO() << "server public key : " << serpublickey;
QLOG_INFO
()
<<
"server public key : "
<<
serpublickey
;
//QLOG_INFO() << "client private key : " << cleprivatekey;
QLOG_INFO
()
<<
"client private key : "
<<
cleprivatekey
;
#endif
return
true
;
return
true
;
}
}
...
...
sbkpay/DataProcess/dataprocess.h
View file @
2dbc7ad8
...
@@ -92,7 +92,7 @@ public:
...
@@ -92,7 +92,7 @@ public:
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
[
3
3
]
=
{
'\0'
};
unsigned
char
sha1
[
3
2
]
=
{
'\0'
};
char
tmpprivatekey
[
MAX_RSA_KEY_LEN
]
=
{
0
};
char
tmpprivatekey
[
MAX_RSA_KEY_LEN
]
=
{
0
};
...
@@ -121,7 +121,7 @@ public:
...
@@ -121,7 +121,7 @@ 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
);
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
);
free
(
sig
);
RSA_free
(
rsa
);
RSA_free
(
rsa
);
printf
(
"RSA_sign error.
\n
"
);
printf
(
"RSA_sign error.
\n
"
);
...
@@ -146,7 +146,7 @@ public:
...
@@ -146,7 +146,7 @@ public:
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
[
3
3
];
unsigned
char
sha1
[
3
2
];
char
tmppublickey
[
MAX_RSA_KEY_LEN
]
=
{
0
};
char
tmppublickey
[
MAX_RSA_KEY_LEN
]
=
{
0
};
...
@@ -177,7 +177,7 @@ public:
...
@@ -177,7 +177,7 @@ 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
);
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
);
free
(
sig_debase
);
RSA_free
(
rsa
);
RSA_free
(
rsa
);
printf
(
"RSA_verify error.
\n
"
);
printf
(
"RSA_verify error.
\n
"
);
...
...
sbkpay/hostwidget.cpp
View file @
2dbc7ad8
...
@@ -86,8 +86,8 @@ void HostWidget::ShowWidget(QWidget *showwidget)
...
@@ -86,8 +86,8 @@ void HostWidget::ShowWidget(QWidget *showwidget)
}
}
//
this->show();
//
this->show();
//
this->move(1200, 500);
//
this->move(1200, 500);
this
->
showFullScreen
();
this
->
showFullScreen
();
}
}
...
...
sbkpay/sbkpay.pro
View file @
2dbc7ad8
...
@@ -15,7 +15,9 @@ include("./DataProcess/DataProcess.pri")
...
@@ -15,7 +15,9 @@ include("./DataProcess/DataProcess.pri")
LIBS
+=
-
L
$$
PWD
/
lib
-
llibeay32
-
lssleay32
LIBS
+=
-
L
$$
PWD
/
lib
-
llibeay32
-
lssleay32
CONFIG
+=
C
++
11
CONFIG
+=
C
++
11
SBKDLL
#DEFINES += FM_DEBUG
include
(
$$
PWD
/
qtwinmigrate
/
src
/
qtwinmigrate
.
pri
)
include
(
$$
PWD
/
qtwinmigrate
/
src
/
qtwinmigrate
.
pri
)
...
...
sbkpay/sbkpay.pro.user
View file @
2dbc7ad8
<?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-12T1
5:59:20
. -->
<!-- Written by QtCreator 3.5.1, 2017-09-12T1
6:12:07
. -->
<qtcreator>
<qtcreator>
<data>
<data>
<variable>
EnvironmentId
</variable>
<variable>
EnvironmentId
</variable>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment