sepafm 1.1.6 → 1.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: af34aff52da80e8a3c24f44f5728ab8c356189fb
|
4
|
+
data.tar.gz: 5b3a43610e7c900412e65fc83874d66bf6d132f2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 912764345d7c6bb8758ff1fc31f378e01fe0737e99d221e97a6007dd7798291a2aaa538a688c245da875ca5f335bc73539232018cec6276344056161088d97cd
|
7
|
+
data.tar.gz: 3d9681d0485431280410fa30c6bdb3900c7390249e8c8378510da383dabecaab3bbe7cf3b15aefce9305ee9424a0ca35fe1e66b0a3f1f6d0fde3b00df985da5e
|
@@ -208,7 +208,7 @@ module Sepa
|
|
208
208
|
# @return [String] the base64 encoded digest of the {#application_request}
|
209
209
|
def calculate_digest
|
210
210
|
sha1 = OpenSSL::Digest::SHA1.new
|
211
|
-
encode(sha1.digest(@application_request.canonicalize))
|
211
|
+
encode(sha1.digest(@application_request.canonicalize(canonicalization_mode)))
|
212
212
|
end
|
213
213
|
|
214
214
|
# Adds value to signature node
|
@@ -231,7 +231,7 @@ module Sepa
|
|
231
231
|
sha1 = OpenSSL::Digest::SHA1.new
|
232
232
|
dsig = 'http://www.w3.org/2000/09/xmldsig#'
|
233
233
|
node = @application_request.at_css("dsig|SignedInfo", 'dsig' => dsig)
|
234
|
-
signature = @signing_private_key.sign(sha1, node.canonicalize)
|
234
|
+
signature = @signing_private_key.sign(sha1, node.canonicalize(canonicalization_mode))
|
235
235
|
encode signature
|
236
236
|
end
|
237
237
|
|
@@ -266,5 +266,11 @@ module Sepa
|
|
266
266
|
target_id.content = @target_id
|
267
267
|
@application_request.at(node).add_next_sibling target_id
|
268
268
|
end
|
269
|
+
|
270
|
+
def canonicalization_mode
|
271
|
+
return Nokogiri::XML::XML_C14N_EXCLUSIVE_1_0 if @bank == :danske && @command == :renew_certificate
|
272
|
+
|
273
|
+
Nokogiri::XML::XML_C14N_1_0
|
274
|
+
end
|
269
275
|
end
|
270
276
|
end
|
data/lib/sepa/version.rb
CHANGED
@@ -18,12 +18,13 @@ class DanskeRenewCertApplicationRequestTest < ActiveSupport::TestCase
|
|
18
18
|
end
|
19
19
|
|
20
20
|
test 'signature is calculated correctly' do
|
21
|
-
sha1
|
22
|
-
keys_path
|
23
|
-
private_key
|
21
|
+
sha1 = OpenSSL::Digest::SHA1.new
|
22
|
+
keys_path = File.expand_path('../keys', __FILE__)
|
23
|
+
private_key = rsa_key(File.read("#{keys_path}/signing_key.pem"))
|
24
|
+
canonicalization_mode = Nokogiri::XML::XML_C14N_EXCLUSIVE_1_0
|
24
25
|
|
25
26
|
signed_info_node = @doc.at("dsig|SignedInfo", dsig: 'http://www.w3.org/2000/09/xmldsig#')
|
26
|
-
actual_signature = encode(private_key.sign(sha1, signed_info_node.canonicalize))
|
27
|
+
actual_signature = encode(private_key.sign(sha1, signed_info_node.canonicalize(canonicalization_mode)))
|
27
28
|
|
28
29
|
calculated_signature = @doc.at("dsig|SignatureValue", dsig: 'http://www.w3.org/2000/09/xmldsig#').content
|
29
30
|
|
data/test/sepa/sepa_test.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sepafm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joni Kanerva
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2016-07-
|
13
|
+
date: 2016-07-25 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activemodel
|