kl-ruby-saml 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dca6cdd7235817f6c743cdc5772c7e789fa4557e
4
- data.tar.gz: 9b8636dfd9eabd7a20a66d4290a607978ad055c3
3
+ metadata.gz: f10dab83bddcac22ae4b48210685ffa07fc73f67
4
+ data.tar.gz: 49b15bbbbbee24f12eb825649b440691582de333
5
5
  SHA512:
6
- metadata.gz: 9ade3f457cb68de71766f80d21c84785487505224431d92869e420fe16d562a87fe7503227291fb5ae8aebc75c8db1b522914a78c243c34aa2780a2558c0f025
7
- data.tar.gz: 8b384251a915cdbf9bc0fe3dab4f0426172584a5ec86cf0cec096368986d31e75bb92f2a6eddc9f281a87406fc50988748221747f5ae787da42f16902bc46765
6
+ metadata.gz: 912cf80af8a53c095753e44564c94b48a780e23b2ec525e28156f8f06f529e3289192711556ac17c7a857ad8bc8aa169557ed62f8f7c97d393af67fb94603641
7
+ data.tar.gz: 2b402883126bddb72bb26fd6408a31139057763c8a67fd973cb42e9695bc017fa2789b18cca16b0b61dcf95c2223e57c985ccb175514b7f3590de6e429aec944
@@ -6,10 +6,10 @@ Gem::Specification.new do |s|
6
6
  s.version = OneLogin::RubySaml::VERSION
7
7
 
8
8
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
9
- s.authors = ["OneLogin LLC", "Knightlabs LLC"]
9
+ s.authors = ["OneLogin LLC", "Knightlabs, LLC"]
10
10
  s.date = Time.now.strftime("%Y-%m-%d")
11
- s.description = %q{KL SAML toolkit for Ruby on Rails}
12
- s.email = %q{support@knightlabs.com}
11
+ s.description = %q{SAML toolkit for Ruby on Rails}
12
+ s.email = %q{support@onelogin.com}
13
13
  s.license = 'MIT'
14
14
  s.extra_rdoc_files = [
15
15
  "LICENSE",
@@ -1,5 +1,5 @@
1
1
  module OneLogin
2
2
  module RubySaml
3
- VERSION = '0.0.1'
3
+ VERSION = '0.0.2'
4
4
  end
5
5
  end
@@ -262,6 +262,12 @@ module XMLSecurity
262
262
  '//ds:CanonicalizationMethod',
263
263
  'ds' => DSIG
264
264
  )
265
+
266
+ noko_signed_info_reference_element_uri_attr = noko_signed_info_element.at_xpath('./ds:Reference', 'ds' => DSIG).attributes["URI"]
267
+ if (noko_signed_info_reference_element_uri_attr.value.empty?)
268
+ noko_signed_info_reference_element_uri_attr.value = "##{document.root.attribute('ID')}"
269
+ end
270
+
265
271
  canon_string = noko_signed_info_element.canonicalize(canon_algorithm)
266
272
  noko_sig_element.remove
267
273
 
@@ -269,8 +275,8 @@ module XMLSecurity
269
275
  REXML::XPath.each(@sig_element, "//ds:Reference", {"ds"=>DSIG}) do |ref|
270
276
  uri = ref.attributes.get_attribute("URI").value
271
277
 
272
- # Handle enveloped signatures, not just enveloping signatures: http://www.di-mgt.com.au/xmldsig2.html
273
- hashed_element = uri.empty? ? @working_copy : document.at_xpath("//*[@ID=$uri]", nil, { 'uri' => uri[1..-1] })
278
+ hashed_element = uri.empty? ? document : document.at_xpath("//*[@ID=$uri]", nil, { 'uri' => uri[1..-1] })
279
+ # hashed_element = document.at_xpath("//*[@ID=$uri]", nil, { 'uri' => uri[1..-1] })
274
280
  canon_algorithm = canon_algorithm REXML::XPath.first(
275
281
  ref,
276
282
  '//ds:CanonicalizationMethod',
@@ -337,7 +343,9 @@ module XMLSecurity
337
343
  "//ds:Signature/ds:SignedInfo/ds:Reference",
338
344
  {"ds"=>DSIG}
339
345
  )
340
- self.signed_element_id = reference_element.attribute("URI").value[1..-1] unless reference_element.nil?
346
+
347
+ sei = reference_element.attribute("URI").value[1..-1] unless reference_element.nil?
348
+ self.signed_element_id = sei.nil? ? self.root.attribute("ID") : sei
341
349
  end
342
350
 
343
351
  def extract_inclusive_namespaces
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kl-ruby-saml
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - OneLogin LLC
8
- - Knightlabs LLC
8
+ - Knightlabs, LLC
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-07-06 00:00:00.000000000 Z
12
+ date: 2015-07-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: uuid
@@ -151,8 +151,8 @@ dependencies:
151
151
  - - ">="
152
152
  - !ruby/object:Gem::Version
153
153
  version: '0'
154
- description: KL SAML toolkit for Ruby on Rails
155
- email: support@knightlabs.com
154
+ description: SAML toolkit for Ruby on Rails
155
+ email: support@onelogin.com
156
156
  executables: []
157
157
  extensions: []
158
158
  extra_rdoc_files:
@@ -168,6 +168,7 @@ files:
168
168
  - Rakefile
169
169
  - changelog.md
170
170
  - gemfiles/nokogiri-1.5.gemfile
171
+ - kl-ruby-saml.gemspec
171
172
  - lib/onelogin/ruby-saml.rb
172
173
  - lib/onelogin/ruby-saml/attribute_service.rb
173
174
  - lib/onelogin/ruby-saml/attributes.rb
@@ -200,7 +201,6 @@ files:
200
201
  - lib/schemas/xml.xsd
201
202
  - lib/schemas/xmldsig-core-schema.xsd
202
203
  - lib/xml_security.rb
203
- - ruby-saml.gemspec
204
204
  - test/certificates/certificate1
205
205
  - test/certificates/certificate_without_head_foot
206
206
  - test/certificates/formatted_certificate