henrinormak / Heimdall

Heimdall is a wrapper around the Security framework for simple encryption/decryption operations.
MIT License
402 stars 68 forks source link

Heimdall is not working on Xcode 8 #47

Open jorystiefel opened 8 years ago

jorystiefel commented 8 years ago

Heimdall is not functioning on Xcode 8. Unit tests crash. There seems to be a problem with the obtainKeyData(_ tag: String) function always returning nil.

More specifically, I think this is because SecItemCopyMatching(query as CFDictionary, &keyRef) always returns Item Not Found.

zhao15 commented 8 years ago

SecItemCopyMatching return = -25300, it should be caused by the query setting.

jorystiefel commented 8 years ago

This seems to be related to these issues:

https://forums.developer.apple.com/thread/51071 https://openradar.appspot.com/27422249

jorystiefel commented 8 years ago

More information: it seems the actual problem starts with SecKeyGeneratePair returning -34018 (missing entitlement). This looks like some sort of Xcode 8 or iOS 10 bug.

henrinormak commented 8 years ago

This seems like something that should be mentioned in the docs for Heimdall, any way to fix this? If there is, would you mind submitting a PR with a note in the README for the fix

rchatham commented 8 years ago

Is this still consistent in the new updates? I am reproducing this as well.

rchatham commented 8 years ago

This looks like it could be due to malformed RSA keys.

https://forums.developer.apple.com/thread/15129