Skip to content
This repository was archived by the owner on Apr 25, 2025. It is now read-only.

Commit 3cc5ea3

Browse files
committed
[FAB-10195] Bump to latest fabric
This change updates the imported code from fabric to the latest versions commits in master. Change-Id: Ibc2d15c5371d2df34cd4ba55fcf45debe02fc792 Signed-off-by: Troy Ronda <troy@troyronda.com>
1 parent 81cbc39 commit 3cc5ea3

File tree

41 files changed

+1185
-963
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+1185
-963
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ FABRIC_DEV_REGISTRY_PRE_CMD ?= docker login -u docker -p docker nexus3.hyperledg
6666
THIRDPARTY_FABRIC_CA_BRANCH ?= master
6767
THIRDPARTY_FABRIC_CA_COMMIT ?= v1.1.0
6868
THIRDPARTY_FABRIC_BRANCH ?= master
69-
THIRDPARTY_FABRIC_COMMIT ?= a8cc2c46d8cec1ad199741c0630a46ccb24084ac
69+
THIRDPARTY_FABRIC_COMMIT ?= d78be9f4567d98e8c14542446a85ec5f8fcb5e5a
7070

7171
# Force removal of images in cleanup (overridable)
7272
FIXTURE_DOCKER_REMOVE_FORCE ?= false

internal/github.com/hyperledger/fabric-ca/lib/streamer/jsonstreamer.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ type SearchElement struct {
4747
// For each element of this array, it streams one element at a time.
4848
func StreamJSONArray(decoder *json.Decoder, path string, cb func(*json.Decoder) error) error {
4949
ses := []SearchElement{
50-
{Path: path, CB: cb},
51-
{Path: "errors", CB: errCB},
50+
SearchElement{Path: path, CB: cb},
51+
SearchElement{Path: "errors", CB: errCB},
5252
}
5353
return StreamJSON(decoder, ses)
5454
}

internal/github.com/hyperledger/fabric-ca/util/csp.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,6 @@ func ImportBCCSPKeyFromPEM(keyFile string, myCSP core.CryptoSuite, temporary boo
142142
// ImportBCCSPKeyFromPEMBytes attempts to create a private BCCSP key from a pem byte slice
143143
func ImportBCCSPKeyFromPEMBytes(keyBuff []byte, myCSP core.CryptoSuite, temporary bool) (core.Key, error) {
144144
keyFile := "pem bytes"
145-
146145
key, err := factory.PEMtoPrivateKey(keyBuff, nil)
147146
if err != nil {
148147
return nil, errors.WithMessage(err, fmt.Sprintf("Failed parsing private key from %s", keyFile))

internal/github.com/hyperledger/fabric-ca/util/util.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,16 @@ import (
3131
"io/ioutil"
3232
"math/big"
3333
mrand "math/rand"
34-
35-
factory "github.com/hyperledger/fabric-sdk-go/internal/github.com/hyperledger/fabric-ca/sdkpatch/cryptosuitebridge"
36-
"github.com/hyperledger/fabric-sdk-go/pkg/common/providers/core"
37-
3834
"net/http"
3935
"path/filepath"
4036
"reflect"
4137
"regexp"
4238
"strings"
4339
"time"
4440

41+
factory "github.com/hyperledger/fabric-sdk-go/internal/github.com/hyperledger/fabric-ca/sdkpatch/cryptosuitebridge"
42+
"github.com/hyperledger/fabric-sdk-go/pkg/common/providers/core"
43+
4544
"github.com/pkg/errors"
4645

4746
"golang.org/x/crypto/ocsp"
@@ -312,7 +311,7 @@ func GetMaskedURL(url string) string {
312311
matchStr = strings.Replace(matchStr, matches[idx], "****", 1)
313312
}
314313
}
315-
url = url[:matchIdxs[0]] + matchStr + url[matchIdxs[1]:]
314+
url = url[:matchIdxs[0]] + matchStr + url[matchIdxs[1]:len(url)]
316315
}
317316
return url
318317
}

internal/github.com/hyperledger/fabric/bccsp/factory/sw/swfactory.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ func (f *SWFactory) Get(swOpts *SwOpts) (bccsp.BCCSP, error) {
5959
ks = sw.NewDummyKeyStore()
6060
}
6161

62-
return sw.New(swOpts.SecLevel, swOpts.HashFamily, ks)
62+
return sw.NewWithParams(swOpts.SecLevel, swOpts.HashFamily, ks)
6363
}
6464

6565
// SwOpts contains options for the SWFactory

internal/github.com/hyperledger/fabric/bccsp/pkcs11/impl.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ var (
4141
sessionCacheSize = 10
4242
)
4343

44-
// New returns a new instance of the software-based BCCSP
44+
// NewWithParams returns a new instance of the software-based BCCSP
4545
// set at the passed security level, hash family and KeyStore.
4646
func New(opts PKCS11Opts, keyStore bccsp.KeyStore) (bccsp.BCCSP, error) {
4747
// Init config
@@ -51,7 +51,7 @@ func New(opts PKCS11Opts, keyStore bccsp.KeyStore) (bccsp.BCCSP, error) {
5151
return nil, errors.Wrapf(err, "Failed initializing configuration")
5252
}
5353

54-
swCSP, err := sw.New(opts.SecLevel, opts.HashFamily, keyStore)
54+
swCSP, err := sw.NewWithParams(opts.SecLevel, opts.HashFamily, keyStore)
5555
if err != nil {
5656
return nil, errors.Wrapf(err, "Failed initializing fallback SW BCCSP")
5757
}

internal/github.com/hyperledger/fabric/bccsp/signer/signer.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,10 @@ package signer
2121

2222
import (
2323
"crypto"
24+
"io"
2425

2526
"github.com/hyperledger/fabric-sdk-go/pkg/common/providers/core"
2627

27-
"io"
28-
2928
"github.com/hyperledger/fabric-sdk-go/internal/github.com/hyperledger/fabric/bccsp/utils"
3029
"github.com/pkg/errors"
3130
)

internal/github.com/hyperledger/fabric/bccsp/sw/fileks.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ func (ks *fileBasedKeyStore) storePrivateKey(alias string, privateKey interface{
292292
return err
293293
}
294294

295-
err = ioutil.WriteFile(ks.getPathForAlias(alias, "sk"), rawKey, 0700)
295+
err = ioutil.WriteFile(ks.getPathForAlias(alias, "sk"), rawKey, 0600)
296296
if err != nil {
297297
logger.Errorf("Failed storing private key [%s]: [%s]", alias, err)
298298
return err
@@ -308,7 +308,7 @@ func (ks *fileBasedKeyStore) storePublicKey(alias string, publicKey interface{})
308308
return err
309309
}
310310

311-
err = ioutil.WriteFile(ks.getPathForAlias(alias, "pk"), rawKey, 0700)
311+
err = ioutil.WriteFile(ks.getPathForAlias(alias, "pk"), rawKey, 0600)
312312
if err != nil {
313313
logger.Errorf("Failed storing private key [%s]: [%s]", alias, err)
314314
return err
@@ -324,7 +324,7 @@ func (ks *fileBasedKeyStore) storeKey(alias string, key []byte) error {
324324
return err
325325
}
326326

327-
err = ioutil.WriteFile(ks.getPathForAlias(alias, "key"), pem, 0700)
327+
err = ioutil.WriteFile(ks.getPathForAlias(alias, "key"), pem, 0600)
328328
if err != nil {
329329
logger.Errorf("Failed storing key [%s]: [%s]", alias, err)
330330
return err

0 commit comments

Comments
 (0)