Javacard 3.1 to 3.04 converter - javacard

Does anyone have any experience with Javacard tools 3.1?
I've run through the "installation and getting started": https://docs.oracle.com/en/java/javacard/3.1/guide/introduction.html
I can build / run / simulate and debug the demos in eclipse. Generating CAP files for 3.1 and 3.0.5
But when I run the converter to target 3.0.4 files, there is a verification error:
[ INFO: ] Converting CAP file HelloWorld with target version 3.0.4
[ INFO: ] Converter [v3.1.0]
[ INFO: ] Copyright (c) 1998, 2021, Oracle and/or its affiliates. All rights reserved.
parsing C:\Program Files (x86)\Oracle\Java Card Development Kit Simulator 3.1.0\samples\classic_applets\HelloWorld\applet\bin\com\oracle\jcclassic\samples\helloworld\HelloWorld.class
converting com.oracle.jcclassic.samples.helloworld.HelloWorld
writing C:\Program Files (x86)\Oracle\Java Card Development Kit Simulator 3.1.0\samples\classic_applets\HelloWorld\applet\deliverables\HelloWorld\com\oracle\jcclassic\samples\helloworld\javacard\helloworld.exp
writing C:\Program Files (x86)\Oracle\Java Card Development Kit Simulator 3.1.0\samples\classic_applets\HelloWorld\applet\deliverables\HelloWorld\com\oracle\jcclassic\samples\helloworld\javacard\helloworld.jca
Verifier Error: Version number mismatch on imported package javacard/framework (AID a0:0:0:0:62:1:1):
imported version is 1.6, export file version is 1.5
Verification failed
[ INFO: ] conversion completed with 1 errors and 0 warnings.
"C:\Program Files\Java\jdk-11.0.10\bin\java" "-Djc.home=C:\java\java_card_tools-win-bin-b_108-06_jan_2021\bin\\.." -classpath "C:\java\java_card_tools-win-bin-b_108-06_jan_2021\bin\\..\lib\api_classic_annotations-3.1.0.jar;C:\java\java_card_tools-win-bin-b_108-06_jan_2021\bin\\..\lib\api_classic-3.1.0.jar;C:\java\java_card_tools-win-bin-b_108-06_jan_2021\bin\\..\lib\tools.jar;C:\java\java_card_tools-win-bin-b_108-06_jan_2021\bin\\..\lib\json.jar;C:\java\java_card_tools-win-bin-b_108-06_jan_2021\bin\\..\lib\jctasks_tools.jar;C:\java\java_card_tools-win-bin-b_108-06_jan_2021\bin\\..\lib\commons-logging-1.2-9f99a00.jar;C:\java\java_card_tools-win-bin-b_108-06_jan_2021\bin\\..\lib\commons-cli-1.4.jar;C:\java\java_card_tools-win-bin-b_108-06_jan_2021\bin\\..\lib\asm-8.0.1.jar;" com.sun.javacard.converter.Main -config "C:\Program Files (x86)\Oracle\Java Card Development Kit Simulator 3.1.0\samples\classic_applets\HelloWorld\applet\configurations\HelloWorld.conf"
Has anyone seen this, or any idea what it could be? I only have the basic install from "Guide" link.

Related

.NET Standard 2.0 Xamarin.iOS project VSTS build issue

