亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? console.c

?? 遠程登陸工具軟件源碼 用于遠程登陸unix
?? C
字號:
/*
 * console.c: various interactive-prompt routines shared between
 * the Windows console PuTTY tools
 */

#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>

#include "putty.h"
#include "storage.h"
#include "ssh.h"

int console_batch_mode = FALSE;

static void *console_logctx = NULL;

/*
 * Clean up and exit.
 */
void cleanup_exit(int code)
{
    /*
     * Clean up.
     */
    sk_cleanup();

    random_save_seed();
#ifdef MSCRYPTOAPI
    crypto_wrapup();
#endif

    exit(code);
}

void verify_ssh_host_key(void *frontend, char *host, int port, char *keytype,
			 char *keystr, char *fingerprint)
{
    int ret;
    HANDLE hin;
    DWORD savemode, i;

    static const char absentmsg_batch[] =
	"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"
	"Connection abandoned.\n";
    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, enter \"y\" to add the key to\n"
	"PuTTY's cache and carry on connecting.\n"
	"If you want to carry on connecting just once, without\n"
	"adding the key to the cache, enter \"n\".\n"
	"If you do not trust this host, press Return to abandon the\n"
	"connection.\n"
	"Store key in cache? (y/n) ";

    static const char wrongmsg_batch[] =
	"WARNING - POTENTIAL SECURITY BREACH!\n"
	"The server's host key does not match the one PuTTY 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"
	"Connection abandoned.\n";
    static const char wrongmsg[] =
	"WARNING - POTENTIAL SECURITY BREACH!\n"
	"The server's host key does not match the one PuTTY 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"
	"enter \"y\" to update PuTTY's cache and continue connecting.\n"
	"If you want to carry on connecting but without updating\n"
	"the cache, enter \"n\".\n"
	"If you want to abandon the connection completely, press\n"
	"Return to cancel. Pressing Return is the ONLY guaranteed\n"
	"safe choice.\n"
	"Update cached key? (y/n, Return cancels connection) ";

    static const char abandoned[] = "Connection abandoned.\n";

    char line[32];

    /*
     * Verify the key against the registry.
     */
    ret = verify_host_key(host, port, keytype, keystr);

    if (ret == 0)		       /* success - key matched OK */
	return;

    if (ret == 2) {		       /* key was different */
	if (console_batch_mode) {
	    fprintf(stderr, wrongmsg_batch, keytype, fingerprint);
	    cleanup_exit(1);
	}
	fprintf(stderr, wrongmsg, keytype, fingerprint);
	fflush(stderr);
    }
    if (ret == 1) {		       /* key was absent */
	if (console_batch_mode) {
	    fprintf(stderr, absentmsg_batch, keytype, fingerprint);
	    cleanup_exit(1);
	}
	fprintf(stderr, absentmsg, keytype, fingerprint);
	fflush(stderr);
    }

    hin = GetStdHandle(STD_INPUT_HANDLE);
    GetConsoleMode(hin, &savemode);
    SetConsoleMode(hin, (savemode | ENABLE_ECHO_INPUT |
			 ENABLE_PROCESSED_INPUT | ENABLE_LINE_INPUT));
    ReadFile(hin, line, sizeof(line) - 1, &i, NULL);
    SetConsoleMode(hin, savemode);

    if (line[0] != '\0' && line[0] != '\r' && line[0] != '\n') {
	if (line[0] == 'y' || line[0] == 'Y')
	    store_host_key(host, port, keytype, keystr);
    } else {
	fprintf(stderr, abandoned);
	cleanup_exit(0);
    }
}

void update_specials_menu(void *frontend)
{
}

/*
 * Ask whether the selected cipher is acceptable (since it was
 * below the configured 'warn' threshold).
 * cs: 0 = both ways, 1 = client->server, 2 = server->client
 */
