Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(871)

Unified Diff: services/vanadium/security/wire_blessings.go

Issue 1418013004: Principal Service: Add support for multiple user accounts (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: services/vanadium/security/wire_blessings.go
diff --git a/services/vanadium/security/wire_blessings.go b/services/vanadium/security/wire_blessings.go
index b724000ceea1ea593829cdf62295e17b982a2a1c..efb0fb51794a3712300075d988f9784491e64356 100644
--- a/services/vanadium/security/wire_blessings.go
+++ b/services/vanadium/security/wire_blessings.go
@@ -54,14 +54,19 @@ type caveat struct {
ParamVom []byte // VOM-encoded bytes of the parameters to be provided to the validation function.
}
-func newBlessing(wb *wireBlessings) *vpkg.Blessing {
+func newBlessing(wb *wireBlessings) vpkg.Blessing {
+ if wb == nil || len(wb.CertificateChains) == 0 {
+ return vpkg.Blessing{}
+ }
// TODO(ataly, gauthamt): Below we only consider the first certificate chain
// in the wireBlessings object. We should handle the case when the wireBlessings
- // object has more than one certificate chain.
- // TODO(ataly, gauthamt): We should validate all caveats present in the certificates.
+ // object has more than one certificate chain. This issue would become moot
+ // if the vpkg.Blessing type matched the wireBlessing type.
+ // TODO(ataly, gauthamt): We should validate all caveats present in the
+ // certificates.
var chain []vpkg.Certificate
for _, c := range wb.CertificateChains[0] {
chain = append(chain, vpkg.Certificate{Extension: c.Extension})
}
- return &vpkg.Blessing{chain}
+ return vpkg.Blessing{chain}
}
« services/vanadium/security/principal_service.go ('K') | « services/vanadium/security/public_key.go ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698