mirror of
https://github.com/corda/corda.git
synced 2025-05-04 17:53:05 +00:00
Fixing SignedNodeInfoe security issue (#2908)
This commit is contained in:
parent
623eae7da1
commit
2f1b8ff23e
@ -25,7 +25,7 @@ class SignedNodeInfo(val raw: SerializedBytes<NodeInfo>, val signatures: List<Di
|
|||||||
fun verified(): NodeInfo {
|
fun verified(): NodeInfo {
|
||||||
val nodeInfo = raw.deserialize()
|
val nodeInfo = raw.deserialize()
|
||||||
val identities = nodeInfo.legalIdentities.filterNot { it.owningKey is CompositeKey }
|
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) {
|
if (identities.size < signatures.size) {
|
||||||
throw SignatureException("Extra signatures. Found ${signatures.size} expected ${identities.size}")
|
throw SignatureException("Extra signatures. Found ${signatures.size} expected ${identities.size}")
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user