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 +4 -4
- data/lib/saml/elements/encrypted_id.rb +15 -12
- data/lib/saml/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c8602623fb6ff573229bee77449d7b939bcc867b2862011665cf08876fbca147
|
4
|
+
data.tar.gz: cd3b05407b74aff98d96f5f912bee1f778c635ad1c0b8d9debac3882d14f86bc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
31
|
+
encrypt_for_one_key_descriptor(key_descriptors.first, key_options)
|
32
32
|
else
|
33
|
-
|
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
|
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
|
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
|
-
|
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
|
-
|
75
|
-
|
76
|
-
|
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
|
data/lib/saml/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2020-04-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|