Uploaded image for project: 'Metadata Aggregator'
  1. Metadata Aggregator
  2. MDA-196

XMLSignatureSigningStage's includeX509SubjectName property causes exception

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 0.9.2
    • Fix Version/s: 0.10.0
    • Component/s: DOM Metadata
    • Labels:
      None

      Description

      I suspect, from examination of the code, that the XMLSignatureSigningStage's includeX509SubjectName property doesn't do anything, and may cause a run-time error.

      This is because it adds a String (the the subject name in a particular format) to the array of KeyInfo items to be added to the signature:

      if (includeX509SubjectName) {
          final X500Principal subjectDn = endEntityCert.getSubjectX500Principal();
          keyInfoItems.add(subjectDn.getName(X500Principal.RFC2253));
      }
      

      keyInfoItems is a List<Object>. which works with the Java 8 API (expects a raw List) but the contract actually corresponds to a List<XMLStructure> and is so represented in Java 9.

      Either the string needs to be turned into an appropriate XMLStructure subtype, or it should actually be added to the x509Data as the other elements in this method are.

      There is no unit test for this case, which is probably how we should start out.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              ian@iay.org.uk Ian Young
              Reporter:
              ian@iay.org.uk Ian Young
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 41 minutes
                  41m