~ttx/tomcat6/lucid-sru

« back to all changes in this revision

Viewing changes to java/org/apache/tomcat/util/net/jsse/JSSESupport.java

  • Committer: Bazaar Package Importer
  • Author(s): Ludovic Claude, Ludovic Claude, Jason Brittain
  • Date: 2010-02-09 23:06:51 UTC
  • mfrom: (2.2.7 sid)
  • Revision ID: james.westby@ubuntu.com-20100209230651-qiv9397g7txhrh99
Tags: 6.0.24-1
[ Ludovic Claude ]
* New upstream version
* Update the POM files for the new version of Tomcat
* Bump up Standards-Version to 3.8.4
* Refresh patches deploy-webapps-build-xml.patch and var_loaders.patch
* Remove patch fix_context_name.patch as it has been applied upstream
* Fix the installation of servlet-api-2.5.jar: the jar
  goes to /usr/share/java as in older versions (6.0.20-2)
  and links to the jar are added to /usr/share/maven-repo
* Moved NEWS.Debian into README.Debian
* Add a link from /usr/share/doc/tomcat6-common/README.Debian to
  /usr/share/doc/tomcat6/README.Debian to include a minimum of
  documentation in the tomcat6 package and add some useful notes. 
  (Closes: #563937, #563939)
* Remove poms from the Debian packaging, use upstream pom files

[ Jason Brittain ]
* Fixed a bug in the init script: When a start fails, the PID file was
  being left in place.  Now the init script makes sure it is deleted.
* Fixed a packaging bug that results in the ROOT webapp not being properly
  installed after an uninstall, then a reinstall.
* control: Corrected a couple of comments (no functional change).

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
import java.net.SocketException;
24
24
import java.security.cert.Certificate;
25
25
import java.security.cert.CertificateFactory;
 
26
import java.util.Map;
 
27
import java.util.WeakHashMap;
26
28
 
27
29
import javax.net.ssl.HandshakeCompletedEvent;
28
30
import javax.net.ssl.HandshakeCompletedListener;
52
54
    
53
55
    private static org.apache.juli.logging.Log log =
54
56
        org.apache.juli.logging.LogFactory.getLog(JSSESupport.class);
 
57
    
 
58
    private static final Map<SSLSession,Integer> keySizeCache =
 
59
        new WeakHashMap<SSLSession, Integer>();
55
60
 
56
61
    protected SSLSocket ssl;
57
62
    protected SSLSession session;
148
153
            ssl.setNeedClientAuth(true);
149
154
        }
150
155
 
 
156
        if (ssl.getEnabledCipherSuites().length == 0) {
 
157
            // Handshake is never going to be successful.
 
158
            // Assume this is because handshakes are disabled
 
159
            log.warn("SSL server initiated renegotiation is disabled, closing connection");
 
160
            session.invalidate();
 
161
            ssl.close();
 
162
            return;
 
163
        }
 
164
 
151
165
        InputStream in = ssl.getInputStream();
152
166
        int oldTimeout = ssl.getSoTimeout();
153
167
        ssl.setSoTimeout(1000);
186
200
        SSLSupport.CipherData c_aux[]=ciphers;
187
201
        if (session == null)
188
202
            return null;
189
 
        Integer keySize = (Integer) session.getValue(KEY_SIZE_KEY);
 
203
        
 
204
        Integer keySize = null;
 
205
        synchronized(keySizeCache) {
 
206
            keySize = keySizeCache.get(session);
 
207
        }
 
208
        
190
209
        if (keySize == null) {
191
210
            int size = 0;
192
211
            String cipherSuite = session.getCipherSuite();
197
216
                }
198
217
            }
199
218
            keySize = new Integer(size);
200
 
            session.putValue(KEY_SIZE_KEY, keySize);
 
219
            synchronized(keySizeCache) {
 
220
                keySizeCache.put(session, keySize);
 
221
            }
201
222
        }
202
223
        return keySize;
203
224
    }