[rs-commit] r59 - in /mod_ca/trunk: mod_ca.c mod_ca_crl.c mod_ca_disk.c mod_ca_ldap.c mod_ca_simple.c
rs-commit at redwax.eu
rs-commit at redwax.eu
Wed Aug 28 23:40:38 CEST 2019
Author: minfrin at redwax.eu
Date: Wed Aug 28 23:40:37 2019
New Revision: 59
Log:
Tabs to spaces.
Modified:
mod_ca/trunk/mod_ca.c
mod_ca/trunk/mod_ca_crl.c
mod_ca/trunk/mod_ca_disk.c
mod_ca/trunk/mod_ca_ldap.c
mod_ca/trunk/mod_ca_simple.c
Modified: mod_ca/trunk/mod_ca.c
==============================================================================
--- mod_ca/trunk/mod_ca.c (original)
+++ mod_ca/trunk/mod_ca.c Wed Aug 28 23:40:37 2019
@@ -28,17 +28,17 @@
APR_HOOK_STRUCT(
APR_HOOK_LINK(ca_reqauthz)
- APR_HOOK_LINK(ca_certstore)
- APR_HOOK_LINK(ca_sign)
- APR_HOOK_LINK(ca_getca)
- APR_HOOK_LINK(ca_getnextca)
- APR_HOOK_LINK(ca_getchain)
- APR_HOOK_LINK(ca_getcrl)
- APR_HOOK_LINK(ca_getcertstatus)
- APR_HOOK_LINK(ca_getcert)
- APR_HOOK_LINK(ca_makeserial)
- APR_HOOK_LINK(ca_makekey)
- APR_HOOK_LINK(ca_gettime))
+ APR_HOOK_LINK(ca_certstore)
+ APR_HOOK_LINK(ca_sign)
+ APR_HOOK_LINK(ca_getca)
+ APR_HOOK_LINK(ca_getnextca)
+ APR_HOOK_LINK(ca_getchain)
+ APR_HOOK_LINK(ca_getcrl)
+ APR_HOOK_LINK(ca_getcertstatus)
+ APR_HOOK_LINK(ca_getcert)
+ APR_HOOK_LINK(ca_makeserial)
+ APR_HOOK_LINK(ca_makekey)
+ APR_HOOK_LINK(ca_gettime))
APR_IMPLEMENT_EXTERNAL_HOOK_RUN_FIRST(ap, CA, int, ca_reqauthz,
(request_rec *r, apr_hash_t *params, const unsigned char *buffer, apr_size_t len),
Modified: mod_ca/trunk/mod_ca_crl.c
==============================================================================
--- mod_ca/trunk/mod_ca_crl.c (original)
+++ mod_ca/trunk/mod_ca_crl.c Wed Aug 28 23:40:37 2019
@@ -391,11 +391,11 @@
X509_REVOKED *r = sk_X509_REVOKED_value(revoked, i);
if (r) {
#if HAVE_X509_REVOKED_GET0_SERIALNUMBER
- ca_asn1_t *serial = make_ASN1_INTEGER(cmd->pool, X509_REVOKED_get0_serialNumber(r));
+ ca_asn1_t *serial = make_ASN1_INTEGER(cmd->pool, X509_REVOKED_get0_serialNumber(r));
#else
- ca_asn1_t *serial = make_ASN1_INTEGER(cmd->pool, r->serialNumber);
+ ca_asn1_t *serial = make_ASN1_INTEGER(cmd->pool, r->serialNumber);
#endif
- if (serial) {
+ if (serial) {
apr_hash_set(conf->crl_index, serial->val, serial->len, r);
}
}
Modified: mod_ca/trunk/mod_ca_disk.c
==============================================================================
--- mod_ca/trunk/mod_ca_disk.c (original)
+++ mod_ca/trunk/mod_ca_disk.c Wed Aug 28 23:40:37 2019
@@ -534,13 +534,13 @@
ASN1_STRING *s = parse_ASN1_STRING(r->pool, transaction_id);
if (s) {
#if HAVE_ASN1_STRING_GET0_DATA
- key = apr_pstrcat(r->pool,
+ key = apr_pstrcat(r->pool,
apr_pstrndup(r->pool,
- (const char *) ASN1_STRING_get0_data(s),
+ (const char *) ASN1_STRING_get0_data(s),
ASN1_STRING_length(s)), ".",
conf->transaction_path_suffix, NULL);
#else
- key = apr_pstrcat(r->pool,
+ key = apr_pstrcat(r->pool,
apr_pstrndup(r->pool,
(const char *) ASN1_STRING_data(s),
ASN1_STRING_length(s)), ".",
Modified: mod_ca/trunk/mod_ca_ldap.c
==============================================================================
--- mod_ca/trunk/mod_ca_ldap.c (original)
+++ mod_ca/trunk/mod_ca_ldap.c Wed Aug 28 23:40:37 2019
@@ -376,23 +376,23 @@
return HTTP_FORBIDDEN;
}
- str = X509_ATTRIBUTE_get0_data(challenge, 0, V_ASN1_UTF8STRING, NULL);
- if (!str) {
- str = X509_ATTRIBUTE_get0_data(challenge, 0, V_ASN1_IA5STRING, NULL);
- if (!str) {
- str = X509_ATTRIBUTE_get0_data(challenge, 0, V_ASN1_PRINTABLESTRING,
- NULL);
- if (!str) {
- ASN1_TYPE *asn1 = X509_ATTRIBUTE_get0_type(challenge, 0);
- log_message(r, APR_SUCCESS,
- apr_psprintf(r->pool,
- "challenge included in certificate request was not V_ASN1_UTF8STRING, V_ASN1_IA5STRING, or V_ASN1_PRINTABLESTRING (%d instead)",
- asn1->type));
-
- return HTTP_FORBIDDEN;
- }
- }
- }
+ str = X509_ATTRIBUTE_get0_data(challenge, 0, V_ASN1_UTF8STRING, NULL);
+ if (!str) {
+ str = X509_ATTRIBUTE_get0_data(challenge, 0, V_ASN1_IA5STRING, NULL);
+ if (!str) {
+ str = X509_ATTRIBUTE_get0_data(challenge, 0, V_ASN1_PRINTABLESTRING,
+ NULL);
+ if (!str) {
+ ASN1_TYPE *asn1 = X509_ATTRIBUTE_get0_type(challenge, 0);
+ log_message(r, APR_SUCCESS,
+ apr_psprintf(r->pool,
+ "challenge included in certificate request was not V_ASN1_UTF8STRING, V_ASN1_IA5STRING, or V_ASN1_PRINTABLESTRING (%d instead)",
+ asn1->type));
+
+ return HTTP_FORBIDDEN;
+ }
+ }
+ }
len = ASN1_STRING_to_UTF8(&buf, str);
userPassword = apr_pstrndup(r->pool, (const char *) buf, len);
if (!userPassword || !*userPassword) {
@@ -480,7 +480,7 @@
val = X509_NAME_ENTRY_get_data(tne);
if (V_ASN1_PRINTABLESTRING == val->type
|| V_ASN1_IA5STRING == val->type
- || V_ASN1_UTF8STRING == val->type) {
+ || V_ASN1_UTF8STRING == val->type) {
filter = apr_pstrcat(r->pool, filter, "(",
conf->attributes[i], "=",
escape_ldap(r->pool,
Modified: mod_ca/trunk/mod_ca_simple.c
==============================================================================
--- mod_ca/trunk/mod_ca_simple.c (original)
+++ mod_ca/trunk/mod_ca_simple.c Wed Aug 28 23:40:37 2019
@@ -157,13 +157,13 @@
static apr_status_t ca_EVP_PKEY_cleanup(void *data)
{
- EVP_PKEY_free((EVP_PKEY *) data);
+ EVP_PKEY_free((EVP_PKEY *) data);
return APR_SUCCESS;
}
static apr_status_t ca_EVP_PKEY_CTX_cleanup(void *data)
{
- EVP_PKEY_CTX_free((EVP_PKEY_CTX *) data);
+ EVP_PKEY_CTX_free((EVP_PKEY_CTX *) data);
return APR_SUCCESS;
}
@@ -254,7 +254,7 @@
int ca_simple_sign(request_rec *r, apr_hash_t *params,
const unsigned char **buffer, apr_size_t *len)
{
- X509V3_CTX ext_ctx;
+ X509V3_CTX ext_ctx;
X509 *cert = NULL;
X509_REQ *creq = NULL;
EVP_PKEY *pktmp = NULL;
@@ -399,29 +399,29 @@
return HTTP_INTERNAL_SERVER_ERROR;
}
- X509V3_set_ctx(&ext_ctx, conf->signer, cert, NULL, NULL, 0);
- for (iter = apr_hash_first(r->pool, conf->ext); iter;
- iter = apr_hash_next(iter)) {
- const char *name, *val;
-
- name = apr_hash_this_key(iter);
- val = apr_hash_this_val(iter);
-
- X509_EXTENSION *extension = X509V3_EXT_conf(NULL, &ext_ctx,
- (char *) name, (char *) val);
- if (!extension) {
- log_message(r, APR_SUCCESS,
- apr_psprintf(r->pool,
- "extension '%s' could not be set to '%s'", name,
- val));
-
- return HTTP_INTERNAL_SERVER_ERROR;
- }
- apr_pool_cleanup_register(r->pool, extension, ca_X509_EXTENSION_cleanup,
- apr_pool_cleanup_null);
-
- X509_add_ext(cert, extension, -1);
- }
+ X509V3_set_ctx(&ext_ctx, conf->signer, cert, NULL, NULL, 0);
+ for (iter = apr_hash_first(r->pool, conf->ext); iter;
+ iter = apr_hash_next(iter)) {
+ const char *name, *val;
+
+ name = apr_hash_this_key(iter);
+ val = apr_hash_this_val(iter);
+
+ X509_EXTENSION *extension = X509V3_EXT_conf(NULL, &ext_ctx,
+ (char *) name, (char *) val);
+ if (!extension) {
+ log_message(r, APR_SUCCESS,
+ apr_psprintf(r->pool,
+ "extension '%s' could not be set to '%s'", name,
+ val));
+
+ return HTTP_INTERNAL_SERVER_ERROR;
+ }
+ apr_pool_cleanup_register(r->pool, extension, ca_X509_EXTENSION_cleanup,
+ apr_pool_cleanup_null);
+
+ X509_add_ext(cert, extension, -1);
+ }
if (!X509_sign(cert, conf->key, EVP_sha256())) {
log_message(r, APR_SUCCESS, "could not sign the request");
@@ -870,7 +870,7 @@
new->ext =
(add->ext_set == 0) ?
base->ext : apr_hash_overlay(p, add->ext, base->ext);
- new->ext_set = add->ext_set || base->ext_set;
+ new->ext_set = add->ext_set || base->ext_set;
new->pkey_ctx = (add->pkey_ctx_set == 0) ? base->pkey_ctx : add->pkey_ctx;
new->pkey_ctx_set = add->pkey_ctx_set || base->pkey_ctx_set;
@@ -1136,27 +1136,27 @@
apr_pool_cleanup_null);
if (EVP_PKEY_keygen_init(conf->pkey_ctx) <= 0) {
- return log_config(cmd,
- apr_psprintf(cmd->pool,
- "CASimpleAlgorithm '%s': EVP_PKEY keygen could not be initialised", arg));
+ return log_config(cmd,
+ apr_psprintf(cmd->pool,
+ "CASimpleAlgorithm '%s': EVP_PKEY keygen could not be initialised", arg));
}
while ((arg = apr_strtok(NULL,",", &tok))) {
- char *val = strchr(arg, '=');
- if (val) {
- *(val++) = 0;
- }
- else {
- return log_config(cmd,
- apr_psprintf(cmd->pool,
- "CASimpleAlgorithm parameter '%s' must be a name=value pair", arg));
- }
-
- if (EVP_PKEY_CTX_ctrl_str(conf->pkey_ctx, arg, val) <= 0) {
- return log_config(cmd,
- apr_psprintf(cmd->pool,
- "CASimpleAlgorithm parameter '%s' cannot be set to '%s'", arg, val));
- }
+ char *val = strchr(arg, '=');
+ if (val) {
+ *(val++) = 0;
+ }
+ else {
+ return log_config(cmd,
+ apr_psprintf(cmd->pool,
+ "CASimpleAlgorithm parameter '%s' must be a name=value pair", arg));
+ }
+
+ if (EVP_PKEY_CTX_ctrl_str(conf->pkey_ctx, arg, val) <= 0) {
+ return log_config(cmd,
+ apr_psprintf(cmd->pool,
+ "CASimpleAlgorithm parameter '%s' cannot be set to '%s'", arg, val));
+ }
}
@@ -1174,18 +1174,18 @@
pbio = BIO_new_file(arg, "r");
if (!pbio) {
- return log_config(cmd,
- apr_psprintf(cmd->pool,
- "CASimpleParamFile '%s': Can't open parameter file", arg));
+ return log_config(cmd,
+ apr_psprintf(cmd->pool,
+ "CASimpleParamFile '%s': Can't open parameter file", arg));
}
pkey = PEM_read_bio_Parameters(pbio, NULL);
BIO_free(pbio);
if (!pkey) {
- return log_config(cmd,
- apr_psprintf(cmd->pool,
- "CASimpleParamFile '%s': Error reading parameter file", arg));
+ return log_config(cmd,
+ apr_psprintf(cmd->pool,
+ "CASimpleParamFile '%s': Error reading parameter file", arg));
}
conf->pkey_ctx = EVP_PKEY_CTX_new(pkey, NULL);
@@ -1201,9 +1201,9 @@
apr_pool_cleanup_null);
if (EVP_PKEY_keygen_init(conf->pkey_ctx) <= 0) {
- return log_config(cmd,
- apr_psprintf(cmd->pool,
- "CASimpleParamFile '%s': EVP_PKEY keygen could not be initialised", arg));
+ return log_config(cmd,
+ apr_psprintf(cmd->pool,
+ "CASimpleParamFile '%s': EVP_PKEY keygen could not be initialised", arg));
}
conf->pkey_ctx_set = 1;
@@ -1237,12 +1237,12 @@
AP_INIT_TAKE2("CASimpleExtension",
set_ca_extension, NULL, RSRC_CONF | ACCESS_CONF,
"Certificate extension to add to the certificate when signed."),
- AP_INIT_RAW_ARGS("CASimpleAlgorithm",
- set_ca_algorithm, NULL, RSRC_CONF | ACCESS_CONF,
- "When enabled, private keys will be generated with this algorithm."),
- AP_INIT_TAKE1("CASimpleParamFile",
- set_ca_paramfile, NULL, RSRC_CONF | ACCESS_CONF,
- "When enabled, private keys will be generated with this parameter file."),
+ AP_INIT_RAW_ARGS("CASimpleAlgorithm",
+ set_ca_algorithm, NULL, RSRC_CONF | ACCESS_CONF,
+ "When enabled, private keys will be generated with this algorithm."),
+ AP_INIT_TAKE1("CASimpleParamFile",
+ set_ca_paramfile, NULL, RSRC_CONF | ACCESS_CONF,
+ "When enabled, private keys will be generated with this parameter file."),
{ NULL }
};
More information about the rs-commit
mailing list