remove the last few constants
This commit is contained in:
+3
-6
@@ -15,7 +15,7 @@ use crate::{
|
|||||||
keypair::{KeyPair, SizedBytes},
|
keypair::{KeyPair, SizedBytes},
|
||||||
oprf,
|
oprf,
|
||||||
oprf::OprfClientBytes,
|
oprf::OprfClientBytes,
|
||||||
serialization::{serialize, tokenize, ProtocolMessageType},
|
serialization::{serialize, tokenize, CredentialType, ProtocolMessageType},
|
||||||
slow_hash::SlowHash,
|
slow_hash::SlowHash,
|
||||||
};
|
};
|
||||||
use generic_array::{typenum::Unsigned, GenericArray};
|
use generic_array::{typenum::Unsigned, GenericArray};
|
||||||
@@ -23,9 +23,6 @@ use rand_core::{CryptoRng, RngCore};
|
|||||||
use std::{convert::TryFrom, marker::PhantomData};
|
use std::{convert::TryFrom, marker::PhantomData};
|
||||||
use zeroize::Zeroize;
|
use zeroize::Zeroize;
|
||||||
|
|
||||||
const CREDENTIAL_TYPE_SKU: u8 = 0x01;
|
|
||||||
const CREDENTIAL_TYPE_PKS: u8 = 0x03;
|
|
||||||
|
|
||||||
// Messages
|
// Messages
|
||||||
// =========
|
// =========
|
||||||
|
|
||||||
@@ -136,8 +133,8 @@ where
|
|||||||
registration_response.extend_from_slice(&serialize(Vec::new(), 2));
|
registration_response.extend_from_slice(&serialize(Vec::new(), 2));
|
||||||
|
|
||||||
// TODO: The following should not be hardcoded, but instead be customizable
|
// TODO: The following should not be hardcoded, but instead be customizable
|
||||||
registration_response.extend_from_slice(&serialize(vec![CREDENTIAL_TYPE_SKU], 1));
|
registration_response.extend_from_slice(&[1u8, CredentialType::SkU as u8 + 1]);
|
||||||
registration_response.extend_from_slice(&serialize(vec![CREDENTIAL_TYPE_PKS], 1));
|
registration_response.extend_from_slice(&[1u8, CredentialType::PkS as u8 + 1]);
|
||||||
|
|
||||||
let mut output: Vec<u8> = Vec::new();
|
let mut output: Vec<u8> = Vec::new();
|
||||||
output.push(ProtocolMessageType::from(self) as u8 + 1);
|
output.push(ProtocolMessageType::from(self) as u8 + 1);
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ pub enum ProtocolMessageType {
|
|||||||
CredentialResponse,
|
CredentialResponse,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[allow(dead_code)]
|
||||||
pub enum CredentialType {
|
pub enum CredentialType {
|
||||||
SkU,
|
SkU,
|
||||||
PkU,
|
PkU,
|
||||||
|
|||||||
Reference in New Issue
Block a user