Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't execute card analyzer tool #3

Open
NathanBnm opened this issue Sep 16, 2024 · 6 comments
Open

Can't execute card analyzer tool #3

NathanBnm opened this issue Sep 16, 2024 · 6 comments

Comments

@NathanBnm
Copy link

I have an issue when executing the card analyzer tool. Here is my terminal output:

> java -jar Tool_AnalyzeCardFileStructure-2.0.3.jar
[09:09:30:053] [main] [INFO] SmartCardServiceAdapter - Register plugin [PcscPlugin]
Exception in thread "main" java.lang.IllegalStateException: Reader '.*(ASK.*|Identiv.*2|ACS ACR122U|SCR3310).*' not found in plugin 'PcscPlugin'
	at org.calypsonet.tool.calypso.common.ToolUtils.getCardReaderName(ToolUtils.java:55)
	at org.calypsonet.tool.calypso.card.Tool_AnalyzeCardFileStructure.initReaders(Tool_AnalyzeCardFileStructure.java:242)
	at org.calypsonet.tool.calypso.card.Tool_AnalyzeCardFileStructure.main(Tool_AnalyzeCardFileStructure.java:265)

Are there any prerequisites in order to be able to execute the script?

I'm running on macOS with OpenJDK 17.0.11

@jeanpierrefortune
Copy link
Member

jeanpierrefortune commented Sep 16, 2024

Hi Nathan,

The reader selection is based on the use of a regular expression applied to its name.
As the exception log shows, the default value of this expression may not correspond to the name of your reader.
If this is the case, you can replace the default value by passing another expression as a command line argument.
If you only have one reader, this could be “.*”.

See
https://github.com/calypsonet/calypso-card-analyzer?tab=readme-ov-file#using-the-calypso-card-analyzer-jar
and

Keep us posted.

@NathanBnm
Copy link
Author

NathanBnm commented Sep 16, 2024

Thanks for your help my card reader is now properly detected. Unfortunately I still get an exception while trying to read my Calypso card:

> java -jar Tool_AnalyzeCardFileStructure-2.0.3.jar ".*"
[10:51:12:987] [main] [INFO] SmartCardServiceAdapter - Register plugin [PcscPlugin]
[10:51:13:026] [main] [INFO] ToolUtils - Card reader, plugin; PcscPlugin, name: Generic Smart Card Reader Interface
[10:51:13:026] [main] [INFO] Tool_AnalyzeCardFileStructure - = Card Reader  NAME = Generic Smart Card Reader Interface
[10:51:13:657] [main] [WARN] Tool_AnalyzeCardFileStructure - Traceability information tag not available: A card command error occurred while processing responses to card commands: GET_DATA
Transaction audit JSON data: {"targetSmartCard":{"selectApplicationResponse":{"apdu":"6F228408334D54522E494341A516BF0C13C70800000000036D5D045307062801022012219000","statusWord":"9000"},"isExtendedModeSupported":false,"isRatificationOnDeselectSupported":false,"isSvFeatureAvailable":false,"isPinFeatureAvailable":true,"isPkiModeSupported":false,"isDfInvalidated":false,"calypsoCardClass":"LEGACY","calypsoSerialNumber":"00000000036D5D04","startupInfo":"06280102201221","productType":"PRIME_REVISION_2","dfName":"334D54522E494341","modificationsCounterMax":"06","isModificationCounterInBytes":false,"files":[],"filesBackup":[],"svLastTNum":"00","svLastTNumBackup":"00","isHce":false,"svKvc":"00","applicationSubType":"02","applicationType":"01","sessionModification":"06","payloadCapacity":"80","isCounterValuePostponed":false,"isLegacyCase1":false},"apdus":["94CA018500","6D00"]}
Exception in thread "main" org.eclipse.keypop.calypso.card.transaction.SelectFileException: File not found
	at org.eclipse.keyple.card.calypso.CommandSelectFile.parseResponse(CommandSelectFile.java:238)
	at org.eclipse.keyple.card.calypso.TransactionManagerAdapter.parseCommandResponse(TransactionManagerAdapter.java:240)
	at org.eclipse.keyple.card.calypso.TransactionManagerAdapter.executeCardCommands(TransactionManagerAdapter.java:207)
	at org.eclipse.keyple.card.calypso.FreeTransactionManagerAdapter.processCommands(FreeTransactionManagerAdapter.java:129)
	at org.eclipse.keyple.card.calypso.FreeTransactionManagerAdapter.processCommands(FreeTransactionManagerAdapter.java:28)
	at org.calypsonet.tool.calypso.card.Tool_AnalyzeCardFileStructure.getApplicationData(Tool_AnalyzeCardFileStructure.java:157)
	at org.calypsonet.tool.calypso.card.Tool_AnalyzeCardFileStructure.getApplicationsData(Tool_AnalyzeCardFileStructure.java:232)
	at org.calypsonet.tool.calypso.card.Tool_AnalyzeCardFileStructure.main(Tool_AnalyzeCardFileStructure.java:295)
Caused by: org.eclipse.keyple.card.calypso.CardDataAccessException: File not found
	at org.eclipse.keyple.card.calypso.Command.buildCommandException(Command.java:491)
	at org.eclipse.keyple.card.calypso.Command.checkStatus(Command.java:474)
	at org.eclipse.keyple.card.calypso.Command.setApduResponseAndCheckStatus(Command.java:390)
	at org.eclipse.keyple.card.calypso.CommandSelectFile.parseResponse(CommandSelectFile.java:236)
	... 7 more

Is my card not supported by the analyzer tool?

@jeanpierrefortune
Copy link
Member

Hi Nathan,
The card may indeed have a file structure that's incompatible with the tool.
Could you please give us the complete stacktrace, as we can't see the details of the origin of the problem here.

@NathanBnm
Copy link
Author

The card I'm trying to read is my public transport Calypso card. It has the same structure as the Paris Navigo card.

I don't have any further stack trace it is the only output I get in the terminal.

@jeanpierrefortune
Copy link
Member

Have you tried running the program in verbose mode?
java -jar Tool_AnalyzeCardFileStructure-2.0.3.jar “ .* ” --debug
By the way, I guess you have an old Calypso card, maybe revision 1, which is not supported by this tool.

@NathanBnm
Copy link
Author

I tried java -verbose -jar Tool_AnalyzeCardFileStructure-2.0.3.jar ".*" but it does not give more details about the error.

By the way, I guess you have an old Calypso card, maybe revision 1, which is not supported by this tool.

Is there any way to check that? I know my card has been issued in 2018 and expires in 2025.
If you have a way to identify old version maybe you could add a check with an error message to the tool.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants