@@ -18,8 +18,8 @@ function FileKeyInfo(file) {
18
18
this . file = file
19
19
20
20
this . getKeyInfo = function ( key , prefix ) {
21
- prefix = prefix || ''
22
- prefix = prefix ? prefix + ':' : prefix
21
+ prefix = prefix || ''
22
+ prefix = prefix ? prefix + ':' : prefix
23
23
return "<" + prefix + "X509Data></" + prefix + "X509Data>"
24
24
}
25
25
@@ -450,16 +450,15 @@ SignedXml.prototype.validateReferences = function(doc) {
450
450
/**
451
451
* Search for ancestor namespaces before validating references.
452
452
*/
453
- if ( Array . isArray ( ref . transforms ) ) {
454
-
455
- ref . ancestorNamespaces = findAncestorNs ( doc , elemXpath ) ;
453
+ if ( Array . isArray ( ref . transforms ) ) {
454
+ ref . ancestorNamespaces = findAncestorNs ( doc , elemXpath ) ;
456
455
}
457
456
458
457
var c14nOptions = {
459
458
inclusiveNamespacesPrefixList : ref . inclusiveNamespacesPrefixList ,
460
459
ancestorNamespaces : ref . ancestorNamespaces
461
460
} ;
462
-
461
+
463
462
var canonXml = this . getCanonXml ( ref . transforms , elem [ 0 ] , c14nOptions ) ;
464
463
465
464
var hash = this . findHashAlgorithm ( ref . digestAlgorithm )
@@ -578,7 +577,11 @@ SignedXml.prototype.loadReference = function(ref) {
578
577
if ( inclusiveNamespaces . length > 0 ) {
579
578
//Should really only be one prefix list, but maybe there's some circumstances where more than one to lets handle it
580
579
for ( var i = 0 ; i < inclusiveNamespaces . length ; i ++ ) {
581
- inclusiveNamespacesPrefixList = inclusiveNamespaces [ i ] . getAttribute ( 'PrefixList' ) ;
580
+ if ( inclusiveNamespacesPrefixList ) {
581
+ inclusiveNamespacesPrefixList = inclusiveNamespacesPrefixList + " " + inclusiveNamespaces [ i ] . getAttribute ( 'PrefixList' ) ;
582
+ } else {
583
+ inclusiveNamespacesPrefixList = inclusiveNamespaces [ i ] . getAttribute ( 'PrefixList' ) ;
584
+ }
582
585
}
583
586
}
584
587
}
@@ -881,10 +884,10 @@ SignedXml.prototype.createSignature = function(signedInfo, prefix) {
881
884
var xmlNsAttr = 'xmlns'
882
885
883
886
if ( prefix ) {
884
- xmlNsAttr += ':' + prefix ;
885
- prefix += ':' ;
887
+ xmlNsAttr += ':' + prefix ;
888
+ prefix += ':' ;
886
889
} else {
887
- prefix = '' ;
890
+ prefix = '' ;
888
891
}
889
892
890
893
//the canonicalization requires to get a valid xml node.
0 commit comments