Commit 26f224ff authored by Sietse Ringers's avatar Sietse Ringers
Browse files

Don't export SchemeManager.index

parent 014ef89f
......@@ -22,9 +22,10 @@ type SchemeManager struct {
XMLVersion int `xml:"version,attr"`
XMLName xml.Name `xml:"SchemeManager"`
Index SchemeManagerIndex `xml:"-"`
Status SchemeManagerStatus `xml:"-"`
Valid bool `xml:"-"` // true iff Status == SchemeManagerStatusValid
index SchemeManagerIndex
}
// Issuer describes an issuer.
......
......@@ -636,12 +636,12 @@ func (conf *Configuration) parseIndex(name string, manager *SchemeManager) error
if err != nil {
return err
}
manager.Index = make(map[string]ConfigurationFileHash)
return manager.Index.FromString(string(indexbts))
manager.index = make(map[string]ConfigurationFileHash)
return manager.index.FromString(string(indexbts))
}
func (conf *Configuration) VerifySchemeManager(manager *SchemeManager) error {
for file := range manager.Index {
for file := range manager.index {
exists, err := fs.PathExists(filepath.Join(conf.path, file))
if err != nil {
return err
......@@ -662,7 +662,7 @@ func (conf *Configuration) VerifySchemeManager(manager *SchemeManager) error {
// and verifies its authenticity by checking that the file hash
// is present in the (signed) scheme manager index file.
func (conf *Configuration) ReadAuthenticatedFile(manager *SchemeManager, path string) ([]byte, error) {
signedHash, ok := manager.Index[path]
signedHash, ok := manager.index[path]
if !ok {
return nil, errors.Errorf("File %s not present in scheme manager index", path)
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment