Skip to content

Commit

Permalink
[FABG-723] add int tests for dist signatures
Browse files Browse the repository at this point in the history
	Integration test includes external signing using OpenSSL

	When signing with an external tool like OpenSSL, one must
	convert the signature with a low S value to prevent from
	ECDSA signature malleability. This is a Fabric requirement
	as well. For more details, see the comments about this in the call:
	loadExternalSignature() found in
	test/integration/e2e/orgs/multi_orgs_ch_update_signatures_test.go

Change-Id: Idddae8b38c11c821fcf0467509aa6a79e963396e
Signed-off-by: Baha Shaaban <[email protected]>
  • Loading branch information
Baha Shaaban committed Oct 4, 2018
1 parent 6ca34b9 commit 7687669
Show file tree
Hide file tree
Showing 10 changed files with 694 additions and 36 deletions.
12 changes: 12 additions & 0 deletions test/fixtures/fabric/v1.1/config/configtx.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ Profiles:
Organizations:
- *org1
- *org2

OneOrgChannel:
Consortium: SampleConsortium
Application:
Expand All @@ -39,6 +40,7 @@ Profiles:
- *org1
Capabilities:
<<: *ApplicationCapabilities

TwoOrgsChannel:
Consortium: SampleConsortium
Application:
Expand All @@ -49,6 +51,16 @@ Profiles:
Capabilities:
<<: *ApplicationCapabilities

DsChannel:
Consortium: SampleConsortium
Application:
<<: *ApplicationDefaults
Organizations:
- *org1
- *org2
Capabilities:
<<: *ApplicationCapabilities

################################################################################
#
# Section: Organizations
Expand Down
16 changes: 12 additions & 4 deletions test/fixtures/fabric/v1.2/config/configtx.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ Profiles:
<<: *OrdererOrgPolicies
Admins:
Type: Signature
Rule: "OR('OrdererMSP.member')"
Rule: "OR('OrdererMSP.admin')"
Consortiums:
TestConsortium:
Organizations:
Expand All @@ -418,7 +418,7 @@ Profiles:
<<: *Org1Policies
Admins:
Type: Signature
Rule: "OR('Org1MSP.member')"
Rule: "OR('Org1MSP.admin')"

SampleConsortium:
Organizations:
Expand All @@ -427,13 +427,13 @@ Profiles:
<<: *Org1Policies
Admins:
Type: Signature
Rule: "OR('Org1MSP.member')"
Rule: "OR('Org1MSP.admin')"
- <<: *Org2
Policies:
<<: *Org2Policies
Admins:
Type: Signature
Rule: "OR('Org2MSP.member')"
Rule: "OR('Org2MSP.admin')"

OneOrgChannel:
Consortium: TestConsortium
Expand All @@ -443,6 +443,14 @@ Profiles:
- *Org1

TwoOrgsChannel:
Consortium: SampleConsortium
Application:
<<: *ApplicationDefaults
Organizations:
- *Org1
- *Org2

DsChannel:
Consortium: SampleConsortium
Application:
<<: *ApplicationDefaults
Expand Down
16 changes: 12 additions & 4 deletions test/fixtures/fabric/v1.3/config/configtx.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ Profiles:
<<: *OrdererOrgPolicies
Admins:
Type: Signature
Rule: "OR('OrdererMSP.member')"
Rule: "OR('OrdererMSP.admin')"
Consortiums:
TestConsortium:
Organizations:
Expand All @@ -418,7 +418,7 @@ Profiles:
<<: *Org1Policies
Admins:
Type: Signature
Rule: "OR('Org1MSP.member')"
Rule: "OR('Org1MSP.admin')"

SampleConsortium:
Organizations:
Expand All @@ -427,13 +427,13 @@ Profiles:
<<: *Org1Policies
Admins:
Type: Signature
Rule: "OR('Org1MSP.member')"
Rule: "OR('Org1MSP.admin')"
- <<: *Org2
Policies:
<<: *Org2Policies
Admins:
Type: Signature
Rule: "OR('Org2MSP.member')"
Rule: "OR('Org2MSP.admin')"

OneOrgChannel:
Consortium: TestConsortium
Expand All @@ -443,6 +443,14 @@ Profiles:
- *Org1

TwoOrgsChannel:
Consortium: SampleConsortium
Application:
<<: *ApplicationDefaults
Organizations:
- *Org1
- *Org2

DsChannel:
Consortium: SampleConsortium
Application:
<<: *ApplicationDefaults
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const (
putBothFunc = "putboth"
getAndPutBothFunc = "getandputboth"
invokeCCFunc = "invokecc"
addToIntFunc = "addToInt"
addToIntFunc = "addToInt"
)

// ExampleCC example chaincode that puts and gets state and private data
Expand Down Expand Up @@ -220,7 +220,7 @@ func (cc *ExampleCC) getAndPutBoth(stub shim.ChaincodeStubInterface, args []stri

// Adds a given int amount to the value stored in the given private collection's key, storing the result using the same key.
// If the given key does not already exist then it will be added and stored with the given amount.
func (cc *ExampleCC) addToInt(stub shim.ChaincodeStubInterface, args[]string) pb.Response {
func (cc *ExampleCC) addToInt(stub shim.ChaincodeStubInterface, args []string) pb.Response {
if len(args) != 3 {
return shim.Error("Invalid args. Expecting collection, key, amountToAdd")
}
Expand Down
Loading

0 comments on commit 7687669

Please sign in to comment.