openpgp-card-sequoia: fix padding for Curve 25519 private key material.
Importing 25519 keys with leading zero bytes led to failures on at least Gnuk and Nitrokey's opgpcard-rs implementation. Reported by Wiktor Kwapisiewicz, also see https://codeberg.org/wiktor/broken-nitro
This commit is contained in:
parent
7a28d36e93
commit
365670041f
1 changed files with 1 additions and 1 deletions
|
@ -234,11 +234,11 @@ impl EccKey for SqEccKey {
|
|||
}
|
||||
|
||||
fn private(&self) -> Vec<u8> {
|
||||
// FIXME: padding for 25519?
|
||||
match self.curve {
|
||||
Curve::NistP256 => self.private.value_padded(0x20).to_vec(),
|
||||
Curve::NistP384 => self.private.value_padded(0x30).to_vec(),
|
||||
Curve::NistP521 => self.private.value_padded(0x42).to_vec(),
|
||||
Curve::Cv25519 | Curve::Ed25519 => self.private.value_padded(0x20).to_vec(),
|
||||
_ => self.private.value().to_vec(),
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue