Add messages for the OPAQUE protocol

This commit is contained in:
Valentin Tolmer 2021-06-16 19:12:41 +02:00 committed by nitnelave
parent b5c7e3b0d7
commit 7e6c6eace6
2 changed files with 51 additions and 0 deletions

View File

@ -10,6 +10,56 @@ pub struct BindRequest {
pub password: String,
}
/// The messages for the 3-step OPAQUE login process.
pub mod login {
use super::*;
#[derive(Serialize, Deserialize, Clone)]
pub struct ClientLoginStartRequest {
pub username: String,
pub login_start_request: opaque::server::login::CredentialRequest,
}
#[derive(Serialize, Deserialize, Clone)]
pub struct ServerLoginStartResponse {
/// A randomly-generated temporary key that corresponds to this login attempt.
pub login_key: String,
pub credential_response: opaque::client::login::CredentialResponse,
}
#[derive(Serialize, Deserialize, Clone)]
pub struct ClientLoginFinishRequest {
/// The key returned by the server in the previous step.
pub login_key: String,
pub credential_finalization: opaque::client::login::CredentialFinalization,
}
}
/// The messages for the 3-step OPAQUE registration process.
pub mod registration {
use super::*;
#[derive(Serialize, Deserialize, Clone)]
pub struct ClientRegistrationStartRequest {
pub username: String,
pub registration_start_request: opaque::server::registration::RegistrationRequest,
}
#[derive(Serialize, Deserialize, Clone)]
pub struct ServerRegistrationStartResponse {
/// A randomly-generated temporary key that corresponds to this registration attempt.
pub registration_key: String,
pub registration_response: opaque::client::registration::RegistrationResponse,
}
#[derive(Serialize, Deserialize, Clone)]
pub struct ClientRegistrationFinishRequest {
/// The key returned by the server in the previous step.
pub registration_key: String,
pub registration_upload: opaque::server::registration::RegistrationUpload,
}
}
#[derive(PartialEq, Eq, Debug, Serialize, Deserialize, Clone)]
pub enum RequestFilter {
And(Vec<RequestFilter>),

View File

@ -100,6 +100,7 @@ pub mod client {
pub type ClientLoginFinishResult = opaque_ke::ClientLoginFinishResult<DefaultSuite>;
pub type ClientLoginStartResult = opaque_ke::ClientLoginStartResult<DefaultSuite>;
pub type CredentialResponse = opaque_ke::CredentialResponse<DefaultSuite>;
pub type CredentialFinalization = opaque_ke::CredentialFinalization<DefaultSuite>;
pub use opaque_ke::{
ClientLoginFinishParameters,
ClientLoginStartParameters,