scepclient: Avoid name conflict with global PKCS#7 chunk
authorTobias Brunner <tobias@strongswan.org>
Tue, 28 Jan 2020 10:33:31 +0000 (11:33 +0100)
committerTobias Brunner <tobias@strongswan.org>
Tue, 28 Jan 2020 14:32:43 +0000 (15:32 +0100)
Use the same name as further down below in the file.

Fixes: 04ff78aa33b1 ("scepclient: Store received RA certificates, using CA cert name as base.")

src/scepclient/scepclient.c

index bf526e5..ecbd1b7 100644 (file)
@@ -959,7 +959,7 @@ int main(int argc, char **argv)
        {
                char ca_path[PATH_MAX];
                container_t *container;
-               pkcs7_t *pkcs7;
+               pkcs7_t *p7;
 
                if (!scep_http_request(scep_url, chunk_create(ca_name, strlen(ca_name)),
                                                           SCEP_GET_CA_CERT, http_get_request,
@@ -970,10 +970,10 @@ int main(int argc, char **argv)
 
                join_paths(ca_path, sizeof(ca_path), CA_CERT_PATH, file_out_ca_cert);
 
-               pkcs7 = lib->creds->create(lib->creds, CRED_CONTAINER, CONTAINER_PKCS7,
+               p7 = lib->creds->create(lib->creds, CRED_CONTAINER, CONTAINER_PKCS7,
                                                                BUILD_BLOB_ASN1_DER, scep_response, BUILD_END);
 
-               if (!pkcs7)
+               if (!p7)
                {       /* no PKCS#7 encoded CA+RA certificates, assume simple CA cert */
 
                        DBG1(DBG_APP, "unable to parse PKCS#7, assuming plain CA cert");
@@ -990,7 +990,7 @@ int main(int argc, char **argv)
                        int ra_certs = 0, ca_certs = 0;
                        int ra_index = 1, ca_index = 1;
 
-                       enumerator = pkcs7->create_cert_enumerator(pkcs7);
+                       enumerator = p7->create_cert_enumerator(p7);
                        while (enumerator->enumerate(enumerator, &cert))
                        {
                                x509_t *x509 = (x509_t*)cert;
@@ -1005,7 +1005,7 @@ int main(int argc, char **argv)
                        }
                        enumerator->destroy(enumerator);
 
-                       enumerator = pkcs7->create_cert_enumerator(pkcs7);
+                       enumerator = p7->create_cert_enumerator(p7);
                        while (enumerator->enumerate(enumerator, &cert))
                        {
                                x509_t *x509 = (x509_t*)cert;
@@ -1042,7 +1042,7 @@ int main(int argc, char **argv)
                                chunk_free(&encoding);
                        }
                        enumerator->destroy(enumerator);
-                       container = &pkcs7->container;
+                       container = &p7->container;
                        container->destroy(container);
                }
                exit_scepclient(NULL); /* no further output required */