From 7c6cc95a24cee8f846507f0c8c18f8cc6e99ee20 Mon Sep 17 00:00:00 2001 From: ncabatoff Date: Thu, 24 Oct 2019 10:23:31 -0400 Subject: [PATCH] Fix a regression introduced in #7698 that breaks root token generation. (#7727) --- vault/generate_root.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vault/generate_root.go b/vault/generate_root.go index c0521d30e..ca8ab54e6 100644 --- a/vault/generate_root.go +++ b/vault/generate_root.go @@ -39,11 +39,11 @@ type GenerateRootStrategy interface { type generateStandardRootToken struct{} func (g generateStandardRootToken) authenticate(ctx context.Context, c *Core, combinedKey []byte) error { - _, err := c.unsealKeyToMasterKey(ctx, combinedKey) + masterKey, err := c.unsealKeyToMasterKey(ctx, combinedKey) if err != nil { return errwrap.Wrapf("unable to authenticate: {{err}}", err) } - if err := c.barrier.VerifyMaster(combinedKey); err != nil { + if err := c.barrier.VerifyMaster(masterKey); err != nil { return errwrap.Wrapf("master key verification failed: {{err}}", err) }