diff --git a/CommonCrypto/module.modulemap b/CommonCrypto/module.modulemap deleted file mode 100644 index b70f7d6..0000000 --- a/CommonCrypto/module.modulemap +++ /dev/null @@ -1,4 +0,0 @@ -module CommonCrypto [system] { - header "shim.h" - export * -} diff --git a/CommonCrypto/shim.h b/CommonCrypto/shim.h deleted file mode 100644 index c332624..0000000 --- a/CommonCrypto/shim.h +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/Package.swift b/Package.swift index 5ba29b4..afc4362 100644 --- a/Package.swift +++ b/Package.swift @@ -1,22 +1,6 @@ // swift-tools-version:4.0 -import PackageDescription - - -#if os(macOS) || os(iOS) || os(watchOS) || os(tvOS) -let dependencies = [ - Package.Dependency.package(url: "https://github.com/kylef-archive/CommonCrypto.git", from: "1.0.0"), -] -let excludes = ["HMAC/HMACCryptoSwift.swift"] -let targetDependencies: [Target.Dependency] = [] -#else -let dependencies = [ - Package.Dependency.package(url: "https://github.com/krzyzanowskim/CryptoSwift.git", from: "0.8.0"), -] -let excludes = ["HMAC/HMACCommonCrypto.swift"] -let targetDependencies: [Target.Dependency] = ["CryptoSwift"] -#endif - +import PackageDescriptio let package = Package( name: "JWT", diff --git a/Sources/JWA/HMAC/HMACCommonCrypto.swift b/Sources/JWA/HMAC/HMACCommonCrypto.swift index 299fd8a..0bf0184 100644 --- a/Sources/JWA/HMAC/HMACCommonCrypto.swift +++ b/Sources/JWA/HMAC/HMACCommonCrypto.swift @@ -5,7 +5,7 @@ import CommonCrypto extension HMACAlgorithm: SignAlgorithm, VerifyAlgorithm { public func sign(_ message: Data) -> Data { let context = UnsafeMutablePointer.allocate(capacity: 1) - defer { context.deallocate(capacity: 1) } + defer {context.deallocate()} key.withUnsafeBytes() { (buffer: UnsafePointer) in CCHmacInit(context, hash.commonCryptoAlgorithm, buffer, size_t(key.count))