Comments (4)
@dfed @vamsig7 Just wanted to let you know I found a workaround to this issue and posted about it here: https://developer.apple.com/forums/thread/88888
I encountered this same issue today: callback function never fires if SecItemCopyMatching has been called, but fires fine if SecItemCopyMatching hasn't been called. I had success by removing the callback before calls to SecItemCopyMatching and then adding it back afterwards. Odd, but as far as workarounds go it's not the worst. Weirdly, it must be: remove callback, SecItemCopyMatching call, add back callback; SecItemCopyMatching call, remove callback, add back callback doesn't seem to work.
Edit: On second thought, the above at least works without kSecUseDataProtectionKeychain. I had unrelated issues when trying to test with kSecUseDataProtectionKeychain.
from valet.
Hi @vamsig7!
I haven't tried using this API before, so I don't know why this wouldn't be working for you.
I doubt we're doing something that's preventing these callbacks from being executed. I'm not sure how we would have managed to do that.
I'd warn you against using this API with Valet, since Valet uses locks to prevent simultaneous reads and writes from and to the keychain. These callbacks might be called from within the critical lock region, which depending on what you do in the callback could lead to a deadlock.
That said, the Discussion section of the documentation you linked does make it seem like notifications are triggered asynchronously, so maybe my warning isn't necessary.
In any case, it was never our intention to support this API β our intention was to build a library that enables folk who didn't want to dive into the details of keychain to easily store their data securely β and as such I am going to close this issue.
If you figure out what the issue is, please do let us know how you fixed it in a comment below π
from valet.
Thanx for quick response as always π
I tried commenting each line cheking and I guess the issue is with
baseQuery[kSecUseDataProtectionKeychain as String] = true
line no: 64 in Valet/Sources/Valet/Internal/Service.swift , when I toggled it to false ,everything works as expected and callbacks are accurate
kSecUseDataProtectionKeychain .
Rather than issues with portability, does this attribute fix any security implications (or) What's the disadvantage of removing this flag?
Thank You
from valet.
Good sleuthing! It seems like the callback API only works the older implementation of the macOS keychain β that's unfortunate π
The reason for this key is outlined in #213 (comment): this key is required for utilizing the kSecAttrAccessGroup and kSecAttrAccessible fields, both of which we rely on for core functionality. I believe removing this key would result a bunch of unexpected behavior from Valet βΒ accessibility fields would be ignored, and Valets with different identifiers would be able to read and write one another's values.
from valet.
Related Issues (20)
- Free YouTube video on how to use Valet on iOS HOT 2
- Xcode 12 - Valet Framework not compiling on Dynamic Library Mach-O HOT 11
- Namespacing HOT 2
- Module compiled with Swift 5.2.2 cannot be imported by the Swift 5.3 compiler HOT 3
- Feature Request, Unlock with Apple Watch HOT 6
- Add convenience access methods for `Codable` types HOT 6
- .whenUnlocked vs .afterFirstUnlock HOT 3
- Create new KeyChain Option HOT 5
- Enable customization of biometrics prompt with application-specific fallback HOT 26
- Unit tests fail on tvOS 14 HOT 4
- Tips on building and running the sample app? HOT 1
- Keychain Sharing between iOS App and Apple Watch Extension HOT 6
- Documentation for `afterFirstUnlockThisDeviceOnly` wrong? HOT 1
- iOS 15 crash on `specialized static SecItem.copy<A>(matching:)` HOT 18
- [Feature Request] Unlock with Apple Watch with no passcode fallback HOT 7
- iOS 16 build error HOT 6
- tvOS target doesn't compile with Xcode 14.0 beta HOT 8
- Deprecation warnings when targeting iOS 14+ HOT 4
- (Some folks) await async support HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from valet.