Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3374519
D4814.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D4814.diff
View Options
diff --git a/native/cpp/CommonCpp/grpc/grpc_client/src/lib.rs b/native/cpp/CommonCpp/grpc/grpc_client/src/lib.rs
--- a/native/cpp/CommonCpp/grpc/grpc_client/src/lib.rs
+++ b/native/cpp/CommonCpp/grpc/grpc_client/src/lib.rs
@@ -95,6 +95,39 @@
}
}
+fn pake_registration_start(
+ rng: &mut (impl Rng + CryptoRng),
+ user_id: String,
+ password: &str,
+ device_id: String,
+ username: String,
+ user_public_key: String,
+) -> Result<(RegistrationRequest, Option<ClientRegistration<Cipher>>), Status> {
+ let client_registration_start_result =
+ ClientRegistration::<Cipher>::start(rng, password.as_bytes()).map_err(
+ |e| {
+ error!("Failed to start PAKE registration: {}", e);
+ Status::failed_precondition("PAKE failure")
+ },
+ )?;
+ let pake_registration_request =
+ client_registration_start_result.message.serialize();
+ Ok((
+ RegistrationRequest {
+ data: Some(PakeRegistrationRequestAndUserId(
+ PakeRegistrationRequestAndUserIdStruct {
+ user_id,
+ device_id,
+ pake_registration_request,
+ username,
+ user_public_key,
+ },
+ )),
+ },
+ Some(client_registration_start_result.state),
+ ))
+}
+
fn pake_registration_finish(
rng: &mut (impl Rng + CryptoRng),
registration_response_bytes: &[u8],
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Nov 27, 3:51 PM (19 h, 13 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2590903
Default Alt Text
D4814.diff (1 KB)
Attached To
Mode
D4814: [native] another helper for PAKE registration on client side
Attached
Detach File
Event Timeline
Log In to Comment