libsaml 2.20.5 → 2.20.6

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: 1b30e94ad7e7b8311c5b84c5edea49b20dae43a6
4
- data.tar.gz: a9d74c63b1cbab83ea6e8af8661757893603cd34
3
+ metadata.gz: e7a5bc6d4b39b33a25b99f8de2b19c909fc900a6
4
+ data.tar.gz: 9b49196c7e2f24300c8e5674d242c7f5b39feac4
5
5
  SHA512:
6
- metadata.gz: f8ff347da53be0f0d7851d6575697bdb0b77e03c8f96e337228e58b6284d8cf875d9883e71c11da58aa08aa1bb8d420a63bd01d25370331cb47ed6c265e1668a
7
- data.tar.gz: 69346069b05a10f2e66dfd34d797395301f201d9c8a4f2784ed8ca44ada5174c9e413813b7b762dc58a3b8145b5bde253dcf9436a21f96aea0eab44d06a36ab0
6
+ metadata.gz: b892f8c29b90e96ec3b5c867c412ab86618fe070fef6a747bb40d212fd8516fb0f04b0d8df64cb75bec2aa809adca251574c7a8220506219e05790c88a8eecad
7
+ data.tar.gz: ce074d548cefdee9d0074e9cf3247ee297ebabe733a649fd72ffe64c0b511c7ed00bc3c3d4bd37bbde3716b11b5896b616dc5a13624b59efa1f234f1a02179a7
@@ -75,7 +75,7 @@ module Saml
75
75
  end
76
76
 
77
77
  relay_state = params["RelayState"] ? "&RelayState=#{params['RelayState']}" : ""
78
- "#{param_key}=#{params['SAMLRequest']}#{relay_state}&SigAlg=#{params['SigAlg']}"
78
+ "#{param_key}=#{params[param_key]}#{relay_state}&SigAlg=#{params['SigAlg']}"
79
79
  end
80
80
 
81
81
  def encoded_message
@@ -27,9 +27,11 @@ module Saml
27
27
  end
28
28
 
29
29
  def find_key_descriptor(key_name, use)
30
+ return key_descriptors.first unless key_name_or_use_specified?
31
+
30
32
  key_descriptors_by_use = find_key_descriptors_by_use(use)
31
33
 
32
- if key_name.present?
34
+ if key_name.present? && key_name_specified?
33
35
  key_descriptors_by_use.find { |key| key.key_info.key_name == key_name }
34
36
  else
35
37
  key_descriptors_by_use.first
@@ -41,6 +43,14 @@ module Saml
41
43
  def find_key_descriptors_by_use(use)
42
44
  key_descriptors.select { |key| key.use == use || key.use.blank? }
43
45
  end
46
+
47
+ def key_name_or_use_specified?
48
+ key_descriptors.any? { |key| key.use.present? || key.key_info.key_name.present? }
49
+ end
50
+
51
+ def key_name_specified?
52
+ key_descriptors.any? { |key| key.key_info.key_name.present? }
53
+ end
44
54
  end
45
55
  end
46
56
  end
data/lib/saml/config.rb CHANGED
@@ -18,6 +18,9 @@ module Saml
18
18
  mattr_accessor :registered_stores
19
19
  @@registered_stores = {}
20
20
 
21
+ mattr_accessor :generate_key_name
22
+ @@generate_key_name = true
23
+
21
24
  mattr_accessor :default_store
22
25
 
23
26
  mattr_accessor :inclusive_namespaces_prefix_list
@@ -19,7 +19,7 @@ module Saml
19
19
  if cert
20
20
  self.x509Data = X509Data.new(cert)
21
21
  end
22
- if self.x509Data && self.x509Data.x509certificate
22
+ if self.x509Data && self.x509Data.x509certificate && Saml::Config.generate_key_name
23
23
  self.key_name = Digest::SHA1.hexdigest(self.x509Data.x509certificate.to_der)
24
24
  end
25
25
  end
data/lib/saml/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Saml
2
- VERSION = '2.20.5'
2
+ VERSION = '2.20.6'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: libsaml
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.20.5
4
+ version: 2.20.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Benoist Claassen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-15 00:00:00.000000000 Z
11
+ date: 2016-03-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport