Skip to content

Commit

Permalink
[FABC-708] Revendor BCCSP
Browse files Browse the repository at this point in the history
Revendor BCCSP in fabric ca. The BCCSP implementation
changed some of the build tags, made the corresponding
changes to use the new build tags in Fabric CA code.

Change-Id: I4ed4d50ac3173e5657e1da3d62431712e79a0417
Signed-off-by: Saad Karim <skarim@us.ibm.com>
  • Loading branch information
Saad Karim committed Aug 27, 2018
1 parent 3bcdbb2 commit 86ae906
Show file tree
Hide file tree
Showing 21 changed files with 471 additions and 290 deletions.
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ fabric-ca-server: bin/fabric-ca-server

bin/%: $(GO_SOURCE)
@echo "Building ${@F} in bin directory ..."
@mkdir -p bin && go build -o bin/${@F} -ldflags "$(GO_LDFLAGS)" $(PKGNAME)/$(path-map.${@F})
@mkdir -p bin && go build -o bin/${@F} -tags "pkcs11" -ldflags "$(GO_LDFLAGS)" $(PKGNAME)/$(path-map.${@F})
@echo "Built bin/${@F}"

# We (re)build a package within a docker context but persist the $GOPATH/pkg
Expand Down Expand Up @@ -239,29 +239,29 @@ release-all: $(patsubst %,release/%, $(RELEASE_PLATFORMS))

release/windows-amd64: GOOS=windows
release/windows-amd64: CC=/usr/bin/x86_64-w64-mingw32-gcc
release/windows-amd64: GO_TAGS+= nopkcs11 caclient
release/windows-amd64: GO_TAGS+= caclient
release/windows-amd64: $(patsubst %,release/windows-amd64/bin/%, $(RELEASE_PKGS))

release/darwin-amd64: GOOS=darwin
release/darwin-amd64: CC=/usr/bin/clang
release/darwin-amd64: GO_TAGS+= nopkcs11 caclient
release/darwin-amd64: GO_TAGS+= caclient
release/darwin-amd64: $(patsubst %,release/darwin-amd64/bin/%, $(RELEASE_PKGS))

release/linux-amd64: GOOS=linux
release/linux-amd64: GO_TAGS+= nopkcs11 caclient
release/linux-amd64: GO_TAGS+= caclient
release/linux-amd64: $(patsubst %,release/linux-amd64/bin/%, $(RELEASE_PKGS))

release/%-amd64: GOARCH=amd64

release/linux-%: GOOS=linux

release/linux-ppc64le: GOARCH=ppc64le
release/linux-ppc64le: GO_TAGS+= nopkcs11 caclient
release/linux-ppc64le: GO_TAGS+= caclient
release/linux-ppc64le: CC=/usr/bin/powerpc64le-linux-gnu-gcc
release/linux-ppc64le: $(patsubst %,release/linux-ppc64le/bin/%, $(RELEASE_PKGS))

release/linux-s390x: GOARCH=s390x
release/linux-s390x: GO_TAGS+= nopkcs11 caclient
release/linux-s390x: GO_TAGS+= caclient
release/linux-s390x: $(patsubst %,release/linux-s390x/bin/%, $(RELEASE_PKGS))

release/%/bin/fabric-ca-client: $(GO_SOURCE)
Expand Down
2 changes: 2 additions & 0 deletions lib/ca_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// +build pkcs11

/*
Copyright IBM Corp. 2016 All Rights Reserved.
Expand Down
2 changes: 1 addition & 1 deletion lib/keyrequest.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// +build !nopkcs11
// +build pkcs11

/*
Copyright IBM Corp. 2017 All Rights Reserved.
Expand Down
5 changes: 2 additions & 3 deletions lib/keyrequestnopkcs11.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// +build nopkcs11
// +build !pkcs11

/*
Copyright IBM Corp. 2017 All Rights Reserved.
Expand All @@ -25,7 +25,6 @@ import "github.com/hyperledger/fabric-ca/api"
func GetKeyRequest(cfg *CAConfig) *api.BasicKeyRequest {
if cfg.CSP.SwOpts != nil {
return &api.BasicKeyRequest{Algo: "ecdsa", Size: cfg.CSP.SwOpts.SecLevel}
} else {
return api.NewBasicKeyRequest()
}
return api.NewBasicKeyRequest()
}
2 changes: 1 addition & 1 deletion util/configurebccsp.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// +build !nopkcs11
// +build pkcs11

/*
Copyright IBM Corp. 2017 All Rights Reserved.
Expand Down
2 changes: 1 addition & 1 deletion util/configurebccspnopkcs11.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// +build nopkcs11
// +build !pkcs11

/*
Copyright IBM Corp. 2017 All Rights Reserved.
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

139 changes: 139 additions & 0 deletions vendor/github.com/hyperledger/fabric/bccsp/idemixopts.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion vendor/github.com/hyperledger/fabric/bccsp/pkcs11/conf.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 86ae906

Please sign in to comment.