2
2
mirror of https://github.com/octoleo/restic.git synced 2024-06-09 04:12:25 +00:00

server: Check irreducible polynomial in config

This commit is contained in:
Alexander Neumann 2015-05-03 17:42:01 +02:00
parent 765e3dc66f
commit ddc44ddfb1

View File

@ -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,