diff options
Diffstat (limited to 'src/stroke')
-rw-r--r-- | src/stroke/Makefile.am | 6 | ||||
-rw-r--r-- | src/stroke/Makefile.in | 70 | ||||
-rw-r--r-- | src/stroke/stroke.c | 34 | ||||
-rw-r--r-- | src/stroke/stroke_keywords.c | 108 | ||||
-rw-r--r-- | src/stroke/stroke_keywords.h | 4 | ||||
-rw-r--r-- | src/stroke/stroke_keywords.txt | 5 | ||||
-rw-r--r-- | src/stroke/stroke_msg.h | 4 |
7 files changed, 149 insertions, 82 deletions
diff --git a/src/stroke/Makefile.am b/src/stroke/Makefile.am index f93680b64..ed170bd08 100644 --- a/src/stroke/Makefile.am +++ b/src/stroke/Makefile.am @@ -4,11 +4,13 @@ stroke_SOURCES = \ stroke.c stroke_msg.h stroke_keywords.c stroke_keywords.h stroke_LDADD = $(top_builddir)/src/libstrongswan/libstrongswan.la $(SOCKLIB) -INCLUDES = -I$(top_srcdir)/src/libstrongswan EXTRA_DIST = stroke_keywords.txt Android.mk BUILT_SOURCES = stroke_keywords.c MAINTAINERCLEANFILES = stroke_keywords.c -AM_CFLAGS = -DIPSEC_PIDDIR=\"${piddir}\" +AM_CPPFLAGS = \ + -I$(top_srcdir)/src/libstrongswan \ + -DIPSEC_PIDDIR=\"${piddir}\" stroke_keywords.c: $(srcdir)/stroke_keywords.txt $(srcdir)/stroke_keywords.h + $(AM_V_GEN) \ $(GPERF) -m 10 -D -C -G -t < $(srcdir)/stroke_keywords.txt > $@ diff --git a/src/stroke/Makefile.in b/src/stroke/Makefile.in index e73489058..21f9349cd 100644 --- a/src/stroke/Makefile.in +++ b/src/stroke/Makefile.in @@ -63,7 +63,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/config/libtool.m4 \ $(top_srcdir)/m4/macros/with.m4 \ $(top_srcdir)/m4/macros/enable-disable.m4 \ $(top_srcdir)/m4/macros/add-plugin.m4 \ - $(top_srcdir)/configure.in + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -78,19 +78,35 @@ am__DEPENDENCIES_1 = stroke_DEPENDENCIES = \ $(top_builddir)/src/libstrongswan/libstrongswan.la \ $(am__DEPENDENCIES_1) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ CCLD = $(CC) -LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ - $(LDFLAGS) -o $@ +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; SOURCES = $(stroke_SOURCES) DIST_SOURCES = $(stroke_SOURCES) am__can_run_installinfo = \ @@ -104,6 +120,7 @@ DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ @@ -116,6 +133,8 @@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_CFLAGS = @CHECK_CFLAGS@ CHECK_LIBS = @CHECK_LIBS@ +COVERAGE_CFLAGS = @COVERAGE_CFLAGS@ +COVERAGE_LDFLAGS = @COVERAGE_LDFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ @@ -131,6 +150,7 @@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +GENHTML = @GENHTML@ GPERF = @GPERF@ GPRBUILD = @GPRBUILD@ GREP = @GREP@ @@ -139,6 +159,7 @@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LCOV = @LCOV@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ @@ -185,6 +206,7 @@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOCKLIB = @SOCKLIB@ STRIP = @STRIP@ +UNWINDLIB = @UNWINDLIB@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ @@ -213,6 +235,7 @@ charon_natt_port = @charon_natt_port@ charon_plugins = @charon_plugins@ charon_udp_port = @charon_udp_port@ clearsilver_LIBS = @clearsilver_LIBS@ +cmd_plugins = @cmd_plugins@ datadir = @datadir@ datarootdir = @datarootdir@ dbusservicedir = @dbusservicedir@ @@ -294,11 +317,13 @@ stroke_SOURCES = \ stroke.c stroke_msg.h stroke_keywords.c stroke_keywords.h stroke_LDADD = $(top_builddir)/src/libstrongswan/libstrongswan.la $(SOCKLIB) -INCLUDES = -I$(top_srcdir)/src/libstrongswan EXTRA_DIST = stroke_keywords.txt Android.mk BUILT_SOURCES = stroke_keywords.c MAINTAINERCLEANFILES = stroke_keywords.c -AM_CFLAGS = -DIPSEC_PIDDIR=\"${piddir}\" +AM_CPPFLAGS = \ + -I$(top_srcdir)/src/libstrongswan \ + -DIPSEC_PIDDIR=\"${piddir}\" + all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-am @@ -382,7 +407,7 @@ clean-ipsecPROGRAMS: rm -f $$list stroke$(EXEEXT): $(stroke_OBJECTS) $(stroke_DEPENDENCIES) $(EXTRA_stroke_DEPENDENCIES) @rm -f stroke$(EXEEXT) - $(LINK) $(stroke_OBJECTS) $(stroke_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(stroke_OBJECTS) $(stroke_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -394,25 +419,25 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stroke_keywords.Po@am__quote@ .c.o: -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c $< +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< .c.obj: -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: -@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo @@ -632,6 +657,7 @@ uninstall-am: uninstall-ipsecPROGRAMS stroke_keywords.c: $(srcdir)/stroke_keywords.txt $(srcdir)/stroke_keywords.h + $(AM_V_GEN) \ $(GPERF) -m 10 -D -C -G -t < $(srcdir)/stroke_keywords.txt > $@ # Tell versions [3.59,3.63) of GNU make to not export all variables. diff --git a/src/stroke/stroke.c b/src/stroke/stroke.c index 3273aedf2..75f014516 100644 --- a/src/stroke/stroke.c +++ b/src/stroke/stroke.c @@ -36,6 +36,8 @@ struct stroke_token { stroke_keyword_t kw; }; +static int output_verbosity = 1; /* CONTROL */ + static char* push_string(stroke_msg_t *msg, char *string) { unsigned long string_start = msg->length; @@ -61,7 +63,7 @@ static int send_stroke_msg (stroke_msg_t *msg) ctl_addr.sun_family = AF_UNIX; strcpy(ctl_addr.sun_path, STROKE_SOCKET); - msg->output_verbosity = 1; /* CONTROL */ + msg->output_verbosity = output_verbosity; sock = socket(AF_UNIX, SOCK_STREAM, 0); if (sock < 0) @@ -91,11 +93,11 @@ static int send_stroke_msg (stroke_msg_t *msg) /* we prompt if we receive a magic keyword */ if ((byte_count >= 12 && - strcmp(buffer + byte_count - 12, "Passphrase:\n") == 0) || + streq(buffer + byte_count - 12, "Passphrase:\n")) || (byte_count >= 10 && - strcmp(buffer + byte_count - 10, "Password:\n") == 0) || + streq(buffer + byte_count - 10, "Password:\n")) || (byte_count >= 5 && - strcmp(buffer + byte_count - 5, "PIN:\n") == 0)) + streq(buffer + byte_count - 5, "PIN:\n"))) { /* remove trailing newline */ pass = strrchr(buffer, '\n'); @@ -321,6 +323,8 @@ static int purge(stroke_keyword_t kw) static int export_flags[] = { EXPORT_X509, + EXPORT_CONN_CERT, + EXPORT_CONN_CHAIN, }; static int export(stroke_keyword_t kw, char *selector) @@ -413,9 +417,15 @@ static void exit_usage(char *error) printf(" Initiate a connection:\n"); printf(" stroke up NAME\n"); printf(" where: NAME is a connection name added with \"stroke add\"\n"); + printf(" Initiate a connection without blocking:\n"); + printf(" stroke up-nb NAME\n"); + printf(" where: NAME is a connection name added with \"stroke add\"\n"); printf(" Terminate a connection:\n"); printf(" stroke down NAME\n"); printf(" where: NAME is a connection name added with \"stroke add\"\n"); + printf(" Terminate a connection without blocking:\n"); + printf(" stroke down-nb NAME\n"); + printf(" where: NAME is a connection name added with \"stroke add\"\n"); printf(" Terminate a connection by remote srcip:\n"); printf(" stroke down-srcip START [END]\n"); printf(" where: START and optional END define the clients source IP\n"); @@ -428,7 +438,7 @@ static void exit_usage(char *error) printf(" Show extended status information:\n"); printf(" stroke statusall\n"); printf(" Show extended status information without blocking:\n"); - printf(" stroke statusallnb\n"); + printf(" stroke statusall-nb\n"); printf(" Show list of authority and attribute certificates:\n"); printf(" stroke listcacerts|listocspcerts|listaacerts|listacerts\n"); printf(" Show list of end entity certificates, ca info records and crls:\n"); @@ -449,6 +459,8 @@ static void exit_usage(char *error) printf(" stroke purgeike\n"); printf(" Export credentials to the console:\n"); printf(" stroke exportx509 DN\n"); + printf(" stroke exportconncert connname\n"); + printf(" stroke exportconnchain connname\n"); printf(" Show current memory usage:\n"); printf(" stroke memusage\n"); printf(" Show leases of a pool:\n"); @@ -503,6 +515,9 @@ int main(int argc, char *argv[]) } res = del_connection(argv[2]); break; + case STROKE_UP_NOBLK: + output_verbosity = -1; + /* fall-through */ case STROKE_UP: if (argc < 3) { @@ -510,6 +525,9 @@ int main(int argc, char *argv[]) } res = initiate_connection(argv[2]); break; + case STROKE_DOWN_NOBLK: + output_verbosity = -1; + /* fall-through */ case STROKE_DOWN: if (argc < 3) { @@ -569,7 +587,7 @@ int main(int argc, char *argv[]) case STROKE_LIST_ALGS: case STROKE_LIST_PLUGINS: case STROKE_LIST_ALL: - res = list(token->kw, argc > 2 && strcmp(argv[2], "--utc") == 0); + res = list(token->kw, argc > 2 && streq(argv[2], "--utc")); break; case STROKE_REREAD_SECRETS: case STROKE_REREAD_CACERTS: @@ -587,9 +605,11 @@ int main(int argc, char *argv[]) res = purge(token->kw); break; case STROKE_EXPORT_X509: + case STROKE_EXPORT_CONN_CERT: + case STROKE_EXPORT_CONN_CHAIN: if (argc != 3) { - exit_usage("\"exportx509\" needs a distinguished name"); + exit_usage("\"export\" needs a name"); } res = export(token->kw, argv[2]); break; diff --git a/src/stroke/stroke_keywords.c b/src/stroke/stroke_keywords.c index 084df986d..ed0c4ceb4 100644 --- a/src/stroke/stroke_keywords.c +++ b/src/stroke/stroke_keywords.c @@ -54,12 +54,12 @@ struct stroke_token { stroke_keyword_t kw; }; -#define TOTAL_KEYWORDS 43 +#define TOTAL_KEYWORDS 48 #define MIN_WORD_LENGTH 2 #define MAX_WORD_LENGTH 15 -#define MIN_HASH_VALUE 4 -#define MAX_HASH_VALUE 50 -/* maximum key range = 47, duplicates = 0 */ +#define MIN_HASH_VALUE 3 +#define MAX_HASH_VALUE 59 +/* maximum key range = 57, duplicates = 0 */ #ifdef __GNUC__ __inline @@ -75,32 +75,32 @@ hash (str, len) { static const unsigned char asso_values[] = { - 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, - 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, - 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, - 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, - 51, 51, 51, 51, 51, 19, 51, 51, 51, 51, - 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, - 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, - 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, - 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, - 51, 51, 51, 51, 51, 51, 51, 1, 29, 2, - 2, 16, 51, 21, 51, 11, 51, 16, 1, 1, - 51, 18, 7, 51, 6, 12, 6, 11, 51, 51, - 4, 13, 51, 51, 51, 51, 51, 51, 51, 51, - 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, - 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, - 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, - 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, - 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, - 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, - 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, - 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, - 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, - 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, - 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, - 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, - 51, 51, 51, 51, 51, 51 + 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 25, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 0, 18, 1, + 1, 15, 60, 23, 60, 23, 60, 11, 0, 7, + 60, 24, 14, 60, 6, 9, 16, 9, 60, 60, + 2, 3, 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60 }; register int hval = len; @@ -131,9 +131,9 @@ static const struct stroke_token wordlist[] = {"listall", STROKE_LIST_ALL}, {"listcrls", STROKE_LIST_CRLS}, {"up", STROKE_UP}, - {"delete", STROKE_DELETE}, {"listaacerts", STROKE_LIST_AACERTS}, {"listcacerts", STROKE_LIST_CACERTS}, + {"rekey", STROKE_REKEY}, {"rereadall", STROKE_REREAD_ALL}, {"listcerts", STROKE_LIST_CERTS}, {"rereadcrls", STROKE_REREAD_CRLS}, @@ -141,41 +141,47 @@ static const struct stroke_token wordlist[] = {"rereadaacerts", STROKE_REREAD_AACERTS}, {"rereadcacerts", STROKE_REREAD_CACERTS}, {"leases", STROKE_LEASES}, - {"rekey", STROKE_REKEY}, - {"listcainfos", STROKE_LIST_CAINFOS}, {"listcounters", STROKE_COUNTERS}, - {"route", STROKE_ROUTE}, - {"listacerts", STROKE_LIST_ACERTS}, + {"delete", STROKE_DELETE}, {"status", STROKE_STATUS}, - {"listplugins", STROKE_LIST_PLUGINS}, - {"listalgs", STROKE_LIST_ALGS}, - {"rereadsecrets", STROKE_REREAD_SECRETS}, + {"listacerts", STROKE_LIST_ACERTS}, + {"route", STROKE_ROUTE}, {"statusall", STROKE_STATUSALL}, - {"purgeocsp", STROKE_PURGE_OCSP}, + {"rereadsecrets", STROKE_REREAD_SECRETS}, {"statusallnb", STROKE_STATUSALL_NOBLK}, + {"statusall-nb", STROKE_STATUSALL_NOBLK}, + {"listalgs", STROKE_LIST_ALGS}, + {"up-nb", STROKE_UP_NOBLK}, {"exportx509", STROKE_EXPORT_X509}, + {"listplugins", STROKE_LIST_PLUGINS}, + {"listcainfos", STROKE_LIST_CAINFOS}, + {"exportconncert", STROKE_EXPORT_CONN_CERT}, + {"exportconnchain", STROKE_EXPORT_CONN_CHAIN}, + {"loglevel", STROKE_LOGLEVEL}, + {"purgeocsp", STROKE_PURGE_OCSP}, + {"unroute", STROKE_UNROUTE}, + {"listocsp", STROKE_LIST_OCSP}, {"down-srcip", STROKE_DOWN_SRCIP}, + {"listpubkeys", STROKE_LIST_PUBKEYS}, {"purgecrls", STROKE_PURGE_CRLS}, - {"listocsp", STROKE_LIST_OCSP}, {"rereadocspcerts", STROKE_REREAD_OCSPCERTS}, - {"loglevel", STROKE_LOGLEVEL}, - {"memusage", STROKE_MEMUSAGE}, - {"resetcounters", STROKE_COUNTERS_RESET}, {"listocspcerts", STROKE_LIST_OCSPCERTS}, - {"unroute", STROKE_UNROUTE}, - {"user-creds", STROKE_USER_CREDS}, + {"memusage", STROKE_MEMUSAGE}, {"purgeike", STROKE_PURGE_IKE}, - {"listpubkeys", STROKE_LIST_PUBKEYS}, + {"user-creds", STROKE_USER_CREDS}, + {"down-nb", STROKE_DOWN_NOBLK}, {"purgecerts", STROKE_PURGE_CERTS}, - {"listgroups", STROKE_LIST_GROUPS} + {"listgroups", STROKE_LIST_GROUPS}, + {"resetcounters", STROKE_COUNTERS_RESET} }; static const short lookup[] = { - -1, -1, -1, -1, 0, 1, 2, -1, -1, -1, 3, -1, 4, 5, - 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, - 34, 35, 36, 37, 38, 39, 40, 41, 42 + -1, -1, -1, 0, 1, 2, -1, 3, -1, 4, -1, 5, 6, 7, + 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 40, 41, 42, -1, 43, 44, -1, -1, 45, -1, + -1, 46, -1, 47 }; #ifdef __GNUC__ diff --git a/src/stroke/stroke_keywords.h b/src/stroke/stroke_keywords.h index f5979a0e5..4a1016277 100644 --- a/src/stroke/stroke_keywords.h +++ b/src/stroke/stroke_keywords.h @@ -23,7 +23,9 @@ typedef enum { STROKE_ROUTE, STROKE_UNROUTE, STROKE_UP, + STROKE_UP_NOBLK, STROKE_DOWN, + STROKE_DOWN_NOBLK, STROKE_DOWN_SRCIP, STROKE_REKEY, STROKE_LOGLEVEL, @@ -55,6 +57,8 @@ typedef enum { STROKE_PURGE_CERTS, STROKE_PURGE_IKE, STROKE_EXPORT_X509, + STROKE_EXPORT_CONN_CERT, + STROKE_EXPORT_CONN_CHAIN, STROKE_LEASES, STROKE_MEMUSAGE, STROKE_USER_CREDS, diff --git a/src/stroke/stroke_keywords.txt b/src/stroke/stroke_keywords.txt index 5d2ebd9e2..ceb0dd253 100644 --- a/src/stroke/stroke_keywords.txt +++ b/src/stroke/stroke_keywords.txt @@ -30,13 +30,16 @@ delete, STROKE_DELETE route, STROKE_ROUTE unroute, STROKE_UNROUTE up, STROKE_UP +up-nb, STROKE_UP_NOBLK down, STROKE_DOWN +down-nb, STROKE_DOWN_NOBLK down-srcip, STROKE_DOWN_SRCIP rekey, STROKE_REKEY loglevel, STROKE_LOGLEVEL status, STROKE_STATUS statusall, STROKE_STATUSALL statusallnb, STROKE_STATUSALL_NOBLK +statusall-nb, STROKE_STATUSALL_NOBLK listpubkeys, STROKE_LIST_PUBKEYS listcerts, STROKE_LIST_CERTS listcacerts, STROKE_LIST_CACERTS @@ -62,6 +65,8 @@ purgecrls, STROKE_PURGE_CRLS purgecerts, STROKE_PURGE_CERTS purgeike, STROKE_PURGE_IKE exportx509, STROKE_EXPORT_X509 +exportconncert, STROKE_EXPORT_CONN_CERT +exportconnchain, STROKE_EXPORT_CONN_CHAIN leases, STROKE_LEASES memusage, STROKE_MEMUSAGE user-creds, STROKE_USER_CREDS diff --git a/src/stroke/stroke_msg.h b/src/stroke/stroke_msg.h index 5cee916cd..a4dfc5e7a 100644 --- a/src/stroke/stroke_msg.h +++ b/src/stroke/stroke_msg.h @@ -123,6 +123,10 @@ typedef enum export_flag_t export_flag_t; enum export_flag_t { /** export an X509 certificate */ EXPORT_X509 = 0x0001, + /** export an X509 end entity certificate for a connection */ + EXPORT_CONN_CERT = 0x0002, + /** export the complete trust chain of a connection */ + EXPORT_CONN_CHAIN = 0x0004, }; /** |