Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

导入上一版本 0.77 翻译 #60

Merged
merged 2 commits into from
Mar 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 7 additions & 18 deletions LICENCE
Original file line number Diff line number Diff line change
@@ -1,28 +1,17 @@
PuTTY is copyright 1997-2022 Simon Tatham.

Portions copyright Robert de Bath, Joris van Rantwijk, Delian
部分版权属于 Robert de Bath, Joris van Rantwijk, Delian
Delchev, Andreas Schultz, Jeroen Massar, Wez Furlong, Nicolas Barry,
Justin Bradford, Ben Harris, Malcolm Smith, Ahmad Khalifa, Markus
Kuhn, Colin Watson, Christopher Staite, Lorenz Diener, Christian
Brabandt, Jeff Smith, Pavel Kryukov, Maxim Kuznetsov, Svyatoslav
Kuzmich, Nico Williams, Viktor Dukhovni, Josh Dersch, Lars Brinkhoff,
and CORE SDI S.A.
CORE SDI S.A

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation files
(the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
这里以此方式许可任何人可以免费得到该软件拷贝以及附属文档文件 (""软件""),并可任意处理该软件,包括无限制的使用、复制、修改、合并、出版、分发、转让、授权和/或出售软件的权利,并允许购买该软件的人这样做,只要遵从以下条件:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
以上的版权说明和许可说明应被包含在该软件任何部分的所有拷贝中。

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE
FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
该软件是作为 "AS IS" 提供,没有任何保证、表示或暗示,包括但不限于适销性、适用性和不侵权。在任何情况下作者不对任何声明、损坏或其他责任负责,无论是发生在合同行为、侵权或其它任何来自软件的、与软件相关或无关的以及软件的使用。

PuTTY 中文版的版权属于 2003-2023 李峰,保留所有权利。
7 changes: 7 additions & 0 deletions cmake/gitcommit.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ execute_process(
RESULT_VARIABLE status)
string(REGEX REPLACE "\n$" "" git_worktree "${git_worktree}")

# Fix virtualbox share path
cmake_path(GET git_worktree ROOT_NAME git_root_name)
if (git_root_name STREQUAL "//VBoxSvr")
message("Fix virtualbox share path: \"${git_worktree}\"")
string(REGEX REPLACE "^//VBoxSvr/[A-Za-z0-9_]+" "Z:" git_worktree "${git_worktree}")
endif()

if(status EQUAL 0)
if(git_worktree STREQUAL CMAKE_SOURCE_DIR)
execute_process(
Expand Down
6 changes: 4 additions & 2 deletions cmake/platforms/windows.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ dwmapi_test_wrapper()

set(NO_SECURITY ${PUTTY_NO_SECURITY})

add_compile_options("$<$<C_COMPILER_ID:MSVC>:/source-charset:utf-8>")

add_compile_definitions(
_WINDOWS
_CRT_SECURE_NO_WARNINGS
Expand All @@ -104,10 +106,10 @@ if(WINELIB)
set(LFLAG_MANIFEST_NO "")
elseif(CMAKE_C_COMPILER_ID MATCHES "MSVC" OR
CMAKE_C_COMPILER_FRONTEND_VARIANT MATCHES "MSVC")
set(CMAKE_RC_FLAGS "${CMAKE_RC_FLAGS} /nologo /C1252")
set(CMAKE_RC_FLAGS "${CMAKE_RC_FLAGS} /nologo /C65001")
set(LFLAG_MANIFEST_NO "/manifest:no")
else()
set(CMAKE_RC_FLAGS "${CMAKE_RC_FLAGS} -c1252")
set(CMAKE_RC_FLAGS "${CMAKE_RC_FLAGS} -c65001")
set(LFLAG_MANIFEST_NO "")
endif()

Expand Down
121 changes: 60 additions & 61 deletions cmdgen.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,13 @@ void showversion(void)
void usage(bool standalone)
{
fprintf(standalone ? stderr : stdout,
"Usage: puttygen ( keyfile | -t type [ -b bits ] )\n"
" [ -C comment ] [ -P ] [ -q ]\n"
" [ -o output-keyfile ] [ -O type | -l | -L"
"用法: puttygen ( 密钥文件 | -t 类型 [ -b 位数 ] )\n"
" [ -C 注释 ] [ -P ] [ -q ]\n"
" [ -o 输出密钥文件 ] [ -O 类型 | -l | -L"
" | -p ]\n");
if (standalone)
fprintf(stderr,
"Use \"puttygen --help\" for more detail.\n");
"使用 \"puttygen --help\" 了解更多帮助。\n");
}

void help(void)
Expand All @@ -111,68 +111,67 @@ void help(void)
* Help message is an extended version of the usage message. So
* start with that, plus a version heading.
*/
printf("PuTTYgen: key generator and converter for the PuTTY tools\n"
printf("PuTTYgen: PuTTY 密钥生成与转换工具\n"
"%s\n", ver);
usage(false);
printf(" -t specify key type when generating:\n"
" eddsa, ecdsa, rsa, dsa, rsa1 use with -b\n"
" ed25519, ed448 special cases of eddsa\n"
" -b specify number of bits when generating key\n"
" -C change or specify key comment\n"
" -P change key passphrase\n"
" -q quiet: do not display progress bar\n"
" -O specify output type:\n"
" private output PuTTY private key format\n"
" private-openssh export OpenSSH private key\n"
" private-openssh-new export OpenSSH private key "
"(force new format)\n"
" private-sshcom export ssh.com private key\n"
" public RFC 4716 / ssh.com public key\n"
" public-openssh OpenSSH public key\n"
" fingerprint output the key fingerprint\n"
" cert-info print certificate information\n"
" text output the key components as "
printf(" -t 指定生成的密钥类型:\n"
" eddsa, ecdsa, rsa, dsa, rsa1 配合使用 -b\n"
" ed25519, ed448 来指定 eddsa 实例\n"
" -b 指定生成密钥的位数\n"
" -C 修改或指定密钥注释\n"
" -P 修改密钥密码\n"
" -q 静默: 不显示进度条\n"
" -O 指定输出类型:\n"
" private 输出 PuTTY 私钥\n"
" private-openssh 导出 OpenSSH 私钥\n"
" private-openssh-new 导出 OpenSSH 私钥 "
"(强制新格式)\n"
" private-sshcom 导出 ssh.com 私钥\n"
" public RFC 4716 / ssh.com 公钥\n"
" public-openssh OpenSSH 公钥\n"
" fingerprint 输出密钥指纹\n"
" cert-info 打印证书信息\n"
" text 输出密钥组件为"
"'name=0x####'\n"
" -o specify output file\n"
" -l equivalent to `-O fingerprint'\n"
" -L equivalent to `-O public-openssh'\n"
" -p equivalent to `-O public'\n"
" --cert-info equivalent to `-O cert-info'\n"
" --dump equivalent to `-O text'\n"
" -E fptype specify fingerprint output type:\n"
" -o 指定输出文件\n"
" -l 等价于 `-O fingerprint'\n"
" -L 等价于 `-O public-openssh'\n"
" -p 等价于 `-O public'\n"
" --cert-info 等价于 `-O cert-info'\n"
" --dump 等价于 `-O text'\n"
" -E fptype 指定指纹输出类型:\n"
" sha256, md5, sha256-cert, md5-cert\n"
" --certificate file incorporate a certificate into the key\n"
" --remove-certificate remove any certificate from the key\n"
" --reencrypt load a key and save it with fresh "
"encryption\n"
" --old-passphrase file\n"
" specify file containing old key passphrase\n"
" --new-passphrase file\n"
" specify file containing new key passphrase\n"
" --random-device device\n"
" specify device to read entropy from (e.g. /dev/urandom)\n"
" --primes <type> select prime-generation method:\n"
" probable conventional probabilistic prime finding\n"
" proven numbers that have been proven to be prime\n"
" proven-even also try harder for an even distribution\n"
" --strong-rsa use \"strong\" primes as RSA key factors\n"
" --ppk-param <key>=<value>[,<key>=<value>,...]\n"
" specify parameters when writing PuTTY private key file "
"format:\n"
" version PPK format version (min 2, max 3, "
"default 3)\n"
" kdf key derivation function (argon2id, "
" --certificate 文件 合并指定证书到密钥\n"
" --remove-certificate 从密钥中删除所有证书\n"
" --reencrypt 载入和保存使用全新"
"加密\n"
" --old-passphrase 文件\n"
" 指定包含旧密钥密码的文件\n"
" --new-passphrase 文件\n"
" 指定包含新密钥密码的文件\n"
" --random-device 设备\n"
" 指定用于读取熵的设备 (例如: /dev/urandom)\n"
" --primes <type> 选择素数的生成方式:\n"
" probable 常规概率查找素数\n"
" proven 已被证实的素数\n"
" proven-even 已被证实的素数且尽量均匀分布\n"
" --strong-rsa 使用 \"\" 素数作为 RSA 密钥因素\n"
" --ppk-param <>=<>[,<>=<>,...]\n"
" 写入 PuTTY 私钥文件格式时"
"的指定参数:\n"
" version PPK 格式版本 (最小 2, 最大 3, "
"默认 3)\n"
" kdf 密钥派生函数 (argon2id, "
"argon2i, argon2d)\n"
" memory Kbyte of memory to use in passphrase "
"hash\n"
" (default 8192)\n"
" time approx milliseconds to hash for "
"(default 100)\n"
" passes number of hash passes to run "
"(alternative to 'time')\n"
" parallelism number of parallelisable threads in the "
"hash function\n"
" (default 1)\n"
" memory 用于密匙哈希的内存大小 "
"(单位: Kb)\n"
" (默认 8192)\n"
" time 哈希时间 (单位: 毫秒) "
"(默认 100)\n"
" passes 哈希次数 "
"(可替代 'time')\n"
" parallelism 哈希并发线程数\n"
" (默认 1)\n"
);
}

Expand Down
Loading