Closed srlehn closed 3 years ago
/usr/bin/security find-generic-password -s "Chrome Safe Storage" -wa "Chrome"
https://gist.github.com/dacort/bd6a5116224c594b14db#file-cookiemonster-go-L105
I did mistakenly assume that we use keybase/go-keychain not only for getting but also for setting (probably because of setChromeKeychainPassword()) but we only use get.
I now think that we could use security for querying the password and leave the old method behind a cgo build tag.
chrome_darwin.go currently needs a C compiler for the dependency github.com/keybase/go-keychain. This makes cross compilation difficult.
I see 2 alternatives: the "security" command line tool which is installed by default (?) or querying the keychain with syscall.
I think the best way is to translate the cgo parts to syscall like https://github.com/jaraco/keyring/blob/master/keyring/backends/_OS_X_API.py.