void askcipher(void *frontend, char *ciphername, int cs)
{
    HANDLE hin;
    DWORD savemode, i;

    static const char msg[] =
	"The first %scipher supported by the server is\n"
	"%s, which is below the configured warning threshold.\n"
	"Continue with connection? (y/n) ";
    static const char msg_batch[] =
	"The first %scipher supported by the server is\n"
	"%s, which is below the configured warning threshold.\n"
	"Connection abandoned.\n";
    static const char abandoned[] = "Connection abandoned.\n";

    char line[32];

    if (console_batch_mode) {
	fprintf(stderr, msg_batch,
		(cs == 0) ? "" :
		(cs == 1) ? "client-to-server " : "server-to-client ",
		ciphername);
	cleanup_exit(1);
    }

    fprintf(stderr, msg,
	    (cs == 0) ? "" :
	    (cs == 1) ? "client-to-server " : "server-to-client ",
	    ciphername);
    fflush(stderr);

    hin = GetStdHandle(STD_INPUT_HANDLE);
    GetConsoleMode(hin, &savemode);
    SetConsoleMode(hin, (savemode | ENABLE_ECHO_INPUT |
			 ENABLE_PROCESSED_INPUT | ENABLE_LINE_INPUT));
    ReadFile(hin, line, sizeof(line) - 1, &i, NULL);
    SetConsoleMode(hin, savemode);

    if (line[0] == 'y' || line[0] == 'Y') {
	return;
    } else {
	fprintf(stderr, abandoned);
	cleanup_exit(0);
    }
}

/*
 * Ask whether to wipe a session log file before writing to it.
 * Returns 2 for wipe, 1 for append, 0 for cancel (don't log).
 */
int askappend(void *frontend, Filename filename)
{
    HANDLE hin;
    DWORD savemode, i;

    static const char msgtemplate[] =
	"The session log file \"%.*s\" already exists.\n"
	"You can overwrite it with a new session log,\n"
	"append your session log to the end of it,\n"
	"or disable session logging for this session.\n"
	"Enter \"y\" to wipe the file, \"n\" to append to it,\n"
	"or just press Return to disable logging.\n"
	"Wipe the log file? (y/n, Return cancels logging) ";

    static const char msgtemplate_batch[] =
	"The session log file \"%.*s\" already exists.\n"
	"Logging will not be enabled.\n";

    char line[32];

    if (console_batch_mode) {
	fprintf(stderr, msgtemplate_batch, FILENAME_MAX, filename.path);
	fflush(stderr);
	return 0;
    }
    fprintf(stderr, msgtemplate, FILENAME_MAX, filename.path);
    fflush(stderr);

    hin = GetStdHandle(STD_INPUT_HANDLE);
    GetConsoleMode(hin, &savemode);
    SetConsoleMode(hin, (savemode | ENABLE_ECHO_INPUT |
			 ENABLE_PROCESSED_INPUT | ENABLE_LINE_INPUT));
    ReadFile(hin, line, sizeof(line) - 1, &i, NULL);
    SetConsoleMode(hin, savemode);

    if (line[0] == 'y' || line[0] == 'Y')
	return 2;
    else if (line[0] == 'n' || line[0] == 'N')
	return 1;
    else
	return 0;
}

/*
 * Warn about the obsolescent key file format.
 * 
 * Uniquely among these functions, this one does _not_ expect a
 * frontend handle. This means that if PuTTY is ported to a
 * platform which requires frontend handles, this function will be
 * an anomaly. Fortunately, the problem it addresses will not have
 * been present on that platform, so it can plausibly be
 * implemented as an empty function.
 */
void old_keyfile_warning(void)
{
    static const char message[] =
	"You are loading an SSH 2 private key which has an\n"
	"old version of the file format. This means your key\n"
	"file is not fully tamperproof. Future versions of\n"
	"PuTTY may stop supporting this private key format,\n"
	"so we recommend you convert your key to the new\n"
	"format.\n"
	"\n"
	"Once the key is loaded into PuTTYgen, you can perform\n"
	"this conversion simply by saving it again.\n";

    fputs(message, stderr);
}

void console_provide_logctx(void *logctx)
{
    console_logctx = logctx;
}

void logevent(void *frontend, const char *string)
{
    if (console_logctx)
	log_eventlog(console_logctx, string);
}

int console_get_line(const char *prompt, char *str,
			    int maxlen, int is_pw)
{
    HANDLE hin, hout;
    DWORD savemode, newmode, i;

    if (console_batch_mode) {
	if (maxlen > 0)
	    str[0] = '\0';
    } else {
	hin = GetStdHandle(STD_INPUT_HANDLE);
	hout = GetStdHandle(STD_OUTPUT_HANDLE);
	if (hin == INVALID_HANDLE_VALUE || hout == INVALID_HANDLE_VALUE) {
	    fprintf(stderr, "Cannot get standard input/output handles\n");
	    cleanup_exit(1);
	}

	GetConsoleMode(hin, &savemode);
	newmode = savemode | ENABLE_PROCESSED_INPUT | ENABLE_LINE_INPUT;
	if (is_pw)
	    newmode &= ~ENABLE_ECHO_INPUT;
	else
	    newmode |= ENABLE_ECHO_INPUT;
	SetConsoleMode(hin, newmode);

	WriteFile(hout, prompt, strlen(prompt), &i, NULL);
	ReadFile(hin, str, maxlen - 1, &i, NULL);

	SetConsoleMode(hin, savemode);

	if ((int) i > maxlen)
	    i = maxlen - 1;
	else
	    i = i - 2;
	str[i] = '\0';

	if (is_pw)
	    WriteFile(hout, "\r\n", 2, &i, NULL);

    }
    return 1;
}

