libsaml 3.7.0 → 3.8.0

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
  SHA256:
3
- metadata.gz: e689c8b19f26da4c7cc09904fb18cb052088834f32567abf14023219f9987481
4
- data.tar.gz: cbc544b35d8b045d11c09c85f074234466d33b1a90a91a229d47d594456cc646
3
+ metadata.gz: c8602623fb6ff573229bee77449d7b939bcc867b2862011665cf08876fbca147
4
+ data.tar.gz: cd3b05407b74aff98d96f5f912bee1f778c635ad1c0b8d9debac3882d14f86bc
5
5
  SHA512:
6
- metadata.gz: 1b11d5dda8bf220251d944a1c8397075e33b0c98c67a42b6d0e61bffe0c67722a8628e79461880d3ecd9d982751ef322ff5485a18cd320c024f1ef13e5d80827
7
- data.tar.gz: cec277eeadebc7a6c4f5294437b34f7a39daff47873c9e35ad95e6c42e0f91429580bca880214c4e95728f17cdf599694e60981bab8d24c2483f99ab0c79c1cb
6
+ metadata.gz: 004b9e85d04de2d72c7e0436b278c8b2a9b7b60e2a31ff814b1e5af65c00b0fb82ea7dddbaf59cad54f4f3c517542dc9ff981d48b4e50936d57f2c852dc96838
7
+ data.tar.gz: aa39e527b34460a27860d017e2a46a2077539f75130318b697fb725a23899f7a79f048cc81599b5ffc575e0b7f30ae1b0491fef85847f1a26d9a5dbd890be5e1
@@ -28,16 +28,16 @@ module Saml
28
28
 
29
29
  if key_descriptors.any?
30
30
  if key_descriptors.one?
31
- encrypt_for_one_recipient(key_descriptors.first, key_options)
31
+ encrypt_for_one_key_descriptor(key_descriptors.first, key_options)
32
32
  else
33
- encrypt_for_multiple_recipients(key_descriptors, key_options)
33
+ encrypt_for_multiple_key_descriptors(key_descriptors, key_options)
34
34
  end
35
35
  end
36
36
  end
37
37
 
38
38
  private
39
39
 
40
- def encrypt_for_one_recipient(key_descriptor, key_options = {})
40
+ def encrypt_for_one_key_descriptor(key_descriptor, key_options = {})
41
41
  self.encrypted_data = Xmlenc::Builder::EncryptedData.new
42
42
 
43
43
  self.encrypted_data.set_key_retrieval_method Xmlenc::Builder::RetrievalMethod.new(
@@ -60,27 +60,30 @@ module Saml
60
60
  self.name_id = nil
61
61
  end
62
62
 
63
- def encrypt_for_multiple_recipients(key_descriptors, key_options = {})
63
+ def encrypt_for_multiple_key_descriptors(key_descriptors, key_options = {})
64
64
  key_name = key_options[:key_name]
65
65
  encrypted_keys = []
66
66
 
67
67
  self.encrypted_data = Xmlenc::Builder::EncryptedData.new
68
68
  self.encrypted_data.set_key_name key_name
69
- self.encrypted_data.set_encryption_method(
70
- algorithm: 'http://www.w3.org/2001/04/xmlenc#aes256-cbc'
71
- )
69
+ self.encrypted_data.set_encryption_method(algorithm: 'http://www.w3.org/2001/04/xmlenc#aes256-cbc')
70
+
71
+ original_encrypted_key = self.encrypted_data.encrypt(name_id_xml, key_options)
72
72
 
73
73
  key_descriptors.each do |key_descriptor|
74
- encrypted_key = self.encrypted_data.encrypt(
75
- name_id_xml,
76
- key_options.merge(id: "_#{SecureRandom.uuid}", carried_key_name: key_name)
74
+ encrypted_key_options = key_options.merge(
75
+ id: "_#{SecureRandom.uuid}",
76
+ data: original_encrypted_key.data,
77
+ carried_key_name: key_name
77
78
  )
79
+
80
+ encrypted_key = Xmlenc::Builder::EncryptedKey.new(encrypted_key_options)
81
+ encrypted_key.add_data_reference(self.encrypted_data.id)
82
+ encrypted_key.set_key_name(key_descriptor.key_info.key_name)
78
83
  encrypted_key.set_encryption_method(
79
84
  algorithm: 'http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p',
80
85
  digest_method_algorithm: 'http://www.w3.org/2000/09/xmldsig#sha1'
81
86
  )
82
-
83
- encrypted_key.set_key_name(key_descriptor.key_info.key_name)
84
87
  encrypted_key.encrypt(key_descriptor.certificate.public_key)
85
88
 
86
89
  encrypted_keys << encrypted_key
@@ -1,3 +1,3 @@
1
1
  module Saml
2
- VERSION = '3.7.0'
2
+ VERSION = '3.8.0'
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: 3.7.0
4
+ version: 3.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Benoist Claassen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-03-17 00:00:00.000000000 Z
11
+ date: 2020-04-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport