jdk/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMManifest.java
changeset 40551 05eba5515cbb
parent 27747 3a271dc8b758
equal deleted inserted replaced
40550:ed2670b26b6e 40551:05eba5515cbb
    19  * KIND, either express or implied. See the License for the
    19  * KIND, either express or implied. See the License for the
    20  * specific language governing permissions and limitations
    20  * specific language governing permissions and limitations
    21  * under the License.
    21  * under the License.
    22  */
    22  */
    23 /*
    23 /*
    24  * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
    24  * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
    25  */
    25  */
    26 /*
    26 /*
    27  * $Id: DOMManifest.java 1333415 2012-05-03 12:03:51Z coheigea $
    27  * $Id: DOMManifest.java 1333415 2012-05-03 12:03:51Z coheigea $
    28  */
    28  */
    29 package org.jcp.xml.dsig.internal.dom;
    29 package org.jcp.xml.dsig.internal.dom;
   108             if (!localName.equals("Reference")) {
   108             if (!localName.equals("Reference")) {
   109                 throw new MarshalException("Invalid element name: " +
   109                 throw new MarshalException("Invalid element name: " +
   110                                            localName + ", expected Reference");
   110                                            localName + ", expected Reference");
   111             }
   111             }
   112             refs.add(new DOMReference(refElem, context, provider));
   112             refs.add(new DOMReference(refElem, context, provider));
   113             if (secVal && (refs.size() > DOMSignedInfo.MAXIMUM_REFERENCE_COUNT)) {
   113             if (secVal && Policy.restrictNumReferences(refs.size())) {
   114                 String error = "A maxiumum of " + DOMSignedInfo.MAXIMUM_REFERENCE_COUNT + " "
   114                 String error = "A maximum of " + Policy.maxReferences()
   115                     + "references per Manifest are allowed with secure validation";
   115                     + " references per Manifest are allowed when"
       
   116                     + " secure validation is enabled";
   116                 throw new MarshalException(error);
   117                 throw new MarshalException(error);
   117             }
   118             }
   118             refElem = DOMUtils.getNextSiblingElement(refElem);
   119             refElem = DOMUtils.getNextSiblingElement(refElem);
   119         }
   120         }
   120         this.references = Collections.unmodifiableList(refs);
   121         this.references = Collections.unmodifiableList(refs);