Skip to content

Commit fe8c021

Browse files
committed
Depricate using gossip ignore security
Since there is tool for generating peer crypto material there is no more need to allow bypassing security checks within gossip layer because each peer will have unique identity. Change-Id: Ic4cd40c724823afa7a7d04c68db45247a0c38f9f Signed-off-by: Artem Barger <[email protected]>
1 parent 397f5de commit fe8c021

File tree

5 files changed

+1
-48
lines changed

5 files changed

+1
-48
lines changed

examples/e2e_cli/docker-compose.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,6 @@ services:
193193
- CORE_PEER_ENDORSER_ENABLED=true
194194
# - CORE_PEER_COMMITTER_LEDGER_ORDERER=orderer0:7050
195195
- CORE_PEER_ADDRESS=peer0:7051
196-
- CORE_PEER_GOSSIP_IGNORESECURITY=true
197196
- CORE_PEER_LOCALMSPID=Org0MSP
198197
- CORE_PEER_TLS_ENABLED=true
199198
- CORE_PEER_TLS_CERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peer/peer0/localMspConfig/signcerts/peer0Signer.pem

examples/sfhackfest/channel_test.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ EOF
2727
2828
#create
2929
echo "Creating channel on Orderer"
30-
CORE_PEER_GOSSIP_IGNORESECURITY=true CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/fabric/msp/sampleconfig CORE_PEER_COMMITTER_LEDGER_ORDERER=orderer:7050 peer channel create -c myc1 -a anchorPeer.txt >>log.txt 2>&1
30+
CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/fabric/msp/sampleconfig CORE_PEER_COMMITTER_LEDGER_ORDERER=orderer:7050 peer channel create -c myc1 -a anchorPeer.txt >>log.txt 2>&1
3131
cat log.txt
3232
grep -q "Exiting" log.txt
3333
if [ $? -ne 0 ]; then

examples/sfhackfest/docker-compose-gettingstarted.yml

-4
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,6 @@ services:
6565
- CORE_PEER_PROFILE_ENABLED=true
6666
- CORE_PEER_COMMITTER_LEDGER_ORDERER=orderer:7050
6767
- CORE_PEER_GOSSIP_ORGLEADER=true
68-
- CORE_PEER_GOSSIP_IGNORESECURITY=true
69-
7068
working_dir: /opt/gopath/src/github.com/hyperledger/fabric/peer
7169

7270
command: peer node start --peer-defaultchain=false
@@ -95,7 +93,6 @@ services:
9593
- CORE_PEER_PROFILE_ENABLED=true
9694
- CORE_PEER_COMMITTER_LEDGER_ORDERER=orderer:7050
9795
- CORE_PEER_GOSSIP_ORGLEADER=true
98-
- CORE_PEER_GOSSIP_IGNORESECURITY=true
9996
working_dir: /opt/gopath/src/github.com/hyperledger/fabric/peer
10097
ports:
10198
- 8055:7051
@@ -123,7 +120,6 @@ services:
123120
- CORE_PEER_PROFILE_ENABLED=true
124121
- CORE_PEER_COMMITTER_LEDGER_ORDERER=orderer:7050
125122
- CORE_PEER_GOSSIP_ORGLEADER=true
126-
- CORE_PEER_GOSSIP_IGNORESECURITY=true
127123
working_dir: /opt/gopath/src/github.com/hyperledger/fabric/peer
128124

129125
ports:

gossip/service/gossip_service.go

-40
Original file line numberDiff line numberDiff line change
@@ -137,14 +137,6 @@ func InitGossipServiceCustomDeliveryFactory(peerIdentity []byte, endpoint string
137137
endpoint = overrideEndpoint
138138
}
139139

140-
if viper.GetBool("peer.gossip.ignoreSecurity") {
141-
logger.Info("This peer ignoring security in gossip")
142-
sec := &secImpl{[]byte(endpoint)}
143-
mcs = sec
144-
secAdv = sec
145-
peerIdentity = []byte(endpoint)
146-
}
147-
148140
idMapper := identity.NewIdentityMapper(mcs)
149141
idMapper.Put(mcs.GetPKIidOfCert(peerIdentity), peerIdentity)
150142

@@ -312,35 +304,3 @@ func orgListFromConfig(config Config) []string {
312304
}
313305
return orgList
314306
}
315-
316-
type secImpl struct {
317-
identity []byte
318-
}
319-
320-
func (*secImpl) OrgByPeerIdentity(api.PeerIdentityType) api.OrgIdentityType {
321-
return api.OrgIdentityType("DEFAULT")
322-
}
323-
324-
func (s *secImpl) GetPKIidOfCert(peerIdentity api.PeerIdentityType) gossipCommon.PKIidType {
325-
return gossipCommon.PKIidType(peerIdentity)
326-
}
327-
328-
func (s *secImpl) VerifyBlock(chainID gossipCommon.ChainID, signedBlock []byte) error {
329-
return nil
330-
}
331-
332-
func (s *secImpl) Sign(msg []byte) ([]byte, error) {
333-
return msg, nil
334-
}
335-
336-
func (s *secImpl) Verify(peerIdentity api.PeerIdentityType, signature, message []byte) error {
337-
return nil
338-
}
339-
340-
func (s *secImpl) VerifyByChannel(chainID gossipCommon.ChainID, peerIdentity api.PeerIdentityType, signature, message []byte) error {
341-
return nil
342-
}
343-
344-
func (s *secImpl) ValidateIdentity(peerIdentity api.PeerIdentityType) error {
345-
return nil
346-
}

peer/core.yaml

-2
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,6 @@ peer:
112112
publishCertPeriod: 10s
113113
# Should we skip verifying block messages or not
114114
skipBlockVerification: false
115-
# Should we ignore security or not
116-
ignoreSecurity: false
117115
# Dial timeout(unit: second)
118116
dialTimeout: 3s
119117
# Connection timeout(unit: second)

0 commit comments

Comments
 (0)