#3265: Extract parts replaced by pinserver_authenticate.