Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3114771
D4363.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
4 KB
Referenced Files
None
Subscribers
None
D4363.diff
View Options
diff --git a/services/identity/src/service.rs b/services/identity/src/service.rs
--- a/services/identity/src/service.rs
+++ b/services/identity/src/service.rs
@@ -37,10 +37,9 @@
registration_request::Data::PakeCredentialFinalization as PakeRegistrationCredentialFinalization,
registration_request::Data::PakeRegistrationRequestAndUserId,
registration_request::Data::PakeRegistrationUploadAndCredentialRequest,
+ registration_response::Data::PakeLoginResponse as PakeRegistrationLoginResponse,
registration_response::Data::PakeRegistrationResponse, LoginRequest,
- LoginResponse,
- PakeCredentialRequestAndUserId as PakeCredentialRequestAndUserIdStruct,
- PakeLoginRequest as PakeLoginRequestStruct,
+ LoginResponse, PakeLoginRequest as PakeLoginRequestStruct,
PakeLoginResponse as PakeLoginResponseStruct, RegistrationRequest,
RegistrationResponse, VerifyUserTokenRequest, VerifyUserTokenResponse,
WalletLoginRequest as WalletLoginRequestStruct,
@@ -125,15 +124,91 @@
Some(PakeRegistrationUploadAndCredentialRequest(
pake_registration_upload_and_credential_request,
)),
- }) => unimplemented!(),
+ }) => {
+ if let Err(e) = tx
+ .send(
+ match pake_registration_finish(
+ &user_id,
+ client.clone(),
+ &pake_registration_upload_and_credential_request
+ .pake_registration_upload,
+ server_registration,
+ num_messages_received,
+ )
+ .await
+ {
+ Ok(_) => pake_login_start(
+ config.clone(),
+ client.clone(),
+ &user_id.clone(),
+ &pake_registration_upload_and_credential_request
+ .pake_credential_request,
+ num_messages_received,
+ PakeWorkflow::Registration,
+ )
+ .await
+ .map(
+ |pake_login_response_and_server_login| {
+ server_login =
+ Some(pake_login_response_and_server_login.1);
+ RegistrationResponse {
+ data: Some(PakeRegistrationLoginResponse(
+ pake_login_response_and_server_login.0,
+ )),
+ }
+ },
+ ),
+ Err(e) => Err(e),
+ },
+ )
+ .await
+ {
+ error!("Response was dropped: {}", e);
+ break;
+ }
+ server_registration = None;
+ }
Ok(RegistrationRequest {
data:
Some(PakeRegistrationCredentialFinalization(
pake_credential_finalization,
)),
- }) => unimplemented!(),
-
- unexpected => unimplemented!(),
+ }) => {
+ if let Err(e) = tx
+ .send(
+ pake_login_finish(
+ &user_id,
+ &device_id,
+ client,
+ server_login,
+ &pake_credential_finalization,
+ &mut OsRng,
+ num_messages_received,
+ PakeWorkflow::Registration,
+ )
+ .await
+ .map(|pake_login_response| {
+ RegistrationResponse {
+ data: Some(PakeRegistrationLoginResponse(
+ pake_login_response,
+ )),
+ }
+ }),
+ )
+ .await
+ {
+ error!("Response was dropped: {}", e);
+ }
+ break;
+ }
+ unexpected => {
+ error!("Received an unexpected Result: {:?}", unexpected);
+ if let Err(e) = tx.send(Err(Status::unknown("unknown error"))).await
+ {
+ error!("Response was dropped: {}", e);
+ }
+ break;
+ }
}
num_messages_received += 1;
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Nov 1, 8:36 PM (21 h, 55 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2401319
Default Alt Text
D4363.diff (4 KB)
Attached To
Mode
D4363: [services][identity] register_user RPC
Attached
Detach File
Event Timeline
Log In to Comment