Handle empty signing key slot in key_slot()
This commit is contained in:
parent
1ac64f5360
commit
17fc6ebeff
1 changed files with 11 additions and 11 deletions
|
@ -245,17 +245,17 @@ pub fn key_slot(open: &mut Open, kt: KeyType) -> Result<Option<PublicKey>> {
|
|||
|
||||
match kt {
|
||||
KeyType::Signing => {
|
||||
// FIXME: handle empty signing key slot
|
||||
|
||||
let pkm = open.public_key(KeyType::Signing)?;
|
||||
|
||||
let key_sig = public_key_material_and_fp_to_key(
|
||||
if let Ok(pkm) = open.public_key(KeyType::Signing) {
|
||||
if let Some(ts) = times.signature() {
|
||||
return Ok(Some(public_key_material_and_fp_to_key(
|
||||
&pkm,
|
||||
KeyType::Signing,
|
||||
times.signature().expect("Signature time is unset"),
|
||||
ts,
|
||||
fps.signature().expect("Signature fingerprint is unset"),
|
||||
)?;
|
||||
Ok(Some(key_sig))
|
||||
)?));
|
||||
}
|
||||
}
|
||||
Ok(None)
|
||||
}
|
||||
KeyType::Decryption => {
|
||||
if let Ok(pkm) = open.public_key(KeyType::Decryption) {
|
||||
|
|
Loading…
Reference in a new issue