Skip to content

Commit 192e272

Browse files
committed
Log PRF seed and input for debugging
1 parent a9a283f commit 192e272

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

BitwardenShared/Core/Auth/Services/DevicePasskeyService.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,11 @@ private func createAttestationObject(
367367
private func generatePrf(using prfInput: Data, from seed: SymmetricKey) -> Data {
368368
let saltPrefix = "WebAuthn PRF\0".data(using: .utf8)!
369369
let salt1 = saltPrefix + prfInput
370+
let logger = Logger()
371+
seed.withUnsafeBytes{
372+
let seedBytes = Data(Array($0))
373+
logger.debug("PRF Input: \(salt1.base64EncodedString())\nPRF Seed: \(seedBytes.base64UrlEncodedString())")
374+
}
370375
// CTAP2 uses HMAC to expand salt into a PRF, so we're doing the same.
371376
return Data(HMAC<SHA256>.authenticationCode(for: salt1, using: seed))
372377
}

0 commit comments

Comments
 (0)