Yubico/libfido2

libfido2 in Windows 10

danielValdezR opened this issue · 12 comments

Hi,

I'm trying to use libfido2 on a C# Console application targeting AnyCPU, using the .NET bindings (https://github.com/borrrden/Fido2Net) without any success. I've tried to use the libraries on yours Releases page and even built it on my own but I don't stop getting: BadImageFormatException: An attempt was made to load a program with an incorrect format. (0x8007000B), no matter if I use Win32 or Win64.

Currently I'm setting the fido2.dll as Embedded Resource but, is there a way to install it directly on the system so I don't have to add it to my project.

Device specifications:
Processor 11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz 1.80 GHz
Installed RAM 16.0 GB (15.7 GB usable)
System type 64-bit operating system, x64-based processor

Windows version
Edition Windows 10 Pro
Version 21H1
Installed on ‎11/‎30/‎2021
OS build 19043.1348
Experience Windows Feature Experience Pack 120.2212.3920.0

What am I missing?

I honestly have no idea. Perhaps @borrrden could help?

I haven't updated the C# bindings in a good long while but the theory behind it remains the same. Perhaps you could create a github repo of your project that shows the issue?

Well, even trying to run your own examples @borrrden is getting me that kind of issues, so I don't really know if the way the libfido2 is built has changed or is it something else

Would it make sense to try with past releases?

I've already tried with v1.5.0, I will check with the oldest one...worth the try

So v1.1.0 works, looks something has changed in the way the library is built /:

Thank you; I will have a look next week (it is late here). Does 1.2.0 not work?

Thanks! Yes, 1.2.0 also work. It is throwing another errors (@borrrden examples) but at least it is loading the library.

I should probably change my deps script to check out a tag, because the last version I tested the bindings against was 1.0.0. That is the only version that I know to function. In theory, as long as the C interface is the same, all subsequent releases should still function though.

EDIT Just tried it myself with the master branch here and it still runs, though my examples are against an outdated .NET Core. Perhaps you can recreate what I've done using the build_deps.ps1 script in my repo.

I was following that ps1 but now I realized that for the latest releases there are more dependencies needed than the ones stated in the build_deps.ps1 script.

Everything works as expected! Thanks a lot for your comments and sorry for the waste of time

I have some motivation now to bring the bindings inline with 1.9.0 so maybe I'll do that after the new year 😄

Great; thank you!