- showversion();
- usage();
- fprintf(stderr,
- " -t specify key type when generating (rsa, dsa, rsa1)\n"
- " -b specify number of bits when generating key\n"
- " -C change or specify key comment\n"
- " -P change key passphrase\n"
- " -O specify output type:\n"
- " private output PuTTY private key format\n"
- " private-openssh export OpenSSH private key\n"
- " private-sshcom export ssh.com private key\n"
- " public standard / ssh.com public key\n"
- " public-openssh OpenSSH public key\n"
- " fingerprint output the key fingerprint\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"
- );
-}
-
-static int save_ssh2_pubkey(char *filename, char *comment,
- void *v_pub_blob, int pub_len)
-{
- unsigned char *pub_blob = (unsigned char *)v_pub_blob;
- char *p;
- int i, column;
- FILE *fp;
-
- if (filename) {
- fp = fopen(filename, "wb");
- if (!fp)
- return 0;
- } else
- fp = stdout;
-
- fprintf(fp, "---- BEGIN SSH2 PUBLIC KEY ----\n");
-
- if (comment) {
- fprintf(fp, "Comment: \"");
- for (p = comment; *p; p++) {
- if (*p == '\\' || *p == '\"')
- fputc('\\', fp);
- fputc(*p, fp);
- }
- fprintf(fp, "\"\n");
- }
-
- i = 0;
- column = 0;
- while (i < pub_len) {
- char buf[5];
- int n = (pub_len - i < 3 ? pub_len - i : 3);
- base64_encode_atom(pub_blob + i, n, buf);
- i += n;
- buf[4] = '\0';
- fputs(buf, fp);
- if (++column >= 16) {
- fputc('\n', fp);
- column = 0;
- }
- }
- if (column > 0)
- fputc('\n', fp);
-
- fprintf(fp, "---- END SSH2 PUBLIC KEY ----\n");
- if (filename)
- fclose(fp);
- return 1;
+ printf("PuTTYgen: key generator and converter for the PuTTY tools\n"
+ "%s\n", ver);
+ usage(FALSE);
+ printf(" -t specify key type when generating (ed25519, ecdsa, rsa, "
+ "dsa, rsa1)\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"
+ " -o specify output file\n"
+ " -l equivalent to `-O fingerprint'\n"
+ " -L equivalent to `-O public-openssh'\n"
+ " -p equivalent to `-O public'\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"
+ );