59 Commits (6f8ac9818cd186efb661d6dbc4a91963ff209696)
 

Author SHA1 Message Date
Jan Dittberner 6f8ac9818c Update component diagram
This commit adds the Framer and Server Protocol components to the
component diagram.
2 years ago
Jan Dittberner 1374fe58e8 Implement graceful shutdown on interrupt or SIGTERM 2 years ago
Jan Dittberner 7837164e6e Build system improvements
- build PIE binaries using goreleaser
- add snapshot target to Makefile
- add -trimpath option to go build
2 years ago
Jan Dittberner 37d3b1e021 Update dependencies
This commit updates all external dependencies. The cobs module has a
changed API and code using cobs has been adapted to this new API.
2 years ago
Jan Dittberner 19436c06c2 Implement unit tests for public packages
This commit adds a comprehensive unit test suite for all public packages.
2 years ago
Jan Dittberner 51afebf2c1 Test and refactor messages
- add unit tests for all handwritten code in messages package
- use uuid.NewString() instead of uuid.NewUUID() to avoid unnecessary error
  handling
- sort code in messages.go to put type related code close to each other
- move checkFailed from hsm.Access.Healthy method to messages.CertificateInfoFailed
- add typing for Status field of messages.CertificateInfo
2 years ago
Jan Dittberner de7e716a82 Improve signer setup code
- allow multiple attempts to setup certificates
- use CAB forum BR compliant CRLDistributionPoint for Subordinate CA
  certificates by referencing their own CRL instead of their parent CA's CRL
- store certificates in DER encoded form
2 years ago
Jan Dittberner fffc65a540 Tidy up dependencies 2 years ago
Jan Dittberner 65c5bac2d9 Implement delta CRL support
This commit provides real CRL support with persistent storage of CRLs as well
as support for delta CRLs using github.com/balacode/go-delta
2 years ago
Jan Dittberner 1031ee3118 Implement configuration support for CA profiles 2 years ago
Jan Dittberner f98840bf9e Add documentation section for socat PTYs 2 years ago
Jan Dittberner c92b0455db Remove example comments from goreleaser configuration 2 years ago
Jan Dittberner c5f436b4d0 Add development documentation 2 years ago
Jan Dittberner 7b6fdbb18a Attach ClientHandler methods to references 2 years ago
Jan Dittberner af40662c7d Refactor client protocol
- define protocols.ClientHandler interface as base for client implementations
- implement protocols.ClientHandler in clientsim's ClientHandler type
- move protocol state handling into protocols.ServerProtocol and
  protocols.ClientProtocol
- move protocolState type into protocols.go
- reduce clientsim's TestCommandGenerator responsibility to test command
  generation
2 years ago
Jan Dittberner f429d3da45 Refactor server handler
- rename protocols.Handler to ServerHandler
- rename ServerHandler methods to better express their purpose
- pass command and response as parameters
- simplify state machine and handle errors in serial/seriallink.go
- implement command read timeout
- remove currentCommand and currentResponse fields from MsgPackHandler
2 years ago
Jan Dittberner 9905d748d9 Improve signer robustness
- let client simulator send some garbage bytes before starting real commands
- handle EOF during reads
2 years ago
Jan Dittberner e5dcf7afa9 Refactor COBS wire protocol
Wire protocol handling has been moved to protocol.Framer and its
implementation protocol.COBSFramer
2 years ago
Jan Dittberner faaadbe5aa Move internal code to internal packages 2 years ago
Jan Dittberner f0d456dd13 Protocol improvements
- add a client generated command ID for tracing commands and responses
- define protocol delimiter in protocol.CobsDelimiter
- apply code simplifications suggested by golangci-lint
- add Makefile
- add compile time build information for signer binary
- make sure that dependencies for msgpackgen survive go mod tidy
- extract MsgPackHandler into its own file
- add CRL number to fetch CRL response
- remove port.Flush() to avoid removing written data before it reaches the
  client
