Closed aph3rson closed 4 years ago
Ah interesting. Should be a relatively easy change though. We cal already determine (service) the bundle (used in the repl), and can update the attribute here to be account.
Maybe we should add some flags here? 🤔
@leonjza how would you feel about renaming --key
to --account
and adding a --service
flag accordingly? That way we're at somewhat-parity with the actual iOS APIs, and using terms that are relevant to the keys we're storing.
@aph3rson Excellent idea, I did just that. Will be available in the next release.
Minor bug, this should be --service
, not --server
. You'll want to change the relevant test suite line as well.
Describe the bug When using
ios keychain add --key foo --data bar
,foo
is set to the service name on the keychain, not the account. When setting items on the Keychain, the service is most often the bundle name (except in instances of cross-app keys), and the account identifies the specific purpose within the application. However, that's not in use here.Here's an example from
ios keychain dump
- the top is a normal key on the keychain, the middle is the one I'm trying to overwrite, and the bottom is my added key:ios keychain dump_raw
also has similar output, showing the account as blank.To Reproduce Steps to reproduce the behavior:
ios keychain add
key
argument becomes the service name, not the account name.Expected behavior Either set the
key
parameter to be the account name (and the bundle name to be the service name), or split thekey
parameter intoaccount
andservice
, to match available arguments to SecItemAdd.Environment (please complete the following information):