sfree((void *)mbox.lpszText); sfree((void *)mbox.lpszCaption); if (mbret == IDYES)
sfree(text); sfree(caption); if (mbret == IDYES) {
int verify_ssh_host_key(void *frontend, char *host, int port, char *keytype,                        char *keystr, char *fingerprint,                        void (*callback)(void *ctx, int result), void *ctx){    int ret;    static const char absentmsg[] =	"The server's host key is not cached in the registry. You\n"	"have no guarantee that the server is the computer you\n"	"think it is.\n"	"The server's %s key fingerprint is:\n"	"%s\n"	"If you trust this host, hit Yes to add the key to\n"	"%s's cache and carry on connecting.\n"	"If you want to carry on connecting just once, without\n"	"adding the key to the cache, hit No.\n"	"If you do not trust this host, hit Cancel to abandon the\n"	"connection.\n";    static const char wrongmsg[] =	"WARNING - POTENTIAL SECURITY BREACH!\n"	"\n"	"The server's host key does not match the one %s has\n"	"cached in the registry. This means that either the\n"	"server administrator has changed the host key, or you\n"	"have actually connected to another computer pretending\n"	"to be the server.\n"	"The new %s key fingerprint is:\n"	"%s\n"	"If you were expecting this change and trust the new key,\n"	"hit Yes to update %s's cache and continue connecting.\n"	"If you want to carry on connecting but without updating\n"	"the cache, hit No.\n"	"If you want to abandon the connection completely, hit\n"	"Cancel. Hitting Cancel is the ONLY guaranteed safe\n" "choice.\n";    static const char mbtitle[] = "%s Security Alert";    UINT help_button = 0;    MSGBOXPARAMS mbox;    /*     * We use MessageBoxIndirect() because it allows us to specify a     * callback function for the Help button.     */    mbox.cbSize = sizeof(mbox);    mbox.hInstance = hinst;    mbox.hwndOwner = hwnd;    mbox.lpfnMsgBoxCallback = &verify_ssh_host_key_help;    mbox.dwLanguageId = LANG_NEUTRAL;    /* Do we have a help file? */    if (help_path)	help_button = MB_HELP;    /*     * Verify the key against the registry.     */    ret = verify_host_key(host, port, keytype, keystr);    if (ret == 0)		       /* success - key matched OK */	return 1;    if (ret == 2) {		       /* key was different */	int mbret;	mbox.lpszText = dupprintf(wrongmsg, appname, keytype, fingerprint,				  appname);	mbox.lpszCaption = dupprintf(mbtitle, appname);	mbox.dwContextHelpId = HELPCTXID(errors_hostkey_changed);	mbox.dwStyle = MB_ICONWARNING | MB_YESNOCANCEL | MB_DEFBUTTON3 |	    help_button;	mbret = MessageBoxIndirect(&mbox);	assert(mbret==IDYES || mbret==IDNO || mbret==IDCANCEL);	sfree((void *)mbox.lpszText);	sfree((void *)mbox.lpszCaption);	if (mbret == IDYES) {	    store_host_key(host, port, keytype, keystr);	    return 1;	} else if (mbret == IDNO)	    return 1;        return 0;    }    if (ret == 1) {		       /* key was absent */	int mbret;	mbox.lpszText = dupprintf(absentmsg, keytype, fingerprint, appname);	mbox.lpszCaption = dupprintf(mbtitle, appname);	mbox.dwContextHelpId = HELPCTXID(errors_hostkey_absent);	mbox.dwStyle = MB_ICONWARNING | MB_YESNOCANCEL | MB_DEFBUTTON3 |	    help_button;	mbret = MessageBoxIndirect(&mbox);	assert(mbret==IDYES || mbret==IDNO || mbret==IDCANCEL);	sfree((void *)mbox.lpszText);	sfree((void *)mbox.lpszCaption);	if (mbret == IDYES)	    store_host_key(host, port, keytype, keystr);	if (mbret == IDNO)	    return 1;        return 0;    }}