Skip to content
This repository has been archived by the owner on Jun 9, 2022. It is now read-only.

TypeError: valid_facets() takes exactly 3 arguments (2 given) #2

Closed
jeffemandel opened this issue Apr 7, 2015 · 1 comment
Closed

Comments

@jeffemandel
Copy link

I’m developing a medical device that needs to communicate with a server to function. I need to secure this communication, and I’m trying to use u2f. The server is running Labview Web Services, but I’m able to make things work on the server side using the .Net server library. Where I’m stuck is in the trustedFacet stage. I output json according to the specification at FIDO:

{"trustedFacets":[{"version":{"major”:1,"minor":0},"ids":["https://myserver.example.com/u2f/AppID"]}]}

This gets rejected by appid.py verify_facet(self, app_id, facet, version=(2, 0))

I looked for a 2.0 version of FIDO AppID and Facet Specification v1.0, and can’t find it. No matter, I change the AppID to version 2.0 and it proceeds, but dies with:

File "register.py", line 23, in register return u2f.register(device, params, facet)
File "build/bdist.macosx-10.10-x86_64/egg/u2flib_host/u2f.py", line 52, in register
File "build/bdist.macosx-10.10-x86_64/egg/u2flib_host/u2f_v2.py", line 43, in register
File "build/bdist.macosx-10.10-x86_64/egg/u2flib_host/appid.py", line 140, in verify_facet
TypeError: valid_facets() takes exactly 3 arguments (2 given)

Looking at the code it seems like valid_facets is being called with:

 trustedFacets = self.valid_facets(entry['ids'])

but is defined as:

 valid_facets(self, app_id, facets):

This suggests that ids shouldn't be an array of strings, but rather an array of dicts. Am I missing something?

Thanks,

Jeff E Mandel MD MS
Assistant Professor of Anesthesiology & Critical Care
Perelman School of Medicine at the University of Pennsylvania

Update:

I changed the line

 trustedFacets = self.valid_facets(entry['ids'])

to

 trustedFacets = self.valid_facets(app_id, entry['ids'])

and

verify_facet(self, app_id, facet, version=(2, 0))

to

verify_facet(self, app_id, facet, version=(1, 0))

u2f.register works now.

@dainnilsson
Copy link
Member

Those changes are both correct, I'll update the source code, thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

2 participants