Bug: Non-darwin KeychainUnlocker stub panics instead of returning errors #7
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Bug
In
internal/secret/keychainunlocker_stub.go(non-darwin build), all methods includingNewKeychainUnlocker,GetType(),GetID(), etc. callpanic()instead of returning errors:This is a crash bug on Linux/Windows. The code paths in
vault/unlockers.goGetCurrentUnlocker()andfindUnlockerByID()callNewKeychainUnlockerwhen they encounter a keychain-type unlocker in metadata:If a vault is synced from macOS to Linux (which is a valid use case since vaults are just files), and the vault has a keychain unlocker, any operation that lists or resolves unlockers will panic and crash instead of gracefully skipping or returning an error.
Impact
secret unlocker listcrashes on Linux if any keychain unlocker existsFix
Stub methods should return errors instead of panicking.
NewKeychainUnlockershould return a valid struct whose methods return appropriate errors.