The correct answer is: C. The former master said that he would have been surprised if I had passed the examination.
The former master is using the past subjunctive mood to express a counterfactual situation. In other words, he is saying that he would have been surprised if I had passed the examination, but I did not pass the examination.
Option A is incorrect because the former master is not saying that he was surprised. He is saying that he would have been surprised.
Option B is incorrect because the former master is not saying that he should have been surprised. He is saying that he would have been surprised.
Option D is incorrect because the former master is not saying that he was surprised. He is saying that he would have been surprised.