The magnetic fields of white dwarfs