Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
00e91d8
Edited Identity Protocol RFCs
VRamakrishna Aug 28, 2022
6f7e36b
Merge remote-tracking branch 'upstream/main' into main
VRamakrishna Sep 3, 2022
e5d3a3c
Updated Membership Management Logic in Fabric Interop CC
VRamakrishna Sep 7, 2022
b81cbff
Added nonce addition and validation logic to IIN Agent attestations
VRamakrishna Sep 8, 2022
ec46d89
Finished updating terminology in Identity Protocol RFCs
VRamakrishna Sep 8, 2022
ef4f4b0
Reverting Fabric Interop CC changes that don't work for Go version le…
VRamakrishna Sep 8, 2022
5f59a07
Added older membership handling code in Fabric Interop CC for backwar…
VRamakrishna Sep 9, 2022
a34204c
Merge remote-tracking branch 'upstream/main' into main
VRamakrishna Sep 19, 2022
c5d1001
Added filters to Corda package publishing Github workflows
VRamakrishna Sep 19, 2022
b838904
Fabric CLI Upgrade to handle IIN Agents and Counter Attested Foreign …
VRamakrishna Sep 22, 2022
876f61c
Added missing step in Fabric CLI for asset transfer logic
VRamakrishna Sep 22, 2022
1385354
Fixed import path in Fabric CLI source file
VRamakrishna Sep 22, 2022
c933021
Fixed logging bug in Fabric CLI
VRamakrishna Sep 22, 2022
f9e1f48
Added necessary user credential creation logic to Fabric CLI scripts
VRamakrishna Sep 22, 2022
abe84d4
Bug fixes in Fabric CLI credential creation logic
VRamakrishna Sep 22, 2022
f6fa692
Merge pull request #2 from VRamakrishna/fabric-cli-iin-upgrade
VRamakrishna Sep 22, 2022
889303d
Disabling tests dependent on updated protos
VRamakrishna Sep 23, 2022
0ad48b0
Changed bytes fields to strings for serialized parameters in IIN Agen…
VRamakrishna Sep 23, 2022
66be3aa
Reverting unnecessary Github action change
VRamakrishna Sep 25, 2022
7aa7485
Refactored memership handling code in Fabric Interop CC to eliminate …
VRamakrishna Sep 27, 2022
ba63f75
Refactored membership logic in Fabric Interoperation Chaincode to ext…
VRamakrishna Sep 27, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test_asset-exchange-fabric.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ on:
jobs:

asset-exchange-fabric:
# if: ${{ false }} # disable
if: ${{ false }} # disable
# The type of runner that the job will run on
runs-on: ubuntu-latest

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test_asset-transfer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ on:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
fabric-asset-transfer:
# if: ${{ false }} # disable
if: ${{ false }} # disable
# The type of runner that the job will run on
runs-on: ubuntu-latest

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test_data-sharing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ on:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
data-sharing:
# if: ${{ false }} # disable
if: ${{ false }} # disable
# The type of runner that the job will run on
runs-on: ubuntu-latest

Expand Down
203 changes: 100 additions & 103 deletions common/protos-go/identity/agent.pb.go

Large diffs are not rendered by default.

13 changes: 7 additions & 6 deletions common/protos/identity/agent.proto
Original file line number Diff line number Diff line change
Expand Up @@ -29,30 +29,31 @@ message SecurityDomainMemberIdentity {
}

message SecurityDomainMemberIdentityRequest {
SecurityDomainMemberIdentity source_network = 1;
SecurityDomainMemberIdentity requesting_network = 2;
string nonce = 3;
SecurityDomainMemberIdentity source_network = 1;
SecurityDomainMemberIdentity requesting_network = 2;
string nonce = 3;
}

// Association of signature (over arbitrary data) and signer identity
message Attestation {
SecurityDomainMemberIdentity unit_identity = 1;
string certificate = 2;
string signature = 3;
string nonce = 4;
}

// Attested security domain membership by a single member
message AttestedMembership {
common.membership.Membership membership = 1;
string membership = 1; // 'common.membership.Membership': Serialized and Base64-encoded
Attestation attestation = 2;
}

// Counter attestation over security domain membership attested by its participants
message CounterAttestedMembership {
message AttestedMembershipSet {
common.membership.Membership membership = 1;
string membership = 1; // 'common.membership.Membership': Serialized and Base64-encoded
repeated Attestation attestations = 2;
}
AttestedMembershipSet attested_membership_set = 1;
string attested_membership_set = 1; // 'AttestedMembershipSet': Serialized and Base64-encoded
repeated Attestation attestations = 2;
}
1 change: 1 addition & 0 deletions core/drivers/corda-driver/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ build-refresh-dependencies: github.properties
.PHONY: image-local
image-local: build-local
docker build -f Dockerfile.local -t $(DOCKER_IMAGE_NAME):$(DOCKER_TAG) .
docker tag $(DOCKER_IMAGE_NAME):$(DOCKER_TAG) $(DOCKER_IMAGE_NAME):latest

