move the NID_undef check for EC named curve