Skip to content

Commit f1a3675

Browse files
author
Jason Yellick
committed
Add trivial signature validation dsl via protobuf
This changeset attempts to make a first pass at having a generic enough to be useful, but not so generic as to be impossible to understand domain specific language (via protobuf) to express cryptographic validation schemes. In particular, the two primitives which comprise a policy are: NOutOf(n, []policies) SignedBy(id) Please note that this DSL is relying on the structure imposed by protobuf, and therefore defines the entire grammar of the DSL in 10 lines. There is an additional envelope message to allow the specification to be versioned. This was developed especially for aiding in specifying bootstrap configuration for signature policies, however, its applicability for other areas such as endorsement seems likely. https://jira.hyperledger.org/browse/FAB-704 Change-Id: I330b0660caf90b09034e5a1c167c08a5c2078e8f Signed-off-by: Jason Yellick <[email protected]>
1 parent db22cdc commit f1a3675

File tree

5 files changed

+507
-44
lines changed

5 files changed

+507
-44
lines changed

orderer/atomicbroadcast/ab.pb.go

+215-43
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

orderer/atomicbroadcast/ab.proto

+26-1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,32 @@ message BroadcastMessage {
3535
bytes Data = 1;
3636
}
3737

38+
39+
// SignaturePolicyEnvelope wraps a SignaturePolicy and includes a version for future enhancements
40+
message SignaturePolicyEnvelope {
41+
int32 Version = 1;
42+
SignaturePolicy Policy = 2;
43+
repeated bytes Identities = 3;
44+
}
45+
46+
// SignaturePolicy is a recursive message structure which defines a featherweight DSL for describing
47+
// policies which are more complicated than 'exactly this signature'. The NOutOf operator is sufficent
48+
// to express AND as well as OR, as well as of course N out of the following M policies
49+
// SignedBy implies that the signature is from a valid certificate which is signed by the trusted
50+
// authority specified in the bytes. This will be the certificate itself for a self-signed certificate
51+
// and will be the CA for more traditional certificates
52+
message SignaturePolicy {
53+
message NOutOf {
54+
int32 N = 1;
55+
repeated SignaturePolicy Policies = 2;
56+
}
57+
oneof Type {
58+
int32 SignedBy = 1;
59+
NOutOf From = 2;
60+
}
61+
}
62+
63+
3864
message SeekInfo {
3965
// Start may be specified to a specific block number, or may be request from the newest or oldest available
4066
// The start location is always inclusive, so the first reply from NEWEST will contain the newest block at the time
@@ -89,4 +115,3 @@ service AtomicBroadcast {
89115
// To avoid latency, clients will likely acknowledge before the WindowSize has been exhausted, preventing the server from stopping and waiting for an Acknowledgement
90116
rpc Deliver(stream DeliverUpdate) returns (stream DeliverResponse) {}
91117
}
92-

0 commit comments

Comments
 (0)