bbartlett wrote:
I am using the .NET library published on your developer pages.
Just to be clear: We are linking to the .NET library from developers.yubico.com. Yubico is not the publisher of that library.
bbartlett wrote:
(2) A correct implementation of U2F by a relying party to authenticate users would require the following, (a) persistence of the key handle, public key and attestation certificate created during registration (from window.u2f.register)
They key handle and the public key has to be persisted, but usually a U2F library will collect this data in an object (called
DeviceRegistration or similar). As a user of a library, you should only have to persist this object. See code example
here.
The attestation certificate can, but does not have to, be persisted.
bbartlett wrote:
(b) no error code returned during authentication (from window.u2f.sign)
Well... If an error code is returned by the browser, there will be no signature and thus the next step will fail.
bbartlett wrote:
(c) verify the digital signature returned from the Yubikey sign operation using a crypto library such as Bouncy Castle.
Once again, this should be handled by the U2F library. You should not have to deal with crypto libraries yourself. The only thing you should have to do is something like this:
Code:
u2f_lib.finish_authentication(challenge, device_response, registered_devices)
This will code will throw an exception if the signature was invalid.
I'm not familiar with the .NET library, but it
seems like this is the way the demo server of that libarary does it:
Code:
memberShipService.AuthenticateUser(model.UserName.Trim(), model.DeviceResponse.Trim());
(this line returns a boolean instead of throwing an exception)