security: Make Discharge a struct (instead of an interface).
This commit accompanies:
https://vanadium-review.googlesource.com/#/c/5432/
Motivation:
(1) Will allow us to eventually use VDL support for automatic
translation between wire and native types, thereby relieving
developers of the need to manually convert to the WireDischarge format
(2) Discharges are not meant to be implemented outside the v23/security
package anyway as all processes must be able to understand them
(i.e., no user-defined ThirdPartyCaveats/Discharges)
MultiPart: 2/2
Change-Id: Ib145ff7d9f4c3a1786e2a9c876c22552a5fb99d6
diff --git a/runtimes/google/ipc/server.go b/runtimes/google/ipc/server.go
index 36545a0..2d3a414 100644
--- a/runtimes/google/ipc/server.go
+++ b/runtimes/google/ipc/server.go
@@ -1177,11 +1177,8 @@
fs.ackBlessings = true
}
- for i, d := range req.Discharges {
- dis, err := security.NewDischarge(d)
- if err != nil {
- return verror.New(verror.ErrBadProtocol, fs.T, newErrBadDischarge(fs.T, uint64(i), err))
- }
+ for _, d := range req.Discharges {
+ dis := security.NewDischarge(d)
fs.discharges[dis.ID()] = dis
}
return nil