Open securitykernel opened 2 years ago
I think one issue is that OCSP relies on SHA-1 as a key identifier, though I don't recall the details at the moment.
Absolutely in favor of any changes which allow disabling SHA-1 in more configurations.
Possibly for OCSP we can use some different key identifier mechanism instead.
So from what I can see, the following things need to be done to fix the tests:
Re OCSP (via Feisty Duck TLS News):
The CA/Browser Forum has decided to deprecate the use of SHA-1 signatures in OCSP signing. SHA-1 signatures for certificates were deprecated in the web PKI a long time ago, but in OCSP they were still allowed. Some further discussion around this issue can be found in the bug tracker of the Go x509 module. The module’s developer, Filippo Valsorda, recently tried to disable SHA-1 signatures and had to re-enable them for OCSP.
It's not just the signatures either - IIRC, OCSP uses the SHA-1 of the certificate as a key identifier.
Oh, or looking at this code again, perhaps it just was "required" by the ecosystem at the time I wrote the OCSP code? It may be we can start using SHA-256 here, given that this comment dates back to 2012.
Our high-level goal is to be able to use the BSI module policy and additionally enable the tls module, but leave the sha1 module disabled. This is currently not possible, as tls depends on x509, which depends on sha1. From looking at the code, it seems the x509 module already handles non-existence of the sha1 module by throwing, e.g., at runtime in
X509Cert::subject_public_key_bitstring_sha1()
. This function seems to be used byFlatfile_Certificate_Store
, which we could potentially replace. Also, ocsp relies onsubject_public_key_bitstring_sha1()
. Additionally, theCertificateStore
interface and implementations rely on it viaCertificateStore::find_cert_by_pubkey_sha1()
, I am not sure what the consequences would be here.Temporarily removing sha1 from x509's info.txt builds just fine, but unsurprisingly some tests fail:
Probably we can replace most of the test certificates using SHA-1 with SHA-256 ones, that depends on the source. I will check these.