@@ -36,6 +36,7 @@ describe("Signature unit tests", function () {
36
36
} ) ;
37
37
38
38
sig . canonicalizationAlgorithm = "http://www.w3.org/2001/10/xml-exc-c14n#" ;
39
+ sig . signatureAlgorithm = "http://www.w3.org/2000/09/xmldsig#rsa-sha1" ;
39
40
sig . computeSignature ( xml ) ;
40
41
const signedXml = sig . getOriginalXmlWithIds ( ) ;
41
42
const doc = new xmldom . DOMParser ( ) . parseFromString ( signedXml ) ;
@@ -72,6 +73,7 @@ describe("Signature unit tests", function () {
72
73
} ) ;
73
74
74
75
sig . canonicalizationAlgorithm = "http://www.w3.org/2001/10/xml-exc-c14n#" ;
76
+ sig . signatureAlgorithm = "http://www.w3.org/2000/09/xmldsig#rsa-sha1" ;
75
77
sig . computeSignature ( xml , {
76
78
existingPrefixes : {
77
79
wsu : "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" ,
@@ -95,6 +97,7 @@ describe("Signature unit tests", function () {
95
97
digestAlgorithm : "http://www.w3.org/2000/09/xmldsig#sha1" ,
96
98
} ) ;
97
99
sig . canonicalizationAlgorithm = "http://www.w3.org/2001/10/xml-exc-c14n#" ;
100
+ sig . signatureAlgorithm = "http://www.w3.org/2000/09/xmldsig#rsa-sha1" ;
98
101
sig . computeSignature ( xml ) ;
99
102
const signedXml = sig . getOriginalXmlWithIds ( ) ;
100
103
const doc = new xmldom . DOMParser ( ) . parseFromString ( signedXml ) ;
@@ -129,6 +132,7 @@ describe("Signature unit tests", function () {
129
132
} ) ;
130
133
131
134
sig . canonicalizationAlgorithm = "http://www.w3.org/2001/10/xml-exc-c14n#" ;
135
+ sig . signatureAlgorithm = "http://www.w3.org/2000/09/xmldsig#rsa-sha1" ;
132
136
sig . computeSignature ( xml , {
133
137
attrs : attrs ,
134
138
} ) ;
@@ -163,6 +167,7 @@ describe("Signature unit tests", function () {
163
167
digestAlgorithm : "http://www.w3.org/2000/09/xmldsig#sha1" ,
164
168
} ) ;
165
169
sig . canonicalizationAlgorithm = "http://www.w3.org/2001/10/xml-exc-c14n#" ;
170
+ sig . signatureAlgorithm = "http://www.w3.org/2000/09/xmldsig#rsa-sha1" ;
166
171
sig . computeSignature ( xml ) ;
167
172
168
173
const doc = new xmldom . DOMParser ( ) . parseFromString ( sig . getSignedXml ( ) ) ;
@@ -186,6 +191,7 @@ describe("Signature unit tests", function () {
186
191
} ) ;
187
192
188
193
sig . canonicalizationAlgorithm = "http://www.w3.org/2001/10/xml-exc-c14n#" ;
194
+ sig . signatureAlgorithm = "http://www.w3.org/2000/09/xmldsig#rsa-sha1" ;
189
195
sig . computeSignature ( xml , {
190
196
location : {
191
197
reference : "/root/name" ,
@@ -216,6 +222,7 @@ describe("Signature unit tests", function () {
216
222
} ) ;
217
223
218
224
sig . canonicalizationAlgorithm = "http://www.w3.org/2001/10/xml-exc-c14n#" ;
225
+ sig . signatureAlgorithm = "http://www.w3.org/2000/09/xmldsig#rsa-sha1" ;
219
226
sig . computeSignature ( xml , {
220
227
location : {
221
228
reference : "/root/name" ,
@@ -245,6 +252,7 @@ describe("Signature unit tests", function () {
245
252
} ) ;
246
253
247
254
sig . canonicalizationAlgorithm = "http://www.w3.org/2001/10/xml-exc-c14n#" ;
255
+ sig . signatureAlgorithm = "http://www.w3.org/2000/09/xmldsig#rsa-sha1" ;
248
256
sig . computeSignature ( xml , {
249
257
location : {
250
258
reference : "/root/name" ,
@@ -275,6 +283,7 @@ describe("Signature unit tests", function () {
275
283
} ) ;
276
284
277
285
sig . canonicalizationAlgorithm = "http://www.w3.org/2001/10/xml-exc-c14n#" ;
286
+ sig . signatureAlgorithm = "http://www.w3.org/2000/09/xmldsig#rsa-sha1" ;
278
287
sig . computeSignature ( xml , {
279
288
location : {
280
289
reference : "/root/name" ,
@@ -637,6 +646,7 @@ describe("Signature unit tests", function () {
637
646
} ) ;
638
647
639
648
sig . canonicalizationAlgorithm = "http://www.w3.org/2001/10/xml-exc-c14n#" ;
649
+ sig . signatureAlgorithm = "http://www.w3.org/2000/09/xmldsig#rsa-sha1" ;
640
650
sig . computeSignature ( xml ) ;
641
651
const signedXml = sig . getSignedXml ( ) ;
642
652
const expected =
@@ -956,6 +966,7 @@ describe("Signature unit tests", function () {
956
966
} ) ;
957
967
958
968
sig . canonicalizationAlgorithm = "http://www.w3.org/2001/10/xml-exc-c14n#" ;
969
+ sig . signatureAlgorithm = "http://www.w3.org/2000/09/xmldsig#rsa-sha1" ;
959
970
sig . computeSignature ( xml ) ;
960
971
const signedXml = sig . getSignedXml ( ) ;
961
972
const doc = new xmldom . DOMParser ( ) . parseFromString ( signedXml ) ;
@@ -1013,6 +1024,7 @@ describe("Signature unit tests", function () {
1013
1024
sig . getKeyInfoContent = getKeyInfoContentWithAssertionId . bind ( this , { assertionId } ) ;
1014
1025
sig . privateKey = fs . readFileSync ( "./test/static/client.pem" ) ;
1015
1026
sig . canonicalizationAlgorithm = "http://www.w3.org/2001/10/xml-exc-c14n#" ;
1027
+ sig . signatureAlgorithm = "http://www.w3.org/2000/09/xmldsig#rsa-sha1" ;
1016
1028
sig . computeSignature ( xml , {
1017
1029
prefix : "ds" ,
1018
1030
location : {
@@ -1045,6 +1057,7 @@ describe("Signature unit tests", function () {
1045
1057
} ) ;
1046
1058
1047
1059
sig . canonicalizationAlgorithm = "http://www.w3.org/2001/10/xml-exc-c14n#" ;
1060
+ sig . signatureAlgorithm = "http://www.w3.org/2000/09/xmldsig#rsa-sha1" ;
1048
1061
sig . computeSignature ( xml ) ;
1049
1062
const signedXml = sig . getSignedXml ( ) ;
1050
1063
@@ -1081,6 +1094,7 @@ describe("Signature unit tests", function () {
1081
1094
} ) ;
1082
1095
1083
1096
sig . canonicalizationAlgorithm = "http://www.w3.org/2001/10/xml-exc-c14n#" ;
1097
+ sig . signatureAlgorithm = "http://www.w3.org/2000/09/xmldsig#rsa-sha1" ;
1084
1098
sig . computeSignature ( xml ) ;
1085
1099
const signedXml = sig . getSignedXml ( ) ;
1086
1100
@@ -1105,6 +1119,7 @@ describe("Signature unit tests", function () {
1105
1119
} ) ;
1106
1120
1107
1121
sig . canonicalizationAlgorithm = "http://www.w3.org/2001/10/xml-exc-c14n#" ;
1122
+ sig . signatureAlgorithm = "http://www.w3.org/2000/09/xmldsig#rsa-sha1" ;
1108
1123
sig . computeSignature ( xml ) ;
1109
1124
const signedXml = sig . getSignedXml ( ) ;
1110
1125
@@ -1143,6 +1158,7 @@ describe("Signature unit tests", function () {
1143
1158
} ) ;
1144
1159
1145
1160
sig . canonicalizationAlgorithm = "http://www.w3.org/2001/10/xml-exc-c14n#" ;
1161
+ sig . signatureAlgorithm = "http://www.w3.org/2000/09/xmldsig#rsa-sha1" ;
1146
1162
sig . computeSignature ( xml ) ;
1147
1163
const signedXml = sig . getSignedXml ( ) ;
1148
1164
@@ -1169,6 +1185,7 @@ describe("Signature unit tests", function () {
1169
1185
sig . getKeyInfoContent = ( ) => "<dummy/>" ;
1170
1186
1171
1187
sig . canonicalizationAlgorithm = "http://www.w3.org/2001/10/xml-exc-c14n#" ;
1188
+ sig . signatureAlgorithm = "http://www.w3.org/2000/09/xmldsig#rsa-sha1" ;
1172
1189
sig . computeSignature ( xml ) ;
1173
1190
const signedXml = sig . getSignedXml ( ) ;
1174
1191
@@ -1200,6 +1217,7 @@ describe("Signature unit tests", function () {
1200
1217
sig . privateKey = pemBuffer ;
1201
1218
sig . publicCert = pemBuffer ;
1202
1219
sig . canonicalizationAlgorithm = "http://www.w3.org/2001/10/xml-exc-c14n#" ;
1220
+ sig . signatureAlgorithm = "http://www.w3.org/2000/09/xmldsig#rsa-sha1" ;
1203
1221
sig . computeSignature ( xml ) ;
1204
1222
const signedXml = sig . getSignedXml ( ) ;
1205
1223
0 commit comments