mirror of
https://github.com/corda/corda.git
synced 2025-04-12 21:53:17 +00:00
CORDA-2837 Prevent node running SwapIdentitiesFlow from initiating session with itself (#5457)
This commit is contained in:
parent
aad2e82d07
commit
33055702a8
@ -90,10 +90,12 @@ private constructor(private val otherSideSession: FlowSession?,
|
||||
|
||||
@Suspendable
|
||||
override fun call(): LinkedHashMap<Party, AnonymousParty> {
|
||||
val session = otherSideSession ?: run {
|
||||
val session = if (otherParty != null && otherParty != otherSideSession?.counterparty) {
|
||||
logger.warnOnce("The current usage of SwapIdentitiesFlow is unsafe. Please consider upgrading your CorDapp to use " +
|
||||
"SwapIdentitiesFlow with FlowSessions. (${CordappResolver.currentCordapp?.info})")
|
||||
initiateFlow(otherParty!!)
|
||||
initiateFlow(otherParty)
|
||||
} else {
|
||||
otherSideSession!!
|
||||
}
|
||||
progressTracker.currentStep = GENERATING_IDENTITY
|
||||
val ourAnonymousIdentity = serviceHub.keyManagementService.freshKeyAndCert(ourIdentityAndCert, false)
|
||||
|
Loading…
x
Reference in New Issue
Block a user