prereq.sh revision ba751492fcc4f161a18b983d4f018a1a52938cb9
63af1a646a006867dbd99dc0aa74559d832a420fMark Andrews#!/bin/sh
63af1a646a006867dbd99dc0aa74559d832a420fMark Andrews#
a3128c1995310262648e575a9ff148d5741fd167Tinderbox User# Copyright (C) 2010, 2012 Internet Systems Consortium, Inc. ("ISC")
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews#
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews# Permission to use, copy, modify, and/or distribute this software for any
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews# purpose with or without fee is hereby granted, provided that the above
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews# copyright notice and this permission notice appear in all copies.
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews#
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews# AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews# PERFORMANCE OF THIS SOFTWARE.
63af1a646a006867dbd99dc0aa74559d832a420fMark Andrews
ad0471f93b33ef24d3ade731477d63669a7095dbAutomatic Updater# $Id: prereq.sh,v 1.3 2010/06/08 23:50:24 tbox Exp $
63af1a646a006867dbd99dc0aa74559d832a420fMark Andrews
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan HuntSYSTEMTESTTOP=..
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt. $SYSTEMTESTTOP/conf.sh
63af1a646a006867dbd99dc0aa74559d832a420fMark Andrews../../../tools/genrandom 400 random.data
63af1a646a006867dbd99dc0aa74559d832a420fMark Andrews
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Huntrsafail=0 eccfail=0
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt$KEYGEN -q -r random.data foo > /dev/null 2>&1 || rsafail=1
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Huntrm -f Kfoo*
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt$KEYGEN -q -a ECDSAP256SHA256 -r random.data foo > /dev/null 2>&1 || eccfail=1
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Huntrm -f Kfoo*
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Huntif [ $rsafail = 0 -a $eccfail = 0 ]; then
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt echo both > supported
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Huntelif [ $rsafail = 1 -a $eccfail = 1 ]; then
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt echo "I:This test requires PKCS#11 support for either RSA or ECDSA cryptography." >&2
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt exit 255
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Huntelif [ $rsafail = 0 ]; then
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt echo rsaonly > supported
63af1a646a006867dbd99dc0aa74559d832a420fMark Andrewselse
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt echo ecconly > supported
63af1a646a006867dbd99dc0aa74559d832a420fMark Andrewsfi