[rs-commit] r307 - /mod_scep/trunk/mod_scep.c

rs-commit at redwax.eu rs-commit at redwax.eu
Tue Feb 25 00:36:50 CET 2020


Author: minfrin at redwax.eu
Date: Tue Feb 25 00:36:48 2020
New Revision: 307

Log:
p7 is a more accorate variable name.

Modified:
    mod_scep/trunk/mod_scep.c

Modified: mod_scep/trunk/mod_scep.c
==============================================================================
--- mod_scep/trunk/mod_scep.c	(original)
+++ mod_scep/trunk/mod_scep.c	Tue Feb 25 00:36:48 2020
@@ -1104,7 +1104,7 @@
     apr_size_t len;
     apr_off_t offset;
 
-    PKCS7 *p7s = NULL;
+    PKCS7 *p7 = NULL;
     BIO *b;
     X509 *cert = NULL;
     X509_STORE_CTX *ctx;
@@ -1123,20 +1123,20 @@
     ap_set_content_type(r, "application/x-x509-ca-ra-cert");
 
     /* create a new signed data PKCS#7 */
-    p7s = PKCS7_new();
-    if (!p7s) {
+    p7 = PKCS7_new();
+    if (!p7) {
         log_message(r, APR_SUCCESS,
                 "could not create a PKCS7 degenerate response");
 
         return HTTP_INTERNAL_SERVER_ERROR;
     }
     else {
-        apr_pool_cleanup_register(r->pool, p7s, scep_PKCS7_cleanup,
+        apr_pool_cleanup_register(r->pool, p7, scep_PKCS7_cleanup,
                 apr_pool_cleanup_null);
     }
 
-    PKCS7_set_type(p7s, NID_pkcs7_signed);
-    PKCS7_content_new(p7s, NID_pkcs7_data);
+    PKCS7_set_type(p7, NID_pkcs7_signed);
+    PKCS7_content_new(p7, NID_pkcs7_data);
 
     /* get the CA certificate */
     rv = ap_run_ca_getca(r, &der, &len, &validity);
@@ -1159,13 +1159,13 @@
     apr_pool_cleanup_register(r->pool, cert, scep_X509_cleanup,
             apr_pool_cleanup_null);
 
-    if (!PKCS7_add_certificate(p7s, cert)) {
+    if (!PKCS7_add_certificate(p7, cert)) {
         log_message(r, APR_SUCCESS,
                 "could not add the CA certificate to the degenerate PKCS7 response");
 
         return HTTP_INTERNAL_SERVER_ERROR;
     }
-    if (!PKCS7_add_certificate(p7s, conf->signer)) {
+    if (!PKCS7_add_certificate(p7, conf->signer)) {
         log_message(r, APR_SUCCESS,
                 "could not add the RA certificate to the degenerate PKCS7 response");
 
@@ -1221,7 +1221,7 @@
     apr_pool_cleanup_register(r->pool, b, scep_BIO_cleanup,
             apr_pool_cleanup_null);
 
-    i2d_PKCS7_bio(b, p7s);
+    i2d_PKCS7_bio(b, p7);
 
     apr_sha1_init(&sha1);
     while ((offset = BIO_read(b, buf, sizeof(buf))) > 0) {
@@ -1305,7 +1305,7 @@
     apr_size_t len;
     apr_off_t offset;
 
-    PKCS7 *p7s = NULL;
+    PKCS7 *p7 = NULL;
     PKCS7_SIGNER_INFO *si;
     BIO *b;
     X509 *next_cert = NULL;
@@ -1348,19 +1348,19 @@
     ap_set_content_type(r, "application/x-x509-next-ca-cert");
 
     /* create a new signed data PKCS#7                              */
-    p7s = PKCS7_new();
-    if (!p7s) {
+    p7 = PKCS7_new();
+    if (!p7) {
         log_message(r, APR_SUCCESS,
                 "could not create a PKCS7 degenerate response");
 
         return HTTP_INTERNAL_SERVER_ERROR;
     }
     else {
-        apr_pool_cleanup_register(r->pool, p7s, scep_PKCS7_cleanup,
+        apr_pool_cleanup_register(r->pool, p7, scep_PKCS7_cleanup,
                 apr_pool_cleanup_null);
     }
-    PKCS7_set_type(p7s, NID_pkcs7_signed);
-    PKCS7_content_new(p7s, NID_pkcs7_data);
+    PKCS7_set_type(p7, NID_pkcs7_signed);
+    PKCS7_content_new(p7, NID_pkcs7_data);
 
     tmp = der;
     if (!d2i_X509(&next_cert, &tmp, len)) {
@@ -1372,20 +1372,20 @@
     apr_pool_cleanup_register(r->pool, next_cert, scep_X509_cleanup,
             apr_pool_cleanup_null);
 
-    if (!PKCS7_add_certificate(p7s, next_cert)) {
+    if (!PKCS7_add_certificate(p7, next_cert)) {
         log_message(r, APR_SUCCESS,
                 "could not add the next CA certificate to the degenerate PKCS7 response");
 
         return HTTP_INTERNAL_SERVER_ERROR;
     }
-    if (!PKCS7_add_certificate(p7s, conf->next_signer)) {
+    if (!PKCS7_add_certificate(p7, conf->next_signer)) {
         log_message(r, APR_SUCCESS,
                 "could not add the next RA certificate to the degenerate PKCS7 response");
 
         return HTTP_INTERNAL_SERVER_ERROR;
     }
 
-    si = PKCS7_add_signature(p7s, conf->signer, conf->key, EVP_sha256());
+    si = PKCS7_add_signature(p7, conf->signer, conf->key, EVP_sha256());
     if (!si) {
         log_message(r, APR_SUCCESS,
                 "could not add the signature to the signed PKCS7 response");
@@ -1442,7 +1442,7 @@
     apr_pool_cleanup_register(r->pool, b, scep_BIO_cleanup,
             apr_pool_cleanup_null);
 
-    i2d_PKCS7_bio(b, p7s);
+    i2d_PKCS7_bio(b, p7);
 
     apr_sha1_init(&sha1);
     while ((offset = BIO_read(b, buf, sizeof(buf))) > 0) {
@@ -1565,7 +1565,7 @@
     int len; /* len must be signed */
     apr_off_t offset;
 
-    PKCS7 *p7s = NULL;
+    PKCS7 *p7 = NULL;
     PKCS7_SIGNER_INFO *si;
     STACK_OF(X509_ATTRIBUTE) *sattrs;
     BIO *p7bio, *b;
@@ -1579,18 +1579,18 @@
             &scep_module);
 
     /* create a new signed data PKCS#7                              */
-    p7s = PKCS7_new();
-    if (!p7s) {
+    p7 = PKCS7_new();
+    if (!p7) {
         log_message(r, APR_SUCCESS, "could not create a PKCS7 signed response");
 
         return HTTP_BAD_REQUEST;
     }
     else {
-        apr_pool_cleanup_register(r->pool, p7s, scep_PKCS7_cleanup,
+        apr_pool_cleanup_register(r->pool, p7, scep_PKCS7_cleanup,
                 apr_pool_cleanup_null);
     }
-    PKCS7_set_type(p7s, NID_pkcs7_signed);
-    PKCS7_content_new(p7s, NID_pkcs7_data);
+    PKCS7_set_type(p7, NID_pkcs7_signed);
+    PKCS7_content_new(p7, NID_pkcs7_data);
 
     /* if a successful CertRep, return the certificate chain */
 //    if (rscep->messageType == SCEP_MESSAGETYPE_CERTREP
@@ -1609,7 +1609,7 @@
 //        }
 //    }
 
-    si = PKCS7_add_signature(p7s, conf->signer, conf->key, EVP_sha256());
+    si = PKCS7_add_signature(p7, conf->signer, conf->key, EVP_sha256());
     if (!si) {
         log_message(r, APR_SUCCESS,
                 "could not add the signature to the signed PKCS7 response");
@@ -1617,7 +1617,7 @@
         return HTTP_BAD_REQUEST;
     }
 
-    p7bio = PKCS7_dataInit(p7s, NULL);
+    p7bio = PKCS7_dataInit(p7, NULL);
     if (!p7bio) {
         log_message(r, APR_SUCCESS,
                 "could not PKCS7_dataInit in the signed PKCS7 response");
@@ -1651,7 +1651,7 @@
     PKCS7_add_signed_attribute(si, NID_pkcs9_contentType, V_ASN1_OBJECT,
             OBJ_nid2obj(NID_pkcs7_data));
 
-    if (!PKCS7_dataFinal(p7s, p7bio)) {
+    if (!PKCS7_dataFinal(p7, p7bio)) {
         log_message(r, APR_SUCCESS,
                 "could not PKCS7_dataFinal in the signed PKCS7 response");
 
@@ -1666,7 +1666,7 @@
     b = BIO_new(BIO_s_mem());
     apr_pool_cleanup_register(r->pool, b, scep_BIO_cleanup,
             apr_pool_cleanup_null);
-    i2d_PKCS7_bio(b, p7s);
+    i2d_PKCS7_bio(b, p7);
     if (!BIO_flush(b)) {
         log_message(r, APR_SUCCESS,
                 "could not BIO_flush the signed PKCS7 response");



More information about the rs-commit mailing list