Recently, I was pulled over for not using my blinker to pull out of a gas station late at night. In reality, it was an excuse to question me and search my car by a department that had never pulled me over and a cop I'd never met. An acquaintance claimed that I was selling prescriptions and the cop started questioning me about my (ex)boyfriend's prescription before I even had a chance to ask why I got pulled over. After 10 minutes of refusing to let him search my car, he claimed he smelled marijuana and told me he had a right to search my car even if I didn't consent. Angry, I let him search and he found nothing.
It wasn't until he finished searching that he asked me for my license and registration. He then ticketed me for not using my blinker and gave me a lecture about how he knows I'm selling and is watching me and it better stop.
My question is this: is this all legal? Especially the part where he doesn't even ask for my ID or registration until after searching my car. Clearly he knew who I was, despite the fact that I've never been in any sort of legal trouble.