The U.S. Congress is sending President Donald Trump legislation that would force technology companies to disclose if they allowed countries like China and Russia to examine the inner workings of software sold to the U.S. military.

The legislation, part of the Pentagon's spending bill, was drafted after an investigation last year found that software-makers allowed a Russian defense agency to hunt for vulnerabilities in software used by some agencies of the U.S. government, including the Pentagon and intelligence services.

The final version of the bill was approved by the Senate in a 87-10 vote Wednesday after passing the House last week. The spending bill is expected to be signed into law by Trump.