Key::list: Skip Certificate::new for empty buffers

This matches the C code behaviour.
This commit is contained in:
Jack Grigg
2019-11-30 16:40:15 +00:00
parent 8e38cf6c4e
commit c3698dcffb
+4 -2
View File
@@ -125,8 +125,10 @@ impl Key {
} }
}; };
let cert = Certificate::new(buf)?; if !buf.is_empty() {
keys.push(Key { slot, cert }); let cert = Certificate::new(buf)?;
keys.push(Key { slot, cert });
}
} }
Ok(keys) Ok(keys)