Skip to content

Commit ea6cd8f

Browse files
authored
Drop support for device public key (dpk) (#567)
* Removed DevicePubKey p1 * Removed DevicePubkey p2 * Clean up crumbs * format * Add the comment back in * format
1 parent 0d38438 commit ea6cd8f

20 files changed

+30
-515
lines changed

BlazorWasmDemo/Server/Controllers/UserController.cs

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,7 @@ public CredentialCreateOptions GetCredentialOptions(
112112
{
113113
Extensions = true,
114114
UserVerificationMethod = true,
115-
CredProps = true,
116-
DevicePubKey = new AuthenticationExtensionsDevicePublicKeyInputs
117-
{
118-
Attestation = attestationType?.ToString() ?? AttestationConveyancePreference.None.ToString()
119-
},
115+
CredProps = true
120116
}
121117
);
122118

@@ -168,7 +164,6 @@ public async Task<string> CreateCredentialAsync([FromRoute] string username, [Fr
168164
SignCount = credential.SignCount,
169165
RegDate = DateTimeOffset.UtcNow,
170166
AaGuid = credential.AaGuid,
171-
DevicePublicKeys = [credential.DevicePublicKey],
172167
Transports = credential.Transports,
173168
IsBackupEligible = credential.IsBackupEligible,
174169
IsBackedUp = credential.IsBackedUp,
@@ -213,8 +208,7 @@ public AssertionOptions MakeAssertionOptions([FromRoute] string? username, [From
213208
var exts = new AuthenticationExtensionsClientInputs
214209
{
215210
UserVerificationMethod = true,
216-
Extensions = true,
217-
DevicePubKey = new AuthenticationExtensionsDevicePublicKeyInputs()
211+
Extensions = true
218212
};
219213

220214
// 2. Create options (usernameless users will be prompted by their device to select a credential from their own list)
@@ -277,16 +271,11 @@ public async Task<string> MakeAssertionAsync([FromBody] AuthenticatorAssertionRa
277271
OriginalOptions = options,
278272
StoredPublicKey = creds.PublicKey,
279273
StoredSignatureCounter = creds.SignCount,
280-
IsUserHandleOwnerOfCredentialIdCallback = UserHandleOwnerOfCredentialIdAsync,
281-
StoredDevicePublicKeys = creds.DevicePublicKeys
274+
IsUserHandleOwnerOfCredentialIdCallback = UserHandleOwnerOfCredentialIdAsync
282275
}, cancellationToken: cancellationToken);
283276

284277
// 4. Store the updated counter
285278
_demoStorage.UpdateCounter(res.CredentialId, res.SignCount);
286-
if (res.DevicePublicKey is not null)
287-
{
288-
creds.DevicePublicKeys.Add(res.DevicePublicKey);
289-
}
290279

291280

292281
// 5. return result to client

Demo/Controller.cs

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ public JsonResult MakeCredentialOptions([FromForm] string username,
6767
{
6868
Extensions = true,
6969
UserVerificationMethod = true,
70-
DevicePubKey = new AuthenticationExtensionsDevicePublicKeyInputs() { Attestation = attType },
7170
CredProps = true
7271
};
7372

@@ -127,8 +126,7 @@ public async Task<JsonResult> MakeCredential([FromBody] AuthenticatorAttestation
127126
IsBackupEligible = credential.IsBackupEligible,
128127
IsBackedUp = credential.IsBackedUp,
129128
AttestationObject = credential.AttestationObject,
130-
AttestationClientDataJson = credential.AttestationClientDataJson,
131-
DevicePublicKeys = [credential.DevicePublicKey]
129+
AttestationClientDataJson = credential.AttestationClientDataJson
132130
});
133131

134132
// 4. return "ok" to the client
@@ -160,8 +158,7 @@ public ActionResult AssertionOptionsPost([FromForm] string username, [FromForm]
160158
var exts = new AuthenticationExtensionsClientInputs()
161159
{
162160
Extensions = true,
163-
UserVerificationMethod = true,
164-
DevicePubKey = new AuthenticationExtensionsDevicePublicKeyInputs()
161+
UserVerificationMethod = true
165162
};
166163

167164
// 3. Create options
@@ -215,16 +212,12 @@ public async Task<JsonResult> MakeAssertion([FromBody] AuthenticatorAssertionRaw
215212
OriginalOptions = options,
216213
StoredPublicKey = creds.PublicKey,
217214
StoredSignatureCounter = storedCounter,
218-
IsUserHandleOwnerOfCredentialIdCallback = callback,
219-
StoredDevicePublicKeys = creds.DevicePublicKeys
215+
IsUserHandleOwnerOfCredentialIdCallback = callback
220216
}, cancellationToken: cancellationToken);
221217

222218
// 6. Store the updated counter
223219
DemoStorage.UpdateCounter(res.CredentialId, res.SignCount);
224220

225-
if (res.DevicePublicKey is not null)
226-
creds.DevicePublicKeys.Add(res.DevicePublicKey);
227-
228221
// 7. return OK to client
229222
return Json(res);
230223
}

Demo/TestController.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -188,16 +188,12 @@ public async Task<JsonResult> MakeAssertionTestAsync([FromBody] AuthenticatorAss
188188
OriginalOptions = options,
189189
StoredPublicKey = creds.PublicKey,
190190
StoredSignatureCounter = storedCounter,
191-
IsUserHandleOwnerOfCredentialIdCallback = callback,
192-
StoredDevicePublicKeys = creds.DevicePublicKeys
191+
IsUserHandleOwnerOfCredentialIdCallback = callback
193192
}, cancellationToken: cancellationToken);
194193

195194
// 6. Store the updated counter
196195
_demoStorage.UpdateCounter(res.CredentialId, res.SignCount);
197196

198-
if (res.DevicePublicKey is not null)
199-
creds.DevicePublicKeys.Add(res.DevicePublicKey);
200-
201197
// 7. return OK to client
202198
return Json(new
203199
{

Src/Fido2.Development/StoredCredential.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,6 @@ public class StoredCredential
4848
/// </summary>
4949
public byte[] AttestationClientDataJson { get; set; }
5050

51-
public List<byte[]> DevicePublicKeys { get; set; }
52-
5351
public byte[] UserId { get; set; }
5452

5553
/// <summary>

Src/Fido2.Models/Exceptions/Fido2ErrorCode.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,5 @@ public enum Fido2ErrorCode
3333
UnimplementedAlgorithm,
3434
BackupEligibilityRequirementNotMet,
3535
BackupStateRequirementNotMet,
36-
CredentialAlgorithmRequirementNotMet,
37-
DevicePublicKeyAuthentication
36+
CredentialAlgorithmRequirementNotMet
3837
}

Src/Fido2.Models/Objects/AuthenticationExtensionsClientInputs.cs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,6 @@ public sealed class AuthenticationExtensionsClientInputs
4040
public bool? UserVerificationMethod { private get; set; }
4141

4242
#nullable enable
43-
/// <summary>
44-
/// This extension enables use of a user verification method.
45-
/// https://www.w3.org/TR/webauthn/#sctn-uvm-extension
46-
/// </summary>
47-
[JsonPropertyName("devicePubKey")]
48-
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
49-
public AuthenticationExtensionsDevicePublicKeyInputs? DevicePubKey { get; set; }
50-
5143
/// <summary>
5244
/// This client registration extension facilitates reporting certain credential properties known by the client to the requesting WebAuthn Relying Party upon creation of a public key credential source as a result of a registration ceremony.
5345
/// </summary>

Src/Fido2.Models/Objects/AuthenticationExtensionsClientOutputs.cs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,6 @@ public class AuthenticationExtensionsClientOutputs
3636
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
3737
public ulong[][]? UserVerificationMethod { get; set; }
3838

39-
/// <summary>
40-
/// This authenticator registration extension and authentication extension provides a Relying Party with a "device continuity" signal for backup eligible credentials.
41-
/// https://w3c.github.io/webauthn/#sctn-device-publickey-extension
42-
/// </summary>
43-
[JsonPropertyName("devicePubKey")]
44-
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
45-
public AuthenticationExtensionsDevicePublicKeyOutputs? DevicePubKey { get; set; }
46-
4739
/// <summary>
4840
/// This client registration extension facilitates reporting certain credential properties known by the client to the requesting WebAuthn Relying Party upon creation of a public key credential source as a result of a registration ceremony.
4941
/// </summary>

Src/Fido2.Models/Objects/AuthenticationExtensionsDevicePublicKeyInputs.cs

Lines changed: 0 additions & 16 deletions
This file was deleted.

Src/Fido2.Models/Objects/AuthenticationExtensionsDevicePublicKeyOutputs.cs

Lines changed: 0 additions & 19 deletions
This file was deleted.

Src/Fido2.Models/Objects/RegisteredPublicKeyCredential.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,6 @@ public class RegisteredPublicKeyCredential
4343
/// </summary>
4444
public bool IsBackedUp { get; init; }
4545

46-
/// <summary>
47-
/// The public key portion of a hardware-bound device key pair
48-
/// </summary>
49-
public byte[] DevicePublicKey { get; init; }
50-
5146
public Guid AaGuid { get; init; }
5247

5348
public Fido2User User { get; init; }

Src/Fido2.Models/Objects/VerifyAssertionResult.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,4 @@ public class VerifyAssertionResult
1616
/// The latest value of the BS flag in the authenticator data from any ceremony using the public key credential source.
1717
/// </summary>
1818
public bool IsBackedUp { get; init; }
19-
20-
/// <summary>
21-
/// The public key portion of a hardware-bound device key pair
22-
/// </summary>
23-
public byte[] DevicePublicKey { get; init; }
2419
}

0 commit comments

Comments
 (0)