summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/Makefile.am4
-rw-r--r--scripts/Makefile.in42
-rw-r--r--scripts/bin2array.c14
-rw-r--r--scripts/bin2sql.c14
-rw-r--r--scripts/crypt_burn.c43
-rw-r--r--scripts/dh_speed.c14
-rw-r--r--scripts/hash_burn.c74
-rw-r--r--scripts/id2sql.c14
-rw-r--r--scripts/key2keyid.c14
-rw-r--r--scripts/keyid2sql.c14
-rw-r--r--scripts/oid2der.c14
11 files changed, 238 insertions, 23 deletions
diff --git a/scripts/Makefile.am b/scripts/Makefile.am
index 5f303be17..ea399e84c 100644
--- a/scripts/Makefile.am
+++ b/scripts/Makefile.am
@@ -3,7 +3,7 @@ AM_CFLAGS = \
-DPLUGINS="\"${scripts_plugins}\""
noinst_PROGRAMS = bin2array bin2sql id2sql key2keyid keyid2sql oid2der \
- thread_analysis dh_speed pubkey_speed crypt_burn fetch
+ thread_analysis dh_speed pubkey_speed crypt_burn hash_burn fetch
if USE_TLS
noinst_PROGRAMS += tls_test
@@ -22,6 +22,7 @@ thread_analysis_SOURCES = thread_analysis.c
dh_speed_SOURCES = dh_speed.c
pubkey_speed_SOURCES = pubkey_speed.c
crypt_burn_SOURCES = crypt_burn.c
+hash_burn_SOURCES = hash_burn.c
fetch_SOURCES = fetch.c
id2sql_LDADD = $(top_builddir)/src/libstrongswan/libstrongswan.la
key2keyid_LDADD = $(top_builddir)/src/libstrongswan/libstrongswan.la
@@ -30,6 +31,7 @@ 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
+hash_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 f16ca8735..a50e8d6e0 100644
--- a/scripts/Makefile.in
+++ b/scripts/Makefile.in
@@ -37,8 +37,8 @@ host_triplet = @host@
noinst_PROGRAMS = bin2array$(EXEEXT) bin2sql$(EXEEXT) id2sql$(EXEEXT) \
key2keyid$(EXEEXT) keyid2sql$(EXEEXT) oid2der$(EXEEXT) \
thread_analysis$(EXEEXT) dh_speed$(EXEEXT) \
- pubkey_speed$(EXEEXT) crypt_burn$(EXEEXT) fetch$(EXEEXT) \
- $(am__EXEEXT_1)
+ pubkey_speed$(EXEEXT) crypt_burn$(EXEEXT) hash_burn$(EXEEXT) \
+ fetch$(EXEEXT) $(am__EXEEXT_1)
@USE_TLS_TRUE@am__append_1 = tls_test
subdir = scripts
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
@@ -55,6 +55,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/config/libtool.m4 \
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
@USE_TLS_TRUE@am__EXEEXT_1 = tls_test$(EXEEXT)
@@ -77,6 +78,10 @@ am_fetch_OBJECTS = fetch.$(OBJEXT)
fetch_OBJECTS = $(am_fetch_OBJECTS)
fetch_DEPENDENCIES = \
$(top_builddir)/src/libstrongswan/libstrongswan.la
+am_hash_burn_OBJECTS = hash_burn.$(OBJEXT)
+hash_burn_OBJECTS = $(am_hash_burn_OBJECTS)
+hash_burn_DEPENDENCIES = \
+ $(top_builddir)/src/libstrongswan/libstrongswan.la
am_id2sql_OBJECTS = id2sql.$(OBJEXT)
id2sql_OBJECTS = $(am_id2sql_OBJECTS)
id2sql_DEPENDENCIES = \
@@ -105,7 +110,7 @@ am__tls_test_SOURCES_DIST = tls_test.c
tls_test_OBJECTS = $(am_tls_test_OBJECTS)
@USE_TLS_TRUE@tls_test_DEPENDENCIES = $(top_builddir)/src/libstrongswan/libstrongswan.la \
@USE_TLS_TRUE@ $(top_builddir)/src/libtls/libtls.la
-DEFAULT_INCLUDES = -I.@am__isrc@
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
am__mv = mv -f
@@ -120,14 +125,16 @@ LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
$(LDFLAGS) -o $@
SOURCES = $(bin2array_SOURCES) $(bin2sql_SOURCES) \
$(crypt_burn_SOURCES) $(dh_speed_SOURCES) $(fetch_SOURCES) \
- $(id2sql_SOURCES) $(key2keyid_SOURCES) $(keyid2sql_SOURCES) \
- $(oid2der_SOURCES) $(pubkey_speed_SOURCES) \
- $(thread_analysis_SOURCES) $(tls_test_SOURCES)
+ $(hash_burn_SOURCES) $(id2sql_SOURCES) $(key2keyid_SOURCES) \
+ $(keyid2sql_SOURCES) $(oid2der_SOURCES) \
+ $(pubkey_speed_SOURCES) $(thread_analysis_SOURCES) \
+ $(tls_test_SOURCES)
DIST_SOURCES = $(bin2array_SOURCES) $(bin2sql_SOURCES) \
$(crypt_burn_SOURCES) $(dh_speed_SOURCES) $(fetch_SOURCES) \
- $(id2sql_SOURCES) $(key2keyid_SOURCES) $(keyid2sql_SOURCES) \
- $(oid2der_SOURCES) $(pubkey_speed_SOURCES) \
- $(thread_analysis_SOURCES) $(am__tls_test_SOURCES_DIST)
+ $(hash_burn_SOURCES) $(id2sql_SOURCES) $(key2keyid_SOURCES) \
+ $(keyid2sql_SOURCES) $(oid2der_SOURCES) \
+ $(pubkey_speed_SOURCES) $(thread_analysis_SOURCES) \
+ $(am__tls_test_SOURCES_DIST)
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -139,6 +146,7 @@ AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
+BFDLIB = @BFDLIB@
BTLIB = @BTLIB@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
@@ -233,11 +241,14 @@ build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
c_plugins = @c_plugins@
+charon_natt_port = @charon_natt_port@
+charon_plugins = @charon_plugins@
+charon_udp_port = @charon_udp_port@
clearsilver_LIBS = @clearsilver_LIBS@
datadir = @datadir@
datarootdir = @datarootdir@
dbusservicedir = @dbusservicedir@
-default_pkcs11 = @default_pkcs11@
+dev_headers = @dev_headers@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
@@ -254,11 +265,12 @@ imcvdir = @imcvdir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
+ipsec_script = @ipsec_script@
+ipsec_script_upper = @ipsec_script_upper@
ipsecdir = @ipsecdir@
ipsecgroup = @ipsecgroup@
ipseclibdir = @ipseclibdir@
ipsecuser = @ipsecuser@
-libcharon_plugins = @libcharon_plugins@
libdir = @libdir@
libexecdir = @libexecdir@
linux_headers = @linux_headers@
@@ -274,6 +286,7 @@ mkdir_p = @mkdir_p@
nm_CFLAGS = @nm_CFLAGS@
nm_LIBS = @nm_LIBS@
nm_ca_dir = @nm_ca_dir@
+nm_plugins = @nm_plugins@
oldincludedir = @oldincludedir@
openac_plugins = @openac_plugins@
p_plugins = @p_plugins@
@@ -283,7 +296,6 @@ pdfdir = @pdfdir@
piddir = @piddir@
pki_plugins = @pki_plugins@
plugindir = @plugindir@
-pluto_plugins = @pluto_plugins@
pool_plugins = @pool_plugins@
prefix = @prefix@
program_transform_name = @program_transform_name@
@@ -329,6 +341,7 @@ thread_analysis_SOURCES = thread_analysis.c
dh_speed_SOURCES = dh_speed.c
pubkey_speed_SOURCES = pubkey_speed.c
crypt_burn_SOURCES = crypt_burn.c
+hash_burn_SOURCES = hash_burn.c
fetch_SOURCES = fetch.c
id2sql_LDADD = $(top_builddir)/src/libstrongswan/libstrongswan.la
key2keyid_LDADD = $(top_builddir)/src/libstrongswan/libstrongswan.la
@@ -337,6 +350,7 @@ 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
+hash_burn_LDADD = $(top_builddir)/src/libstrongswan/libstrongswan.la
fetch_LDADD = $(top_builddir)/src/libstrongswan/libstrongswan.la
all: all-am
@@ -396,6 +410,9 @@ dh_speed$(EXEEXT): $(dh_speed_OBJECTS) $(dh_speed_DEPENDENCIES)
fetch$(EXEEXT): $(fetch_OBJECTS) $(fetch_DEPENDENCIES)
@rm -f fetch$(EXEEXT)
$(LINK) $(fetch_OBJECTS) $(fetch_LDADD) $(LIBS)
+hash_burn$(EXEEXT): $(hash_burn_OBJECTS) $(hash_burn_DEPENDENCIES)
+ @rm -f hash_burn$(EXEEXT)
+ $(LINK) $(hash_burn_OBJECTS) $(hash_burn_LDADD) $(LIBS)
id2sql$(EXEEXT): $(id2sql_OBJECTS) $(id2sql_DEPENDENCIES)
@rm -f id2sql$(EXEEXT)
$(LINK) $(id2sql_OBJECTS) $(id2sql_LDADD) $(LIBS)
@@ -429,6 +446,7 @@ distclean-compile:
@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)/hash_burn.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@
diff --git a/scripts/bin2array.c b/scripts/bin2array.c
index 5e0ad7c74..b82391a12 100644
--- a/scripts/bin2array.c
+++ b/scripts/bin2array.c
@@ -1,3 +1,17 @@
+/*
+ * Copyright (C) 2008 Martin Willi
+ * Hochschule fuer Technik Rapperswil
+ *
+ * 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>
diff --git a/scripts/bin2sql.c b/scripts/bin2sql.c
index ce5e600a3..88edb7f7a 100644
--- a/scripts/bin2sql.c
+++ b/scripts/bin2sql.c
@@ -1,3 +1,17 @@
+/*
+ * Copyright (C) 2008 Martin Willi
+ * Hochschule fuer Technik Rapperswil
+ *
+ * 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>
diff --git a/scripts/crypt_burn.c b/scripts/crypt_burn.c
index 5c41b191b..449364a1a 100644
--- a/scripts/crypt_burn.c
+++ b/scripts/crypt_burn.c
@@ -1,7 +1,20 @@
+/*
+ * 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 <library.h>
-#include <crypto/proposal/proposal_keywords.h>
int main(int argc, char *argv[])
{
@@ -33,7 +46,7 @@ int main(int argc, char *argv[])
limit = atoi(argv[2]);
}
- token = proposal_get_token(argv[1], strlen(argv[1]));
+ token = lib->proposal->get_token(lib->proposal, argv[1]);
if (!token)
{
fprintf(stderr, "algorithm '%s' unknown!\n", argv[1]);
@@ -56,10 +69,14 @@ int main(int argc, char *argv[])
}
while (TRUE)
{
- aead->encrypt(aead,
+ if (!aead->encrypt(aead,
chunk_create(buffer, sizeof(buffer) - aead->get_icv_size(aead)),
chunk_from_thing(assoc),
- chunk_create(iv, aead->get_iv_size(aead)), NULL);
+ chunk_create(iv, aead->get_iv_size(aead)), NULL))
+ {
+ fprintf(stderr, "aead encryption failed!\n");
+ return 1;
+ }
if (!aead->decrypt(aead, chunk_create(buffer, sizeof(buffer)),
chunk_from_thing(assoc),
chunk_create(iv, aead->get_iv_size(aead)), NULL))
@@ -86,12 +103,18 @@ int main(int argc, char *argv[])
while (i--)
{
- crypter->encrypt(crypter,
- chunk_create(buffer, sizeof(buffer) / bs * bs),
- chunk_create(iv, crypter->get_iv_size(crypter)), NULL);
- crypter->decrypt(crypter,
- chunk_create(buffer, sizeof(buffer) / bs * bs),
- chunk_create(iv, crypter->get_iv_size(crypter)), NULL);
+ if (!crypter->encrypt(crypter,
+ chunk_create(buffer, sizeof(buffer) / bs * bs),
+ chunk_create(iv, crypter->get_iv_size(crypter)), NULL))
+ {
+ continue;
+ }
+ if (!crypter->decrypt(crypter,
+ chunk_create(buffer, sizeof(buffer) / bs * bs),
+ chunk_create(iv, crypter->get_iv_size(crypter)), NULL))
+ {
+ continue;
+ }
if (limit && ++i == limit)
{
break;
diff --git a/scripts/dh_speed.c b/scripts/dh_speed.c
index ce102491b..629a8eabb 100644
--- a/scripts/dh_speed.c
+++ b/scripts/dh_speed.c
@@ -1,3 +1,17 @@
+/*
+ * Copyright (C) 2009 Martin Willi
+ * Hochschule fuer Technik Rapperswil
+ *
+ * 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 <time.h>
diff --git a/scripts/hash_burn.c b/scripts/hash_burn.c
new file mode 100644
index 000000000..e616d6d5a
--- /dev/null
+++ b/scripts/hash_burn.c
@@ -0,0 +1,74 @@
+/*
+ * Copyright (C) 2012 Martin Willi
+ * Copyright (C) 2012 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 <library.h>
+
+
+
+int main(int argc, char *argv[])
+{
+ hash_algorithm_t alg;
+ hasher_t *hasher;
+ char buffer[1024];
+ int limit = 0, i = 0;
+
+ library_init(NULL);
+ lib->plugins->load(lib->plugins, NULL, PLUGINS);
+ atexit(library_deinit);
+
+ printf("loaded: %s\n", PLUGINS);
+
+ memset(buffer, 0x12, sizeof(buffer));
+
+ if (argc < 2)
+ {
+ fprintf(stderr, "usage: %s <algorithm>!\n", argv[0]);
+ return 1;
+ }
+ if (argc > 2)
+ {
+ limit = atoi(argv[2]);
+ }
+
+ alg = enum_from_name(hash_algorithm_short_names, argv[1]);
+ if (alg == -1)
+ {
+ fprintf(stderr, "unknown hash algorthm: %s\n", argv[1]);
+ return 1;
+ }
+ hasher = lib->crypto->create_hasher(lib->crypto, alg);
+ if (!hasher)
+ {
+ fprintf(stderr, "hash algorthm not supported: %N\n",
+ hash_algorithm_names, alg);
+ return 1;
+ }
+
+ while (TRUE)
+ {
+ if (!hasher->get_hash(hasher, chunk_from_thing(buffer), buffer))
+ {
+ fprintf(stderr, "hashing failed!\n");
+ return 1;
+ }
+ if (limit && ++i == limit)
+ {
+ break;
+ }
+ }
+ hasher->destroy(hasher);
+ return 0;
+}
diff --git a/scripts/id2sql.c b/scripts/id2sql.c
index 5bc94f5b6..0742c1c71 100644
--- a/scripts/id2sql.c
+++ b/scripts/id2sql.c
@@ -1,3 +1,17 @@
+/*
+ * Copyright (C) 2008 Martin Willi
+ * Hochschule fuer Technik Rapperswil
+ *
+ * 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 <utils/identification.h>
diff --git a/scripts/key2keyid.c b/scripts/key2keyid.c
index 6a8301c6a..5b63381b8 100644
--- a/scripts/key2keyid.c
+++ b/scripts/key2keyid.c
@@ -1,3 +1,17 @@
+/*
+ * Copyright (C) 2008-2009 Martin Willi
+ * Hochschule fuer Technik Rapperswil
+ *
+ * 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 <library.h>
diff --git a/scripts/keyid2sql.c b/scripts/keyid2sql.c
index e37303c08..7cad4c45e 100644
--- a/scripts/keyid2sql.c
+++ b/scripts/keyid2sql.c
@@ -1,3 +1,17 @@
+/*
+ * Copyright (C) 2008 Andreas Steffen
+ * Hochschule fuer Technik Rapperswil
+ *
+ * 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 <library.h>
diff --git a/scripts/oid2der.c b/scripts/oid2der.c
index 0da3bbb62..793c9804a 100644
--- a/scripts/oid2der.c
+++ b/scripts/oid2der.c
@@ -1,3 +1,17 @@
+/*
+ * 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 <asn1/asn1.h>