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
/// Step 16. Let enterpriseAttestationPossible be a Boolean value, as follows. If pkOptions.attestation
173
173
/// → is set to enterprise
174
174
/// Let enterpriseAttestationPossible be true if the user agent wishes to support enterprise attestation for pkOptions.rp.id (see Step 8, above). Otherwise false.
175
175
/// → otherwise
176
176
/// Let enterpriseAttestationPossible be false.
177
-
letisEnterpriseAttestationPossible=false
177
+
// let isEnterpriseAttestationPossible = false
178
178
179
179
/// Step 19. Let attestationFormats be a list of strings, initialized to the value of pkOptions.attestationFormats.
180
+
// let attestationFormats: [AttestationFormat] = []
181
+
180
182
/// Step 20. If pkOptions.attestation
181
183
/// → is set to none
182
184
/// Set attestationFormats be the single-element list containing the string “none”
183
185
guard case .none = registration.options.attestation else{throwWebAuthnError.attestationFormatNotSupported }
184
186
185
187
/// Step 22. Let excludeCredentialDescriptorList be a new list.
188
+
// let excludeCredentialDescriptorList: [PublicKeyCredentialDescriptor] = []
186
189
/// Step 23. For each credential descriptor C in pkOptions.excludeCredentials:
187
190
/// 1. If C.transports is not empty, and authenticator is connected over a transport not mentioned in C.transports, the client MAY continue.
188
191
/// 2. Otherwise, Append C to excludeCredentialDescriptorList.
192
+
// Skip.
193
+
189
194
/// 3. Invoke the authenticatorMakeCredential operation on authenticator with clientDataHash, pkOptions.rp, pkOptions.user, requireResidentKey, userVerification, credTypesAndPubKeyAlgs, excludeCredentialDescriptorList, enterpriseAttestationPossible, attestationFormats, and authenticatorExtensions as parameters.
195
+
/*
196
+
registration.clientDataHash;
197
+
registration.options.relyingParty
198
+
registration.options.user
199
+
requiresResidentKey
200
+
shouldPerformUserVerification
201
+
registration.publicKeyCredentialParameters
202
+
excludeCredentialDescriptorList
203
+
isEnterpriseAttestationPossible
204
+
attestationFormats
205
+
*/
206
+
190
207
/// Step 24. Append authenticator to issuedRequests.
208
+
// Skip.
191
209
192
210
/// See [WebAuthn Level 3 Editor's Draft §6.3.2. The authenticatorMakeCredential Operation](https://w3c.github.io/webauthn/#sctn-op-make-cred)
193
211
/// Step 1. Check if all the supplied parameters are syntactically well-formed and of the correct length. If not, return an error code equivalent to "UnknownError" and terminate the operation.
212
+
// Skip.
213
+
194
214
/// Step 2. Check if at least one of the specified combinations of PublicKeyCredentialType and cryptographic parameters in credTypesAndPubKeyAlgs is supported. If not, return an error code equivalent to "NotSupportedError" and terminate the operation.
/// return an error code equivalent to "NotAllowedError" and terminate the operation.
204
224
/// NOTE: The purpose of this authorization gesture is not to proceed with creating a credential, but for privacy reasons to authorize disclosure of the fact that descriptor.id is bound to this authenticator. If the user consents, the client and Relying Party can detect this and guide the user to use a different authenticator. If the user does not consent, the authenticator does not reveal that descriptor.id is bound to it, and responds as if the user simply declined consent to create a credential.
225
+
// Skip.
226
+
205
227
/// Step 4. If requireResidentKey is true and the authenticator cannot store a client-side discoverable public key credential source, return an error code equivalent to "ConstraintError" and terminate the operation.
228
+
// Skip.
229
+
206
230
/// Step 5. If requireUserVerification is true and the authenticator cannot perform user verification, return an error code equivalent to "ConstraintError" and terminate the operation.
231
+
// Skip.
232
+
207
233
/// Step 6. Collect an authorization gesture confirming user consent for creating a new credential. The prompt for the authorization gesture is shown by the authenticator if it has its own output capability, or by the user agent otherwise. The prompt SHOULD display rpEntity.id, rpEntity.name, userEntity.name and userEntity.displayName, if possible.
208
234
/// → If requireUserVerification is true, the authorization gesture MUST include user verification.
209
235
/// → If requireUserPresence is true, the authorization gesture MUST include a test of user presence.
210
236
/// → If the user does not consent or if user verification fails, return an error code equivalent to "NotAllowedError" and terminate the operation.
237
+
// Skip.
238
+
211
239
/// Step 7. Once the authorization gesture has been completed and user consent has been obtained, generate a new credential object:
212
240
/// 1. Let (publicKey, privateKey) be a new pair of cryptographic keys using the combination of PublicKeyCredentialType and cryptographic parameters represented by the first item in credTypesAndPubKeyAlgs that is supported by this authenticator.
/// Step 8. If any error occurred while creating the new credential object, return an error code equivalent to "UnknownError" and terminate the operation.
266
+
// Skip.
267
+
238
268
/// Step 9. Let processedExtensions be the result of authenticator extension processing for each supported extension identifier → authenticator extension input in extensions.
269
+
// Skip.
270
+
239
271
/// Step 10. If the authenticator:
240
272
/// → is a U2F device
241
273
/// let the signature counter value for the new credential be zero. (U2F devices may support signature counters but do not return a counter when making a credential. See [FIDO-U2F-Message-Formats].)
/// Step 16. Let attestationFormat be the first supported attestation statement format identifier from attestationFormats, taking into account enterpriseAttestationPossible. If attestationFormats contains no supported value, then let attestationFormat be the attestation statement format identifier most preferred by this authenticator.
/// Step 17. Let authenticatorData be the byte array specified in § 6.1 Authenticator Data, including attestedCredentialData as the attestedCredentialData and processedExtensions, if any, as the extensions.
/// Step 18. Create an attestation object for the new credential using the procedure specified in § 6.5.4 Generating an Attestation Object, the attestation statement format attestationFormat, and the values authenticatorData and hash, as well as taking into account the value of enterpriseAttestationPossible. For more details on attestation, see § 6.5 Attestation.
0 commit comments