X509: Use unique debug prints for unused bits entries

This makes it easier to understand which X.509 BIT STRING value has the
unused bits.

Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
Jouni Malinen 2020-04-05 19:59:47 +03:00
parent 63ccec5433
commit eac6eb7024

View File

@ -264,7 +264,8 @@ static int x509_parse_public_key(const u8 *buf, size_t len,
return -1; return -1;
pos = hdr.payload; pos = hdr.payload;
if (*pos) { if (*pos) {
wpa_printf(MSG_DEBUG, "X509: BITSTRING - %d unused bits", wpa_printf(MSG_DEBUG,
"X509: BITSTRING (subjectPublicKey) - %d unused bits",
*pos); *pos);
/* /*
* TODO: should this be rejected? X.509 certificates are * TODO: should this be rejected? X.509 certificates are
@ -1851,7 +1852,8 @@ struct x509_certificate * x509_certificate_parse(const u8 *buf, size_t len)
} }
pos = hdr.payload; pos = hdr.payload;
if (*pos) { if (*pos) {
wpa_printf(MSG_DEBUG, "X509: BITSTRING - %d unused bits", wpa_printf(MSG_DEBUG,
"X509: BITSTRING (signatureValue) - %d unused bits",
*pos); *pos);
/* PKCS #1 v1.5 10.2.1: /* PKCS #1 v1.5 10.2.1:
* It is an error if the length in bits of the signature S is * It is an error if the length in bits of the signature S is