forked from corda/corda
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CORDA-1171 - When a double-spend occurs, do not send the consuming tr…
…ansaction id and requesting party back to the client - this might lead to privacy leak. Only the transaction id hash is now returned. (corda#2746)
- Loading branch information
Showing
17 changed files
with
215 additions
and
173 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
core/src/main/kotlin/net/corda/core/internal/NotaryUtils.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package net.corda.core.internal | ||
|
||
import net.corda.core.crypto.SecureHash | ||
import net.corda.core.crypto.isFulfilledBy | ||
import net.corda.core.flows.NotarisationResponse | ||
import net.corda.core.identity.Party | ||
|
||
/** | ||
* Checks that there are sufficient signatures to satisfy the notary signing requirement and validates the signatures | ||
* against the given transaction id. | ||
*/ | ||
fun NotarisationResponse.validateSignatures(txId: SecureHash, notary: Party) { | ||
val signingKeys = signatures.map { it.by } | ||
require(notary.owningKey.isFulfilledBy(signingKeys)) { "Insufficient signatures to fulfill the notary signing requirement for $notary" } | ||
signatures.forEach { it.verify(txId) } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.