diff options
Diffstat (limited to 'src/libstrongswan/plugins/x509/x509_crl.c')
-rw-r--r-- | src/libstrongswan/plugins/x509/x509_crl.c | 17 |
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; |