saml-kit 1.0.8 → 1.0.9

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
  SHA256:
3
- metadata.gz: f4ad05245ab472bceea2071e05fc63f90279ad48930d5367b97c585b8edc9319
4
- data.tar.gz: bdaf6d0bfab7815d44d721a4a16137fe55324d20c9b833439b6094fb1507643e
3
+ metadata.gz: c0d58bbb3c3a82d505f9898c871e9038d22cbf0fe6b50c59615e3a528e3770a0
4
+ data.tar.gz: 527f1c7a86aafa31d7bb5629325c177dfaeb3517c4c2d570832298c33622c647
5
5
  SHA512:
6
- metadata.gz: 4d2838caf5a66987765e77b1393e5a42b6b67605aef30a3507fee7bd9e048dc5d7c93b07d227fa473ae8a13109f60a67793fe7f000068c3ecb58031937402bc0
7
- data.tar.gz: ec2fc1bdffd706af00b21910c2830dbab388d66ba411ba04ac0aabbd975844268fd89d634177f2ae6b017d365d755322dd6a811d7ab71a42b3a51fb2a1fc7460
6
+ metadata.gz: 315cb5a0c5f725577fdae560a924d27cf421299af013bdc10a69a8842add199723088165b266f68dec8fa6af47fbc3b26d8c1f72fde4da5b857e627ae6618696
7
+ data.tar.gz: 05b34c3e338867fc0ebd8fe22bcddd41b41ccbf0629deb2813a2f63081cf0e05def3aaf48e9a6caa7474f754bbdffe6a224b90697a8ba7a6f9549176059d4d78
data/bin/cibuild CHANGED
@@ -17,7 +17,6 @@ export RUBY_HEAP_FREE_MIN=100000
17
17
  export RUBY_HEAP_SLOTS_INCREMENT=400000
18
18
  export RUBY_HEAP_SLOTS_GROWTH_FACTOR=1
19
19
 
20
- gem install bundler --no-ri --no-rdoc --conservative
21
- # run tests
22
20
  ruby -v
23
- bin/test
21
+ gem install bundler --no-ri --no-rdoc --conservative
22
+ time bin/test
@@ -31,6 +31,13 @@ module Saml
31
31
  at_xpath('./ds:SignedInfo/ds:Reference/ds:DigestValue').try(:text)
32
32
  end
33
33
 
34
+ def expected_digest_value
35
+ digests = dsignature.references.map do |x|
36
+ Base64.encode64(x.calculate_digest_value).chomp
37
+ end
38
+ digests.count > 1 ? digests : digests[0]
39
+ end
40
+
34
41
  def digest_method
35
42
  at_xpath('./ds:SignedInfo/ds:Reference/ds:DigestMethod/@Algorithm').try(:value)
36
43
  end
@@ -69,11 +76,10 @@ module Saml
69
76
  attr_reader :node
70
77
 
71
78
  def validate_signature
72
- return errors[:base].push(error_message(:empty)) if certificate.nil?
79
+ return errors.add(:base, error_message(:empty)) if certificate.nil?
80
+ return if dsignature.valid?(certificate.x509)
73
81
 
74
- signature = Xmldsig::Signature.new(@node, 'ID=$uri or @Id')
75
- return if signature.valid?(certificate.x509)
76
- signature.errors.each do |attribute|
82
+ dsignature.errors.each do |attribute|
77
83
  errors.add(attribute, error_message(attribute))
78
84
  end
79
85
  end
@@ -94,6 +100,10 @@ module Saml
94
100
  return nil unless node
95
101
  node.at_xpath(xpath, Saml::Kit::Document::NAMESPACES)
96
102
  end
103
+
104
+ def dsignature
105
+ @dsignature ||= Xmldsig::Signature.new(node, 'ID=$uri or @Id')
106
+ end
97
107
  end
98
108
  end
99
109
  end
@@ -1,5 +1,5 @@
1
1
  module Saml
2
2
  module Kit
3
- VERSION = '1.0.8'.freeze
3
+ VERSION = '1.0.9'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: saml-kit
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.8
4
+ version: 1.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - mo khan