You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// **credentialIdLength** (2): Byte length L of credentialId, 16-bit unsigned big-endian integer. Value MUST be ≤ 1023.
90
90
letidLengthBytes=data[53..<55] // Length is 2 bytes
91
91
letidLengthData=Data(idLengthBytes)
92
92
letidLength=UInt16(bigEndianBytes: idLengthData)
93
93
94
94
guard idLength <=1023
95
-
else{throwWebAuthnError.credentialIDTooLong }
95
+
else{throw.credentialIDTooLong }
96
96
97
97
letcredentialIDEndIndex=Int(idLength)+55
98
98
guard data.count >= credentialIDEndIndex
99
-
else{throwWebAuthnError.credentialIDTooShort }
99
+
else{throw.credentialIDTooShort }
100
100
101
101
/// **credentialId** (L): Credential ID
102
102
letcredentialID=data[55..<credentialIDEndIndex]
103
103
104
104
/// **credentialPublicKey** (variable): The credential public key encoded in `COSE_Key` format, as defined in [Section 7](https://tools.ietf.org/html/rfc9052#section-7) of [RFC9052], using the CTAP2 canonical CBOR encoding form.
105
-
/// Assuming valid CBOR, verify the public key's length by decoding the next CBOR item.
105
+
/// Assuming valid CBOR, verify the public key's length by decoding the next CBOR item, and checking how much data is left on the stream.
0 commit comments