binaryfoo / emv-bertlv Goto Github PK
View Code? Open in Web Editor NEWDeciphering EMV data encoded in the not so basic "basic encoding rules".
License: MIT License
Deciphering EMV data encoded in the not so basic "basic encoding rules".
License: MIT License
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
}
}
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)
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==/`
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]
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 ?
The deprecated Loader and Dumper are gone in snakeyaml 1.16. Play framework depends on snakeyaml 1.16. Time to clean up.
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.