diff --git a/crates/jose/src/constraints.rs b/crates/jose/src/constraints.rs index 9af4c431..8e95ebbe 100644 --- a/crates/jose/src/constraints.rs +++ b/crates/jose/src/constraints.rs @@ -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, } } diff --git a/crates/jose/src/jwk/public_parameters.rs b/crates/jose/src/jwk/public_parameters.rs index 563bb13a..2fe00dc4 100644 --- a/crates/jose/src/jwk/public_parameters.rs +++ b/crates/jose/src/jwk/public_parameters.rs @@ -152,7 +152,7 @@ mod ec_impls { .get(..FieldSize::::USIZE) .ok_or_else(Self::Error::default)?; let y = value - .x + .y .get(..FieldSize::::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);