-
Notifications
You must be signed in to change notification settings - Fork 26
add SMP support #20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
add SMP support #20
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.