Account for a possible error in Transit BYOK. (#17025)

This commit is contained in:
Matt Schultz 2022-09-06 13:03:24 -05:00 committed by GitHub
parent 10121fed37
commit d50941ac85
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -258,6 +258,9 @@ func (b *backend) pathImportVersionWrite(ctx context.Context, req *logical.Reque
return nil, err
}
importKey, err := b.decryptImportedKey(ctx, req.Storage, ciphertext, hashFn)
if err != nil {
return nil, err
}
err = p.Import(ctx, req.Storage, importKey, b.GetRandomReader())
if err != nil {
return nil, err