Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8237604

[TEST_BUG] sun/security/tools/jarsigner/EntriesOrder.java not adapted for changes in JDK-7194449

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • openjdk7u
    • openjdk7u
    • tools
    • None
    • b00
    • master
    • generic
    • generic

      The sequencing of JDK-7194449 and JDK-8031572 in OpenJDK 7 has led to the EntriesOrder.java test introduced by JDK-8031572 not being adapted to keytool and jarsigner now being in their own packages:

      ----------System.err:(11/541)----------
      /home/andrew/projects/openjdk/upstream/jdk7/jdk/test/sun/security/tools/jarsigner/EntriesOrder.java:78: error: cannot find symbol
              sun.security.tools.KeyTool.main(
                                ^
        symbol: class KeyTool
        location: package sun.security.tools
      /home/andrew/projects/openjdk/upstream/jdk7/jdk/test/sun/security/tools/jarsigner/EntriesOrder.java:81: error: cannot find symbol
              sun.security.tools.JarSigner.main(
                                ^
        symbol: class JarSigner
        location: package sun.security.tools
      2 errors
      result: Failed. Compilation failed: Compilation failed

      In 8u:

      JDK-7194449 is introduced on 2012-10-14
      JDK-8031572 is introduced on 2014-01-21

      sun.security.tools.{keytool,jarsigner}.Main classes

      In 7u:

      JDK-8031572 is introduced on 2014-01-21 (as with 8u)
      JDK-7194449 is introduced on 2016-13-07

      so the version of 8031572 in 7u uses sun.security.tools.JarSigner & sun.security.tools.KeyTool, as this was correct for 7u in 2014, and this wasn't fixed when 7194449 was backported in 2016, because the original patch in 8u predated 8031572, being from 2012.

      It's easily fixed from a diff of the 7u & 8u versions:

      @@ -70,10 +75,10 @@
               if (!m.run("cvf a.jar a META-INF/inf".split(" "))) {
                   throw new Exception("jar creation failed");
               }
      - sun.security.tools.KeyTool.main(
      + sun.security.tools.keytool.Main.main(
                       ("-keystore jks -storepass changeit -keypass changeit -dname" +
                               " CN=A -alias a -genkeypair -keyalg rsa").split(" "));
      - sun.security.tools.JarSigner.main(
      + sun.security.tools.jarsigner.Main.main(
                       "-keystore jks -storepass changeit a.jar a".split(" "));
               m = new sun.tools.jar.Main(System.out, System.err, "jar");
               if (!m.run("xvf a.jar".split(" "))) {

            andrew Andrew Hughes
            andrew Andrew Hughes
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: