Skip to content

Commit

Permalink
fix rp enumeration errors
Browse files Browse the repository at this point in the history
  • Loading branch information
dangfan committed Sep 8, 2024
1 parent 0ed418c commit 8fbd71e
Show file tree
Hide file tree
Showing 3 changed files with 1,008 additions and 9 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@
.vscode
build
*.iml
pubspec.lock
.flutter-plugins*
17 changes: 9 additions & 8 deletions lib/controller/applets/webauthn.dart
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,15 @@ class WebAuthnController extends Controller {
webAuthnItems.clear();
final cm = CredentialManagement(_ctap, cp.pinProtocolVersion == 1 ? PinProtocolV1() : PinProtocolV2(), pinToken);
try {
final rp = await cm.enumerateRpsBegin();
for (var element in (await cm.enumerateCredentials(rp.rpIdHash))) {
webAuthnItems.add(WebAuthnItem(
rpId: rp.rp.id,
userName: element.user.name,
userDisplayName: element.user.displayName,
credentialId: element.credentialId,
));
for (var rp in (await cm.enumerateRPs())) {
for (var element in (await cm.enumerateCredentials(rp.rpIdHash))) {
webAuthnItems.add(WebAuthnItem(
rpId: rp.rp.id,
userName: element.user.name,
userDisplayName: element.user.displayName,
credentialId: element.credentialId,
));
}
}
} on CtapError catch (e) {
if (e.status == CtapStatusCode.ctap2ErrNoCredentials) {
Expand Down
Loading

0 comments on commit 8fbd71e

Please sign in to comment.