void frontend_keypress(void *handle)
{
    /*
     * This is nothing but a stub, in console code.
     */
    return;
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲成人动漫精品| 国产精品不卡在线| 欧美在线三级电影| 91视频你懂的| 99久久精品国产一区| 粉嫩aⅴ一区二区三区四区五区| 精品无码三级在线观看视频| 美女视频网站久久| 国产麻豆精品在线| 国产a视频精品免费观看| 国产高清不卡二三区| 成人h版在线观看| 99精品国产91久久久久久| 色天使色偷偷av一区二区 | 欧美国产一区二区在线观看| 国产三级精品在线| 国产精品视频在线看| 亚洲人123区| 五月综合激情日本mⅴ| 美女诱惑一区二区| 国产激情一区二区三区桃花岛亚洲 | 亚洲国产高清不卡| 亚洲激情图片qvod| 蜜桃视频在线观看一区| 国产伦精一区二区三区| www.欧美精品一二区| 在线观看欧美日本| 日韩色在线观看| 亚洲国产精品av| 亚洲第一福利视频在线| 麻豆freexxxx性91精品| 99久久婷婷国产综合精品电影| 在线视频欧美精品| 欧美精品一区二| 亚洲人成网站影音先锋播放| 三级一区在线视频先锋| av资源站一区| 在线播放中文一区| 国产精品久久久久四虎| 视频一区中文字幕国产| 国产精华液一区二区三区| 欧美色成人综合| 国产欧美va欧美不卡在线| 午夜欧美视频在线观看| 99热99精品| 日韩欧美一区在线观看| 亚洲人成亚洲人成在线观看图片 | 欧美一区二区视频在线观看2020| 国产丝袜欧美中文另类| 秋霞电影网一区二区| 在线观看av不卡| 国产亚洲精品免费| 日日夜夜免费精品视频| 97国产一区二区| 国产拍欧美日韩视频二区| 日韩成人精品在线| 91美女片黄在线观看| 久久精品男人天堂av| 久久国内精品自在自线400部| 欧美亚洲国产一区在线观看网站| 中文字幕av一区二区三区免费看| 美女久久久精品| 7777精品伊人久久久大香线蕉最新版| 中文字幕一区二区三中文字幕| 国产一区日韩二区欧美三区| 欧美理论片在线| 午夜在线电影亚洲一区| 在线视频欧美区| 亚洲综合色婷婷| 色哟哟国产精品| 亚洲精品水蜜桃| 色综合久久88色综合天天6| 国产精品久久毛片a| 成人h动漫精品一区二区| 欧美激情艳妇裸体舞| 成人免费高清视频| 午夜影院久久久| 色国产综合视频| 亚洲综合免费观看高清在线观看| 91原创在线视频| 亚洲精品中文在线影院| 欧美色老头old∨ideo| 午夜免费欧美电影| 欧美久久高跟鞋激| 天天综合天天做天天综合| 欧美一级日韩不卡播放免费| 美日韩一区二区| 久久麻豆一区二区| 成人av在线影院| 一区二区三区毛片| 欧美日本视频在线| 国产在线播放一区三区四| 久久精品日韩一区二区三区| 波多野结衣亚洲| 一区2区3区在线看| 91精品国产综合久久精品app| 美女视频黄 久久| 国产日产欧美一区二区视频| 91一区二区三区在线播放| 亚洲123区在线观看| 欧美mv和日韩mv的网站| caoporn国产精品| 五月婷婷综合激情| 亚洲精品一区二区三区香蕉| 91亚洲男人天堂| 美腿丝袜在线亚洲一区| 国产精品理论片| 日韩一区二区三区观看| 成人毛片视频在线观看| 午夜精品福利视频网站| 欧美v日韩v国产v| 99国产精品99久久久久久| 日本va欧美va精品| 国产精品国产三级国产普通话蜜臀 | 国产三级精品三级| 欧美视频完全免费看| 国产一区二区三区在线观看精品 | 欧美韩国日本综合| 欧美美女网站色| av电影在线观看完整版一区二区| 首页国产欧美日韩丝袜| 18欧美乱大交hd1984| 日韩欧美美女一区二区三区| 91免费国产在线| 国产激情精品久久久第一区二区 | 欧美激情在线看| 91精品国产免费久久综合| 972aa.com艺术欧美| 狠狠色狠狠色综合日日91app| 一区二区不卡在线播放| 国产精品狼人久久影院观看方式| 欧美一区二区三区免费在线看| 91视频国产观看| 国产精品18久久久久久久久久久久| 亚洲国产日日夜夜| 欧美激情资源网| 国产日韩视频一区二区三区| 精品国产一区二区三区av性色| 欧美日韩激情在线| 日本乱人伦aⅴ精品| 99re视频这里只有精品| 欧美日韩一区国产| 色婷婷久久久综合中文字幕| 国产成人8x视频一区二区 | 一本一道综合狠狠老| 成人免费毛片嘿嘿连载视频| 韩国中文字幕2020精品| 午夜电影久久久| 亚洲成av人影院| 亚洲成精国产精品女| 亚洲高清免费视频| 夜夜亚洲天天久久| 一级做a爱片久久| 洋洋av久久久久久久一区| 亚洲综合区在线| 亚洲成年人影院| 裸体在线国模精品偷拍| 免费成人在线视频观看| 美日韩一区二区| 国产乱淫av一区二区三区| 国产精品综合视频| 国产成人免费在线观看不卡| 国产盗摄女厕一区二区三区 | 亚洲男人的天堂一区二区| 国产精品美女久久久久久| 中文字幕一区二区日韩精品绯色| 国产精品国产成人国产三级| 夜夜精品浪潮av一区二区三区| 五月天激情综合网| 激情六月婷婷久久| av中文字幕在线不卡| 欧美丝袜丝交足nylons| 日韩欧美在线观看一区二区三区| 日韩欧美一区二区在线视频| 亚洲国产成人自拍| 亚洲五月六月丁香激情| 久久99久久精品| 成人午夜视频在线观看| 欧美三级中文字| 精品国产凹凸成av人导航| 国产精品免费视频观看| 亚洲一区二区精品久久av| 美女www一区二区| 99久久精品费精品国产一区二区| 欧美性色欧美a在线播放| 欧美成人vps| 一区二区三区电影在线播| 麻豆国产一区二区| 91精品91久久久中77777| 7777精品伊人久久久大香线蕉经典版下载 | 欧美日韩国产成人在线免费| 日韩欧美在线123| 亚洲精品免费在线播放| 麻豆精品一二三| 在线一区二区观看| 欧美精品一区二区三区四区| 有码一区二区三区| 国产一区二区三区四| 欧美三区免费完整视频在线观看| 中文字幕av一区二区三区|