1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-02 22:46:30 +02:00

common: Change argument order of log_printhex.

* common/logging.c (log_printhex): Chnage order of args.  Make it
printf alike.  Change all callers.
* configure.ac: Add -Wno-format-zero-length
--

This makes it consistent with modern libgpgrt logging and thus eases
back porting from newer GnuPG versions which use libgpgrt logging.

Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
Werner Koch 2020-05-12 18:51:47 +02:00
parent aec7d136e4
commit c6324ee07a
No known key found for this signature in database
GPG key ID: E3FDFF218E45B72B
26 changed files with 84 additions and 76 deletions

View file

@ -475,7 +475,7 @@ dump_reader_status (int slot)
if (reader_table[slot].atrlen)
{
log_info ("slot %d: ATR=", slot);
log_printhex ("", reader_table[slot].atr, reader_table[slot].atrlen);
log_printhex (reader_table[slot].atr, reader_table[slot].atrlen, "");
}
}
@ -739,7 +739,7 @@ pcsc_send_apdu (int slot, unsigned char *apdu, size_t apdulen,
return err;
if (DBG_CARD_IO)
log_printhex (" PCSC_data:", apdu, apdulen);
log_printhex (apdu, apdulen, " PCSC_data:");
if ((reader_table[slot].pcsc.protocol & PCSC_PROTOCOL_T1))
send_pci.protocol = PCSC_PROTOCOL_T1;
@ -1453,7 +1453,7 @@ send_apdu_ccid (int slot, unsigned char *apdu, size_t apdulen,
return err;
if (DBG_CARD_IO)
log_printhex (" raw apdu:", apdu, apdulen);
log_printhex (apdu, apdulen, " raw apdu:");
maxbuflen = *buflen;
if (pininfo)
@ -1723,7 +1723,7 @@ my_rapdu_send_apdu (int slot, unsigned char *apdu, size_t apdulen,
*buflen = 0;
if (DBG_CARD_IO)
log_printhex (" APDU_data:", apdu, apdulen);
log_printhex (apdu, apdulen, " APDU_data:");
if (apdulen < 4)
{
@ -2879,7 +2879,7 @@ send_le (int slot, int class, int ins, int p0, int p1,
log_debug (" response: sw=%04X datalen=%d\n",
sw, (unsigned int)resultlen);
if ( !retbuf && (sw == SW_SUCCESS || (sw & 0xff00) == SW_MORE_DATA))
log_printhex (" dump: ", result, resultlen);
log_printhex (result, resultlen, " dump: ");
}
if (sw == SW_SUCCESS || sw == SW_EOF_REACHED)
@ -2952,7 +2952,7 @@ send_le (int slot, int class, int ins, int p0, int p1,
log_debug (" more: sw=%04X datalen=%d\n",
sw, (unsigned int)resultlen);
if (!retbuf && (sw==SW_SUCCESS || (sw&0xff00)==SW_MORE_DATA))
log_printhex (" dump: ", result, resultlen);
log_printhex (result, resultlen, " dump: ");
}
if ((sw & 0xff00) == SW_MORE_DATA
@ -2998,7 +2998,7 @@ send_le (int slot, int class, int ins, int p0, int p1,
xfree (result_buffer);
if (DBG_CARD_IO && retbuf && sw == SW_SUCCESS)
log_printhex (" dump: ", *retbuf, *retbuflen);
log_printhex (*retbuf, *retbuflen, " dump: ");
return sw;
}
@ -3164,7 +3164,7 @@ apdu_send_direct (int slot, size_t extended_length,
log_debug (" response: sw=%04X datalen=%d\n",
sw, (unsigned int)resultlen);
if ( !retbuf && (sw == SW_SUCCESS || (sw & 0xff00) == SW_MORE_DATA))
log_printhex (" dump: ", result, resultlen);
log_printhex (result, resultlen, " dump: ");
}
if (handle_more && (sw & 0xff00) == SW_MORE_DATA)
@ -3220,7 +3220,7 @@ apdu_send_direct (int slot, size_t extended_length,
log_debug (" more: sw=%04X datalen=%d\n",
sw, (unsigned int)resultlen);
if (!retbuf && (sw==SW_SUCCESS || (sw&0xff00)==SW_MORE_DATA))
log_printhex (" dump: ", result, resultlen);
log_printhex (result, resultlen, " dump: ");
}
if ((sw & 0xff00) == SW_MORE_DATA
@ -3292,7 +3292,7 @@ apdu_send_direct (int slot, size_t extended_length,
*r_sw = sw;
if (DBG_CARD_IO && retbuf)
log_printhex (" dump: ", *retbuf, *retbuflen);
log_printhex (*retbuf, *retbuflen, " dump: ");
return 0;

View file

@ -608,7 +608,7 @@ dump_all_do (int slot)
if (data_objects[i].binary)
{
log_info ("DO '%s': ", data_objects[i].desc);
log_printhex ("", buffer, buflen);
log_printhex (buffer, buflen, "");
}
else
log_info ("DO '%s': '%.*s'\n",
@ -638,7 +638,7 @@ dump_all_do (int slot)
if (valuelen > 200)
log_info ("[%u]\n", (unsigned int)valuelen);
else
log_printhex ("", value, valuelen);
log_printhex (value, valuelen, "");
}
else
log_info ("DO '%s': '%.*s'\n",
@ -5206,7 +5206,7 @@ parse_algorithm_attribute (app_t app, int keyno)
curve = ecc_curve (buffer + 1, oidlen);
if (!curve)
log_printhex ("Curve with OID not supported: ", buffer+1, buflen-1);
log_printhex (buffer+1, buflen-1, "Curve with OID not supported: ");
else
{
app->app_local->keyattr[keyno].key_type = KEY_TYPE_ECC;
@ -5224,7 +5224,7 @@ parse_algorithm_attribute (app_t app, int keyno)
}
}
else if (opt.verbose)
log_printhex ("", buffer, buflen);
log_printhex (buffer, buflen, "");
xfree (relptr);
}
@ -5266,7 +5266,7 @@ app_select_openpgp (app_t app)
if (opt.verbose)
{
log_info ("AID: ");
log_printhex ("", buffer, buflen);
log_printhex (buffer, buflen, "");
}
app->card_version = buffer[6] << 8;
@ -5299,7 +5299,7 @@ app_select_openpgp (app_t app)
if (opt.verbose)
{
log_info ("Historical Bytes: ");
log_printhex ("", buffer, buflen);
log_printhex (buffer, buflen, "");
}
parse_historical (app->app_local, buffer, buflen);
xfree (relptr);

View file

@ -744,7 +744,7 @@ read_ef_odf (app_t app, unsigned short odf_fid)
}
else
{
log_printhex ("p15: ODF format not supported:", p, buflen);
log_printhex (p, buflen, "p15: ODF format not supported:");
xfree (buffer);
return gpg_error (GPG_ERR_INV_OBJ);
}
@ -799,7 +799,7 @@ read_ef_odf (app_t app, unsigned short odf_fid)
if (n < buflen)
{
log_info ("p15: warning: garbage detected at end of ODF: ");
log_printhex ("", p, buflen);
log_printhex (p, buflen, "");
}
}
@ -2463,7 +2463,7 @@ read_ef_tokeninfo (app_t app)
{
/* (We use a separate log_info to avoid the "DBG:" prefix.) */
log_info ("p15: serialNumber .: ");
log_printhex ("", p, objlen);
log_printhex (p, objlen, "");
}
p += objlen;
n -= objlen;
@ -3192,7 +3192,7 @@ micardo_mse (app_t app, unsigned short fid)
if (opt.verbose)
{
log_info (buffer, buflen, "p15: keyD record: ");
log_printhex ("", buffer, buflen);
log_printhex (buffer, buflen, "");
}
p = find_tlv (buffer, buflen, 0x83, &n);
if (p && n == 4 && ((p[2]<<8)|p[3]) == fid)