Skip to content

Commit 474ce79

Browse files
authored
Merge pull request radianttap#2 from mattbeshara/master
Resolve warning when building with Swift 5
2 parents b0d8c36 + 825de60 commit 474ce79

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Sources/JWT/HMACCommonCrypto.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@ func hmac(algorithm: HMACAlgorithm, key: Data, message: Data) -> Data {
3131
let context = UnsafeMutablePointer<CCHmacContext>.allocate(capacity: 1)
3232
defer { context.deallocate() }
3333

34-
key.withUnsafeBytes() { (buffer: UnsafePointer<UInt8>) in
35-
CCHmacInit(context, algorithm.commonCryptoAlgorithm, buffer, size_t(key.count))
34+
key.withUnsafeBytes { (buffer: UnsafeRawBufferPointer) in
35+
CCHmacInit(context, algorithm.commonCryptoAlgorithm, buffer.baseAddress, size_t(key.count))
3636
}
3737

38-
message.withUnsafeBytes { (buffer: UnsafePointer<UInt8>) in
39-
CCHmacUpdate(context, buffer, size_t(message.count))
38+
message.withUnsafeBytes { (buffer: UnsafeRawBufferPointer) in
39+
CCHmacUpdate(context, buffer.baseAddress, size_t(message.count))
4040
}
4141

4242
var hmac = Array<UInt8>(repeating: 0, count: Int(algorithm.commonCryptoDigestLength))

0 commit comments

Comments
 (0)