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 59114c5cc1
commit 00eaf0727f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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