Kitura / Kitura/BlueECC

xCode 11.4 / Swift 5.2 crashes on parsing PublicKey in simulators and <= iOS 12

Open
#23 3 comments 1 reaction 1 assignee Claimed by @adam-rocska View on GitHub
Dominant language
Swift
Stars
93
Forks
42
PR merge metrics
No merged PRs in 30d

Description

The following code crashes on Simulators and my iOS12.4 iPhone 6when built with xCode 11.4, but works ok on xCode 11.3.

Does not seem to crash on iOS 13.4.

`let p256PrivateKey = try! ECPrivateKey.make(for: .prime256v1)
print(p256PrivateKey.pemString)
publicKey = try! p256PrivateKey.extractPublicKey()
print(publicKey.pemString)`

Error is happening at this line:
`guard let secKey = SecKeyCreateWithData(keyData as CFData,
[kSecAttrKeyType: kSecAttrKeyTypeECSECPrimeRandom,
kSecAttrKeyClass: kSecAttrKeyClassPublic] as CFDictionary,
&error)`

Error:
`objc[1049]: Class _TtGCs18_DictionaryStorageaSo11CFStringRefS0__$ is implemented in both /usr/lib/swift/libswiftCore.dylib (0x1c1d492d8) and /usr/lib/swift/libswiftCore.dylib (0x1c1d495e8). One of the two will be used. Which one is undefined.
Fatal error: invalid unsafeDowncast`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.