-
Bug
-
Resolution: Won't Fix
-
P4
-
None
-
1.2.0, 1.2.1, 1.2.2
-
x86, sparc
-
linux, solaris_2.5.1, solaris_2.6, windows_nt
Vector.class) in 8 ms]
[loaded /opt/java/lib/iaik_jce_full.jar(iaik/asn1/structures/Name.class) in 14 ms]
[loaded /opt/java/lib/iaik_jce_full.jar(iaik/security/provider/IAIK.class) in 13 ms]
[loaded /opt/java/lib/iaik_jce_full.jar(iaik/pkcs/pkcs8/EncryptedPrivateKeyInfo.class) in 10 ms]
[loaded /opt/java/lib/iaik_ssl.jar(demo/SSLKeyStore.class) in 7 ms]
[loaded /usr/java1.2/jre/lib/rt.jar(java/lang/Object.class) in 3 ms]
[loaded /opt/java/lib/iaik_ssl.jar(demo/KeyStoreConstants.class) in 3 ms]
[checking class demo.server.SSLServer]
[loaded /usr/java1.2/jre/lib/rt.jar(java/lang/String.class) in 9 ms]
[loaded /usr/java1.2/jre/lib/rt.jar(java/io/Serializable.class) in 1 ms]
[loaded /usr/java1.2/jre/lib/rt.jar(java/lang/Comparable.class) in 0 ms]
[loaded /usr/java1.2/jre/lib/rt.jar(java/io/IOException.class) in 1 ms]
[loaded /usr/java1.2/jre/lib/rt.jar(java/lang/Exception.class) in 0 ms]
[loaded /usr/java1.2/jre/lib/rt.jar(java/lang/Throwable.class) in 2 ms]
[loaded /usr/java1.2/jre/lib/rt.jar(java/lang/Class.class) in 8 ms]
[loaded /usr/java1.2/jre/lib/rt.jar(java/security/Provider.class) in 3 ms]
[loaded /usr/java1.2/jre/lib/rt.jar(java/util/Properties.class) in 4 ms]
[loaded /usr/java1.2/jre/lib/rt.jar(java/util/Hashtable.class) in 6 ms]
[loaded /usr/java1.2/jre/lib/rt.jar(java/util/Dictionary.class) in 1 ms]
[loaded /usr/java1.2/jre/lib/rt.jar(java/util/Map.class) in 1 ms]
[loaded /usr/java1.2/jre/lib/rt.jar(java/util/Map$Entry.class) in 1 ms]
[loaded /usr/java1.2/jre/lib/rt.jar(java/lang/Cloneable.class) in 0 ms]
[loaded /usr/java1.2/jre/lib/rt.jar(java/lang/System.class) in 5 ms]
[loaded /usr/java1.2/jre/lib/rt.jar(java/io/PrintStream.class) in 3 ms]
[loaded /usr/java1.2/jre/lib/rt.jar(java/io/FilterOutputStream.class) in 1 ms]
[loaded /usr/java1.2/jre/lib/rt.jar(java/io/OutputStream.class) in 1 ms]
[loaded /usr/java1.2/jre/lib/rt.jar(java/security/Security.class) in 8 ms]
[loaded /usr/java1.2/jre/lib/rt.jar(java/lang/ClassNotFoundException.class) in 1 ms]
[loaded /usr/java1.2/jre/lib/rt.jar(java/lang/Error.class) in 0 ms]
[loaded /usr/java1.2/jre/lib/rt.jar(java/lang/RuntimeException.class) in 0 ms]
[loaded /usr/java1.2/jre/lib/rt.jar(java/lang/InstantiationException.class) in 1 ms]
[loaded /usr/java1.2/jre/lib/rt.jar(java/lang/IllegalAccessException.class) in 0 ms]
[loaded /opt/java/lib/iaik_ssl.jar(iaik/security/ssl/SSLSocket.class) in 7 ms]
sun.tools.java.CompilerError: duplicate addition
at java.lang.Throwable.fillInStackTrace(Native Method)
at java.lang.Throwable.fillInStackTrace(Compiled Code)
at java.lang.Throwable.<init>(Compiled Code)
at java.lang.Error.<init>(Error.java:50)
at sun.tools.java.CompilerError.<init>(CompilerError.java:29)
at sun.tools.java.MethodSet.add(Compiled Code)
at sun.tools.java.ClassDefinition.collectInheritedMethods(Compiled Code)
at sun.tools.java.BinaryClass.basicCheck(Compiled Code)
at sun.tools.java.ClassDeclaration.getClassDefinition(Compiled Code)
at sun.tools.java.Environment.getQualifiedClassDefinition(Compiled Code)
at sun.tools.java.Environment.resolve(Compiled Code)
at sun.tools.tree.IdentifierExpression.toResolvedType(Compiled Code)
at sun.tools.tree.IdentifierExpression.toType(IdentifierExpression.java:344)
at sun.tools.tree.DeclarationStatement.checkBlockStatement(Compiled Code)
at sun.tools.tree.CompoundStatement.check(Compiled Code)
at sun.tools.tree.Statement.checkMethod(Statement.java:92)
at sun.tools.javac.SourceMember.check(Compiled Code)
at sun.tools.javac.SourceClass.checkMembers(Compiled Code)
at sun.tools.javac.SourceClass.checkInternal(Compiled Code)
at sun.tools.javac.SourceClass.check(SourceClass.java:511)
at sun.tools.javac.Main.compile(Compiled Code)
at sun.tools.javac.Main.main(Main.java:733)
error: An error has occurred in the compiler; please file a bug report (http://java.sun.com/cgi-bin/bugreport.cgi).
1 error
#####
##### 4.
#####
None...
#####
##### 5.
#####
Hmm... do you really need that for at compiler bug???
Well:
java -version
java version "1.2"
Solaris VM (build Solaris_JDK_1.2_01, native threads, sunwjit)
java -fullversion
java full version "Solaris_JDK_1.2_01"
#####
##### 6.
#####
None.
======================================================================
Name: tb29552 Date: 05/10/99
sun.tools.java.CompilerError: duplicate addition
at sun.tools.java.MethodSet.add(MethodSet.java:92)
at sun.tools.java.ClassDefinition.collectInheritedMethods(ClassDefinitio
n.java:1479)
at sun.tools.java.BinaryClass.basicCheck(BinaryClass.java:80)
at sun.tools.java.ClassDeclaration.getClassDefinition(ClassDeclaration.j
ava:137)
at sun.tools.java.Environment.getQualifiedClassDefinition(Environment.ja
va:399)
at sun.tools.java.Environment.resolve(Environment.java:226)
at sun.tools.tree.FieldExpression.toType(FieldExpression.java:195)
at sun.tools.tree.DeclarationStatement.checkBlockStatement(DeclarationSt
atement.java:51)
at sun.tools.tree.CompoundStatement.check(CompoundStatement.java:65)
at sun.tools.tree.Statement.checkMethod(Statement.java:92)
at sun.tools.javac.SourceMember.check(SourceMember.java:539)
at sun.tools.javac.SourceClass.checkMembers(SourceClass.java:1002)
at sun.tools.javac.SourceClass.checkInternal(SourceClass.java:612)
at sun.tools.javac.SourceClass.check(SourceClass.java:511)
at sun.tools.javac.Main.compile(Main.java:550)
at sun.tools.javac.Main.main(Main.java:733)
error: An error has occurred in the compiler; please file a bug report (http://j
ava.sun.com/cgi-bin/bugreport.cgi).
I get this error message after compiling my software with a new
release of the IAIK JCE 2.5 release (with thr 2.5beta 1 everything
worked fine). I don't think it is a problem with the IAIK-Software,
because of the internal error
(Review ID: 58010)
======================================================================
Name: tb29552 Date: 05/14/99
Whenever we are compiling a code with IAIK JCE 2.5(and before) implementation
of X509CRL class the following error is reported
////Error
sun.tools.java.CompilerError: duplicate addition
at sun.tools.java.MethodSet.add(Compiled Code)
at sun.tools.java.ClassDefinition.collectInheritedMethods(Compiled Code)
at sun.tools.java.BinaryClass.basicCheck(BinaryClass.java:80)
at sun.tools.java.ClassDeclaration.getClassDefinition(Compiled Code)
at sun.tools.java.Environment.getQualifiedClassDefinition(Compiled Code)
at sun.tools.java.Environment.resolve(Compiled Code)
at sun.tools.tree.IdentifierExpression.toResolvedType(IdentifierExpression.java
:312)
at sun.tools.tree.IdentifierExpression.toType(IdentifierExpression.java:344)
at sun.tools.tree.DeclarationStatement.checkBlockStatement(Compiled Code)
at sun.tools.tree.CompoundStatement.check(Compiled Code)
at sun.tools.tree.Statement.checkMethod(Statement.java:92)
at sun.tools.javac.SourceMember.check(Compiled Code)
at sun.tools.javac.SourceClass.checkMembers(Compiled Code)
at sun.tools.javac.SourceClass.checkInternal(Compiled Code)
at sun.tools.javac.SourceClass.check(SourceClass.java:511)
at sun.tools.javac.Main.compile(Compiled Code)
at sun.tools.javac.Main.main(Main.java:733)
error: An error has occurred in the compiler; please file a bug report (http://java.sun
.com/cgi-bin/bugreport.cgi).
1 error
//Code below
//iaik_jce_full.jar class file is included in the class path
import java.io.*;
import iaik.x509.X509CRL;
import java.security.*;
public class CRLTest {
public CRLTest(String fIn)throws Exception
{
InputStream inFile = new FileInputStream(fIn);
X509CRL thisCRL = new X509CRL(inFile);
System.out.println("The CRL is:");
System.out.println(thisCRL.toString());
inFile.close();
}
public static void main(String[] args) throws Exception
{
Security.addProvider(new IAIK());
CRLTest crl = new CRLTest(args[0]);
}
}
//Configuration: iaik_jce_full.jar has to be added to the class path.
//Steps to reproduce this problem is to compile the above code
//This error is coming with Windows 95 also.
(Review ID: 63181)
======================================================================
Name: tb29552 Date: 05/28/99
I'm getting the problem when I use IAIK's X509Crl class.
iaik.x509.X509CRL crl=new iaik.x509.X509CRL;
The error I'm getting is
sun.tools.java.CompilerError: duplicate addition
at sun.tools.java.MethodSet.add(Compiled Code)
...
...
...
at sun.tools.javaac.Main.main(Main.java)
(Review ID: 83602)
======================================================================
Name: krT82822 Date: 03/02/99
I was rejigging several classes at the same time. Attempted a compile of the "new" top level one, and.....
sun.tools.java.CompilerError: duplicate addition
at sun.tools.java.MethodSet.add(Compiled Code)
at sun.tools.java.ClassDefinition.collectInheritedMethods(Compiled Code)
at sun.tools.java.ClassDefinition.getMethods(Compiled Code)
at sun.tools.java.ClassDefinition.collectOneClass(Compiled Code)
at sun.tools.java.ClassDefinition.collectInheritedMethods(Compiled Code)
at sun.tools.java.BinaryClass.basicCheck(Compiled Code)
at sun.tools.java.ClassDeclaration.getClassDefinition(Compiled Code)
at sun.tools.java.BinaryClass.initInnerClasses(Compiled Code)
at sun.tools.java.BinaryClass.loadNested(Compiled Code)
at sun.tools.java.BinaryClass.loadNested(Compiled Code)
at sun.tools.javac.BatchEnvironment.loadDefinition(Compiled Code)
at sun.tools.java.ClassDeclaration.getClassDefinition(Compiled Code)
at sun.tools.java.BinaryClass.initInnerClasses(Compiled Code)
at sun.tools.java.BinaryClass.loadNested(Compiled Code)
at sun.tools.java.BinaryClass.loadNested(Compiled Code)
at sun.tools.javac.BatchEnvironment.loadDefinition(Compiled Code)
at sun.tools.java.Environment.loadDefinition(Compiled Code)
at sun.tools.java.Environment.loadDefinition(Compiled Code)
at sun.tools.java.Environment.loadDefinition(Compiled Code)
at sun.tools.java.ClassDeclaration.getClassDefinition(Compiled Code)
at sun.tools.java.Environment.getClassDefinition(Compiled Code)
at sun.tools.java.ClassDefinition.resolveName(Compiled Code)
at sun.tools.javac.SourceClass.resolveSuper(Compiled Code)
at sun.tools.javac.SourceClass.resolveSupers(Compiled Code)
at sun.tools.javac.SourceClass.resolveTypeStructure(Compiled Code)
at sun.tools.javac.SourceMember.resolveTypeStructure(Compiled Code)
at sun.tools.javac.SourceClass.resolveTypeStructure(Compiled Code)
at sun.tools.javac.SourceClass.basicCheck(Compiled Code)
at sun.tools.java.ClassDeclaration.getClassDefinition(Compiled Code)
at sun.tools.javac.Main.compile(Compiled Code)
at sun.tools.javac.Main.main(Compiled Code)
error: An error has occurred in the compiler; please file a bug report (http://java.sun.com/cgi-bin/bugreport.cgi).
1 error
Compilation exited abnormally with code 4 at Tue Feb 16 16:30:38
(Review ID: 54228)
======================================================================
Name: tb29552 Date: 04/09/99
#####
##### 1.
#####
Compile the IAIK SSL implementation (iSaSiLk) demo
(see: http://jcewww.iaik.tu-graz.ac.at/) with:
javac -verbose -classpath $CLASSPATH:/opt/java/lib/iaik_ssl.jar:/opt/java/lib/iaik_jce_full.jar SSLServer.java
(also non-verbose fails)
#####
##### 2.
#####
SSLServer:
// Copyright (C) 1997, 1998, 1999 by DI Wolfgang Platzer, IAIK
// email: ###@###.###
//
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
// SUCH DAMAGE.
//
package demo.server;
import java.io.*;
import java.net.*;
import java.security.*;
import java.math.BigInteger;
import java.security.spec.InvalidParameterSpecException;
import java.security.cert.X509Certificate;
import java.util.Vector;
import javax.crypto.spec.*;
import iaik.security.ssl.*;
import iaik.security.rsa.*;
import iaik.asn1.structures.Name;
import iaik.asn1.*;
import iaik.security.provider.IAIK;
import iaik.pkcs.*;
import iaik.security.dh.*;
import iaik.security.dsa.*;
import iaik.pkcs.pkcs8.EncryptedPrivateKeyInfo;
import demo.SSLKeyStore;
/**
* Demo SSL server implementation.
*
* Waits for a SSL connection from a SSL browser and returns the string:
* "SSL Test ok.".
*
* @author wplatzer
*/
public class SSLServer implements demo.KeyStoreConstants {
// shall we renegotiate the cipher suite
static boolean renegotiate = false;
static int port = 4433;
public static void main(String args[]) throws IOException {
try {
// first try to locate the IAIK provider
Class provider = Class.forName("iaik.security.provider.IAIK");
Provider iaik = (Provider)provider.newInstance();
System.out.println("add Provider "+iaik.getInfo()+"...");
Security.addProvider(iaik);
} catch (ClassNotFoundException ex) {
System.out.println("Provider IAIK not found. Add iaik_jce.jar or iaik_jce_full.jar to your classpath.");
System.out.println("If you are going to use a different provider please take a look at Readme.html!");
System.exit(0);
} catch (Exception ex) {
System.out.println("Internal Error. Please report this bug to <###@###.###>.");
System.exit(0);
}
// the accepted client SSL socket
SSLSocket ssl = null;
// the server context
SSLServerContext serverContext = new SSLServerContext();
// use pre-generated Diffi-Hellman parameters
boolean generateDHParameters = false;
// the pre-generated Diffi-Hellman parameters
DHParameterSpec dhparam = null;
// set a TrustDecider which checks the certificates sent by clients
DemoServerTrustDecider trustDecider = new DemoServerTrustDecider();
// no certificate is also ok
trustDecider.setRequireCertificate(false);
// client chain need no trusted root
trustDecider.setRequireTrustedRoot(false);
// set the trust decider
serverContext.setTrustDecider(trustDecider);
// Vector which holds the CAs
Vector cas = new Vector();
final SecureRandom random = serverContext.getRandomGenerator();
// create a new Thread which initializes the Secure Random Number generator
(new Thread() {
public void run() {
try {
setPriority(Thread.MIN_PRIORITY);
random.nextInt();
System.out.println("random number generator initialized...");
} catch (Exception ex) {
ex.printStackTrace();
}
}
}).start();
if (generateDHParameters) {
System.out.println("generating new DH parameters...\n");
try {
int primeLength = 512; // length of prime p to generate
int exponentLength = 504; // length of random exponent (private)
DHGenParameterSpec genParamSpec = new DHGenParameterSpec(primeLength, exponentLength);
AlgorithmParameterGenerator paramGenerator = AlgorithmParameterGenerator.getInstance("DH");
paramGenerator.init(genParamSpec);
AlgorithmParameters parameters = paramGenerator.generateParameters();
// we need the class for getParameterSpec(Class)
Class classSpec = new DHParameterSpec(null, null).getClass();
dhparam = (DHParameterSpec)parameters.getParameterSpec(classSpec);
} catch (NoSuchAlgorithmException ex) {
System.out.println("Unable to generate DH parameters: "+ex.toString());
dhparam = null;
} catch (InvalidAlgorithmParameterException ex) {
System.out.println("Unable to generate DH parameters: "+ex.toString());
dhparam = null;
} catch (InvalidParameterSpecException ex) {
System.out.println("Unable to generate DH parameters: "+ex.toString());
dhparam = null;
}
}
else {
// pre-generated Diffi-Hellman parameters
BigInteger p = new BigInteger("da583c16d9852289d0e4af756f4cca92dd4be533b804fb0fed94ef9c8a4403ed574650d36999db29d776276ba2d3d412e218f4dd1e084cf6d8003e7c4774e833", 16);
BigInteger g = BigInteger.valueOf(2);
dhparam = new DHParameterSpec(p, g);
}
// set the DH parameter for empherial and anon cipher suites
serverContext.setDHParameter(dhparam);
try {
// set the RSA certificate/private key for RSA cipher suites
X509Certificate[] chain = SSLKeyStore.getCertificateChain(RSA, SERVER);
serverContext.setRSACertificate(chain, SSLKeyStore.getPrivateKey(RSA, SERVER));
// add the RSA CA certificate
Principal dn = trustDecider.addTrustedSigner(chain[1]);
cas.addElement(dn);
// set the temporary RSA key pair for RSA_EXPORT cipher suites
serverContext.setRSATempKeyPair(SSLKeyStore.getRSATempKeyPair());
} catch (Exception ex) {
System.out.println("Unable to get RSA server certificate from KeyStore.");
System.out.println("RSA cipher-suites can not be used.");
}
try {
// set the DSA certificate/private key for DSA cipher suites
X509Certificate[] chain = SSLKeyStore.getCertificateChain(DSA, SERVER);
serverContext.setDSACertificate(chain, SSLKeyStore.getPrivateKey(DSA, SERVER));
// add the DSA CA certificate
Principal dn = trustDecider.addTrustedSigner(chain[1]);
cas.addElement(dn);
} catch (Exception ex) {
System.out.println("Unable to get DSA server certificate from KeyStore.");
System.out.println("DSA cipher-suites can not be used.");
}
try {
// set the DH certificate/private key for DH cipher suites
serverContext.setDHCertificate(
SSLKeyStore.getCertificateChain(DH, SERVER),
SSLKeyStore.getPrivateKey(DH, SERVER));
} catch (Exception ex) {
System.out.println("Unable to get Diffie-Hellman server certificate from KeyStore.");
System.out.println("Diffie-Hellman cipher-suites can not be used.");
}
// for testing the cipher suites
CipherSuite[] cs = {
CipherSuite.SSL_RSA_WITH_NULL_MD5,
CipherSuite.SSL_RSA_WITH_NULL_SHA,
CipherSuite.SSL_RSA_EXPORT_WITH_RC4_40_MD5,
CipherSuite.SSL_RSA_WITH_RC4_MD5,
CipherSuite.SSL_RSA_WITH_RC4_SHA,
CipherSuite.SSL_RSA_EXPORT_WITH_RC2_CBC_40_MD5,
CipherSuite.SSL_RSA_WITH_IDEA_CBC_SHA,
CipherSuite.SSL_RSA_EXPORT_WITH_DES40_CBC_SHA,
CipherSuite.SSL_RSA_WITH_DES_CBC_SHA,
CipherSuite.SSL_RSA_WITH_3DES_EDE_CBC_SHA,
CipherSuite.SSL_DH_DSS_EXPORT_WITH_DES40_CBC_SHA,
CipherSuite.SSL_DH_DSS_WITH_DES_CBC_SHA,
CipherSuite.SSL_DH_DSS_WITH_3DES_EDE_CBC_SHA,
CipherSuite.SSL_DH_RSA_EXPORT_WITH_DES40_CBC_SHA,
CipherSuite.SSL_DH_RSA_WITH_DES_CBC_SHA,
CipherSuite.SSL_DH_RSA_WITH_3DES_EDE_CBC_SHA,
CipherSuite.SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA,
CipherSuite.SSL_DHE_DSS_WITH_DES_CBC_SHA,
CipherSuite.SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA,
CipherSuite.SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA,
CipherSuite.SSL_DHE_RSA_WITH_DES_CBC_SHA,
CipherSuite.SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA,
CipherSuite.SSL_DH_anon_EXPORT_WITH_RC4_40_MD5,
CipherSuite.SSL_DH_anon_WITH_RC4_MD5,
CipherSuite.SSL_DH_anon_EXPORT_WITH_DES40_CBC_SHA,
CipherSuite.SSL_DH_anon_WITH_DES_CBC_SHA,
CipherSuite.SSL_DH_anon_WITH_3DES_EDE_CBC_SHA,
};
// serverContext.setEnabledCipherSuites(cs);
// enable all possible cipher suites
CipherSuite[] enabledCS = serverContext.updateCipherSuites();
// require a client certificate ?
Name[] acceptedCAs = new Name[cas.size()];
cas.copyInto(acceptedCAs);
byte[] types = {
ClientTrustDecider.rsa_sign,
ClientTrustDecider.dss_sign
};
serverContext.setRequireClientCertificate(types, acceptedCAs);
System.out.println(serverContext);
System.out.println("listening on port "+port+"...");
SSLServerSocket server = new SSLServerSocket(port, serverContext);
while (true) {
try {
ssl = (SSLSocket)server.accept();
ssl.setDebugStream(System.out); // debug information to System.out
ssl.setSoTimeout(1000*60*5); // we just wait for 5 minutes
OutputStream os = ssl.getOutputStream();
InputStream is = ssl.getInputStream();
System.out.println("Client Request:");
BufferedReader reader = new BufferedReader(new InputStreamReader(is));
String line;
do {
line = reader.readLine();
System.out.println(line);
} while ((line != null) && (line.length() > 0));
System.out.println();
if (renegotiate) {
System.out.println("renegotiating cipher-suite...");
// at this time we only allow one cipher-suite
CipherSuite[] new_cs = new CipherSuite[] {CipherSuite.SSL_RSA_EXPORT_WITH_RC4_40_MD5};
SSLContext context = ssl.getContext();
context.setEnabledCipherSuites(new_cs);
ssl.setContext(context);
ssl.renegotiate();
}
System.out.println("sending reply...");
PrintWriter writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(os), 2000));
writer.println("HTTP/1.0 200 OK");
writer.println("Content-Type: text/html");
writer.println("Server: IAIK-SSL Testserver");
writer.println();
writer.println("<HTML><HEAD>");
writer.println("<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html;CHARSET=iso-8859-1\">");
writer.println("<TITLE>SSL Test</TITLE>");
writer.println("</HEAD>");
writer.println("<BODY>");
writer.println("<H1>SSL Test ok.</H1>");
writer.println("</BODY>");
writer.println("</HTML>");
writer.flush();
writer.close();
} catch (UnknownHostException ex) {
System.out.println("UnknownHostException: "+ex.getMessage());
} catch (SSLException ex) {
System.out.println("SSLException: "+ex.getMessage());
} catch (IOException ex) {
System.out.println("IOException: "+ex.getMessage());
}
}
}
}
#####
##### 3.
#####
[parsed SSLServer.java in 976 ms]
[loaded /usr/java1.2/jre/lib/rt.jar(java/math/BigInteger.class) in 69 ms]
[loaded /usr/java1.2/jre/lib/rt.jar(java/security/spec/InvalidParameterSpecException.class) in 1 ms]
[loaded /usr/java1.2/jre/lib/rt.jar(java/security/cert/X509Certificate.class) in 3 ms]
[loaded /usr/java1.2/jre/lib/rt.jar(java/util/
[loaded /opt/java/lib/iaik_jce_full.jar(iaik/asn1/structures/Name.class) in 14 ms]
[loaded /opt/java/lib/iaik_jce_full.jar(iaik/security/provider/IAIK.class) in 13 ms]
[loaded /opt/java/lib/iaik_jce_full.jar(iaik/pkcs/pkcs8/EncryptedPrivateKeyInfo.class) in 10 ms]
[loaded /opt/java/lib/iaik_ssl.jar(demo/SSLKeyStore.class) in 7 ms]
[loaded /usr/java1.2/jre/lib/rt.jar(java/lang/Object.class) in 3 ms]
[loaded /opt/java/lib/iaik_ssl.jar(demo/KeyStoreConstants.class) in 3 ms]
[checking class demo.server.SSLServer]
[loaded /usr/java1.2/jre/lib/rt.jar(java/lang/String.class) in 9 ms]
[loaded /usr/java1.2/jre/lib/rt.jar(java/io/Serializable.class) in 1 ms]
[loaded /usr/java1.2/jre/lib/rt.jar(java/lang/Comparable.class) in 0 ms]
[loaded /usr/java1.2/jre/lib/rt.jar(java/io/IOException.class) in 1 ms]
[loaded /usr/java1.2/jre/lib/rt.jar(java/lang/Exception.class) in 0 ms]
[loaded /usr/java1.2/jre/lib/rt.jar(java/lang/Throwable.class) in 2 ms]
[loaded /usr/java1.2/jre/lib/rt.jar(java/lang/Class.class) in 8 ms]
[loaded /usr/java1.2/jre/lib/rt.jar(java/security/Provider.class) in 3 ms]
[loaded /usr/java1.2/jre/lib/rt.jar(java/util/Properties.class) in 4 ms]
[loaded /usr/java1.2/jre/lib/rt.jar(java/util/Hashtable.class) in 6 ms]
[loaded /usr/java1.2/jre/lib/rt.jar(java/util/Dictionary.class) in 1 ms]
[loaded /usr/java1.2/jre/lib/rt.jar(java/util/Map.class) in 1 ms]
[loaded /usr/java1.2/jre/lib/rt.jar(java/util/Map$Entry.class) in 1 ms]
[loaded /usr/java1.2/jre/lib/rt.jar(java/lang/Cloneable.class) in 0 ms]
[loaded /usr/java1.2/jre/lib/rt.jar(java/lang/System.class) in 5 ms]
[loaded /usr/java1.2/jre/lib/rt.jar(java/io/PrintStream.class) in 3 ms]
[loaded /usr/java1.2/jre/lib/rt.jar(java/io/FilterOutputStream.class) in 1 ms]
[loaded /usr/java1.2/jre/lib/rt.jar(java/io/OutputStream.class) in 1 ms]
[loaded /usr/java1.2/jre/lib/rt.jar(java/security/Security.class) in 8 ms]
[loaded /usr/java1.2/jre/lib/rt.jar(java/lang/ClassNotFoundException.class) in 1 ms]
[loaded /usr/java1.2/jre/lib/rt.jar(java/lang/Error.class) in 0 ms]
[loaded /usr/java1.2/jre/lib/rt.jar(java/lang/RuntimeException.class) in 0 ms]
[loaded /usr/java1.2/jre/lib/rt.jar(java/lang/InstantiationException.class) in 1 ms]
[loaded /usr/java1.2/jre/lib/rt.jar(java/lang/IllegalAccessException.class) in 0 ms]
[loaded /opt/java/lib/iaik_ssl.jar(iaik/security/ssl/SSLSocket.class) in 7 ms]
sun.tools.java.CompilerError: duplicate addition
at java.lang.Throwable.fillInStackTrace(Native Method)
at java.lang.Throwable.fillInStackTrace(Compiled Code)
at java.lang.Throwable.<init>(Compiled Code)
at java.lang.Error.<init>(Error.java:50)
at sun.tools.java.CompilerError.<init>(CompilerError.java:29)
at sun.tools.java.MethodSet.add(Compiled Code)
at sun.tools.java.ClassDefinition.collectInheritedMethods(Compiled Code)
at sun.tools.java.BinaryClass.basicCheck(Compiled Code)
at sun.tools.java.ClassDeclaration.getClassDefinition(Compiled Code)
at sun.tools.java.Environment.getQualifiedClassDefinition(Compiled Code)
at sun.tools.java.Environment.resolve(Compiled Code)
at sun.tools.tree.IdentifierExpression.toResolvedType(Compiled Code)
at sun.tools.tree.IdentifierExpression.toType(IdentifierExpression.java:344)
at sun.tools.tree.DeclarationStatement.checkBlockStatement(Compiled Code)
at sun.tools.tree.CompoundStatement.check(Compiled Code)
at sun.tools.tree.Statement.checkMethod(Statement.java:92)
at sun.tools.javac.SourceMember.check(Compiled Code)
at sun.tools.javac.SourceClass.checkMembers(Compiled Code)
at sun.tools.javac.SourceClass.checkInternal(Compiled Code)
at sun.tools.javac.SourceClass.check(SourceClass.java:511)
at sun.tools.javac.Main.compile(Compiled Code)
at sun.tools.javac.Main.main(Main.java:733)
error: An error has occurred in the compiler; please file a bug report (http://java.sun.com/cgi-bin/bugreport.cgi).
1 error
#####
##### 4.
#####
None...
#####
##### 5.
#####
Hmm... do you really need that for at compiler bug???
Well:
java -version
java version "1.2"
Solaris VM (build Solaris_JDK_1.2_01, native threads, sunwjit)
java -fullversion
java full version "Solaris_JDK_1.2_01"
#####
##### 6.
#####
None.
======================================================================
Name: tb29552 Date: 05/10/99
sun.tools.java.CompilerError: duplicate addition
at sun.tools.java.MethodSet.add(MethodSet.java:92)
at sun.tools.java.ClassDefinition.collectInheritedMethods(ClassDefinitio
n.java:1479)
at sun.tools.java.BinaryClass.basicCheck(BinaryClass.java:80)
at sun.tools.java.ClassDeclaration.getClassDefinition(ClassDeclaration.j
ava:137)
at sun.tools.java.Environment.getQualifiedClassDefinition(Environment.ja
va:399)
at sun.tools.java.Environment.resolve(Environment.java:226)
at sun.tools.tree.FieldExpression.toType(FieldExpression.java:195)
at sun.tools.tree.DeclarationStatement.checkBlockStatement(DeclarationSt
atement.java:51)
at sun.tools.tree.CompoundStatement.check(CompoundStatement.java:65)
at sun.tools.tree.Statement.checkMethod(Statement.java:92)
at sun.tools.javac.SourceMember.check(SourceMember.java:539)
at sun.tools.javac.SourceClass.checkMembers(SourceClass.java:1002)
at sun.tools.javac.SourceClass.checkInternal(SourceClass.java:612)
at sun.tools.javac.SourceClass.check(SourceClass.java:511)
at sun.tools.javac.Main.compile(Main.java:550)
at sun.tools.javac.Main.main(Main.java:733)
error: An error has occurred in the compiler; please file a bug report (http://j
ava.sun.com/cgi-bin/bugreport.cgi).
I get this error message after compiling my software with a new
release of the IAIK JCE 2.5 release (with thr 2.5beta 1 everything
worked fine). I don't think it is a problem with the IAIK-Software,
because of the internal error
(Review ID: 58010)
======================================================================
Name: tb29552 Date: 05/14/99
Whenever we are compiling a code with IAIK JCE 2.5(and before) implementation
of X509CRL class the following error is reported
////Error
sun.tools.java.CompilerError: duplicate addition
at sun.tools.java.MethodSet.add(Compiled Code)
at sun.tools.java.ClassDefinition.collectInheritedMethods(Compiled Code)
at sun.tools.java.BinaryClass.basicCheck(BinaryClass.java:80)
at sun.tools.java.ClassDeclaration.getClassDefinition(Compiled Code)
at sun.tools.java.Environment.getQualifiedClassDefinition(Compiled Code)
at sun.tools.java.Environment.resolve(Compiled Code)
at sun.tools.tree.IdentifierExpression.toResolvedType(IdentifierExpression.java
:312)
at sun.tools.tree.IdentifierExpression.toType(IdentifierExpression.java:344)
at sun.tools.tree.DeclarationStatement.checkBlockStatement(Compiled Code)
at sun.tools.tree.CompoundStatement.check(Compiled Code)
at sun.tools.tree.Statement.checkMethod(Statement.java:92)
at sun.tools.javac.SourceMember.check(Compiled Code)
at sun.tools.javac.SourceClass.checkMembers(Compiled Code)
at sun.tools.javac.SourceClass.checkInternal(Compiled Code)
at sun.tools.javac.SourceClass.check(SourceClass.java:511)
at sun.tools.javac.Main.compile(Compiled Code)
at sun.tools.javac.Main.main(Main.java:733)
error: An error has occurred in the compiler; please file a bug report (http://java.sun
.com/cgi-bin/bugreport.cgi).
1 error
//Code below
//iaik_jce_full.jar class file is included in the class path
import java.io.*;
import iaik.x509.X509CRL;
import java.security.*;
public class CRLTest {
public CRLTest(String fIn)throws Exception
{
InputStream inFile = new FileInputStream(fIn);
X509CRL thisCRL = new X509CRL(inFile);
System.out.println("The CRL is:");
System.out.println(thisCRL.toString());
inFile.close();
}
public static void main(String[] args) throws Exception
{
Security.addProvider(new IAIK());
CRLTest crl = new CRLTest(args[0]);
}
}
//Configuration: iaik_jce_full.jar has to be added to the class path.
//Steps to reproduce this problem is to compile the above code
//This error is coming with Windows 95 also.
(Review ID: 63181)
======================================================================
Name: tb29552 Date: 05/28/99
I'm getting the problem when I use IAIK's X509Crl class.
iaik.x509.X509CRL crl=new iaik.x509.X509CRL;
The error I'm getting is
sun.tools.java.CompilerError: duplicate addition
at sun.tools.java.MethodSet.add(Compiled Code)
...
...
...
at sun.tools.javaac.Main.main(Main.java)
(Review ID: 83602)
======================================================================
Name: krT82822 Date: 03/02/99
I was rejigging several classes at the same time. Attempted a compile of the "new" top level one, and.....
sun.tools.java.CompilerError: duplicate addition
at sun.tools.java.MethodSet.add(Compiled Code)
at sun.tools.java.ClassDefinition.collectInheritedMethods(Compiled Code)
at sun.tools.java.ClassDefinition.getMethods(Compiled Code)
at sun.tools.java.ClassDefinition.collectOneClass(Compiled Code)
at sun.tools.java.ClassDefinition.collectInheritedMethods(Compiled Code)
at sun.tools.java.BinaryClass.basicCheck(Compiled Code)
at sun.tools.java.ClassDeclaration.getClassDefinition(Compiled Code)
at sun.tools.java.BinaryClass.initInnerClasses(Compiled Code)
at sun.tools.java.BinaryClass.loadNested(Compiled Code)
at sun.tools.java.BinaryClass.loadNested(Compiled Code)
at sun.tools.javac.BatchEnvironment.loadDefinition(Compiled Code)
at sun.tools.java.ClassDeclaration.getClassDefinition(Compiled Code)
at sun.tools.java.BinaryClass.initInnerClasses(Compiled Code)
at sun.tools.java.BinaryClass.loadNested(Compiled Code)
at sun.tools.java.BinaryClass.loadNested(Compiled Code)
at sun.tools.javac.BatchEnvironment.loadDefinition(Compiled Code)
at sun.tools.java.Environment.loadDefinition(Compiled Code)
at sun.tools.java.Environment.loadDefinition(Compiled Code)
at sun.tools.java.Environment.loadDefinition(Compiled Code)
at sun.tools.java.ClassDeclaration.getClassDefinition(Compiled Code)
at sun.tools.java.Environment.getClassDefinition(Compiled Code)
at sun.tools.java.ClassDefinition.resolveName(Compiled Code)
at sun.tools.javac.SourceClass.resolveSuper(Compiled Code)
at sun.tools.javac.SourceClass.resolveSupers(Compiled Code)
at sun.tools.javac.SourceClass.resolveTypeStructure(Compiled Code)
at sun.tools.javac.SourceMember.resolveTypeStructure(Compiled Code)
at sun.tools.javac.SourceClass.resolveTypeStructure(Compiled Code)
at sun.tools.javac.SourceClass.basicCheck(Compiled Code)
at sun.tools.java.ClassDeclaration.getClassDefinition(Compiled Code)
at sun.tools.javac.Main.compile(Compiled Code)
at sun.tools.javac.Main.main(Compiled Code)
error: An error has occurred in the compiler; please file a bug report (http://java.sun.com/cgi-bin/bugreport.cgi).
1 error
Compilation exited abnormally with code 4 at Tue Feb 16 16:30:38
(Review ID: 54228)
======================================================================
Name: tb29552 Date: 04/09/99
#####
##### 1.
#####
Compile the IAIK SSL implementation (iSaSiLk) demo
(see: http://jcewww.iaik.tu-graz.ac.at/) with:
javac -verbose -classpath $CLASSPATH:/opt/java/lib/iaik_ssl.jar:/opt/java/lib/iaik_jce_full.jar SSLServer.java
(also non-verbose fails)
#####
##### 2.
#####
SSLServer:
// Copyright (C) 1997, 1998, 1999 by DI Wolfgang Platzer, IAIK
// email: ###@###.###
//
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
// SUCH DAMAGE.
//
package demo.server;
import java.io.*;
import java.net.*;
import java.security.*;
import java.math.BigInteger;
import java.security.spec.InvalidParameterSpecException;
import java.security.cert.X509Certificate;
import java.util.Vector;
import javax.crypto.spec.*;
import iaik.security.ssl.*;
import iaik.security.rsa.*;
import iaik.asn1.structures.Name;
import iaik.asn1.*;
import iaik.security.provider.IAIK;
import iaik.pkcs.*;
import iaik.security.dh.*;
import iaik.security.dsa.*;
import iaik.pkcs.pkcs8.EncryptedPrivateKeyInfo;
import demo.SSLKeyStore;
/**
* Demo SSL server implementation.
*
* Waits for a SSL connection from a SSL browser and returns the string:
* "SSL Test ok.".
*
* @author wplatzer
*/
public class SSLServer implements demo.KeyStoreConstants {
// shall we renegotiate the cipher suite
static boolean renegotiate = false;
static int port = 4433;
public static void main(String args[]) throws IOException {
try {
// first try to locate the IAIK provider
Class provider = Class.forName("iaik.security.provider.IAIK");
Provider iaik = (Provider)provider.newInstance();
System.out.println("add Provider "+iaik.getInfo()+"...");
Security.addProvider(iaik);
} catch (ClassNotFoundException ex) {
System.out.println("Provider IAIK not found. Add iaik_jce.jar or iaik_jce_full.jar to your classpath.");
System.out.println("If you are going to use a different provider please take a look at Readme.html!");
System.exit(0);
} catch (Exception ex) {
System.out.println("Internal Error. Please report this bug to <###@###.###>.");
System.exit(0);
}
// the accepted client SSL socket
SSLSocket ssl = null;
// the server context
SSLServerContext serverContext = new SSLServerContext();
// use pre-generated Diffi-Hellman parameters
boolean generateDHParameters = false;
// the pre-generated Diffi-Hellman parameters
DHParameterSpec dhparam = null;
// set a TrustDecider which checks the certificates sent by clients
DemoServerTrustDecider trustDecider = new DemoServerTrustDecider();
// no certificate is also ok
trustDecider.setRequireCertificate(false);
// client chain need no trusted root
trustDecider.setRequireTrustedRoot(false);
// set the trust decider
serverContext.setTrustDecider(trustDecider);
// Vector which holds the CAs
Vector cas = new Vector();
final SecureRandom random = serverContext.getRandomGenerator();
// create a new Thread which initializes the Secure Random Number generator
(new Thread() {
public void run() {
try {
setPriority(Thread.MIN_PRIORITY);
random.nextInt();
System.out.println("random number generator initialized...");
} catch (Exception ex) {
ex.printStackTrace();
}
}
}).start();
if (generateDHParameters) {
System.out.println("generating new DH parameters...\n");
try {
int primeLength = 512; // length of prime p to generate
int exponentLength = 504; // length of random exponent (private)
DHGenParameterSpec genParamSpec = new DHGenParameterSpec(primeLength, exponentLength);
AlgorithmParameterGenerator paramGenerator = AlgorithmParameterGenerator.getInstance("DH");
paramGenerator.init(genParamSpec);
AlgorithmParameters parameters = paramGenerator.generateParameters();
// we need the class for getParameterSpec(Class)
Class classSpec = new DHParameterSpec(null, null).getClass();
dhparam = (DHParameterSpec)parameters.getParameterSpec(classSpec);
} catch (NoSuchAlgorithmException ex) {
System.out.println("Unable to generate DH parameters: "+ex.toString());
dhparam = null;
} catch (InvalidAlgorithmParameterException ex) {
System.out.println("Unable to generate DH parameters: "+ex.toString());
dhparam = null;
} catch (InvalidParameterSpecException ex) {
System.out.println("Unable to generate DH parameters: "+ex.toString());
dhparam = null;
}
}
else {
// pre-generated Diffi-Hellman parameters
BigInteger p = new BigInteger("da583c16d9852289d0e4af756f4cca92dd4be533b804fb0fed94ef9c8a4403ed574650d36999db29d776276ba2d3d412e218f4dd1e084cf6d8003e7c4774e833", 16);
BigInteger g = BigInteger.valueOf(2);
dhparam = new DHParameterSpec(p, g);
}
// set the DH parameter for empherial and anon cipher suites
serverContext.setDHParameter(dhparam);
try {
// set the RSA certificate/private key for RSA cipher suites
X509Certificate[] chain = SSLKeyStore.getCertificateChain(RSA, SERVER);
serverContext.setRSACertificate(chain, SSLKeyStore.getPrivateKey(RSA, SERVER));
// add the RSA CA certificate
Principal dn = trustDecider.addTrustedSigner(chain[1]);
cas.addElement(dn);
// set the temporary RSA key pair for RSA_EXPORT cipher suites
serverContext.setRSATempKeyPair(SSLKeyStore.getRSATempKeyPair());
} catch (Exception ex) {
System.out.println("Unable to get RSA server certificate from KeyStore.");
System.out.println("RSA cipher-suites can not be used.");
}
try {
// set the DSA certificate/private key for DSA cipher suites
X509Certificate[] chain = SSLKeyStore.getCertificateChain(DSA, SERVER);
serverContext.setDSACertificate(chain, SSLKeyStore.getPrivateKey(DSA, SERVER));
// add the DSA CA certificate
Principal dn = trustDecider.addTrustedSigner(chain[1]);
cas.addElement(dn);
} catch (Exception ex) {
System.out.println("Unable to get DSA server certificate from KeyStore.");
System.out.println("DSA cipher-suites can not be used.");
}
try {
// set the DH certificate/private key for DH cipher suites
serverContext.setDHCertificate(
SSLKeyStore.getCertificateChain(DH, SERVER),
SSLKeyStore.getPrivateKey(DH, SERVER));
} catch (Exception ex) {
System.out.println("Unable to get Diffie-Hellman server certificate from KeyStore.");
System.out.println("Diffie-Hellman cipher-suites can not be used.");
}
// for testing the cipher suites
CipherSuite[] cs = {
CipherSuite.SSL_RSA_WITH_NULL_MD5,
CipherSuite.SSL_RSA_WITH_NULL_SHA,
CipherSuite.SSL_RSA_EXPORT_WITH_RC4_40_MD5,
CipherSuite.SSL_RSA_WITH_RC4_MD5,
CipherSuite.SSL_RSA_WITH_RC4_SHA,
CipherSuite.SSL_RSA_EXPORT_WITH_RC2_CBC_40_MD5,
CipherSuite.SSL_RSA_WITH_IDEA_CBC_SHA,
CipherSuite.SSL_RSA_EXPORT_WITH_DES40_CBC_SHA,
CipherSuite.SSL_RSA_WITH_DES_CBC_SHA,
CipherSuite.SSL_RSA_WITH_3DES_EDE_CBC_SHA,
CipherSuite.SSL_DH_DSS_EXPORT_WITH_DES40_CBC_SHA,
CipherSuite.SSL_DH_DSS_WITH_DES_CBC_SHA,
CipherSuite.SSL_DH_DSS_WITH_3DES_EDE_CBC_SHA,
CipherSuite.SSL_DH_RSA_EXPORT_WITH_DES40_CBC_SHA,
CipherSuite.SSL_DH_RSA_WITH_DES_CBC_SHA,
CipherSuite.SSL_DH_RSA_WITH_3DES_EDE_CBC_SHA,
CipherSuite.SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA,
CipherSuite.SSL_DHE_DSS_WITH_DES_CBC_SHA,
CipherSuite.SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA,
CipherSuite.SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA,
CipherSuite.SSL_DHE_RSA_WITH_DES_CBC_SHA,
CipherSuite.SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA,
CipherSuite.SSL_DH_anon_EXPORT_WITH_RC4_40_MD5,
CipherSuite.SSL_DH_anon_WITH_RC4_MD5,
CipherSuite.SSL_DH_anon_EXPORT_WITH_DES40_CBC_SHA,
CipherSuite.SSL_DH_anon_WITH_DES_CBC_SHA,
CipherSuite.SSL_DH_anon_WITH_3DES_EDE_CBC_SHA,
};
// serverContext.setEnabledCipherSuites(cs);
// enable all possible cipher suites
CipherSuite[] enabledCS = serverContext.updateCipherSuites();
// require a client certificate ?
Name[] acceptedCAs = new Name[cas.size()];
cas.copyInto(acceptedCAs);
byte[] types = {
ClientTrustDecider.rsa_sign,
ClientTrustDecider.dss_sign
};
serverContext.setRequireClientCertificate(types, acceptedCAs);
System.out.println(serverContext);
System.out.println("listening on port "+port+"...");
SSLServerSocket server = new SSLServerSocket(port, serverContext);
while (true) {
try {
ssl = (SSLSocket)server.accept();
ssl.setDebugStream(System.out); // debug information to System.out
ssl.setSoTimeout(1000*60*5); // we just wait for 5 minutes
OutputStream os = ssl.getOutputStream();
InputStream is = ssl.getInputStream();
System.out.println("Client Request:");
BufferedReader reader = new BufferedReader(new InputStreamReader(is));
String line;
do {
line = reader.readLine();
System.out.println(line);
} while ((line != null) && (line.length() > 0));
System.out.println();
if (renegotiate) {
System.out.println("renegotiating cipher-suite...");
// at this time we only allow one cipher-suite
CipherSuite[] new_cs = new CipherSuite[] {CipherSuite.SSL_RSA_EXPORT_WITH_RC4_40_MD5};
SSLContext context = ssl.getContext();
context.setEnabledCipherSuites(new_cs);
ssl.setContext(context);
ssl.renegotiate();
}
System.out.println("sending reply...");
PrintWriter writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(os), 2000));
writer.println("HTTP/1.0 200 OK");
writer.println("Content-Type: text/html");
writer.println("Server: IAIK-SSL Testserver");
writer.println();
writer.println("<HTML><HEAD>");
writer.println("<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html;CHARSET=iso-8859-1\">");
writer.println("<TITLE>SSL Test</TITLE>");
writer.println("</HEAD>");
writer.println("<BODY>");
writer.println("<H1>SSL Test ok.</H1>");
writer.println("</BODY>");
writer.println("</HTML>");
writer.flush();
writer.close();
} catch (UnknownHostException ex) {
System.out.println("UnknownHostException: "+ex.getMessage());
} catch (SSLException ex) {
System.out.println("SSLException: "+ex.getMessage());
} catch (IOException ex) {
System.out.println("IOException: "+ex.getMessage());
}
}
}
}
#####
##### 3.
#####
[parsed SSLServer.java in 976 ms]
[loaded /usr/java1.2/jre/lib/rt.jar(java/math/BigInteger.class) in 69 ms]
[loaded /usr/java1.2/jre/lib/rt.jar(java/security/spec/InvalidParameterSpecException.class) in 1 ms]
[loaded /usr/java1.2/jre/lib/rt.jar(java/security/cert/X509Certificate.class) in 3 ms]
[loaded /usr/java1.2/jre/lib/rt.jar(java/util/