Page MenuHomePhabricator

D4814.diff
No OneTemporary

D4814.diff

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

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)

Event Timeline