You've already forked authentication-service
mirror of
https://github.com/matrix-org/matrix-authentication-service.git
synced 2025-08-07 17:03:01 +03:00
Fix EC key conversion & constraints
This commit is contained in:
@@ -221,7 +221,7 @@ impl<'a> ConstraintSet<'a> {
|
|||||||
ConstraintDecision::Positive => score += 1,
|
ConstraintDecision::Positive => score += 1,
|
||||||
ConstraintDecision::Neutral => {}
|
ConstraintDecision::Neutral => {}
|
||||||
// If any constraint was negative, don't add it to the candidates
|
// If any constraint was negative, don't add it to the candidates
|
||||||
ConstraintDecision::Negative => break 'outer,
|
ConstraintDecision::Negative => continue 'outer,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -152,7 +152,7 @@ mod ec_impls {
|
|||||||
.get(..FieldSize::<C>::USIZE)
|
.get(..FieldSize::<C>::USIZE)
|
||||||
.ok_or_else(Self::Error::default)?;
|
.ok_or_else(Self::Error::default)?;
|
||||||
let y = value
|
let y = value
|
||||||
.x
|
.y
|
||||||
.get(..FieldSize::<C>::USIZE)
|
.get(..FieldSize::<C>::USIZE)
|
||||||
.ok_or_else(Self::Error::default)?;
|
.ok_or_else(Self::Error::default)?;
|
||||||
|
|
||||||
@@ -220,7 +220,7 @@ mod legacy {
|
|||||||
y.try_into()
|
y.try_into()
|
||||||
.map_err(|_| anyhow::anyhow!("invalid curve parameter y"))?,
|
.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);
|
let point = sec1::EncodedPoint::from_affine_coordinates(&x.into(), &y.into(), false);
|
||||||
|
Reference in New Issue
Block a user