Currently I'm trying to upgrade a Xamarin.Forms project to use .NET Standard 2.0. This went fine for Android but I'm getting stuck with the iOS version. To build iOS we use a On-Primise MacMini as build agent int VSTS. Now I'm getting the error below when building the solution.
=================================
.... way more erros like below ...
2017-11-21T11:39:43.8920830Z ViewModels/DashboardViewModel.cs(66,35): error CS0012: The type 'Object' is defined in an assembly that is not referenced. You must add a reference to assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. [/Users/Admin/BuildAgent/_work/3/s/xxx.App/xxx.Core.csproj]
2017-11-21T11:39:43.9014700Z ViewModels/DashboardViewModel.cs(66,73): error CS0012: The type 'Object' is defined in an assembly that is not referenced. You must add a reference to assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. [/Users/Admin/BuildAgent/_work/3/s/xxx.App/xxx.Core.csproj]
2017-11-21T11:39:43.9036150Z ViewModels/DashboardViewModel.cs(66,93): error CS0012: The type 'Object' is defined in an assembly that is not referenced. You must add a reference to assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. [/Users/Admin/BuildAgent/_work/3/s/xxx.App/xxx.Core.csproj]
2017-11-21T11:39:43.9053280Z
2017-11-21T11:39:43.9083060Z 6 Warning(s)
2017-11-21T11:39:43.9107960Z 47 Error(s)
2017-11-21T11:39:43.9116100Z
2017-11-21T11:39:43.9131830Z Time Elapsed 00:00:59.23
2017-11-21T11:39:43.9327960Z ##[error]Xamarin.iOS task failed with error Error: /Library/Frameworks/Mono.framework/Versions/Current/Commands/msbuild failed with return code: 1. For guidance on setting up the build definition, see https://go.microsoft.com/fwlink/?LinkId=760847.
2017-11-21T11:39:43.9575950Z [command]/usr/bin/security delete-keychain /Users/Admin/BuildAgent/_work/3/s/_xamariniostasktmp.keychain
2017-11-21T11:39:44.2658340Z ##[section]Finishing: Build Xamarin.iOS solution xxx.sln
=================================
This output comes from the following build definition:
Now I've searched the internet and found a view possible solutions:
Update Visual Studio on the MacMini
Update XCode on the MacMini
Install .NET Core 2.x SDK on the MacMini
Add .NET Standard 2.x NuGet package to Xamarin.IOS project
Add .NET Standard Library NuGet pre-release package to Xamarin.iOS project (not possible)
Manually reference netstandard.dll to the Xamarin.iOS project
Remove install argument (not using it)
But all of this was not enough to fix the issue. Now I'm not a expert in using a Mac. Actually I never touched one before this issue... So I might have done something wrong here...
But I've been able to get some version information about all products on the MacMini:
========= Visual Studio =========
Visual Studio Community 2017 for Mac
Version 7.2.2 (build 11)
Installation UUID: b43353ef-651c-468b-8b7d-3f1714586419
Runtime:
Mono 5.4.1.6 (2017-06/1f4613aa1ac) (64-bit)
GTK+ 2.24.23 (Raleigh theme)
Package version: 504010006
NuGet
Version: 4.3.1.4445
.NET Core
Runtime: /usr/local/share/dotnet/dotnet
Runtime Version: 2.0.3
SDK: /usr/local/share/dotnet/sdk/2.0.3/Sdks
SDK Version: 2.0.3
MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/5.4.1/lib/mono/msbuild/15.0/bin/Sdks
Xamarin.Profiler
Version: 1.5.6
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler
Xamarin.Android
Not Installed
Xamarin Inspector
Not Installed
Apple Developer Tools
Xcode 9.1 (13532)
Build 9B55
Xamarin.iOS
Version: 11.3.0.47 (Visual Studio Community)
Hash: 51128b8c
Branch: xcode9.1
Build date: 2017-10-31 22:42:13-0400
Xamarin.Mac
Xamarin.Mac not installed. Can't find /Library/Frameworks/Xamarin.Mac.framework/Versions/Current/Version.
Build Information
Release ID: 702020011
Git revision: b604c37c5a4a2f0919b45ffbe2aaad9fe040af31
Build date: 2017-11-01 08:31:43-04
Xamarin addins: d57dc14cbd4eb166ee62bab585965ab78d3650bc
Build lane: monodevelop-lion-d15-4
Operating System
Mac OS X 10.12.6
Darwin 16.7.0 Darwin Kernel Version 16.7.0
Wed Oct 4 00:17:00 PDT 2017
root:xnu-3789.71.6~1/RELEASE_X86_64 x86_64
============= XCode =============
XCode for Mac
Version 9.1 (9B55)
============= Mono ==============
Mono JIT compiler version 5.4.1.6 (2017-06/1f4613aa1ac Wed Oct 18 09:31:57 EDT 2017)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
TLS: normal
SIGSEGV: altstack
Notification: kqueue
Architecture: amd64
Disabled: none
Misc: softdebug
LLVM: yes(3.6.0svn-mono-master/8b1520c8aae)
GC: sgen (concurrent by default)
========= .NET Core SDK =========
.NET Core SDK
Version 2.0.3
=================================
The project can be build on the MacMini itself. Only the VSTS task keeps failing...
Does someone have any idea's left which can help me solve my issue?
Kind regards,
Jop
Everything started to work fine after we manually edited the .NET Standard 2.0 project file (*.csproj) and add a PackageReference by hand.
<ItemGroup>
...
<PackageReference Include="NETStandard.Library" version="2.0.0" />
...
</ItemGroup>

Unable to build NDK project from latest Android Studio (version 2.1.2, Windows 64 bit)

