A former military lawyer turned whistleblower has been given leave to appeal his sentence and convictions after he was jailed for leaking military information.