Skip to content

Commit 1a2c8ec

Browse files
authored
validate proposal (#1362)
The new validateProposal() method verifies: 1. The Fabric proposal structure (header, payload) 2. That the creator (BankA's FSC node X.509 certificate) is a known MSP member: mspManager.IsValid(creator) 3. That the proposal signature was made by that creator: verifier.Verify(proposalBytes, signature) The fix closes a gap where the FSC endorser was not explicitly verifying that the Fabric proposal came from a legitimate, authenticated MSP member before endorsing it. Signed-off-by: Hayim.Shaul@ibm.com <hayimsha@fhe3.haifa.ibm.com>
1 parent 0ee62f7 commit 1a2c8ec

8 files changed

Lines changed: 647 additions & 15 deletions

File tree

token/services/network/fabric/endorsement/fsc/deps.go

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,3 +75,22 @@ type NamespaceTxProcessor interface {
7575
// EnableTxProcessing signals the backend to process all the transactions for the given tms id
7676
EnableTxProcessing(tmsID token.TMSID) error
7777
}
78+
79+
// MSPManager provides MSP-based identity validation and signature verification for a Fabric channel.
80+
// It is used to verify that the proposal creator is known to the network.
81+
//
82+
//go:generate counterfeiter -o mock/msp_manager.go -fake-name MSPManager . MSPManager
83+
type MSPManager interface {
84+
// IsValid checks that the identity is valid (i.e., known to the network via MSP)
85+
IsValid(identity view.Identity) error
86+
// GetVerifier returns a verifier for the given identity, which can be used to verify signatures
87+
GetVerifier(identity view.Identity) (driver.Verifier, error)
88+
}
89+
90+
// ChannelProvider provides access to the MSP manager for a given Fabric network and channel.
91+
//
92+
//go:generate counterfeiter -o mock/channel_provider.go -fake-name ChannelProvider . ChannelProvider
93+
type ChannelProvider interface {
94+
// GetMSPManager returns the MSP manager for the given network and channel
95+
GetMSPManager(network, channel string) (MSPManager, error)
96+
}

token/services/network/fabric/endorsement/fsc/mock/channel_provider.go

Lines changed: 118 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

token/services/network/fabric/endorsement/fsc/mock/msp_manager.go

Lines changed: 192 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)