@@ -4,7 +4,7 @@ use crate::ctanker::{
4
4
} ;
5
5
use std:: ffi:: CString ;
6
6
7
- const CVERIFICATION_VERSION : u8 = 8 ;
7
+ const CVERIFICATION_VERSION : u8 = 9 ;
8
8
const CEMAIL_VERIFICATION_VERSION : u8 = 1 ;
9
9
const CPHONE_NUMBER_VERIFICATION_VERSION : u8 = 1 ;
10
10
const CPREVERIFIED_OIDC_VERIFICATION_VERSION : u8 = 1 ;
@@ -23,6 +23,7 @@ enum Type {
23
23
E2ePassphrase = 8 ,
24
24
PreverifiedOIDC = 9 ,
25
25
OIDCAuthorizationCode = 10 ,
26
+ PrehashedAndEncryptedPassphrase = 11 ,
26
27
}
27
28
28
29
pub ( crate ) struct CVerificationWrapper {
@@ -68,6 +69,7 @@ impl CVerificationWrapper {
68
69
authorization_code : std:: ptr:: null ( ) ,
69
70
state : std:: ptr:: null ( ) ,
70
71
} ,
72
+ prehashed_and_encrypted_passphrase : std:: ptr:: null ( ) ,
71
73
} ,
72
74
}
73
75
}
@@ -166,6 +168,19 @@ impl CVerificationWrapper {
166
168
wrapper
167
169
}
168
170
171
+ pub ( self ) fn with_prehashed_and_encrypted_passphrase (
172
+ prehashed_and_encrypted_passphrase : & str ,
173
+ ) -> Self {
174
+ let mut wrapper = Self :: new ( ) ;
175
+ let cpaep = CString :: new ( prehashed_and_encrypted_passphrase) . unwrap ( ) ;
176
+
177
+ wrapper. cverif . verification_method_type = Type :: PrehashedAndEncryptedPassphrase as u8 ;
178
+ wrapper. cverif . prehashed_and_encrypted_passphrase = cpaep. as_ptr ( ) ;
179
+
180
+ wrapper. cstrings . push ( cpaep) ;
181
+ wrapper
182
+ }
183
+
169
184
pub ( self ) fn with_preverifed_oidc ( subject : & str , provider_id : & str ) -> Self {
170
185
let mut wrapper = Self :: new ( ) ;
171
186
let csubject = CString :: new ( subject) . unwrap ( ) ;
@@ -240,6 +255,7 @@ pub enum Verification {
240
255
authorization_code : String ,
241
256
state : String ,
242
257
} ,
258
+ PrehashedAndEncryptedPassphrase ( String ) ,
243
259
}
244
260
245
261
impl Verification {
@@ -281,6 +297,11 @@ impl Verification {
281
297
authorization_code,
282
298
state,
283
299
) ,
300
+ Verification :: PrehashedAndEncryptedPassphrase ( prehashed_and_encrypted_passphrase) => {
301
+ CVerificationWrapper :: with_prehashed_and_encrypted_passphrase (
302
+ prehashed_and_encrypted_passphrase,
303
+ )
304
+ }
284
305
}
285
306
}
286
307
}
0 commit comments