It is common practice for police to use driving tickets as a pretext to search motorists' cars. The typical scenario includes the officer asking permission to search the vehicle but often times police just search anyways if the motorist is acting strange (in the officer's eyes). Commonly, the officer will use police dogs to sniff and find whatever is hidden in the car. Skilled officers will prolong the ticket writing to give the dog enough time to sniff (search) the car.
Luckily, the U.S. Supreme Court has recently ruled that "Police who use drug-sniffing dogs in conjunction with traffic stops can’t keep the motorist waiting after the ticket is written when they have no reasonable suspicion justifying the extra time." The case is Rodriguez v. United States. In the case, the high court ruled that a making a motorist wait 7 or 8 minutes for a police dug to perform it sniff of the court violated the Fourth Amendment because the traffic warning was given before the sniffing occurred.
The case's issue was whether the police officer had a reasonable suspicion of criminal activity that justified detaining the motorist after the traffic stop was complete. The high court could not answer the question and remanded the case.
A traffic stop surpassing the time for the traffic violation violates the motorist's Fourth Amendment's right against unreasonable seizures, if there is no reasonable suspicion justifying the prolonged detention.