you did give permission to search. that gives them permission to search.
as to the pre-permission; if anything was found that resulted in a prosecution, you might would be able to contest the inclusion of such evidence due to an improper (unwarranted) search. Another possiblity is a "terry" search, which is a allowable search of your vehicle but within more restrictive tolerances, to look for weapons. The police would have to be able to articulate a reasonable justification for that as well though and if not acceptable by the courts, would allow for the exclusion of any evidence obtained by such a search.
No harm, no foul. You aren;t going to court for anything so making a deal out of this will probably get you nowhere.

