Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-11925

Coverity static analysis: Dereference null return value in ServerAuthenticationContext (Elytron)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Critical Critical
    • 7.1.0.ER3
    • 7.1.0.ER1
    • Security
    • None

      Coverity found possible NPE occurence, as according to javadoc for SSLSession().getLocalCertificates() may return null [1], but X500.asX509CertificateArray can't consume null parameter and NPE will be thrown in that case.

      ServerAuthenticationContext.java
       
                      } else if (callback instanceof SSLCallback) {
                          SSLCallback sslCallback = (SSLCallback) callback;
      
                          try {
                              peerCerts = X500.asX509CertificateArray(sslCallback.getSslSession().getPeerCertificates());
                          } catch (SSLPeerUnverifiedException e) {
                              log.trace("Peer unverified", e);
                              peerCerts = null;
                          }
                          serverCerts = X500.asX509CertificateArray(sslCallback.getSslSession().getLocalCertificates());
                          handleOne(callbacks, idx + 1);
                      }
      

      https://scan7.coverity.com/reports.htm#v23632/p11778/fileInstanceId=26379676&defectInstanceId=5932898&mergedDefectId=1449008

      [1] https://docs.oracle.com/javase/8/docs/api/javax/net/ssl/SSLSession.html#getLocalCertificates--

            rhn-support-ivassile Ilia Vassilev
            mchoma@redhat.com Martin Choma
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: