diff options
author | Rene Mayrhofer <rene@mayrhofer.eu.org> | 2008-10-29 20:30:44 +0000 |
---|---|---|
committer | Rene Mayrhofer <rene@mayrhofer.eu.org> | 2008-10-29 20:30:44 +0000 |
commit | 74f0bbfc53cb5fa519e4e27ece53735ab51b397c (patch) | |
tree | 0dbab9c835be15577ff05b474b6361bb326d66ce /src/openac | |
parent | 5c1fa2516bda1ccf8eb00178c0beb196c2020a94 (diff) | |
download | vyos-strongswan-74f0bbfc53cb5fa519e4e27ece53735ab51b397c.tar.gz vyos-strongswan-74f0bbfc53cb5fa519e4e27ece53735ab51b397c.zip |
- New upstream release.
Diffstat (limited to 'src/openac')
-rw-r--r-- | src/openac/Makefile.in | 2 | ||||
-rwxr-xr-x | src/openac/openac.c | 14 |
2 files changed, 12 insertions, 4 deletions
diff --git a/src/openac/Makefile.in b/src/openac/Makefile.in index 00977e038..f25073a21 100644 --- a/src/openac/Makefile.in +++ b/src/openac/Makefile.in @@ -184,6 +184,8 @@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ +nm_CFLAGS = @nm_CFLAGS@ +nm_LIBS = @nm_LIBS@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ piddir = @piddir@ 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; |