make key path a constant

This commit is contained in:
miampf 2025-01-09 15:24:04 +01:00
parent 5053c4581d
commit 6ec18eb7ca
No known key found for this signature in database
GPG Key ID: EF039364B5B6886C
2 changed files with 3 additions and 1 deletions

View File

@ -285,7 +285,7 @@ func (c *JoinClient) startNodeAndJoin(ticket *joinproto.IssueJoinTicketResponse,
}
// TODO(miampf): Make path a constant
if err := c.fileHandler.Write("/run/ssh/ssh_ca.pub", ssh.MarshalAuthorizedKey(ca.PublicKey()), file.OptMkdirAll); err != nil {
if err := c.fileHandler.Write(constants.SSHCAKeyPath, ssh.MarshalAuthorizedKey(ca.PublicKey()), file.OptMkdirAll); err != nil {
return fmt.Errorf("writing ca key: %w", err)
}

View File

@ -44,6 +44,8 @@ const (
CLIDebugLogFile = "constellation-debug.log"
// SSHCAKeySuffix is the suffix used together with the DEKPrefix to derive an SSH CA key for emergency ssh access.
SSHCAKeySuffix = "ca_emergency_ssh"
// SSHCAKeyPath is the path to the emergency SSH CA key on the node.
SSHCAKeyPath = "/run/ssh/ssh_ca.pub"
//
// Ports.