Trust and Reputation in the Internet of Things: State-of-the-Art and Research Challenges