The analysis suggests that the U.S. war in Somalia was waged with no clear legal basis.