diff options
author | Martin Willi <martin@strongswan.org> | 2006-10-18 11:46:13 +0000 |
---|---|---|
committer | Martin Willi <martin@strongswan.org> | 2006-10-18 11:46:13 +0000 |
commit | 60356f3375da67375e48691bb1d732c02d1681a1 (patch) | |
tree | 1bfa3bd28d46c4211a17a831094e7fcbceea8bb6 /src/libstrongswan/crypto/certinfo.c | |
parent | 8cdce67afa4bc4b4ff1a05e956db08cddc5dc48e (diff) | |
download | strongswan-60356f3375da67375e48691bb1d732c02d1681a1.tar.bz2 strongswan-60356f3375da67375e48691bb1d732c02d1681a1.tar.xz |
introduced new logging subsystem using bus:
passive listeners can register on the bus
active listeners wait for signals actively
multiplexing allows multiple listeners to receive debug signals
a lot more...
Diffstat (limited to 'src/libstrongswan/crypto/certinfo.c')
-rw-r--r-- | src/libstrongswan/crypto/certinfo.c | 30 |
1 files changed, 9 insertions, 21 deletions
diff --git a/src/libstrongswan/crypto/certinfo.c b/src/libstrongswan/crypto/certinfo.c index a289d6562..20a695753 100644 --- a/src/libstrongswan/crypto/certinfo.c +++ b/src/libstrongswan/crypto/certinfo.c @@ -69,24 +69,15 @@ struct private_certinfo_t { crl_reason_t revocationReason; }; -/** - * RFC 2560 OCSP - certificate status - */ -static const char *const cert_status_name[] = { +ENUM(cert_status_names, CERT_GOOD, CERT_UNTRUSTED, "good", "revoked", "unknown", "unknown", - "untrusted" - }; - -enum_names cert_status_names = - { CERT_GOOD, CERT_UNTRUSTED, cert_status_name, NULL}; + "untrusted", +); -/** - * RFC 2459 CRL reason codes - */ -static const char *const crl_reason_name[] = { +ENUM(crl_reason_names, REASON_UNSPECIFIED, REASON_REMOVE_FROM_CRL, "unspecified", "key compromise", "ca compromise", @@ -95,11 +86,8 @@ static const char *const crl_reason_name[] = { "cessation of operation", "certificate hold", "reason #7", - "remove from crl" - }; - -enum_names crl_reason_names = - { REASON_UNSPECIFIED, REASON_REMOVE_FROM_CRL, crl_reason_name, NULL}; + "remove from crl", +); /** * Implements certinfo_t.get_serialNumber @@ -168,9 +156,9 @@ static void set_revocationReason(private_certinfo_t *this, crl_reason_t reason) /** * Implements certinfo_t.get_revocationReason */ -static const char *get_revocationReason(const private_certinfo_t *this) +static crl_reason_t get_revocationReason(const private_certinfo_t *this) { - return enum_name(&crl_reason_names, this->revocationReason); + return this->revocationReason; } /** @@ -205,7 +193,7 @@ certinfo_t *certinfo_create(chunk_t serial) this->public.set_revocationTime = (void (*) (certinfo_t*,time_t))set_revocationTime; this->public.get_revocationTime = (time_t (*) (const certinfo_t*))get_revocationTime; this->public.set_revocationReason = (void (*) (certinfo_t*, crl_reason_t))set_revocationReason; - this->public.get_revocationReason = (const char *(*) (const certinfo_t*))get_revocationReason; + this->public.get_revocationReason = (crl_reason_t(*) (const certinfo_t*))get_revocationReason; this->public.destroy = (void (*) (certinfo_t*))destroy; return &this->public; |