The United States Senate ratified, and President Reagan signed the The U.N. Convention Against Torture, which states that “no exceptional circumstances whatsoever, whether a state of war or a threat or war, internal political instability or any other public emergency, may be invoked as a justification of torture.”
No amount of legal hand waving by the Bush administration can justify what was done.
Likewise, there is no excuse for the Obama administration refusing to prosecute the crimes that occurred.