[rs-commit] r50 - in /mod_ca/trunk: ChangeLog mod_ca.c mod_ca.h

rs-commit at redwax.eu rs-commit at redwax.eu
Sun Apr 21 11:50:46 CEST 2019


Author: minfrin at redwax.eu
Date: Sun Apr 21 11:50:45 2019
New Revision: 50

Log:
Add the ca_makekey hook.

Modified:
    mod_ca/trunk/ChangeLog
    mod_ca/trunk/mod_ca.c
    mod_ca/trunk/mod_ca.h

Modified: mod_ca/trunk/ChangeLog
==============================================================================
--- mod_ca/trunk/ChangeLog	(original)
+++ mod_ca/trunk/ChangeLog	Sun Apr 21 11:50:45 2019
@@ -1,5 +1,7 @@
 
 Changes with v0.2.0
+
+ *) Add the ca_makekey hook. [Graham Leggett]
 
  *) Allow the challengePassword to be a UTF8 string. [Graham Leggett]
 

Modified: mod_ca/trunk/mod_ca.c
==============================================================================
--- mod_ca/trunk/mod_ca.c	(original)
+++ mod_ca/trunk/mod_ca.c	Sun Apr 21 11:50:45 2019
@@ -27,7 +27,18 @@
 module AP_MODULE_DECLARE_DATA ca_module;
 
 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_gettime))
+        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_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),
@@ -59,6 +70,9 @@
 APR_IMPLEMENT_EXTERNAL_HOOK_RUN_FIRST(ap, CA, int, ca_makeserial,
         (request_rec *r, apr_hash_t *params, const unsigned char **serial, apr_size_t *len),
         (r, params, serial, len), DECLINED);
+APR_IMPLEMENT_EXTERNAL_HOOK_RUN_FIRST(ap, CA, int, ca_makekey,
+        (request_rec *r, apr_hash_t *params, const unsigned char **key, apr_size_t *len),
+        (r, params, key, len), DECLINED);
 APR_IMPLEMENT_EXTERNAL_HOOK_RUN_FIRST(ap, CA, int, ca_gettime,
         (request_rec *r, apr_time_t *time, apr_interval_time_t *as, apr_interval_time_t *ams, apr_interval_time_t *amicro),
         (r, time, as, ams, amicro), DECLINED);

Modified: mod_ca/trunk/mod_ca.h
==============================================================================
--- mod_ca/trunk/mod_ca.h	(original)
+++ mod_ca/trunk/mod_ca.h	Sun Apr 21 11:50:45 2019
@@ -283,6 +283,22 @@
         (request_rec *r, apr_hash_t *params, const unsigned char **serial, apr_size_t *len));
 
 /**
+ * Create a private key.
+ *
+ * The private key is returned as a DER encoded PKCS8 structure.
+ *
+ * @param r The request.
+ * @param params Hash containing parameters.
+ * @param key Pointer to the DER encoded PKCS8 private key will be returned
+ * at this location, allocated from the request pool.
+ * @param len The size of the returned DER encoded PKCS8 private key
+ * will be written to this location on return.
+ * @return OK on success, HTTP return code on failure.
+ */
+APR_DECLARE_EXTERNAL_HOOK(ap, CA, int, ca_makekey,
+        (request_rec *r, apr_hash_t *params, const unsigned char **key, apr_size_t *len));
+
+/**
  * Get the current time for timestamping or certificate signing.
  *
  * Return a DER encoded ASN1 generalizedTime representing the current time for the



More information about the rs-commit mailing list