diff options
author | Rob Austein <sra@hactrn.net> | 2008-07-07 18:16:54 +0000 |
---|---|---|
committer | Rob Austein <sra@hactrn.net> | 2008-07-07 18:16:54 +0000 |
commit | 8d95ff37ee5c9802189697ab6511f8fac593a25f (patch) | |
tree | edb15a321dd639ea5e6a13c982f2f60a9604d24d /utils | |
parent | 1bba780fb11d5b48a0951ccdf442934417c0e323 (diff) |
Add test_roa.sh wrapper script.
svn path=/utils/find_roa/Makefile; revision=1977
Diffstat (limited to 'utils')
-rw-r--r-- | utils/find_roa/Makefile | 7 | ||||
-rw-r--r-- | utils/find_roa/test_roa.sh | 35 | ||||
-rw-r--r-- | utils/hashdir/Makefile | 2 |
3 files changed, 41 insertions, 3 deletions
diff --git a/utils/find_roa/Makefile b/utils/find_roa/Makefile index 0832aec7..7d22c936 100644 --- a/utils/find_roa/Makefile +++ b/utils/find_roa/Makefile @@ -15,10 +15,13 @@ LIB = ${OPENSSL_DIR}/libcrypto.a all: ${BIN} clean: - rm -f ${BIN} ${OBJ} + rm -rf ${BIN} ${OBJ} hashed-pem-dir ${BIN}: ${OBJ} ${LIB} Makefile ${CC} -g -o $@ ${OBJ} ${LIB} +TEST_ARGS = ../../rcynic/rcynic-data/authenticated 10.3.0.44 10.2.0.6 10.0.0.0/24 + test: ${BIN} - ./${BIN} ../../rcynic/rcynic-data/authenticated 10.3.0.44 10.2.0.6 10.0.0.0/24 +# ./${BIN} ${TEST_ARGS} + sh ./test_roa.sh ${TEST_ARGS} diff --git a/utils/find_roa/test_roa.sh b/utils/find_roa/test_roa.sh new file mode 100644 index 00000000..aa95b91c --- /dev/null +++ b/utils/find_roa/test_roa.sh @@ -0,0 +1,35 @@ +#!/bin/sh - +# +# Copyright (C) 2006--2008 American Registry for Internet Numbers ("ARIN") +# +# Permission to use, copy, modify, and distribute this software for any +# purpose with or without fee is hereby granted, provided that the above +# copyright notice and this permission notice appear in all copies. +# +# THE SOFTWARE IS PROVIDED "AS IS" AND ARIN DISCLAIMS ALL WARRANTIES WITH +# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +# AND FITNESS. IN NO EVENT SHALL ARIN BE LIABLE FOR ANY SPECIAL, DIRECT, +# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE +# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +# PERFORMANCE OF THIS SOFTWARE. +# +# $Id$ + +auth_dir="${1?"usage: $0 authenticated_certificate_tree prefix [prefix...]"}" + +rm -rf hashed-pem-dir +mkdir hashed-pem-dir + +../hashdir/hashdir "$auth_dir" hashed-pem-dir >/dev/null + +./find_roa "$@" | awk ' + $1 == "ASN" && $3 == "prefix" && $5 == "ROA" { + print ""; + print "Found match:" + print; + print "Verifying certificate chain and signatures:" + roa = $6; + if (!system("../../openssl/openssl/apps/openssl cms -verify -inform DER -out /dev/null -CApath hashed-pem-dir -in " roa)) + system("../print_roa/print_roa " roa); + }' diff --git a/utils/hashdir/Makefile b/utils/hashdir/Makefile index 2031f136..7c779d7a 100644 --- a/utils/hashdir/Makefile +++ b/utils/hashdir/Makefile @@ -19,7 +19,7 @@ ${BIN}: ${OBJ} ${LIB} Makefile ${CC} -g -o $@ ${OBJ} ${LIB} INPUT = ../../rcynic/rcynic-data/authenticated -OUTPUT = test.out +OUTPUT = hashed-pem-dir test: ${BIN} if test -d ${INPUT}; then rm -rf ${OUTPUT} && mkdir ${OUTPUT} && ./hashdir ${INPUT} ${OUTPUT}; else :; fi |