Giter Site home page Giter Site logo

emv-bertlv's People

Contributors

dependabot[bot] avatar kikju avatar maciej7777 avatar premek avatar wcurrie avatar wcurrietyro avatar

Stargazers

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

Watchers

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

emv-bertlv's Issues

Cannot parse an empty data source

In the scenario where the data source is empty the library crashes throwing Method java.lang.IndexOutOfBoundsException exception.

Code used to test this:

assertNull(BerTlv.parse("".toByteArray()))

I think this can be easily fixed by this change in the BerTlv.java class:

@JvmStatic
fun parse(data: ByteArray): BerTlv {
      if (data.isNotEmpty()) {
        return parseList(ByteBuffer.wrap(data), true)[0]
    } else {
        null
    }
}

SnakeYml 2.0 incompatibility

Because SnakeYaml due to https://www.cve.org/CVERecord?id=CVE-2022-1471 has been updated and in version 2.0 does not support class Constructor with an empty constructor, it's not possible to update SnakeYaml to 2.0 version.
Trying to update SnakeYaml in a project using emv library results with error:

Exception in thread "main" java.lang.NoSuchMethodError: org.yaml.snakeyaml.constructor.Constructor: method 'void <init>()' not found
	at io.github.binaryfoo.TagMetaData$Companion.load(TagMetaData.kt:70)
	at io.github.binaryfoo.TagMetaData.load(TagMetaData.kt)
	at io.github.binaryfoo.EmvTags.<clinit>(EmvTags.java:9)
	at org.test.EmvTagsChecker.main(EmvTagsChecker.java:8)

ClassnotFoundException CryptogramInformationDecoder

Hi!, i´m getting this error when i´m trying to decode ( using the "decode" method in RootDecoder class ). This seems to be an issue of ofuscation apparently.

It is possibly a bug ?.

           `Caused by: java.lang.ClassNotFoundException: io.github.binaryfoo.decoders.CryptogramInformationDecoder
                                                                                                	at java.lang.Class.classForName(Native Method)
                                                                                                	at java.lang.Class.forName(Class.java:454)
                                                                                                	at java.lang.Class.forName(Class.java:379)
                                                                                                	at io.github.binaryfoo.TagMetaData$Companion.load(TagMetaData.kt:86)
                                                                                                	at io.github.binaryfoo.TagMetaData.load(Unknown Source:2)
                                                                                                	at io.github.binaryfoo.EmvTags.<clinit>(EmvTags.java:9)
                                                                                                	at io.github.binaryfoo.RootDecoder.<clinit>(RootDecoder.kt:40) 
                                                                                                	at com.geopagos.cps.others.tlv.TlvHelper.getTlvs(Unknown Source:5) 
                                                                                                	at com.geopagos.reader.magicpos.wrapper.MagicPosServiceAdapter$magicPosCallback$1.processNfcTradeResult(MagicPosServiceAdapter.kt:772) 
                                                                                                	at com.geopagos.reader.magicpos.wrapper.MagicPosServiceAdapter$magicPosCallback$1.onDoPollCardResult(MagicPosServiceAdapter.kt:579) 
                                                                                                	at com.magicpos.xpos.MPOSService$31.run(MPOSService.java:7457) 
                                                                                                	at android.os.Handler.handleCallback(Handler.java:978) 
                                                                                                	at android.os.Handler.dispatchMessage(Handler.java:104) 
                                                                                                	at android.os.Looper.loopOnce(Looper.java:238) 
                                                                                                	at android.os.Looper.loop(Looper.java:357) 
                                                                                                	at android.app.ActivityThread.main(ActivityThread.java:8098) 
                                                                                                	at java.lang.reflect.Method.invoke(Native Method) 
                                                                                                	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548) 
                                                                                                	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1026) 
                                                                                                Caused by: java.lang.ClassNotFoundException: Didn't find class "io.github.binaryfoo.decoders.CryptogramInformationDecoder" on path: DexPathList[[zip file "/data/app/~~PPOTaQP2cMfkagmY4r_CEQ==/`                               

NullPointerException thrown when unpacking data

Trying to decode the following TLV string, cloned from a working chip card, a NPE is thrown. Parsing the same data using BP-TOOLS EMV tool seems to handle it fine, as does splitting the original string up into two separate substrings (and updating the length bytes).

"709157134761739001010119D22122011143804400000F5F201A5541542041544D2F5465737420436172642030352020202020205F300202019F1F183131343338303434303030303030303030303030303030309F080200969F4401028C159F02069F03069F1A0295055F2A029A039C019F37048D178A029F02069F03069F1A0295055F2A029A039C019F37049F49039F3704"

Fails with:
raw=[Error] decoded=[Failed parsing TLV with tag 70: Bad length: -1878982400 < 0. Read 8 of 17 (0x91) bytes used to encode length of TLV.] indexes=[0,147]

Kotlin compiler version out of date

I don't know if I am at the right place but I'm trying to use your fabulous project but I'm stuck with a compiler error.

For example, in DecodedData.class I have this message when I try to open file :

// This class file was compiled with different version of Kotlin compiler and can't be decompiled.
//
// Current compiler ABI version is 1.0.1
// File ABI version is 0.19.0

I'm working on IntelliJ.

Have you got any idea to solve this issue ?

Library has Kotlin runtime bundled into it

If I use the jar in an Android Studio project I have the following issue:

...app/libs/emv-bertlv-0.1.7-shaded.jar: Library has Kotlin runtime bundled into it  

It's a compile error because the jar it has the runtime libs of kotlin.

"Please note that you should not include kotlin-runtime and kotlin-stdlib jars with your plugin because Kotlin guarantees backward- and forward- binary compatibility."

http://www.jetbrains.org/intellij/sdk/docs/tutorials/kotlin.html

I hope you can fix it or provide a version without the dependency (an not executable version), and thank you so much for the amazing lib.

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.