Problem loading applet on Yubikey Neo

Tagged:

Currently contains 6 posts

Avatar

September 06, 2016 13:23

Collard Baudoin

Hello,

I have a Fidesmo Card and a Fidesmo Yubikey Neo.
I am trying to load the sample applet (https://github.com/fidesmo/gradle-fidesmo-example) on both card using the gradle installer provided on Github (https://github.com/fidesmo/gradle-fidesmo)

The applet builds without error:

>gradlew build
> Configuring > 0/1 projects > root project
Please specify fidesmo app id: xxredactedxx
:compileJava UP-TO-DATE
:processResources UP-TO-DATE
:classes UP-TO-DATE
:jar UP-TO-DATE
:assemble UP-TO-DATE
:compileTestJava UP-TO-DATE
:processTestResources UP-TO-DATE
:testClasses UP-TO-DATE
:test UP-TO-DATE
:check UP-TO-DATE
:convertJavacard UP-TO-DATE
:build UP-TO-DATE
BUILD SUCCESSFUL
Total time: 3 mins 0.81 secs

When I try to load it on the Fidesmo card, I get the Following:

>gradlew installToLocalCard
> Configuring > 0/1 projects > root project
Please specify fidesmo app id: xxredactedxx
> Building 0% > :deleteFromLocalCard
Please specify fidesmo app key: xxredactedxx
:deleteFromLocalCard
:compileJava UP-TO-DATE
:processResources UP-TO-DATE
:classes UP-TO-DATE
:convertJavacard UP-TO-DATE
:uploadExecutableLoadFile
:installToLocalCard
BUILD SUCCESSFUL
Total time: 58.001 secs

However, when I try the same command on the Yubikey Neo, I get this error:

>gradlew installToLocalCard
> Configuring > 0/1 projects > root project
Please specify fidesmo app id: xxredactedxx
> Building 0% > :deleteFromLocalCard
Please specify fidesmo app key: xxredactedxx
:deleteFromLocalCard FAILED

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ‘:deleteFromLocalCard’.
    > Operation fb654fc9-fda9-4907-8536-e027d6b43fda failed with 500
  • Try:
    Run with —stacktrace option to get the stack trace. Run with —info or —debug option to get more log output.

BUILD FAILED
Total time: 1 mins 8.28 secs

When I run with the —stacktrace option, I get:

>gradlew installToLocalCard —stacktrace
> Configuring > 0/1 projects > root project
Please specify fidesmo app id: xxredactedxx
> Building 0% > :deleteFromLocalCard
Please specify fidesmo app key: xxredactedxx
:deleteFromLocalCard FAILED

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ‘:deleteFromLocalCard’.
    > Operation 552a31e1-82b7-4775-88e0-075105f00e8b failed with 500
  • Try:
    Run with —info or —debug option to get more log output.
  • Exception is:
    org.gradle.api.tasks.TaskExecutionException: Execution failed for task ‘:deleteFromLocalCard’.
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.
    java:69)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46
    )
    at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskEx
    ecuter.java:35)
    at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:64)
    at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
    at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExec
    uter.java:42)
    at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.j
    ava:52)
    at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53)
    at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.j
    ava:43)
    at org.gradle.api.internal.AbstractTask.executeWithoutThrowingTaskFailure(AbstractTask.java:296)
    at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.executeTask(AbstractTaskPlanExecut
    or.java:79)
    at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecut
    or.java:63)
    at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:
    51)
    at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:23)
    at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:86)
    at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:29)
    at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:61)
    at org.gradle.execution.DefaultBuildExecuter.access$200(DefaultBuildExecuter.java:23)
    at org.gradle.execution.DefaultBuildExecuter$2.proceed(DefaultBuildExecuter.java:67)
    at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)
    at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:61)
    at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:54)
    at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:148)
    at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:105)
    at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:85)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter
    .java:81)
    at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:33)
    at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:24)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:39)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:29)
    at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:50)
    at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.java:171)
    at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:23
    7)
    at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:21
    0)
    at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:35)
    at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:24)
    at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:206)
    at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:169)
    at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33)
    at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22)
    at org.gradle.launcher.Main.doAction(Main.java:33)
    at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
    at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:54)
    at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:35)
    at org.gradle.launcher.GradleMain.main(GradleMain.java:23)
    at org.gradle.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:30)
    at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:127)
    at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:56)
    Caused by: org.gradle.api.GradleException: Operation 552a31e1-82b7-4775-88e0-075105f00e8b failed with 500
    at com.fidesmo.gradle.plugin.OperationTask.executeOperation(OperationTask.groovy:69)
    at com.fidesmo.gradle.plugin.FidesmoPlugin$_apply_closure3_closure9.doCall(FidesmoPlugin.groovy:82)
    at org.gradle.api.internal.AbstractTask$ClosureTaskAction.execute(AbstractTask.java:539)
    at org.gradle.api.internal.AbstractTask$ClosureTaskAction.execute(AbstractTask.java:520)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.j
    ava:80)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.
    java:61)
    … 47 more

BUILD FAILED
Total time: 51.511 secs

Any idea for the error?
Is there any reference resource for the error code (500)

Avatar

September 06, 2016 16:44

NFCtester

Hello Baudoin,

Thanks for writing to the Fidesmo forum.

We have been able to reproduce the issue, and it seems that there is a bug in the way our Gradle plugin handles Yubikeys.
Yubikeys comply to an older version of GlobalPlatform than our regular cards, and our software is raising an exception when parsing the Yubikey’s response to one of the command APDUs sent during the “deleteFromLocalCard” task, which is always the first stage of “installToLocalCard” (the plugin attempts to remove older versions of the applet before trying to install it.)

We will notify you when the bug is fixed, which we hope doesn’t take too long…

Best regards,
/Miguel

Avatar

September 12, 2016 19:25

Collard Baudoin

Thanks for the quick reply!

While the bug is being fixed, is there another way to load the applet on the yubikey?

Best regards,

Baudoin

Avatar

September 13, 2016 12:08

NFCtester

Hi Baudoin,

Yes, there is – following our “standard” service delivery process. It is designed to deliver a service to all Fidesmo devices, so it is a bit overkill, but it is also a way to learn how it works.

You have already done all the JavaCard preparation tasks, so now the instructions you need to follow are in this tutorial:

https://developer.fidesmo.com/tutorials/publish_cardlet

which explains how to upload the compiled applet to our server, write a mini-script defining a service that just installs it (it could be doing many more things), and upload it.

Then you will be able to deliver it to any Fidesmo-enabled device, like your Yubikey, using an Android phone with NFC capabilities: install the Fidesmo App, go to “Manual Service Order” and type your App-Id and service-Id.

If you have any issue during the process, we are here to help!

Regards,
/Miguel

Avatar

September 16, 2016 11:01

pepegar

Hello Badouin,

We, the Fidesmo team, have been able to fix the error concerning yubikeys and gradle-fidesmo-example.

It should be seamless to you, so the same operation that didn’t work before in gradle-fidesmo-example should work now.

Thank you very much for your patience.

Regards.

Avatar

September 22, 2016 20:21

Collard Baudoin

Thank you, I will check that and keep you informed!

Reply to thread