KeyNegotiation.java: add flag to check whether it succeed or not.