Yubico / python-fido2

Provides library functionality for FIDO 2.0, including communication with a device over USB.
BSD 2-Clause "Simplified" License
432 stars 109 forks source link

Error in verify_attestation.py example #155

Closed BananasRule closed 2 years ago

BananasRule commented 2 years ago

Issue

verify_attestation.py throws error

Traceback (most recent call last): File "C:/fake_path/verify_attestation.py", line 142, in if use_prompt: NameError: name 'use_prompt' is not defined

Environment

Python version: 3.10.2 OS: Windows 11

Quick fix

Add

use_prompt = None

to main body of code immediately after imports

Guess at issue

use_prompt is defined within a function and not the main block. When called on line 142 it is not defined as it is a function only variable. Defining it in main removes this problem.

BananasRule commented 2 years ago

use_prompt may need to be set to true or false in main to achieve desired behavior.

dainnilsson commented 2 years ago

Thanks! The use_prompt variable should no longer be used and I have now removed it from that example.