summaryrefslogtreecommitdiff
path: root/src/openac/openac.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/openac/openac.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/openac/openac.c')
-rwxr-xr-xsrc/openac/openac.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/openac/openac.c b/src/openac/openac.c
index 48dc57ece..5d9cd92d3 100755
--- a/src/openac/openac.c
+++ b/src/openac/openac.c
@@ -20,7 +20,7 @@
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*
- * RCSID $Id: openac.c 3967 2008-05-16 08:52:32Z martin $
+ * RCSID $Id: openac.c 4345 2008-09-17 08:10:48Z martin $
*/
#include <stdio.h>
@@ -103,6 +103,10 @@ static chunk_t mpz_to_chunk(mpz_t number)
chunk.len = 1 + mpz_sizeinbase(number, 2)/BITS_PER_BYTE;
chunk.ptr = mpz_export(NULL, NULL, 1, chunk.len, 1, 0, number);
+ if (chunk.ptr == NULL)
+ {
+ chunk.len = 0;
+ }
return chunk;
}
@@ -191,6 +195,7 @@ static private_key_t* private_key_create_from_file(char *path, chunk_t *secret)
}
key = lib->creds->create(lib->creds, CRED_PRIVATE_KEY, KEY_RSA,
BUILD_BLOB_ASN1_DER, chunk, BUILD_END);
+ free(chunk.ptr);
if (key == NULL)
{
DBG1(" could not parse loaded private key file '%s'", path);
@@ -527,14 +532,15 @@ int main(int argc, char **argv)
attr_cert = lib->creds->create(lib->creds,
CRED_CERTIFICATE, CERT_X509_AC,
- BUILD_CERT, userCert->get_ref(userCert),
+ BUILD_CERT, userCert,
BUILD_NOT_BEFORE_TIME, notBefore,
BUILD_NOT_AFTER_TIME, notAfter,
BUILD_SERIAL, serial,
BUILD_IETF_GROUP_ATTR, groups,
- BUILD_SIGNING_CERT, signerCert->get_ref(signerCert),
- BUILD_SIGNING_KEY, signerKey->get_ref(signerKey),
+ BUILD_SIGNING_CERT, signerCert,
+ BUILD_SIGNING_KEY, signerKey,
BUILD_END);
+ free(serial.ptr);
if (!attr_cert)
{
goto end;