Inspired by RedHat changes that used libgcrypt. Also add digest_type_to_name() to map a sudo digest type (int) to a name (string) and use it.