omniauth-suomifi 0.4.0 → 0.4.1

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: 3a565773bca57e1803acfbf666ee25c54474374831857b4a1d7eeec965dbf289
4
- data.tar.gz: f555e8a657886b482b19bc93decac583dd3f6101c2060a48f9f811cc27af1272
3
+ metadata.gz: 6f13147094a51b1011e54a3b72e31352b17ce876fad5598156b5b1f6ada977b2
4
+ data.tar.gz: 3ab984607001ce46573290197e49390f7e9b27bc098a7c1f48a4f24717609065
5
5
  SHA512:
6
- metadata.gz: df188a2b7f673b6b2710a63dda35c123b5d757d2a0310b11b76ed43f58ec0c8cc39aa682bb2c99caa8967c5a8083137dc7340804e311aaae7ac20aaabed91739
7
- data.tar.gz: ce866b947cce063f0df0233bca9a5de7836b2b0326c4dab6398abb6255cd4b58627d365d9abcae09d74bc27fc4f0c7a07ab8f67eaac73efc2ebf0e3891758aeb
6
+ metadata.gz: 58af0b760126edc00ee2f114f90fd8c632271f1a60bc80938c70e61dbfb536c7e7032da6cd3cb91515bb239d68872c44ec3784c1498930f121e2bd139e63ff5d
7
+ data.tar.gz: a6367ec02b859f4e18e84bc9e739d3b44314a299b00730092c52c65a657b44b57b7ac80149cd2fd067023a200f1e25dc537647bd33e155b2bc4d5573fac7e39d
@@ -30,31 +30,35 @@ OneLogin::RubySaml::Utils.class_eval do
30
30
  # @return [String] The deciphered text
31
31
  def self.retrieve_plaintext(cipher_text, symmetric_key, algorithm)
32
32
  case algorithm
33
- when 'http://www.w3.org/2001/04/xmlenc#tripledes-cbc' then cipher = OpenSSL::Cipher.new('DES-EDE3-CBC').decrypt
34
- when 'http://www.w3.org/2001/04/xmlenc#aes128-cbc' then cipher = OpenSSL::Cipher.new('AES-128-CBC').decrypt
35
- when 'http://www.w3.org/2001/04/xmlenc#aes192-cbc' then cipher = OpenSSL::Cipher.new('AES-192-CBC').decrypt
36
- when 'http://www.w3.org/2001/04/xmlenc#aes256-cbc' then cipher = OpenSSL::Cipher.new('AES-256-CBC').decrypt
37
- when 'http://www.w3.org/2009/xmlenc11#aes128-gcm' then auth_cipher = OpenSSL::Cipher.new('AES-128-GCM').decrypt
38
- when 'http://www.w3.org/2009/xmlenc11#aes192-gcm' then auth_cipher = OpenSSL::Cipher.new('AES-192-GCM').decrypt
39
- when 'http://www.w3.org/2009/xmlenc11#aes256-gcm' then auth_cipher = OpenSSL::Cipher.new('AES-256-GCM').decrypt
40
- when 'http://www.w3.org/2001/04/xmlenc#rsa-1_5' then rsa = symmetric_key
41
- when 'http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p' then oaep = symmetric_key
33
+ when 'http://www.w3.org/2001/04/xmlenc#tripledes-cbc' then cipher = OpenSSL::Cipher.new('DES-EDE3-CBC').decrypt
34
+ when 'http://www.w3.org/2001/04/xmlenc#aes128-cbc' then cipher = OpenSSL::Cipher.new('AES-128-CBC').decrypt
35
+ when 'http://www.w3.org/2001/04/xmlenc#aes192-cbc' then cipher = OpenSSL::Cipher.new('AES-192-CBC').decrypt
36
+ when 'http://www.w3.org/2001/04/xmlenc#aes256-cbc' then cipher = OpenSSL::Cipher.new('AES-256-CBC').decrypt
37
+ when 'http://www.w3.org/2009/xmlenc11#aes128-gcm' then auth_cipher = OpenSSL::Cipher.new('AES-128-GCM').decrypt
38
+ when 'http://www.w3.org/2009/xmlenc11#aes192-gcm' then auth_cipher = OpenSSL::Cipher.new('AES-192-GCM').decrypt
39
+ when 'http://www.w3.org/2009/xmlenc11#aes256-gcm' then auth_cipher = OpenSSL::Cipher.new('AES-256-GCM').decrypt
40
+ when 'http://www.w3.org/2001/04/xmlenc#rsa-1_5' then rsa = symmetric_key
41
+ when 'http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p' then oaep = symmetric_key
42
42
  end
43
43
 
44
44
  if cipher
45
45
  iv_len = cipher.iv_len
46
46
  data = cipher_text[iv_len..-1]
47
- cipher.padding, cipher.key, cipher.iv = 0, symmetric_key, cipher_text[0..iv_len-1]
47
+ cipher.padding = 0
48
+ cipher.key = symmetric_key
49
+ cipher.iv = cipher_text[0..iv_len - 1]
48
50
  assertion_plaintext = cipher.update(data)
49
51
  assertion_plaintext << cipher.final
50
52
  elsif auth_cipher
51
- iv_len, text_len, tag_len = auth_cipher.iv_len, cipher_text.length, 16
52
- data = cipher_text[iv_len..text_len-1-tag_len]
53
+ iv_len = auth_cipher.iv_len
54
+ text_len = cipher_text.length
55
+ tag_len = 16
56
+ data = cipher_text[iv_len..text_len - 1 - tag_len]
53
57
  auth_cipher.padding = 0
54
58
  auth_cipher.key = symmetric_key
55
- auth_cipher.iv = cipher_text[0..iv_len-1]
59
+ auth_cipher.iv = cipher_text[0..iv_len - 1]
56
60
  auth_cipher.auth_data = ''
57
- auth_cipher.auth_tag = cipher_text[text_len-tag_len..-1]
61
+ auth_cipher.auth_tag = cipher_text[text_len - tag_len..-1]
58
62
  assertion_plaintext = auth_cipher.update(data)
59
63
  assertion_plaintext << auth_cipher.final
60
64
  elsif rsa
@@ -2,6 +2,6 @@
2
2
 
3
3
  module OmniAuth
4
4
  module Suomifi
5
- VERSION = '0.4.0'
5
+ VERSION = '0.4.1'
6
6
  end
7
7
  end
@@ -609,8 +609,8 @@ module OmniAuth
609
609
  case options.mode
610
610
  when :test
611
611
  'https://testi.apro.tunnistus.fi/static/metadata/idp-metadata.xml'
612
- else
613
- 'https://tunnistus.suomi.fi/static/metadata/idp-metadata-secondary.xml'
612
+ else # :production
613
+ 'https://tunnistus.suomi.fi/static/metadata/idp-metadata-tunnistautuminen.xml'
614
614
  end
615
615
  end
616
616
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-suomifi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Antti Hukkanen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-10-22 00:00:00.000000000 Z
11
+ date: 2021-02-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: omniauth-saml