summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorRené Mayrhofer <rene@mayrhofer.eu.org>2011-03-05 09:20:09 +0100
committerRené Mayrhofer <rene@mayrhofer.eu.org>2011-03-05 09:20:09 +0100
commit568905f488e63e28778f87ac0e38d845f45bae79 (patch)
treed9969a147e36413583ff4bc75542d34c955f8823 /scripts
parentf73fba54dc8b30c6482e1e8abf15bbf455592fcd (diff)
downloadvyos-strongswan-568905f488e63e28778f87ac0e38d845f45bae79.tar.gz
vyos-strongswan-568905f488e63e28778f87ac0e38d845f45bae79.zip
Imported Upstream version 4.5.1
Diffstat (limited to 'scripts')
-rw-r--r--scripts/Makefile.am8
-rw-r--r--scripts/Makefile.in43
-rw-r--r--scripts/fetch.c41
-rw-r--r--scripts/oid2der.c31
4 files changed, 111 insertions, 12 deletions
diff --git a/scripts/Makefile.am b/scripts/Makefile.am
index 827fb7dfb..2cd8b499b 100644
--- a/scripts/Makefile.am
+++ b/scripts/Makefile.am
@@ -2,8 +2,8 @@ INCLUDES = -I$(top_srcdir)/src/libstrongswan -I$(top_srcdir)/src/libtls
AM_CFLAGS = \
-DPLUGINS="\"${scripts_plugins}\""
-noinst_PROGRAMS = bin2array bin2sql id2sql key2keyid keyid2sql \
- thread_analysis dh_speed pubkey_speed crypt_burn
+noinst_PROGRAMS = bin2array bin2sql id2sql key2keyid keyid2sql oid2der \
+ thread_analysis dh_speed pubkey_speed crypt_burn fetch
if USE_TLS
noinst_PROGRAMS += tls_test
@@ -17,16 +17,20 @@ bin2sql_SOURCES = bin2sql.c
id2sql_SOURCES = id2sql.c
key2keyid_SOURCES = key2keyid.c
keyid2sql_SOURCES = keyid2sql.c
+oid2der_SOURCES = oid2der.c
thread_analysis_SOURCES = thread_analysis.c
dh_speed_SOURCES = dh_speed.c
pubkey_speed_SOURCES = pubkey_speed.c
crypt_burn_SOURCES = crypt_burn.c
+fetch_SOURCES = fetch.c
id2sql_LDADD = $(top_builddir)/src/libstrongswan/libstrongswan.la
key2keyid_LDADD = $(top_builddir)/src/libstrongswan/libstrongswan.la
keyid2sql_LDADD = $(top_builddir)/src/libstrongswan/libstrongswan.la
+oid2der_LDADD = $(top_builddir)/src/libstrongswan/libstrongswan.la
dh_speed_LDADD = $(top_builddir)/src/libstrongswan/libstrongswan.la -lrt
pubkey_speed_LDADD = $(top_builddir)/src/libstrongswan/libstrongswan.la -lrt
crypt_burn_LDADD = $(top_builddir)/src/libstrongswan/libstrongswan.la
+fetch_LDADD = $(top_builddir)/src/libstrongswan/libstrongswan.la
key2keyid.o : $(top_builddir)/config.status
diff --git a/scripts/Makefile.in b/scripts/Makefile.in
index e28424350..891555dcd 100644
--- a/scripts/Makefile.in
+++ b/scripts/Makefile.in
@@ -35,8 +35,9 @@ POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
noinst_PROGRAMS = bin2array$(EXEEXT) bin2sql$(EXEEXT) id2sql$(EXEEXT) \
- key2keyid$(EXEEXT) keyid2sql$(EXEEXT) thread_analysis$(EXEEXT) \
- dh_speed$(EXEEXT) pubkey_speed$(EXEEXT) crypt_burn$(EXEEXT)
+ key2keyid$(EXEEXT) keyid2sql$(EXEEXT) oid2der$(EXEEXT) \
+ thread_analysis$(EXEEXT) dh_speed$(EXEEXT) \
+ pubkey_speed$(EXEEXT) crypt_burn$(EXEEXT) fetch$(EXEEXT)
subdir = scripts
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
@@ -69,6 +70,10 @@ am_dh_speed_OBJECTS = dh_speed.$(OBJEXT)
dh_speed_OBJECTS = $(am_dh_speed_OBJECTS)
dh_speed_DEPENDENCIES = \
$(top_builddir)/src/libstrongswan/libstrongswan.la
+am_fetch_OBJECTS = fetch.$(OBJEXT)
+fetch_OBJECTS = $(am_fetch_OBJECTS)
+fetch_DEPENDENCIES = \
+ $(top_builddir)/src/libstrongswan/libstrongswan.la
am_id2sql_OBJECTS = id2sql.$(OBJEXT)
id2sql_OBJECTS = $(am_id2sql_OBJECTS)
id2sql_DEPENDENCIES = \
@@ -81,6 +86,10 @@ am_keyid2sql_OBJECTS = keyid2sql.$(OBJEXT)
keyid2sql_OBJECTS = $(am_keyid2sql_OBJECTS)
keyid2sql_DEPENDENCIES = \
$(top_builddir)/src/libstrongswan/libstrongswan.la
+am_oid2der_OBJECTS = oid2der.$(OBJEXT)
+oid2der_OBJECTS = $(am_oid2der_OBJECTS)
+oid2der_DEPENDENCIES = \
+ $(top_builddir)/src/libstrongswan/libstrongswan.la
am_pubkey_speed_OBJECTS = pubkey_speed.$(OBJEXT)
pubkey_speed_OBJECTS = $(am_pubkey_speed_OBJECTS)
pubkey_speed_DEPENDENCIES = \
@@ -102,13 +111,15 @@ LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
$(LDFLAGS) -o $@
SOURCES = $(bin2array_SOURCES) $(bin2sql_SOURCES) \
- $(crypt_burn_SOURCES) $(dh_speed_SOURCES) $(id2sql_SOURCES) \
- $(key2keyid_SOURCES) $(keyid2sql_SOURCES) \
- $(pubkey_speed_SOURCES) $(thread_analysis_SOURCES)
+ $(crypt_burn_SOURCES) $(dh_speed_SOURCES) $(fetch_SOURCES) \
+ $(id2sql_SOURCES) $(key2keyid_SOURCES) $(keyid2sql_SOURCES) \
+ $(oid2der_SOURCES) $(pubkey_speed_SOURCES) \
+ $(thread_analysis_SOURCES)
DIST_SOURCES = $(bin2array_SOURCES) $(bin2sql_SOURCES) \
- $(crypt_burn_SOURCES) $(dh_speed_SOURCES) $(id2sql_SOURCES) \
- $(key2keyid_SOURCES) $(keyid2sql_SOURCES) \
- $(pubkey_speed_SOURCES) $(thread_analysis_SOURCES)
+ $(crypt_burn_SOURCES) $(dh_speed_SOURCES) $(fetch_SOURCES) \
+ $(id2sql_SOURCES) $(key2keyid_SOURCES) $(keyid2sql_SOURCES) \
+ $(oid2der_SOURCES) $(pubkey_speed_SOURCES) \
+ $(thread_analysis_SOURCES)
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -231,9 +242,7 @@ includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
ipsecdir = @ipsecdir@
-ipsecgid = @ipsecgid@
ipsecgroup = @ipsecgroup@
-ipsecuid = @ipsecuid@
ipsecuser = @ipsecuser@
libcharon_plugins = @libcharon_plugins@
libdir = @libdir@
@@ -272,6 +281,8 @@ sbindir = @sbindir@
scepclient_plugins = @scepclient_plugins@
scripts_plugins = @scripts_plugins@
sharedstatedir = @sharedstatedir@
+soup_CFLAGS = @soup_CFLAGS@
+soup_LIBS = @soup_LIBS@
srcdir = @srcdir@
strongswan_conf = @strongswan_conf@
sysconfdir = @sysconfdir@
@@ -291,16 +302,20 @@ bin2sql_SOURCES = bin2sql.c
id2sql_SOURCES = id2sql.c
key2keyid_SOURCES = key2keyid.c
keyid2sql_SOURCES = keyid2sql.c
+oid2der_SOURCES = oid2der.c
thread_analysis_SOURCES = thread_analysis.c
dh_speed_SOURCES = dh_speed.c
pubkey_speed_SOURCES = pubkey_speed.c
crypt_burn_SOURCES = crypt_burn.c
+fetch_SOURCES = fetch.c
id2sql_LDADD = $(top_builddir)/src/libstrongswan/libstrongswan.la
key2keyid_LDADD = $(top_builddir)/src/libstrongswan/libstrongswan.la
keyid2sql_LDADD = $(top_builddir)/src/libstrongswan/libstrongswan.la
+oid2der_LDADD = $(top_builddir)/src/libstrongswan/libstrongswan.la
dh_speed_LDADD = $(top_builddir)/src/libstrongswan/libstrongswan.la -lrt
pubkey_speed_LDADD = $(top_builddir)/src/libstrongswan/libstrongswan.la -lrt
crypt_burn_LDADD = $(top_builddir)/src/libstrongswan/libstrongswan.la
+fetch_LDADD = $(top_builddir)/src/libstrongswan/libstrongswan.la
all: all-am
.SUFFIXES:
@@ -356,6 +371,9 @@ crypt_burn$(EXEEXT): $(crypt_burn_OBJECTS) $(crypt_burn_DEPENDENCIES)
dh_speed$(EXEEXT): $(dh_speed_OBJECTS) $(dh_speed_DEPENDENCIES)
@rm -f dh_speed$(EXEEXT)
$(LINK) $(dh_speed_OBJECTS) $(dh_speed_LDADD) $(LIBS)
+fetch$(EXEEXT): $(fetch_OBJECTS) $(fetch_DEPENDENCIES)
+ @rm -f fetch$(EXEEXT)
+ $(LINK) $(fetch_OBJECTS) $(fetch_LDADD) $(LIBS)
id2sql$(EXEEXT): $(id2sql_OBJECTS) $(id2sql_DEPENDENCIES)
@rm -f id2sql$(EXEEXT)
$(LINK) $(id2sql_OBJECTS) $(id2sql_LDADD) $(LIBS)
@@ -365,6 +383,9 @@ key2keyid$(EXEEXT): $(key2keyid_OBJECTS) $(key2keyid_DEPENDENCIES)
keyid2sql$(EXEEXT): $(keyid2sql_OBJECTS) $(keyid2sql_DEPENDENCIES)
@rm -f keyid2sql$(EXEEXT)
$(LINK) $(keyid2sql_OBJECTS) $(keyid2sql_LDADD) $(LIBS)
+oid2der$(EXEEXT): $(oid2der_OBJECTS) $(oid2der_DEPENDENCIES)
+ @rm -f oid2der$(EXEEXT)
+ $(LINK) $(oid2der_OBJECTS) $(oid2der_LDADD) $(LIBS)
pubkey_speed$(EXEEXT): $(pubkey_speed_OBJECTS) $(pubkey_speed_DEPENDENCIES)
@rm -f pubkey_speed$(EXEEXT)
$(LINK) $(pubkey_speed_OBJECTS) $(pubkey_speed_LDADD) $(LIBS)
@@ -382,9 +403,11 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bin2sql.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/crypt_burn.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dh_speed.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fetch.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/id2sql.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/key2keyid.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/keyid2sql.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/oid2der.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pubkey_speed.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/thread_analysis.Po@am__quote@
diff --git a/scripts/fetch.c b/scripts/fetch.c
new file mode 100644
index 000000000..57abce4ca
--- /dev/null
+++ b/scripts/fetch.c
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2010 Martin Willi
+ * Copyright (C) 2010 revosec AG
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * for more details.
+ */
+
+#include <stdio.h>
+#include <unistd.h>
+
+#include <library.h>
+#include <debug.h>
+
+int main(int argc, char *argv[])
+{
+ chunk_t res;
+
+ library_init(NULL);
+ atexit(library_deinit);
+ lib->plugins->load(lib->plugins, NULL, PLUGINS);
+
+ if (argc != 2)
+ {
+ fprintf(stderr, "usage: %s <url>\n", argv[0]);
+ }
+ if (lib->fetcher->fetch(lib->fetcher, argv[1], &res, FETCH_END) == SUCCESS)
+ {
+ ignore_result(write(1, res.ptr, res.len));
+ free(res.ptr);
+ return 0;
+ }
+ return 1;
+}
diff --git a/scripts/oid2der.c b/scripts/oid2der.c
new file mode 100644
index 000000000..0da3bbb62
--- /dev/null
+++ b/scripts/oid2der.c
@@ -0,0 +1,31 @@
+
+#include <stdio.h>
+#include <asn1/asn1.h>
+
+/**
+ * convert string OID to DER encoding
+ */
+int main(int argc, char *argv[])
+{
+ int i, nr = 0;
+ chunk_t oid;
+
+ while (argc > ++nr)
+ {
+ oid = asn1_oid_from_string(argv[nr]);
+ if (oid.len)
+ {
+ for (i = 0; i < oid.len; i++)
+ {
+ printf("0x%02x,", oid.ptr[i]);
+ }
+ printf("\n");
+ free(oid.ptr);
+ }
+ else
+ {
+ return 1;
+ }
+ }
+ return 0;
+}