Skip to content

Commit

Permalink
fix build for hfs feature
Browse files Browse the repository at this point in the history
  • Loading branch information
mcginty committed Feb 2, 2022
1 parent 3c512ed commit 8186005
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ impl<'builder> Builder<'builder> {
let kem = resolver.resolve_kem(&kem_choice).ok_or(InitStage::GetKemImpl)?;
hs.set_kem(kem);
} else {
return Err(InitStage::GetKemImpl)
return Err(InitStage::GetKemImpl.into())
}
}
Ok(())
Expand Down
4 changes: 2 additions & 2 deletions src/params/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ impl FromStr for KemChoice {
use self::KemChoice::*;
match s {
"Kyber1024" => Ok(Kyber1024),
_ => return Err(PatternProblem::UnsupportedKemType),
_ => return Err(PatternProblem::UnsupportedKemType.into()),
}
}
}
Expand Down Expand Up @@ -221,7 +221,7 @@ impl FromStr for NoiseParams {

// Validate that a KEM is specified iff the hfs modifier is present
if p.handshake.is_hfs() != p.kem.is_some() {
return Err(PatternProblem::TooFewParameters);
return Err(PatternProblem::TooFewParameters.into());
}
Ok(p)
}
Expand Down
2 changes: 1 addition & 1 deletion src/params/patterns.rs
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ impl<'a> TryFrom<&'a HandshakeChoice> for HandshakeTokens {
/// if `handshake` is invalid because of this. Otherwise it will return `()`.
fn check_hfs_and_oneway_conflict(handshake: &HandshakeChoice) -> Result<(), Error> {
if handshake.is_hfs() && handshake.pattern.is_oneway() {
return Err(PatternProblem::UnsupportedModifier)
return Err(PatternProblem::UnsupportedModifier.into())
} else {
Ok(())
}
Expand Down

0 comments on commit 8186005

Please sign in to comment.