The White House threatened on Wednesday to veto cyber-legislation that is widely expected to pass the House this week, asserting that the bill would put Americans’ privacy at risk and give a pass to companies that fail to secure their computer networks.