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

(-)apache-tomcat-6.0.10-src.orig/java/org/apache/coyote/ajp/AjpAprProcessor.java (-5 / +17 lines)
Lines 562-575 Link Here
562
                    new ByteArrayInputStream(certData.getBytes(),
562
                    new ByteArrayInputStream(certData.getBytes(),
563
                            certData.getStart(),
563
                            certData.getStart(),
564
                            certData.getLength());
564
                            certData.getLength());
565
                // Fill the first element.
565
                // Fill all elements
566
                try {
566
                try {
567
                    CertificateFactory cf =
567
                    CertificateFactory cf =
568
                        CertificateFactory.getInstance("X.509");
568
                        CertificateFactory.getInstance("X.509");
569
                    X509Certificate cert = (X509Certificate)
569
                    int i = 0;
570
                    cf.generateCertificate(bais);
570
                    while (bais.available() > 0) {
571
                    jsseCerts = new X509Certificate[1];
571
                        X509Certificate cert = (X509Certificate)
572
                    jsseCerts[0] = cert;
572
                            cf.generateCertificate(bais);
573
                        if (jsseCerts == null) {
574
                            jsseCerts = new X509Certificate[1];
575
                        } else {
576
                            X509Certificate tmpJsseCerts[] =
577
                                new X509Certificate[jsseCerts.length + 1];
578
                                System.arraycopy(jsseCerts, 0,
579
                                                 tmpJsseCerts, 0,
580
                                                 jsseCerts.length);
581
                                jsseCerts = tmpJsseCerts;
582
                        }
583
                        jsseCerts[i++] = cert;
584
                    }
573
                    request.setAttribute(AprEndpoint.CERTIFICATE_KEY, jsseCerts);
585
                    request.setAttribute(AprEndpoint.CERTIFICATE_KEY, jsseCerts);
574
                } catch (java.security.cert.CertificateException e) {
586
                } catch (java.security.cert.CertificateException e) {
575
                    log.error(sm.getString("ajpprocessor.certs.fail"), e);
587
                    log.error(sm.getString("ajpprocessor.certs.fail"), e);
(-)apache-tomcat-6.0.10-src.orig/java/org/apache/coyote/ajp/AjpProcessor.java (-5 / +17 lines)
Lines 550-563 Link Here
550
                    new ByteArrayInputStream(certData.getBytes(),
550
                    new ByteArrayInputStream(certData.getBytes(),
551
                            certData.getStart(),
551
                            certData.getStart(),
552
                            certData.getLength());
552
                            certData.getLength());
553
                // Fill the first element.
553
                // Fill all elements
554
                try {
554
                try {
555
                    CertificateFactory cf =
555
                    CertificateFactory cf =
556
                        CertificateFactory.getInstance("X.509");
556
                        CertificateFactory.getInstance("X.509");
557
                    X509Certificate cert = (X509Certificate)
557
                    int i = 0;
558
                    cf.generateCertificate(bais);
558
                    while (bais.available() > 0) {
559
                    jsseCerts = new X509Certificate[1];
559
                        X509Certificate cert = (X509Certificate)
560
                    jsseCerts[0] = cert;
560
                            cf.generateCertificate(bais);
561
                        if (jsseCerts == null) {
562
                            jsseCerts = new X509Certificate[1];
563
                        } else {
564
                            X509Certificate tmpJsseCerts[] =
565
                                new X509Certificate[jsseCerts.length + 1];
566
                            System.arraycopy(jsseCerts, 0,
567
                                             tmpJsseCerts, 0,
568
                                             jsseCerts.length);
569
                            jsseCerts = tmpJsseCerts;
570
                        }
571
                        jsseCerts[i++] = cert;
572
                    }
561
                    request.setAttribute(JIoEndpoint.CERTIFICATE_KEY, jsseCerts);
573
                    request.setAttribute(JIoEndpoint.CERTIFICATE_KEY, jsseCerts);
562
                } catch (java.security.cert.CertificateException e) {
574
                } catch (java.security.cert.CertificateException e) {
563
                    log.error(sm.getString("ajpprocessor.certs.fail"), e);
575
                    log.error(sm.getString("ajpprocessor.certs.fail"), e);
(-)apache-tomcat-6.0.10-src.orig/java/org/apache/jk/core/MsgContext.java (-5 / +17 lines)
Lines 321-335 Link Here
321
                                             certData.getStart(),
321
                                             certData.getStart(),
322
                                             certData.getLength());
322
                                             certData.getLength());
323
 
323
 
324
                // Fill the first element.
324
                // Fill all elements
325
                X509Certificate jsseCerts[] = null;
325
                X509Certificate jsseCerts[] = null;
326
                try {
326
                try {
327
                    CertificateFactory cf =
327
                    CertificateFactory cf =
328
                        CertificateFactory.getInstance("X.509");
328
                        CertificateFactory.getInstance("X.509");
329
                    X509Certificate cert = (X509Certificate)
329
                    int i = 0;
330
                        cf.generateCertificate(bais);
330
                    while (bais.available() > 0) {
331
                    jsseCerts =  new X509Certificate[1];
331
                        X509Certificate cert = (X509Certificate)
332
                    jsseCerts[0] = cert;
332
                            cf.generateCertificate(bais);
333
                        if (jsseCerts == null) {
334
                            jsseCerts = new X509Certificate[1];
335
                        } else {
336
                            X509Certificate tmpJsseCerts[] =
337
                                new X509Certificate[jsseCerts.length + 1];
338
                            System.arraycopy(jsseCerts, 0,
339
                                             tmpJsseCerts, 0,
340
                                             jsseCerts.length);
341
                            jsseCerts = tmpJsseCerts;
342
                        }
343
                        jsseCerts[i++] = cert;
344
                    }
333
                } catch(java.security.cert.CertificateException e) {
345
                } catch(java.security.cert.CertificateException e) {
334
                    log.error("Certificate convertion failed" , e );
346
                    log.error("Certificate convertion failed" , e );
335
                    return;
347
                    return;

Return to bug 39637