View | Details | Raw Unified | Return to bug 39637
Collapse All | Expand All

(-)./apache-tomcat-5.5.23-src.orig/connectors/jk/java/org/apache/ajp/RequestHandler.java (-5 / +17 lines)
Lines 357-371 Link Here
357
                byte[] certData = certString.getBytes();
357
                byte[] certData = certString.getBytes();
358
                ByteArrayInputStream bais = new ByteArrayInputStream(certData);
358
                ByteArrayInputStream bais = new ByteArrayInputStream(certData);
359
 
359
 
360
                // Fill the first element.
360
                // Fill all elements
361
                X509Certificate jsseCerts[] = null;
361
                X509Certificate jsseCerts[] = null;
362
                try {
362
                try {
363
                    CertificateFactory cf =
363
                    CertificateFactory cf =
364
                        CertificateFactory.getInstance("X.509");
364
                        CertificateFactory.getInstance("X.509");
365
                    X509Certificate cert = (X509Certificate)
365
                    int i = 0;
366
                        cf.generateCertificate(bais);
366
                    while (bais.available() > 0) {
367
                    jsseCerts =  new X509Certificate[1];
367
                        X509Certificate cert = (X509Certificate)
368
                    jsseCerts[0] = cert;
368
                            cf.generateCertificate(bais);
369
                        if (jsseCerts == null) {
370
                            jsseCerts = new X509Certificate[1];
371
                        } else {
372
                            X509Certificate tmpJsseCerts[] =
373
                                new X509Certificate[jsseCerts.length + 1];
374
                            System.arraycopy(jsseCerts, 0,
375
                                             tmpJsseCerts, 0,
376
                                             jsseCerts.length);
377
                            jsseCerts = tmpJsseCerts;
378
                        }
379
                        jsseCerts[i++] = cert;
380
                    }
369
                } catch(java.security.cert.CertificateException e) {
381
                } catch(java.security.cert.CertificateException e) {
370
                    log("Certificate convertion failed" + e );
382
                    log("Certificate convertion failed" + e );
371
                }
383
                }
(-)./apache-tomcat-5.5.23-src.orig/connectors/jk/java/org/apache/jk/core/MsgContext.java (-5 / +17 lines)
Lines 322-336 Link Here
322
                                             certData.getStart(),
322
                                             certData.getStart(),
323
                                             certData.getLength());
323
                                             certData.getLength());
324
 
324
 
325
                // Fill the first element.
325
                // Fill all elements
326
                X509Certificate jsseCerts[] = null;
326
                X509Certificate jsseCerts[] = null;
327
                try {
327
                try {
328
                    CertificateFactory cf =
328
                    CertificateFactory cf =
329
                        CertificateFactory.getInstance("X.509");
329
                        CertificateFactory.getInstance("X.509");
330
                    X509Certificate cert = (X509Certificate)
330
                    int i = 0;
331
                        cf.generateCertificate(bais);
331
                    while (bais.available() > 0) {
332
                    jsseCerts =  new X509Certificate[1];
332
                        X509Certificate cert = (X509Certificate)
333
                    jsseCerts[0] = cert;
333
                            cf.generateCertificate(bais);
334
                        if (jsseCerts == null) {
335
                            jsseCerts = new X509Certificate[1];
336
                        } else {
337
                            X509Certificate tmpJsseCerts[] =
338
                                new X509Certificate[jsseCerts.length + 1];
339
                            System.arraycopy(jsseCerts, 0,
340
                                             tmpJsseCerts, 0,
341
                                             jsseCerts.length);
342
                            jsseCerts = tmpJsseCerts;
343
                        }
344
                        jsseCerts[i++] = cert;
345
                    }
334
                } catch(java.security.cert.CertificateException e) {
346
                } catch(java.security.cert.CertificateException e) {
335
                    log.error("Certificate convertion failed" , e );
347
                    log.error("Certificate convertion failed" , e );
336
                    return;
348
                    return;

Return to bug 39637