kms: remember if a secret was saved without a master key

So we will be able to decrypt secret stored without a master key if a
such key is provided later
This commit is contained in:
Nicola Murino
2020-12-01 22:18:16 +01:00
parent 940836b25b
commit 87b51a6fd5
6 changed files with 144 additions and 5 deletions

View File

@@ -6,6 +6,8 @@ type baseSecret struct {
Payload string `json:"payload,omitempty"`
Key string `json:"key,omitempty"`
AdditionalData string `json:"additional_data,omitempty"`
// 1 means encrypted using a master key
Mode int `json:"mode,omitempty"`
}
func (s *baseSecret) GetStatus() SecretStatus {
@@ -20,6 +22,10 @@ func (s *baseSecret) GetKey() string {
return s.Key
}
func (s *baseSecret) GetMode() int {
return s.Mode
}
func (s *baseSecret) GetAdditionalData() string {
return s.AdditionalData
}