libsaml 3.5.0 → 3.6.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: abb53b0d4b821345d7c6a788457f25b4d70c321544bf4f865657d98e92e51373
4
- data.tar.gz: e6232eca89ec113e397fac83520309051fc110cbd9fd7f2d25a967e53e84a90d
3
+ metadata.gz: 9eea4c36aa9fc6f404ff5e6283c2ef39c1cb0e328652edc5e5fda2ceb7b21416
4
+ data.tar.gz: d76324210f3fe2863f82f89ac7b7317bc295798ec10982b903f2e3b2700dd62f
5
5
  SHA512:
6
- metadata.gz: 04d10429a91597ac66db5cbadbd1d340a7caff52582bf77e2323351e9462bc663a6fea2a82d3c9797d6c42023af80e8f96c53763bb92928c89c118fad2acb85d
7
- data.tar.gz: 68179407ec64d23b23b061a90b1e04ed7b9c0b6d991e860ed5d5a479fc441bf0b1619dff5409f51bf4a74c07501f990b42a6bf218e5700590b7e4158fe04e0c9
6
+ metadata.gz: 40a5e18247a43f3e215ce6045d51feeb2774a86e649b4702a64533555b4c5c98b83dad3927b3238929d141f0c49a1078903a278b2ccd76cdf6c29d6188f71839
7
+ data.tar.gz: 0eda4d5265000e0da3fc7d2650b69064cda9de9914a287cecb2974e077f42d4c76d05e30e7025a56f6ba7173128c63a652b185f0253424715e6e62227f5bdb45
@@ -28,10 +28,10 @@ module Saml
28
28
  !success? && status.status_code.unknown_principal?
29
29
  end
30
30
 
31
- def encrypt_assertions(certificate)
31
+ def encrypt_assertions(certificate, include_certificate: false)
32
32
  @encrypted_assertions = []
33
33
  assertions.each do |assertion|
34
- @encrypted_assertions << Saml::Util.encrypt_assertion(assertion, certificate)
34
+ @encrypted_assertions << Saml::Util.encrypt_assertion(assertion, certificate, include_certificate: include_certificate)
35
35
  end
36
36
  assertions.clear
37
37
  end
@@ -60,7 +60,7 @@ module Saml
60
60
  end
61
61
  end
62
62
 
63
- def encrypt_assertion(assertion, key_descriptor_or_certificate)
63
+ def encrypt_assertion(assertion, key_descriptor_or_certificate, include_certificate: false)
64
64
  case key_descriptor_or_certificate
65
65
  when OpenSSL::X509::Certificate
66
66
  certificate = key_descriptor_or_certificate
@@ -80,7 +80,11 @@ module Saml
80
80
  encrypted_key = encrypted_data.encrypt(assertion.to_s)
81
81
  encrypted_key.set_encryption_method(algorithm: 'http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p',
82
82
  digest_method_algorithm: 'http://www.w3.org/2000/09/xmldsig#sha1')
83
- encrypted_key.set_key_name(key_name)
83
+ encrypted_key.key_info = if include_certificate || key_name
84
+ key_info = Saml::Elements::KeyInfo.new(include_certificate ? certificate.to_pem : nil)
85
+ key_info.key_name = key_name
86
+ key_info
87
+ end
84
88
  encrypted_key.encrypt(certificate.public_key)
85
89
 
86
90
  Saml::Elements::EncryptedAssertion.new(encrypted_data: encrypted_data, encrypted_keys: encrypted_key)
@@ -1,3 +1,3 @@
1
1
  module Saml
2
- VERSION = '3.5.0'
2
+ VERSION = '3.6.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.5.0
4
+ version: 3.6.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: 2019-05-09 00:00:00.000000000 Z
11
+ date: 2019-10-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport