Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return error if isProtectedDataAvailable = false #183

Merged
merged 1 commit into from
Jun 10, 2020

Conversation

kellycampbell
Copy link

Addresses issue #72 where SecItemCOpyMatching doesn't return data and
doesn't give an error when the protected files are not yet
available. This will now give an error instead of empty results,
allowing the caller to retry after some delay.

Addresses issue mCodex#72 where SecItemCOpyMatching doesn't return data and
doesn't give an error when the protected files are not yet
available. This will now give an error instead of empty results,
allowing the caller to retry after some delay.
@mCodex
Copy link
Owner

mCodex commented Jun 10, 2020

Awesome, thanks!

@mCodex mCodex merged commit 5d1fd98 into mCodex:master Jun 10, 2020
@jordoh
Copy link

jordoh commented Feb 15, 2021

One note on this change: keychain items using kSecAttrAccessibleAfterFirstUnlock - e.g. for apps that run in the background - will fail this check, even though the keychain item is available when the device is locked (isProtectedDataAvailable is false).

It appears that getItem needs to include kSecAttrAccessible anyway, so perhaps this check should be conditional on kSecAttrAccessible actually requiring isProtectedDataAvailable?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants