netsec-ethz / fpki

4 stars 1 forks source link

New DB design #43

Closed cyrill-k closed 9 months ago

cyrill-k commented 1 year ago

This pull requests modifies the structure of the DB. The goals of the new design are:

This change is Reviewable

cyrill-k commented 1 year ago

pkg/common/structure.go line 10 at r1 (raw file):

Previously, cyrill-k wrote…
New naming scheme: - RPC + SP become PolicyCertificate, which has a `subject`, `issuer`, `domain`, `IsIssuer` bit, and `PolicyAttributes`. - `IsIssuer` specifies if this PolicyCertificate can be used to sign another certificate (or if it is a leaf). If the `IsIssuer` bit is not set, the PolicyCertificate may not have a public key. - `domain` specifies the domain that this PolicyCertificate is tied to. If this value is empty, then there is no restriction on the domain. If this value is non-empty, the `domain` attribute of any child must have the same value. - RCSR + PSR become PolicyCertificateSigningRequest. - SPT becomes SignedPolicyCertificateTimestamp. - PolicyRevocation becomes PolicyCertificateRevocation.

I forgot two objects relating to revocations:

cyrill-k commented 1 year ago

pkg/common/policies.go line 42 at r8 (raw file):

Previously, juagargi (Juan A. Garcia Pardo) wrote…
I thought we agreed to *not* use the identification of the issuer or owner via `Issuer` or `Owner`. In my opinion, we should *remove* the fields `Issuer` and `Subject`, and *always* identify issuer and owner via the hash of something that uniquely identifies the certificate (payload maybe?). We could add a new field `Description`, if people would want to have a human readable description of the certificate and what it is used for.

Let's use a new field IssuerHash which is the hash of the payload without SPCTs and without issuer signature while preserving the owner signature.

The analogous is done for the OwnerHash field.

And remove the Issuer and Subject field.

juagargi commented 1 year ago

pkg/common/policies.go line 42 at r8 (raw file):

Previously, cyrill-k wrote…
Let's use a new field `IssuerHash` which is the hash of the payload without SPCTs and without issuer signature while preserving the owner signature. The analogous is done for the `OwnerHash` field. And remove the `Issuer` and `Subject` field.

Note for future self: the issuer will not be present in the SPCTs or requests, only in certificate and revocation. Also, we can remove now the IssuerPubKeyHash and OwnerPubKeyHash.