diff options
author | Rene Mayrhofer <rene@mayrhofer.eu.org> | 2008-10-29 11:11:01 +0000 |
---|---|---|
committer | Rene Mayrhofer <rene@mayrhofer.eu.org> | 2008-10-29 11:11:01 +0000 |
commit | 8b80ab5a6950ce6515f477624794defd7531642a (patch) | |
tree | aa8303f3806c5615fbeafc4dc82febe3cd7c24dc /src/openac | |
parent | db67c87db3c9089ea8d2e14f617bf3d9e2af261f (diff) | |
download | vyos-strongswan-8b80ab5a6950ce6515f477624794defd7531642a.tar.gz vyos-strongswan-8b80ab5a6950ce6515f477624794defd7531642a.zip |
[svn-upgrade] Integrating new upstream version, strongswan (4.2.8)
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; |