Skip to content

Commit 96c1fcd

Browse files
committed
Adjust whitespace
1 parent c140018 commit 96c1fcd

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

lib/signed-xml.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ SignedXml.prototype.checkSignature = function(xml, callback) {
343343

344344
if (!this.keyInfoProvider) {
345345
var err = new Error("cannot validate signature since no key info resolver was provided")
346-
if (!callback){
346+
if (!callback) {
347347
throw err
348348
} else {
349349
callback(err)
@@ -354,7 +354,7 @@ SignedXml.prototype.checkSignature = function(xml, callback) {
354354
this.signingKey = this.keyInfoProvider.getKey(this.keyInfo)
355355
if (!this.signingKey) {
356356
var err = new Error("key info provider could not resolve key info " + this.keyInfo)
357-
if (!callback){
357+
if (!callback) {
358358
throw err
359359
} else {
360360
callback(err)
@@ -365,15 +365,15 @@ SignedXml.prototype.checkSignature = function(xml, callback) {
365365
var doc = new Dom().parseFromString(xml)
366366

367367
if (!this.validateReferences(doc)) {
368-
if (!callback){
368+
if (!callback) {
369369
return false;
370370
} else {
371371
callback(new Error('Could not validate references'))
372372
return
373373
}
374374
}
375375

376-
if (!callback){
376+
if (!callback) {
377377
//Syncronous flow
378378
if (!this.validateSignatureValue(doc)) {
379379
return false
@@ -691,11 +691,11 @@ SignedXml.prototype.addReference = function(xpath, transforms, digestAlgorithm,
691691
*
692692
*/
693693
SignedXml.prototype.computeSignature = function(xml, opts, callback) {
694-
if (typeof opts === 'function' && callback == null){
694+
if (typeof opts === 'function' && callback == null) {
695695
callback = opts
696696
}
697697

698-
if (callback != null && typeof callback !== 'function'){
698+
if (callback != null && typeof callback !== 'function') {
699699
throw new Error("Last paramater must be a callback function")
700700
}
701701

@@ -722,7 +722,7 @@ SignedXml.prototype.computeSignature = function(xml, opts, callback) {
722722
if (validActions.indexOf(location.action) === -1) {
723723
var err = new Error("location.action option has an invalid action: " + location.action +
724724
", must be any of the following values: " + validActions.join(", "));
725-
if (!callback){
725+
if (!callback) {
726726
throw err;
727727
} else {
728728
callback(err, null)
@@ -770,7 +770,7 @@ SignedXml.prototype.computeSignature = function(xml, opts, callback) {
770770

771771
if (!referenceNode || referenceNode.length === 0) {
772772
var err = new Error("the following xpath cannot be used because it was not found: " + location.reference);
773-
if (!callback){
773+
if (!callback) {
774774
throw err
775775
} else {
776776
callback(err, null)
@@ -794,7 +794,7 @@ SignedXml.prototype.computeSignature = function(xml, opts, callback) {
794794
var signedInfoNode = utils.findChilds(this.signatureNode, "SignedInfo")
795795
if (signedInfoNode.length == 0) {
796796
var err = new Error("could not find SignedInfo element in the message")
797-
if (!callback){
797+
if (!callback) {
798798
throw err
799799
} else {
800800
callback(err)
@@ -803,7 +803,7 @@ SignedXml.prototype.computeSignature = function(xml, opts, callback) {
803803
}
804804
signedInfoNode = signedInfoNode[0];
805805

806-
if (!callback){
806+
if (!callback) {
807807
//Synchronous flow
808808
this.calculateSignatureValue(doc)
809809
signatureDoc.insertBefore(this.createSignature(prefix), signedInfoNode.nextSibling)

test/signature-unit-tests.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,7 @@ module.exports = {
500500
sig.addReference("//*[local-name(.)='y']")
501501
sig.addReference("//*[local-name(.)='w']")
502502

503-
sig.computeSignature(xml, function(err){
503+
sig.computeSignature(xml, function(err) {
504504
var signedXml = sig.getSignedXml()
505505
var expected = "<root><x xmlns=\"ns\" Id=\"_0\"/><y attr=\"value\" Id=\"_1\"/><z><w Id=\"_2\"/></z>" +
506506
"<Signature xmlns=\"http://www.w3.org/2000/09/xmldsig#\">" +

0 commit comments

Comments
 (0)