1
0
mirror of https://github.com/bitwarden/server.git synced 2025-06-30 15:42:48 -05:00

Upgrade FIDO2 library usage out of beta (#2579)

This commit is contained in:
Matt Bishop
2023-01-19 11:06:51 -05:00
committed by GitHub
parent 354caa3063
commit 352b42b535
40 changed files with 1363 additions and 1065 deletions

View File

@ -27,7 +27,7 @@
<PackageReference Include="Azure.Storage.Blobs" Version="12.11.0" />
<PackageReference Include="Azure.Storage.Queues" Version="12.9.0" />
<PackageReference Include="BitPay.Light" Version="1.0.1907" />
<PackageReference Include="Fido2.AspNet" Version="3.0.0-beta2" />
<PackageReference Include="Fido2.AspNet" Version="3.0.1" />
<PackageReference Include="Handlebars.Net" Version="2.1.2" />
<PackageReference Include="IdentityServer4.AccessTokenValidation" Version="3.0.1" />
<PackageReference Include="MailKit" Version="3.2.0" />

View File

@ -107,7 +107,9 @@ public class WebAuthnTokenProvider : IUserTwoFactorTokenProvider<User>
return false;
}
IsUserHandleOwnerOfCredentialIdAsync callback = (args) => Task.FromResult(true);
// Callback to check user ownership of credential. Always return true since we have already
// established ownership in this context.
IsUserHandleOwnerOfCredentialIdAsync callback = (args, cancellationToken) => Task.FromResult(true);
var res = await _fido2.MakeAssertionAsync(clientResponse, options, webAuthCred.Item2.PublicKey, webAuthCred.Item2.SignatureCounter, callback);

View File

@ -442,9 +442,9 @@ public class UserService : UserManager<User>, IUserService, IDisposable
var options = CredentialCreateOptions.FromJson((string)provider.MetaData["pending"]);
// Callback to ensure credential id is unique. Always return true since we don't care if another
// account uses the same 2fa key.
IsCredentialIdUniqueToUserAsyncDelegate callback = args => Task.FromResult(true);
// Callback to ensure credential ID is unique. Always return true since we don't care if another
// account uses the same 2FA key.
IsCredentialIdUniqueToUserAsyncDelegate callback = (args, cancellationToken) => Task.FromResult(true);
var success = await _fido2.MakeNewCredentialAsync(attestationResponse, options, callback);

View File

