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 {
|
match kt {
|
||||||
KeyType::Signing => {
|
KeyType::Signing => {
|
||||||
// FIXME: handle empty signing key slot
|
if let Ok(pkm) = open.public_key(KeyType::Signing) {
|
||||||
|
if let Some(ts) = times.signature() {
|
||||||
let pkm = open.public_key(KeyType::Signing)?;
|
return Ok(Some(public_key_material_and_fp_to_key(
|
||||||
|
|
||||||
let key_sig = public_key_material_and_fp_to_key(
|
|
||||||
&pkm,
|
&pkm,
|
||||||
KeyType::Signing,
|
KeyType::Signing,
|
||||||
times.signature().expect("Signature time is unset"),
|
ts,
|
||||||
fps.signature().expect("Signature fingerprint is unset"),
|
fps.signature().expect("Signature fingerprint is unset"),
|
||||||
)?;
|
)?));
|
||||||
Ok(Some(key_sig))
|
}
|
||||||
|
}
|
||||||
|
Ok(None)
|
||||||
}
|
}
|
||||||
KeyType::Decryption => {
|
KeyType::Decryption => {
|
||||||
if let Ok(pkm) = open.public_key(KeyType::Decryption) {
|
if let Ok(pkm) = open.public_key(KeyType::Decryption) {
|
||||||
|
|
Loading…
Reference in a new issue