Skip to content

Commit 8aa2f52

Browse files
committed
Disable encoding of MSPID in serlz'd identities
This is a temporary workaround to ensure interoperability with the SDK until we find a proper encoding schema that works for both SDK and peer. Change-Id: I8e54fa78f4edd5e08c6679f48f8dc27adabfe290 Signed-off-by: Alessandro Sorniotti <[email protected]>
1 parent 9d3abd1 commit 8aa2f52

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

msp/identities.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ import (
2121
"crypto/x509"
2222
"fmt"
2323

24-
"encoding/asn1"
25-
2624
"github.com/hyperledger/fabric/core/crypto/bccsp"
2725
"github.com/hyperledger/fabric/core/crypto/bccsp/factory"
2826
"github.com/hyperledger/fabric/core/crypto/bccsp/signer"
@@ -80,6 +78,7 @@ func (id *identity) VerifyAttributes(proof [][]byte, spec *AttributeProofSpec) (
8078
}
8179

8280
func (id *identity) Serialize() ([]byte, error) {
81+
/*
8382
mspLogger.Infof("Serializing identity %s", id.id)
8483
8584
// We serialize identities by prepending the MSPID and appending the ASN.1 DER content of the cert
@@ -90,6 +89,8 @@ func (id *identity) Serialize() ([]byte, error) {
9089
}
9190
9291
return idBytes, nil
92+
*/
93+
return id.cert.Raw, nil
9394
}
9495

9596
type signingidentity struct {

msp/peermspmanager.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ import (
2020
"fmt"
2121
"sync"
2222

23-
"encoding/asn1"
24-
2523
"github.com/op/go-logging"
2624
)
2725

@@ -139,6 +137,7 @@ func (mgr *peerMspManagerImpl) GetSigningIdentity(identifier *IdentityIdentifier
139137
}
140138

141139
func (mgr *peerMspManagerImpl) DeserializeIdentity(serializedID []byte) (Identity, error) {
140+
/*
142141
// We first deserialize to a SerializedIdentity to get the MSP ID
143142
sId := &SerializedIdentity{}
144143
_, err := asn1.Unmarshal(serializedID, sId)
@@ -154,6 +153,8 @@ func (mgr *peerMspManagerImpl) DeserializeIdentity(serializedID []byte) (Identit
154153
155154
// if we have this MSP, we ask it to deserialize
156155
return msp.DeserializeIdentity(sId.IdBytes)
156+
*/
157+
return mgr.mspsMap["DEFAULT"].DeserializeIdentity(serializedID) // FIXME!
157158
}
158159

159160
func (mgr *peerMspManagerImpl) DeleteSigningIdentity(identifier string) (bool, error) {

0 commit comments

Comments
 (0)