The driver, knowing that he had illegal substance in his trunk took the chance that it would not be found or that the officer would not search since the driver agreed to the search giving the appearance of innocence. The greatest danger in this sort of slide into tyranny is if the driver indeed was innocent yet the search turns up ‘something incriminating.’
Request permission to document the search with your cell phone video camera. Point out to the cop that it’s for his protection, so you can’t claim any misdeeds on his part.