Harmony
  1. Harmony
  2. HARMONY-1678

[DRLVM] junit test o.a.h.crypto.tests.javax.crypto.EncryptedPrivateKeyInfoTest fails

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: DRLVM
    • Labels:
      None
    • Environment:
      Windows XP IA32

      Description

      Build:
      svn = r452457, (Oct 3 2006), Windows/ia32/msvc 1310, debug build

      4 test cases fail in Unit test
      EncryptedPrivateKeyInfoTest

      Unfortunately I can't tell why they fail because they do something too complicated for me

      Please see a standalone test attached - in RI it prints nothing while on Harmony it prints

      AES, nulljava.security.spec.InvalidKeySpecException: Decrypted data does not rep
      resent valid PKCS#8 PrivateKeyInfo

      DES, nulljava.security.spec.InvalidKeySpecException: Decrypted data does not rep
      resent valid PKCS#8 PrivateKeyInfo

      RC4, nulljava.security.spec.InvalidKeySpecException: Decrypted data does not rep
      resent valid PKCS#8 PrivateKeyInfo

      1.2.840.113549.1.12.1.3, nulljava.security.spec.InvalidKeySpecException: Decrypt
      ed data does not represent valid PKCS#8 PrivateKeyInfo

      1. Test.java
        17 kB
        Anton Luht
      2. JETKiller.java
        1 kB
        Egor Pasko
      3. harmony_1678_1724_fix.patch
        2 kB
        Alex Astapchuk
      4. harmony_1678_1724_fix.patch
        2 kB
        Alex Astapchuk

        Issue Links

          Activity

          Hide
          Elena Semukhina added a comment -

          While Anton is on vacation I can confirm that tests passed on windows as well.

          Show
          Elena Semukhina added a comment - While Anton is on vacation I can confirm that tests passed on windows as well.
          Hide
          Mikhail Loenko added a comment -

          the latest patch applied in revision 462758
          Anton, please check that it fully resolves the issue

          Show
          Mikhail Loenko added a comment - the latest patch applied in revision 462758 Anton, please check that it fully resolves the issue
          Hide
          Alexey Varlamov added a comment -

          I tried this patch on Linux Suse 9, works fine. Thanks!

          Show
          Alexey Varlamov added a comment - I tried this patch on Linux Suse 9, works fine. Thanks!
          Hide
          Alex Astapchuk added a comment -

          The same patch against latest SVN (the previous conflicted with HARMONY-1681).

          Show
          Alex Astapchuk added a comment - The same patch against latest SVN (the previous conflicted with HARMONY-1681 ).
          Hide
          Alexey Varlamov added a comment -

          Patch does not apply at 454621...

          Show
          Alexey Varlamov added a comment - Patch does not apply at 454621...
          Hide
          Alex Astapchuk added a comment -

          The fix is attached.

          The problem was that .jet-generated code did not save a variable (the endOffset in the test) into memory.

          The fix also covers HARMONY-1724.

          Not sure, which tests to run to verify the fix: I tried to run 'build.sh test' and got number of failures even w/o my fix.

          Anyway, the attached JETKiller passes, the test from HARMONY-1724 passes and I also checked Win32 & Lin32 builds.

          Show
          Alex Astapchuk added a comment - The fix is attached. The problem was that .jet-generated code did not save a variable (the endOffset in the test) into memory. The fix also covers HARMONY-1724 . Not sure, which tests to run to verify the fix: I tried to run 'build.sh test' and got number of failures even w/o my fix. Anyway, the attached JETKiller passes, the test from HARMONY-1724 passes and I also checked Win32 & Lin32 builds.
          Hide
          Alexei Fedotov added a comment -

          [drlvm][unit] Blocks http://wiki.apache.org/harmony/Unit_Tests_Pass_on_DRLVM

          I played with the test a bit and cannot simplify more - thanks, Egor, for this piece of art. On Linux the test fails as well.

          Show
          Alexei Fedotov added a comment - [drlvm] [unit] Blocks http://wiki.apache.org/harmony/Unit_Tests_Pass_on_DRLVM I played with the test a bit and cannot simplify more - thanks, Egor, for this piece of art. On Linux the test fails as well.
          Hide
          Egor Pasko added a comment -

          reduced test (JETKiller.java) attached. method runSequence is compiled incorrectly by JET, moving compilation of this method to OPT makes the test PASS.

          Show
          Egor Pasko added a comment - reduced test (JETKiller.java) attached. method runSequence is compiled incorrectly by JET, moving compilation of this method to OPT makes the test PASS.
          Hide
          Egor Pasko added a comment -

          this method:
          org/apache/harmony/security/asn1/BerInputStream::readSequence(Lorg/apache/harmony/security/asn1/ASN1Sequence;)V

          if moved to OPT, test passes

          Show
          Egor Pasko added a comment - this method: org/apache/harmony/security/asn1/BerInputStream::readSequence(Lorg/apache/harmony/security/asn1/ASN1Sequence;)V if moved to OPT, test passes
          Hide
          Alexey Varlamov added a comment -

          I tried the attached test on Linux and it fails on JET only, OPT and interpreter pass normally.

          Show
          Alexey Varlamov added a comment - I tried the attached test on Linux and it fails on JET only, OPT and interpreter pass normally.

            People

            • Assignee:
              Mikhail Loenko
              Reporter:
              Anton Luht
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development