add SMP support#20
add SMP support#20antoinepalazzolo wants to merge 3 commits intokreactive:masterfrom antoinepalazzolo:spm_support
Conversation
| targets: [ | ||
| // Targets are the basic building blocks of a package. A target can define a module or a test suite. | ||
| // Targets can depend on other targets in this package, and on products in packages which this package depends on. | ||
| .target( | ||
| name: "JSONWebToken", | ||
| dependencies: []), | ||
| ] |
There was a problem hiding this comment.
Don't you want to add the test target, in order for people to see how to use the package ?
There was a problem hiding this comment.
the test target needs a container app with an entitlement because the library use a keychain hack to create keys, and I don't know how to do that with SPM.
I'm working on a solution without the keychain hack and CryptoKit and I'll add a test target on the package
* crypto_kit_hash: use CryptoKit for hash function when running on iOS 13 or later fallback to common crypto for iOS 12 and earlier removed objc compatibility implementation since common crypto module is now available
* fix_alloc_leak: fix memory leak when allocating buffer for SHA and HMAC result
| @@ -11,7 +11,7 @@ import CryptoKit | |||
|
|
|||
| extension Data { | |||
| func sha(_ hashFunction: SignatureAlgorithm.HashFunction) -> Data { | |||
| if #available(iOSApplicationExtension 13.0, *) { | |||
There was a problem hiding this comment.
this is a fairly significant change as it means this can no longer be used in an app extension (such as the share extension). Is that really necessary?
| @@ -40,7 +40,7 @@ extension Data { | |||
| } | |||
| } | |||
| func hmac(_ hashFunction: SignatureAlgorithm.HashFunction, secret: Data) -> Data { | |||
| if #available(iOSApplicationExtension 13.0, *) { | |||
There was a problem hiding this comment.
this is a fairly significant change as it means this can no longer be used in an app extension (such as the share extension). Is that really necessary?
No description provided.