Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions CommonCrypto/module.modulemap

This file was deleted.

1 change: 0 additions & 1 deletion CommonCrypto/shim.h

This file was deleted.

18 changes: 1 addition & 17 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion Sources/JWA/HMAC/HMACCommonCrypto.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import CommonCrypto
extension HMACAlgorithm: SignAlgorithm, VerifyAlgorithm {
public func sign(_ message: Data) -> Data {
let context = UnsafeMutablePointer<CCHmacContext>.allocate(capacity: 1)
defer { context.deallocate(capacity: 1) }
defer {context.deallocate()}

key.withUnsafeBytes() { (buffer: UnsafePointer<UInt8>) in
CCHmacInit(context, hash.commonCryptoAlgorithm, buffer, size_t(key.count))
Expand Down