tanker-core 4.2.1 → 4.3.0.alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 45642288b534e67519487f9da9b697f21875ee66831e4ee91fe587b9748fdfdf
4
- data.tar.gz: ae8bc7f15ef328d1185d48086b177424b4182f37b61c182dc9c394ad8836584a
3
+ metadata.gz: 646aacdef995028da941416820f722d17a21ea374d08b2a736914b09df78acd0
4
+ data.tar.gz: 67f254c17c13353fc60d1d41fbbc046fedb9fec3cf2d36207d06de81c6019c1a
5
5
  SHA512:
6
- metadata.gz: eb6bcdfdc78d70a201039c4980ec55b954315ade3682c0933b2b07f65e27725a01a7b1248c3b5d90554eb1f301301bcdd8a513cca5e36137e5075c09df2b4c9e
7
- data.tar.gz: 31b3656945dca2d7e4e77f9f8234c34a3db115f3fac0b1f0c1cfa34412bed316922dc9429e694ab07583e4ce645f3ca8a7779f4b27b084b85b2d468530f0a6d3
6
+ metadata.gz: a3b57594fac7d9b78deec0aced563b7eee7ef1a0a27a754d587994af17d6fdc53e855310f75210747b8bc0dfad95264f6943285051ad8ccb55796902ed64faa3
7
+ data.tar.gz: ab8e10d48c28de75a40a2860bb1d4f346fd23a081d839722b3cc8a69c95b90fca10a7268a582a3b2b398927d42879af3962465e69386505edeefbb9423f3f40d
@@ -93,7 +93,8 @@ module Tanker
93
93
  :preverified_email, :pointer,
94
94
  :preverified_phone_number, :pointer,
95
95
  :preverified_oidc, COIDCVerification,
96
- :oidc_authorization_code_verification, COIDCAuthorizationCodeVerification
96
+ :oidc_authorization_code_verification, COIDCAuthorizationCodeVerification,
97
+ :prehashed_and_encrypted_passphrase, :pointer
97
98
 
98
99
  TYPE_EMAIL = 1
99
100
  TYPE_PASSPHRASE = 2
@@ -105,6 +106,7 @@ module Tanker
105
106
  TYPE_E2E_PASSPHRASE = 8
106
107
  TYPE_PREVERIFIED_OIDC = 9
107
108
  TYPE_OIDC_AUTHORIZATION_CODE = 10
109
+ TYPE_PREHASHED_AND_ENCRYPTED_PASSPHRASE = 11
108
110
 
109
111
  def initialize(verification) # rubocop:disable Metrics/MethodLength, Metrics/CyclomaticComplexity Not relevant for a case/when
110
112
  super()
@@ -157,11 +159,15 @@ module Tanker
157
159
  verification.authorization_code,
158
160
  verification.state
159
161
  )
162
+ when Tanker::PrehashedAndEncryptedPassphraseVerification
163
+ @prehashed_and_encrypted_passphrase = CTanker.new_cstring verification.prehashed_and_encrypted_passphrase
164
+ self[:type] = TYPE_PREHASHED_AND_ENCRYPTED_PASSPHRASE
165
+ self[:prehashed_and_encrypted_passphrase] = @prehashed_and_encrypted_passphrase
160
166
  else
161
167
  raise ArgumentError, 'Unknown Tanker::Verification type!'
162
168
  end
163
169
 
164
- self[:version] = 8
170
+ self[:version] = 9
165
171
  end
166
172
  end
167
173
 
@@ -90,6 +90,7 @@ module Tanker
90
90
  blocking_attach_function :tanker_http_handle_response, [CHttpRequest, CHttpResponse], :void
91
91
 
92
92
  blocking_attach_function :tanker_prehash_password, [:string], CFuture
93
+ blocking_attach_function :tanker_prehash_and_encrypt_password, [:string, :string], CFuture
93
94
 
94
95
  blocking_attach_function :tanker_authenticate_with_idp, [:session_pointer, :string, :string], CFuture
95
96
  blocking_attach_function :tanker_free_authenticate_with_idp_result, [:pointer], :void
@@ -79,6 +79,13 @@ module Tanker
79
79
  CTanker.tanker_prehash_password(str).get_string
80
80
  end
81
81
 
82
+ def self.prehash_and_encrypt_password(password, public_key)
83
+ ASSERT_UTF8.call(password)
84
+ ASSERT_UTF8.call(public_key)
85
+
86
+ CTanker.tanker_prehash_and_encrypt_password(password, public_key).get_string
87
+ end
88
+
82
89
  private
83
90
 
84
91
  def encrypt_common(data, encryption_options)
@@ -139,4 +139,16 @@ module Tanker
139
139
  @e2e_passphrase = e2e_passphrase
140
140
  end
141
141
  end
142
+
143
+ class PrehashedAndEncryptedPassphraseVerification < Verification
144
+ attr_reader :prehashed_and_encrypted_passphrase
145
+
146
+ def initialize(prehashed_and_encrypted_passphrase)
147
+ super()
148
+
149
+ ASSERT_UTF8.call(prehashed_and_encrypted_passphrase)
150
+
151
+ @prehashed_and_encrypted_passphrase = prehashed_and_encrypted_passphrase
152
+ end
153
+ end
142
154
  end
@@ -78,4 +78,6 @@ module Tanker
78
78
  end
79
79
 
80
80
  class E2ePassphraseVerificationMethod < VerificationMethod; end
81
+
82
+ class PrehashedAndEncryptedPassphraseVerificationMethod < VerificationMethod; end
81
83
  end
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Tanker
4
4
  class Core
5
- VERSION = '4.2.1'
5
+ VERSION = '4.3.0.alpha.1'
6
6
 
7
7
  def self.native_version
8
8
  CTanker.tanker_version_string
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tanker-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.2.1
4
+ version: 4.3.0.alpha.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tanker team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-09-13 00:00:00.000000000 Z
11
+ date: 2024-12-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -104,9 +104,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
104
104
  version: 3.1.0
105
105
  required_rubygems_version: !ruby/object:Gem::Requirement
106
106
  requirements:
107
- - - ">="
107
+ - - ">"
108
108
  - !ruby/object:Gem::Version
109
- version: '0'
109
+ version: 1.3.1
110
110
  requirements: []
111
111
  rubygems_version: 3.4.10
112
112
  signing_key: