Any person subject to this code who does either of the following shall be punished as a court-martial may direct:
(1) Aids, or attempts to aid, the enemy with arms, ammunition, supplies, money, or other things.
(2) Without proper authority, knowingly harbors or protects or gives intelligence to, or communicates or corresponds with or holds any intercourse with the enemy, either directly or indirectly.