From dcb5ae4df6f3a70a1c3c4e215818d6c416af3c6e Mon Sep 17 00:00:00 2001 From: Till Neunast Date: Thu, 12 Sep 2024 13:26:09 +1200 Subject: [PATCH 1/3] Fix CVN18 ARQC padding method --- .../main/java/org/jpos/emv/cryptogram/CVN18DataBuilder.java | 2 +- .../java/org/jpos/emv/cryptogram/CVN18DataBuilderTest.java | 2 +- .../java/org/jpos/emv/cryptogram/CVN22DataBuilderTest.java | 5 +++++ .../java/org/jpos/emv/cryptogram/CVNMCDataBuilderTest.java | 4 ++++ 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/jpos/src/main/java/org/jpos/emv/cryptogram/CVN18DataBuilder.java b/jpos/src/main/java/org/jpos/emv/cryptogram/CVN18DataBuilder.java index a7afa712c9..3415e4ce1e 100644 --- a/jpos/src/main/java/org/jpos/emv/cryptogram/CVN18DataBuilder.java +++ b/jpos/src/main/java/org/jpos/emv/cryptogram/CVN18DataBuilder.java @@ -50,6 +50,6 @@ public String buildARQCRequest(TLVList data, IssuerApplicationData iad) { @Override public PaddingMethod getPaddingMethod() { - return PaddingMethod.ISO9797Method1; + return PaddingMethod.ISO9797Method2; } } diff --git a/jpos/src/test/java/org/jpos/emv/cryptogram/CVN18DataBuilderTest.java b/jpos/src/test/java/org/jpos/emv/cryptogram/CVN18DataBuilderTest.java index 10a4e19def..9d4131a753 100644 --- a/jpos/src/test/java/org/jpos/emv/cryptogram/CVN18DataBuilderTest.java +++ b/jpos/src/test/java/org/jpos/emv/cryptogram/CVN18DataBuilderTest.java @@ -57,7 +57,7 @@ void testBuildARQCRequest() { ); assertEquals( - "00000000010000000000000008400000000000084018123101ABCDEF101800000106011203000000", + "00000000010000000000000008400000000000084018123101ABCDEF1018000001060112030000008000000000000000", builder.buildARQCRequest_padded(data, iad) ); diff --git a/jpos/src/test/java/org/jpos/emv/cryptogram/CVN22DataBuilderTest.java b/jpos/src/test/java/org/jpos/emv/cryptogram/CVN22DataBuilderTest.java index 3266b91824..cc8d512de1 100644 --- a/jpos/src/test/java/org/jpos/emv/cryptogram/CVN22DataBuilderTest.java +++ b/jpos/src/test/java/org/jpos/emv/cryptogram/CVN22DataBuilderTest.java @@ -55,5 +55,10 @@ void testBuildARQCRequest() { "00000000010000000000000008400000000000084018123101ABCDEF10180000011F22010300000000000000000000000000000000000000000000000000000000", builder.buildARQCRequest(data, iad) ); + + assertEquals( + "00000000010000000000000008400000000000084018123101ABCDEF10180000011F2201030000000000000000000000000000000000000000000000000000000080000000000000", + builder.buildARQCRequest_padded(data, iad) + ); } } diff --git a/jpos/src/test/java/org/jpos/emv/cryptogram/CVNMCDataBuilderTest.java b/jpos/src/test/java/org/jpos/emv/cryptogram/CVNMCDataBuilderTest.java index 427ce5a943..f26d98e6ac 100644 --- a/jpos/src/test/java/org/jpos/emv/cryptogram/CVNMCDataBuilderTest.java +++ b/jpos/src/test/java/org/jpos/emv/cryptogram/CVNMCDataBuilderTest.java @@ -53,6 +53,10 @@ void buildARPCRequest() { "000000010000000000001000084000000010800840980704001111111158003456608003220000", builder.buildARQCRequest(data, iad) ); + assertEquals( + "00000001000000000000100008400000001080084098070400111111115800345660800322000080", + builder.buildARQCRequest_padded(data, iad) + ); } From 6a2927dff0c3379dce0a99fc38cdc376ee67ed2c Mon Sep 17 00:00:00 2001 From: Till Neunast Date: Sat, 14 Sep 2024 08:03:13 +1200 Subject: [PATCH 2/3] Dummy change to trigger rebuild --- .../test/java/org/jpos/emv/cryptogram/CVN22DataBuilderTest.java | 1 - 1 file changed, 1 deletion(-) diff --git a/jpos/src/test/java/org/jpos/emv/cryptogram/CVN22DataBuilderTest.java b/jpos/src/test/java/org/jpos/emv/cryptogram/CVN22DataBuilderTest.java index cc8d512de1..38b2e77dab 100644 --- a/jpos/src/test/java/org/jpos/emv/cryptogram/CVN22DataBuilderTest.java +++ b/jpos/src/test/java/org/jpos/emv/cryptogram/CVN22DataBuilderTest.java @@ -55,7 +55,6 @@ void testBuildARQCRequest() { "00000000010000000000000008400000000000084018123101ABCDEF10180000011F22010300000000000000000000000000000000000000000000000000000000", builder.buildARQCRequest(data, iad) ); - assertEquals( "00000000010000000000000008400000000000084018123101ABCDEF10180000011F2201030000000000000000000000000000000000000000000000000000000080000000000000", builder.buildARQCRequest_padded(data, iad) From 6e4cd080a0134a599bf46e6a896513727ec05eb3 Mon Sep 17 00:00:00 2001 From: Till Neunast Date: Sat, 14 Sep 2024 08:10:00 +1200 Subject: [PATCH 3/3] Dummy change to trigger rebuild --- .../java/org/jpos/emv/cryptogram/CVN10DataBuilderTest.java | 3 --- .../java/org/jpos/emv/cryptogram/CVN18DataBuilderTest.java | 3 --- .../java/org/jpos/emv/cryptogram/CVNCPADataBuilderTest.java | 1 - .../java/org/jpos/emv/cryptogram/CVNMCDataBuilderTest.java | 2 -- 4 files changed, 9 deletions(-) diff --git a/jpos/src/test/java/org/jpos/emv/cryptogram/CVN10DataBuilderTest.java b/jpos/src/test/java/org/jpos/emv/cryptogram/CVN10DataBuilderTest.java index 495931b1c1..45df5bac57 100644 --- a/jpos/src/test/java/org/jpos/emv/cryptogram/CVN10DataBuilderTest.java +++ b/jpos/src/test/java/org/jpos/emv/cryptogram/CVN10DataBuilderTest.java @@ -55,12 +55,9 @@ void testBuildARQCRequest() { "00000000010000000000000008400000000000084018123101ABCDEF101800000203000000", builder.buildARQCRequest(data, iad) ); - assertEquals( "00000000010000000000000008400000000000084018123101ABCDEF101800000203000000000000", builder.buildARQCRequest_padded(data, iad) ); - - } } diff --git a/jpos/src/test/java/org/jpos/emv/cryptogram/CVN18DataBuilderTest.java b/jpos/src/test/java/org/jpos/emv/cryptogram/CVN18DataBuilderTest.java index 9d4131a753..7e81b9bc47 100644 --- a/jpos/src/test/java/org/jpos/emv/cryptogram/CVN18DataBuilderTest.java +++ b/jpos/src/test/java/org/jpos/emv/cryptogram/CVN18DataBuilderTest.java @@ -55,12 +55,9 @@ void testBuildARQCRequest() { "00000000010000000000000008400000000000084018123101ABCDEF101800000106011203000000", builder.buildARQCRequest(data, iad) ); - assertEquals( "00000000010000000000000008400000000000084018123101ABCDEF1018000001060112030000008000000000000000", builder.buildARQCRequest_padded(data, iad) ); - - } } diff --git a/jpos/src/test/java/org/jpos/emv/cryptogram/CVNCPADataBuilderTest.java b/jpos/src/test/java/org/jpos/emv/cryptogram/CVNCPADataBuilderTest.java index 5314e0f6bc..622332da45 100644 --- a/jpos/src/test/java/org/jpos/emv/cryptogram/CVNCPADataBuilderTest.java +++ b/jpos/src/test/java/org/jpos/emv/cryptogram/CVNCPADataBuilderTest.java @@ -34,7 +34,6 @@ void testBuildARQCRequest() { "0000000100000000000010000840000000108008409807040011111111580034560FA500A03800000000000000000000000F010000000000000000000000000000", builder.buildARQCRequest(data, iad) ); - assertEquals( "0000000100000000000010000840000000108008409807040011111111580034560FA500A03800000000000000000000000F01000000000000000000000000000080000000000000", builder.buildARQCRequest_padded(data, iad) diff --git a/jpos/src/test/java/org/jpos/emv/cryptogram/CVNMCDataBuilderTest.java b/jpos/src/test/java/org/jpos/emv/cryptogram/CVNMCDataBuilderTest.java index f26d98e6ac..03ff660056 100644 --- a/jpos/src/test/java/org/jpos/emv/cryptogram/CVNMCDataBuilderTest.java +++ b/jpos/src/test/java/org/jpos/emv/cryptogram/CVNMCDataBuilderTest.java @@ -57,8 +57,6 @@ void buildARPCRequest() { "00000001000000000000100008400000001080084098070400111111115800345660800322000080", builder.buildARQCRequest_padded(data, iad) ); - } - }