Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
don
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
25
Issues
25
List
Boards
Labels
Service Desk
Milestones
Merge Requests
5
Merge Requests
5
Operations
Operations
Incidents
Environments
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
LQDN Adminsys
don
Commits
ef5f0d54
Commit
ef5f0d54
authored
Oct 30, 2018
by
Mindiell
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'new-hash' into 'preprod'
Use HMAC-SHA256 instead of SHA1 Closes
#29
See merge request
!5
parents
5a645e27
4f987deb
Changes
3
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
5 deletions
+8
-5
app/controller/bank.php
app/controller/bank.php
+5
-3
app/controller/campaign.php
app/controller/campaign.php
+1
-1
app/controller/perso.php
app/controller/perso.php
+2
-1
No files found.
app/controller/bank.php
View file @
ef5f0d54
...
...
@@ -81,9 +81,11 @@ class Bank extends Controller
$sig
.
=
$value
.
"+"
;
}
$sig
.
=
CERTIFICATE
;
$cb_log
->
write
(
"sig: "
.
$signature
.
" == "
.
sha1
(
$sig
));
if
(
sha1
(
$sig
)
!=
$signature
)
{
$error
=
"Error in signature: "
.
$signature
.
" != "
.
sha1
(
$sig
);
### Attempt to do it in hmac-sha256
$sig_hash
=
base64_encode
(
hash_hmac
(
'sha256'
,
$sig
,
CERTIFICATE
,
true
));
$cb_log
->
write
(
"sig: "
.
$signature
.
" == "
.
$sig_hash
);
if
(
$sig_hash
!=
$signature
)
{
$error
=
"Error in signature: "
.
$signature
.
" != "
.
$sig_hash
;
}
// Résultats des vérifications globales
if
(
$error
!=
""
)
{
...
...
app/controller/campaign.php
View file @
ef5f0d54
...
...
@@ -196,7 +196,7 @@ class Campaign extends Controller
$signature
.
=
$value
.
"+"
;
}
$signature
.
=
CERTIFICATE
;
$signature
=
sha1
(
$signature
);
$signature
=
base64_encode
(
hash_hmac
(
'sha256'
,
$signature
,
CERTIFICATE
,
true
)
);
$params
[
"signature"
]
=
$signature
;
$f3
->
set
(
'target'
,
$target
);
...
...
app/controller/perso.php
View file @
ef5f0d54
...
...
@@ -538,7 +538,8 @@ class Perso extends Controller
$signature
.
=
$value
.
"+"
;
}
$signature
.
=
CERTIFICATE
;
$signature
=
sha1
(
$signature
);
$signature
=
base64_encode
(
hash_hmac
(
'sha256'
,
$signature
,
CERTIFICATE
,
true
));
#$signature = sha1($signature);
$parameters
[
"wsSignature"
]
=
$signature
;
$client
=
new
\
SoapClient
(
"https://paiement.systempay.fr/vads-ws/ident-v2.1?wsdl"
);
$result
=
$client
->
customerCancel
(
$parameters
);
...
...
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