-
Notifications
You must be signed in to change notification settings - Fork 2
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
Public key pinning is nil
and disabled by default - contrary to documentation
#19
Comments
Hi @roschaefer - HTTP pinning is where I stopped the development back in the days. Unfortunately I can't remember what stage it is in right now. I am in the Threema Group of API developers and we had some chats about it. See the created issues by @rugk from this time. If you're interested in being invited in this group let me know and I ask the admin(s). The easy fix would be to remove it. My preferred way would be to have it properly implemented also covering the issues linked above. However, I won't find the time over the next 4 weeks as least. Therefore I can't make any demands. I do agree that it is broken in its current implementation and should get fixed. |
Of course I am interested. @mattwr18 @tillprochaska @phoeinx you?
That is fine. It's called
I have a follow-up question. Does HTTP public key pinning means that this gem needs to be updated as soon as possible when the public key of Threema Gateway API changes? In the meantime, applications wouldn't be able to receive messages anymore? In our use-case that would not be acceptable. For context, I haven't looked into public key pinning in detail but saw the public key in this gem is outdated. Compare: https://github.com/thorsteneckel/threema/blob/master/lib/threema/client.rb#L11 With:
The article on Wikipedia starts with:
|
Note HPKP has nothing to do with static key pinning, which we use here. Static key pinning does not have the problems of HPKP, so that's not an issue. As for the wrong key, yeah, likely also a maintenance problem. One just needs to update it to the correct one. Some time ago they have notified the API consumers via mail about that change too: rugk/threema-msgapi-sdk-php#59 |
@mattwr18 @tillprochaska @phoeinx @roschaefer please send me your Threema IDs to support at zammad.com, refer to Thorsten and this issue. I'll forward your IDs to the admins. |
OK, so I tried to fix static certificate pinning with the least amount of code. Instead of fixing ruby named arguments, I decided to pass a reference to the threema instance. I have questions: Why are `Threema` and `Threema::Client` two different classes? They seem very entangled. Do we know in advance when Threema changes the public key? Would we have to allow two fingerprints during the migration? (old and new?) Fix threemarb#19
OK, so I tried to fix static certificate pinning with the least amount of code. Instead of fixing ruby named arguments, I decided to pass a reference to the threema instance. I have questions: Why are `Threema` and `Threema::Client` two different classes? They seem very entangled. Do we know in advance when Threema changes the public key? Would we have to allow two fingerprints during the migration? (old and new?) Fix threemarb#19
WHY: I chatted with Threema developers and one of them discouraged me from implementing static certificate pinning because they have no workflow to inform developers of upcoming changes to their HTTPS certificates. So that's why we have at least * get rid of the hardcoded HTTPS fingerprint, because it's unmaintainable * disable static certificate pinning by default Nevertheless, @rugk writes that static certificate pinning is a useful feature and does not suffer from the problems of HTTP public key pinning, see: https://en.wikipedia.org/wiki/HTTP_Public_Key_Pinning So I changed the source code in such a way that it's still possible to configure the used HTTP client for certificate pinning as it used to be. This commit includes a refactoring: DRY the threema client by passing a reference to `threema` instance. Thus, the client does not have to remember it's own `private_key`, `api_identity` and `api_secret`. Less redundancy, less errors. Fix threemarb#19
WHY: I chatted with Threema developers and one of them discouraged me from implementing static certificate pinning because they have no workflow to inform developers of upcoming changes to their HTTPS certificates. So that's why we have at least * get rid of the hardcoded HTTPS fingerprint, because it's unmaintainable * disable static certificate pinning by default Nevertheless, @rugk writes that static certificate pinning is a useful feature and does not suffer from the problems of HTTP public key pinning, see: https://en.wikipedia.org/wiki/HTTP_Public_Key_Pinning So I changed the source code in such a way that it's still possible to configure the used HTTP client for certificate pinning as it used to be. This commit includes a refactoring: DRY the threema client by passing a reference to `threema` instance. Thus, the client does not have to remember it's own `private_key`, `api_identity` and `api_secret`. Less redundancy, less errors. Fix threemarb#19
WHY: I chatted with Threema developers and one of them discouraged me from implementing static certificate pinning because they have no workflow to inform developers of upcoming changes to their HTTPS certificates. So that's why we have at least * get rid of the hardcoded HTTPS fingerprint, because it's unmaintainable * disable static certificate pinning by default Nevertheless, @rugk writes that static certificate pinning is a useful feature and does not suffer from the problems of HTTP public key pinning, see: https://en.wikipedia.org/wiki/HTTP_Public_Key_Pinning So I changed the source code in such a way that it's still possible to configure the used HTTP client for certificate pinning as it used to be. This commit includes a refactoring: DRY the threema client by passing a reference to `threema` instance. Thus, the client does not have to remember it's own `private_key`, `api_identity` and `api_secret`. Less redundancy, less errors. Fix threemarb#19
WHY: I chatted with Threema developers and one of them discouraged me from implementing static certificate pinning because they have no workflow to inform developers of upcoming changes to their HTTPS certificates. So that's why we have at least * get rid of the hardcoded HTTPS fingerprint, because it's unmaintainable * disable static certificate pinning by default Nevertheless, @rugk writes that static certificate pinning is a useful feature and does not suffer from the problems of HTTP public key pinning, see: https://en.wikipedia.org/wiki/HTTP_Public_Key_Pinning So I changed the source code in such a way that it's still possible to configure the used HTTP client for certificate pinning as it used to be. This commit includes a refactoring: DRY the threema client by passing a reference to `threema` instance. Thus, the client does not have to remember it's own `private_key`, `api_identity` and `api_secret`. Less redundancy, less errors. Fix threemarb#19
WHY: I chatted with Threema developers and one of them discouraged me from implementing static certificate pinning because they have no workflow to inform developers of upcoming changes to their HTTPS certificates. So that's why we have at least * get rid of the hardcoded HTTPS fingerprint, because it's unmaintainable * disable static certificate pinning by default Nevertheless, @rugk writes that static certificate pinning is a useful feature and does not suffer from the problems of HTTP public key pinning, see: https://en.wikipedia.org/wiki/HTTP_Public_Key_Pinning So I changed the source code in such a way that it's still possible to configure the used HTTP client for certificate pinning as it used to be. This commit includes a refactoring: DRY the threema client by passing a reference to `threema` instance. Thus, the client does not have to remember it's own `private_key`, `api_identity` and `api_secret`. Less redundancy, less errors. Fix #19
Hey @thorsteneckel I'm trying to fix tests locally for this gem. Tests for
HTTP Public Key Pinning
all fail.Documentation says:
But looking into the source code:
Makes me believe, it's
nil
by default.When I
bin/rails c
in our app that installedthreema
and do the following:gives me
I think it's because of a misconception of named arguments:
I was using
ruby 2.7.1p83
Could we maybe remove HTTP key pinning? Or do you prefer fixing HTTP key pinning?
The text was updated successfully, but these errors were encountered: