@@ -35,33 +35,33 @@ const (
3535 barrierInitPath = "barrier/init"
3636
3737 // keyringPath is the location of the keyring data. This is encrypted
38- // by the master key.
38+ // by the root key.
3939 keyringPath = "core/keyring"
4040 keyringPrefix = "core/"
4141
4242 // keyringUpgradePrefix is the path used to store keyring update entries.
4343 // When running in HA mode, the active instance will install the new key
4444 // and re-write the keyring. For standby instances, they need an upgrade
45- // path from key N to N+1. They cannot just use the master key because
46- // in the event of a rekey, that master key can no longer decrypt the keyring.
45+ // path from key N to N+1. They cannot just use the root key because
46+ // in the event of a rekey, that root key can no longer decrypt the keyring.
4747 // When key N+1 is installed, we create an entry at "prefix/N" which uses
4848 // encryption key N to provide the N+1 key. The standby instances scan
4949 // for this periodically and refresh their keyring. The upgrade keys
5050 // are deleted after a few minutes, but this provides enough time for the
5151 // standby instances to upgrade without causing any disruption.
5252 keyringUpgradePrefix = "core/upgrade/"
5353
54- // masterKeyPath is the location of the master key. This is encrypted
54+ // rootKeyPath is the location of the root key. This is encrypted
5555 // by the latest key in the keyring. This is only used by standby instances
5656 // to handle the case of a rekey. If the active instance does a rekey,
5757 // the standby instances can no longer reload the keyring since they
58- // have the old master key. This key can be decrypted if you have the
59- // keyring to discover the new master key. The new master key is then
58+ // have the old root key. This key can be decrypted if you have the
59+ // keyring to discover the new root key. The new root key is then
6060 // used to reload the keyring itself.
61- masterKeyPath = "core/master"
61+ rootKeyPath = "core/master"
6262
6363 // shamirKekPath is used with Shamir in v1.3+ to store a copy of the
64- // unseal key behind the barrier. As with masterKeyPath this is primarily
64+ // unseal key behind the barrier. As with rootKeyPath this is primarily
6565 // used by standbys to handle rekeys. It also comes into play when restoring
6666 // raft snapshots.
6767 shamirKekPath = "core/shamir-kek"
@@ -75,14 +75,14 @@ const (
7575// a Vault. The barrier should only be Unlockable given its key.
7676type SecurityBarrier interface {
7777 // Initialized checks if the barrier has been initialized
78- // and has a master key set.
78+ // and has a root key set.
7979 Initialized (ctx context.Context ) (bool , error )
8080
8181 // Initialize works only if the barrier has not been initialized
82- // and makes use of the given master key. When sealKey is provided
83- // it's because we're using a new-style Shamir seal, and masterKey
82+ // and makes use of the given root key. When sealKey is provided
83+ // it's because we're using a new-style Shamir seal, and rootKey
8484 // is to be stored using sealKey to encrypt it.
85- Initialize (ctx context.Context , masterKey []byte , sealKey []byte , random io.Reader ) error
85+ Initialize (ctx context.Context , rootKey []byte , sealKey []byte , random io.Reader ) error
8686
8787 // GenerateKey is used to generate a new key
8888 GenerateKey (io.Reader ) ([]byte , error )
@@ -94,27 +94,27 @@ type SecurityBarrier interface {
9494 // is not expected to be able to perform any CRUD until it is unsealed.
9595 Sealed () (bool , error )
9696
97- // Unseal is used to provide the master key which permits the barrier
97+ // Unseal is used to provide the unseal key which permits the barrier
9898 // to be unsealed. If the key is not correct, the barrier remains sealed.
9999 Unseal (ctx context.Context , key []byte ) error
100100
101- // VerifyMaster is used to check if the given key matches the master key
102- VerifyMaster (key []byte ) error
101+ // VerifyRoot is used to check if the given key matches the root key
102+ VerifyRoot (key []byte ) error
103103
104- // SetMasterKey is used to directly set a new master key. This is used in
104+ // SetRootKey is used to directly set a new root key. This is used in
105105 // replicated scenarios due to the chicken and egg problem of reloading the
106- // keyring from disk before we have the master key to decrypt it.
107- SetMasterKey (key []byte ) error
106+ // keyring from disk before we have the root key to decrypt it.
107+ SetRootKey (key []byte ) error
108108
109109 // ReloadKeyring is used to re-read the underlying keyring.
110110 // This is used for HA deployments to ensure the latest keyring
111111 // is present in the leader.
112112 ReloadKeyring (ctx context.Context ) error
113113
114- // ReloadMasterKey is used to re-read the underlying masterkey .
115- // This is used for HA deployments to ensure the latest master key
114+ // ReloadRootKey is used to re-read the underlying root key .
115+ // This is used for HA deployments to ensure the latest root key
116116 // is available for keyring reloading.
117- ReloadMasterKey (ctx context.Context ) error
117+ ReloadRootKey (ctx context.Context ) error
118118
119119 // Seal is used to re-seal the barrier. This requires the barrier to
120120 // be unsealed again to perform any further operations.
0 commit comments