Fixing SignedNodeInfoe security issue (#2908)

This commit is contained in:
Michal Kit 2018-04-03 15:49:06 +01:00 committed by GitHub
parent 623eae7da1
commit 2f1b8ff23e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -25,7 +25,7 @@ class SignedNodeInfo(val raw: SerializedBytes<NodeInfo>, val signatures: List<Di
fun verified(): NodeInfo {
val nodeInfo = raw.deserialize()
val identities = nodeInfo.legalIdentities.filterNot { it.owningKey is CompositeKey }
require(identities.isNotEmpty()) { "At least one identity with a non-composite key needs to be specified." }
if (identities.size < signatures.size) {
throw SignatureException("Extra signatures. Found ${signatures.size} expected ${identities.size}")
}