Commit Graph

8 Commits

Author SHA1 Message Date
Aaron Gable 0981768793
Extract cmd/ceremony into a separate binary (#6999)
Fixes https://github.com/letsencrypt/boulder/issues/6936
2023-07-14 15:34:23 -04:00
Aaron Gable 9c197e1f43
Use io and os instead of deprecated ioutil (#6286)
The iotuil package has been deprecated since go1.16; the various
functions it provided now exist in the os and io packages. Replace all
instances of ioutil with either io or os, as appropriate.
2022-08-10 13:30:17 -07:00
Eng Zer Jun f6db0fe0a3
test: use `T.TempDir` to create temporary test directory (#5930)
Use the T.TempDir method from the testing package to create temporary
directories for tests. Directories created by T.TempDir are automatically
removed when tests complete.
2022-02-07 12:41:28 -08:00
Jacob Hoffman-Andrews 23dd1e21f9
Build all boulder binaries into a single binary (#5693)
The resulting `boulder` binary can be invoked by different names to
trigger the behavior of the relevant subcommand. For instance, symlinking
and invoking as `boulder-ca` acts as the CA. Symlinking and invoking as
`boulder-va` acts as the VA.

This reduces the .deb file size from about 200MB to about 20MB.

This works by creating a registry that maps subcommand names to `main`
functions. Each subcommand registers itself in an `init()` function. The
monolithic `boulder` binary then checks what name it was invoked with
(`os.Args[0]`), looks it up in the registry, and invokes the appropriate
`main`. To avoid conflicts, all of the old `package main` are replaced
with `package notmain`.

To get the list of registered subcommands, run `boulder --list`. This
is used when symlinking all the variants into place, to ensure the set
of symlinked names matches the entries in the registry.

Fixes #5692
2021-10-20 17:05:45 -07:00
Jacob Hoffman-Andrews 6ee3e1748a
Allow generating a key in a non-empty slot. (#5014)
Partial revert of #4981 / 62eae60. Some HSMs have a small number
of slots and require storing multiple keys per slot (differentiated
by keyID, which we now look up based on the public key per #4992).
2020-08-11 12:49:24 -07:00
Jacob Hoffman-Andrews 0834ca4a19
pkcs11helper: add a Session abstraction (#4989) 2020-07-29 12:38:45 -07:00
Jacob Hoffman-Andrews 62eae60711
Check for existing objects before generating a key. (#4981)
We only expect to want one key per slot/token.

Refactor key_test somewhat to split up cases, and add a new test case.
2020-07-23 16:55:43 -07:00
Roland Bracewell Shoemaker 81bb4047d5
Ceremony monolith (#4678)
Merges gen-ca and gen-key into a single tool that can be used to complete a key/certificate generation ceremony. The driving idea here is that instead of having to write out multiple long commands in a specific order in order to complete a ceremony a configuration file is fed to a single binary. This config file contains all of the information needed to complete the ceremony, and can be easily tested outside of the secure environment before hand without fear of later typing a command/flag incorrectly etc.

The tooling works against the test hardware I have (there are minimal changes to the actual PKCS#11 code behind the scenes). Specific attention should be given to the documentation, and the general UX of the tool.

Fixes #4639 and fixes #4667.
2020-03-27 13:54:56 -07:00