Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

standalone app #84

Closed
meganchen opened this issue Jan 21, 2019 · 5 comments
Closed

standalone app #84

meganchen opened this issue Jan 21, 2019 · 5 comments

Comments

@meganchen
Copy link

I cloned the repo, and I'm following the Developing Solo (No Hardware Needed) section of the readme.

After I run ./main, the terminal output is

[STOR] Auth state is initialized
[STOR] pin not set.

If I run python tools/ctap_test.py, the output shows

Test init
Traceback (most recent call last):
  File "tools/ctap_test.py", line 828, in <module>
    t.test_hid()
  File "tools/ctap_test.py", line 156, in test_hid
    r = self.send_data(CTAPHID.INIT, '\x11\x11\x11\x11\x11\x11\x11\x11')
  File "tools/ctap_test.py", line 85, in send_data
    return self.dev.call(cmd, data, event)
AttributeError: Tester instance has no attribute 'dev'

Then, if I run python python-fido2/examples/credential.py, the output says
No FIDO device found

Not sure what the desired outputs should be - could you help troubleshoot what's going on? (Not sure if this matters, but I have Mojave). Thanks!

@conorpp
Copy link
Member

conorpp commented Jan 22, 2019

Hmm, did you install our patched version of python-fido2? Is the repo up to date?

I see in master version of tools/ctap_test.py, test_hid() is commented out.

if __name__ == '__main__':
    t = Tester()
    t.find_device()
    # t.test_hid()
    # t.test_long_ping()
    t.test_fido2()
    # t.test_rk()
    # t.test_responses()
    # test_find_brute_force()
    # t.test_fido2_simple()
    # t.test_fido2_brute_force()

I'm guessing for your case, for some reason, t.find_device() is commented out

@meganchen
Copy link
Author

I believe I installed the patched version of python-fido2 (head at 329434f).
I checked tools/ctap_test.py and noticed I was running t.test_hid() instead of t.find_device() because I was fiddling around with it. Whoops. Now when I run python tools/ctap_test.py, I get

[]
Traceback (most recent call last):
  File "tools/ctap_test.py", line 827, in <module>
    t.find_device()
  File "tools/ctap_test.py", line 73, in find_device
    raise RuntimeError('No FIDO device found')
RuntimeError: No FIDO device found

A step that I forgot I did about: I changed line 75 in pc/device.c from

    serveraddr.sin_port = htons( 8111 );

to

    serveraddr.sin_port = htons( 0 );

to fix an error that said bind failed: Address already in use. Also did the same in tools/http2udb.py line 44 (udpport = 8111 -> udpport = 0). I wonder if the issue is something to do with which ports tools/ctap_test.py is using to find the device.

@conorpp
Copy link
Member

conorpp commented Jan 24, 2019

The bind failed: Address already in use was due to an error with the routine being called twice. Just merged this PR which should fix it.

#58

I would revert serveraddr.sin_port = htons( 0 );, it must be 8111.

@meganchen
Copy link
Author

Sweet. Thanks! The bind failed: Address already in use error is gone now. I'm still getting RuntimeError: No FIDO device found. Not sure what else to try

@szszszsz
Copy link
Contributor

@meganchen Perhaps 'Simulated device' section in nucleo board documentation would help you (if it has not gone stale already).
My guess is, that you are not using the bundled modified python-fido2 library, but the original one. You need to install the bundled sources in a virtual environment, and run it from there.

@0x0ece 0x0ece closed this as completed Nov 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants