libsaml 3.9.1 → 3.9.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
  SHA256:
3
- metadata.gz: a6d2ed00b846de2e5bc324dfbcc6cb0128911b2d7d083db22ad6faf700120968
4
- data.tar.gz: 41f666637953e2d440518c4435b434026d2c42d74d6ed8963a7677e0fb9156fd
3
+ metadata.gz: 80a144ab0df42eeb447e74d6df3f3a19a7d89e72cf5527277403b229eb87216c
4
+ data.tar.gz: cd41e41d4f0492e98c52ea9c6865e958a0896c0522f987b58175c69e2d23eaac
5
5
  SHA512:
6
- metadata.gz: fa7bcd81253a4b7052ca0b897f7b8217dd6c6fe6c6fa51fb93abd39f36dbc5f3de16ccfd9f7eacad7f067b0b0ff4ea55f70b77d0a9b0c3a71819c7a93d2f4d48
7
- data.tar.gz: 820fb5b35797152e6d2d4981befab82e9eb916abaddd4c80e746639d1d810a620dc2072d116d1a7a6c4ec36c72d868a29428f2c05bab4969203e11dd38111d73
6
+ metadata.gz: 258f442a035b8e06cb9896ed2faf0c5e88d4d58c63ddfcbcd19b14b937fed2de1482aa89bd92bf3b8bcff20f32e5c65b0f92355eefcb1abe0944f2c14a470b45
7
+ data.tar.gz: faa732f728819578d2e75a73129148da7e74eefca3d5ef7a033b7926d2266c417f9c52666dae8c0eef5f3c6fa06032b6da2bdf7eb5118ba4fb9758d127d8f626
data/lib/saml/response.rb CHANGED
@@ -28,10 +28,14 @@ module Saml
28
28
  !success? && status.status_code.unknown_principal?
29
29
  end
30
30
 
31
- def encrypt_assertions(certificate, include_certificate: false)
31
+ def encrypt_assertions(key_descriptor_or_certificate, include_certificate: false, include_key_retrieval_method: false)
32
32
  @encrypted_assertions = []
33
33
  assertions.each do |assertion|
34
- @encrypted_assertions << Saml::Util.encrypt_assertion(assertion, certificate, include_certificate: include_certificate)
34
+ @encrypted_assertions << Saml::Util.encrypt_assertion(
35
+ assertion, key_descriptor_or_certificate,
36
+ include_certificate: include_certificate,
37
+ include_key_retrieval_method: include_key_retrieval_method
38
+ )
35
39
  end
36
40
  assertions.clear
37
41
  end
data/lib/saml/util.rb CHANGED
@@ -60,7 +60,7 @@ module Saml
60
60
  end
61
61
  end
62
62
 
63
- def encrypt_assertion(assertion, key_descriptor_or_certificate, include_certificate: false)
63
+ def encrypt_assertion(assertion, key_descriptor_or_certificate, include_certificate: false, include_key_retrieval_method: false)
64
64
  case key_descriptor_or_certificate
65
65
  when OpenSSL::X509::Certificate
66
66
  certificate = key_descriptor_or_certificate
@@ -87,6 +87,11 @@ module Saml
87
87
  end
88
88
  encrypted_key.encrypt(certificate.public_key)
89
89
 
90
+ if include_key_retrieval_method
91
+ encrypted_key.id = '_' + SecureRandom.uuid
92
+ encrypted_data.set_key_retrieval_method (Xmlenc::Builder::RetrievalMethod.new(uri: "##{encrypted_key.id}"))
93
+ end
94
+
90
95
  Saml::Elements::EncryptedAssertion.new(encrypted_data: encrypted_data, encrypted_keys: encrypted_key)
91
96
  end
92
97
 
data/lib/saml/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Saml
2
- VERSION = '3.9.1'
2
+ VERSION = '3.9.2'.freeze
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.9.1
4
+ version: 3.9.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Benoist Claassen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-01-11 00:00:00.000000000 Z
11
+ date: 2021-02-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport