libsaml 3.9.1 → 3.11.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: a6d2ed00b846de2e5bc324dfbcc6cb0128911b2d7d083db22ad6faf700120968
4
- data.tar.gz: 41f666637953e2d440518c4435b434026d2c42d74d6ed8963a7677e0fb9156fd
3
+ metadata.gz: 9f068650fef3acc9414a742014fc8627037e1b389ed1d3fb51ae35ccebce2132
4
+ data.tar.gz: 49ea9d3a2f1c8864784a303d6831eb0a517e77ca287f774e43bd01ec095f8db6
5
5
  SHA512:
6
- metadata.gz: fa7bcd81253a4b7052ca0b897f7b8217dd6c6fe6c6fa51fb93abd39f36dbc5f3de16ccfd9f7eacad7f067b0b0ff4ea55f70b77d0a9b0c3a71819c7a93d2f4d48
7
- data.tar.gz: 820fb5b35797152e6d2d4981befab82e9eb916abaddd4c80e746639d1d810a620dc2072d116d1a7a6c4ec36c72d868a29428f2c05bab4969203e11dd38111d73
6
+ metadata.gz: d3e4a582bfe261f693c80930e22a5c516972cd72aa1886a7aa9af8747a2f440e43f1ac7251cdfb8933f8e0bd8e9be5dcf1f9eac59119ad012981311f8b4dc0dc
7
+ data.tar.gz: deb28f03e0f61c917c7da96d4cd01829402af67abdef7e46b06e1d678156bad8b8580fc30222d1d92e6b47d1a9f557864c07bc56dbe610cfd22e23fb73353ab5
data/README.md CHANGED
@@ -1,7 +1,6 @@
1
- [![Build status](https://travis-ci.org/digidentity/libsaml.png?branch=master)](https://travis-ci.org/digidentity/libsaml)
1
+ [![Build status](https://travis-ci.com/digidentity/libsaml.svg?branch=master)](https://travis-ci.com/digidentity/libsaml)
2
2
  [![Coverage status](https://coveralls.io/repos/digidentity/libsaml/badge.png)](https://coveralls.io/r/digidentity/libsaml)
3
3
  [![Code climate](https://codeclimate.com/github/digidentity/libsaml.png)](https://codeclimate.com/github/digidentity/libsaml)
4
- [![Dependency status](https://gemnasium.com/digidentity/libsaml.png)](https://gemnasium.com/digidentity/libsaml)
5
4
 
6
5
  # libsaml
7
6
 
@@ -7,7 +7,12 @@ module Saml
7
7
  def create_form_attributes(message, options = {})
8
8
  param = message.is_a?(Saml::ComplexTypes::StatusResponseType) ? "SAMLResponse" : "SAMLRequest"
9
9
 
10
- xml = notify('create_message', Saml::Util.sign_xml(message))
10
+ xml = if options[:skip_signature]
11
+ message.to_xml
12
+ else
13
+ Saml::Util.sign_xml(message)
14
+ end
15
+ notify('create_message', xml)
11
16
 
12
17
  variables = {}
13
18
  variables[param] = Saml::Encoding.encode_64(xml)
@@ -14,6 +14,11 @@ module Saml
14
14
  options[:signature_algorithm] = http_request.params["SigAlg"]
15
15
  options[:relay_state] = http_request.params["RelayState"]
16
16
 
17
+ receive_xml = http_request.params["SAMLRequest"] || http_request.params["SAMLResponse"]
18
+ if receive_xml.nil?
19
+ raise Saml::Errors::InvalidParams, 'require params `SAMLRequest` or `SAMLResponse`'
20
+ end
21
+
17
22
  request_or_response = parse_request_or_response(options.delete(:type), http_request.params)
18
23
 
19
24
  redirect_binding = new(request_or_response, options)
data/lib/saml/provider.rb CHANGED
@@ -105,6 +105,8 @@ module Saml
105
105
  def digest_method(signature_algorithm)
106
106
  digest = signature_algorithm && signature_algorithm =~ /sha(.*?)$/i && $1.to_i
107
107
  case digest
108
+ when 512 then
109
+ OpenSSL::Digest::SHA512
108
110
  when 256 then
109
111
  OpenSSL::Digest::SHA256
110
112
  else
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.11.0'.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.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Benoist Claassen
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-01-11 00:00:00.000000000 Z
11
+ date: 2021-12-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -44,28 +44,28 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 0.7.3
47
+ version: 0.8.1
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 0.7.3
54
+ version: 0.8.1
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: nokogiri
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '1.8'
61
+ version: '1.11'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '1.8'
68
+ version: '1.11'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: xmldsig
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -95,7 +95,7 @@ dependencies:
95
95
  version: 0.6.9
96
96
  - - "<"
97
97
  - !ruby/object:Gem::Version
98
- version: 0.8.0
98
+ version: 0.9.0
99
99
  type: :runtime
100
100
  prerelease: false
101
101
  version_requirements: !ruby/object:Gem::Requirement
@@ -105,7 +105,7 @@ dependencies:
105
105
  version: 0.6.9
106
106
  - - "<"
107
107
  - !ruby/object:Gem::Version
108
- version: 0.8.0
108
+ version: 0.9.0
109
109
  - !ruby/object:Gem::Dependency
110
110
  name: coveralls
111
111
  requirement: !ruby/object:Gem::Requirement
@@ -240,7 +240,7 @@ homepage: https://www.digidentity.eu
240
240
  licenses:
241
241
  - MIT
242
242
  metadata: {}
243
- post_install_message:
243
+ post_install_message:
244
244
  rdoc_options: []
245
245
  require_paths:
246
246
  - lib
@@ -255,8 +255,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
255
255
  - !ruby/object:Gem::Version
256
256
  version: '0'
257
257
  requirements: []
258
- rubygems_version: 3.0.3
259
- signing_key:
258
+ rubygems_version: 3.1.4
259
+ signing_key:
260
260
  specification_version: 4
261
261
  summary: A gem to easily create SAML 2.0 messages.
262
262
  test_files: []