< prev index next >

src/jdk.jartool/share/classes/sun/security/tools/jarsigner/Main.java

Print this page

        

*** 108,118 **** private static final Set<CryptoPrimitive> DIGEST_PRIMITIVE_SET = Collections .unmodifiableSet(EnumSet.of(CryptoPrimitive.MESSAGE_DIGEST)); private static final Set<CryptoPrimitive> SIG_PRIMITIVE_SET = Collections .unmodifiableSet(EnumSet.of(CryptoPrimitive.SIGNATURE)); ! private static boolean permsDetected; static final String VERSION = "1.0"; static final int IN_KEYSTORE = 0x01; // signer is in keystore static final int NOT_ALIAS = 0x04; // alias list is NOT empty and --- 108,118 ---- private static final Set<CryptoPrimitive> DIGEST_PRIMITIVE_SET = Collections .unmodifiableSet(EnumSet.of(CryptoPrimitive.MESSAGE_DIGEST)); private static final Set<CryptoPrimitive> SIG_PRIMITIVE_SET = Collections .unmodifiableSet(EnumSet.of(CryptoPrimitive.SIGNATURE)); ! private static boolean extraAttrsDetected; static final String VERSION = "1.0"; static final int IN_KEYSTORE = 0x01; // signer is in keystore static final int NOT_ALIAS = 0x04; // alias list is NOT empty and
*** 780,791 **** while (e.hasMoreElements()) { JarEntry je = e.nextElement(); String name = je.getName(); ! if (!permsDetected && JUZFA.getPosixPerms(je) != -1) { ! permsDetected = true; } hasSignature = hasSignature || SignatureFileVerifier.isBlockOrSF(name); CodeSigner[] signers = je.getCodeSigners(); --- 780,791 ---- while (e.hasMoreElements()) { JarEntry je = e.nextElement(); String name = je.getName(); ! if (!extraAttrsDetected && JUZFA.getExtraAttributes(je) != -1) { ! extraAttrsDetected = true; } hasSignature = hasSignature || SignatureFileVerifier.isBlockOrSF(name); CodeSigner[] signers = je.getCodeSigners();
*** 1245,1256 **** ? rb.getString("no.timestamp.signing") : rb.getString("no.timestamp.verifying"), expireDate)); } } ! if (permsDetected) { ! warnings.add(rb.getString("posix.attributes.detected")); } if ((strict) && (!errors.isEmpty())) { result = isSigning ? rb.getString("jar.signed.with.signer.errors.") --- 1245,1256 ---- ? rb.getString("no.timestamp.signing") : rb.getString("no.timestamp.verifying"), expireDate)); } } ! if (extraAttrsDetected) { ! warnings.add(rb.getString("extra.attributes.detected")); } if ((strict) && (!errors.isEmpty())) { result = isSigning ? rb.getString("jar.signed.with.signer.errors.")
*** 1775,1786 **** Throwable failedCause = null; String failedMessage = null; try { ! Event.setReportListener(Event.ReporterCategory.POSIXPERMS, ! (t, o) -> permsDetected = true); builder.build().sign(zipFile, fos); } catch (JarSignerException e) { failedCause = e.getCause(); if (failedCause instanceof SocketTimeoutException || failedCause instanceof UnknownHostException) { --- 1775,1786 ---- Throwable failedCause = null; String failedMessage = null; try { ! Event.setReportListener(Event.ReporterCategory.ZIPFILEATTRS, ! (t, o) -> extraAttrsDetected = true); builder.build().sign(zipFile, fos); } catch (JarSignerException e) { failedCause = e.getCause(); if (failedCause instanceof SocketTimeoutException || failedCause instanceof UnknownHostException) {
*** 1811,1821 **** if (fos != null) { fos.close(); } ! Event.clearReportListener(Event.ReporterCategory.POSIXPERMS); } if (failedCause != null) { signedJarFile.delete(); error(failedMessage, failedCause); --- 1811,1821 ---- if (fos != null) { fos.close(); } ! Event.clearReportListener(Event.ReporterCategory.ZIPFILEATTRS); } if (failedCause != null) { signedJarFile.delete(); error(failedMessage, failedCause);
< prev index next >