cred: reject non-32-byte raw ES256 scalars
This commit is contained in:
@@ -141,7 +141,7 @@ pub(super) fn read(value: &str, format: &str, passphrase: Option<&str>) -> Resul
|
||||
"ed25519" => Key::Ed(SigningKey::from_bytes(
|
||||
bytes.as_slice().try_into().map_err(|_| invalid_key())?,
|
||||
)),
|
||||
"es256" => {
|
||||
"es256" if bytes.len() == 32 => {
|
||||
Key::Ec(p256::ecdsa::SigningKey::from_slice(&bytes).map_err(|_| invalid_key())?)
|
||||
}
|
||||
"hmac" => Key::Mac(bytes),
|
||||
|
||||
Reference in New Issue
Block a user