Mind you, that might be an issue when the DoD sells some technology to another country. Take as an example all the software running a plane such as the F16. If you sell the plane to Brazil, then you'd have to share the source code for the modules with the Brazilian DoD, something that I think is not the current policy.
(I'm mentioning Brazil because, if memory doesn't fail me, one of the requirements they asked of countries/companies bidding to provide them with 4+ generation planes was that they should be able to audit and modify all the software running the planes.)
You can always pack it as a blob and claim it's firmware. Also, I would think twice before annoying someone who sells F-16s and is willing to use them (as well as the newer toys) against those who annoy them.
And yes, being able to audit the complete code for all components was one of the initial conditions and, IIRC, the reason why the Grippen NG was originally selected by the military. But then politicians took over and nobody really knows what will come out of that.
(I'm mentioning Brazil because, if memory doesn't fail me, one of the requirements they asked of countries/companies bidding to provide them with 4+ generation planes was that they should be able to audit and modify all the software running the planes.)