.PHONY: image
image: github.properties
Expand Down
1 change: 1 addition & 0 deletions core/drivers/fabric-driver/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ build-image-local: protos-js weaver-fabric-interop-sdk
(mv package-remote.json package.json && exit 1) # Only if fails
mv package-remote.json package.json # Only if success
rm -rf protos-js
docker tag ${DOCKER_IMAGE_NAME}:$(DOCKER_TAG) $(DOCKER_IMAGE_NAME):latest

build-image: .npmrc
docker build --build-arg BUILD_TAG="remote" --build-arg GIT_URL=$(GIT_URL) -t ${DOCKER_IMAGE_NAME}:$(DOCKER_TAG) -f fabricDriver.dockerfile .
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,9 @@ func verifyCaCertificate(cert *x509.Certificate, memberCertificate string) error
return nil
}

/* This function works for a Corda network's configuration
The assumption is that a Corda network has a single Root CA and Doorman CA, and one or more Node CAs corresponding to nodes.
This function will receive arguments for exactly one node with the following cert chain assumed: <root cert> -> <int cert 0> -> <int cert 1>
/* This function will receive arguments for exactly one node with the following cert chain assumed: <root cert> -> <int cert 0> -> <int cert 1> -> ......
In a Fabric network, we assume that there are multiple MSPs, each having one or more Root CAs and zero or more Intermediate CAs.
In a Corda network, we assume that there is a single Root CA and Doorman CA, and one or more Node CAs corresponding to nodes.
*/
func verifyCertificateChain(cert *x509.Certificate, certPEMs []string) error {
var parentCert *x509.Certificate
Expand Down Expand Up @@ -227,7 +227,7 @@ func validateSignature(message string, cert *x509.Certificate, signature string)
pubKey := getECDSAPublicKeyFromCertificate(cert)
if pubKey != nil {
// Construct the message that was signed
hashed, err := computeSHA2Hash([]byte(message), 256)
hashed, err := computeSHA2Hash([]byte(message), pubKey.Params().BitSize)
if err != nil {
return err
}
Expand All @@ -241,6 +241,7 @@ func validateSignature(message string, cert *x509.Certificate, signature string)
return errors.New("Missing or unsupported public key type")
}
}

func parseCert(certString string) (*x509.Certificate, error) {
certBytes, _ := pem.Decode([]byte(certString))

Expand Down
17 changes: 17 additions & 0 deletions core/network/fabric-interop-cc/contracts/interop/decoders.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,14 @@
package main

import (
"encoding/base64"
"encoding/json"
"strings"
"fmt"

"github.com/hyperledger-labs/weaver-dlt-interoperability/common/protos-go/common"
"github.com/hyperledger-labs/weaver-dlt-interoperability/common/protos-go/identity"
protoV2 "google.golang.org/protobuf/proto"
)

func decodeMembership(jsonBytes []byte) (*common.Membership, error) {
Expand All @@ -29,6 +33,19 @@ func decodeMembership(jsonBytes []byte) (*common.Membership, error) {
return &decodeObj, nil
}

func decodeCounterAttestedMembership(protoBytesBase64 string) (*identity.CounterAttestedMembership, error) {
var decodeObj identity.CounterAttestedMembership
protoBytes, err := base64.StdEncoding.DecodeString(protoBytesBase64)
if err != nil {
return nil, fmt.Errorf("Counter attested membership could not be decoded from base64: %s", err.Error())
}
err = protoV2.Unmarshal(protoBytes, &decodeObj)
if err != nil {
return nil, fmt.Errorf("Unable to unmarshal counter attested membership: %s", err.Error())
}
return &decodeObj, nil
}

func decodeVerificationPolicy(jsonBytes []byte) (*common.VerificationPolicy, error) {
var decodeObj common.VerificationPolicy
dec := json.NewDecoder(strings.NewReader(string(jsonBytes)))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ func testHandleExternalRequestSignatureCertificateMismatch(t *testing.T, query *

_, err = interopcc.HandleExternalRequest(ctx, string(b64QueryBytes))
require.EqualError(t, err, fmt.Sprintf("Invalid Signature: asn1: structure error: tags don't match (16 vs {class:1 tag:19 length:105 isCompound:false}) {optional:false explicit:false application:false private:false defaultValue:<nil> tag:<nil> stringType:0 timeType:0 set:false omitEmpty:false} ECDSASignature @2"))
//require.EqualError(t, err, "Invalid Signature: Signature Verification failed. ECDSA VERIFY")
}

func testHandleExternalRequestInvalidCert(t *testing.T, query *common.Query) {
Expand Down
Loading