Commit bec20498 authored by masala's avatar masala

fix bug disallowing nonvoting auth

parent 02c548ee
......@@ -290,13 +290,11 @@ func (s *Store) newAccount(id string, cfg *config.Account, pCfg *proxy.Config) (
var err error
a.nonvotingAuthority, err = s.authorities.Get(cfg.NonvotingAuthority)
if err != nil {
return nil, err
}
a.votingAuthority, err = s.authorities.Get(cfg.VotingAuthority)
if err != nil {
return nil, err
a.votingAuthority, err = s.authorities.Get(cfg.VotingAuthority)
if err != nil {
return nil, err
}
}
if a.nonvotingAuthority != nil {
a.clientCfg.PKIClient = a.nonvotingAuthority.Client()
}
......
......@@ -121,13 +121,19 @@ func NewStore(g glue.ProxyInternals) *Store {
s := new(Store)
s.cfg = g.Config()
s.logBackend = g.LogBackend()
auth := g.NonvotingAuthorities()
if auth != nil {
s.authorities = auth
if len(s.cfg.NonvotingAuthority) > 0 {
auth := g.NonvotingAuthorities()
if auth != nil {
s.authorities = auth
}
} else if len(s.cfg.VotingAuthority) > 0 {
auth := g.VotingAuthorities()
if auth != nil {
s.authorities = auth
}
}
auth = g.VotingAuthorities()
if auth != nil {
s.authorities = auth
if s.authorities == nil {
return nil
}
s.eventCh = g.EventCh()
s.fatalErrCh = g.FatalErrCh()
......
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