summaryrefslogtreecommitdiff
path: root/src/libstrongswan/plugins/x509/x509_ac.c
diff options
context:
space:
mode:
authorRene Mayrhofer <rene@mayrhofer.eu.org>2008-10-29 11:11:01 +0000
committerRene Mayrhofer <rene@mayrhofer.eu.org>2008-10-29 11:11:01 +0000
commit8b80ab5a6950ce6515f477624794defd7531642a (patch)
treeaa8303f3806c5615fbeafc4dc82febe3cd7c24dc /src/libstrongswan/plugins/x509/x509_ac.c
parentdb67c87db3c9089ea8d2e14f617bf3d9e2af261f (diff)
downloadvyos-strongswan-8b80ab5a6950ce6515f477624794defd7531642a.tar.gz
vyos-strongswan-8b80ab5a6950ce6515f477624794defd7531642a.zip
[svn-upgrade] Integrating new upstream version, strongswan (4.2.8)
Diffstat (limited to 'src/libstrongswan/plugins/x509/x509_ac.c')
-rw-r--r--src/libstrongswan/plugins/x509/x509_ac.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/src/libstrongswan/plugins/x509/x509_ac.c b/src/libstrongswan/plugins/x509/x509_ac.c
index cfa38c66b..caae5e08d 100644
--- a/src/libstrongswan/plugins/x509/x509_ac.c
+++ b/src/libstrongswan/plugins/x509/x509_ac.c
@@ -1054,6 +1054,7 @@ static void add(private_builder_t *this, builder_part_t part, ...)
{
va_list args;
certificate_t *cert;
+ chunk_t chunk;
va_start(args, part);
switch (part)
@@ -1070,7 +1071,8 @@ static void add(private_builder_t *this, builder_part_t part, ...)
{
destroy(this->ac);
}
- this->ac = create_from_chunk(va_arg(args, chunk_t));
+ chunk = va_arg(args, chunk_t);
+ this->ac = create_from_chunk(chunk_clone(chunk));
break;
case BUILD_NOT_BEFORE_TIME:
this->ac->notBefore = va_arg(args, time_t);
@@ -1079,7 +1081,8 @@ static void add(private_builder_t *this, builder_part_t part, ...)
this->ac->notAfter = va_arg(args, time_t);
break;
case BUILD_SERIAL:
- this->ac->serialNumber = va_arg(args, chunk_t);
+ chunk = va_arg(args, chunk_t);
+ this->ac->serialNumber = chunk_clone(chunk);
break;
case BUILD_IETF_GROUP_ATTR:
ietfAttr_list_create_from_string(va_arg(args, char*),
@@ -1089,29 +1092,27 @@ static void add(private_builder_t *this, builder_part_t part, ...)
cert = va_arg(args, certificate_t*);
if (cert->get_type(cert) == CERT_X509)
{
- this->ac->holderCert = cert;
- }
- else
- {
- cert->destroy(cert);
+ this->ac->holderCert = cert->get_ref(cert);
}
break;
case BUILD_SIGNING_CERT:
cert = va_arg(args, certificate_t*);
if (cert->get_type(cert) == CERT_X509)
{
- this->ac->signerCert = cert;
- }
- else
- {
- cert->destroy(cert);
+ this->ac->signerCert = cert->get_ref(cert);
}
break;
case BUILD_SIGNING_KEY:
this->ac->signerKey = va_arg(args, private_key_t*);
+ this->ac->signerKey->get_ref(this->ac->signerKey);
break;
default:
- DBG1("ignoring unsupported build part %N", builder_part_names, part);
+ /* abort if unsupported option */
+ if (this->ac)
+ {
+ destroy(this->ac);
+ }
+ builder_cancel(&this->public);
break;
}
va_end(args);