he had gained a history degree from essex university before his lifetime incarceration and , in the last twelve years of his imprisonment , he had , through the open university , garnered honors and a masters degree in history and then a doctorate in philosophy .