shared-macros.mk: fix GNU_CPU
[oi-userland.git] / components / network / putty / patches / 02-cmdgen.patch
blob442c30091d0d759a64c83839bdf62d97614352db
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
7 @@ -240,8 +240,8 @@
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;
15 int bits = -1;
16 const char *comment = NULL;
17 char *origcomment = NULL;
18 @@ -591,7 +591,7 @@
19 else if (!strcmp(p, "public-openssh"))
20 outtype = PUBLICO;
21 else if (!strcmp(p, "private"))
22 - outtype = PRIVATE;
23 + outtype = PPRIVATE;
24 else if (!strcmp(p, "fingerprint"))
25 outtype = FP;
26 else if (!strcmp(p, "private-openssh"))
27 @@ -742,7 +742,7 @@
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");
36 @@ -819,8 +819,8 @@
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)) {
47 @@ -841,7 +841,7 @@
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");
55 RETURN(1);
56 @@ -866,7 +866,7 @@
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))
65 @@ -1314,7 +1314,7 @@
66 bool ret;
67 int real_outtype;
69 - case PRIVATE:
70 + case PPRIVATE:
71 random_ref(); /* we'll need a few random bytes in the save file */
72 if (sshver == 1) {
73 assert(ssh1key);