mirror of
https://github.com/pgpainless/pgpainless.git
synced 2025-12-09 05:41:07 +01:00
Ensure proper compatibility with keys with missing direct-key or certification self-sigs
This commit is contained in:
parent
6fdf136024
commit
620c1fc96a
3 changed files with 117 additions and 2 deletions
|
|
@ -67,9 +67,11 @@ abstract class KeyAccessor(protected val info: KeyRingInfo, protected val key: S
|
|||
info.getLatestUserIdCertification(userId).let { if (it != null) return it }
|
||||
}
|
||||
|
||||
return checkNotNull(info.latestDirectKeySelfSignature) {
|
||||
"No valid signature found."
|
||||
if (info.latestDirectKeySelfSignature != null) {
|
||||
return info.latestDirectKeySelfSignature
|
||||
}
|
||||
|
||||
return info.getCurrentSubkeyBindingSignature(key.subkeyId)!!
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -172,8 +172,11 @@ class KeyRingInfo(
|
|||
primaryUserIdCertification?.let { getKeyExpirationTimeAsDate(it, publicKey) }
|
||||
|
||||
if (latestDirectKeySelfSignature == null && primaryUserIdCertification == null) {
|
||||
/*
|
||||
throw NoSuchElementException(
|
||||
"No direct-key signature and no user-id signature found.")
|
||||
*/
|
||||
return null
|
||||
}
|
||||
if (directKeyExpirationDate != null && userIdExpirationDate == null) {
|
||||
return directKeyExpirationDate
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue