Closed Droeftoeter closed 7 years ago
Nice addition!, I will have a look at it later today :)
Nice addition!, I will have a look at it later today :)
How's the merge process going?
Before this is merged, the function generateRequestHash()
in src/Handlers/Signature.php
should be replaced with:
protected function generateRequestHash($serializedTicket, $serializedRequest)
{
$seed = (unpack("J", pack("H*", xxhash64($serializedTicket, 0x1B845238))))[1];
return (unpack("J", pack("H*", xxhash64($request, $seed))))[1];
}
(See also https://github.com/Droeftoeter/pokapi/pull/4)
Ill update it tonight.
Progress?
Anyone up for the challenge?
It seems the signatures we generated are not correct. And the only way to properly sign them is by using a hashing server.
Hey, I added basic request signing. I wasn't able to test this on PHP 5.6 but I think the random_bytes polyfill works.
This extension is required for request signing: https://github.com/MatthewKingDev/php-xxhash Also depends on https://github.com/NicklasWallgren/pogoprotos-php/pull/5
I suggest switching to https://github.com/protobuf-php/protobuf-plugin for protobuf generation in a later version.