@ -95,12 +95,12 @@
},
"Fido2.AspNet": {
"type": "Direct",
"requested": "[3.0.0-beta2, )",
"resolved": "3.0.0-beta2",
"contentHash": "qkowZS0WPS26gDG97rwjZObOa/xtFVjSpvWHl3OwWRQ9ZU5xNePXKk2XJWmO2MCQc40idxyEOfA34MMexCHc3w==",
"requested": "[3.0.1, )",
"resolved": "3.0.1",
"contentHash": "5n5shEXD7RFUyTesjUHGDjkpgES7j4KotQo1GwUcS08k+fx+1tl/zCFHJ9RFDuUwO+S681ZILT2PyA67IPYpaA==",
"dependencies": {
"Fido2": "3.0.0-beta2",
"Fido2.Models": "3.0.0-beta2"
"Fido2": "3.0.1",
"Fido2.Models": "3.0.1"
}
},
"Handlebars.Net": {
@ -427,19 +427,20 @@
},
"Fido2": {
"type": "Transitive",
"resolved": "3.0.0-beta2",
"contentHash": "FnNMbK88dyPp0Ww/iMim5g89rSPdqkjQiDiTJJtvxDcEk8JK/eBdTzAl4myNaKS9e8PKrxxddOTrnNja3PHGtQ==",
"resolved": "3.0.1",
"contentHash": "S0Bz1vfcKlO4Jase3AWp5XnQ746psf4oGx5kL+D2A10j1SsjoAOAIIpanSwfi0cEepDHgk1bClcOKY5TjOzGdA==",
"dependencies": {
"Fido2.Models": "3.0.0-beta2",
"NSec.Cryptography": "20.2.0",
"System.Formats.Cbor": "5.0.0",
"System.IdentityModel.Tokens.Jwt": "6.6.0"
"Fido2.Models": "3.0.1",
"Microsoft.Extensions.Http": "6.0.0",
"NSec.Cryptography": "22.4.0",
"System.Formats.Cbor": "6.0.0",
"System.IdentityModel.Tokens.Jwt": "6.17.0"
}
},
"Fido2.Models": {
"type": "Transitive",
"resolved": "3.0.0-beta2",
"contentHash": "6ePSMUtqz6lAfDUjDvOONMLugcKiAyz8hzoLSAISk3iDIjBMLMPlZSV3TVZqiY+5SAzC8x61OHNoCODqorucNw=="
"resolved": "3.0.1",
"contentHash": "mgjcuGETuYSCUEaZG+jQeeuuEMkDLc4GDJHBvKDdOz6oSOWp5adPdWP4btZx7Pi+9fu4szN3JIjJmby67MaILw=="
},
"IdentityModel": {
"type": "Transitive",
@ -468,11 +469,8 @@
},
"libsodium": {
"type": "Transitive",
"resolved": "1.0.18",
"contentHash": "Ajv3AR9Qg/C4SQcE2ONx/UieeKnn5lSvVNc6egC3p6NP6qjZzWJ+Xg2vJURNYjkpHui/KctBwQjMPqpZK8/CHA==",
"dependencies": {
"Microsoft.NETCore.Platforms": "1.0.1"
}
"resolved": "1.0.18.2",
"contentHash": "flArHoVdscSzyV8ZdPV+bqqY2TTFlaN+xZf/vIqsmHI51KVcD/mOdUPaK3n/k/wGKz8dppiktXUqSmf3AXFgig=="
},
"Microsoft.AspNetCore.Authentication.OpenIdConnect": {
"type": "Transitive",
@ -757,6 +755,17 @@
"Microsoft.Extensions.Logging.Abstractions": "3.1.8"
}
},
"Microsoft.Extensions.Http": {
"type": "Transitive",
"resolved": "6.0.0",
"contentHash": "15+pa2G0bAMHbHewaQIdr/y6ag2H3yh4rd9hTXavtWDzQBkvpe2RMqFg8BxDpcQWssmjmBApGPcw93QRz6YcMg==",
"dependencies": {
"Microsoft.Extensions.DependencyInjection.Abstractions": "6.0.0",
"Microsoft.Extensions.Logging": "6.0.0",
"Microsoft.Extensions.Logging.Abstractions": "6.0.0",
"Microsoft.Extensions.Options": "6.0.0"
}
},
"Microsoft.Extensions.Identity.Core": {
"type": "Transitive",
"resolved": "6.0.4",
@ -1008,11 +1017,10 @@
},
"NSec.Cryptography": {
"type": "Transitive",
"resolved": "20.2.0",
"contentHash": "NxzHaDQm3JfH+9VQdLI1bC4h/ZTKPo5o/4BEscBu4KK0Yv35sB87hSRuzpr09VahxY5ZpJfE2tHyK4u27jfiyQ==",
"resolved": "22.4.0",
"contentHash": "lEntcPYd7h3aZ8xxi/y/4TML7o8w0GEGqd+w4L1omqFLbdCBmhxJAeO2YBmv/fXbJKgKCQLm7+TD4bR605PEUQ==",
"dependencies": {
"System.Runtime.CompilerServices.Unsafe": "4.7.0",
"libsodium": "[1.0.18, 1.0.19)"
"libsodium": "[1.0.18.2, 1.0.19)"
}
},
"Pipelines.Sockets.Unofficial": {
@ -1474,8 +1482,8 @@
},
"System.Formats.Cbor": {
"type": "Transitive",
"resolved": "5.0.0",
"contentHash": "OJ8UXNyYIvu22ZrMHDBcnBvs3l6w2wEWUSwgPf2gimUrdoKJC4pcg963kiYAA9kvs8HYLQKQ+2Arr7pm19aZ4A=="
"resolved": "6.0.0",
"contentHash": "mGaLOoiw7KurJagOOcIsWUoCT5ACIiGxKlCcbYQASefBGXjnCcKTq5Hdjb94eEAKg38zXKlHw4c6EjzgBl9dIw=="
},
"System.Globalization": {
"type": "Transitive",