| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 package main | 5 package main |
| 6 | 6 |
| 7 import vpkg "mojo/services/vanadium/security/public/interfaces/principal" | 7 import vpkg "mojo/services/vanadium/security/interfaces/principal" |
| 8 | 8 |
| 9 // wireBlessings encapsulates wire format of a set of a Vanadium blessings | 9 // wireBlessings encapsulates wire format of a set of a Vanadium blessings |
| 10 // and the corresponding cryptographic proof that binds them to a principal | 10 // and the corresponding cryptographic proof that binds them to a principal |
| 11 // (identified by a public key). | 11 // (identified by a public key). |
| 12 type wireBlessings struct { | 12 type wireBlessings struct { |
| 13 // CertificateChains is an array of chains of certificates that bind | 13 // CertificateChains is an array of chains of certificates that bind |
| 14 // a blessing to the public key in the last certificate of the chain. | 14 // a blessing to the public key in the last certificate of the chain. |
| 15 CertificateChains [][]certificate | 15 CertificateChains [][]certificate |
| 16 } | 16 } |
| 17 | 17 |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 // TODO(ataly, gauthamt): Below we only consider the first certificate c
hain | 58 // TODO(ataly, gauthamt): Below we only consider the first certificate c
hain |
| 59 // in the wireBlessings object. We should handle the case when the wireB
lessings | 59 // in the wireBlessings object. We should handle the case when the wireB
lessings |
| 60 // object has more than one certificate chain. | 60 // object has more than one certificate chain. |
| 61 // TODO(ataly, gauthamt): We should validate all caveats present in the
certificates. | 61 // TODO(ataly, gauthamt): We should validate all caveats present in the
certificates. |
| 62 var chain []vpkg.Certificate | 62 var chain []vpkg.Certificate |
| 63 for _, c := range wb.CertificateChains[0] { | 63 for _, c := range wb.CertificateChains[0] { |
| 64 chain = append(chain, vpkg.Certificate{Extension: c.Extension}) | 64 chain = append(chain, vpkg.Certificate{Extension: c.Extension}) |
| 65 } | 65 } |
| 66 return &vpkg.Blessing{chain} | 66 return &vpkg.Blessing{chain} |
| 67 } | 67 } |
| OLD | NEW |