Skip to content

Commit

Permalink
Merge pull request #105 from erikespinoza/transient-temp
Browse files Browse the repository at this point in the history
Move temp keys to ~/.keymaster/
  • Loading branch information
rgooch committed Mar 26, 2021
2 parents 73c04aa + 3f19b52 commit 3f04ab3
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion cmd/keymaster/main.go
Expand Up @@ -30,6 +30,7 @@ import (

const DefaultSSHKeysLocation = "/.ssh/"
const DefaultTLSKeysLocation = "/.ssl/"
const DefaultTMPKeysLocation = "/.keymaster/"

const userAgentAppName = "keymaster"
const defaultVersionNumber = "No version provided"
Expand Down Expand Up @@ -210,8 +211,14 @@ func setupCerts(
logger.Fatal(err)
}

tempPrivateKeyPath := filepath.Join(homeDir, DefaultTMPKeysLocation, "keymaster-temp")
tempPrivateConfigPath, _ := filepath.Split(tlsKeyPath)
err = os.MkdirAll(tempPrivateConfigPath, 0700)
if err != nil {
logger.Fatal(err)
}

// get signer
tempPrivateKeyPath := filepath.Join(homeDir, DefaultSSHKeysLocation, "keymaster-temp")
signer, tempPublicKeyPath, err := util.GenKeyPair(
tempPrivateKeyPath, userName+"@keymaster", logger)
if err != nil {
Expand Down

0 comments on commit 3f04ab3

Please sign in to comment.