Yubico Forum

[QUESTION] ErrorCode 1 trying to perform device registration
Page 1 of 1

Author:  patrickherber [ Mon Dec 04, 2017 2:27 pm ]
Post subject:  [QUESTION] ErrorCode 1 trying to perform device registration

I'm trying to integrate U2F authentication in our web application using the sample code you provide.
Both on our application than with your u2flib-server-demo application when I try to perform a registration I get following error message:

{"errorCode":1,"errorMessage":"device status code: -200"}

What could be its reason?

I'm performing the tests on Ubuntu 14.04 using Chrome version 63.0.3239.59 and a Yubikey NEO

Thanks a lot for your support and best regards


Author:  patrickherber [ Tue Dec 05, 2017 4:50 pm ]
Post subject:  Re: [QUESTION] ErrorCode 1 trying to perform device registra

the problem I had yesterday was probably related to my Ubuntu PC.
I've tried now using a MacOS and it works fine.
However when I try to register in my application (where for the moment I've simply used the sample code provided in your example) I get a "Bad signature" error message during the finishRegistration method:

com.yubico.u2f.exceptions.U2fBadInputException: Bad signature
   at com.yubico.u2f.crypto.BouncyCastleCrypto.checkSignature(BouncyCastleCrypto.java:45)
   at com.yubico.u2f.crypto.BouncyCastleCrypto.checkSignature(BouncyCastleCrypto.java:31)
   at com.yubico.u2f.data.messages.key.RawRegisterResponse.checkSignature(RawRegisterResponse.java:97)
   at com.yubico.u2f.U2fPrimitives.finishRegistration(U2fPrimitives.java:89)
   at com.yubico.u2f.U2F.finishRegistration(U2F.java:81)
   at com.yubico.u2f.U2F.finishRegistration(U2F.java:67)
   at U2FManager.finishRegistration(U2FManager.java:82)

The RegisterResponse and RegisterRequestData seem correct...

What could be the cause of this problem?

Thanks and best regards

Author:  patrickherber [ Thu Dec 07, 2017 9:34 am ]
Post subject:  Re: [SOLVED] ErrorCode 1 trying to perform device registrati

Thanks to the support of the Yubico team I could solve this problem:

Debugging the class BouncyCastleCrypto I could find out the source of the problem. The following exception was thrown at the line "ecdsaSignature.initVerify(publicKey);":

java.security.InvalidKeyException: No installed provider supports this key: org.bouncycastle.jce.provider.JCEECPublicKey

The source of it was a conflict in the version of BouncyCastle used inside the application (we had a dependent library which depended on an older version of BC). Fixing the dependencies solved the problem.

Thanks a lot for your precious help and best regards.

Page 1 of 1 All times are UTC + 1 hour
Powered by phpBB® Forum Software © phpBB Group