From d855cc609099b72a0bb20fafb87da79a5478068d Mon Sep 17 00:00:00 2001 From: Thomas <> Date: Thu, 22 Jun 2023 21:14:21 +0200 Subject: fix(core): update cpxlevel validation lib to solve wrong key-usage validation --- moaSig/libs/iaik_cpxlevel-0.9.1_moa.jar | Bin 139207 -> 0 bytes moaSig/moa-sig-lib/build.gradle | 2 ++ .../egovernment/moa/spss/util/AdESResultUtils.java | 6 +++++- .../test/integration/PadesIntegrationTest.java | 23 ++++++++++++++++++++- 4 files changed, 29 insertions(+), 2 deletions(-) delete mode 100644 moaSig/libs/iaik_cpxlevel-0.9.1_moa.jar diff --git a/moaSig/libs/iaik_cpxlevel-0.9.1_moa.jar b/moaSig/libs/iaik_cpxlevel-0.9.1_moa.jar deleted file mode 100644 index 0bbbf6e..0000000 Binary files a/moaSig/libs/iaik_cpxlevel-0.9.1_moa.jar and /dev/null differ diff --git a/moaSig/moa-sig-lib/build.gradle b/moaSig/moa-sig-lib/build.gradle index 8774567..07f0c93 100644 --- a/moaSig/moa-sig-lib/build.gradle +++ b/moaSig/moa-sig-lib/build.gradle @@ -12,6 +12,8 @@ dependencies { testImplementation project(path: ':common', configuration: 'testArtifacts') api fileTree(dir: '../libs', include: '*.jar') + //api fileTree(dir: '../libs_debug', include: '*.jar') + api group: 'at.gv.egovernment.moa.sig', name: 'tsl-lib', version: '2.1.1' api 'commons-logging:commons-logging:1.2' api 'commons-io:commons-io:2.11.0' diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/util/AdESResultUtils.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/util/AdESResultUtils.java index 23570cc..8e37b1c 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/util/AdESResultUtils.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/util/AdESResultUtils.java @@ -112,7 +112,11 @@ public class AdESResultUtils { minorInfo = "ERROR"; } else if (resultCode.getCode().equals(ResultCode.UNKNOWN_SUBFILTER)) { minorInfo = "UNKNOWN_SUBFILTER"; - + } else if (resultCode.getCode().equals(ResultCode.CODE_NO_SIGNER_CERTIFICATE_FOUND)) { + minorInfo = "NO_SIGNER_CERTIFICATE_FOUND"; + + + // pdf-as 3.x detection is removed from MOA-SP since 3.1.2 } else if (resultCode.getCode().equals(ResultCode.PDF_AS_SIGNATURE)) { // minorInfo = "PDF_AS_SIGNATURE"; diff --git a/moaSig/moa-sig/src/test/java/at/gv/egovernment/moa/spss/test/integration/PadesIntegrationTest.java b/moaSig/moa-sig/src/test/java/at/gv/egovernment/moa/spss/test/integration/PadesIntegrationTest.java index e90a9a1..e210ddf 100644 --- a/moaSig/moa-sig/src/test/java/at/gv/egovernment/moa/spss/test/integration/PadesIntegrationTest.java +++ b/moaSig/moa-sig/src/test/java/at/gv/egovernment/moa/spss/test/integration/PadesIntegrationTest.java @@ -170,6 +170,8 @@ public class PadesIntegrationTest extends AbstractIntegrationTest { } + + @Ignore @Test public void padesLteTest() throws MOAException, IOException { @@ -184,6 +186,26 @@ public class PadesIntegrationTest extends AbstractIntegrationTest { // verify result assertNotNull("verification result", result); + + + } + + + @Test + public void padesAmtssignatur() throws MOAException, IOException { + final VerifyCMSSignatureRequest request = buildVerfifyCmsRequest( + IOUtils.resourceToByteArray("/testdata/pades/TestAmtssignatur_Sign.pdf"), + "MOAIDBuergerkarteAuthentisierungsDaten", + true, + true); + + + // perform test + final VerifyCMSSignatureResponse result = cadesInvoker.verifyCMSSignature(request); + + // verify result + assertNotNull("verification result", result); + } @@ -226,5 +248,4 @@ public class PadesIntegrationTest extends AbstractIntegrationTest { } - } -- cgit v1.2.3