aboutsummaryrefslogtreecommitdiffstats
path: root/src/libstrongswan/plugins/x509/x509_crl.c
diff options
context:
space:
mode:
authorMartin Willi <martin@revosec.ch>2010-07-13 13:34:04 +0200
committerMartin Willi <martin@revosec.ch>2010-07-13 13:53:20 +0200
commit0406eeaacb9c9f927cd1625a2cda72427be9a6dc (patch)
treeb102097d6db3f9455a223ceeffdca796a9c4c525 /src/libstrongswan/plugins/x509/x509_crl.c
parentda9724e6d0fe82db4191a2d15919b365f0f210b0 (diff)
downloadstrongswan-0406eeaacb9c9f927cd1625a2cda72427be9a6dc.tar.bz2
strongswan-0406eeaacb9c9f927cd1625a2cda72427be9a6dc.tar.xz
Support different encoding types in certificate.get_encoding()
Diffstat (limited to 'src/libstrongswan/plugins/x509/x509_crl.c')
-rw-r--r--src/libstrongswan/plugins/x509/x509_crl.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/libstrongswan/plugins/x509/x509_crl.c b/src/libstrongswan/plugins/x509/x509_crl.c
index 88d901a83..4bd0470d3 100644
--- a/src/libstrongswan/plugins/x509/x509_crl.c
+++ b/src/libstrongswan/plugins/x509/x509_crl.c
@@ -457,10 +457,16 @@ METHOD(certificate_t, get_validity, bool,
return (t <= this->nextUpdate);
}
-METHOD(certificate_t, get_encoding, chunk_t,
- private_x509_crl_t *this)
+METHOD(certificate_t, get_encoding, bool,
+ private_x509_crl_t *this, cred_encoding_type_t type, chunk_t *encoding)
{
- return chunk_clone(this->encoding);
+ if (type == CERT_ASN1_DER)
+ {
+ *encoding = chunk_clone(this->encoding);
+ return TRUE;
+ }
+ return lib->encoding->encode(lib->encoding, type, NULL, encoding,
+ CRED_PART_X509_CRL_ASN1_DER, this->encoding, CRED_PART_END);
}
METHOD(certificate_t, equals, bool,
@@ -477,7 +483,10 @@ METHOD(certificate_t, equals, bool,
{ /* skip allocation if we have the same implementation */
return chunk_equals(this->encoding, ((private_x509_crl_t*)other)->encoding);
}
- encoding = other->get_encoding(other);
+ if (!other->get_encoding(other, CERT_ASN1_DER, &encoding))
+ {
+ return FALSE;
+ }
equal = chunk_equals(this->encoding, encoding);
free(encoding.ptr);
return equal;