1
0
mirror of https://github.com/matrix-org/matrix-authentication-service.git synced 2025-07-31 09:24:31 +03:00

Fix EC key conversion & constraints

This commit is contained in:
Quentin Gliech
2022-08-29 12:22:29 +02:00
parent 7ea61ca257
commit 0b6e4cdece
2 changed files with 3 additions and 3 deletions

View File

@ -221,7 +221,7 @@ impl<'a> ConstraintSet<'a> {
ConstraintDecision::Positive => score += 1,
ConstraintDecision::Neutral => {}
// If any constraint was negative, don't add it to the candidates
ConstraintDecision::Negative => break 'outer,
ConstraintDecision::Negative => continue 'outer,
}
}

View File

@ -152,7 +152,7 @@ mod ec_impls {
.get(..FieldSize::<C>::USIZE)
.ok_or_else(Self::Error::default)?;
let y = value
.x
.y
.get(..FieldSize::<C>::USIZE)
.ok_or_else(Self::Error::default)?;
@ -220,7 +220,7 @@ mod legacy {
y.try_into()
.map_err(|_| anyhow::anyhow!("invalid curve parameter y"))?,
),
_ => bail!("Wrong key type"),
_ => bail!("Wrong curve"),
};
let point = sec1::EncodedPoint::from_affine_coordinates(&x.into(), &y.into(), false);