Skip to content
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

Factor out "p11trustmod" package #28

Open
JeremyRand opened this issue Jun 28, 2021 · 0 comments
Open

Factor out "p11trustmod" package #28

JeremyRand opened this issue Jun 28, 2021 · 0 comments

Comments

@JeremyRand
Copy link
Member

We should refactor ncp11, by factoring out a p11trustmod package. This package will provide a p11mod.Slot, and will accept a p11trustmod.Backend, which provides the following interface:

  • Accepts query for "IsBuiltinRootList"; returns boolean. If true, then the module will have a CKO_NSS_BUILTIN_ROOT_LIST object present, and certificates will have a CKA_NSS_MOZILLA_CA_POLICY attribute present. Otherwise, both are suppressed.
  • Accepts query for "IsTrusted"; returns boolean. If true, then the module will return both CKO_CERTIFICATE and CKO_NSS_TRUST objects. Otherwise, it will only return CKO_CERTIFICATE objects.
  • Accepts queries for certificates by value, subject, issuer+serial, or all certs.
  • Returns a struct per cert that contains the following fields (which are then converted into a CKO_CERTIFICATE and CKO_NSS_TRUST object and passed to p11mod):
    • Label (string)
    • Certificate (x509.Certificate)
    • Builtin Policy (boolean)
    • Trust for Server Auth (CKT_NSS_ trust value)
    • Trust for Client Auth (CKT_NSS_ trust value)
    • Trust for Code Signing (CKT_NSS_ trust value)
    • Trust for Email Protection (CKT_NSS_ trust value)
  • Info, TokenInfo (pass through to p11mod.Slot's functions)

ncp11 can then be refactored to provide this API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant