mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 02:33:34 +00:00
kms: Add GetSecret() to metadata KMS
Add GetSecret() to allow direct access to passphrases without KDF and wrapping by a DEKStore. This will be used by fscrypt, which has its own KDF and wrapping. It will allow users to take a k8s secret, for example, and use that directly as a password in fscrypt. Signed-off-by: Marcel Lauhoff <marcel.lauhoff@suse.com>
This commit is contained in:
committed by
mergify[bot]
parent
0599089de0
commit
cb02a9beb9
@ -263,6 +263,11 @@ func (kms secretsMetadataKMS) DecryptDEK(volumeID, encryptedDEK string) (string,
|
||||
return string(dek), nil
|
||||
}
|
||||
|
||||
func (kms secretsMetadataKMS) GetSecret(volumeID string) (string, error) {
|
||||
// use the passphrase from the secretKMS
|
||||
return kms.secretsKMS.FetchDEK(volumeID)
|
||||
}
|
||||
|
||||
// generateCipher returns a AEAD cipher based on a passphrase and salt
|
||||
// (volumeID). The cipher can then be used to encrypt/decrypt the DEK.
|
||||
func generateCipher(passphrase, salt string) (cipher.AEAD, error) {
|
||||
|
Reference in New Issue
Block a user