db: prioritize fingerprint collision errors over key id ones
This commit is contained in:
parent
dc3454facb
commit
cae1d16b77
|
@ -391,14 +391,6 @@ impl Database for Filesystem {
|
|||
|
||||
let path_published = self.fingerprint_to_path_published(fpr_target);
|
||||
|
||||
if let Ok(link_keyid_target) = link_keyid.canonicalize() {
|
||||
if !link_keyid_target.ends_with(&path_published) {
|
||||
info!("KeyID points to different key for {} (expected {:?} to be suffix of {:?})",
|
||||
fpr, &path_published, &link_keyid_target);
|
||||
Err(failure::err_msg(format!("KeyID collision for key {}", fpr)))?;
|
||||
}
|
||||
}
|
||||
|
||||
if let Ok(link_fpr_target) = link_keyid.canonicalize() {
|
||||
if !link_fpr_target.ends_with(&path_published) {
|
||||
info!("Fingerprint points to different key for {} (expected {:?} to be suffix of {:?})",
|
||||
|
@ -407,6 +399,14 @@ impl Database for Filesystem {
|
|||
}
|
||||
}
|
||||
|
||||
if let Ok(link_keyid_target) = link_keyid.canonicalize() {
|
||||
if !link_keyid_target.ends_with(&path_published) {
|
||||
info!("KeyID points to different key for {} (expected {:?} to be suffix of {:?})",
|
||||
fpr, &path_published, &link_keyid_target);
|
||||
Err(failure::err_msg(format!("KeyID collision for key {}", fpr)))?;
|
||||
}
|
||||
}
|
||||
|
||||
if !link_fpr.exists() || link_keyid.exists() {
|
||||
Ok(Some(fpr.clone()))
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue