aboutsummaryrefslogtreecommitdiffstats
path: root/src/libstrongswan/plugins/pubkey/pubkey_cert.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/pubkey/pubkey_cert.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/pubkey/pubkey_cert.c')
-rw-r--r--src/libstrongswan/plugins/pubkey/pubkey_cert.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/libstrongswan/plugins/pubkey/pubkey_cert.c b/src/libstrongswan/plugins/pubkey/pubkey_cert.c
index f2dcd71a1..c50189a8b 100644
--- a/src/libstrongswan/plugins/pubkey/pubkey_cert.c
+++ b/src/libstrongswan/plugins/pubkey/pubkey_cert.c
@@ -163,15 +163,10 @@ static bool get_validity(private_pubkey_cert_t *this, time_t *when,
/**
* Implementation of certificate_t.get_encoding.
*/
-static chunk_t get_encoding(private_pubkey_cert_t *this)
+static bool get_encoding(private_pubkey_cert_t *this, cred_encoding_type_t type,
+ chunk_t *encoding)
{
- chunk_t encoding;
-
- if (this->key->get_encoding(this->key, PUBKEY_ASN1_DER, &encoding))
- {
- return encoding;
- }
- return chunk_empty;
+ return this->key->get_encoding(this->key, PUBKEY_ASN1_DER, encoding);
}
/**
@@ -213,7 +208,7 @@ static pubkey_cert_t *pubkey_cert_create(public_key_t *key)
this->public.interface.issued_by = (bool (*)(certificate_t *this, certificate_t *issuer))issued_by;
this->public.interface.get_public_key = (public_key_t* (*)(certificate_t *this))get_public_key;
this->public.interface.get_validity = (bool (*)(certificate_t*, time_t *when, time_t *, time_t*))get_validity;
- this->public.interface.get_encoding = (chunk_t (*)(certificate_t*))get_encoding;
+ this->public.interface.get_encoding = (bool (*)(certificate_t*,cred_encoding_type_t,chunk_t*))get_encoding;
this->public.interface.equals = (bool (*)(certificate_t*, certificate_t *other))equals;
this->public.interface.get_ref = (certificate_t* (*)(certificate_t *this))get_ref;
this->public.interface.destroy = (void (*)(certificate_t *this))destroy;