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
Suppress AbstractProfile::CA_CLASH_ADDED for a new CA with the same public key #222
Conversation
Attempting to identify a root vs. cross-signed equivalent CA by its name is not sufficient. The whole alerting feature is about a (hyporthetical) attacker taking over the account of an inst admin, and then replacing the root CA with one that has an identical name but is under control of the attacker. It is easily possible to synthesize a CA that has many of the same properties as the expected original. So, merely comparing the name is something that can easily be catered for by an attacker. The only property that cannot be synthesized by the attacker is the public/private keypair. And here a modified PR would make sense: additionally to the name, also compare if the public key of the intermediate version matches the public key of the root variant. Only if they are both identical, then we can be sure it is the "same" CA (in the sense that the person/organisation controlling the old cert's private key is also the organisation controlling the new cert's private key). Please modify your PR to compare public keys, too. In the example you gave in issue #221, this would be the key: Subject Public Key Info: |
Thanks @restena-sw I understand I mixed up the root flag anyway (it should be old=0, new=1). Furthermore, per your comment, I now think I should only check for a matching public key in order to skip this warning, regardless the type of CA. Your thoughts? As I could not find any established facility to inspect the public key or modulus, I added fetching the string representation, which I then just compare, so as to not have to deal with different key types/algorithms. Please advise if this is an acceptable approach. PS: I will subsequently squash the additional commit(s) and update messages and description. |
This looks very good! Happy to merge this and backport to release_2_0 branch after squashing. And yes, it doesn't matter if the status changed from intermediate to root either. One could also imagine re-issuing an intermediate as intermediate; or even re-issuing a root with some differing properties. It's still the "same" CA then, and there is no need for the overly alerting warning. The public key (and by that, private key) being identical is the only thing that really counts. |
Thanks @restena-sw, all done |
Suppress AbstractProfile::CA_CLASH_ADDED for a new CA with the same public key
Fix #221
Skip
AbstractProfile::CA_CLASH_ADDED
when the new CA has the same name with an existing CA, but also an identical public key.