Permalink
Browse files

Try the empty password

Change-Id: Ic4b6fb9237ccf30c2dd9161a137bdd3c8919e6be
  • Loading branch information...
cyngus84 committed May 31, 2017
1 parent b5a4a00 commit ccc55922bf6167995aabc750be433b9f408fd572
Showing with 9 additions and 5 deletions.
  1. +9 −5 local_store.go
View
@@ -392,12 +392,16 @@ func (f *fileSystemStore) loadKeys(role string) ([]*sign.PrivateKey, []byte, err
return nil, nil, ErrPassphraseRequired{role}
}
pass, err := f.passphraseFunc(role, false)
if err != nil {
return nil, nil, err
}
// try the empty string as the password first
pass := []byte("")
if err := encrypted.Unmarshal(pk.Data, &keys, pass); err != nil {
return nil, nil, err
pass, err = f.passphraseFunc(role, false)
if err != nil {
return nil, nil, err
}
if err = encrypted.Unmarshal(pk.Data, &keys, pass); err != nil {
return nil, nil, err
}
}
return keys, pass, nil
}

0 comments on commit ccc5592

Please sign in to comment.