2 years ago
Jan Dittberner 8e443bd8b4 Implement protocol improvements
This commit implements a client and server side state machine
for the serial protocol.
2 years ago
Jan Dittberner 2de592d30c Implement command type handling
This commit changes the wire protocol to split between command
announcement and command payload to allow proper typing of sent and
received msgpack messages.

CRL fetching has been implemented as second command after the existing
health check command.
2 years ago
Jan Dittberner 472091b374 Switch to logrus for structured logging 2 years ago
Jan Dittberner 4c24e4692b Fix golangci-lint warnings 2 years ago
Jan Dittberner 175a72298d Centralize serial number generation 2 years ago
Jan Dittberner 64dd9429be Let the client send health checks periodically 2 years ago
Jan Dittberner 82a1284073 Rename intermediary CA to subordinate CA
This refactoring commit renames all occurrences of the term "intermediary CA"
to "subordinate CA" for better alignment with the terms used in RFC-5280 and
other standard documents.
2 years ago
Jan Dittberner 60be959c24 Implement health check infrastructure
This commit adds health check capabilities to the hsm.Access and health
response data to the messages returned by the health command.
2 years ago
Jan Dittberner 3107ad8abb Implement serial link and protocol handling infrastructure
This commit adds basic serial link and protocol support. None of the commands
from the docs/design.md document is implemented yet.

The following new packages have been added:

- seriallink containing the serial link handler including COBS decoding and
  encoding
- protocol containing the protocol handler including msgpack unmarshalling
  and marshaling
- health containing a rudimentary health check implementation
- messages containing command and response types and generated msgpack
  marshaling code

A client simulation command has been added in cmd/clientsim.

README.md got instructions how to run the client simulator. The
docs/config.sample.yaml contains a new section for the serial connection
parameters.
2 years ago
Jan Dittberner c2b987fd31 Allow hsm to use relative paths 2 years ago
Jan Dittberner 0d69a9013d Refactor HSM setup
- create new type hsm.Access to encapsulate HSM operations
- make setup options operate on hsm.Access instances
- adapt tests and cmd/signer to work with hsm.Access
2 years ago
Jan Dittberner 7acec714e3 Remove separate Command dispatcher 2 years ago
Jan Dittberner b084872542 Add architecture/design documentation 2 years ago
Jan Dittberner c532ec436a Improve test coverage of package hsm 2 years ago
Jan Dittberner 5776723fa2 Fix typo (singer vs. signer) 2 years ago
Jan Dittberner 057852ede6 Implement proper support for CRLEntry extensions 2 years ago
Jan Dittberner 474e7717cc Fix Goland code inspection warnings 2 years ago
Jan Dittberner 79cb5c96bf Extract test helper functions 2 years ago
Jan Dittberner 510ba2ad25 Add test for pkg/hsm/context.go 2 years ago
Jan Dittberner 23c9e6f3e0 Improve test coverage of X.509 revoking 2 years ago
Jan Dittberner c538be4385 Fix error message spelling 2 years ago
Jan Dittberner baf6d0f037 Configure and apply golangci-lint 2 years ago
Jan Dittberner 63c3716b5b Move x509 and openpgp into pkg
small refactoring to unify package structure. Use crypto.rand for serial
number generation in tests.
2 years ago
Jan Dittberner 20580cda52 Use standard library types for certificates and revocations 2 years ago
Jan Dittberner 42c7dc7170 Improve config handling and test coverage 2 years ago
Jan Dittberner 7d415ff181 Increase coverage for pkg/config 2 years ago
Jan Dittberner 3a6127a939 Finish openssl repository implementation and tests 2 years ago
Jan Dittberner b9e8862f3e Update README to reflect setup
Key setup can now be done by the signer, p11tool is no longer needed for
key generation.
2 years ago
Jan Dittberner 9fd40af603 Add -verbose flag, implement config options 2 years ago
Jan Dittberner 2e343498af Fix failing test 2 years ago