summaryrefslogtreecommitdiff
path: root/usr/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src/lib')
-rw-r--r--usr/src/lib/Makefile9
-rw-r--r--usr/src/lib/libkmf/plugins/kmf_openssl/common/openssl_spi.c3
-rw-r--r--usr/src/lib/libwanboot/Makefile77
-rw-r--r--usr/src/lib/libwanboot/Makefile.com99
-rw-r--r--usr/src/lib/libwanboot/amd64/Makefile29
-rw-r--r--usr/src/lib/libwanboot/common/bootinfo_aux.c520
-rw-r--r--usr/src/lib/libwanboot/common/llib-lwanboot41
-rw-r--r--usr/src/lib/libwanboot/common/mapfile-vers95
-rw-r--r--usr/src/lib/libwanboot/common/socket_inet.c91
-rw-r--r--usr/src/lib/libwanboot/common/socket_inet.h44
-rw-r--r--usr/src/lib/libwanboot/i386/Makefile34
-rw-r--r--usr/src/lib/libwanboot/libwanboot.xcl115
-rw-r--r--usr/src/lib/libwanboot/req.flg32
-rw-r--r--usr/src/lib/libwanboot/sparc/Makefile31
-rw-r--r--usr/src/lib/libwanboot/sparcv9/Makefile29
-rw-r--r--usr/src/lib/libwanbootutil/Makefile101
-rw-r--r--usr/src/lib/libwanbootutil/Makefile.com91
-rw-r--r--usr/src/lib/libwanbootutil/amd64/Makefile29
-rw-r--r--usr/src/lib/libwanbootutil/common/key_util.c424
-rw-r--r--usr/src/lib/libwanbootutil/common/key_util.h103
-rw-r--r--usr/src/lib/libwanbootutil/common/key_xdr.x57
-rw-r--r--usr/src/lib/libwanbootutil/common/llib-lwanbootutil32
-rw-r--r--usr/src/lib/libwanbootutil/common/mapfile-vers73
-rw-r--r--usr/src/lib/libwanbootutil/common/wanbootutil.h40
-rw-r--r--usr/src/lib/libwanbootutil/common/wbio.c94
-rw-r--r--usr/src/lib/libwanbootutil/common/wbio.h46
-rw-r--r--usr/src/lib/libwanbootutil/i386/Makefile31
-rw-r--r--usr/src/lib/libwanbootutil/libwanbootutil.xcl35
-rw-r--r--usr/src/lib/libwanbootutil/req.flg29
-rw-r--r--usr/src/lib/libwanbootutil/sparc/Makefile31
-rw-r--r--usr/src/lib/libwanbootutil/sparcv9/Makefile29
31 files changed, 2 insertions, 2492 deletions
diff --git a/usr/src/lib/Makefile b/usr/src/lib/Makefile
index 0f62e87b79..3091b1a6f4 100644
--- a/usr/src/lib/Makefile
+++ b/usr/src/lib/Makefile
@@ -233,8 +233,6 @@ SUBDIRS += \
libvrrpadm \
libvscan \
libw \
- libwanboot \
- libwanbootutil \
libwrap \
libxcurses \
libxcurses2 \
@@ -348,8 +346,6 @@ MSGSUBDIRS= \
libuutil \
libvrrpadm \
libvscan \
- libwanboot \
- libwanbootutil \
libzfs \
libzonecfg \
madv \
@@ -480,8 +476,6 @@ HDRSUBDIRS= \
libvolmgt \
libvrrpadm \
libvscan \
- libwanboot \
- libwanbootutil \
libwrap \
libxcurses2 \
libzfs \
@@ -636,7 +630,7 @@ libnisdb: libldap5
libnwam: libscf libbsm libdladm libipadm
libpcp: libumem libdevinfo
libpctx: libproc
-libpkg: libwanboot libscf libadm
+libpkg: libscf libadm
libpool: libscf libexacct
libpp: libast
libproc: ../cmd/sgs/librtld_db ../cmd/sgs/libelf libctf
@@ -675,7 +669,6 @@ libv12n: libds libuuid
libvolmgt: libadm
libvrrpadm: libdladm libscf
libvscan: libscf libsecdb
-libwanboot: libresolv2 libdevinfo libinetutil libdhcputil
libzfs: libdevid libgen libuutil libadm libavl libefi libidmap \
libumem libtsol libzfs_core libcmdutils
libzfs_jni: libdiskmgt libzfs
diff --git a/usr/src/lib/libkmf/plugins/kmf_openssl/common/openssl_spi.c b/usr/src/lib/libkmf/plugins/kmf_openssl/common/openssl_spi.c
index 94225f846a..46aea6a2aa 100644
--- a/usr/src/lib/libkmf/plugins/kmf_openssl/common/openssl_spi.c
+++ b/usr/src/lib/libkmf/plugins/kmf_openssl/common/openssl_spi.c
@@ -135,8 +135,7 @@ static uchar_t G[] = { 0x00, 0x62, 0x6d, 0x02, 0x78, 0x39, 0xea, 0x0a,
#define SET_SYS_ERROR(h, c) h->lasterr.kstype = -1; h->lasterr.errcode = c;
/*
- * Declare some new macros for managing stacks of EVP_PKEYS, similar to
- * what wanboot did.
+ * Declare some new macros for managing stacks of EVP_PKEYS.
*/
DECLARE_STACK_OF(EVP_PKEY)
diff --git a/usr/src/lib/libwanboot/Makefile b/usr/src/lib/libwanboot/Makefile
deleted file mode 100644
index 580716ccc2..0000000000
--- a/usr/src/lib/libwanboot/Makefile
+++ /dev/null
@@ -1,77 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
-# Use is subject to license terms.
-# Copyright 2012 OmniTI Computer Consulting, Inc. All rights reserved.
-#
-
-include $(SRC)/lib/Makefile.lib
-
-SUBDIRS = $(MACH)
-$(BUILD64)SUBDIRS += $(MACH64)
-
-HDRS = boot_http.h \
- bootinfo.h \
- bootlog.h \
- netboot_paths.h \
- parseURL.h \
- p12aux.h \
- p12access.h\
- p12err.h\
- wanboot_conf.h
-HDRDIR = $(SRCDIR) $(SRC)/common/net/wanboot
-
-CHECKHDRS += $(SRC)/common/net/wanboot/auxutil.h
-
-POFILE = libwanboot.po
-MSGFILES = $(SRC)/common/net/wanboot/bootconf_errmsg.c \
- $(SRC)/common/net/wanboot/boot_http.c \
- $(SRC)/common/net/wanboot/bootlog.c \
- $(SRC)/common/net/wanboot/http_errorstr.c \
- $(SRC)/common/net/wanboot/p12err.c
-XGETFLAGS = -a -x libwanboot.xcl
-
-all := TARGET = all
-clean := TARGET = clean
-clobber := TARGET = clobber
-install := TARGET = install
-lint := TARGET = lint
-
-.KEEP_STATE:
-
-all clean clobber install lint: $(SUBDIRS)
-
-install_h: $(ROOTHDRS)
-
-check: $(CHECKHDRS)
-
-$(POFILE): pofile_MSGFILES
-
-_msg: $(MSGDOMAINPOFILE)
-
-$(SUBDIRS): FRC
- @cd $@; pwd; $(MAKE) $(TARGET)
-
-FRC:
-
-include $(SRC)/Makefile.msg.targ
-include $(SRC)/lib/Makefile.targ
diff --git a/usr/src/lib/libwanboot/Makefile.com b/usr/src/lib/libwanboot/Makefile.com
deleted file mode 100644
index 322bfb51f7..0000000000
--- a/usr/src/lib/libwanboot/Makefile.com
+++ /dev/null
@@ -1,99 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
-# Use is subject to license terms.
-#
-# Copyright (c) 2012 by Delphix. All rights reserved.
-#
-
-LIBRARY = libwanboot.a
-VERS = .1
-
-# List of locally located modules.
-LOC_DIR = ../common
-LOC_OBJS = socket_inet.o bootinfo_aux.o
-LOC_SRCS = $(LOC_OBJS:%.o=$(LOC_DIR)/%.c)
-
-# List of common wanboot objects.
-COM_DIR = ../../../common/net/wanboot
-COM_OBJS = auxutil.o \
- boot_http.o \
- bootconf.o \
- bootconf_errmsg.o \
- bootinfo.o \
- bootlog.o \
- http_errorstr.o \
- p12access.o \
- p12auxpars.o \
- p12auxutl.o \
- p12err.o \
- p12misc.o \
- parseURL.o
-COM_SRCS = $(COM_OBJS:%.o=$(COM_DIR)/%.c)
-
-# List of common DHCP modules.
-DHCP_DIR = $(SRC)/common/net/dhcp
-DHCP_OBJS = dhcpinfo.o
-DHCP_SRCS = $(DHCP_OBJS:%.o=$(DHCP_DIR)/%.c)
-
-OBJECTS = $(LOC_OBJS) $(COM_OBJS) $(DHCP_OBJS)
-
-include ../../Makefile.lib
-
-LIBS += $(LINTLIB)
-LDLIBS += -lnvpair -lresolv -lnsl -lsocket -ldevinfo -ldhcputil \
- -linetutil -lc -lcrypto -lssl
-CPPFLAGS = -I$(SRC)/common/net/wanboot/crypt $(CPPFLAGS.master)
-CERRWARN += -_gcc=-Wno-switch
-CERRWARN += -_gcc=-Wno-parentheses
-CERRWARN += -_gcc=-Wno-unused-value
-CERRWARN += -_gcc=-Wno-uninitialized
-
-# Must override SRCS from Makefile.lib since sources have
-# multiple source directories.
-SRCS = $(LOC_SRCS) $(COM_SRCS) $(DHCP_SRCS)
-
-# Must define location of lint library source.
-SRCDIR = $(LOC_DIR)
-$(LINTLIB) := SRCS = $(SRCDIR)/$(LINTSRC)
-
-# OpenSSL (incl. varying versions) requires us to turn these off
-LINTFLAGS += -erroff=E_BAD_PTR_CAST_ALIGN,E_SUPPRESSION_DIRECTIVE_UNUSED
-LINTFLAGS64 += -erroff=E_BAD_PTR_CAST_ALIGN,E_SUPPRESSION_DIRECTIVE_UNUSED
-
-CFLAGS += $(CCVERBOSE)
-CPPFLAGS += -I$(LOC_DIR) -I$(COM_DIR) -I$(DHCP_DIR)
-
-.KEEP_STATE:
-
-all: $(LIBS)
-
-lint: lintcheck
-
-pics/%.o: $(COM_DIR)/%.c
- $(COMPILE.c) -o $@ $<
- $(POST_PROCESS_O)
-
-pics/%.o: $(DHCP_DIR)/%.c
- $(COMPILE.c) -o $@ $<
- $(POST_PROCESS_O)
-
-include ../../Makefile.targ
diff --git a/usr/src/lib/libwanboot/amd64/Makefile b/usr/src/lib/libwanboot/amd64/Makefile
deleted file mode 100644
index df2bad0003..0000000000
--- a/usr/src/lib/libwanboot/amd64/Makefile
+++ /dev/null
@@ -1,29 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License, Version 1.0 only
-# (the "License"). You may not use this file except in compliance
-# with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-# Copyright 2012 OmniTI Computer Consulting, Inc. All rights reserved.
-#
-
-include ../Makefile.com
-include ../../Makefile.lib.64
-
-install: all $(ROOTLIBS64) $(ROOTLINKS64) $(ROOTLINT64)
diff --git a/usr/src/lib/libwanboot/common/bootinfo_aux.c b/usr/src/lib/libwanboot/common/bootinfo_aux.c
deleted file mode 100644
index a72561da57..0000000000
--- a/usr/src/lib/libwanboot/common/bootinfo_aux.c
+++ /dev/null
@@ -1,520 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
- */
-
-#pragma ident "%Z%%M% %I% %E% SMI"
-
-#include <sys/types.h>
-#include <stdlib.h>
-#include <dhcp_impl.h>
-#include <netinet/inetutil.h>
-#include <sys/systeminfo.h>
-#include <netinet/in.h>
-#include <strings.h>
-#include <net/if.h>
-#include <libdevinfo.h>
-#include <sys/isa_defs.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <netdb.h>
-#include <alloca.h>
-#include <stdio.h>
-#include <sys/sockio.h>
-#include <sys/statvfs.h>
-#include <sys/utsname.h>
-#include <bootinfo.h>
-#include <bootinfo_aux.h>
-
-#define MAXIFS 256 /* default max number of interfaces */
-
-/*
- * Callback structure used when walking the device tree.
- */
-typedef struct {
- char *cb_path; /* device path we want to match */
- di_node_t cb_node; /* found leaf node of device path */
-} cb_t;
-
-/*
- * Handles on devinfo stuff.
- */
-static di_node_t root_node = DI_NODE_NIL;
-static di_prom_handle_t phdl = DI_PROM_HANDLE_NIL;
-
-/*
- * Root filesystem type string.
- */
-static char *rootfs_type = NULL;
-
-/*
- * Handles on DHCP's packet list and interface-name.
- */
-static PKT_LIST *dhcp_pl = NULL;
-static char dhcp_ifn[IFNAMSIZ + 1];
-
-/*
- * Deallocate dhcp_pl.
- */
-static void
-dhcp_info_end(void)
-{
- if (dhcp_pl != NULL) {
- free(dhcp_pl->pkt);
- free(dhcp_pl);
- }
- dhcp_pl = NULL;
- dhcp_ifn[0] = '\0';
-}
-
-/*
- * Determine whether the kernel has a cached DHCP ACK, and if so
- * initialize dhcp_pl and dhcp_ifn.
- */
-static boolean_t
-dhcp_info_init(void)
-{
- boolean_t ret = B_FALSE;
- char dummy;
- char *dhcack = NULL;
- long dhcacksz;
- char *ackp;
-
- /*
- * See whether the kernel has a cached DHCP ACK, and if so get it.
- * If there is no DHCP ACK, then the returned length is equal to
- * the size of an empty string.
- */
- if ((dhcacksz = sysinfo(SI_DHCP_CACHE, &dummy,
- sizeof (dummy))) == sizeof ("")) {
- return (B_TRUE);
- }
- if ((dhcack = malloc(dhcacksz)) == NULL) {
- goto cleanup;
- }
- if ((dhcp_pl = calloc(1, sizeof (PKT_LIST))) == NULL) {
- goto cleanup;
- }
- (void) sysinfo(SI_DHCP_CACHE, (caddr_t)dhcack, dhcacksz);
-
- /*
- * The first IFNAMSIZ bytes are reserved for the interface name;
- * the ACK follows.
- */
- ackp = &dhcack[IFNAMSIZ];
-
- /*
- * Convert and scan the options.
- */
- dhcp_pl->len = strlen(ackp) / 2;
- if ((dhcp_pl->pkt = malloc(dhcp_pl->len)) == NULL) {
- goto cleanup;
- }
- if (hexascii_to_octet(ackp, dhcp_pl->len * 2,
- dhcp_pl->pkt, &dhcp_pl->len) != 0) {
- goto cleanup;
- }
- if (dhcp_options_scan(dhcp_pl, B_TRUE) != 0) {
- goto cleanup;
- }
-
- /*
- * Set the interface-name.
- */
- (void) strlcpy(dhcp_ifn, dhcack, sizeof (dhcp_ifn));
-
- ret = B_TRUE;
-cleanup:
- if (!ret) {
- dhcp_info_end();
- }
- if (dhcack != NULL) {
- free(dhcack);
- }
-
- return (ret);
-}
-
-/*
- * Deallocate devinfo stuff.
- */
-static void
-destroy_snapshot(void)
-{
- if (phdl != DI_PROM_HANDLE_NIL) {
- di_prom_fini(phdl);
- }
- phdl = DI_PROM_HANDLE_NIL;
-
- if (root_node != DI_NODE_NIL) {
- di_fini(root_node);
- }
- root_node = DI_NODE_NIL;
-}
-
-/*
- * Take a snapshot of the device tree, i.e. get a devinfo handle and
- * a PROM handle.
- */
-static boolean_t
-snapshot_devtree(void)
-{
- /*
- * Deallocate any existing devinfo stuff first.
- */
- destroy_snapshot();
-
- if ((root_node = di_init("/", DINFOCPYALL)) == DI_NODE_NIL ||
- (phdl = di_prom_init()) == DI_PROM_HANDLE_NIL) {
- destroy_snapshot();
- return (B_FALSE);
- }
-
- return (B_TRUE);
-}
-
-/*
- * Get the value of the named property on the named node in root.
- */
-static char *
-get_prop(const char *nodename, const char *propname, size_t *lenp)
-{
- di_node_t node;
- di_prom_prop_t pp;
- char *val = NULL;
- int len;
-
- /*
- * Locate nodename within '/'.
- */
- for (node = di_child_node(root_node);
- node != DI_NODE_NIL;
- node = di_sibling_node(node)) {
- if (strcmp(di_node_name(node), nodename) == 0) {
- break;
- }
- }
- if (node == DI_NODE_NIL) {
- return (NULL);
- }
-
- /*
- * Scan all properties of /nodename for the 'propname' property.
- */
- for (pp = di_prom_prop_next(phdl, node, DI_PROM_PROP_NIL);
- pp != DI_PROM_PROP_NIL;
- pp = di_prom_prop_next(phdl, node, pp)) {
- if (strcmp(propname, di_prom_prop_name(pp)) == 0) {
- break;
- }
- }
- if (pp == DI_PROM_PROP_NIL) {
- return (NULL);
- }
-
- /*
- * Found the property; copy out its length and return its value.
- */
- len = di_prom_prop_data(pp, (uchar_t **)&val);
- if (lenp != NULL) {
- *lenp = len;
- }
- return (val);
-}
-
-/*
- * Strip any trailing arguments from a device path.
- * Returned memory must be freed by caller.
- */
-static char *
-strip_args(char *path, size_t len)
-{
- char *stripped_path = NULL;
-
- if (path != NULL && len != 0 &&
- (stripped_path = calloc(len + 1, sizeof (char))) != NULL) {
- char *p;
-
- (void) memcpy(stripped_path, path, len);
- if ((p = strchr(stripped_path, ':')) != NULL) {
- *p = '\0';
- }
- }
- return (stripped_path);
-}
-
-/*
- * Return the "bootpath" property (sans arguments) from /chosen.
- * Returned memory must be freed by caller.
- */
-static char *
-get_bootpath(void)
-{
- char *path;
- size_t len;
-
- path = get_prop("chosen", "bootpath", &len);
- return (strip_args(path, len));
-}
-
-/*
- * Return the "net" property (sans arguments) from /aliases.
- * Returned memory must be freed by caller.
- */
-static char *
-get_netalias(void)
-{
- char *path;
- size_t len;
-
- path = get_prop("aliases", "net", &len);
- return (strip_args(path, len));
-}
-
-/*
- * Callback used by path2node().
- */
-static int
-p2n_cb(di_node_t node, void *arg)
-{
- int ret = DI_WALK_CONTINUE;
- cb_t *cbp = arg;
- char *phys_path = di_devfs_path(node);
-
- if (strcmp(cbp->cb_path, phys_path) == 0) {
- cbp->cb_node = node;
- ret = DI_WALK_TERMINATE;
- }
- di_devfs_path_free(phys_path);
-
- return (ret);
-}
-
-/*
- * Map a device path to its matching di_node_t.
- */
-static di_node_t
-path2node(char *path)
-{
- cb_t cb;
-
- cb.cb_path = path;
- cb.cb_node = DI_NODE_NIL;
-
- (void) di_walk_node(root_node, DI_WALK_CLDFIRST, &cb, p2n_cb);
-
- return (cb.cb_node);
-}
-
-/*
- * Check whether node corresponds to a network device.
- */
-static boolean_t
-is_network_device(di_node_t node)
-{
- char *type;
-
- return (di_prom_prop_lookup_strings(phdl, node,
- "device_type", &type) > 0 && strcmp(type, "network") == 0);
-}
-
-/*
- * Initialise bootmisc with the rootfs-type.
- */
-static boolean_t
-rootfs_type_init(void)
-{
- static struct statvfs vfs;
-
- if (statvfs("/", &vfs) >= 0) {
- if (strncmp(vfs.f_basetype, "nfs", sizeof ("nfs") - 1) == 0) {
- vfs.f_basetype[sizeof ("nfs") - 1] = '\0';
- }
- rootfs_type = vfs.f_basetype;
- }
-
- return (rootfs_type != NULL && bi_put_bootmisc(BI_ROOTFS_TYPE,
- rootfs_type, strlen(rootfs_type) + 1));
-}
-
-/*
- * Initialise bootmisc with the interface-name of the primary network device,
- * and the net-config-strategy employed in configuring that device.
- */
-static boolean_t
-netif_init(char *ifn, char *ncs)
-{
- return (bi_put_bootmisc(BI_INTERFACE_NAME, ifn, strlen(ifn) + 1) &&
- bi_put_bootmisc(BI_NET_CONFIG_STRATEGY, ncs, strlen(ncs) + 1));
-}
-
-/*
- * Determine whether the interface was configured manually.
- */
-static boolean_t
-manual_if_init(void)
-{
- boolean_t ret = B_FALSE;
- char *ncs;
- char *devpath;
- di_node_t node;
- int instance;
- char *drvname;
- char ifname[IFNAMSIZ + 1];
-
- /*
- * If net-config-strategy isn't "manual", don't go any further.
- */
- if ((ncs = get_prop("chosen", BI_NET_CONFIG_STRATEGY, NULL)) == NULL ||
- strcmp(ncs, "manual") != 0) {
- return (B_FALSE);
- }
-
- /*
- * First check the 'bootpath' property of /chosen to see whether
- * it specifies the path of a network device; if so, use this.
- */
- if ((devpath = get_bootpath()) == NULL ||
- (node = path2node(devpath)) == DI_NODE_NIL ||
- !is_network_device(node)) {
- /*
- * Must have been booted from CD-ROM or disk; attempt to
- * use the path defined by the 'net' property of /aliases.
- */
- free(devpath);
- if ((devpath = get_netalias()) == NULL ||
- (node = path2node(devpath)) == DI_NODE_NIL ||
- !is_network_device(node)) {
- goto cleanup;
- }
- }
-
- /*
- * Get the driver name and instance number of this node.
- * We may have to load the driver.
- */
- if ((drvname = di_driver_name(node)) == NULL) {
- goto cleanup;
- }
- if ((instance = di_instance(node)) == -1) {
- di_node_t tmp;
-
- /*
- * Attempt to load the driver, create a new snapshot of the
- * (possibly changed) device tree and re-compute our node.
- */
- if ((tmp = di_init_driver(drvname, 0)) != DI_NODE_NIL) {
- di_fini(tmp);
-
- if (!snapshot_devtree() ||
- (node = path2node(devpath)) == DI_NODE_NIL) {
- goto cleanup;
- }
- }
- instance = di_instance(node);
- }
-
- /*
- * Construct the interface name.
- */
- if (instance == -1) {
- (void) snprintf(ifname, sizeof (ifname),
- "%s", di_driver_name(node));
- } else {
- (void) snprintf(ifname, sizeof (ifname),
- "%s%d", di_driver_name(node), instance);
- }
-
- ret = netif_init(ifname, "manual");
-cleanup:
- free(devpath);
- return (ret);
-}
-
-/*
- * Determine whether the interface was configured via DHCP.
- */
-static boolean_t
-dhcp_if_init(void)
-{
- return (strlen(dhcp_ifn) != 0 && netif_init(dhcp_ifn, "dhcp"));
-}
-
-static boolean_t
-bootmisc_init(void)
-{
- return (rootfs_type_init() &&
- (manual_if_init() || dhcp_if_init()));
-}
-
-
-/*
- * Functions dealing with bootinfo initialization/cleanup.
- */
-boolean_t
-bi_init_bootinfo(void)
-{
- if (snapshot_devtree() && dhcp_info_init() && bootmisc_init()) {
- return (B_TRUE);
- }
- bi_end_bootinfo();
- return (B_FALSE);
-}
-
-void
-bi_end_bootinfo(void)
-{
- destroy_snapshot();
- dhcp_info_end();
-}
-
-/*
- * Function dealing with /chosen data.
- */
-boolean_t
-bi_get_chosen_prop(const char *name, void *valbuf, size_t *vallenp)
-{
- char *val;
- size_t buflen = *vallenp;
-
- if ((val = get_prop("chosen", name, vallenp)) == NULL) {
- return (B_FALSE);
- }
- if (*vallenp <= buflen) {
- (void) memcpy(valbuf, val, *vallenp);
- }
-
- return (B_TRUE);
-}
-
-/*
- * Function dealing with DHCP data.
- */
-boolean_t
-bi_get_dhcp_info(uchar_t optcat, uint16_t optcode, uint16_t optsize,
- void *valbuf, size_t *vallenp)
-{
- return (dhcp_getinfo_pl(dhcp_pl,
- optcat, optcode, optsize, valbuf, vallenp));
-}
diff --git a/usr/src/lib/libwanboot/common/llib-lwanboot b/usr/src/lib/libwanboot/common/llib-lwanboot
deleted file mode 100644
index 885e58e1fc..0000000000
--- a/usr/src/lib/libwanboot/common/llib-lwanboot
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
- */
-
-#pragma ident "%Z%%M% %I% %E% SMI"
-
-/* LINTLIBRARY */
-/* PROTOLIB1 */
-
-#include <boot_http.h>
-#include <bootinfo.h>
-#include <bootlog.h>
-#include <parseURL.h>
-#include <wanboot_conf.h>
-
-#include <openssl/ssl.h>
-#include <openssl/pkcs12.h>
-#include <p12access.h>
-#include <p12aux.h>
diff --git a/usr/src/lib/libwanboot/common/mapfile-vers b/usr/src/lib/libwanboot/common/mapfile-vers
deleted file mode 100644
index 0bbcc85a2e..0000000000
--- a/usr/src/lib/libwanboot/common/mapfile-vers
+++ /dev/null
@@ -1,95 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
-#
-
-#
-# MAPFILE HEADER START
-#
-# WARNING: STOP NOW. DO NOT MODIFY THIS FILE.
-# Object versioning must comply with the rules detailed in
-#
-# usr/src/lib/README.mapfiles
-#
-# You should not be making modifications here until you've read the most current
-# copy of that file. If you need help, contact a gatekeeper for guidance.
-#
-# MAPFILE HEADER END
-#
-
-$mapfile_version 2
-
-SYMBOL_VERSION SUNWprivate_1.1 {
- global:
- bootconf_end;
- bootconf_errmsg;
- bootconf_get;
- bootconf_init;
- bootinfo_end;
- bootinfo_get;
- bootinfo_init;
- bootlog;
- http_conn_is_https;
- http_decode_err;
- http_errorstr;
- http_free_respinfo;
- http_get_conn_info;
- http_get_header_value;
- http_get_lasterr;
- http_get_range_request;
- http_get_request;
- http_get_response_header;
- http_get_version;
- http_head_request;
- http_process_headers;
- http_process_part_headers;
- http_read_body;
- http_set_basic_auth;
- http_set_certificate_authority_file;
- http_set_cipher_list;
- http_set_client_certificate_file;
- http_set_keepalive;
- http_set_key_file_password;
- http_set_p12_format;
- http_set_password;
- http_set_private_key_file;
- http_set_proxy;
- http_set_random_file;
- http_set_socket_read_timeout;
- http_set_verbose;
- http_srv_close;
- http_srv_connect;
- http_srv_disconnect;
- http_srv_init;
- sunw_check_keys;
- sunw_crypto_init;
- sunw_evp_pkey_free;
- sunw_issuer_attrs;
- sunw_PKCS12_create;
- sunw_PKCS12_parse;
- sunw_print_times;
- sunw_subject_attrs;
- url_parse;
- url_parse_hostport;
- local:
- *;
-};
diff --git a/usr/src/lib/libwanboot/common/socket_inet.c b/usr/src/lib/libwanboot/common/socket_inet.c
deleted file mode 100644
index f1ddd29e53..0000000000
--- a/usr/src/lib/libwanboot/common/socket_inet.c
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2002-2003 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
- */
-
-#pragma ident "%Z%%M% %I% %E% SMI"
-
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <unistd.h>
-#include <poll.h>
-#include <errno.h>
-
-#include <socket_inet.h>
-
-/*
- * Name: socket_read
- * Description: Use recv in non-secure sockets.
- * Scope: private
- * Arguments: fildes - Socket file descriptor.
- * buf - Buffer to read data into.
- * nbyte - Number of bytes to read.
- * read_timeout - Timeout value in seconds.
- * Returns: n - Number of bytes read. -1 on error.
- */
-int
-socket_read(int fildes, void *buf, size_t nbyte, int read_timeout)
-{
- struct pollfd pfd;
-
- pfd.fd = fildes;
- pfd.events = POLLIN;
-
- switch (poll(&pfd, 1, read_timeout * 1000)) {
- case 0:
- errno = EINTR;
- return (-1);
- case -1:
- return (-1);
- default:
- break;
- }
-
- return (recv(fildes, buf, nbyte, 0));
-}
-
-/*
- * Name: socket_write
- * Description: Use sendto for non-secure connections.
- * Scope: private
- * Arguments: fildes - Socket file descriptor.
- * buf - Buffer containing data to be written.
- * nbyte - Number of bytes to write.
- * addr - Connection address
- * Returns: n - Number of bytes written. -1 on error.
- */
-int
-socket_write(int fildes, const void *buf, size_t nbyte,
- struct sockaddr_in *addr)
-{
- return (sendto(fildes, buf, nbyte, 0, (struct sockaddr *)addr,
- sizeof (*addr)));
-}
-
-int
-socket_close(int fildes)
-{
- return (close(fildes));
-}
diff --git a/usr/src/lib/libwanboot/common/socket_inet.h b/usr/src/lib/libwanboot/common/socket_inet.h
deleted file mode 100644
index 7e4401b3ce..0000000000
--- a/usr/src/lib/libwanboot/common/socket_inet.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2002-2003 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
- */
-
-#ifndef _SOCKET_INET_H
-#define _SOCKET_INET_H
-
-#pragma ident "%Z%%M% %I% %E% SMI"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-int socket_read(int, void *, size_t, int);
-int socket_write(int, const void *, size_t, struct sockaddr_in *);
-int socket_close(int);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _SOCKET_INET_H */
diff --git a/usr/src/lib/libwanboot/i386/Makefile b/usr/src/lib/libwanboot/i386/Makefile
deleted file mode 100644
index 8b836a15c9..0000000000
--- a/usr/src/lib/libwanboot/i386/Makefile
+++ /dev/null
@@ -1,34 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License, Version 1.0 only
-# (the "License"). You may not use this file except in compliance
-# with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-# Copyright 2002-2003 Sun Microsystems, Inc. All rights reserved.
-# Use is subject to license terms.
-#
-#ident "%Z%%M% %I% %E% SMI"
-#
-
-include ../Makefile.com
-
-install: all $(ROOTLIBS) $(ROOTLINKS) $(ROOTLINT)
-
-
-
diff --git a/usr/src/lib/libwanboot/libwanboot.xcl b/usr/src/lib/libwanboot/libwanboot.xcl
deleted file mode 100644
index aa4184949c..0000000000
--- a/usr/src/lib/libwanboot/libwanboot.xcl
+++ /dev/null
@@ -1,115 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License, Version 1.0 only
-# (the "License"). You may not use this file except in compliance
-# with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-# Copyright 2003 Sun Microsystems, Inc. All rights reserved.
-# Use is subject to license terms.
-#
-# ident "%Z%%M% %I% %E% SMI"
-#
-
-msgid "proxy_connect"
-msgid "tcp_connect"
-msgid "HTTP/1.1"
-msgid "Content-Type"
-msgid "Multipart/Mixed;"
-msgid "Boundary="
-msgid "--"
-msgid "GET"
-msgid "HEAD"
-msgid "CONNECT %s:%d HTTP/1.0\r\n\r\n"
-msgid " %s"
-msgid "%s http://%s:%d%s HTTP/1.1\r\n"
-msgid "%s %s HTTP/1.1\r\n"
-msgid "Host: %s:%d\r\n"
-msgid "Connection: close\r\n"
-msgid "Connection: Keep-Alive\r\n"
-msgid "Range: bytes=%ld-"
-msgid "%ld"
-msgid "\r\n"
-msgid "%s:%s"
-msgid "Authorization: Basic %s\r\n"
-msgid "%s"
-msgid "HTTP"
-msgid "200"
-msgid "%08lx %s"
-msgid ""
-msgid "Content-Length"
-msgid "Transfer-Encoding"
-msgid "chunked"
-msgid "chunked;"
-msgid "panic"
-msgid "alert"
-msgid "crit"
-msgid "warn"
-msgid "info"
-msgid "debug"
-msgid "verbose"
-msgid "progress"
-msgid "none"
-msgid "libwanboot"
-msgid "?"
-msgid "%s %s %s: %s\n"
-msgid "/var/log/bootlog"
-msgid "a"
-msgid "/dev/urandom"
-msgid "sunw_p12_use_x509cert"
-msgid "sunw_p12_use_certfile"
-msgid "sunw_p12_use_pkey"
-msgid "sunw_p12_use_keyfile"
-msgid "sunw_p12_use_tastore"
-msgid "sunw_p12_use_trustfile"
-msgid "p12_read_file"
-msgid "p12_doparse"
-msgid "sunw_PKCS12_parse"
-msgid "sunw_PKCS12_contents"
-msgid "parse_one_bag"
-msgid "sunw_PKCS12_create"
-msgid "sunw_split_certs"
-msgid "sunw_find_localkeyid"
-msgid "sunw_set_localkeyid"
-msgid "sunw_get_localkeyid"
-msgid "sunw_set_fname"
-msgid "sunw_get_pkey_fname"
-msgid "sunw_append_keys"
-msgid "sunw_PEM_contents"
-msgid "pem_info"
-msgid "asc2bmpstring"
-msgid "utf82ascstr"
-msgid "findattr"
-msgid "type2attrib"
-msgid "move_certs"
-msgid "sunw_find_fname"
-msgid "parse_outer"
-msgid "Tue Jan 19 03:14:07 2038\n"
-msgid "%s?%s"
-msgid "\n"
-msgid "%s %s %s: %s\r"
-msgid "/?{}|^~[]`<>#%=\"\t"
-msgid "read_headerlines: %s"
-msgid "get_chunk_header: <%s>"
-msgid "<time> %s %s: [ID %u user.%s] %s"
-msgid "%s %s %s: [ID %u user.%s] %s\n"
-msgid "sunw_use_x509cert"
-msgid "sunw_use_pkey"
-msgid "sunw_use_tastore"
-msgid "checkfile"
-msgid "peer_CN = %s, host = %s"
diff --git a/usr/src/lib/libwanboot/req.flg b/usr/src/lib/libwanboot/req.flg
deleted file mode 100644
index bd87a35f8a..0000000000
--- a/usr/src/lib/libwanboot/req.flg
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/bin/sh
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License, Version 1.0 only
-# (the "License"). You may not use this file except in compliance
-# with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-# Copyright 2002-2003 Sun Microsystems, Inc. All rights reserved.
-# Use is subject to license terms.
-#
-# ident "%Z%%M% %I% %E% SMI"
-#
-# lib/libwanboot/req.flg
-#
-
-find_files "s.*" usr/src/common/net/wanboot
diff --git a/usr/src/lib/libwanboot/sparc/Makefile b/usr/src/lib/libwanboot/sparc/Makefile
deleted file mode 100644
index 3921305654..0000000000
--- a/usr/src/lib/libwanboot/sparc/Makefile
+++ /dev/null
@@ -1,31 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License, Version 1.0 only
-# (the "License"). You may not use this file except in compliance
-# with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-# Copyright 2002-2003 Sun Microsystems, Inc. All rights reserved.
-# Use is subject to license terms.
-#
-#ident "%Z%%M% %I% %E% SMI"
-#
-
-include ../Makefile.com
-
-install: all $(ROOTLIBS) $(ROOTLINKS) $(ROOTLINT)
diff --git a/usr/src/lib/libwanboot/sparcv9/Makefile b/usr/src/lib/libwanboot/sparcv9/Makefile
deleted file mode 100644
index df2bad0003..0000000000
--- a/usr/src/lib/libwanboot/sparcv9/Makefile
+++ /dev/null
@@ -1,29 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License, Version 1.0 only
-# (the "License"). You may not use this file except in compliance
-# with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-# Copyright 2012 OmniTI Computer Consulting, Inc. All rights reserved.
-#
-
-include ../Makefile.com
-include ../../Makefile.lib.64
-
-install: all $(ROOTLIBS64) $(ROOTLINKS64) $(ROOTLINT64)
diff --git a/usr/src/lib/libwanbootutil/Makefile b/usr/src/lib/libwanbootutil/Makefile
deleted file mode 100644
index 2899af6623..0000000000
--- a/usr/src/lib/libwanbootutil/Makefile
+++ /dev/null
@@ -1,101 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
-# Use is subject to license terms.
-# Copyright 2012 OmniTI Computer Consulting, Inc. All rights reserved.
-#
-
-include ../Makefile.lib
-
-SUBDIRS = $(MACH)
-$(BUILD64)SUBDIRS += $(MACH64)
-
-# Library header.
-HDRS = wanbootutil.h
-HDRDIR = common
-
-# Headers who get installed into $(ROOT)/usr/include/wanboot
-LOCHDRS = key_util.h \
- key_xdr.h \
- wbio.h
-LOCSRCS = $(LOCHDRS:%=$(HDRDIR)/%)
-
-# Must define targets for thise headers being installed into
-# a non-default location.
-WBKUHDRDIR = $(ROOT)/usr/include/wanboot
-WBKUHDRS = $(LOCHDRS:%=$(WBKUHDRDIR)/%)
-
-# Must override CHECKHDRS so that it does not check the
-# RPC generated header.
-CHECKHDRS = $(HDRDIR)/key_util.check
-
-# Must rpcgen XDR source.
-RPCFILES = common/key_xdr.c common/key_xdr.h
-
-POFILE = libwanbootutil.po
-MSGFILES = common/key_util.c
-XGETFLAGS = -a -x libwanbootutil.xcl
-
-all := TARGET = all
-clean := TARGET = clean
-clobber := TARGET = clobber
-install := TARGET = install
-lint := TARGET = lint
-
-.KEEP_STATE:
-.PARALLEL: $(ROOTHDRS)
-
-all clean clobber install: $(RPCFILES) $(SUBDIRS)
-
-lint: $(SUBDIRS)
-
-install_h: $(ROOTHDRDIR) $(WBKUHDRDIR) .WAIT $(ROOTHDRS) $(WBKUHDRS)
-
-check: $(CHECKHDRS)
-
-$(POFILE): pofile_MSGFILES
-
-_msg: $(MSGDOMAINPOFILE)
-
-$(SUBDIRS): FRC
- @cd $@; pwd; $(MAKE) $(TARGET)
-
-FRC:
-
-# No rules for this in Makefile.lib.
-$(WBKUHDRDIR)/%: $(HDRDIR)/%
- $(INS.file)
-$(WBKUHDRDIR):
- $(INS.dir)
-
-# No rules for this in Makefile.lib.
-common/key_xdr.c: common/key_xdr.x
- cd common; $(RPCGEN) -cC -o key_xdr.c key_xdr.x; cd ..
-
-common/key_xdr.h: common/key_xdr.x
- cd common; $(RPCGEN) -h -o key_xdr.h key_xdr.x; cd ..
-
-CLOBBERFILES += common/key_xdr.c common/key_xdr.h
-
-include $(SRC)/Makefile.msg.targ
-include $(SRC)/lib/Makefile.targ
-
diff --git a/usr/src/lib/libwanbootutil/Makefile.com b/usr/src/lib/libwanbootutil/Makefile.com
deleted file mode 100644
index 4bc03836e1..0000000000
--- a/usr/src/lib/libwanbootutil/Makefile.com
+++ /dev/null
@@ -1,91 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
-# Use is subject to license terms.
-#
-# Copyright (c) 2012 by Delphix. All rights reserved.
-#
-
-LIBRARY = libwanbootutil.a
-VERS = .1
-
-# List of locally located modules.
-LOC_DIR = ../common
-LOC_OBJS = key_xdr.o \
- key_util.o \
- wbio.o
-LOC_SRCS = $(LOC_OBJS:%.o=$(LOC_DIR)/%.c)
-
-# The crypto modules are located under usr/src/common.
-CRYPTO_DIR = $(SRC)/common/net/wanboot/crypt
-CRYPTO_OBJS = hmac_sha1.o \
- aes.o \
- des3.o \
- des.o \
- cbc.o
-CRYPTO_SRCS = $(CRYPTO_OBJS:%.o=$(CRYPTO_DIR)/%.c)
-
-# Together the local and crypto modules makeup the entire wad.
-OBJECTS = $(LOC_OBJS) $(CRYPTO_OBJS)
-
-include $(SRC)/lib/Makefile.lib
-
-LIBS += $(LINTLIB)
-LDLIBS += -lc -lnsl -lmd
-
-# Must override SRCS from Makefile.lib since sources have
-# multiple source directories.
-SRCS = $(LOC_SRCS) $(CRYPTO_SRCS)
-
-# Must define location of lint library source.
-SRCDIR = $(LOC_DIR)
-$(LINTLIB):= SRCS = $(SRCDIR)/$(LINTSRC)
-
-# Library includes sources created via rpcgen. And rpcgen unfortunately
-# created unused function variables.
-LINTFLAGS += -erroff=E_FUNC_VAR_UNUSED
-LINTFLAGS64 += -erroff=E_FUNC_VAR_UNUSED
-
-CPPFLAGS += -I$(CRYPTO_DIR)
-
-CERRWARN += -_gcc=-Wno-unused-variable
-CERRWARN += -_gcc=-Wno-type-limits
-CERRWARN += -_gcc=-Wno-uninitialized
-
-install: all
-
-all: $(LIBS)
-
-lint: lintcheck
-
-
-# Define rule for local modules.
-objs/%.o pics/%.o: $(LOC_DIR)/%.c
- $(COMPILE.c) -o $@ $<
- $(POST_PROCESS_O)
-
-# Define rule for crypto modules.
-objs/%.o pics/%.o: $(CRYPTO_DIR)/%.c
- $(COMPILE.c) -o $@ $<
- $(POST_PROCESS_O)
-
-include $(SRC)/lib/Makefile.targ
diff --git a/usr/src/lib/libwanbootutil/amd64/Makefile b/usr/src/lib/libwanbootutil/amd64/Makefile
deleted file mode 100644
index df2bad0003..0000000000
--- a/usr/src/lib/libwanbootutil/amd64/Makefile
+++ /dev/null
@@ -1,29 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License, Version 1.0 only
-# (the "License"). You may not use this file except in compliance
-# with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-# Copyright 2012 OmniTI Computer Consulting, Inc. All rights reserved.
-#
-
-include ../Makefile.com
-include ../../Makefile.lib.64
-
-install: all $(ROOTLIBS64) $(ROOTLINKS64) $(ROOTLINT64)
diff --git a/usr/src/lib/libwanbootutil/common/key_util.c b/usr/src/lib/libwanbootutil/common/key_util.c
deleted file mode 100644
index e4c45e9966..0000000000
--- a/usr/src/lib/libwanbootutil/common/key_util.c
+++ /dev/null
@@ -1,424 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
- */
-#pragma ident "%Z%%M% %I% %E% SMI"
-
-#include <strings.h>
-#include <stdarg.h>
-#include <errno.h>
-#include <libintl.h>
-#include <sys/wanboot_impl.h>
-
-#include "key_xdr.h"
-#include "key_util.h"
-
-/*
- * Size of 'empty' pkcs12 key file (with no key in it) plus 1
- * This is the minimum length for our RSA keys, because we
- * only use RSA keys that are stored in PKCS12 format.
- */
-#define PKCS12_MIN_LEN 76
-
-/*
- * Program name to be used by wbku_printerr()
- */
-static const char *wbku_pname = NULL;
-
-/*
- * Note: must be kept in sync with codes in <key_util.h>
- */
-static char *wbku_retmsgs[WBKU_NRET] = {
-/* 0 WBKU_SUCCESS */ "Success",
-/* 1 WBKU_INTERNAL_ERR */ "Internal error",
-/* 2 WBKU_WRITE_ERR */ "Keystore write error",
-/* 3 WBKU_NOKEY */ "Key does not exist in keystore",
-/* 4 WBKU_BAD_KEYTYPE */ "Invalid keytype specified"
-};
-
-/*
- * Initialize library for calls to wbku_printerr().
- */
-void
-wbku_errinit(const char *arg0)
-{
- wbku_pname = strrchr(arg0, '/');
-
- if (wbku_pname == NULL)
- wbku_pname = arg0;
- else
- wbku_pname++;
-}
-
-/*
- * Print an error message to standard error and optionally
- * append a system error.
- */
-/*PRINTFLIKE1*/
-void
-wbku_printerr(const char *format, ...)
-{
- int err = errno;
- va_list ap;
-
- if (wbku_pname != NULL)
- (void) fprintf(stderr, "%s: ", wbku_pname);
-
- /*
- * Note that gettext() is used in order to obtain the
- * message from the consumer's domain.
- */
- va_start(ap, format);
- (void) vfprintf(stderr, gettext(format), ap);
- va_end(ap);
-
- if (strchr(format, '\n') == NULL)
- (void) fprintf(stderr, ": %s\n", strerror(err));
-}
-
-/*
- * Return the appropriate message for a given WBKU return code.
- */
-const char *
-wbku_retmsg(wbku_retcode_t retcode)
-{
- if ((retcode < WBKU_SUCCESS) || (retcode >= WBKU_NRET))
- return (dgettext(TEXT_DOMAIN, "<unknown code>"));
-
- return (dgettext(TEXT_DOMAIN, wbku_retmsgs[retcode]));
-}
-
-/*
- * This routine is a simple helper routine that initializes a
- * wbku_key_attr_t object.
- */
-static void
-wbku_keyattr_init(wbku_key_attr_t *attr, wbku_key_type_t type, uint_t atype,
- uint_t len, uint_t minlen, uint_t maxlen,
- char *str, char *oid, boolean_t (*keycheck)(const uint8_t *))
-{
- attr->ka_type = type;
- attr->ka_atype = atype;
- attr->ka_len = len;
- attr->ka_minlen = minlen;
- attr->ka_maxlen = maxlen;
- attr->ka_str = str;
- attr->ka_oid = oid;
- attr->ka_keycheck = keycheck;
-}
-
-
-/*
- * This routine is used to build a key attribute structure of the type
- * defined by 'str' and 'flag'. This structure, 'attr', is the common
- * structure used by the utilities that defines the attributes of a
- * specific key type.
- *
- * Returns:
- * WBKU_SUCCESS or WBKU_BAD_KEYTYPE.
- */
-wbku_retcode_t
-wbku_str_to_keyattr(const char *str, wbku_key_attr_t *attr, uint_t flag)
-{
- if (str == NULL)
- return (WBKU_BAD_KEYTYPE);
-
- if (flag & WBKU_ENCR_KEY) {
- if (strcmp(str, WBKU_KW_3DES) == 0) {
- wbku_keyattr_init(attr, WBKU_KEY_3DES,
- WBKU_ENCR_KEY, DES3_KEY_SIZE, DES3_KEY_SIZE,
- DES3_KEY_SIZE, "3DES", WBKU_DES3_OID,
- des3_keycheck);
- return (WBKU_SUCCESS);
- }
- if (strcmp(str, WBKU_KW_AES_128) == 0) {
- wbku_keyattr_init(attr, WBKU_KEY_AES_128,
- WBKU_ENCR_KEY, AES_128_KEY_SIZE, AES_128_KEY_SIZE,
- AES_128_KEY_SIZE, "AES", WBKU_AES_128_OID, NULL);
- return (WBKU_SUCCESS);
- }
- if (strcmp(str, WBKU_KW_RSA) == 0) {
- wbku_keyattr_init(attr, WBKU_KEY_RSA,
- WBKU_ENCR_KEY, 0, PKCS12_MIN_LEN,
- WBKU_MAX_KEYLEN, "RSA", WBKU_RSA_OID, NULL);
- return (WBKU_SUCCESS);
- }
- }
- if (flag & WBKU_HASH_KEY) {
- if (strcmp(str, WBKU_KW_HMAC_SHA1) == 0) {
- wbku_keyattr_init(attr, WBKU_KEY_HMAC_SHA1,
- WBKU_HASH_KEY, WANBOOT_HMAC_KEY_SIZE,
- WANBOOT_HMAC_KEY_SIZE, WANBOOT_HMAC_KEY_SIZE,
- "HMAC/SHA1", WBKU_HMAC_SHA1_OID, NULL);
- return (WBKU_SUCCESS);
- }
- }
- return (WBKU_BAD_KEYTYPE);
-}
-
-/*
- * This routine is used to search a key file (whose handle, fp, has been
- * initialized by the caller) for the key of type 'ka'. The search is further
- * constrained by the 'master' argument which is used to signify that the
- * key being searched for is the master key.
- *
- * This routine may be used for a number of purposes:
- * - Check for the existence of key of type foo.
- * - Get the value for the key of type foo.
- * - Return the file position of the key of type foo.
- *
- * To faciliate the uses above, both 'ppos' and 'ekey' will only be
- * returned if they are not NULL pointers.
- *
- * Returns:
- * WBKU_SUCCESS, WBKU_INTERNAL_ERR or WBKU_NOKEY.
- */
-wbku_retcode_t
-wbku_find_key(FILE *fp, fpos_t *ppos, wbku_key_attr_t *ka, uint8_t *ekey,
- boolean_t master)
-{
- fpos_t pos;
- XDR xdrs;
- wbku_key keyobj;
- int keyno;
- int ret;
-
- /*
- * Always, start at the beginning.
- */
- rewind(fp);
-
- /*
- * Initialize the XDR stream.
- */
- xdrs.x_ops = NULL;
- xdrstdio_create(&xdrs, fp, XDR_DECODE);
- if (xdrs.x_ops == NULL) {
- return (WBKU_INTERNAL_ERR);
- }
-
- /*
- * The XDR routines may examine the content of the keyobj
- * structure to determine whether or not to provide memory
- * resources. Since XDR does not provide an init routine
- * for XDR generated objects, it seems that the safest thing
- * to do is to bzero() the object as a means of initialization.
- */
- bzero(&keyobj, sizeof (keyobj));
-
- /*
- * Read a key and check to see if matches the criteria.
- */
- for (keyno = 0; !feof(fp); keyno++) {
-
- /*
- * Returning the file position is conditional.
- */
- if (ppos != NULL) {
- if (fgetpos(fp, &pos) != 0) {
- ret = WBKU_INTERNAL_ERR;
- break;
- }
- }
-
- /*
- * Read the key. Unfortuantely, XDR does not provide
- * the ability to tell an EOF from some other IO error.
- * Therefore, a faliure to read is assumed to be EOF.
- */
- if (!xdr_wbku_key(&xdrs, &keyobj)) {
- ret = WBKU_NOKEY;
- break;
- }
-
- /*
- * Check this key against the criteria.
- */
- if ((strcmp(keyobj.wk_oid, ka->ka_oid) == 0) &&
- (keyobj.wk_master == master)) {
-
- ka->ka_len = keyobj.wk_key_len;
-
- /*
- * Conditionally return the key value and file
- * position.
- */
- if (ekey != NULL) {
- (void) memcpy(ekey, keyobj.wk_key_val,
- ka->ka_len);
- }
- if (ppos != NULL) {
- *ppos = pos;
- }
-
- xdr_free(xdr_wbku_key, (char *)&keyobj);
- ret = WBKU_SUCCESS;
- break;
- }
- xdr_free(xdr_wbku_key, (char *)&keyobj);
- }
-
- xdr_destroy(&xdrs);
- return (ret);
-}
-
-/*
- * This routine writes a key object to the key file at the location
- * specified by the caller.
- *
- * Returns:
- * WBKU_SUCCESS, WBKU_INTERNAL_ERR or WBKU_WRITE_ERR.
- */
-wbku_retcode_t
-wbku_write_key(FILE *fp, const fpos_t *ppos, const wbku_key_attr_t *ka,
- uint8_t *rand_key, boolean_t master)
-{
- XDR xdrs;
- wbku_key keyobj;
-
- /*
- * Set the file position as specified by the caller.
- */
- if (fsetpos(fp, ppos) != 0) {
- return (WBKU_INTERNAL_ERR);
- }
-
- /*
- * Initialize the XDR stream.
- */
- xdrs.x_ops = NULL;
- xdrstdio_create(&xdrs, fp, XDR_ENCODE);
- if (xdrs.x_ops == NULL) {
- return (WBKU_INTERNAL_ERR);
- }
-
- /*
- * Build the key object.
- */
- keyobj.wk_master = master;
- keyobj.wk_oid = ka->ka_oid;
- keyobj.wk_key_len = ka->ka_len;
- keyobj.wk_key_val = (char *)rand_key;
-
- /*
- * Write it.
- */
- if (!xdr_wbku_key(&xdrs, &keyobj)) {
- xdr_free(xdr_wbku_key, (char *)&keyobj);
- xdr_destroy(&xdrs);
- return (WBKU_WRITE_ERR);
- }
-
- /*
- * Free the stream and return success.
- */
- xdr_destroy(&xdrs);
- return (WBKU_SUCCESS);
-}
-
-/*
- * This routine reads the contents of one keystore file and copies it to
- * another, omitting the key of the type defined by 'ka'.
- *
- * Returns:
- * WBKU_SUCCESS, WBKU_INTERNAL_ERR or WBKU_WRITE_ERR.
- */
-wbku_retcode_t
-wbku_delete_key(FILE *from_fp, FILE *to_fp, const wbku_key_attr_t *ka)
-{
- XDR from_xdrs;
- XDR to_xdrs;
- wbku_key keyobj;
- int keyno;
- int ret;
-
- /*
- * Always, start at the beginning.
- */
- rewind(from_fp);
- rewind(to_fp);
-
- /*
- * Initialize the XDR streams.
- */
- from_xdrs.x_ops = NULL;
- xdrstdio_create(&from_xdrs, from_fp, XDR_DECODE);
- if (from_xdrs.x_ops == NULL) {
- return (WBKU_INTERNAL_ERR);
- }
-
- to_xdrs.x_ops = NULL;
- xdrstdio_create(&to_xdrs, to_fp, XDR_ENCODE);
- if (to_xdrs.x_ops == NULL) {
- xdr_destroy(&from_xdrs);
- return (WBKU_INTERNAL_ERR);
- }
-
- /*
- * The XDR routines may examine the content of the keyobj
- * structure to determine whether or not to provide memory
- * resources. Since XDR does not provide an init routine
- * for XDR generated objects, it seems that the safest thing
- * to do is to bzero() the object as a means of initialization.
- */
- bzero(&keyobj, sizeof (keyobj));
-
- /*
- * Read a key and check to see if matches the criteria.
- */
- ret = WBKU_SUCCESS;
- for (keyno = 0; !feof(from_fp); keyno++) {
-
- /*
- * Read the key. Unfortuantely, XDR does not provide
- * the ability to tell an EOF from some other IO error.
- * Therefore, a faliure to read is assumed to be EOF.
- */
- if (!xdr_wbku_key(&from_xdrs, &keyobj)) {
- break;
- }
-
- /*
- * If this isn't the key to skip, then write it.
- */
- if (strcmp(keyobj.wk_oid, ka->ka_oid) != 0) {
- /*
- * Write this to the copy.
- */
- if (!xdr_wbku_key(&to_xdrs, &keyobj)) {
- xdr_free(xdr_wbku_key, (char *)&keyobj);
- ret = WBKU_WRITE_ERR;
- break;
- }
-
- }
-
- xdr_free(xdr_wbku_key, (char *)&keyobj);
- }
-
- xdr_destroy(&from_xdrs);
- xdr_destroy(&to_xdrs);
-
- return (ret);
-}
diff --git a/usr/src/lib/libwanbootutil/common/key_util.h b/usr/src/lib/libwanbootutil/common/key_util.h
deleted file mode 100644
index fd1d2199fc..0000000000
--- a/usr/src/lib/libwanbootutil/common/key_util.h
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
- */
-
-#ifndef _KEY_UTIL_H
-#define _KEY_UTIL_H
-
-#pragma ident "%Z%%M% %I% %E% SMI"
-
-#include <stdio.h>
-#include <sys/types.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* Key algorithms */
-typedef enum {
- WBKU_KEY_3DES,
- WBKU_KEY_AES_128,
- WBKU_KEY_HMAC_SHA1,
- WBKU_KEY_RSA,
- WBKU_KEY_UNKNOWN
-} wbku_key_type_t;
-
-/* Algorithm keywords */
-#define WBKU_KW_3DES "3des"
-#define WBKU_KW_AES_128 "aes"
-#define WBKU_KW_HMAC_SHA1 "sha1"
-#define WBKU_KW_RSA "rsa"
-
-/* Algorithm types */
-#define WBKU_ENCR_KEY (uint_t)0x1
-#define WBKU_HASH_KEY (uint_t)0x2
-#define WBKU_ANY_KEY (WBKU_ENCR_KEY | WBKU_HASH_KEY)
-
-/* Return codes */
-typedef enum {
- WBKU_SUCCESS,
- WBKU_INTERNAL_ERR,
- WBKU_WRITE_ERR,
- WBKU_NOKEY,
- WBKU_BAD_KEYTYPE
-} wbku_retcode_t;
-
-#define WBKU_NRET (WBKU_BAD_KEYTYPE + 1)
-
-/* The master key file location. */
-#define MASTER_KEY_FILE "/etc/netboot/keystore"
-
-/* The root directory for all client keys */
-#define CLIENT_KEY_DIR "/etc/netboot"
-
-/* The structure that defines the attributes of a particular key type */
-typedef struct key_attr {
- wbku_key_type_t ka_type; /* key type */
- uint_t ka_atype; /* key algorithm type */
- uint_t ka_len; /* length of the current key */
- uint_t ka_minlen; /* shortest allowable key value */
- uint_t ka_maxlen; /* maximum allowable key length */
- char *ka_str; /* key string identifier */
- char *ka_oid; /* key algorithm oid */
- boolean_t (*ka_keycheck)(const uint8_t *); /* keycheck function */
-} wbku_key_attr_t;
-
-extern void wbku_errinit(const char *);
-extern void wbku_printerr(const char *, ...);
-extern const char *wbku_retmsg(wbku_retcode_t);
-extern wbku_retcode_t wbku_str_to_keyattr(const char *, wbku_key_attr_t *,
- uint_t);
-extern wbku_retcode_t wbku_find_key(FILE *, fpos_t *, wbku_key_attr_t *,
- uint8_t *, boolean_t);
-extern wbku_retcode_t wbku_write_key(FILE *, const fpos_t *,
- const wbku_key_attr_t *, uint8_t *, boolean_t);
-extern wbku_retcode_t wbku_delete_key(FILE *, FILE *, const wbku_key_attr_t *);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _KEY_UTIL_H */
diff --git a/usr/src/lib/libwanbootutil/common/key_xdr.x b/usr/src/lib/libwanbootutil/common/key_xdr.x
deleted file mode 100644
index f0b2be9b99..0000000000
--- a/usr/src/lib/libwanbootutil/common/key_xdr.x
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
- */
-
-/* #ident "%Z%%M% %I% %E% SMI" */
-
-/*
- * The formal definition of OIDs comes from ITU-T recommendation X.208
- */
-const WBKU_AES_128_OID = "2.16.840.1.101.3.4.1.2";
-const WBKU_DES3_OID = "1.3.6.1.4.1.4929.1.8";
-const WBKU_HMAC_SHA1_OID = "1.3.6.1.5.5.8.1.2";
-const WBKU_RSA_OID = "1.2.840.113549.1.1.1";
-
-const WBKU_MAX_KEYLEN = 1024;
-
-struct wbku_key {
- bool wk_master;
- string wk_oid<>;
- opaque KEYDATA<WBKU_MAX_KEYLEN>;
-};
-
-#ifdef RPC_HDR
-%#define wk_key_len KEYDATA.KEYDATA_len
-%#define wk_key_val KEYDATA.KEYDATA_val
-#endif /* RPC_HDR */
-
-/*
- * Allow one entry for each key that can be in a keystore at
- * the same time. There can be one AES key, one 3DES key,
- * two HMAC SHA-1 values (one master and one for the client) and one RSA
- * private key. The master key is a HMAC SHA-1 master key used to
- * derive a per-client HMAC SHA-1 key as described in RFC 3118, Appendix A.
- */
-typedef struct wbku_key wbku_keystore<5>;
diff --git a/usr/src/lib/libwanbootutil/common/llib-lwanbootutil b/usr/src/lib/libwanbootutil/common/llib-lwanbootutil
deleted file mode 100644
index 537e95af3b..0000000000
--- a/usr/src/lib/libwanbootutil/common/llib-lwanbootutil
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
- */
-
-#pragma ident "%Z%%M% %I% %E% SMI"
-
-/* LINTLIBRARY */
-/* PROTOLIB1 */
-
-#include <wanbootutil.h>
diff --git a/usr/src/lib/libwanbootutil/common/mapfile-vers b/usr/src/lib/libwanbootutil/common/mapfile-vers
deleted file mode 100644
index 260a6904b0..0000000000
--- a/usr/src/lib/libwanbootutil/common/mapfile-vers
+++ /dev/null
@@ -1,73 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
-#
-
-#
-# MAPFILE HEADER START
-#
-# WARNING: STOP NOW. DO NOT MODIFY THIS FILE.
-# Object versioning must comply with the rules detailed in
-#
-# usr/src/lib/README.mapfiles
-#
-# You should not be making modifications here until you've read the most current
-# copy of that file. If you need help, contact a gatekeeper for guidance.
-#
-# MAPFILE HEADER END
-#
-
-$mapfile_version 2
-
-SYMBOL_VERSION SUNWprivate_1.1 {
- global:
- aes_decrypt;
- aes_encrypt;
- aes_fini;
- aes_init;
- aes_key;
- aes_keycheck;
- cbc_decrypt;
- cbc_encrypt;
- cbc_makehandle;
- des3_decrypt;
- des3_encrypt;
- des3_fini;
- des3_init;
- des3_key;
- des3_keycheck;
- HMACFinal;
- HMACInit;
- HMACUpdate;
- wbio_nread;
- wbio_nread_rand;
- wbio_nwrite;
- wbku_delete_key;
- wbku_errinit;
- wbku_find_key;
- wbku_printerr;
- wbku_retmsg;
- wbku_str_to_keyattr;
- wbku_write_key;
- local:
- *;
-};
diff --git a/usr/src/lib/libwanbootutil/common/wanbootutil.h b/usr/src/lib/libwanbootutil/common/wanbootutil.h
deleted file mode 100644
index 96f11edf9d..0000000000
--- a/usr/src/lib/libwanbootutil/common/wanbootutil.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
- */
-
-#ifndef _WANBOOTUTIL_H
-#define _WANBOOTUTIL_H
-
-#pragma ident "%Z%%M% %I% %E% SMI"
-
-#include <aes.h>
-#include <cbc.h>
-#include <des3.h>
-#include <hmac_sha1.h>
-#include <wanboot/wbio.h>
-#include <wanboot/key_util.h>
-#include <wanboot/key_xdr.h>
-
-#endif /* _WANBOOTUTIL_H */
diff --git a/usr/src/lib/libwanbootutil/common/wbio.c b/usr/src/lib/libwanbootutil/common/wbio.c
deleted file mode 100644
index a03b0a00bb..0000000000
--- a/usr/src/lib/libwanbootutil/common/wbio.c
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
- */
-#pragma ident "%Z%%M% %I% %E% SMI"
-
-#include <unistd.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-
-#include "wbio.h"
-
-/*
- * Write `buflen' bytes from `buffer' to the file represented by `fd'.
- * Returns -1 if all `buflen' bytes cannot be written, otherwise returns 0.
- */
-int
-wbio_nwrite(int fd, const void *buffer, size_t buflen)
-{
- size_t nwritten;
- ssize_t nbytes;
- const char *buf = buffer;
-
- for (nwritten = 0; nwritten < buflen; nwritten += nbytes) {
- nbytes = write(fd, &buf[nwritten], buflen - nwritten);
- if (nbytes <= 0)
- return (-1);
- }
-
- return (0);
-}
-
-/*
- * Read `buflen' bytes into `buffer' from the file represented by `fd'.
- * Returns -1 if all `buflen' bytes cannot be read, otherwise returns 0.
- */
-int
-wbio_nread(int fd, void *buffer, size_t buflen)
-{
- size_t nread;
- ssize_t nbytes;
- char *buf = buffer;
-
- for (nread = 0; nread < buflen; nread += nbytes) {
- nbytes = read(fd, &buf[nread], buflen - nread);
- if (nbytes <= 0)
- return (-1);
- }
-
- return (0);
-}
-
-/*
- * Read a random number of `buflen' bytes into `buffer' from /dev/urandom.
- * Returns -1 if all `buflen' bytes cannot be read, otherwise returns 0.
- */
-int
-wbio_nread_rand(void *buffer, size_t buflen)
-{
- int fd;
-
- if ((fd = open("/dev/urandom", O_RDONLY)) == -1) {
- return (-1);
- }
-
- if (wbio_nread(fd, buffer, buflen) != 0) {
- (void) close(fd);
- return (-1);
- }
-
- (void) close(fd);
- return (0);
-}
diff --git a/usr/src/lib/libwanbootutil/common/wbio.h b/usr/src/lib/libwanbootutil/common/wbio.h
deleted file mode 100644
index 3747946492..0000000000
--- a/usr/src/lib/libwanbootutil/common/wbio.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
- */
-
-#ifndef _WBIO_H
-#define _WBIO_H
-
-#pragma ident "%Z%%M% %I% %E% SMI"
-
-#include <sys/types.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-extern int wbio_nwrite(int, const void *, size_t);
-extern int wbio_nread(int, void *, size_t);
-extern int wbio_nread_rand(void *, size_t);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _WBIO_H */
diff --git a/usr/src/lib/libwanbootutil/i386/Makefile b/usr/src/lib/libwanbootutil/i386/Makefile
deleted file mode 100644
index 5da8a52eba..0000000000
--- a/usr/src/lib/libwanbootutil/i386/Makefile
+++ /dev/null
@@ -1,31 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License, Version 1.0 only
-# (the "License"). You may not use this file except in compliance
-# with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-# Copyright 2002-2003 Sun Microsystems, Inc. All rights reserved.
-# Use is subject to license terms.
-#
-# ident "%Z%%M% %I% %E% SMI"
-#
-
-include ../Makefile.com
-
-install: all $(ROOTLIBS) $(ROOTLINKS) $(ROOTLINT)
diff --git a/usr/src/lib/libwanbootutil/libwanbootutil.xcl b/usr/src/lib/libwanbootutil/libwanbootutil.xcl
deleted file mode 100644
index 7ef4c71843..0000000000
--- a/usr/src/lib/libwanbootutil/libwanbootutil.xcl
+++ /dev/null
@@ -1,35 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License, Version 1.0 only
-# (the "License"). You may not use this file except in compliance
-# with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-# Copyright 2003 Sun Microsystems, Inc. All rights reserved.
-# Use is subject to license terms.
-#
-# ident "%Z%%M% %I% %E% SMI"
-#
-
-msgid "3DES"
-msgid "AES"
-msgid "HMAC/SHA1"
-msgid "rsa"
-msgid "%s: "
-msgid ": %s\n"
-msgid "RSA"
diff --git a/usr/src/lib/libwanbootutil/req.flg b/usr/src/lib/libwanbootutil/req.flg
deleted file mode 100644
index 54c90e1cda..0000000000
--- a/usr/src/lib/libwanbootutil/req.flg
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/bin/sh
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License, Version 1.0 only
-# (the "License"). You may not use this file except in compliance
-# with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-# Copyright 2003 Sun Microsystems, Inc. All rights reserved.
-# Use is subject to license terms.
-#
-# ident "%Z%%M% %I% %E% SMI"
-
-find_files "s.*" usr/src/common/net/wanboot/crypt
diff --git a/usr/src/lib/libwanbootutil/sparc/Makefile b/usr/src/lib/libwanbootutil/sparc/Makefile
deleted file mode 100644
index 5da8a52eba..0000000000
--- a/usr/src/lib/libwanbootutil/sparc/Makefile
+++ /dev/null
@@ -1,31 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License, Version 1.0 only
-# (the "License"). You may not use this file except in compliance
-# with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-# Copyright 2002-2003 Sun Microsystems, Inc. All rights reserved.
-# Use is subject to license terms.
-#
-# ident "%Z%%M% %I% %E% SMI"
-#
-
-include ../Makefile.com
-
-install: all $(ROOTLIBS) $(ROOTLINKS) $(ROOTLINT)
diff --git a/usr/src/lib/libwanbootutil/sparcv9/Makefile b/usr/src/lib/libwanbootutil/sparcv9/Makefile
deleted file mode 100644
index df2bad0003..0000000000
--- a/usr/src/lib/libwanbootutil/sparcv9/Makefile
+++ /dev/null
@@ -1,29 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License, Version 1.0 only
-# (the "License"). You may not use this file except in compliance
-# with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-# Copyright 2012 OmniTI Computer Consulting, Inc. All rights reserved.
-#
-
-include ../Makefile.com
-include ../../Makefile.lib.64
-
-install: all $(ROOTLIBS64) $(ROOTLINKS64) $(ROOTLINT64)