aboutsummaryrefslogtreecommitdiffstats
path: root/src/schema.rs
diff options
context:
space:
mode:
authorYigit Sever2021-04-14 03:27:27 +0300
committerYigit Sever2021-04-14 19:11:49 +0300
commite466f25ecfa356137523ee597b9fc6ab0da5df22 (patch)
tree06946f8811f90cf89ddc0afe685f15e9b3cf6cda /src/schema.rs
parentdb5a025bae30bfb6044e87eb196cc6bb63eb68d3 (diff)
downloadgradecoin-e466f25ecfa356137523ee597b9fc6ab0da5df22.tar.gz
gradecoin-e466f25ecfa356137523ee597b9fc6ab0da5df22.tar.bz2
gradecoin-e466f25ecfa356137523ee597b9fc6ab0da5df22.zip
[WIP] Initial implementation of user auth
There is a dance involved and everything Write down specs for RSA and AES, padding scheme, ugh.
Diffstat (limited to 'src/schema.rs')
-rw-r--r--src/schema.rs9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/schema.rs b/src/schema.rs
index 9e157c7..f159d83 100644
--- a/src/schema.rs
+++ b/src/schema.rs
@@ -178,7 +178,7 @@ pub struct MetuId {
178 passwd: String, 178 passwd: String,
179} 179}
180 180
181// TODO: this will arrive encrypted <13-04-21, yigit> // 181/// The plaintext of the initial user authentication request
182#[derive(Serialize, Deserialize, Debug, PartialEq)] 182#[derive(Serialize, Deserialize, Debug, PartialEq)]
183pub struct AuthRequest { 183pub struct AuthRequest {
184 pub student_id: String, 184 pub student_id: String,
@@ -186,6 +186,13 @@ pub struct AuthRequest {
186 pub public_key: String, 186 pub public_key: String,
187} 187}
188 188
189/// Ciphertext of the initial authentication request, or what we will receive
190#[derive(Serialize, Deserialize, Debug)]
191pub struct InitialAuthRequest {
192 pub c: String,
193 pub key: String,
194}
195
189lazy_static! { 196lazy_static! {
190 static ref OUR_STUDENTS: HashSet<(&'static str, &'static str)> = { 197 static ref OUR_STUDENTS: HashSet<(&'static str, &'static str)> = {
191 [ 198 [