From 0a9d51a49042a68daa15b0c74a2b7f152f52606b Mon Sep 17 00:00:00 2001 From: René Mayrhofer Date: Thu, 19 May 2011 13:37:29 +0200 Subject: Imported Upstream version 4.5.2 --- src/openac/Makefile.in | 3 +++ src/openac/openac.c | 14 ++++++++------ 2 files changed, 11 insertions(+), 6 deletions(-) (limited to 'src/openac') diff --git a/src/openac/Makefile.in b/src/openac/Makefile.in index ec4657e55..54544b665 100644 --- a/src/openac/Makefile.in +++ b/src/openac/Makefile.in @@ -241,6 +241,8 @@ nm_ca_dir = @nm_ca_dir@ oldincludedir = @oldincludedir@ openac_plugins = @openac_plugins@ p_plugins = @p_plugins@ +pcsclite_CFLAGS = @pcsclite_CFLAGS@ +pcsclite_LIBS = @pcsclite_LIBS@ pdfdir = @pdfdir@ piddir = @piddir@ pki_plugins = @pki_plugins@ @@ -264,6 +266,7 @@ soup_LIBS = @soup_LIBS@ srcdir = @srcdir@ strongswan_conf = @strongswan_conf@ sysconfdir = @sysconfdir@ +systemdsystemunitdir = @systemdsystemunitdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ diff --git a/src/openac/openac.c b/src/openac/openac.c index 5de8f5b7c..745988750 100755 --- a/src/openac/openac.c +++ b/src/openac/openac.c @@ -39,8 +39,8 @@ #include #include -#define OPENAC_PATH IPSEC_CONFDIR "/openac" -#define OPENAC_SERIAL IPSEC_CONFDIR "/openac/serial" +#define OPENAC_PATH IPSEC_CONFDIR "/openac" +#define OPENAC_SERIAL IPSEC_CONFDIR "/openac/serial" #define DEFAULT_VALIDITY 24*3600 /* seconds */ @@ -133,7 +133,7 @@ static void write_serial(chunk_t serial) DBG1(DBG_LIB, " serial number is %#B", &serial); hex_serial = chunk_to_hex(serial, NULL, FALSE); - fprintf(fd, "%.*s\n", hex_serial.len, hex_serial.ptr); + fprintf(fd, "%.*s\n", (int)hex_serial.len, hex_serial.ptr); fclose(fd); free(hex_serial.ptr); } @@ -300,6 +300,7 @@ int main(int argc, char **argv) if (*optarg == '/') /* absolute pathname */ { strncpy(path, optarg, BUF_LEN); + path[BUF_LEN-1] = '\0'; } else /* relative pathname */ { @@ -326,7 +327,7 @@ int main(int argc, char **argv) continue; case 'p': /* --key */ - if (strlen(optarg) > BUF_LEN) + if (strlen(optarg) >= BUF_LEN) { usage("passphrase too long"); goto end; @@ -490,7 +491,8 @@ int main(int argc, char **argv) notAfter = (notAfter == UNDEFINED_TIME) ? time(NULL) + validity : notAfter; /* build and parse attribute certificate */ - if (userCert != NULL && signerCert != NULL && signerKey != NULL) + if (userCert != NULL && signerCert != NULL && signerKey != NULL && + outfile != NULL) { /* read the serial number and increment it by one */ serial = read_serial(); @@ -522,7 +524,7 @@ int main(int argc, char **argv) } else { - usage("some of the mandatory parameters --usercert --cert --key " + usage("some of the mandatory parameters --usercert --cert --key --out " "are missing"); } -- cgit v1.2.3