Fix incorrect usage of log_message()
Fix compilation error without PAM
Fix password authentication to handle different encryption algorithms