browserutils / kooky

Go code to read cookies from browser cookie stores.
MIT License
210 stars 41 forks source link

implement chrome_darwin.go without the need of cgo #6

Closed srlehn closed 3 years ago

srlehn commented 5 years ago

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.

srlehn commented 4 years ago
/usr/bin/security find-generic-password -s "Chrome Safe Storage" -wa "Chrome"

https://gist.github.com/dacort/bd6a5116224c594b14db#file-cookiemonster-go-L105

srlehn commented 3 years ago

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.