mirror of
https://github.com/octoleo/restic.git
synced 2024-11-16 18:15:20 +00:00
server: Check irreducible polynomial in config
This commit is contained in:
parent
765e3dc66f
commit
ddc44ddfb1
@ -552,7 +552,16 @@ func (s *Server) createConfig() (err error) {
|
||||
}
|
||||
|
||||
func (s *Server) loadConfig(cfg *Config) error {
|
||||
return s.LoadJSONUnpacked(backend.Config, nil, cfg)
|
||||
err := s.LoadJSONUnpacked(backend.Config, nil, cfg)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if !cfg.ChunkerPolynomial.Irreducible() {
|
||||
return errors.New("invalid chunker polynomial")
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// SearchKey tries to find a key for which the supplied password works,
|
||||
|
Loading…
Reference in New Issue
Block a user