1 From c6abf7976f64be5191dc80fecdbcb07daab7a2e0 Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Nguy=E1=BB=85n=20H=E1=BB=93ng=20Qu=C3=A2n?=
3 <ng.hong.quan@gmail.com>
4 Date: Sun, 3 Nov 2013 01:45:56 +0800
5 Subject: [PATCH 19/26] OpenPGP: Make indentation consistent (space -> tab).
8 src/libopensc/card-openpgp.c | 22 ++++++++---------
9 src/tools/openpgp-tool.c | 56 ++++++++++++++++++++++----------------------
10 2 files changed, 39 insertions(+), 39 deletions(-)
12 diff --git a/src/libopensc/card-openpgp.c b/src/libopensc/card-openpgp.c
13 index 037ef73..ae40940 100644
14 --- a/src/libopensc/card-openpgp.c
15 +++ b/src/libopensc/card-openpgp.c
16 @@ -192,12 +192,12 @@ static struct do_info pgp1_objects[] = { /* OpenPGP card spec 1.1 */
17 { 0x5f35, SIMPLE, READ_ALWAYS | WRITE_PIN3, NULL, sc_put_data },
18 { 0x5f50, SIMPLE, READ_ALWAYS | WRITE_PIN3, sc_get_data, sc_put_data },
19 { 0x7f49, CONSTRUCTED, READ_ALWAYS | WRITE_NEVER, NULL, NULL },
20 - { 0xa400, CONSTRUCTED, READ_ALWAYS | WRITE_NEVER, pgp_get_pubkey, NULL },
21 - { 0xa401, SIMPLE, READ_ALWAYS | WRITE_PIN3, pgp_get_pubkey_pem, NULL },
22 - { 0xb600, CONSTRUCTED, READ_ALWAYS | WRITE_NEVER, pgp_get_pubkey, NULL },
23 - { 0xb601, SIMPLE, READ_ALWAYS | WRITE_PIN3, pgp_get_pubkey_pem, NULL },
24 - { 0xb800, CONSTRUCTED, READ_ALWAYS | WRITE_NEVER, pgp_get_pubkey, NULL },
25 - { 0xb801, SIMPLE, READ_ALWAYS | WRITE_PIN3, pgp_get_pubkey_pem, NULL },
26 + { 0xa400, CONSTRUCTED, READ_ALWAYS | WRITE_NEVER, pgp_get_pubkey, NULL },
27 + { 0xa401, SIMPLE, READ_ALWAYS | WRITE_PIN3, pgp_get_pubkey_pem, NULL },
28 + { 0xb600, CONSTRUCTED, READ_ALWAYS | WRITE_NEVER, pgp_get_pubkey, NULL },
29 + { 0xb601, SIMPLE, READ_ALWAYS | WRITE_PIN3, pgp_get_pubkey_pem, NULL },
30 + { 0xb800, CONSTRUCTED, READ_ALWAYS | WRITE_NEVER, pgp_get_pubkey, NULL },
31 + { 0xb801, SIMPLE, READ_ALWAYS | WRITE_PIN3, pgp_get_pubkey_pem, NULL },
32 { 0, 0, 0, NULL, NULL },
35 @@ -253,11 +253,11 @@ static struct do_info pgp2_objects[] = { /* OpenPGP card spec 2.0 */
36 /* The 0xA401, 0xB601, 0xB801 are just symbolic, it does not represent any real DO.
37 * However, their R/W access condition may block the process of importing key in pkcs15init.
38 * So we set their accesses condition as WRITE_PIN3 (writable). */
39 - { 0xa401, SIMPLE, READ_ALWAYS | WRITE_PIN3, pgp_get_pubkey_pem, NULL },
40 - { 0xb600, CONSTRUCTED, READ_ALWAYS | WRITE_NEVER, pgp_get_pubkey, NULL },
41 - { 0xb601, SIMPLE, READ_ALWAYS | WRITE_PIN3, pgp_get_pubkey_pem, NULL },
42 - { 0xb800, CONSTRUCTED, READ_ALWAYS | WRITE_NEVER, pgp_get_pubkey, NULL },
43 - { 0xb801, SIMPLE, READ_ALWAYS | WRITE_PIN3, pgp_get_pubkey_pem, NULL },
44 + { 0xa401, SIMPLE, READ_ALWAYS | WRITE_PIN3, pgp_get_pubkey_pem, NULL },
45 + { 0xb600, CONSTRUCTED, READ_ALWAYS | WRITE_NEVER, pgp_get_pubkey, NULL },
46 + { 0xb601, SIMPLE, READ_ALWAYS | WRITE_PIN3, pgp_get_pubkey_pem, NULL },
47 + { 0xb800, CONSTRUCTED, READ_ALWAYS | WRITE_NEVER, pgp_get_pubkey, NULL },
48 + { 0xb801, SIMPLE, READ_ALWAYS | WRITE_PIN3, pgp_get_pubkey_pem, NULL },
49 { 0, 0, 0, NULL, NULL },
52 diff --git a/src/tools/openpgp-tool.c b/src/tools/openpgp-tool.c
53 index 374819a..a0334ca 100644
54 --- a/src/tools/openpgp-tool.c
55 +++ b/src/tools/openpgp-tool.c
58 #include "libopensc/log.h"
61 -#define OPT_PRETTY 257
62 -#define OPT_VERIFY 258
64 -#define OPT_DELKEY 260
66 +#define OPT_PRETTY 257
67 +#define OPT_VERIFY 258
69 +#define OPT_DELKEY 260
71 /* define structures */
73 @@ -142,10 +142,10 @@ static const struct ef_name_map openpgp_data[] = {
74 static void show_version(void)
77 - "openpgp-tool - OpenPGP card utility version " PACKAGE_VERSION "\n"
79 - "Copyright (c) 2012 Peter Marschall <peter@adpm.de>\n"
80 - "Licensed under LGPL v2\n");
81 + "openpgp-tool - OpenPGP card utility version " PACKAGE_VERSION "\n"
83 + "Copyright (c) 2012 Peter Marschall <peter@adpm.de>\n"
84 + "Licensed under LGPL v2\n");
88 @@ -176,16 +176,16 @@ static char *prettify_language(char *str)
91 switch (strlen(str)) {
92 - case 8: memmove(str+7, str+6, 1+strlen(str+6));
93 + case 8: memmove(str+7, str+6, 1+strlen(str+6));
96 - case 6: memmove(str+5, str+4, 1+strlen(str+4));
97 + case 6: memmove(str+5, str+4, 1+strlen(str+4));
100 - case 4: memmove(str+3, str+2, 1+strlen(str+2));
101 + case 4: memmove(str+3, str+2, 1+strlen(str+2));
104 - case 2: return str;
105 + case 2: return str;
109 @@ -197,10 +197,10 @@ static char *prettify_gender(char *str)
113 - case '0': return "unknown";
114 - case '1': return "male";
115 - case '2': return "female";
116 - case '9': return "not applicable";
117 + case '0': return "unknown";
118 + case '1': return "male";
119 + case '2': return "female";
120 + case '9': return "not applicable";
124 @@ -218,7 +218,7 @@ static void display_data(const struct ef_name_map *mapping, char *value)
127 envvar = malloc(strlen(mapping->env_name) +
128 - strlen(value) + 2);
129 + strlen(value) + 2);
130 if (envvar != NULL) {
131 strcpy(envvar, mapping->env_name);
133 @@ -346,20 +346,20 @@ static int do_userinfo(sc_card_t *card)
137 - if (count > (int)sizeof(buf) - 1) {
138 + if (count > (int)sizeof(buf) - 1) {
139 fprintf(stderr, "Too small buffer to read the OpenPGP data\n");
143 - r = sc_read_binary(card, 0, buf, count, 0);
146 + r = sc_read_binary(card, 0, buf, count, 0);
148 fprintf(stderr, "%s: read failed - %s\n", openpgp_data[i].ef, sc_strerror(r));
152 - fprintf(stderr, "%s: expecting %d, got only %d bytes\n", openpgp_data[i].ef, count, r);
155 + fprintf(stderr, "%s: expecting %d, got only %d bytes\n", openpgp_data[i].ef, count, r);
162 @@ -628,7 +628,7 @@ int main(int argc, char **argv)
163 r = sc_context_create(&ctx, &ctx_param);
165 util_fatal("failed to establish context: %s\n",
171 @@ -640,7 +640,7 @@ int main(int argc, char **argv)
172 r = util_connect_card(ctx, &card, opt_reader, opt_wait, verbose);
174 util_fatal("failed to connect to card: %s\n",