aboutsummaryrefslogtreecommitdiffstats
path: root/src/pki
diff options
context:
space:
mode:
authorTobias Brunner <tobias@strongswan.org>2017-05-12 12:10:27 +0200
committerTobias Brunner <tobias@strongswan.org>2017-05-26 13:56:44 +0200
commit525cc46cabe3dbf17d9f63e76ea9aa974d3665fa (patch)
tree33c09810e1c86a943c9bbca05ad35900d086362b /src/pki
parent95a63bf2813cd6ecad912237688526bbcc3481ee (diff)
downloadstrongswan-525cc46cabe3dbf17d9f63e76ea9aa974d3665fa.tar.bz2
strongswan-525cc46cabe3dbf17d9f63e76ea9aa974d3665fa.tar.xz
Change interface for enumerator_create_filter() callback
This avoids the unportable 5 pointer hack, but requires enumerating in the callback.
Diffstat (limited to 'src/pki')
-rw-r--r--src/pki/commands/signcrl.c28
1 files changed, 18 insertions, 10 deletions
diff --git a/src/pki/commands/signcrl.c b/src/pki/commands/signcrl.c
index 6bccf1b09..25a3aac52 100644
--- a/src/pki/commands/signcrl.c
+++ b/src/pki/commands/signcrl.c
@@ -61,16 +61,24 @@ static void revoked_destroy(revoked_t *revoked)
free(revoked);
}
-/**
- * Filter for revoked enumerator
- */
-static bool filter(void *data, revoked_t **revoked, chunk_t *serial, void *p2,
- time_t *date, void *p3, crl_reason_t *reason)
+CALLBACK(filter, bool,
+ void *data, enumerator_t *orig, va_list args)
{
- *serial = (*revoked)->serial;
- *date = (*revoked)->date;
- *reason = (*revoked)->reason;
- return TRUE;
+ revoked_t *revoked;
+ crl_reason_t *reason;
+ chunk_t *serial;
+ time_t *date;
+
+ VA_ARGS_VGET(args, serial, date, reason);
+
+ if (orig->enumerate(orig, &revoked))
+ {
+ *serial = revoked->serial;
+ *date = revoked->date;
+ *reason = revoked->reason;
+ return TRUE;
+ }
+ return FALSE;
}
/**
@@ -392,7 +400,7 @@ static int sign_crl()
chunk_increment(crl_serial);
enumerator = enumerator_create_filter(list->create_enumerator(list),
- (void*)filter, NULL, NULL);
+ filter, NULL, NULL);
crl = lib->creds->create(lib->creds, CRED_CERTIFICATE, CERT_X509_CRL,
BUILD_SIGNING_KEY, private, BUILD_SIGNING_CERT, ca,
BUILD_SERIAL, crl_serial,