Characterization of optimality in convex programming without a constraint qualification