git.cweiske.de
/
stouyapi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
f19759b
)
double encryption for purchase responses
author
Christian Weiske
<cweiske@cweiske.de>
Sun, 26 Jan 2020 12:56:43 +0000
(13:56 +0100)
committer
Christian Weiske
<cweiske@cweiske.de>
Sun, 26 Jan 2020 12:56:43 +0000
(13:56 +0100)
www/api/v1/games/purchase.php
patch
|
blob
|
history
diff --git
a/www/api/v1/games/purchase.php
b/www/api/v1/games/purchase.php
index 38e58d28ea239da9fc0d627cc706ef037cad0517..ef6531ccf221b04c53c1b6585ea75a2cea7e3b25 100644
(file)
--- a/
www/api/v1/games/purchase.php
+++ b/
www/api/v1/games/purchase.php
@@
-43,12
+43,22
@@
if ($product === null) {
$payload = $product;
$payload->uuid = $buyRequest->uuid;
$payload = $product;
$payload->uuid = $buyRequest->uuid;
-$enc = [
+//"god of blades" and "pinball arcade" want double-encrypted responses
+// muffin knights works with single encryption
+$enc1 = [
'key' => base64_encode('0123456789abcdef'),
'iv' => 't3jir1LHpICunvhlM76edQ==',//random bytes
'blob' => base64_encode(
json_encode($payload, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES)
),
];
'key' => base64_encode('0123456789abcdef'),
'iv' => 't3jir1LHpICunvhlM76edQ==',//random bytes
'blob' => base64_encode(
json_encode($payload, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES)
),
];
-echo json_encode($enc, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES) . "\n";
+
+$enc2 = [
+ 'key' => base64_encode('0123456789abcdef'),
+ 'iv' => 't3jir1LHpICunvhlM76edQ==',//random bytes
+ 'blob' => base64_encode(
+ json_encode($enc1, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES)
+ ),
+];
+echo json_encode($enc2, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES) . "\n";
?>
?>