@kacfengine leave it for now maybe. Probably we will have to rethink how this whole authentication is working. 
And regarding the question couple lines above there is function ServerIdentifyClient(). If that one fails flow is closed so we are sure that username is set while saving the key.