[jira] Created: (HARMONY-186) X509CertSelector.match throws ArrayIndexOutOfBoundsException when checks keyUsage criterion
X509CertSelector.match throws ArrayIndexOutOfBoundsException when checks keyUsage criterion --- Key: HARMONY-186 URL: http://issues.apache.org/jira/browse/HARMONY-186 Project: Harmony Type: Bug Components: Classlib Reporter: Stepan Mishura According to the spec. of X509Certificate and X509CertSelector classes KeyUsage extension is represented by array of boolean values. But the spec. doesn't specify any restrictions on the array so instances of X509Certificate and X509CertSelector classes may have arrays of different length to be matched. If a certificate's array is longer then a selector's array then invocation of method X509CertSelector.match(java.security.cert.Certificate) throws ArrayIndexOutOfBoundsException. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Updated: (HARMONY-186) X509CertSelector.match throws ArrayIndexOutOfBoundsException when checks keyUsage criterion
[ http://issues.apache.org/jira/browse/HARMONY-186?page=all ] Stepan Mishura updated HARMONY-186: --- Attachment: fixHarmony186.txt Patch includes bug fix and regression test X509CertSelector.match throws ArrayIndexOutOfBoundsException when checks keyUsage criterion --- Key: HARMONY-186 URL: http://issues.apache.org/jira/browse/HARMONY-186 Project: Harmony Type: Bug Components: Classlib Reporter: Stepan Mishura Attachments: fixHarmony186.txt According to the spec. of X509Certificate and X509CertSelector classes KeyUsage extension is represented by array of boolean values. But the spec. doesn't specify any restrictions on the array so instances of X509Certificate and X509CertSelector classes may have arrays of different length to be matched. If a certificate's array is longer then a selector's array then invocation of method X509CertSelector.match(java.security.cert.Certificate) throws ArrayIndexOutOfBoundsException. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Updated: (HARMONY-164) local test server
[ http://issues.apache.org/jira/browse/HARMONY-164?page=all ] Stepan Mishura updated HARMONY-164: --- Attachment: MyTest.java A local server and 2 JUnit test cases in attached file local test server - Key: HARMONY-164 URL: http://issues.apache.org/jira/browse/HARMONY-164 Project: Harmony Type: Improvement Components: Classlib Reporter: Stepan Mishura Attachments: MyTest.java As was discussed on harmony-dev mailing list (see [1]) a proof of concept is required to demonstrate that it is possible to test net API without configuring external server or creating sophisticated internal. I'm going attach a small peace of code that demonstrates testing approach. [1] http://mail-archives.apache.org/mod_mbox/incubator-harmony-dev/200602.mbox/[EMAIL PROTECTED] -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (HARMONY-138) 2 regression tests for URLConnection class should be network independent
[ http://issues.apache.org/jira/browse/HARMONY-138?page=comments#action_12367953 ] Stepan Mishura commented on HARMONY-138: Ok with the fix 2 regression tests for URLConnection class should be network independent Key: HARMONY-138 URL: http://issues.apache.org/jira/browse/HARMONY-138 Project: Harmony Type: Bug Components: Classlib Reporter: Stepan Mishura Assignee: Tim Ellison Priority: Minor Attachments: fixURLConnectionTest.txt There are two regression tests for URLConnection class: - HARMONY-71: test_setUseCachesZ - HARMONY-72: test_setAllowUserInteractionZ They may fail because depend on network connection. It is possible to fix these tests to avoid dependency on connection because they verify URLConnection object state only and opened connections are not used by tests. Also tests should verify URLConnection class code rather then a default implementation of HttpURLConnection class because tested method may be overridden by default implementation. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Created: (HARMONY-138) 2 regression tests for URLConnection class should be network independent
2 regression tests for URLConnection class should be network independent Key: HARMONY-138 URL: http://issues.apache.org/jira/browse/HARMONY-138 Project: Harmony Type: Bug Reporter: Stepan Mishura Priority: Minor There are two regression tests for URLConnection class: - HARMONY-71: test_setUseCachesZ - HARMONY-72: test_setAllowUserInteractionZ They may fail because depend on network connection. It is possible to fix these tests to avoid dependency on connection because they verify URLConnection object state only and opened connections are not used by tests. Also tests should verify URLConnection class code rather then a default implementation of HttpURLConnection class because tested method may be overridden by default implementation. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Updated: (HARMONY-138) 2 regression tests for URLConnection class should be network independent
[ http://issues.apache.org/jira/browse/HARMONY-138?page=all ] Stepan Mishura updated HARMONY-138: --- Attachment: fixURLConnectionTest.txt A patch is attached 2 regression tests for URLConnection class should be network independent Key: HARMONY-138 URL: http://issues.apache.org/jira/browse/HARMONY-138 Project: Harmony Type: Bug Reporter: Stepan Mishura Priority: Minor Attachments: fixURLConnectionTest.txt There are two regression tests for URLConnection class: - HARMONY-71: test_setUseCachesZ - HARMONY-72: test_setAllowUserInteractionZ They may fail because depend on network connection. It is possible to fix these tests to avoid dependency on connection because they verify URLConnection object state only and opened connections are not used by tests. Also tests should verify URLConnection class code rather then a default implementation of HttpURLConnection class because tested method may be overridden by default implementation. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Updated: (HARMONY-80) serialVersionUID is missed in org.ietf.jgss.GSSException
[ http://issues.apache.org/jira/browse/HARMONY-80?page=all ] Stepan Mishura updated HARMONY-80: -- Attachment: fixHarmony80.txt Tim, Good catch! Thank you. It indeed incorrect and I'd change bug summary to: GSSException has the incorrect serialized form, but I don't know how to do this. The fix is attached. serialVersionUID is missed in org.ietf.jgss.GSSException Key: HARMONY-80 URL: http://issues.apache.org/jira/browse/HARMONY-80 Project: Harmony Type: Bug Components: Classlib Reporter: Stepan Mishura Priority: Trivial Attachments: fix.txt, fixHarmony80.txt According to Java Spec 5.0 serialVersionUID for org.ietf.jgss.GSSException class is -2706218945227726672L. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (HARMONY-80) GSSException has the incorrect serialized form
[ http://issues.apache.org/jira/browse/HARMONY-80?page=comments#action_12366605 ] Stepan Mishura commented on HARMONY-80: --- Ok with the fix. Thanks GSSException has the incorrect serialized form -- Key: HARMONY-80 URL: http://issues.apache.org/jira/browse/HARMONY-80 Project: Harmony Type: Bug Components: Classlib Reporter: Stepan Mishura Assignee: Tim Ellison Priority: Trivial Attachments: fix.txt, fixHarmony80.txt According to Java Spec 5.0 serialVersionUID for org.ietf.jgss.GSSException class is -2706218945227726672L. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (HARMONY-71) java.net.URLConnection.setUseCaches throws unspecified IllegalAccessError
[ http://issues.apache.org/jira/browse/HARMONY-71?page=comments#action_12366637 ] Stepan Mishura commented on HARMONY-71: --- Tim, Added test case (test_setUseCachesZ) depends on network and it fails if it can not create connection with apache.org. The same for HARMONY-72. I'm going to attach a patch file with a local server in it. Could you reopen this JIRA? Thanks, Stepan. java.net.URLConnection.setUseCaches throws unspecified IllegalAccessError -- Key: HARMONY-71 URL: http://issues.apache.org/jira/browse/HARMONY-71 Project: Harmony Type: Bug Components: Classlib Reporter: Svetlana Samoilenko Assignee: Tim Ellison According to j2se 1.4.2 specification method java.net.URLConnection.setUseCaches(boolean) throws IllegalStateException, if already connected. Harmony throws java.lang.IllegalAccessError instead, that contradicts the specification. Code to reproduce: import java.io.IOException; import java.net.*; public class test2 { public static void main(String[] args) { HttpURLConnection u=null; try { u=(HttpURLConnection)(new URL(http://intel.com;).openConnection()); u.connect(); } catch (MalformedURLException e) { System.out.println(unexpected MalformedURLException+e); } catch (IOException f) { System.out.println(unexpected IOException+f); } try { u.setUseCaches(true); } catch (IllegalStateException e) { System.out.println(OK. Expected IllegalStateException); e.printStackTrace(); }; } } Steps to Reproduce: 1. Build Harmony (check-out on 2006-01-30) j2se subset as described in README.txt. 2. Compile test2.java using BEA 1.4 javac javac -d . test2.java 3. Run java using compatible VM (J9) java -showversion test2 Output: C:\tmpC:\jrockit-j2sdk1.4.2_04\bin\java.exe -showversion test2 java version 1.4.2_04 Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) BEA WebLogic JRockit(TM) 1.4.2_04 JVM (build ari-31788-20040616-1132-win-ia32, Native Threads, GC strategy: parallel) OK. Expected IllegalStateException java.lang.IllegalStateException: Already connected at java.net.URLConnection.setUseCaches(Z)V(URLConnection.java:828) at test2.main([Ljava.lang.String;)V(test2.java:17) C:\tmpC:\harmony\trunk\deploy\jre\bin\java -showversion test2 (c) Copyright 1991, 2005 The Apache Software Foundation or its licensors, as applicable. java.lang.IllegalAccessError: Connection already established at java.net.URLConnection.setUseCaches(URLConnection.java:923) at test2.main(test2.java:17) Suggested junit test case: URLConnectionTest.java - import java.io.IOException; import java.net.*; import junit.framework.*; public class URLConnectionTest extends TestCase { public static void main(String[] args) { junit.textui.TestRunner.run(URLConnectionTest.class); } public void test_setUseCaches () { HttpURLConnection u=null; try { u=(HttpURLConnection)(new URL(http://intel.com;).openConnection()); u.connect(); } catch (MalformedURLException e) { fail(unexpected MalformedURLException+e); } catch (IOException f) { fail(unexpected IOException+f); } try { u.setUseCaches(true); } catch (IllegalStateException e) { //expected }; } } -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Created: (HARMONY-95) Extract auth component from 'security2' module
Extract auth component from 'security2' module -- Key: HARMONY-95 URL: http://issues.apache.org/jira/browse/HARMONY-95 Project: Harmony Type: Task Components: Classlib Reporter: Stepan Mishura 'security2' module includes API that provides authorization, authentication and secure communication. As was agreed on harmony-dev list this API will be formed as a separate module - auth. (for initial proposal see http://mail-archives.apache.org/mod_mbox/incubator-harmony-dev/200601.mbox/[EMAIL PROTECTED]) The new module includes the following packages: javax.security.auth javax.security.auth.callback javax.security.auth.kerberos javax.security.auth.login javax.security.auth.spi javax.security.auth.x500 javax.security.sasl org.ietf.jgss -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Created: (HARMONY-80) serialVersionUID is missed in org.ietf.jgss.GSSException
serialVersionUID is missed in org.ietf.jgss.GSSException Key: HARMONY-80 URL: http://issues.apache.org/jira/browse/HARMONY-80 Project: Harmony Type: Bug Components: Classlib Reporter: Stepan Mishura Priority: Trivial Attachments: fix.txt According to Java Spec 5.0 serialVersionUID for org.ietf.jgss.GSSException class is -2706218945227726672L. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Updated: (HARMONY-80) serialVersionUID is missed in org.ietf.jgss.GSSException
[ http://issues.apache.org/jira/browse/HARMONY-80?page=all ] Stepan Mishura updated HARMONY-80: -- Attachment: fix.txt serialVersionUID is missed in org.ietf.jgss.GSSException Key: HARMONY-80 URL: http://issues.apache.org/jira/browse/HARMONY-80 Project: Harmony Type: Bug Components: Classlib Reporter: Stepan Mishura Priority: Trivial Attachments: fix.txt According to Java Spec 5.0 serialVersionUID for org.ietf.jgss.GSSException class is -2706218945227726672L. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Created: (HARMONY-77) serialVersionUID is missed in java.util.LinkedHashSet
serialVersionUID is missed in java.util.LinkedHashSet - Key: HARMONY-77 URL: http://issues.apache.org/jira/browse/HARMONY-77 Project: Harmony Type: Bug Components: Classlib Reporter: Stepan Mishura Priority: Trivial Attachments: suggestedFix.txt According to Java Spec 5.0 serialVersionUIDs for java.util.LinkedHashSet class is -2851667679971038690L. The following test in security2 module fails because of this bug: javax/security/auth/PrivateCredentialPermissionTest.java -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (HARMONY-77) serialVersionUID is missed in java.util.LinkedHashSet
[ http://issues.apache.org/jira/browse/HARMONY-77?page=comments#action_12365391 ] Stepan Mishura commented on HARMONY-77: --- OK with the fix: test passes. serialVersionUID is missed in java.util.LinkedHashSet - Key: HARMONY-77 URL: http://issues.apache.org/jira/browse/HARMONY-77 Project: Harmony Type: Bug Components: Classlib Reporter: Stepan Mishura Assignee: Tim Ellison Priority: Trivial Attachments: suggestedFix.txt According to Java Spec 5.0 serialVersionUIDs for java.util.LinkedHashSet class is -2851667679971038690L. The following test in security2 module fails because of this bug: javax/security/auth/PrivateCredentialPermissionTest.java -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (HARMONY-66) java.lang.SecurityManager.checkAccess(Thread t) throws NullPointerException for the dead thread.
[ http://issues.apache.org/jira/browse/HARMONY-66?page=comments#action_12364938 ] Stepan Mishura commented on HARMONY-66: --- I've looked into added regression test case and I have the following comment: The current test case will pass if the method checkAccess() returns silently or AccessControlException is thrown. I think the test case should be stricter and pass only in one case. Otherwise the test case may mask a bug in Harmony implementation. In our case a security manager is not installed by default and the test case doesn't install it too. As far as I understand the spec. the method checkPermission should not be invoked so no AccessControlException is thrown. However Harmony implementation throws exception. java.lang.SecurityManager.checkAccess(Thread t) throws NullPointerException for the dead thread. Key: HARMONY-66 URL: http://issues.apache.org/jira/browse/HARMONY-66 Project: Harmony Type: Bug Components: Classlib Reporter: Elena Semukhina Assignee: Tim Ellison Priority: Minor java.lang.SecurityManager.checkAccess(Thread t) throws NullPointerException for the dead thread. According to specification, the Thread.getThreadGroup() method returns null if this thread has died. SecurityManager.checkAccess(Thread t) should take that into account. Code for reproducing: public class ThreadCheckAccess { class ThreadRunning extends Thread { volatile boolean stopWork = false; int i = 0; public void run () { while (!stopWork) { } } } public void test() { SecurityManager sm = new SecurityManager(); System.setSecurityManager(sm); ThreadRunning t = new ThreadRunning(); t.start(); t.stopWork = true; try { t.join(); } catch (InterruptedException e) { e.printStackTrace(); } try { sm.checkAccess(t); System.out.println(PASSED); } catch (NullPointerException e) { e.printStackTrace(); System.out.println(FAILED); } } public static void main(String args[]) { new ThreadCheckAccess().test(); } } Steps to Reproduce: 1. Build Harmony (check-out on 2006-01-31) j2se subset as described in README.txt. 2. Compile ThreadCheckAccess.java using BEA 1.4 javac javac -d . ThreadCheckAccess.java 2. Run java using compatible VM (J9) java -showversion ThreadCheckAccess Output: java version 1.4.2 (subset) (c) Copyright 1991, 2005 The Apache Software Foundation or its licensors, as applicable. java.lang.NullPointerException at java.lang.SecurityManager.checkAccess(SecurityManager.java:92) at java.lang.Thread.checkAccess(Thread.java:423) at ThreadCheckAccess.test(ThreadCheckAccess.java:23) at ThreadCheckAccess.main(ThreadCheckAccess.java:32) FAILED Output on BEA 1.4.2: PASSED Suggested junit test case: package org.apache.harmony.tests.java.lang; import junit.framework.TestCase; public class SecurityManagerTest extends TestCase { class ThreadRunning extends Thread { volatile boolean stopWork = false; int i = 0; public void run () { while (!stopWork) { } } } public void test_checkAccessLjava_lang_Thread() { SecurityManager sm = new SecurityManager(); System.setSecurityManager(sm); ThreadRunning t = new ThreadRunning(); t.start(); t.stopWork = true; try { t.join(); } catch (InterruptedException e) { fail(Assert 0: unexpected + e); } try { sm.checkAccess(t); } catch (NullPointerException e) { fail(Assert 1: NullPointerException has been thrown); } } } -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Updated: (HARMONY-58) Problems trying to run the security2 test suite
[ http://issues.apache.org/jira/browse/HARMONY-58?page=all ] Stepan Mishura updated HARMONY-58: -- Attachment: security2ClasslibTestsPatch.txt I've added 'test.classlib' target to run security2 tests on Harmony code base. So the following steps are required: - build the classlib - change dir to modules\security2\make - to compile security2 tests set JAVA_HOME to JDK path - set CLASSPATH=junit.jar;bcprov.jar - ant test.classlib Please let me know whether the patch works for you or not. Problems trying to run the security2 test suite --- Key: HARMONY-58 URL: http://issues.apache.org/jira/browse/HARMONY-58 Project: Harmony Type: Test Components: Classlib Environment: x86, WinXP, repo revision 373866 Reporter: Tim Ellison Attachments: security2ClasslibTestsPatch.txt With a combination of Stepan and Geir's instructions I have: Built the classlib successfully code by: - putting a JDK on the path, unset JAVA_HOME and CLASSPATH - invoke the default target in trunk/make/build.xml - put in the VM Built the security tests successfully by: - cd modules/security2/make - ant tests.run (ignore the run failures) Tried to run the tests by: - set CLASSPATH=%CLASSPATH%;junit.jar;bcprov.jar - set JAVA_HOME=trunk/deploy/jre - set PATH=%JAVA_HOME%/bin;%PATH% - hack the build.xml to remove the clean-ups - ant tests.run After a few targets going by it trys to run the test, but seems to hang with CPU at 100% and the following output on the console: - snip run: [junit] Running java.security.AccessControlExceptionTest [junit] Tests run: 3, Failures: 0, Errors: 0, Time elapsed: 0.04 sec [junit] Running java.security.AlgorithmParameterGeneratorSpiTests [junit] Tests run: 1, Failures: 0, Errors: 0, Time elapsed: 0.209 sec [junit] Running java.security.AlgorithmParameterGeneratorTest1 -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira