Split Unseal into Unseal and unsealInternal

This commit is contained in:
Jeff Mitchell 2017-01-06 16:30:43 -05:00
parent 9e5d1eaac9
commit 681e36c4af
1 changed files with 4 additions and 0 deletions

View File

@ -817,6 +817,10 @@ func (c *Core) Unseal(key []byte) (bool, error) {
}
defer memzero(masterKey)
return c.unsealInternal(masterKey)
}
func (c *Core) unsealInternal(masterKey []byte) (bool, error) {
// Attempt to unlock
if err := c.barrier.Unseal(masterKey); err != nil {
return false, err