Closed Demi-Marie closed 4 years ago
@briansmith what are your thoughts?
I'm not planning to add support for custom extension handlers. This project is about the Web PKI and helping to agree on and standardize improvements to the Web PKI. If there is an extension that we think warrants spending time on, we should add support for it directly to Web PKI.
Background
In libp2p, TLS certificates are not signed by a certificate authority (CA). Instead, self-signed certificates are used, and there is a custom critical extension that contains:
Furthermore, my understanding is that most other parts of the certificate are stubbed out. For example, libp2p does not require the Subject Alternative Name extension, or even the Basic Constraints extension. Since certificates used in libp2p are ephemeral, the issuer and subject may be zero-length stubs.
The exact procedure is part of the libp2p specification, which is the definitive document.
Currently, WebPKI fails to parse libp2p certificates, because it doesn’t understand the critical libp2p extension. WebPKI cannot validate such certificates itself, because doing so may require algorithms (such as ECDSA over secp256k1) that ring does not support. libp2p implementations handle most certificate validation themselves, and extract the node’s identity key from the certificate manually.
In order to be usable with libp2p, WebPKI needs to be able to parse libp2p X.509 certificates, and to be able to validate signatures made with their keys. However, webpki currently rejects such certificates at parse time.
Although libp2p is where I realized this problem, it is not the only place where it arises. Kerberos would have the same problem, as it too uses extensions that are not found on the web.
Suggested Solution
I propose the following API: