Fixing simple_login example (#86)

This commit is contained in:
Kevin Lewi
2020-11-16 11:40:52 -08:00
committed by GitHub
parent f165310c96
commit 2d7b4292ff
2 changed files with 15 additions and 6 deletions
+9
View File
@@ -463,6 +463,15 @@ impl<CS: CipherSuite> LoginThirdMessage<CS> {
output
}
/// Deserialization from bytes
pub fn deserialize(input: &[u8]) -> Result<Self, ProtocolError> {
if input.is_empty() || input[0] != ProtocolMessageType::KeyExchange as u8 + 1 {
return Err(PakeError::SerializationError.into());
}
Self::try_from(&input[1..])
}
/// byte representation for the login finalization
pub fn to_bytes(&self) -> Vec<u8> {
self.ke3_message.to_bytes()