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

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

XMLWordPrintable

      Coverity static analysis found possible use of null object comming from RawPBEKey.getSalt() passed into javax.crypto.spec.PBEParameterSpec.PBEParameterSpec

      javax.crypto.spec.PBEParameterSpec.java
      public PBEParameterSpec(byte[] salt, int iterationCount) {
          this.salt = salt.clone();
          this.iterationCount = iterationCount;
      }
      

      Responsible elytron code:

      KeyUtils.java
      if (key instanceof PBEKey && paramSpecClass.isAssignableFrom(PBEParameterSpec.class)) {
                  final PBEKey pbeKey = (PBEKey) key;
                  // TODO: we miss the IV here
                  return paramSpecClass.cast(new PBEParameterSpec(pbeKey.getSalt(), pbeKey.getIterationCount()));
              }
      

      https://scan7.coverity.com/reports.htm#v23632/p11778/fileInstanceId=8490615&defectInstanceId=2123254&mergedDefectId=1389515

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

              Created:
              Updated:
              Resolved: