From 2b70ab18a97dd248d478d985ae602bd7e3a9d320 Mon Sep 17 00:00:00 2001 From: Andreas Fitzek Date: Fri, 28 Nov 2014 11:04:46 +0100 Subject: Logging Error Levels adapted --- ...0c12b16dc63efa3bfc53fb580b20de5a56f6f86f.tmppdf | Bin 0 -> 6257 bytes ...651beb1a92f9313e46752667ad2caad8e55cc785.tmppdf | Bin 0 -> 6257 bytes ...5990344a0c25a1998c13b80fb54163df279ab0b3.tmppdf | Bin 0 -> 6257 bytes ...3db03bf642b2dfefb9d5e9c4685b6bf4d2801347.tmppdf | Bin 0 -> 6257 bytes ...fdf2688a1a93fbf4759ddc444275ae38e03fa86e.tmppdf | Bin 0 -> 6257 bytes ...02591ca7b2fa3dabd5041f8a3f21e867d0cc0591.tmppdf | Bin 0 -> 6257 bytes ...e6b460a6ddc28c62c6a04f78bff877cb5eb970ff.tmppdf | Bin 0 -> 6257 bytes ...4c67eec41791b71414dadeb0ff387a04448cbe9f.tmppdf | Bin 0 -> 6257 bytes .../java/at/gv/egiz/pdfas/lib/impl/PdfAsImpl.java | 10 +++++----- .../lib/impl/stamping/CertificateResolver.java | 4 ++-- .../pdfas/lib/impl/verify/IntegrityVerifier.java | 10 +++++----- .../at/gv/egiz/pdfas/lib/util/SignatureUtils.java | 16 ++++++++-------- pdf-as-lib/src/main/resources/config/config.zip | Bin 1248998 -> 1269360 bytes 13 files changed, 20 insertions(+), 20 deletions(-) create mode 100644 pdf-as-lib/src/configuration/pdfastmp/024855edaaec4a9e70a10c8dada03c3c2872abd9/0c12b16dc63efa3bfc53fb580b20de5a56f6f86f.tmppdf create mode 100644 pdf-as-lib/src/configuration/pdfastmp/1bc3511b26297bf767ab8bb767815ec65d48b71e/651beb1a92f9313e46752667ad2caad8e55cc785.tmppdf create mode 100644 pdf-as-lib/src/configuration/pdfastmp/1e58de17f4bbdc2a3eb911d8d73b8e5f0b9b8d8f/5990344a0c25a1998c13b80fb54163df279ab0b3.tmppdf create mode 100644 pdf-as-lib/src/configuration/pdfastmp/43cca4ac73be06a084ff233127b261dbf14ea783/3db03bf642b2dfefb9d5e9c4685b6bf4d2801347.tmppdf create mode 100644 pdf-as-lib/src/configuration/pdfastmp/7c7e273e4cecbcf5e0bca3e3770535b767ccf65c/fdf2688a1a93fbf4759ddc444275ae38e03fa86e.tmppdf create mode 100644 pdf-as-lib/src/configuration/pdfastmp/87cf3a0d9ca039d5260e102a672e485e3e7b711e/02591ca7b2fa3dabd5041f8a3f21e867d0cc0591.tmppdf create mode 100644 pdf-as-lib/src/configuration/pdfastmp/cd1fe1d42172b0daeedd6d4dedbf7c67f16fa94c/e6b460a6ddc28c62c6a04f78bff877cb5eb970ff.tmppdf create mode 100644 pdf-as-lib/src/configuration/pdfastmp/cf6014eb965316128c7d6b4e129da73f95ba46ee/4c67eec41791b71414dadeb0ff387a04448cbe9f.tmppdf (limited to 'pdf-as-lib') diff --git a/pdf-as-lib/src/configuration/pdfastmp/024855edaaec4a9e70a10c8dada03c3c2872abd9/0c12b16dc63efa3bfc53fb580b20de5a56f6f86f.tmppdf b/pdf-as-lib/src/configuration/pdfastmp/024855edaaec4a9e70a10c8dada03c3c2872abd9/0c12b16dc63efa3bfc53fb580b20de5a56f6f86f.tmppdf new file mode 100644 index 00000000..867f68db Binary files /dev/null and b/pdf-as-lib/src/configuration/pdfastmp/024855edaaec4a9e70a10c8dada03c3c2872abd9/0c12b16dc63efa3bfc53fb580b20de5a56f6f86f.tmppdf differ diff --git a/pdf-as-lib/src/configuration/pdfastmp/1bc3511b26297bf767ab8bb767815ec65d48b71e/651beb1a92f9313e46752667ad2caad8e55cc785.tmppdf b/pdf-as-lib/src/configuration/pdfastmp/1bc3511b26297bf767ab8bb767815ec65d48b71e/651beb1a92f9313e46752667ad2caad8e55cc785.tmppdf new file mode 100644 index 00000000..867f68db Binary files /dev/null and b/pdf-as-lib/src/configuration/pdfastmp/1bc3511b26297bf767ab8bb767815ec65d48b71e/651beb1a92f9313e46752667ad2caad8e55cc785.tmppdf differ diff --git a/pdf-as-lib/src/configuration/pdfastmp/1e58de17f4bbdc2a3eb911d8d73b8e5f0b9b8d8f/5990344a0c25a1998c13b80fb54163df279ab0b3.tmppdf b/pdf-as-lib/src/configuration/pdfastmp/1e58de17f4bbdc2a3eb911d8d73b8e5f0b9b8d8f/5990344a0c25a1998c13b80fb54163df279ab0b3.tmppdf new file mode 100644 index 00000000..867f68db Binary files /dev/null and b/pdf-as-lib/src/configuration/pdfastmp/1e58de17f4bbdc2a3eb911d8d73b8e5f0b9b8d8f/5990344a0c25a1998c13b80fb54163df279ab0b3.tmppdf differ diff --git a/pdf-as-lib/src/configuration/pdfastmp/43cca4ac73be06a084ff233127b261dbf14ea783/3db03bf642b2dfefb9d5e9c4685b6bf4d2801347.tmppdf b/pdf-as-lib/src/configuration/pdfastmp/43cca4ac73be06a084ff233127b261dbf14ea783/3db03bf642b2dfefb9d5e9c4685b6bf4d2801347.tmppdf new file mode 100644 index 00000000..867f68db Binary files /dev/null and b/pdf-as-lib/src/configuration/pdfastmp/43cca4ac73be06a084ff233127b261dbf14ea783/3db03bf642b2dfefb9d5e9c4685b6bf4d2801347.tmppdf differ diff --git a/pdf-as-lib/src/configuration/pdfastmp/7c7e273e4cecbcf5e0bca3e3770535b767ccf65c/fdf2688a1a93fbf4759ddc444275ae38e03fa86e.tmppdf b/pdf-as-lib/src/configuration/pdfastmp/7c7e273e4cecbcf5e0bca3e3770535b767ccf65c/fdf2688a1a93fbf4759ddc444275ae38e03fa86e.tmppdf new file mode 100644 index 00000000..867f68db Binary files /dev/null and b/pdf-as-lib/src/configuration/pdfastmp/7c7e273e4cecbcf5e0bca3e3770535b767ccf65c/fdf2688a1a93fbf4759ddc444275ae38e03fa86e.tmppdf differ diff --git a/pdf-as-lib/src/configuration/pdfastmp/87cf3a0d9ca039d5260e102a672e485e3e7b711e/02591ca7b2fa3dabd5041f8a3f21e867d0cc0591.tmppdf b/pdf-as-lib/src/configuration/pdfastmp/87cf3a0d9ca039d5260e102a672e485e3e7b711e/02591ca7b2fa3dabd5041f8a3f21e867d0cc0591.tmppdf new file mode 100644 index 00000000..867f68db Binary files /dev/null and b/pdf-as-lib/src/configuration/pdfastmp/87cf3a0d9ca039d5260e102a672e485e3e7b711e/02591ca7b2fa3dabd5041f8a3f21e867d0cc0591.tmppdf differ diff --git a/pdf-as-lib/src/configuration/pdfastmp/cd1fe1d42172b0daeedd6d4dedbf7c67f16fa94c/e6b460a6ddc28c62c6a04f78bff877cb5eb970ff.tmppdf b/pdf-as-lib/src/configuration/pdfastmp/cd1fe1d42172b0daeedd6d4dedbf7c67f16fa94c/e6b460a6ddc28c62c6a04f78bff877cb5eb970ff.tmppdf new file mode 100644 index 00000000..867f68db Binary files /dev/null and b/pdf-as-lib/src/configuration/pdfastmp/cd1fe1d42172b0daeedd6d4dedbf7c67f16fa94c/e6b460a6ddc28c62c6a04f78bff877cb5eb970ff.tmppdf differ diff --git a/pdf-as-lib/src/configuration/pdfastmp/cf6014eb965316128c7d6b4e129da73f95ba46ee/4c67eec41791b71414dadeb0ff387a04448cbe9f.tmppdf b/pdf-as-lib/src/configuration/pdfastmp/cf6014eb965316128c7d6b4e129da73f95ba46ee/4c67eec41791b71414dadeb0ff387a04448cbe9f.tmppdf new file mode 100644 index 00000000..867f68db Binary files /dev/null and b/pdf-as-lib/src/configuration/pdfastmp/cf6014eb965316128c7d6b4e129da73f95ba46ee/4c67eec41791b71414dadeb0ff387a04448cbe9f.tmppdf differ diff --git a/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/PdfAsImpl.java b/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/PdfAsImpl.java index 8e86364b..fe7f72ab 100644 --- a/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/PdfAsImpl.java +++ b/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/PdfAsImpl.java @@ -238,7 +238,7 @@ public class PdfAsImpl implements PdfAs, IConfigurationConstants, return result; } catch (Throwable e) { - logger.error("Failed to create signature [" + e.getMessage() + "]", + logger.warn("Failed to create signature [" + e.getMessage() + "]", e); throw ErrorExtractor.searchPdfAsError(e, status); } finally { @@ -316,7 +316,7 @@ public class PdfAsImpl implements PdfAs, IConfigurationConstants, return request; } catch (Throwable e) { - logger.error("startSign", e); + logger.warn("startSign", e); throw ErrorExtractor.searchPdfAsError(e, status); } } @@ -378,7 +378,7 @@ public class PdfAsImpl implements PdfAs, IConfigurationConstants, request.setNeedSignature(true); } catch (Throwable e) { - logger.error("process", e); + logger.warn("process", e); throw ErrorExtractor.searchPdfAsError(e, status); } } else if (request.needSignature()) { @@ -548,10 +548,10 @@ public class PdfAsImpl implements PdfAs, IConfigurationConstants, return signer.generateVisibleSignaturePreview(parameter, iaikCert, resolution, status, requestedSignature); } catch (PdfAsException e) { - logger.error("PDF-AS Exception", e); + logger.warn("PDF-AS Exception", e); throw ErrorExtractor.searchPdfAsError(e, status); } catch (Throwable e) { - logger.error("Throwable Exception", e); + logger.warn("Throwable Exception", e); throw ErrorExtractor.searchPdfAsError(e, status); } diff --git a/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/stamping/CertificateResolver.java b/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/stamping/CertificateResolver.java index 7012a93a..bff573a4 100644 --- a/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/stamping/CertificateResolver.java +++ b/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/stamping/CertificateResolver.java @@ -57,14 +57,14 @@ public class CertificateResolver implements IResolver { Map issuerDNMap = DNUtils.dnToMap(certificate.getIssuerDN().getName()); this.ctx.put("issuer", issuerDNMap); } catch (InvalidNameException e) { - logger.error("Failed to build issuer Map", e); + logger.warn("Failed to build issuer Map", e); } try { Map subjectDNMap = DNUtils.dnToMap(certificate.getSubjectDN().getName()); this.ctx.put("subject", subjectDNMap); } catch (InvalidNameException e) { - logger.error("Failed to build subject Map", e); + logger.warn("Failed to build subject Map", e); } Map iuiMap = new HashMap(); diff --git a/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/verify/IntegrityVerifier.java b/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/verify/IntegrityVerifier.java index 9142bc68..3b49497b 100644 --- a/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/verify/IntegrityVerifier.java +++ b/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/verify/IntegrityVerifier.java @@ -66,7 +66,7 @@ public class IntegrityVerifier implements IVerifier { signedCertificate = signerInfos[0] .getSignedAttribute(ObjectID.signingCertificateV2); if (signedCertificate == null) { - logger.error("Signature ERROR missing signed Signing Certificate: "); + logger.warn("Signature ERROR missing signed Signing Certificate: "); throw new SignatureException("Signature ERROR missing signed Signing Certificate"); } else { @@ -80,12 +80,12 @@ public class IntegrityVerifier implements IVerifier { // OK logger.debug("Found and verified SigningCertificateV2"); } else { - logger.error("Signature ERROR certificate missmatch: "); + logger.warn("Signature ERROR certificate missmatch, misbehaving Sign Backend?"); throw new SignatureException("Signature ERROR certificate missmatch"); } } catch (Throwable e) { - logger.error("Signature ERROR wrong encoding for ESSCertIDv2"); + logger.error("Signature ERROR wrong encoding for ESSCertIDv2, misbehaving Signature Backend?"); throw new SignatureException("Signature ERROR wrong encoding for ESSCertIDv2"); } @@ -99,12 +99,12 @@ public class IntegrityVerifier implements IVerifier { // OK logger.debug("Found and verified SigningCertificate"); } else { - logger.error("Signature ERROR certificate missmatch"); + logger.warn("Signature ERROR certificate missmatch"); throw new SignatureException("Signature ERROR certificate missmatch"); } } catch (Throwable e) { - logger.error("Signature ERROR wrong encoding for ESSCertIDv2"); + logger.error("Signature ERROR wrong encoding for ESSCertIDv2, misbehaving Signature Backend?"); throw new SignatureException("Signature ERROR wrong encoding for ESSCertIDv2", e); } diff --git a/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/util/SignatureUtils.java b/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/util/SignatureUtils.java index ef5df8b1..6e584f32 100644 --- a/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/util/SignatureUtils.java +++ b/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/util/SignatureUtils.java @@ -45,12 +45,12 @@ public class SignatureUtils implements ErrorConstants { // get the signer infos SignerInfo[] signerInfos = signedData.getSignerInfos(); if (signerInfos.length == 0) { - logger.error("Invalid signature (no signer information)"); + logger.warn("Invalid signature (no signer information)"); throw new PDFASError(ERROR_SIG_INVALID_BKU_SIG); } if (signerInfos.length != 1) { - logger.error("Invalid signature (multiple signer information)"); + logger.warn("Invalid signature (multiple signer information)"); throw new PDFASError(ERROR_SIG_INVALID_BKU_SIG); } // verify the signatures @@ -72,7 +72,7 @@ public class SignatureUtils implements ErrorConstants { signedCertificate = signerInfos[0] .getSignedAttribute(ObjectID.signingCertificateV2); if (signedCertificate == null) { - logger.error("Signature ERROR missing signed Signing Certificate: "); + logger.warn("Signature ERROR missing signed Signing Certificate: "); throw new PDFASError(ERROR_SIG_INVALID_BKU_SIG); } else { @@ -84,12 +84,12 @@ public class SignatureUtils implements ErrorConstants { // OK logger.debug("Found and verified SigningCertificateV2"); } else { - logger.error("Signature ERROR certificate missmatch: "); + logger.error("Signature ERROR certificate missmatch, misbehaving Signature Backend?"); throw new PDFASError(ERROR_SIG_INVALID_BKU_SIG); } } catch (Throwable e) { - logger.error("Signature ERROR wrong encoding for ESSCertIDv2:"); + logger.error("Signature ERROR wrong encoding for ESSCertIDv2, misbehaving Signature Backend?"); throw new PDFASError(ERROR_SIG_INVALID_BKU_SIG, e); } @@ -102,12 +102,12 @@ public class SignatureUtils implements ErrorConstants { // OK logger.debug("Found and verified SigningCertificate"); } else { - logger.error("Signature ERROR certificate missmatch"); + logger.warn("Signature ERROR certificate missmatch, misbehaving Signature Backend?"); throw new PDFASError(ERROR_SIG_INVALID_BKU_SIG); } } catch (Throwable e) { - logger.error("Signature ERROR wrong encoding for ESSCertIDv2"); + logger.error("Signature ERROR wrong encoding for ESSCertIDv2, misbehaving Signature Backend?"); throw new PDFASError(ERROR_SIG_INVALID_BKU_SIG, e); } @@ -121,7 +121,7 @@ public class SignatureUtils implements ErrorConstants { } catch (SignatureException ex) { // if the signature is not OK a SignatureException // is thrown - logger.error( + logger.warn( "Signature ERROR from signer: " + signedData.getCertificate( signerInfos[0].getSignerIdentifier()) diff --git a/pdf-as-lib/src/main/resources/config/config.zip b/pdf-as-lib/src/main/resources/config/config.zip index 19971a5b..e46d87d2 100644 Binary files a/pdf-as-lib/src/main/resources/config/config.zip and b/pdf-as-lib/src/main/resources/config/config.zip differ -- cgit v1.2.3