aboutsummaryrefslogtreecommitdiffstats
path: root/src/pluto/ipsec_doi.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/pluto/ipsec_doi.c
parentda9724e6d0fe82db4191a2d15919b365f0f210b0 (diff)
downloadstrongswan-0406eeaacb9c9f927cd1625a2cda72427be9a6dc.tar.bz2
strongswan-0406eeaacb9c9f927cd1625a2cda72427be9a6dc.tar.xz
Support different encoding types in certificate.get_encoding()
Diffstat (limited to 'src/pluto/ipsec_doi.c')
-rw-r--r--src/pluto/ipsec_doi.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/src/pluto/ipsec_doi.c b/src/pluto/ipsec_doi.c
index f2a5de780..4a6a7c872 100644
--- a/src/pluto/ipsec_doi.c
+++ b/src/pluto/ipsec_doi.c
@@ -3645,7 +3645,7 @@ stf_status main_inR2_outI3(struct msg_digest *md)
}
if (send_cert)
{
- bool success;
+ bool success = FALSE;
chunk_t cert_encoding;
pb_stream cert_pbs;
@@ -3657,9 +3657,12 @@ stf_status main_inR2_outI3(struct msg_digest *md)
{
return STF_INTERNAL_ERROR;
}
- cert_encoding = mycert->cert->get_encoding(mycert->cert);
- success = out_chunk(cert_encoding, &cert_pbs, "CERT");
- free(cert_encoding.ptr);
+ if (mycert->cert->get_encoding(mycert->cert, CERT_ASN1_DER,
+ &cert_encoding))
+ {
+ success = out_chunk(cert_encoding, &cert_pbs, "CERT");
+ free(cert_encoding.ptr);
+ }
if (!success)
{
return STF_INTERNAL_ERROR;
@@ -4086,7 +4089,7 @@ main_inI3_outR3_tail(struct msg_digest *md
}
if (send_cert)
{
- bool success;
+ bool success = FALSE;
chunk_t cert_encoding;
pb_stream cert_pbs;
struct isakmp_cert cert_hd;
@@ -4098,9 +4101,12 @@ main_inI3_outR3_tail(struct msg_digest *md
{
return STF_INTERNAL_ERROR;
}
- cert_encoding = mycert->cert->get_encoding(mycert->cert);
- success = out_chunk(cert_encoding, &cert_pbs, "CERT");
- free(cert_encoding.ptr);
+ if (mycert->cert->get_encoding(mycert->cert, CERT_ASN1_DER,
+ &cert_encoding))
+ {
+ success = out_chunk(cert_encoding, &cert_pbs, "CERT");
+ free(cert_encoding.ptr);
+ }
if (!success)
{
return STF_INTERNAL_ERROR;