Skip to content

Commit eb2618d

Browse files
author
7908837174
committed
fix(demo): correct protoc-gen-go installation instructions (fixes #59)
- Replace confusing protoc/protoc-gen-go mixed instructions - Add clear separation between protoc binary and Go plugins - Fix non-existent protobuf-all tarball references - Add working installation commands with correct versions - Add comprehensive troubleshooting section - Maintain cross-platform compatibility - All test cases validated and working Resolves: #59
1 parent 1a4a60b commit eb2618d

File tree

2 files changed

+160
-49
lines changed

2 files changed

+160
-49
lines changed

demo/cca/manual-end-to-end.md

Lines changed: 99 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ end to end CCA Platform Verification Demonstration.
1212

1313
Follow the instructions given [here](https://go.dev/doc/install) to install `go` in your system
1414

15+
> **Important**: After installing Go, ensure that `$GOPATH/bin` (or `$HOME/go/bin` if using default GOPATH) is in your `$PATH` so that Go-installed binaries like `protoc-gen-go` can be found by `protoc`.
16+
1517
Installing jq:
1618
```sh
1719
sudo apt update && sudo apt install jq && jq --version
@@ -38,39 +40,72 @@ sudo apt-get install tmux
3840

3941
* For build to succeed one needs to install following packages:
4042

41-
1. protoc-gen-go with version v1.26
42-
Download `protobuf-all-[VERSION].tar.gz` from [here](https://github.com/protocolbuffers/protobuf/releases).
43+
1. **Protocol Buffer Compiler (protoc)**
44+
45+
Download the latest pre-compiled `protoc` binary from [Protocol Buffers releases](https://github.com/protocolbuffers/protobuf/releases).
46+
47+
For Ubuntu/Linux x86_64:
48+
```sh
49+
# Download and install protoc (replace VERSION with latest, e.g., 32.1)
50+
curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v32.1/protoc-32.1-linux-x86_64.zip
51+
unzip protoc-32.1-linux-x86_64.zip -d $HOME/.local
52+
export PATH="$PATH:$HOME/.local/bin"
53+
```
54+
55+
To verify installation:
56+
```sh
57+
protoc --version
58+
```
4359

44-
Extract the contents and change into the directory
60+
2. **Go Protocol Buffer Plugin (protoc-gen-go) version v1.26**
61+
```sh
62+
go install google.golang.org/protobuf/cmd/[email protected]
63+
```
4564

46-
```sh
47-
./configure
48-
make
49-
make check
50-
sudo make install
65+
3. **protoc-gen-go-grpc version v1.1**
66+
```sh
67+
go install google.golang.org/grpc/cmd/[email protected]
68+
```
69+
70+
4. **protoc-gen-go-json version v1.1.0**
71+
```sh
72+
go install github.com/mitchellh/[email protected]
5173
```
52-
To check if this works
53-
`protoc --version`
5474

55-
2. protoc-gen-go-grpc version v1.1
56-
`go install google.golang.org/grpc/cmd/[email protected]`
57-
3. protoc-gen-go-json version v1.1.0
58-
`go install github.com/mitchellh/[email protected]`
59-
4. mockgen version v1.6.0
60-
`go install github.com/golang/mock/[email protected]`
75+
5. **mockgen version v1.6.0**
76+
```sh
77+
go install github.com/golang/mock/[email protected]
78+
```
6179

6280
### Other systems
6381

64-
* One need to install jq and curl.
82+
For non-Ubuntu systems:
6583

66-
* For build to succeed, one needs to install following packages:
67-
1. protoc-gen-go with version v1.26
68-
2. protoc-gen-go-grpc version v1.1
69-
3. protoc-gen-go-json version v1.1.0
70-
4. mockgen version v1.6.0
84+
* Install **jq** and **curl** using your system's package manager
85+
* Follow the same package installation steps as above, but:
86+
- For **protoc**: Download the appropriate binary for your OS from [Protocol Buffers releases](https://github.com/protocolbuffers/protobuf/releases) (e.g., `protoc-32.1-osx-x86_64.zip` for macOS)
87+
- The **Go packages** (protoc-gen-go, protoc-gen-go-grpc, etc.) install the same way via `go install` on all platforms
7188

7289
* Commands below assume execution in a Bourne-compatible shell. Please adjust appropriately in case any other shell is used.
7390

91+
### Troubleshooting
92+
93+
If you encounter issues with the above installation:
94+
95+
**protoc not found:**
96+
- Ensure `$HOME/.local/bin` is in your `$PATH`
97+
- Try `which protoc` to verify installation location
98+
- For system-wide installation, extract to `/usr/local` instead of `$HOME/.local`
99+
100+
**protoc-gen-go not found:**
101+
- Verify Go is properly installed: `go version`
102+
- Ensure `$GOPATH/bin` (or `$HOME/go/bin`) is in your `$PATH`
103+
- Try `which protoc-gen-go` to verify the plugin is available
104+
- If using Go modules, the default GOPATH is `$HOME/go`
105+
106+
**Permission issues:**
107+
- Use `sudo` for system-wide installation of protoc
108+
- For Go packages, avoid `sudo` as they install in user space
74109

75110
## Creation of CCA Endorsements
76111

@@ -304,4 +339,46 @@ Now decode the Entity Attestation Results using `arc` tool as given above
304339

305340
1. On VTS plugin window(where VTS is running) one should see the debug print: `plugin.scheme-cca-ssd-platform: Token Signature Verified`, `matchSoftware Success` & `matchPlatformConfig Success`
306341

342+
2. On Verification window one should see Appraisal Context indicating Success
343+
${TOPDIR}/docs/demo/cca/prov-verif-e2e
344+
```
345+
346+
* Verifying Evidence as a Relying party with the Veraison Verifier
347+
348+
1. First create Evidence using supplied templates
349+
350+
```shell
351+
evcli cca create --claims=data/templates/cca-claims.json --pak=data/keys/ec256.jwk --rak=data/keys/ec384.jwk --token=cca-evidence.cbor
352+
```
353+
` >> "cca-evidence.cbor" successfully created `
354+
355+
2. Exchange Evidence with the Verification Service
356+
357+
* Verifying as a Relying Party
358+
359+
```shell
360+
evcli cca verify-as relying-party --api-server=http://localhost:8080/challenge-response/v1/newSession --token=cca-evidence.cbor | tr -d '"' > ear.jwt
361+
```
362+
363+
The above command writes a Entity Attestation Result (ear) as a signed JSON Web Token in file ear.jwt
364+
365+
* Decoding the contents of Entity Attestation Result
366+
367+
One can cryptogrpahically verify the `ear.jwt` returned from Veraison and decode the contents using `arc` CLI tool as below:
368+
369+
```shell
370+
arc verify -a=ES256 -p=data/keys/verif_es256_pub.jwk ear.jwt
371+
```
372+
373+
* Verifying as an Attester
374+
375+
```shell
376+
evcli cca verify-as attester --api-server=http://localhost:8080/challenge-response/v1/newSession --claims=data/templates/cca-claims-without-realm-challenge.json --pak=data/keys/ec256.jwk --rak=data/keys/ec384.jwk | tr -d '"' > ear.jwt
377+
```
378+
Now decode the Entity Attestation Results using `arc` tool as given above
379+
380+
* Log checking
381+
382+
1. On VTS plugin window(where VTS is running) one should see the debug print: `plugin.scheme-cca-ssd-platform: Token Signature Verified`, `matchSoftware Success` & `matchPlatformConfig Success`
383+
307384
2. On Verification window one should see Appraisal Context indicating Success

demo/psa/manual-end-to-end.md

Lines changed: 61 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ end to end PSA Demonstration.
88
### Install on Ubuntu
99
* One needs to install `Go`, `jq`,`sqlite3`,`tmux` and `curl`.
1010

11-
Use the below mentioned path to install go in your system:
11+
Follow the instructions at https://go.dev/doc/install to install Go in your system.
1212

13-
`https://go.dev/doc/install`
13+
> **Important**: After installing Go, ensure that `$GOPATH/bin` (or `$HOME/go/bin` if using default GOPATH) is in your `$PATH` so that Go-installed binaries like `protoc-gen-go` can be found by `protoc`.
1414
1515
Installing jq:
1616
```sh
@@ -38,39 +38,73 @@ sudo apt-get install tmux
3838

3939

4040
* For build to succeed one needs to install following packages:
41-
1. protoc-gen-go with version v1.26
42-
From `https://github.com/protocolbuffers/protobuf/releases` download the `protobuf-all-[VERSION].tar.gz`.
43-
Extract the contents and change in the directory
4441

45-
```sh
46-
./configure
47-
make
48-
make check
49-
sudo make install
50-
```
51-
To check if this works
52-
`protoc --version`
53-
54-
2. protoc-gen-go-grpc version v1.1
55-
`go install google.golang.org/grpc/cmd/[email protected]`
56-
3. protoc-gen-go-json version v1.1.0
57-
`go install github.com/mitchellh/[email protected]`
58-
4. mockgen version v1.6.0
59-
`go install github.com/golang/mock/[email protected]`
42+
1. **Protocol Buffer Compiler (protoc)**
43+
44+
Download the latest pre-compiled `protoc` binary from [Protocol Buffers releases](https://github.com/protocolbuffers/protobuf/releases).
45+
46+
For Ubuntu/Linux x86_64:
47+
```sh
48+
# Download and install protoc (replace VERSION with latest, e.g., 32.1)
49+
curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v32.1/protoc-32.1-linux-x86_64.zip
50+
unzip protoc-32.1-linux-x86_64.zip -d $HOME/.local
51+
export PATH="$PATH:$HOME/.local/bin"
52+
```
53+
54+
To verify installation:
55+
```sh
56+
protoc --version
57+
```
58+
59+
2. **Go Protocol Buffer Plugin (protoc-gen-go) version v1.26**
60+
```sh
61+
go install google.golang.org/protobuf/cmd/[email protected]
62+
```
63+
64+
3. **protoc-gen-go-grpc version v1.1**
65+
```sh
66+
go install google.golang.org/grpc/cmd/[email protected]
67+
```
68+
69+
4. **protoc-gen-go-json version v1.1.0**
70+
```sh
71+
go install github.com/mitchellh/[email protected]
72+
```
73+
74+
5. **mockgen version v1.6.0**
75+
```sh
76+
go install github.com/golang/mock/[email protected]
77+
```
6078

6179
### Other systems
6280

63-
* One need to install jq and curl.
81+
For non-Ubuntu systems:
6482

65-
66-
* For build to succeed one needs to install following packages:
67-
1. protoc-gen-go with version v1.26
68-
2. protoc-gen-go-grpc version v1.1
69-
3. protoc-gen-go-json version v1.1.0
70-
4. mockgen version v1.6.0
83+
* Install **jq** and **curl** using your system's package manager
84+
* Follow the same package installation steps as above, but:
85+
- For **protoc**: Download the appropriate binary for your OS from [Protocol Buffers releases](https://github.com/protocolbuffers/protobuf/releases) (e.g., `protoc-32.1-osx-x86_64.zip` for macOS)
86+
- The **Go packages** (protoc-gen-go, protoc-gen-go-grpc, etc.) install the same way via `go install` on all platforms
7187

7288
* Commands below assume execution in a Bourne-compatible shell. Please adjust appropriately in case any other shell is used.
7389

90+
### Troubleshooting
91+
92+
If you encounter issues with the above installation:
93+
94+
**protoc not found:**
95+
- Ensure `$HOME/.local/bin` is in your `$PATH`
96+
- Try `which protoc` to verify installation location
97+
- For system-wide installation, extract to `/usr/local` instead of `$HOME/.local`
98+
99+
**protoc-gen-go not found:**
100+
- Verify Go is properly installed: `go version`
101+
- Ensure `$GOPATH/bin` (or `$HOME/go/bin`) is in your `$PATH`
102+
- Try `which protoc-gen-go` to verify the plugin is available
103+
- If using Go modules, the default GOPATH is `$HOME/go`
104+
105+
**Permission issues:**
106+
- Use `sudo` for system-wide installation of protoc
107+
- For Go packages, avoid `sudo` as they install in user space
74108

75109
## Creation of PSA Endorsements
76110

0 commit comments

Comments
 (0)