X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=crypt-gpgme.c;h=0c0bbf70f69ab6f5b2a30619b7c5b7c37ec3125e;hp=f22ca2d19f25381de76b1273c334558dc9fda545;hb=b3cb6ed8d36c550a2e589910ce51bbc8352ff57c;hpb=a8477ebaa09990b3688164cbe5cf661c4189541d diff --git a/crypt-gpgme.c b/crypt-gpgme.c index f22ca2d..0c0bbf7 100644 --- a/crypt-gpgme.c +++ b/crypt-gpgme.c @@ -18,13 +18,19 @@ #ifdef CRYPT_BACKEND_GPGME +#include + #include "mutt.h" #include "mutt_crypt.h" #include "mutt_menu.h" #include "mutt_curses.h" +#include "ascii.h" +#include "handler.h" +#include "enter.h" #include "mime.h" #include "copy.h" #include "pager.h" +#include "recvattach.h" #include "sort.h" #include "lib/mem.h" @@ -128,12 +134,10 @@ static void print_utf8 (FILE * fp, const char *buf, size_t len) { char *tstr; - tstr = safe_malloc (len + 1); - memcpy (tstr, buf, len); - tstr[len] = 0; + tstr = p_dupstr(buf, len); mutt_convert_string (&tstr, "utf-8", Charset, M_ICONV_HOOK_FROM); fputs (tstr, fp); - FREE (&tstr); + p_delete(&tstr); } @@ -208,11 +212,11 @@ static char crypt_flags (int flags) } /* Return a copy of KEY. */ -static crypt_key_t *crypt_copy_key (crypt_key_t * key) +static crypt_key_t *crypt_copy_key (crypt_key_t *key) { crypt_key_t *k; - k = safe_calloc (1, sizeof *k); + k = p_new(crypt_key_t, 1); k->kobj = key->kobj; gpgme_key_ref (key->kobj); k->idx = key->idx; @@ -229,7 +233,7 @@ static void crypt_free_key (crypt_key_t ** keylist) while (*keylist) { crypt_key_t *k = (*keylist)->next; - FREE (&k); + p_delete(&k); *keylist = k; } } @@ -550,13 +554,13 @@ static gpgme_key_t *create_recipient_set (const char *keylist, err = gpgme_get_key (context, buf, &key, 0); if (!err) { - safe_realloc (&rset, sizeof (*rset) * (rset_n + 1)); + mem_realloc (&rset, sizeof (*rset) * (rset_n + 1)); rset[rset_n++] = key; } else { mutt_error (_("error adding recipient `%s': %s\n"), buf, gpgme_strerror (err)); - FREE (&rset); + p_delete(&rset); return NULL; } } @@ -564,7 +568,7 @@ static gpgme_key_t *create_recipient_set (const char *keylist, } /* NULL terminate. */ - safe_realloc (&rset, sizeof (*rset) * (rset_n + 1)); + mem_realloc (&rset, sizeof (*rset) * (rset_n + 1)); rset[rset_n++] = NULL; if (context) @@ -832,13 +836,13 @@ BODY *pgp_gpgme_encrypt_message (BODY * a, char *keylist, int sign) convert_to_7bit (a); plaintext = body_to_data_object (a, 0); if (!plaintext) { - FREE (&rset); + p_delete(&rset); return NULL; } outfile = encrypt_gpgme_object (plaintext, rset, 0, sign); gpgme_data_release (plaintext); - FREE (&rset); + p_delete(&rset); if (!outfile) return NULL; @@ -890,13 +894,13 @@ BODY *smime_gpgme_build_smime_entity (BODY * a, char *keylist) plaintext = body_to_data_object (a, 0); if (!plaintext) { - FREE (&rset); + p_delete(&rset); return NULL; } outfile = encrypt_gpgme_object (plaintext, rset, 1, 0); gpgme_data_release (plaintext); - FREE (&rset); + p_delete(&rset); if (!outfile) return NULL; @@ -1030,7 +1034,7 @@ static void show_fingerprint (gpgme_key_t key, STATE * state) return; is_pgp = (key->protocol == GPGME_PROTOCOL_OpenPGP); - buf = safe_malloc (str_len (prefix) + str_len (s) * 4 + 2); + buf = xmalloc(str_len (prefix) + str_len (s) * 4 + 2); strcpy (buf, prefix); /* __STRCPY_CHECKED__ */ p = buf + str_len (buf); if (is_pgp && str_len (s) == 40) { /* PGP v4 style formatted. */ @@ -1060,7 +1064,7 @@ static void show_fingerprint (gpgme_key_t key, STATE * state) *p++ = '\n'; *p = 0; state_attach_puts (buf, state); - FREE (&buf); + p_delete(&buf); } /* Show the valididy of a key used for one signature. */ @@ -1531,7 +1535,7 @@ int smime_gpgme_decrypt_mime (FILE * fpin, FILE ** fpout, BODY * b, saved_b_length = b->length; memset (&s, 0, sizeof (s)); s.fpin = fpin; - fseek (s.fpin, b->offset, 0); + fseeko (s.fpin, b->offset, 0); mutt_mktemp (tempfile); if (!(tmpfp = safe_fopen (tempfile, "w+"))) { mutt_perror (tempfile); @@ -1542,7 +1546,7 @@ int smime_gpgme_decrypt_mime (FILE * fpin, FILE ** fpout, BODY * b, s.fpout = tmpfp; mutt_decode_attachment (b, &s); fflush (tmpfp); - b->length = ftell (s.fpout); + b->length = ftello (s.fpout); b->offset = 0; rewind (tmpfp); @@ -1583,7 +1587,7 @@ int smime_gpgme_decrypt_mime (FILE * fpin, FILE ** fpout, BODY * b, saved_b_length = bb->length; memset (&s, 0, sizeof (s)); s.fpin = *fpout; - fseek (s.fpin, bb->offset, 0); + fseeko (s.fpin, bb->offset, 0); mutt_mktemp (tempfile); if (!(tmpfp = safe_fopen (tempfile, "w+"))) { mutt_perror (tempfile); @@ -1594,7 +1598,7 @@ int smime_gpgme_decrypt_mime (FILE * fpin, FILE ** fpout, BODY * b, s.fpout = tmpfp; mutt_decode_attachment (bb, &s); fflush (tmpfp); - bb->length = ftell (s.fpout); + bb->length = ftello (s.fpout); bb->offset = 0; rewind (tmpfp); fclose (*fpout); @@ -1725,7 +1729,7 @@ static void copy_clearsigned (gpgme_data_t data, STATE * s, char *charset) if (!fname) return; unlink (fname); - FREE (&fname); + p_delete(&fname); fc = fgetconv_open (fp, charset, Charset, M_ICONV_HOOK_FROM); @@ -1762,16 +1766,17 @@ static void copy_clearsigned (gpgme_data_t data, STATE * s, char *charset) /* Support for classic_application/pgp */ -void pgp_gpgme_application_handler (BODY * m, STATE * s) +int pgp_gpgme_application_handler (BODY * m, STATE * s) { int needpass = -1, pgp_keyblock = 0; int clearsign = 0; long start_pos = 0; - long bytes, last_pos, offset; + long bytes; + off_t last_pos, offset; char buf[HUGE_STRING]; FILE *pgpout = NULL; - gpgme_error_t err; + gpgme_error_t err = 0; gpgme_data_t armored_data = NULL; short maybe_goodsig = 1; @@ -1787,14 +1792,14 @@ void pgp_gpgme_application_handler (BODY * m, STATE * s) if (!mutt_get_body_charset (body_charset, sizeof (body_charset), m)) strfcpy (body_charset, "iso-8859-1", sizeof body_charset); - fseek (s->fpin, m->offset, 0); + fseeko (s->fpin, m->offset, 0); last_pos = m->offset; for (bytes = m->length; bytes > 0;) { if (fgets (buf, sizeof (buf), s->fpin) == NULL) break; - offset = ftell (s->fpin); + offset = ftello (s->fpin); bytes -= (offset - last_pos); /* don't rely on str_len(buf) */ last_pos = offset; @@ -1827,7 +1832,7 @@ void pgp_gpgme_application_handler (BODY * m, STATE * s) armored_data = create_gpgme_data (); gpgme_data_write (armored_data, buf, str_len (buf)); while (bytes > 0 && fgets (buf, sizeof (buf) - 1, s->fpin) != NULL) { - offset = ftell (s->fpin); + offset = ftello (s->fpin); bytes -= (offset - last_pos); /* don't rely on str_len(buf) */ last_pos = offset; @@ -1917,7 +1922,7 @@ void pgp_gpgme_application_handler (BODY * m, STATE * s) } else { unlink (tmpfname); - FREE (&tmpfname); + p_delete(&tmpfname); } } gpgme_release (ctx); @@ -1982,9 +1987,10 @@ void pgp_gpgme_application_handler (BODY * m, STATE * s) if (needpass == -1) { state_attach_puts (_("[-- Error: could not find beginning" " of PGP message! --]\n\n"), s); - return; + return (-1); } debug_print (2, ("Leaving pgp_application_pgp handler\n")); + return (err); } /* @@ -1992,13 +1998,14 @@ void pgp_gpgme_application_handler (BODY * m, STATE * s) */ /* MIME handler for pgp/mime encrypted messages. */ -void pgp_gpgme_encrypted_handler (BODY * a, STATE * s) +int pgp_gpgme_encrypted_handler (BODY * a, STATE * s) { char tempfile[_POSIX_PATH_MAX]; FILE *fpout; BODY *tattach; BODY *orig_body = a; int is_signed; + int rc = 0; debug_print (2, ("Entering pgp_encrypted handler\n")); a = a->parts; @@ -2009,7 +2016,7 @@ void pgp_gpgme_encrypted_handler (BODY * a, STATE * s) if (s->flags & M_DISPLAY) state_attach_puts (_("[-- Error: malformed PGP/MIME message! --]\n\n"), s); - return; + return (-1); } /* Move forward to the application/pgp-encrypted body. */ @@ -2020,7 +2027,7 @@ void pgp_gpgme_encrypted_handler (BODY * a, STATE * s) if (s->flags & M_DISPLAY) state_attach_puts (_("[-- Error: could not create temporary file! " "--]\n"), s); - return; + return (-1); } tattach = decrypt_part (a, s, fpout, 0, &is_signed); @@ -2030,17 +2037,14 @@ void pgp_gpgme_encrypted_handler (BODY * a, STATE * s) if (s->flags & M_DISPLAY) state_attach_puts (is_signed ? _ - ("[-- The following data is PGP/MIME signed and encrypted --]\n\n") - : - _ - ("[-- The following data is PGP/MIME encrypted --]\n\n"), - s); + ("[-- The following data is PGP/MIME signed and encrypted --]\n\n") : + _("[-- The following data is PGP/MIME encrypted --]\n\n"), s); { FILE *savefp = s->fpin; s->fpin = fpout; - mutt_body_handler (tattach, s); + rc = mutt_body_handler (tattach, s); s->fpin = savefp; } @@ -2066,16 +2070,17 @@ void pgp_gpgme_encrypted_handler (BODY * a, STATE * s) fclose (fpout); mutt_unlink (tempfile); debug_print (2, ("Leaving pgp_encrypted handler\n")); + return (rc); } /* Support for application/smime */ -void smime_gpgme_application_handler (BODY * a, STATE * s) +int smime_gpgme_application_handler (BODY * a, STATE * s) { char tempfile[_POSIX_PATH_MAX]; FILE *fpout; BODY *tattach; int is_signed; - + int rc = 0; debug_print (2, ("Entering smime_encrypted handler\n")); @@ -2085,7 +2090,7 @@ void smime_gpgme_application_handler (BODY * a, STATE * s) if (s->flags & M_DISPLAY) state_attach_puts (_("[-- Error: could not create temporary file! " "--]\n"), s); - return; + return (-1); } tattach = decrypt_part (a, s, fpout, 1, &is_signed); @@ -2094,17 +2099,14 @@ void smime_gpgme_application_handler (BODY * a, STATE * s) if (s->flags & M_DISPLAY) state_attach_puts (is_signed ? - _("[-- The following data is S/MIME signed --]\n\n") - : - _ - ("[-- The following data is S/MIME encrypted --]\n\n"), - s); + _("[-- The following data is S/MIME signed --]\n\n") : + _("[-- The following data is S/MIME encrypted --]\n\n"), s); { FILE *savefp = s->fpin; s->fpin = fpout; - mutt_body_handler (tattach, s); + rc = mutt_body_handler (tattach, s); s->fpin = savefp; } @@ -2135,6 +2137,7 @@ void smime_gpgme_application_handler (BODY * a, STATE * s) fclose (fpout); mutt_unlink (tempfile); debug_print (2, ("Leaving smime_encrypted handler\n")); + return (rc); } @@ -2538,10 +2541,8 @@ static const unsigned char *parse_dn_part (struct dn_array_s *array, n = s - string; if (!n) return NULL; /* empty key */ - array->key = safe_malloc (n + 1); + array->key = p_dupstr(string, n ); p = (unsigned char *) array->key; - memcpy (p, string, n); /* fixme: trim trailing spaces */ - p[n] = 0; string = s + 1; if (*string == '#') { /* hexstring */ @@ -2552,7 +2553,7 @@ static const unsigned char *parse_dn_part (struct dn_array_s *array, if (!n || (n & 1)) return NULL; /* empty or odd number of digits */ n /= 2; - p = safe_malloc (n + 1); + p = xmalloc(n + 1); array->value = (char *) p; for (s1 = string; n; s1 += 2, n--) *p++ = xtoi_2 (s1); @@ -2582,7 +2583,7 @@ static const unsigned char *parse_dn_part (struct dn_array_s *array, n++; } - p = safe_malloc (n + 1); + p = xmalloc(n + 1); array->value = (char *) p; for (s = string; n; s++, n--) { if (*s == '\\') { @@ -2613,7 +2614,7 @@ static struct dn_array_s *parse_dn (const unsigned char *string) int i; arraysize = 7; /* C,ST,L,O,OU,CN,email */ - array = safe_malloc ((arraysize + 1) * sizeof *array); + array = p_new(struct dn_array_s, arraysize + 1); arrayidx = 0; while (*string) { while (*string == ' ') @@ -2624,12 +2625,12 @@ static struct dn_array_s *parse_dn (const unsigned char *string) struct dn_array_s *a2; arraysize += 5; - a2 = safe_malloc ((arraysize + 1) * sizeof *array); + a2 = p_new(struct dn_array_s, arraysize + 1); for (i = 0; i < arrayidx; i++) { a2[i].key = array[i].key; a2[i].value = array[i].value; } - FREE (&array); + p_delete(&array); array = a2; } array[arrayidx].key = NULL; @@ -2651,10 +2652,10 @@ static struct dn_array_s *parse_dn (const unsigned char *string) failure: for (i = 0; i < arrayidx; i++) { - FREE (&array[i].key); - FREE (&array[i].value); + p_delete(&array[i].key); + p_delete(&array[i].value); } - FREE (&array); + p_delete(&array); return NULL; } @@ -2685,10 +2686,10 @@ static void parse_and_print_user_id (FILE * fp, const char *userid) else { print_dn_parts (fp, dn); for (i = 0; dn[i].key; i++) { - FREE (&dn[i].key); - FREE (&dn[i].value); + p_delete(&dn[i].key); + p_delete(&dn[i].value); } - FREE (&dn); + p_delete(&dn); } } } @@ -2753,7 +2754,8 @@ static void print_key_info (gpgme_key_t key, FILE * fp) continue; s = uid->uid; - fprintf (fp, "%s ......: ", idx ? _(" aka") : _("Name")); + fputs (idx ? _(" aka ......: ") :_("Name ......: "), fp); + if (uid->invalid) { fputs (_("[Invalid]"), fp); putc (' ', fp); @@ -2774,7 +2776,7 @@ static void print_key_info (gpgme_key_t key, FILE * fp) #else strftime (shortbuf, sizeof shortbuf, "%c", tm); #endif - fprintf (fp, "Valid From : %s\n", shortbuf); + fprintf (fp, _("Valid From : %s\n"), shortbuf); } if (key->subkeys && (key->subkeys->expires > 0)) { @@ -2786,7 +2788,7 @@ static void print_key_info (gpgme_key_t key, FILE * fp) #else strftime (shortbuf, sizeof shortbuf, "%c", tm); #endif - fprintf (fp, "Valid To ..: %s\n", shortbuf); + fprintf (fp, _("Valid To ..: %s\n"), shortbuf); } if (key->subkeys) @@ -2799,22 +2801,22 @@ static void print_key_info (gpgme_key_t key, FILE * fp) if (key->subkeys) aval = key->subkeys->length; - fprintf (fp, "Key Type ..: %s, %lu bit %s\n", s2, aval, s); + fprintf (fp, _("Key Type ..: %s, %lu bit %s\n"), s2, aval, s); - fprintf (fp, "Key Usage .: "); + fprintf (fp, _("Key Usage .: ")); delim = ""; if (key_check_cap (key, KEY_CAP_CAN_ENCRYPT)) { fprintf (fp, "%s%s", delim, _("encryption")); - delim = ", "; + delim = _(", "); } if (key_check_cap (key, KEY_CAP_CAN_SIGN)) { fprintf (fp, "%s%s", delim, _("signing")); - delim = ", "; + delim = _(", "); } if (key_check_cap (key, KEY_CAP_CAN_CERTIFY)) { fprintf (fp, "%s%s", delim, _("certification")); - delim = ", "; + delim = _(", "); } putc ('\n', fp); @@ -2847,13 +2849,13 @@ static void print_key_info (gpgme_key_t key, FILE * fp) if (key->issuer_serial) { s = key->issuer_serial; if (s) - fprintf (fp, "Serial-No .: 0x%s\n", s); + fprintf (fp, _("Serial-No .: 0x%s\n"), s); } if (key->issuer_name) { s = key->issuer_name; if (s) { - fprintf (fp, "Issued By .: "); + fprintf (fp, _("Issued By .: ")); parse_and_print_user_id (fp, s); putc ('\n', fp); } @@ -2869,7 +2871,7 @@ static void print_key_info (gpgme_key_t key, FILE * fp) putc ('\n', fp); if (str_len (s) == 16) s += 8; /* display only the short keyID */ - fprintf (fp, "Subkey ....: 0x%s", s); + fprintf (fp, _("Subkey ....: 0x%s"), s); if (subkey->revoked) { putc (' ', fp); fputs (_("[Revoked]"), fp); @@ -2897,7 +2899,7 @@ static void print_key_info (gpgme_key_t key, FILE * fp) #else strftime (shortbuf, sizeof shortbuf, "%c", tm); #endif - fprintf (fp, "Valid From : %s\n", shortbuf); + fprintf (fp, _("Valid From : %s\n"), shortbuf); } if (subkey->expires > 0) { @@ -2909,7 +2911,7 @@ static void print_key_info (gpgme_key_t key, FILE * fp) #else strftime (shortbuf, sizeof shortbuf, "%c", tm); #endif - fprintf (fp, "Valid To ..: %s\n", shortbuf); + fprintf (fp, _("Valid To ..: %s\n"), shortbuf); } if (subkey) @@ -2922,22 +2924,22 @@ static void print_key_info (gpgme_key_t key, FILE * fp) else aval = 0; - fprintf (fp, "Key Type ..: %s, %lu bit %s\n", "PGP", aval, s); + fprintf (fp, _("Key Type ..: %s, %lu bit %s\n"), "PGP", aval, s); - fprintf (fp, "Key Usage .: "); + fprintf (fp, _("Key Usage .: ")); delim = ""; if (subkey->can_encrypt) { fprintf (fp, "%s%s", delim, _("encryption")); - delim = ", "; + delim = _(", "); } if (subkey->can_sign) { fprintf (fp, "%s%s", delim, _("signing")); - delim = ", "; + delim = _(", "); } if (subkey->can_certify) { fprintf (fp, "%s%s", delim, _("certification")); - delim = ", "; + delim = _(", "); } putc ('\n', fp); } @@ -3035,7 +3037,7 @@ static char *list_to_pattern (LIST * list) n++; /* delimiter or end of string */ } n++; /* make sure to allocate at least one byte */ - pattern = p = safe_calloc (1, n); + pattern = p = p_new(char, n); for (l = list; l; l = l->next) { s = l->data; if (*s) { @@ -3083,7 +3085,7 @@ static crypt_key_t *get_candidates (LIST * hints, unsigned int app, err = gpgme_new (&ctx); if (err) { mutt_error (_("gpgme_new failed: %s"), gpgme_strerror (err)); - FREE (&pattern); + p_delete(&pattern); return NULL; } @@ -3106,7 +3108,7 @@ static crypt_key_t *get_candidates (LIST * hints, unsigned int app, if (!n) goto no_pgphints; - patarr = safe_calloc (n + 1, sizeof *patarr); + patarr = p_new(char *, n + 1); for (l = hints, n = 0; l; l = l->next) { if (l->data && *l->data) patarr[n++] = str_dup (l->data); @@ -3114,12 +3116,12 @@ static crypt_key_t *get_candidates (LIST * hints, unsigned int app, patarr[n] = NULL; err = gpgme_op_keylist_ext_start (ctx, (const char **) patarr, secret, 0); for (n = 0; patarr[n]; n++) - FREE (&patarr[n]); - FREE (&patarr); + p_delete(&patarr[n]); + p_delete(&patarr); if (err) { mutt_error (_("gpgme_op_keylist_start failed: %s"), gpgme_strerror (err)); gpgme_release (ctx); - FREE (&pattern); + p_delete(&pattern); return NULL; } @@ -3152,7 +3154,7 @@ static crypt_key_t *get_candidates (LIST * hints, unsigned int app, #endif /* DISABLED code */ for (idx = 0, uid = key->uids; uid; idx++, uid = uid->next) { - k = safe_calloc (1, sizeof *k); + k = p_new(crypt_key_t, 1); k->kobj = key; k->idx = idx; k->uid = uid->uid; @@ -3175,7 +3177,7 @@ static crypt_key_t *get_candidates (LIST * hints, unsigned int app, if (err) { mutt_error (_("gpgme_op_keylist_start failed: %s"), gpgme_strerror (err)); gpgme_release (ctx); - FREE (&pattern); + p_delete(&pattern); return NULL; } @@ -3188,7 +3190,7 @@ static crypt_key_t *get_candidates (LIST * hints, unsigned int app, flags |= KEYFLAG_CANSIGN; for (idx = 0, uid = key->uids; uid; idx++, uid = uid->next) { - k = safe_calloc (1, sizeof *k); + k = p_new(crypt_key_t, 1); k->kobj = key; k->idx = idx; k->uid = uid->uid; @@ -3203,7 +3205,7 @@ static crypt_key_t *get_candidates (LIST * hints, unsigned int app, } gpgme_release (ctx); - FREE (&pattern); + p_delete(&pattern); return db; } @@ -3223,7 +3225,7 @@ static LIST *crypt_add_string_to_hints (LIST * hints, const char *str) hints = mutt_add_list (hints, t); } - FREE (&scratch); + p_delete(&scratch); return hints; } @@ -3257,7 +3259,7 @@ static crypt_key_t *crypt_select_key (crypt_key_t * keys, if (i == keymax) { keymax += 20; - safe_realloc (&key_table, sizeof (crypt_key_t *) * keymax); + mem_realloc (&key_table, sizeof (crypt_key_t *) * keymax); } key_table[i++] = k; @@ -3415,7 +3417,7 @@ static crypt_key_t *crypt_select_key (crypt_key_t * keys, } mutt_menuDestroy (&menu); - FREE (&key_table); + p_delete(&key_table); set_option (OPTNEEDREDRAW); @@ -3636,7 +3638,7 @@ static crypt_key_t *crypt_ask_for_key (char *tag, if (l) str_replace (&l->dflt, resp); else { - l = safe_malloc (sizeof (struct crypt_cache)); + l = p_new(struct crypt_cache, 1); l->next = id_defaults; id_defaults = l; l->what = str_dup (whatfor); @@ -3727,7 +3729,7 @@ static char *find_keys (ADDRESS * to, ADDRESS * cc, ADDRESS * bcc, } } else if (r == -1) { - FREE (&keylist); + p_delete(&keylist); rfc822_free_address (&tmp); rfc822_free_address (&addr); return NULL; @@ -3746,7 +3748,7 @@ static char *find_keys (ADDRESS * to, ADDRESS * cc, ADDRESS * bcc, app, #endif &forced_valid)) == NULL) { - FREE (&keylist); + p_delete(&keylist); rfc822_free_address (&tmp); rfc822_free_address (&addr); return NULL; @@ -3766,7 +3768,7 @@ static char *find_keys (ADDRESS * to, ADDRESS * cc, ADDRESS * bcc, #endif keylist_size += str_len (s) + 4 + 1; - safe_realloc (&keylist, keylist_size); + mem_realloc (&keylist, keylist_size); sprintf (keylist + keylist_used, "%s0x%s%s", /* __SPRINTF_CHECKED__ */ keylist_used ? " " : "", s, forced_valid ? "!" : ""); }