1 Rename PRIVATE to PPRIVATE in order to avoid a name clash resulting in errors like this:
2 putty-0.75/cmdgen.c:228:12: error: expected identifier before numeric constant
3 enum { PRIVATE, PUBLIC, PUBLICO, FP, OPENSSH_AUTO,
5 --- putty-0.78/cmdgen.c.orig 2022-10-28 19:19:44.000000000 +0000
6 +++ putty-0.78/cmdgen.c 2022-11-02 21:26:32.194021545 +0000
8 BinarySource *infile_bs = NULL;
9 enum { NOKEYGEN, RSA1, RSA2, DSA, ECDSA, EDDSA } keytype = NOKEYGEN;
10 char *outfile = NULL, *outfiletmp = NULL;
11 - enum { PRIVATE, PUBLIC, PUBLICO, FP, OPENSSH_AUTO,
12 - OPENSSH_NEW, SSHCOM, TEXT, CERTINFO } outtype = PRIVATE;
13 + enum { PPRIVATE, PUBLIC, PUBLICO, FP, OPENSSH_AUTO,
14 + OPENSSH_NEW, SSHCOM, TEXT, CERTINFO } outtype = PPRIVATE;
16 const char *comment = NULL;
17 char *origcomment = NULL;
19 else if (!strcmp(p, "public-openssh"))
21 else if (!strcmp(p, "private"))
24 else if (!strcmp(p, "fingerprint"))
26 else if (!strcmp(p, "private-openssh"))
28 * We must save the private part when generating a new key.
30 if (keytype != NOKEYGEN &&
31 - (outtype != PRIVATE && outtype != OPENSSH_AUTO &&
32 + (outtype != PPRIVATE && outtype != OPENSSH_AUTO &&
33 outtype != OPENSSH_NEW && outtype != SSHCOM && outtype != TEXT)) {
34 fprintf(stderr, "puttygen: this would generate a new key but "
35 "discard the private part\n");
37 * Also in this code, we bomb out if the input and output file
38 * formats are the same and no other action is performed.
40 - if ((intype == SSH_KEYTYPE_SSH1 && outtype == PRIVATE) ||
41 - (intype == SSH_KEYTYPE_SSH2 && outtype == PRIVATE) ||
42 + if ((intype == SSH_KEYTYPE_SSH1 && outtype == PPRIVATE) ||
43 + (intype == SSH_KEYTYPE_SSH2 && outtype == PPRIVATE) ||
44 (intype == SSH_KEYTYPE_OPENSSH_PEM && outtype == OPENSSH_AUTO) ||
45 (intype == SSH_KEYTYPE_OPENSSH_NEW && outtype == OPENSSH_NEW) ||
46 (intype == SSH_KEYTYPE_SSHCOM && outtype == SSHCOM)) {
48 * Bomb out rather than automatically choosing to write
49 * a private key file to stdout.
51 - if (outtype == PRIVATE || outtype == OPENSSH_AUTO ||
52 + if (outtype == PPRIVATE || outtype == OPENSSH_AUTO ||
53 outtype == OPENSSH_NEW || outtype == SSHCOM) {
54 fprintf(stderr, "puttygen: need to specify an output file\n");
57 intype == SSH_KEYTYPE_SSH2_PUBLIC_RFC4716 ||
58 intype == SSH_KEYTYPE_SSH2_PUBLIC_OPENSSH);
59 bool outtype_has_private =
60 - outtype == PRIVATE || outtype == OPENSSH_AUTO ||
61 + outtype == PPRIVATE || outtype == OPENSSH_AUTO ||
62 outtype == OPENSSH_NEW || outtype == SSHCOM;
63 if (outtype_has_private || intype_entirely_encrypted ||
64 (outtype == TEXT && intype_has_private))
71 random_ref(); /* we'll need a few random bytes in the save file */