prefiks / u2f4moz

U2F support extension for Firefox
GNU Lesser General Public License v2.1
197 stars 15 forks source link

Doesn't work in Firefox 42 on Win7 x64 #27

Closed sabi0 closed 8 years ago

sabi0 commented 8 years ago

Hi, I have a Yubico device and use Firefox 42 on Windows 7 x64 with the latest add-on (0.0.10). When I try to register on the U2F demo page I get the popup inviting to touch the device. It lights up when I touch it. But nothing happens in the browser.

Is there any way I could collect some diagnostic details to help understand why it doesn't work?

prefiks commented 8 years ago

Hello, It's possible to get access to debug console of this extension, to do this you need to open browser console (ctrl+shift+i) then you would need to click on gear icon that is on top bar of newly open window and there in advanced settings you would need to check "Enable browser chrome and add-on debugging".

This will add extra button "Debug" in Add-On manager, if you activate it for u2f extension this will open new window and logging informations will be shown there if you trigger u2f operation on page.

sabi0 commented 8 years ago

Here is what I get in the browser console.

When opening the page

TypeError: ({register:function register() {
    [native code]
}, sign:function sign() {
    [native code]
}}) is not extensible

at u2f-api.js:23:1

And then

Register:  Object { challenge: "HlKCfBwK…", version: "U2F_V2", appId: "https://demo.yubico.com" }

at u2f:66:3

Register callback Object { errorCode: 5 }

at u2f:69:5

Object {  }

at sandbox.js:334

Object { _errorType: "Error", message: "Permission denied to access propert…", fileName: "https://demo.yubico.com/u2f?tab=reg…", lineNumber: 71, stack: "@https://demo.yubico.com/u2f?tab=re…", name: "Error" }

at core.js:106

P.S. I do not have Local Admin rights on this machine. And Firefox runs under unprivileged account.

prefiks commented 8 years ago

This tell me that part embeded in webpage did receive request and sent it to part that is responsible for communicating with usb device, but then it didn't receive response and after some time passed it reported error.

If you would be able to access debug console for this extension (you can see movie about how to do it: https://www.youtube.com/watch?v=DvNpUVJcG_E), it will have informations from part talking with usb device, and will probably give more informations.

sabi0 commented 8 years ago

It was the "Remote debugging" checkbox. After I enabled it the add-on Debug button finally appeared.

But I don't get anything logged in the add-on console. Only the last two messages (empty Object and "Permission denied" error) appear when the "touch U2F device" prompt disappears.

P.S. Also the debugger stops by itself on the line 44 of sdk/util/rules.js (I didn't set any breakpoints).

sabi0 commented 8 years ago

Is there anything I could check, say, by running u2f.exe with some specific parameters?

prefiks commented 8 years ago

I will prepare special version of u2f.exe that can be used for standalone testing.

prefiks commented 8 years ago

Here is modified exe file: http://prefiks.org/u2f4moz/win/u2f-reg-test.exe, please download, then execute it and press button on your u2f key, this should create two files in directory where .exe is - log-stdout.txt and log-stderr.txt

sabi0 commented 8 years ago

Launched the program and touched the key. The key lighted up. But there was no reaction from the program. I let it hang for a few minutes and then killed it with Ctrl+C. The log files were there: log-stderr.txt - empty, log-stdout.txt - with a single 0x69 byte ('i') inside.

prefiks commented 8 years ago

It looks like it can't access or enumerate usb devices, probably something related to your account permissions. Will have to check windows developer docs to see how i can handle that.

sabi0 commented 8 years ago

Just in case, the device has the following hardware IDs in the Device Manager: USB\VID_1050&PID_0211&REV_0020 USB\VID_1050&PID_0211

prefiks commented 8 years ago

Could you tell me how that device is named? Can't find that id on list of devices that are recognized by linux driver.

sabi0 commented 8 years ago

In the system tray "Eject" menu it is called "Yubico WinUSB Gnubby (gnubby1)"

prefiks commented 8 years ago

I found this https://github.com/Yubico/pam-u2f/issues/19, this extension also uses libu2f-host library, so unfortunately i may not be able to make it handle this device...

sabi0 commented 8 years ago

I see. Thanks for helping to get to the bottom of it!

prefiks commented 8 years ago

Yes i am using this library, and looks like this exact device is not supported by it. libu2f-host can only talk to devices that expose hid interface, and this one doesn't do this, i think that it implements some kind of pre-u2f spec. I checked chrome code and it has specific implementation just for device with this id, separate from code handling for regular u2f devices.

I cross-compile this for windows on linux with mingw (compilation with msvc didn't success, there are compatibility problem with that).

prefiks commented 8 years ago

Can you show me output from lsusb for that device?