Locksmith
Locksmith copied to clipboard
Not working using XCode 8 and Swift 2.3
Hello, we are using Locksmith in our App and it is a great tool for handling the keychain. Unfortunately, since the update to XCode 8 and Swift-2.3 it suddenly stopped working. Usually we are storing users login information in the keychain and it should get loaded on App start. Now it suddenly doesn't get loaded anymore.
In our podfile we are using:
pod 'Locksmith', :git => 'https://github.com/matthewpalmer/Locksmith.git', :branch => 'swift-2.3'
Some debugging turned out that the problem could be here:
` private func performSecureStorageAction(closure: PerformRequestClosureType, secureStoragePropertyDictionary: [String: AnyObject]) throws -> [String: AnyObject]? { var result: AnyObject? let request = secureStoragePropertyDictionary let requestReference = request as CFDictionaryRef
let status = closure(requestReference: requestReference, result: &result)
let statusCode = Int(status)
if let error = LocksmithError(fromStatusCode: statusCode) {
throw error
}
`
In this code, statusCode gets a value of -25300, which causes an exception to be thrown.
Just updated the swift-2.3 branch, so try again (weren't any changes that should affect this that much though).
Also maybe https://github.com/matthewpalmer/Locksmith/issues/147 will help?
solution described in http://stackoverflow.com/questions/38456471/secitemadd-always-returns-error-34018-in-xcode-8-in-ios-10-simulator worked.
Confirmed that @DBassel's link/solution worked for me. Using Xcode 8, Swift 2.3, Mac OS El Cap
Yes for me the entitlement solution also worked. XCode 8 is weird ;-)
I had the same problem, and the solution by enabling keychain sharing worked for me as well. However, is this really the correct solution to go with here? Keychain sharing is for sharing the keychain between separate apps as far as I know, so this seems like a workaround rather than a permanent solution...
+1 for making an actual fix for this. Feels weird to turn on a feature you don't need to work around this.
Question is if this is really a bug in Locksmith, or in XCode 8? ;-)
Yeah my colleague just explained it and it's basically a xcode bug where the simulator needs some form of entitlement to get code signed and thus access to the keychain...