aboutsummaryrefslogtreecommitdiff
path: root/security/skip/scripts
diff options
context:
space:
mode:
authorJulian Elischer <julian@FreeBSD.org>1998-01-09 23:23:58 +0000
committerJulian Elischer <julian@FreeBSD.org>1998-01-09 23:23:58 +0000
commitde8a9e28514d8bc9a9fec2eea38c03176e927046 (patch)
treee5692950c8d78ca95a07e7aff61f86d562892e1c /security/skip/scripts
parentbec8f4d32e9df07647005d504bb93579e076c67e (diff)
Notes
Diffstat (limited to 'security/skip/scripts')
-rw-r--r--security/skip/scripts/post-install85
-rw-r--r--security/skip/scripts/pre-install132
-rw-r--r--security/skip/scripts/pre-patch12
3 files changed, 229 insertions, 0 deletions
diff --git a/security/skip/scripts/post-install b/security/skip/scripts/post-install
new file mode 100644
index 000000000000..c761d496c7e4
--- /dev/null
+++ b/security/skip/scripts/post-install
@@ -0,0 +1,85 @@
+#!/bin/sh
+
+# This is an interactive script to setup SKIP keys, etc.
+
+SKIP_ETC="${PREFIX}/etc/skip"
+SKIP_BIN="${PREFIX}/bin"
+
+Confirm()
+{
+ while true; do
+ {
+ YESNO="$2"
+ echo -n "$1? [${YESNO}] "
+ read NEWYESNO
+ if [ "${NEWYESNO}" != "" ]; then
+ YESNO=${NEWYESNO}
+ fi
+ if [ "${YESNO}" != "y" -a "${YESNO}" != "n" ]; then
+ echo "Please answer y or n."
+ else
+ break
+ fi
+ }
+ done
+ if [ "${YESNO}" != "y" ]; then
+ return 1
+ else
+ return 0
+ fi
+}
+
+init_skip_dbs ()
+{
+ echo "Initializing SKIP certification database..."
+ ${SKIP_BIN}/skipdb init -o
+
+ echo "Initializing SKIP authorities database..."
+ ${SKIP_BIN}/skipca init -r
+
+ echo "Initializing SKIP local identities database..."
+ ${SKIP_BIN}/skiplocal init -o
+}
+
+generate_key ()
+{
+ echo "Generating Diffie-Hellman public/private key pair..."
+ ${SKIP_BIN}/skiplocal keygen
+}
+
+activate_skip ()
+{
+ echo "Adding SKIP to primary network interface..."
+ ${SKIP_BIN}/skipif -a
+}
+
+# main()
+
+cat << xxENDxx
+
+You now have a chance to:
+
+ o Initialize your SKIP databases.
+ o Generate a Diffie-Hellman public/private key pair.
+ o Add SKIP to your primary network interface.
+
+Notes:
+
+ o If you have an existing working SKIP configuration that
+ you want to keep, you should choose NOT to proceed.
+ Proceeding will overwrite any existing SKIP configuration.
+ o If you choose not to proceed, you will have to initialize
+ the SKIP certification, authorities, and local identities
+ databases manually.
+ o SKIP will be active, but disabled, until you reboot and
+ enable it manually using the skiphost command as described
+ in step 5 of doc/INSTALL.
+
+xxENDxx
+
+Confirm "Do you want to proceed" "y" || exit 0
+
+init_skip_dbs;
+generate_key;
+activate_skip;
+
diff --git a/security/skip/scripts/pre-install b/security/skip/scripts/pre-install
new file mode 100644
index 000000000000..dac838f8ed37
--- /dev/null
+++ b/security/skip/scripts/pre-install
@@ -0,0 +1,132 @@
+#!/bin/sh
+
+#
+# The skip build process actually builds a tree of files
+# in the subdirectory SKIPDIR (defined below). So all we
+# have to do is install these files, with some slight
+# rearrangement, and then deal with the rc script stuff.
+#
+
+SKIPDIR="${WRKSRC}/mkpkgs/freebsd/bin.x86/skip"
+
+Report ()
+{
+ echo " " $1
+}
+
+install_lkm_files ()
+{
+ LKM_FILES="drv/skip.o"
+
+ Report "Installing kernel module in ${PREFIX}/lkm"
+ ${BSD_INSTALL_DATA} ${LKM_FILES} ${PREFIX}/lkm
+}
+
+install_etc_files ()
+{
+ ETC_FILES="etc/dh_params \
+ etc/skipd.conf \
+ etc/SunICG_CA_selfcert"
+ RAS_FILES="bin/none.ras \
+ bin/unknown.ras \
+ bin/icon_v1.ras \
+ bin/icon_v2.ras \
+ bin/skiptool_small.ras \
+ bin/updated.ras \
+ bin/nomadic.ras"
+ SCR_FILES="etc/skip.mkdev \
+ etc/hosts"
+
+ Report "Installing miscellaneous files in ${PREFIX}/etc/skip"
+ ${BSD_INSTALL_DATA} ${ETC_FILES} ${PREFIX}/etc/skip
+ ${BSD_INSTALL_DATA} ${RAS_FILES} ${PREFIX}/etc/skip
+ ${BSD_INSTALL_SCRIPT} ${SCR_FILES} ${PREFIX}/etc/skip
+}
+
+install_bin_files ()
+{
+ BIN_FILES="bin/skiptool \
+ bin/skiphost \
+ bin/skipstat \
+ bin/skiplog \
+ bin/skipstat_ui \
+ bin/skipvar \
+ bin/test_key \
+ bin/skipd \
+ bin/skipdb \
+ bin/skipca \
+ bin/skiplocal \
+ bin/certreq \
+ bin/X509toHashCert \
+ bin/dh_keygen \
+ bin/print_cert"
+ SCRIPT_FILES="bin/install_skip_keys \
+ bin/skipd_restart \
+ bin/skipif \
+ bin/skip_conf"
+
+ Report "Installing binaries and scripts in ${PREFIX}/bin"
+ ${BSD_INSTALL_PROGRAM} ${BIN_FILES} ${PREFIX}/bin
+ ${BSD_INSTALL_SCRIPT} ${SCRIPT_FILES} ${PREFIX}/bin
+}
+
+install_doc_files ()
+{
+ DOC_FILES="doc/SKIP_SOFTWARE_LICENSE \
+ doc/BN_SOFTWARE_LICENSE \
+ doc/README.PATENT \
+ doc/README.FreeBSD \
+ doc/00README \
+ doc/INSTALL \
+ doc/advanced.TOPICS \
+ doc/usersguide.txt \
+ doc/usersguide.ps \
+ doc/usersguide.html \
+ doc/inet-95.ps"
+
+ Report "Installing documentation in ${PREFIX}/share/doc/skip"
+ ${BSD_INSTALL_DATA} ${DOC_FILES} ${PREFIX}/share/doc/skip
+}
+
+install_man_files ()
+{
+ MAN1_FILES="man/man1/certreq.1 \
+ man/man1/skiphost.1 \
+ man/man1/skipstat.1 \
+ man/man1/skiptool.1 \
+ man/man1/skipd.1 \
+ man/man1/skipdb.1 \
+ man/man1/skipca.1 \
+ man/man1/skiplocal.1 \
+ man/man1/install_skip_keys.1 \
+ man/man1/skipd_restart.1 \
+ man/man1/skipif.1 \
+ man/man1/skip_conf.1 \
+ man/man1/skiplog.1 \
+ man/man1/print_cert.1"
+ MAN4_FILES="man/man4/skipd.conf.4 \
+ man/man4/raw_keys.4"
+
+ Report "Installing man pages in ${PREFIX}/man"
+ ${BSD_INSTALL_MAN} ${MAN1_FILES} ${PREFIX}/man/man1
+ ${BSD_INSTALL_MAN} ${MAN4_FILES} ${PREFIX}/man/man4
+}
+
+install_rc_file ()
+{
+ RC_FILE="etc/rc"
+
+ Report "Installing startup script in ${PREFIX}/etc/rc.d"
+ ${BSD_INSTALL_SCRIPT} ${RC_FILE} ${PREFIX}/etc/rc.d/skip.sh
+}
+
+# main()
+
+cd ${SKIPDIR} || exit 1
+install_lkm_files;
+install_etc_files;
+install_bin_files;
+install_doc_files;
+install_man_files;
+install_rc_file;
+
diff --git a/security/skip/scripts/pre-patch b/security/skip/scripts/pre-patch
new file mode 100644
index 000000000000..1f184c68710f
--- /dev/null
+++ b/security/skip/scripts/pre-patch
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+#
+# Set user-writable flags so patch(1) doesn't trip up.
+#
+
+FIXDIRS="${WRKSRC}/skip/man ${WRKSRC}/admin"
+
+for DIR in ${FIXDIRS}; do
+ chmod -R u+w ${DIR}
+done
+