diff options
author | Martin Willi <martin@strongswan.org> | 2009-09-04 13:46:09 +0200 |
---|---|---|
committer | Martin Willi <martin@strongswan.org> | 2009-09-04 13:46:09 +0200 |
commit | 7daf5226b74e14a6e0f1a888b0be26f3d246f9f8 (patch) | |
tree | 6436de2e84e7a677ecfb83db4bf44766cc273d9f /src/libstrongswan/plugins/x509/x509_crl.c | |
parent | 7d1b0304467bc668b592ccd6680fd9615efbb5b2 (diff) | |
download | strongswan-7daf5226b74e14a6e0f1a888b0be26f3d246f9f8.tar.bz2 strongswan-7daf5226b74e14a6e0f1a888b0be26f3d246f9f8.tar.xz |
removed trailing spaces ([[:space:]]+$)
Diffstat (limited to 'src/libstrongswan/plugins/x509/x509_crl.c')
-rw-r--r-- | src/libstrongswan/plugins/x509/x509_crl.c | 64 |
1 files changed, 32 insertions, 32 deletions
diff --git a/src/libstrongswan/plugins/x509/x509_crl.c b/src/libstrongswan/plugins/x509/x509_crl.c index 8df0e2f75..e826f34f9 100644 --- a/src/libstrongswan/plugins/x509/x509_crl.c +++ b/src/libstrongswan/plugins/x509/x509_crl.c @@ -36,12 +36,12 @@ struct revoked_t { * serial of the revoked certificate */ chunk_t serial; - + /** * date of revocation */ time_t date; - + /** * reason for revocation */ @@ -57,7 +57,7 @@ struct private_x509_crl_t { * public functions */ x509_crl_t public; - + /** * X.509 crl encoding in ASN.1 DER format */ @@ -72,12 +72,12 @@ struct private_x509_crl_t { * Version of the X.509 crl */ u_int version; - + /** * ID representing the crl issuer */ identification_t *issuer; - + /** * CRL number */ @@ -97,7 +97,7 @@ struct private_x509_crl_t { * list of revoked certificates as revoked_t */ linked_list_t *revoked; - + /** * Authority Key Identifier */ @@ -107,17 +107,17 @@ struct private_x509_crl_t { * Authority Key Serial Number */ chunk_t authKeySerialNumber; - + /** * Signature algorithm */ int algorithm; - + /** * Signature */ chunk_t signature; - + /** * reference counter */ @@ -128,7 +128,7 @@ struct private_x509_crl_t { * from x509_cert */ extern chunk_t x509_parse_authorityKeyIdentifier( - chunk_t blob, int level0, + chunk_t blob, int level0, chunk_t *authKeySerialNumber); /** @@ -140,7 +140,7 @@ static const asn1Object_t crlObjects[] = { { 2, "version", ASN1_INTEGER, ASN1_OPT | ASN1_BODY }, /* 2 */ { 2, "end opt", ASN1_EOC, ASN1_END }, /* 3 */ - { 2, "signature", ASN1_EOC, ASN1_RAW }, /* 4 */ + { 2, "signature", ASN1_EOC, ASN1_RAW }, /* 4 */ { 2, "issuer", ASN1_SEQUENCE, ASN1_OBJ }, /* 5 */ { 2, "thisUpdate", ASN1_EOC, ASN1_RAW }, /* 6 */ { 2, "nextUpdate", ASN1_EOC, ASN1_RAW }, /* 7 */ @@ -348,7 +348,7 @@ static chunk_t get_authKeyIdentifier(private_x509_crl_t *this) static enumerator_t* create_enumerator(private_x509_crl_t *this) { return enumerator_create_filter( - this->revoked->create_enumerator(this->revoked), + this->revoked->create_enumerator(this->revoked), (void*)filter, NULL, NULL); } @@ -390,7 +390,7 @@ static bool issued_by(private_x509_crl_t *this, certificate_t *issuer) signature_scheme_t scheme; bool valid; x509_t *x509 = (x509_t*)issuer; - + /* check if issuer is an X.509 CA certificate */ if (issuer->get_type(issuer) != CERT_X509) { @@ -408,24 +408,24 @@ static bool issued_by(private_x509_crl_t *this, certificate_t *issuer) if (this->authKeyIdentifier.ptr && key) { chunk_t fingerprint; - + if (!key->get_fingerprint(key, KEY_ID_PUBKEY_SHA1, &fingerprint) || !chunk_equals(fingerprint, this->authKeyIdentifier)) { return FALSE; } } - else + else { if (!this->issuer->equals(this->issuer, issuer->get_subject(issuer))) { return FALSE; } } - + /* determine signature scheme */ scheme = signature_scheme_from_oid(this->algorithm); - + if (scheme == SIGN_UNKNOWN || key == NULL) { return FALSE; @@ -459,7 +459,7 @@ static bool get_validity(private_x509_crl_t *this, time_t *when, time_t *not_before, time_t *not_after) { time_t t; - + if (when) { t = *when; @@ -486,7 +486,7 @@ static bool is_newer(private_x509_crl_t *this, crl_t *that) { chunk_t that_crlNumber = that->get_serial(that); bool new; - + /* compare crlNumbers if available - otherwise use thisUpdate */ if (this->crlNumber.ptr != NULL && that_crlNumber.ptr != NULL) { @@ -495,7 +495,7 @@ static bool is_newer(private_x509_crl_t *this, crl_t *that) &this->crlNumber, new ? "newer":"not newer", &that_crlNumber, new ? "replaced":"retained"); } - else + else { certificate_t *this_cert = &this->public.crl.certificate; certificate_t *that_cert = &that->certificate; @@ -511,7 +511,7 @@ static bool is_newer(private_x509_crl_t *this, crl_t *that) } return new; } - + /** * Implementation of certificate_t.get_encoding. */ @@ -527,14 +527,14 @@ static bool equals(private_x509_crl_t *this, certificate_t *other) { chunk_t encoding; bool equal; - + if ((certificate_t*)this == other) { return TRUE; } if (other->equals == (void*)equals) { /* skip allocation if we have the same implementation */ - return chunk_equals(this->encoding, ((private_x509_crl_t*)other)->encoding); + return chunk_equals(this->encoding, ((private_x509_crl_t*)other)->encoding); } encoding = other->get_encoding(other); equal = chunk_equals(this->encoding, encoding); @@ -563,7 +563,7 @@ static void destroy(private_x509_crl_t *this) static private_x509_crl_t* create_empty(void) { private_x509_crl_t *this = malloc_thing(private_x509_crl_t); - + this->public.crl.get_serial = (chunk_t (*)(crl_t*))get_serial; this->public.crl.get_authKeyIdentifier = (chunk_t (*)(crl_t*))get_authKeyIdentifier; this->public.crl.create_enumerator = (enumerator_t* (*)(crl_t*))create_enumerator; @@ -580,7 +580,7 @@ static private_x509_crl_t* create_empty(void) this->public.crl.certificate.equals = (bool (*)(certificate_t*, certificate_t *other))equals; this->public.crl.certificate.get_ref = (certificate_t* (*)(certificate_t *this))get_ref; this->public.crl.certificate.destroy = (void (*)(certificate_t *this))destroy; - + this->encoding = chunk_empty; this->tbsCertList = chunk_empty; this->issuer = NULL; @@ -589,7 +589,7 @@ static private_x509_crl_t* create_empty(void) this->authKeyIdentifier = chunk_empty; this->authKeySerialNumber = chunk_empty; this->ref = 1; - + return this; } @@ -610,7 +610,7 @@ struct private_builder_t { static private_x509_crl_t *build(private_builder_t *this) { private_x509_crl_t *crl = NULL; - + if (this->blob.len && this->blob.ptr) { crl = create_empty(); @@ -631,7 +631,7 @@ static private_x509_crl_t *build(private_builder_t *this) static void add(private_builder_t *this, builder_part_t part, ...) { va_list args; - + switch (part) { case BUILD_BLOB_ASN1_DER: @@ -653,18 +653,18 @@ static void add(private_builder_t *this, builder_part_t part, ...) builder_t *x509_crl_builder(certificate_type_t type) { private_builder_t *this; - + if (type != CERT_X509_CRL) { return NULL; } this = malloc_thing(private_builder_t); - + this->public.add = (void(*)(builder_t *this, builder_part_t part, ...))add; this->public.build = (void*(*)(builder_t *this))build; - + this->blob = chunk_empty; - + return &this->public; } |