It was one of the deadliest attacks on the army in recent years, and Indian officials quickly blamed a group based in Pakistan.