Commit 737d60bc authored by Matthew Sykes's avatar Matthew Sykes
Browse files

[FAB-10218] store keys without execute bit



Keys aren't executable.

Change-Id: Ide8d3e59f2189a1d26e971f49ab472b9743877db
Signed-off-by: default avatarMatthew Sykes <sykesmat@us.ibm.com>
parent c6d0e6c9
......@@ -288,7 +288,7 @@ func (ks *fileBasedKeyStore) storePrivateKey(alias string, privateKey interface{
return err
}
err = ioutil.WriteFile(ks.getPathForAlias(alias, "sk"), rawKey, 0700)
err = ioutil.WriteFile(ks.getPathForAlias(alias, "sk"), rawKey, 0600)
if err != nil {
logger.Errorf("Failed storing private key [%s]: [%s]", alias, err)
return err
......@@ -304,7 +304,7 @@ func (ks *fileBasedKeyStore) storePublicKey(alias string, publicKey interface{})
return err
}
err = ioutil.WriteFile(ks.getPathForAlias(alias, "pk"), rawKey, 0700)
err = ioutil.WriteFile(ks.getPathForAlias(alias, "pk"), rawKey, 0600)
if err != nil {
logger.Errorf("Failed storing private key [%s]: [%s]", alias, err)
return err
......@@ -320,7 +320,7 @@ func (ks *fileBasedKeyStore) storeKey(alias string, key []byte) error {
return err
}
err = ioutil.WriteFile(ks.getPathForAlias(alias, "key"), pem, 0700)
err = ioutil.WriteFile(ks.getPathForAlias(alias, "key"), pem, 0600)
if err != nil {
logger.Errorf("Failed storing key [%s]: [%s]", alias, err)
return err
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment