@@ -368,45 +368,18 @@ SignedXml.prototype.validateSignatureValue = function(doc) {
368
368
throw new Error ( "When canonicalization method is non-exclusive, whole xml dom must be provided as an argument" ) ;
369
369
}
370
370
}
371
-
372
- /**
373
- * Get the InclusiveNamespaces PrefixList
374
- */
375
- var inclusiveNamespacesPrefixList
376
- var CanonicalizationMethod = utils . findChilds ( signedInfo [ 0 ] , "CanonicalizationMethod" )
377
- if ( CanonicalizationMethod . length != 0 ) {
378
- var inclusiveNamespaces = utils . findChilds ( CanonicalizationMethod [ 0 ] , "InclusiveNamespaces" )
379
- if ( inclusiveNamespaces . length != 0 ) {
380
- inclusiveNamespacesPrefixList = inclusiveNamespaces [ 0 ] . getAttribute ( 'PrefixList' ) . split ( " " ) ;
381
- }
382
- }
383
371
384
372
/**
385
373
* Search for ancestor namespaces before validating signature.
386
374
*/
387
375
var ancestorNamespaces = [ ] ;
388
376
ancestorNamespaces = findAncestorNs ( doc , "//*[local-name()='SignedInfo']" ) ;
389
377
390
- /**
391
- * If you have a PrefixList then use it and the ancestors to add the necessary namespaces
392
- */
393
- if ( inclusiveNamespacesPrefixList ) {
394
- inclusiveNamespacesPrefixList . forEach ( function ( inclusiveNamespacesPrefix ) {
395
- ancestorNamespaces . forEach ( function ( ancestorNamespace ) {
396
- if ( inclusiveNamespacesPrefix == ancestorNamespace . prefix ) {
397
- signedInfo [ 0 ] . setAttributeNS ( 'http://www.w3.org/2000/xmlns/' , 'xmlns:' + ancestorNamespace . prefix , ancestorNamespace . namespaceURI ) ;
398
- }
399
- } )
400
- } )
401
- }
402
-
403
378
var c14nOptions = {
404
- ancestorNamespaces : ancestorNamespaces ,
405
- inclusiveNamespacesPrefixList : inclusiveNamespacesPrefixList
379
+ ancestorNamespaces : ancestorNamespaces
406
380
} ;
407
381
var signedInfoCanon = this . getCanonXml ( [ this . canonicalizationAlgorithm ] , signedInfo [ 0 ] , c14nOptions )
408
382
var signer = this . findSignatureAlgorithm ( this . signatureAlgorithm )
409
-
410
383
var res = signer . verifySignature ( signedInfoCanon , this . signingKey , this . signatureValue )
411
384
if ( ! res ) this . validationErrors . push ( "invalid signature: the signature value " +
412
385
this . signatureValue + " is incorrect" )
@@ -486,19 +459,6 @@ SignedXml.prototype.validateReferences = function(doc) {
486
459
inclusiveNamespacesPrefixList : ref . inclusiveNamespacesPrefixList ,
487
460
ancestorNamespaces : ref . ancestorNamespaces
488
461
} ;
489
-
490
- if ( ref . inclusiveNamespacesPrefixList ) {
491
- var prefixList = ref . inclusiveNamespacesPrefixList instanceof Array ? ref . inclusiveNamespacesPrefixList : ref . inclusiveNamespacesPrefixList . split ( ' ' ) ;
492
- prefixList . forEach ( function ( prefix ) {
493
- if ( ref . ancestorNamespaces ) {
494
- ref . ancestorNamespaces . forEach ( function ( ancestorNamespace ) {
495
- if ( prefix == ancestorNamespace . prefix ) {
496
- elem [ 0 ] . setAttributeNS ( 'http://www.w3.org/2000/xmlns/' , 'xmlns:' + prefix , ancestorNamespace . namespaceURI ) ;
497
- }
498
- } )
499
- }
500
- } )
501
- }
502
462
503
463
var canonXml = this . getCanonXml ( ref . transforms , elem [ 0 ] , c14nOptions ) ;
504
464
0 commit comments