Git Product home page Git Product logo

nfc4pc's Introduction

1674679905811

Hi there ๐Ÿ‘‹

This is Martin from ๐Ÿ‡ช๐Ÿ‡ช Estonia ๐Ÿ‡ช๐Ÿ‡บ. Every now and then I push code to Github, that scratches my own itches (remembering Kerckhoff's principle!).

Most probably you're here because of the "open source javacard software development toolkit" that consists of

๐Ÿ›œ NFC/NDEF and ๐Ÿ”‘ FIDO/WebAuthn are topics where you can expect developments in 2024.

There are also historical bits and pieces related to generic smart cards (PC/SC, CCID) and crypto with Java/JavaScript/PKCS#11, and Estonian eID and identity (OpenID etc) in general.

When it comes to Estonian eID, most of what I worked on has been continued by others: @OpenSC (open source PKCS#11 and native platform crypto drivers for smart cards), @web-eid (modern WebExtensions based authentication and signing for desktop browsers) and @open-eid (ages ago I pushed Estonia to publish (most of) it's eID client software as open source)

Feel free to ๐Ÿ’ฌ book a call if you have any questions or ongoing projects in these domains or to ๐Ÿ™ sponsor my open source work!

News

[Google Open Source Peer Bonus for GlobalPlatformPro]

nfc4pc's People

Contributors

martinpaljak avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

nfc4pc's Issues

feature: UID-URL opener

Goal: when a tag is detected and reader is capable of reading the UID of the chip, but no NDEF payload (again, type 4 only currently) is detected, open a pre-defined URI with the UID of the chip appended as query parameter in small case hex.

That is:

  • If the daemon is started with parameter --uid-url https://example.com/foo#bar and the UID of the chip presented to a reader is 046B477AB92980, the following URL will be triggered: https://example.com/foo?uid=046b477ab92980#bar
  • This will work independently of the tag technology with most readers, meaning that even if currently NTAG NDEF values are not read, the UID is still available and would trigger the URL opening

Possible enhancements:

  • Do a silent triggering with --silent-uid - only show the notification, but don't open the browser, only send a "webhook" (PROBABLY)
  • Add basic/api key authentication to the request (PROBABLY)
  • Add GUI to change the UID URL and silent option (MAYBE)

URl gets doubleencoded

When using Meta-URL the URL Parameter 'url' gets encoded into URL String twice. This results in an wrong encoding

Example:
URL to encode: https://google.com
correctly encoded URL: https%3A%2F%2Fgoogle.com
Encoding from this tool: https%253A%252F%252Fgoogle.com

Maybe it is resulting from this issue: https://bz.apache.org/bugzilla/show_bug.cgi?id=39746

Workaround for me is to decode the URL twice on the receiving end.

Without checking the code out. Maybe the issue is in the class "NFC4PC" where you encode the URL on Line 153 and then add it to the URL with the method "appendUri" in that method you write that the append String will be URL encoded. That would mean that the URL gets encoded twice and would explain the behaviour.

Error reading tags

Seems regardless of the tag type I use (tried with Classic 1K, NTAG213 and NTAG424), I get the following error as soon as I tap it:

22:40:44:508 [ACS ACR122 0] [ERROR] NFCReader - Could not connect to or read: newPosition < 0: (-2 < 0)
java.lang.IllegalArgumentException: newPosition < 0: (-2 < 0)
at java.base/java.nio.Buffer.createPositionException(Buffer.java:341)
at java.base/java.nio.Buffer.position(Buffer.java:316)
at java.base/java.nio.ByteBuffer.position(ByteBuffer.java:1516)
at jnasmartcardio.Smartcardio$JnaCardChannel.transmitImpl(Smartcardio.java:809)
at jnasmartcardio.Smartcardio$JnaCardChannel.transmit(Smartcardio.java:690)
at apdu4j.pcsc.CardBIBO.transceive(CardBIBO.java:130)
at apdu4j.core.APDUBIBO.transmit(APDUBIBO.java:35)
at pro.javacard.nfc4pc.NDEF.getType2(NDEF.java:42)
at pro.javacard.nfc4pc.NFCReader.tryToRead(NFCReader.java:120)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:833)
WARNING: Could not read: newPosition < 0: (-2 < 0)

I am using a ACR-122U reader. What could be causing this?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.