Fix compiler warnings at creation of CRL cache filenames.
This was not really a problem because ptr is the first member of a chunk_t and it contains a null-terminated string at that point. But it's clearer this way.
This commit is contained in:
@@ -280,7 +280,7 @@ static void cache_cert(private_stroke_cred_t *this, certificate_t *cert)
|
|||||||
|
|
||||||
chunk = crl->get_authKeyIdentifier(crl);
|
chunk = crl->get_authKeyIdentifier(crl);
|
||||||
hex = chunk_to_hex(chunk, NULL, FALSE);
|
hex = chunk_to_hex(chunk, NULL, FALSE);
|
||||||
snprintf(buf, sizeof(buf), "%s/%s.crl", CRL_DIR, hex);
|
snprintf(buf, sizeof(buf), "%s/%s.crl", CRL_DIR, hex.ptr);
|
||||||
free(hex.ptr);
|
free(hex.ptr);
|
||||||
|
|
||||||
if (cert->get_encoding(cert, CERT_ASN1_DER, &chunk))
|
if (cert->get_encoding(cert, CERT_ASN1_DER, &chunk))
|
||||||
|
|||||||
+2
-2
@@ -163,7 +163,7 @@ bool insert_crl(x509crl_t *x509crl, char *crl_uri, bool cache_crl)
|
|||||||
{
|
{
|
||||||
/* keep any known CRL distribution points */
|
/* keep any known CRL distribution points */
|
||||||
add_distribution_points(x509crl->distributionPoints,
|
add_distribution_points(x509crl->distributionPoints,
|
||||||
oldcrl->distributionPoints);
|
oldcrl->distributionPoints);
|
||||||
|
|
||||||
/* now delete the old CRL */
|
/* now delete the old CRL */
|
||||||
free_first_crl();
|
free_first_crl();
|
||||||
@@ -199,7 +199,7 @@ bool insert_crl(x509crl_t *x509crl, char *crl_uri, bool cache_crl)
|
|||||||
chunk_t hex, encoding;
|
chunk_t hex, encoding;
|
||||||
|
|
||||||
hex = chunk_to_hex(crl->get_authKeyIdentifier(crl), NULL, FALSE);
|
hex = chunk_to_hex(crl->get_authKeyIdentifier(crl), NULL, FALSE);
|
||||||
snprintf(buf, sizeof(buf), "%s/%s.crl", CRL_PATH, hex);
|
snprintf(buf, sizeof(buf), "%s/%s.crl", CRL_PATH, hex.ptr);
|
||||||
free(hex.ptr);
|
free(hex.ptr);
|
||||||
|
|
||||||
if (cert_crl->get_encoding(cert_crl, CERT_ASN1_DER, &encoding))
|
if (cert_crl->get_encoding(cert_crl, CERT_ASN1_DER, &encoding))
|
||||||
|
|||||||
Reference in New Issue
Block a user