Vehicular networks are becoming a prominent research field in the intelligent transportation system (ITS) due to the nature and characteristics of providing high-level road safety and optimized traffic management. Vehicles are equipped with the heavy communication equipment which requires a high power supply, on-board computing device, and data storage devices. Many wireless communication technologies are deployed to maintain and enhance the traffic management system. The ITS is capable of providing services to the traffic authorities and precautionary measures to the drivers and passengers. Several methods have been proposed for discussing the security and privacy issues for the vehicular ad hoc networks (VANETs) and vehicular cloud computing (VCC). They receive a great deal of attention from researchers around the world since they are new technologies, and they can improve road safety and enhance traffic flow by utilizing the vehicles resources and communication system. Firstly, the VANETs are presented, including the basic overview, characteristics, threats, and attacks. The location privacy methodologies are elaborated, which can protect the confidential information of the vehicle, such as the location detail and driver information. Secondly, the trust management models in the VANETs are comprehensively discussed, followed by the comparison of the cryptography and trust models in terms of different kinds of attacks. Then, the simulation tools and applications of the VANETs are discussed, and the evolution is presented from the VANETs to VCC in the vehicular network. Thirdly, the VCC is discussed from its architecture and the security and privacy issues. Finally, several research challenges on the VANETs and VCC are presented. In sum, this survey comprehensively covers the location privacy and trust management models of the VANETs and discusses the security and privacy issues in the VCC, which fills the gap of existing surveys. Also, it indicates the research challenges in the VANETs and VCC.