I am unable to build a NDK project from the Android Studio environment but can build it manually using the command console.
I get the following error after building:
Error:Execution failed for task ':xxxxxx:compileReleaseNdk'.> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Users\xxxxx\AppData\Local\Android\SDK\android-sdk\ndk-bundle\ndk-build.cmd'' finished with non-zero exit value 2
I got a similar error while invoking ndk-build.cmd manually using the console from the jni directory where my NDK project is stored.However I fixed it by modifying the following in my Application.mk file as follows:
NDK_TOOLCHAIN_VERSION := 4.9
since 4.9 is the tool chain available on my install. I suspect from the Android Studio environment, the toolchain version is being picked incorrectly, and yet I do not know where to set this option in the GUI.
The build.gradle file has the following NDK block:
ndk{
moduleName "xxxxxx"
ldLibs "log"
cFlags "-std=c++11 -fexceptions"
stl "gnustl_static"
abiFilters "arm64-v8a armeabi armeabi-v7a mips mips64 x86 x86_64"
}
Please advise me on how to go about solving this problem.
Just out of curiosity, I moved my project directory to the desktop and tried to build that project. The build was successful.
Finally narrowed down the problem to the NDK compiler not being able to create the following intermediate object file inside my project folder:
C:\Users\xxxxx\GitRepos\REVIEWS\xxx\SMART-xxx\xxxx-xxx-androidnative\xxxLibraries\xxxlibrary\build\intermediates\ndk\debug\obj/local/arm64-v8a/objs/natXXXX/C_\Users\xxxxx\GitRepos\REVIEWS\xxx\SMART-xxxx\xxxx-xxx-androidnative\xxxLibraries\xxxlibrary\src\main\jni\NativeXXXX.o.d
The reason was the well known windows path cannot exceed 255 characters issue. As you can see above the NDK-Build utility tries to append a deep folder hierarchy like "C_\Users\xxxxx\GitRepos\REVIEWS\xxx\SMART-xxxx\xxxx-xxx-androidnative\xxxLibraries\xxxlibrary\src\main\jni\" which exceeds MAX_PATH.

Cmake Visual Studio 2013 error

I am trying to run a simple program through cmake gui and I receive the following output. I am not really sure what the problem is and forgive me, because I am quite new to this. I have also uninstalled and installed visual studio 2012 and 2013 to see if that would make a difference. I am using Visual Studio 2013 as the compiler and get the following configuration error.
My environment is :
Windows 7 enterprise 64 bit
Cmake gui 2.8.12.2
Visual Studio 2013 Professional
The C compiler identification is MSVC 18.0.21005.1
The CXX compiler identification is MSVC 18.0.21005.1
Check for working C compiler using: Visual Studio 12
Check for working C compiler using: Visual Studio 12 -- broken
CMake Error at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:61 (message):
The C compiler "C:/Program Files (x86)/Microsoft Visual Studio
12.0/VC/bin/cl.exe" is not able to compile a simple test program.
It fails with the following output:
Change Dir: C:/Users/PM&R/Desktop/CMakeFiles/CMakeTmp
Run Build Command:C:\PROGRA~2\MSBuild\12.0\Bin\MSBuild.exe
cmTryCompileExec3676669247.vcxproj /p:Configuration=Debug
/p:VisualStudioVersion=12.0
Microsoft (R) Build Engine version 12.0.21005.1
[Microsoft .NET Framework, version 4.0.30319.18444]
Copyright (C) Microsoft Corporation. All rights reserved.
Build started 3/31/2014 2:27:43 PM.
Project
"C:\Users\PM&R\Desktop\CMakeFiles\CMakeTmp\cmTryCompileExec3676669247.vcxproj"
on node 1 (default targets).
C:\Users\PM&R\Desktop\CMakeFiles\CMakeTmp\cmTryCompileExec3676669247.vcxproj(60,85):
error MSB4025: The project file could not be loaded. An error occurred
while parsing EntityName. Line 60, position 85.
Done Building Project
"C:\Users\PM&R\Desktop\CMakeFiles\CMakeTmp\cmTryCompileExec3676669247.vcxproj"
(default targets) -- FAILED.
Build FAILED.
"C:\Users\PM&R\Desktop\CMakeFiles\CMakeTmp\cmTryCompileExec3676669247.vcxproj"
(default target) (1) ->
C:\Users\PM&R\Desktop\CMakeFiles\CMakeTmp\cmTryCompileExec3676669247.vcxproj(60,85): error MSB4025: The project file could not be loaded. An error occurred while parsing EntityName. Line 60, position 85.
0 Warning(s)
1 Error(s)
Time Elapsed 00:00:00.02
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:2 (project)
Configuring incomplete, errors occurred!
See also "C:/Users/PM&R/Desktop/CMakeFiles/CMakeOutput.log".
See also "C:/Users/PM&R/Desktop/CMakeFiles/CMakeError.log".
Try to generate build system in the folder C:/Tmp to test if the problem is related to corrupted cache or path issues. To build it to the folder stated in the question:
Check that you do have write permission in "PM&R" personal folders
Remove cmake cache when you change the generator

