diff --git a/index.bs b/index.bs index ca3d51dd4..e42e52b5c 100644 --- a/index.bs +++ b/index.bs @@ -6758,9 +6758,6 @@ Note: this extension may be implemented for [=authenticators=] that do not use [ }; dictionary AuthenticationExtensionsPRFImportCryptoKeyParams { - required KeyFormat format; - required AlgorithmIdentifier algorithm; - required boolean extractable; required sequence keyUsages; }; @@ -6777,17 +6774,20 @@ Note: this extension may be implemented for [=authenticators=] that do not use [ :: A record mapping [=base64url encoding|base64url encoded=] [=credential IDs=] to PRF inputs to evaluate for that credential. Only applicable during [=assertions=] when {{PublicKeyCredentialRequestOptions/allowCredentials}} is not empty. : importCryptoKey - :: Arguments for the [=client=] to invoke {{SubtleCrypto/importKey}}, along with the PRF result as the `keyData` argument. + :: Arguments for the [=client=] to invoke {{SubtleCrypto/importKey}}. If present, the extension outputs will be {{Promise}}s resolving to {{CryptoKey}} values; if not present, the extension outputs will be {{BufferSource}} values. + The arguments in the {{SubtleCrypto/importKey}} invocation will be: + - `format`: `"raw"` + - `keyData`: The PRF output. + - `algorithm`: `"HKDF"` + - `extractable`: [FALSE] + - `keyUsages`: {{importCryptoKey}}.{{AuthenticationExtensionsPRFImportCryptoKeyParams/keyUsages}} + The client ensures domain separation between {{BufferSource}} and {{CryptoKey}} results, so that an extension input requesting unextractable {{CryptoKey}} values cannot be "downgraded" to requesting the same results as extractable {{BufferSource}} values. - For the same reason, the client also ensures domain separation between the [TRUE] and [FALSE] values - of {{importCryptoKey}}.{{AuthenticationExtensionsPRFImportCryptoKeyParams/extractable}}. - - Note: The {{KeyFormat}}, {{AlgorithmIdentifier}} and {{KeyUsage}} types are defined in [[!WebCryptoApi]]. : Client extension processing ([=registration extension|registration=]) @@ -6796,35 +6796,31 @@ Note: this extension may be implemented for [=authenticators=] that do not use [ 1. Set `hmac-secret` to [TRUE] in the authenticator extensions input. 1. If {{AuthenticationExtensionsPRFInputs/eval}} is present and a future extension to [[FIDO-CTAP]] permits evaluation of the PRF at creation time, configure `hmac-secret` inputs accordingly: - * Let |prefix| be a byte string as follows: - * If {{AuthenticationExtensionsPRFInputs/importCryptoKey}} is not present, let |prefix| be UTF8Encode("WebAuthn PRF"). - * If {{AuthenticationExtensionsPRFInputs/importCryptoKey}} is present and {{AuthenticationExtensionsPRFInputs/importCryptoKey}}.{{AuthenticationExtensionsPRFImportCryptoKeyParams/extractable}} is [TRUE], let |prefix| be UTF8Encode("WebAuthn PRF:CryptoKey"). - * If {{AuthenticationExtensionsPRFInputs/importCryptoKey}} is present and {{AuthenticationExtensionsPRFInputs/importCryptoKey}}.{{AuthenticationExtensionsPRFImportCryptoKeyParams/extractable}} is [FALSE], let |prefix| be UTF8Encode("WebAuthn PRF:CryptoKey:Extractable"). + * Let |prefix| be a byte string as follows. + If {{AuthenticationExtensionsPRFInputs/importCryptoKey}} is present, let |prefix| be UTF8Encode("WebAuthn PRF:CryptoKey"). + Otherwise, let |prefix| be UTF8Encode("WebAuthn PRF"). * Let `salt1` be the value of SHA-256(|prefix| || 0x00 || {{AuthenticationExtensionsPRFInputs/eval}}.{{AuthenticationExtensionsPRFValues/first}}). * If {{AuthenticationExtensionsPRFInputs/eval}}.{{AuthenticationExtensionsPRFValues/second}} is present, let `salt2` be the value of SHA-256(|prefix| || 0x00 || {{AuthenticationExtensionsPRFInputs/eval}}.{{AuthenticationExtensionsPRFValues/second}}). 1. Set {{AuthenticationExtensionsPRFOutputs/enabled}} to the value of `hmac-secret` in the authenticator extensions output. If not present, set {{AuthenticationExtensionsPRFOutputs/enabled}} to [FALSE]. - 1. If {{AuthenticationExtensionsPRFInputs/importCryptoKey}} is not present: - 1. Set {{AuthenticationExtensionsPRFOutputs/results}} to the decrypted PRF result(s), if any. - - 1. If {{AuthenticationExtensionsPRFInputs/importCryptoKey}} is present: - 1. Let |firstOutput| and |secondOutput| be {{BufferSource}} values containing the respective decrypted PRF result(s), if any. - 1. Let |subtleCrypto| be an instance of {{SubtleCrypto}}. - 1. If |firstOutput| is present, set - {{AuthenticationExtensionsPRFOutputs/results}}.{{AuthenticationExtensionsPRFValues/first}} - to the result of invoking |subtleCrypto|.{{SubtleCrypto/importKey}} with the arguments - {{AuthenticationExtensionsPRFInputs/importCryptoKey}}.{{AuthenticationExtensionsPRFImportCryptoKeyParams/format}}, - |firstOutput|, - {{AuthenticationExtensionsPRFInputs/importCryptoKey}}.{{AuthenticationExtensionsPRFImportCryptoKeyParams/algorithm}}, - {{AuthenticationExtensionsPRFInputs/importCryptoKey}}.{{AuthenticationExtensionsPRFImportCryptoKeyParams/extractable}} and - {{AuthenticationExtensionsPRFInputs/importCryptoKey}}.{{AuthenticationExtensionsPRFImportCryptoKeyParams/keyUsages}}. - 1. If |secondOutput| is present, set - {{AuthenticationExtensionsPRFOutputs/results}}.{{AuthenticationExtensionsPRFValues/second}} - to the result of invoking |subtleCrypto|.{{SubtleCrypto/importKey}} with the arguments - {{AuthenticationExtensionsPRFInputs/importCryptoKey}}.{{AuthenticationExtensionsPRFImportCryptoKeyParams/format}}, - |secondOutput|, - {{AuthenticationExtensionsPRFInputs/importCryptoKey}}.{{AuthenticationExtensionsPRFImportCryptoKeyParams/algorithm}}, - {{AuthenticationExtensionsPRFInputs/importCryptoKey}}.{{AuthenticationExtensionsPRFImportCryptoKeyParams/extractable}} and - {{AuthenticationExtensionsPRFInputs/importCryptoKey}}.{{AuthenticationExtensionsPRFImportCryptoKeyParams/keyUsages}}. + 1. If {{AuthenticationExtensionsPRFInputs/importCryptoKey}} +
+ : is not present, + :: Set {{AuthenticationExtensionsPRFOutputs/results}} to the decrypted PRF result(s), if any. + + : is present, + :: 1. Let |firstOutput| and |secondOutput| be {{BufferSource}} values containing the respective decrypted PRF result(s), if any. + 1. Let |subtleCrypto| be an instance of {{SubtleCrypto}}. + 1. If |firstOutput| is present, set + {{AuthenticationExtensionsPRFOutputs/results}}.{{AuthenticationExtensionsPRFValues/first}} + to the result of invoking |subtleCrypto|.{{SubtleCrypto/importKey}} with the arguments + "raw", |firstOutput|, "HKDF", [FALSE] and + {{AuthenticationExtensionsPRFInputs/importCryptoKey}}.{{AuthenticationExtensionsPRFImportCryptoKeyParams/keyUsages}}. + 1. If |secondOutput| is present, set + {{AuthenticationExtensionsPRFOutputs/results}}.{{AuthenticationExtensionsPRFValues/second}} + to the result of invoking |subtleCrypto|.{{SubtleCrypto/importKey}} with the arguments + "raw", |secondOutput|, "HKDF", [FALSE] and + {{AuthenticationExtensionsPRFInputs/importCryptoKey}}.{{AuthenticationExtensionsPRFImportCryptoKeyParams/keyUsages}}. +
Note: If PRF results are obtained during [=registration=] then the [=[RP]=] MUST inspect the [=UV=] bit in the [=flags=] of the response in order to determine the correct value of {{PublicKeyCredentialRequestOptions/userVerification}} for future [=assertions=]. Otherwise results from [=assertions=] may be inconsistent with those from the [=registration=]. @@ -6838,34 +6834,26 @@ Note: If PRF results are obtained during [=registration=] then the [=[RP]=] MUST 1. If |ev| is null and {{AuthenticationExtensionsPRFInputs/eval}} is present, then let |ev| be the value of {{AuthenticationExtensionsPRFInputs/eval}}. 1. If |ev| is not null: - 1. Let |prefix| be a byte string as follows: - - If {{AuthenticationExtensionsPRFInputs/importCryptoKey}} is not present, let |prefix| be UTF8Encode("WebAuthn PRF"). - - If {{AuthenticationExtensionsPRFInputs/importCryptoKey}} is present and {{AuthenticationExtensionsPRFInputs/importCryptoKey}}.{{AuthenticationExtensionsPRFImportCryptoKeyParams/extractable}} is [TRUE], let |prefix| be UTF8Encode("WebAuthn PRF:CryptoKey"). - - If {{AuthenticationExtensionsPRFInputs/importCryptoKey}} is present and {{AuthenticationExtensionsPRFInputs/importCryptoKey}}.{{AuthenticationExtensionsPRFImportCryptoKeyParams/extractable}} is [FALSE], let |prefix| be UTF8Encode("WebAuthn PRF:CryptoKey:Extractable"). + 1. Let |prefix| be a byte string as follows. + If {{AuthenticationExtensionsPRFInputs/importCryptoKey}} is present, let |prefix| be UTF8Encode("WebAuthn PRF:CryptoKey"). + Otherwise, let |prefix| be UTF8Encode("WebAuthn PRF"). 1. Let `salt1` be the value of SHA-256(|prefix| || 0x00 || |ev|.{{AuthenticationExtensionsPRFValues/first}}). 1. If |ev|.{{AuthenticationExtensionsPRFValues/second}} is present, let `salt2` be the value of SHA-256(|prefix| || 0x00 || |ev|.{{AuthenticationExtensionsPRFValues/second}}). 1. Send an `hmac-secret` extension to the [=authenticator=] using the values of `salt1` and, if set, `salt2` as the parameters of the same name in that process. 1. If {{AuthenticationExtensionsPRFInputs/importCryptoKey}} is not present: - 1. Set {{AuthenticationExtensionsPRFOutputs/results}} to the decrypted PRF result(s), if any. - + 1. Set {{AuthenticationExtensionsPRFOutputs/results}} to the decrypted PRF result(s), if any. 1. If {{AuthenticationExtensionsPRFInputs/importCryptoKey}} is present: 1. Let |firstOutput| and |secondOutput| be {{BufferSource}} values containing the respective decrypted PRF result(s), if any. 1. Let |subtleCrypto| be an instance of {{SubtleCrypto}}. 1. If |firstOutput| is present, set {{AuthenticationExtensionsPRFOutputs/results}}.{{AuthenticationExtensionsPRFValues/first}} to the result of invoking |subtleCrypto|.{{SubtleCrypto/importKey}} with the arguments - {{AuthenticationExtensionsPRFInputs/importCryptoKey}}.{{AuthenticationExtensionsPRFImportCryptoKeyParams/format}}, - |firstOutput|, - {{AuthenticationExtensionsPRFInputs/importCryptoKey}}.{{AuthenticationExtensionsPRFImportCryptoKeyParams/algorithm}}, - {{AuthenticationExtensionsPRFInputs/importCryptoKey}}.{{AuthenticationExtensionsPRFImportCryptoKeyParams/extractable}} and + "raw", |firstOutput|, "HKDF", [FALSE] and {{AuthenticationExtensionsPRFInputs/importCryptoKey}}.{{AuthenticationExtensionsPRFImportCryptoKeyParams/keyUsages}}. 1. If |secondOutput| is present, set {{AuthenticationExtensionsPRFOutputs/results}}.{{AuthenticationExtensionsPRFValues/second}} to the result of invoking |subtleCrypto|.{{SubtleCrypto/importKey}} with the arguments - {{AuthenticationExtensionsPRFInputs/importCryptoKey}}.{{AuthenticationExtensionsPRFImportCryptoKeyParams/format}}, - |secondOutput|, - {{AuthenticationExtensionsPRFInputs/importCryptoKey}}.{{AuthenticationExtensionsPRFImportCryptoKeyParams/algorithm}}, - {{AuthenticationExtensionsPRFInputs/importCryptoKey}}.{{AuthenticationExtensionsPRFImportCryptoKeyParams/extractable}} and + "raw", |secondOutput|, "HKDF", [FALSE] and {{AuthenticationExtensionsPRFInputs/importCryptoKey}}.{{AuthenticationExtensionsPRFImportCryptoKeyParams/keyUsages}}. : Authenticator extension input / processing / output