diff options
author | Rene Mayrhofer <rene@mayrhofer.eu.org> | 2008-03-30 08:38:54 +0000 |
---|---|---|
committer | Rene Mayrhofer <rene@mayrhofer.eu.org> | 2008-03-30 08:38:54 +0000 |
commit | 113868f64840631a2b10a2e8987268f2c6566552 (patch) | |
tree | 087c05184fd083ca653d1b85bd10c3c51361bb4a /src/openac | |
parent | c9e3aaf0657e98bc047486ba87edf1489a39ba94 (diff) | |
download | vyos-strongswan-113868f64840631a2b10a2e8987268f2c6566552.tar.gz vyos-strongswan-113868f64840631a2b10a2e8987268f2c6566552.zip |
- New upstream release.
Diffstat (limited to 'src/openac')
-rw-r--r-- | src/openac/Makefile.in | 2 | ||||
-rw-r--r-- | src/openac/build.c | 19 | ||||
-rwxr-xr-x | src/openac/openac.c | 7 |
3 files changed, 13 insertions, 15 deletions
diff --git a/src/openac/Makefile.in b/src/openac/Makefile.in index d0f7817dc..3cca270a7 100644 --- a/src/openac/Makefile.in +++ b/src/openac/Makefile.in @@ -187,11 +187,13 @@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ piddir = @piddir@ +plugindir = @plugindir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ +simreader = @simreader@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ diff --git a/src/openac/build.c b/src/openac/build.c index d03e73048..40c8b7964 100644 --- a/src/openac/build.c +++ b/src/openac/build.c @@ -13,7 +13,7 @@ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * - * RCSID $Id: build.c 3270 2007-10-08 20:09:57Z andreas $ + * RCSID $Id: build.c 3424 2008-01-22 10:34:44Z andreas $ */ #include <stdlib.h> @@ -167,7 +167,7 @@ static chunk_t build_attr_cert_info(void) ASN1_INTEGER_1, build_holder(), build_v2_form(), - ASN1_sha1WithRSA_id, + asn1_algorithmIdentifier(OID_SHA1_WITH_RSA), asn1_simple_object(ASN1_INTEGER, serial), build_attr_cert_validity(), build_attributes(), @@ -180,21 +180,14 @@ static chunk_t build_attr_cert_info(void) */ chunk_t build_attr_cert(void) { - u_char *pos; - chunk_t rawSignature, signatureValue; + chunk_t signatureValue; chunk_t attributeCertificateInfo = build_attr_cert_info(); - /* build the signature */ signerkey->build_emsa_pkcs1_signature(signerkey, HASH_SHA1, - attributeCertificateInfo, &rawSignature); - pos = build_asn1_object(&signatureValue, ASN1_BIT_STRING, - 1 + rawSignature.len); - *pos++ = 0x00; - memcpy(pos, rawSignature.ptr, rawSignature.len); - free(rawSignature.ptr); + attributeCertificateInfo, &signatureValue); return asn1_wrap(ASN1_SEQUENCE, "mcm", attributeCertificateInfo, - ASN1_sha1WithRSA_id, - signatureValue); + asn1_algorithmIdentifier(OID_SHA1_WITH_RSA), + asn1_bitstring("m", signatureValue)); } diff --git a/src/openac/openac.c b/src/openac/openac.c index 075f0039a..3d82940c2 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 3305 2007-10-17 02:55:17Z andreas $ + * RCSID $Id: openac.c 3442 2008-02-04 14:46:43Z andreas $ */ #include <stdio.h> @@ -234,6 +234,8 @@ int main(int argc, char **argv) time_t validity = 0; int status = 1; + options_t *options = options_create(); + /* enable openac debugging hook */ dbg = openac_dbg; @@ -300,7 +302,7 @@ int main(int argc, char **argv) { snprintf(path, BUF_LEN, "%s/%s", OPENAC_PATH, optarg); } - if (!optionsfrom(path, &argc, &argv, optind)) + if (!options->from(options, path, &argc, &argv, optind)) { status = 1; goto end; @@ -509,5 +511,6 @@ end: free(serial.ptr); closelog(); dbg = dbg_default; + options->destroy(options); exit(status); } |