Keytrust values in GPA (patch)

Miguel Coca e970095@zipi.fi.upm.es
Mon Jul 16 19:56:01 2001


--DKU6Jbt7q3WqK7+M
Content-Type: multipart/mixed; boundary="Nq2Wo0NMKNjxTN9z"
Content-Disposition: inline


--Nq2Wo0NMKNjxTN9z
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

        Hello,

        A while back, when using GPA, I noticed that some key trust values
were given as "unknown" when that was not the case.

        I think it could be particularly confusing that the user's own keys
("ultimately trusted" in gpg) are marked as "unknown" by GPA. This also
affects expired, revoked and invalid keys.

        I have written this (trivial) patch that fixes this and makes GPA
provide a correct key trust string for each possible value gpg returns (as
far as I know).

        To keep things simple for the new user, however, if the program is
run in simplified_ui mode all values are mapped to the "trust fully", "trust
marginally", "don't trust", "unknown" ones used so far.

        Hope this helps,

        PS. This is the first time I send a patch to such a project, so feel
free to contact me if there is anything wrong with it.
--=20
Miguel Coca                                            e970095@zipi.fi.upm.=
es
PGP Key 0x27FC3CA8                            http://zipi.fi.upm.es/~e97009=
5/

--Nq2Wo0NMKNjxTN9z
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=gpa-keytrust-patch
Content-Transfer-Encoding: quoted-printable

Index: gpapa/gpapapublickey.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /cvs/gpa/gpa/gpapa/gpapapublickey.c,v
retrieving revision 1.21
diff -r1.21 gpapapublickey.c
79a80,89

> case 'u':
> return (GPAPA_KEYTRUST_ULTIMATE);
> case 'r':
> return (GPAPA_KEYTRUST_REVOKED);
> case 'e':
> return (GPAPA_KEYTRUST_EXPIRED);
> case 'i':
> return (GPAPA_KEYTRUST_INVALID);
> case 'd':
> return (GPAPA_KEYTRUST_DISABLED);
Index: gpapa/gpapapublickey.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvs/gpa/gpa/gpapa/gpapapublickey.h,v retrieving revision 1.11 diff -r1.11 gpapapublickey.h 61c61,66 < GPAPA_KEYTRUST_FULLY ---
> GPAPA_KEYTRUST_FULLY,
> GPAPA_KEYTRUST_ULTIMATE,
> GPAPA_KEYTRUST_REVOKED,
> GPAPA_KEYTRUST_EXPIRED,
> GPAPA_KEYTRUST_INVALID,
> GPAPA_KEYTRUST_DISABLED
66c71 < #define GPAPA_KEYTRUST_LAST GPAPA_KEYTRUST_FULLY ---
> #define GPAPA_KEYTRUST_LAST GPAPA_KEYTRUST_DISABLED
Index: src/gpapastrings.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvs/gpa/gpa/src/gpapastrings.c,v retrieving revision 1.6 diff -r1.6 gpapastrings.c 31c31 < static gchar *keytrust_strings[4] =3D { ---
> static gchar *keytrust_strings_simplified[] =3D {
35c35,52 < N_("trust fully") ---
> N_("trust fully"),
> N_("trust fully"),
> N_("don't trust"),
> N_("don't trust"),
> N_("don't trust"),
> N_("don't trust")
> };
>=20
> static gchar *keytrust_strings_advanced[] =3D {
> N_("unknown"),
> N_("don't trust"),
> N_("trust marginally"),
> N_("trust fully"),
> N_("trust ultimately"),
> N_("revoked"),
> N_("expired"),
> N_("invalid"),
> N_("disabled")
41c58,61 < return _(keytrust_strings[keytrust]); ---
> if( gpa_simplified_ui () )
> return _(keytrust_strings_simplified[keytrust]);
> else
> return _(keytrust_strings_advanced[keytrust]);
--Nq2Wo0NMKNjxTN9z-- --DKU6Jbt7q3WqK7+M Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE7UyrUjE3Htif8PKgRAsXWAJ9E0AZpZvcltlknoV6r37QaAHT0JwCfa6IS mfsLjxsdqPPnSSLQK57oNvY= =DhMo -----END PGP SIGNATURE----- --DKU6Jbt7q3WqK7+M--