Skip to content

Commit

Permalink
Merge "[FAB-6465] Fix client ID library for v1.0"
Browse files Browse the repository at this point in the history
  • Loading branch information
hacera-jonathan authored and Gerrit Code Review committed Oct 10, 2017
2 parents ac1afd9 + 1ced8bc commit eb297c7
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions core/chaincode/lib/cid/cid.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,12 +145,8 @@ func (c *clientIdentityImpl) init() error {
c.mspID = signingID.GetMspid()
idbytes := signingID.GetIdBytes()
block, _ := pem.Decode(idbytes)
if block == nil || block.Type != "CERTIFICATE" {
bt := "none"
if block != nil {
bt = block.Type
}
return errors.Errorf("unexpected PEM block found. Expected a certificate but found a block of type: %s", bt)
if block == nil {
return errors.New("Expecting a PEM-encoded X509 certificate; PEM block not found")
}
cert, err := x509.ParseCertificate(block.Bytes)
if err != nil {
Expand Down

0 comments on commit eb297c7

Please sign in to comment.