Skip to content

testhelper: Fix certificate being generated for the wrong entity

Patrick Steinhardt requested to merge pks-testhelper-fix-cert-generation into master

The GenerateCerts() helper function generates two certificates: the root certificate that acts as certificate authority, and the entity certificate that is signed by the root certificate. The server should then ultimately use the entity certificate for its operation.

The way we generate certificates is wrong though: we use the root certificate as template and sign it with the entity's certificate. This also explains why all the parameters that should theoretically be set for the entity are instead set in the root certificate.

Fix this bug so that we correctly use the entity certificate with proper parameters as template and sign it with the root certificate.

Merge request reports