Calm like the Bomb, please leave such "law bending" cops out of these theoretical events. A cop can shoot you and get away with it, saying, you pulled out what looked like a weapon and raised it at the officer. But, that usually doesnt happen.
What I am asking, is say the driver of the car is pulled over for something, consents to a search, the cop finds marijuana on him. You, as the passenger, declare ignorance. The law states that if you did not know, then you are innocent. This , unfortunately, may be something you will have to fight in court. Fortunately, you can probably win. "Lack of evidence" goes a LONG way in court, and despite the charge and incriminating naysay and witnesses, lack of evidence will rule out. You can have 5 witnesses against you, but if that's all, Lack of Evidence rules. But anywas....
What I'm saying is your friend is arrested. Can you be searched if you say no?
I know that the cop can FRISK you if he has reasonable suspicion of a weapon. I know he must have reasonable suspicion, to have probable cause. Reasonable suspicion may be something like your red eyes, and probably cause being you smelling like bud. But if you truly are innocent, do not smell of bud or have red eyes, can you be searched if you say no? You have not been arrested yet. It seems to me the answer is that you can't be searched.
Of course, the cop can say "i dont believe you shithead" and search you. But lets say you are honest about not knowing, and the cop sees your honesty.