prefiks / u2f4moz

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

Does not work on ARM Platforms #50

Open kop316 opened 7 years ago

kop316 commented 7 years ago

Hello,

I attempted to install this on my Novena laptop which has a Freescale ARM IM.x 6 CPU (Debian Stretch armhf). When installing from the website, it says it is incompatible. Upon looking at the source code, I suspect that is because the C code packaged in the XPI is compiled to x86_64. I suspect then that if anyone runs this on a Raspberry Pi or similar platform, they will get the same issue.

I attempted to follow the instructions for compiling and packing myself, but I kept getting the error of "This package is corrupt."

To compile, I ran

$cd c_src $cmake ./ $make & make install $cd ../ext $zip -9r ../u2f.xpi *

I also attempted to run the "make-xpi.sh" from the script folder, but it said it could not access the "ext" Folder. I moved it up to the root folder, and it ran, but I also got the same issue of the package being corrupt.

I am running Firefox 50.1.0, and I disable the code signing as well.

Any help on how to properly compile would be appreciated!

prefiks commented 7 years ago

Yes extension only contains binaries for x86/x86_64 architectures so it won't work on arm processor. I'm not sure why calling scripts/make_xpi.sh doesn't work for you, maybe some problem with your zip? Would you be able to upload that xpi file somewhere so i could take look at it? Maybe i would be able to figure out whats wrong with it.

kop316 commented 7 years ago

u2f.zip

Hello, per your request, here is the xpi file. I changed the extension to .zip so github would upload it.

Thank you for your help by the way!

kop316 commented 7 years ago

So I checked, for some reason only the bin folder is going into that xpi, I manually ran the

zip -9r ../u2f.xpi *

command. I got this updated one: u2f_updated.zip

But it still complains that is is incompatible with Firefox 50.1.0, even though the one you built worked for my x86 machine.

For fun, I also tried adding the bin folder from mine to the official one you have and tried installing that, but I got the same error again. u2f_support_add_on-1.0.1-fx-linux.zip

prefiks commented 7 years ago

I think you need to add targetPlatform inside ext/install.rdf, i am not 100% sure which one will work for your platform, arm android is using arm-eabi-gcc3, maybe it will works for you too.

kop316 commented 7 years ago

Hello,

So I tried your advice and I added "Linux_armv7l-gcc3" to the targeted platforms, but i still got the incompatible error. The other thing I tried was to just make the targeted platform "linux", and while I got it to install, it would not work properly. I did a bit of googling to try and read about targeted platforms for plug ins, but I had no such luck. Is there a plce you could recommend to look at it?

Thank you for your help once again!

prefiks commented 7 years ago

It probably is unable to locate your binary (you need to place it in correct directory in ext/bin), if you check extension logs after you try to perform u2f operation (go to add-ons window, and click on preferences button in u2f extension section, on add-on preference panel click on show logs) this should give you path where it expects to find it.

kop316 commented 7 years ago

Sorry it took so long to get back to you, life got in the way.

You were correct, the xpi bin file was in "Linux", not "Linux_armv7l-gcc3". I renamed the folder and the extension works! Thank you for the help