harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mikhail Loenko (JIRA)" <j...@apache.org>
Subject [jira] Closed: (HARMONY-1542) [classlib][security] unexpected NPE for KeyStore.TrustedCertificateEntry().toString()
Date Wed, 18 Oct 2006 04:54:41 GMT
     [ http://issues.apache.org/jira/browse/HARMONY-1542?page=all ]

Mikhail Loenko closed HARMONY-1542.
-----------------------------------


> [classlib][security] unexpected NPE for KeyStore.TrustedCertificateEntry().toString()
> -------------------------------------------------------------------------------------
>
>                 Key: HARMONY-1542
>                 URL: http://issues.apache.org/jira/browse/HARMONY-1542
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Vladimir Ivanov
>         Assigned To: Mikhail Loenko
>         Attachments: KeyStoreTest.patch, KeyStoreTest_updated.patch, patch.txt
>
>
> The method KeyStore.TrustedCertificateEntry().toString() throws NPE on Harmony and returns
null on RI.
> ================= test.java ====================
> import java.security.*;
> import java.util.*;
> import java.math.BigInteger;
> import java.security.cert.*;
> public class test {
>   public static void main(String[] args) {
>         System.out.println("res = " + new KeyStore.TrustedCertificateEntry(new TestX509Certificate()));
>     }
> }
> class TestX509Certificate extends X509Certificate {
>         private static final long serialVersionUID = 1L;
>         public void checkValidity() throws CertificateExpiredException,CertificateNotYetValidException
{}
>         public void checkValidity(Date p) throws CertificateExpiredException, CertificateNotYetValidException
{}
>         public int getVersion() {
>                 return 0;
>         }
>         public BigInteger getSerialNumber() {
>                 return null;
>         }
>         public Principal getIssuerDN() {
>                 return null;
>         }
>         public Principal getSubjectDN() {
>                 return null;
>         }
>         public Date getNotBefore() {
>                 return null;
>         }
>         public Date getNotAfter() {
>                 return null;
>         }
>         public byte[] getTBSCertificate() throws CertificateEncodingException {
>                 return null;
>         }
>         public byte[] getSignature() {
>                 return null;
>         }
>         public String getSigAlgName() {
>                 return null;
>         }
>         public String getSigAlgOID() {
>                 return null;
>         }
>         public byte[] getSigAlgParams() {
>                 return null;
>         }
>         public boolean[] getIssuerUniqueID() {
>                 return null;
>         }
>         public boolean[] getSubjectUniqueID() {
>                 return null;
>         }
>         public boolean[] getKeyUsage() {
>                 return null;
>         }
>         public int getBasicConstraints() {
>                 return 0;
>         }
>         public byte[] getEncoded() throws CertificateEncodingException {
>                 return null;
>         }
>         public void verify(PublicKey p)
>                 throws CertificateException,
>                 NoSuchAlgorithmException,
>                 InvalidKeyException,
>                 NoSuchProviderException,
>                 SignatureException 
>         {}
>         public void verify(PublicKey p0, String p1)
>                 throws CertificateException,
>                 NoSuchAlgorithmException,
>                 InvalidKeyException,
>                 NoSuchProviderException,
>                 SignatureException 
>         {}
>         public String toString() {
>                 return null;
>         }
>         public PublicKey getPublicKey() {
>                 return null;
>         }
>         public boolean hasUnsupportedCriticalExtension() {
>                 return false;
>         }
>         public Set getCriticalExtensionOIDs() {
>                 return null;
>         }
>         public Set getNonCriticalExtensionOIDs() {
>                 return null;
>         }
>         public byte[] getExtensionValue(String p) {
>                 return null;
>         }
> }
> ============================================
> Output:
> C:\tmp\tmp17>C:\jrockit-jdk1.5.0-windows-ia32\bin\java.exe -cp . -showversion test
> java version "1.5.0"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64)
> BEA WebLogic JRockit(R) (build dra-38972-20041208-2001-win-ia32, R25.0.0-75, GC: System
optimized over throughput (initial strategy singleparpar))
> res = Trusted certificate entry:
> null
> C:\tmp\tmp17>C:\harmony\classlib1.5\deploy\jdk\jre\bin\java.exe -cp . test
> Exception in thread "main" java.lang.NullPointerException
>         at java.lang.String.concat(String.java:659)
>         at java.security.KeyStore$TrustedCertificateEntry.toString(KeyStore.java:143)
>         at java.lang.StringBuilder.append(StringBuilder.java:226)
>         at test.main(test.java:8)

-- 
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

        

Mime
View raw message