Inf2Cat error when compile sample code from "Windows Driver Kit (WDK) 8.0 Samples"

When I used Visual Studio 2012 and WinDDK 8.0 to compile sample code "Kernel mode display-only miniport driver (KMDOD) sample" from package "Windows Driver Kit (WDK) 8.0 Samples" downloaded from msdn wdk 8.0 sample, I got the following errors:
Error 1 error -1: "Inf2Cat, unknown failure." Double click to see the tool output.
The output file is "inf2catOutput.log", and the content is:
Inf2Cat Tool Output:
.....................
Signability test complete.
Errors:
None
Warnings:
None
Unable to save the catalog.
Signability test failed.
The content of the output pane is:
1>------ Build started: Project: SampleDisplay, Configuration: Win8 Debug Win32 ------
1> Stamping Win8Debug\sampledisplay.inf [Version] section with DriverVer=08/20/2013,16.42.4.37
1> BDD.cxx
1> BDD_DDI.cxx
1> BDD_DMM.cxx
1> BDD_Util.cxx
1> BltFuncs.cxx
1> BltHw.cxx
1> memory.cxx
1> Generating Code...
1> SampleDisplay.vcxproj -> S:_src\Kernel mode display-only miniport driver (KMDOD) sample\Solution\Sample\Win8Debug\SampleDisplay.sys
1> Done Adding Additional Store
1> Successfully signed: S:_src\Kernel mode display-only miniport driver (KMDOD) sample\Solution\Sample\Win8Debug\SampleDisplay.sys
1>
2>------ Build started: Project: package (Package\package), Configuration: Win8 Debug Win32 ------
2> .....................
2> Signability test complete.
2>
2> Errors:
2> None
2>
2> Warnings:
2> None
2>
2> Unable to save the catalog.
2> Signability test failed.
2>Win8Debug\inf2catOutput.log : Inf2Cat error -1: "Inf2Cat, unknown failure." Double click to see the tool output.
I haven't changed any of the settings or code in the sample, I just opened the solution then tried to build the code. any configurations or platforms will result in the same error.
Any suggestion is appreciated. Thanks!
I had the same problem. The cause of this problem was the update http://support.microsoft.com/kb/2862973/ with the description "Update for deprecation of MD5 hashing algorithm for Microsoft root certificate program".
With this update MD5 hashes are no longer valid to:
server authentication
code signing
time stamping
That means that if your inf2cat uses MD5 hashes to check the integrity of contained files, it will fail.
The solution is to download WDK 8.1 and use the new version of inf2cat.
I had the same problem. In my case the problem only occurred when I did builds for windows 8. Windows 7 builds did not have the issue.
The problem is caused by a Microsoft update - http://support.microsoft.com/?kbid=2862966
I removed the fix, disabled updates and my builds are working again.
FWIW, here is a link to the discussion where I found this info - https://www.osronline.com/ShowThread.cfm?link=246887

Install Shield LE - Error 6058 ... merging Visual C++ 10.0 CRT in 64bit

I'm trying to compile an install shield project. It's a 64 bit program.
I keep getting this error, although it does compile OK and installs OK:
Error 16 -6058: Error merging Visual C++ 10.0 CRT (IA64) with module ID C:\Program Files (x86)\Common Files\Merge Modules\Microsoft_VC100_CRT_ia64.msm ISEXP : error : -6058: Error merging Visual C++ 10.0 CRT (IA64) with module ID C:\Program Files (x86)\Common Files\Merge Modules\Microsoft_VC100_CRT_ia64.msm
Any idea how can tell it NOT to try and merge ? (I can let it install the CRT ad a redistributable instead)
Ok, so it's like this:
Was detected as a dependency by mistake:
Adding merge module 'Visual C++ 10.0
CRT (IA64)' that is a dependency of
component
'MyProjectName.Primary_output'
So you go to:
Specify application Data -> Files
Right click on the specified project that had the dependency.
Choose Dependencies from scan at build.. find that unwanted file, and uncheck it.
Some Installshield products (2010, 2011 at least) appear to have an issue scanning managed (/clr) c++ modules that use the 10.0 CRT, even for 32-bit-only projects. In those cases the IA64 msm gets added to the project, producing "error -5008: Intel64 or AMD64 must be specified in the template of the Summary Stream". Yochai's fix cured that too. I have not seen this issue for native c++ code.

Resources