chiark / gitweb /
Backgrounded commands and RELOAD.
[tripe] / keymgmt.c
index e1388e04c26b501319253518bd0fcaf5478bd7af..c7199e566cb4bfc6f7a8acb88ea137fe7e9a1333 100644 (file)
--- a/keymgmt.c
+++ b/keymgmt.c
@@ -316,7 +316,7 @@ static int loadpriv(dstr *d)
 {
   key_file kf;
   key *k;
-  key_data *kd;
+  key_data **kd;
   dstr t = DSTR_INIT;
   group *g = 0;
   mp *x = 0;
@@ -353,7 +353,7 @@ tymatch:;
 
   /* --- Load the key --- */
 
-  if ((e = (*ko)->loadpriv(kd, &g, &x, &t)) != 0) {
+  if ((e = (*ko)->loadpriv(*kd, &g, &x, &t)) != 0) {
     dstr_putf(d, "error reading private key `%s': %s", t.buf, e);
     goto done_1;
   }
@@ -450,16 +450,16 @@ static int loadpub(dstr *d)
   return (0);
 }
 
-/* --- @km_interval@ --- *
+/* --- @km_reload@ --- *
  *
  * Arguments:  ---
  *
  * Returns:    Zero if OK, nonzero to force reloading of keys.
  *
- * Use:                Called on the interval timer to perform various useful jobs.
+ * Use:                Checks the keyrings to see if they need reloading.
  */
 
-int km_interval(void)
+int km_reload(void)
 {
   dstr d = DSTR_INIT;
   key_file *kf;
@@ -546,7 +546,7 @@ void km_init(const char *priv, const char *pub, const char *tag)
 int km_getpubkey(const char *tag, ge *kpub, time_t *t_exp)
 {
   key *k;
-  key_data *kd;
+  key_data **kd;
   dstr t = DSTR_INIT;
   const kgops **ko;
   const char *e;
@@ -574,7 +574,7 @@ tymatch:;
 
   /* --- Load the key --- */
 
-  if ((e = (*ko)->loadpub(kd, &g, &p, &t)) != 0) {
+  if ((e = (*ko)->loadpub(*kd, &g, &p, &t)) != 0) {
     a_warn("KEYMGMT public-key %s bad -- %s", t.buf, e);
     goto done;
   }