Skip to content

Commit 624120e

Browse files
committed
Fix compilation errors and warnings from PKCE merge
1 parent 34c8c38 commit 624120e

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

.swift-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4.2
1+
5.1

Sources/Base/OAuth2Base.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -510,24 +510,24 @@ open class OAuth2ContextStore {
510510
/**
511511
Generates a new code verifier string
512512
*/
513-
func generateCodeVerifier() {
513+
open func generateCodeVerifier() {
514514
var buffer = [UInt8](repeating: 0, count: 32)
515515
_ = SecRandomCopyBytes(kSecRandomDefault, buffer.count, &buffer)
516-
codeVerifier = Data(bytes: buffer).base64EncodedString()
516+
codeVerifier = Data(buffer).base64EncodedString()
517517
.replacingOccurrences(of: "+", with: "-")
518518
.replacingOccurrences(of: "/", with: "_")
519519
.replacingOccurrences(of: "=", with: "")
520520
.trimmingCharacters(in: .whitespaces)
521521
}
522522

523523

524-
func codeChallenge() -> String? {
524+
open func codeChallenge() -> String? {
525525
guard let verifier = codeVerifier, let data = verifier.data(using: .utf8) else { return nil }
526526
var buffer = [UInt8](repeating: 0, count: Int(CC_SHA256_DIGEST_LENGTH))
527527
data.withUnsafeBytes {
528-
_ = CC_SHA256($0, CC_LONG(data.count), &buffer)
528+
_ = CC_SHA256($0.baseAddress, CC_LONG(data.count), &buffer)
529529
}
530-
let hash = Data(bytes: buffer)
530+
let hash = Data(buffer)
531531
let challenge = hash.base64EncodedString()
532532
.replacingOccurrences(of: "+", with: "-")
533533
.replacingOccurrences(of: "/", with: "_")

0 commit comments

Comments
 (0)