Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHK not decrypting/verifiying data #53

Closed
eriksmets opened this issue Oct 29, 2015 · 8 comments
Closed

PHK not decrypting/verifiying data #53

eriksmets opened this issue Oct 29, 2015 · 8 comments

Comments

@eriksmets
Copy link

On 6S+ iOS9.0.2 (jailbroken, for the matter)
Raspberry Pi B2
Latest github commit.

After sending accessories info, the PHK daemon freezes and does not continue.

Ask for accessories info
Reply: HTTP/1.1 200 OK
Content-Type: application/hap+json
Content-Length: 743

{"accessories":[{"aid":1,"services":[{"iid":1,"type":"3E","characteristics":[{"value":"Light 1","perms":["pr"],"type":"23","iid":2,"format":"string"},{"value":"ET","perms":["pr"],"type":"20","iid":3,"format":"string"},{"value":"Light","perms":["pr"],"type":"21","iid":4,"format":"string"},{"value":"12345678","perms":["pr"],"type":"30","iid":5,"format":"string"},{"perms":["pw"],"type":"14","iid":6,"format":"bool"}]},{"iid":7,"type":"43","characteristics":[{"value":"Light","perms":["pr"],"type":"23","iid":8,"format":"string"},{"value":true,"perms":["pr","pw","ev"],"type":"25","iid":9,"format":"bool"},{"value":50,"minValue":0,"maxValue":100,"minStep":1,"perms":["pr","pw","ev"],"type":"8","iid":10,"unit":"percentage","format":"int"}]}]}]}
send: 1
send: 100000000000000
send: 2
I??|<QW???9??y?3?f??*bA4'0??Z)ߍ??9
Passed-in data is no-verified!

@etwmc
Copy link
Owner

etwmc commented Nov 1, 2015

I assume RPi is little endian?
Anyway, can you try the new push?

@eriksmets
Copy link
Author

It is little endian, according to python -c "import sys; print(sys.byteorder)"
Latest commit not working, same thing. Still: Passed-in data is no-verified!

@steveb48
Copy link

steveb48 commented Nov 7, 2015

I'm having the same issue on OS X. I can pair but nothing beyond that.

@etwmc
Copy link
Owner

etwmc commented Nov 8, 2015

I'm still trying to figure it out. It works on my Ubuntu x86-64, but not on anything else.
So I will probably finish tracking and fix it this week after I finish handling all the school work.

@etwmc
Copy link
Owner

etwmc commented Nov 13, 2015

I track down the problem: My MacBook weirdly pushed an old version of code for a while, which make the anything I push doesn't changed
I'm going to push this alongside with multi characteristic operation this weekend, but I'm going to need some testing in big endian platform before I can say I got all changes merge on this side.

@steveb48
Copy link

steveb48 commented Dec 4, 2015

Any luck?

@etwmc
Copy link
Owner

etwmc commented Dec 5, 2015

I'm not sure if the the current commit would work on RPi, because mine still haven't arrived, and my friend's was being used as a course project till next week. And given from the output, and the description on RPi endian, the byte swap seems also problematic.
But if you still see the byte swap happening on little endian machine, go to line 90 of PHKNetworkIP.cpp, and change it into the following:
return !e.c[0];
This reverse the result on the big endian detection, until I figure a way to write the endian system

If you wondering if the byte swap is occur, check for the line like this
send: 1
send: 100000000000000
send: 2

P.S. Sorry for taking so long. Never through overloading credits on MS is such time consuming. I haven't slept normally for a long time.

@eriksmets
Copy link
Author

Latest commit is working fine on my RPI (B2) !
And don't feel bad about it taking time, we are grateful that you chose to share your project with us.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants