--- old/usr/src/cmd/cmd-inet/usr.lib/wanboot/Makefile.com	2014-05-20 11:53:48.295517103 +0400
+++ new/usr/src/cmd/cmd-inet/usr.lib/wanboot/Makefile.com	2014-05-20 11:53:48.365209787 +0400
@@ -31,4 +31,8 @@
 
 CERRWARN += -_gcc=-Wno-uninitialized
 
+# OpenSSL 1.0 and 0.9.8 produce different lint warnings
+LINTFLAGS   +=    -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED
+LINTFLAGS64 +=    -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED
+
 .KEEP_STATE:
--- old/usr/src/cmd/cmd-inet/usr.lib/wanboot/p12split/Makefile	2014-05-20 11:53:48.919632028 +0400
+++ new/usr/src/cmd/cmd-inet/usr.lib/wanboot/p12split/Makefile	2014-05-20 11:53:48.939640284 +0400
@@ -25,9 +25,14 @@
 include ../Makefile.com
 
 PROG=		p12split
-LDLIBS +=	-lwanboot -linetutil -lwanbootutil -lcrypto
+LDLIBS +=	-lwanboot -linetutil -lwanbootutil
 CPPFLAGS +=	-I$(CMNCRYPTDIR)
 
+# libcrypto has no lint library, so we can only include this while building
+$(PROG) := LDLIBS += -lcrypto
+
+LINTFLAGS +=	-erroff=E_NAME_USED_NOT_DEF2
+
 all:		$(PROG)
 
 install:	all $(ROOTCMD)
--- old/usr/src/cmd/cmd-inet/usr.lib/wanboot/wanboot-cgi/Makefile	2014-05-20 11:53:49.259814841 +0400
+++ new/usr/src/cmd/cmd-inet/usr.lib/wanboot/wanboot-cgi/Makefile	2014-05-20 11:53:49.292055113 +0400
@@ -25,9 +25,12 @@
 include ../Makefile.com
 
 PROG =		wanboot-cgi
-LDLIBS +=	-lgen -lnsl -lwanbootutil -lnvpair -lwanboot -lcrypto
+LDLIBS +=	-lgen -lnsl -lwanbootutil -lnvpair -lwanboot
 CPPFLAGS +=	-I$(CMNCRYPTDIR)
 
+# libcrypto has no lint library, so we can only include this while building
+$(PROG) := LDLIBS += -lcrypto
+
 all:		$(PROG)
 
 install:	all $(ROOTCMD)
--- old/usr/src/cmd/ssh/libssh/Makefile.com	2014-05-20 11:53:49.634234536 +0400
+++ new/usr/src/cmd/ssh/libssh/Makefile.com	2014-05-20 11:53:49.648697619 +0400
@@ -94,7 +94,7 @@
 # Define LDLIBS conditionally for lintcheck, rather than in general, since
 # we're building an archive library which itself links to nothing, we just
 # want lint to know about these libraries.
-lintcheck  :=	LDLIBS += -lcrypto -lz -lsocket -lnsl -lc
+lintcheck  :=	LDLIBS += -lz -lsocket -lnsl -lc
 $(LINTLIB) :=	SRCS = $(SRCDIR)/$(LINTSRC)
 
 POFILE_DIR =	../..
--- old/usr/src/cmd/ssh/sftp-server/Makefile	2014-05-20 11:53:49.942107021 +0400
+++ new/usr/src/cmd/ssh/sftp-server/Makefile	2014-05-20 11:53:49.962529920 +0400
@@ -31,7 +31,10 @@
 include ../../Makefile.cmd
 include ../Makefile.ssh-common
 
-LDLIBS +=	$(SSH_COMMON_LDLIBS) -lsocket -lcrypto
+LDLIBS +=	$(SSH_COMMON_LDLIBS) -lsocket
+
+# libcrypto has no lint library, so we can only use it when building
+$(PROG) := 	LDLIBS += -lcrypto
 
 POFILE_DIR =	..
 
--- old/usr/src/cmd/ssh/sftp/Makefile	2014-05-20 11:53:50.263590539 +0400
+++ new/usr/src/cmd/ssh/sftp/Makefile	2014-05-20 11:53:50.274185786 +0400
@@ -35,7 +35,10 @@
 include ../../Makefile.cmd
 include ../Makefile.ssh-common
 
-LDLIBS +=	$(SSH_COMMON_LDLIBS) -lsocket -lcrypto -ltecla
+LDLIBS +=	$(SSH_COMMON_LDLIBS) -lsocket -ltecla
+
+# libcrypto has no lint library, so we can only use it when building
+$(PROG) := LDLIBS += -lcrypto
 
 POFILE_DIR =	..
 
--- old/usr/src/cmd/ssh/ssh-add/Makefile	2014-05-20 11:53:50.578590348 +0400
+++ new/usr/src/cmd/ssh/ssh-add/Makefile	2014-05-20 11:53:50.592577139 +0400
@@ -32,7 +32,10 @@
 include ../../Makefile.cmd
 include ../Makefile.ssh-common
 
-LDLIBS += $(SSH_COMMON_LDLIBS) -lsocket -lcrypto
+LDLIBS += $(SSH_COMMON_LDLIBS) -lsocket
+
+# libcrypto has no lint library, so we can only use it when building
+$(PROG) := LDLIBS += -lcrypto
 
 POFILE_DIR= ..
 
--- old/usr/src/cmd/ssh/ssh-agent/Makefile	2014-05-20 11:53:50.888786097 +0400
+++ new/usr/src/cmd/ssh/ssh-agent/Makefile	2014-05-20 11:53:50.902110159 +0400
@@ -32,7 +32,10 @@
 include ../../Makefile.cmd
 include ../Makefile.ssh-common
 
-LDLIBS += $(SSH_COMMON_LDLIBS) -lsocket -lcrypto
+LDLIBS += $(SSH_COMMON_LDLIBS) -lsocket
+
+# libcrypto has no lint library, so we can only use it when building
+$(PROG) := LDLIBS += -lcrypto
 
 POFILE_DIR= ..
 
--- old/usr/src/cmd/ssh/ssh-keygen/Makefile	2014-05-20 11:53:51.210886102 +0400
+++ new/usr/src/cmd/ssh/ssh-keygen/Makefile	2014-05-20 11:53:51.225359461 +0400
@@ -32,7 +32,10 @@
 include ../../Makefile.cmd
 include ../Makefile.ssh-common
 
-LDLIBS += $(SSH_COMMON_LDLIBS) -lcrypto -lsocket
+LDLIBS += $(SSH_COMMON_LDLIBS) -lsocket
+
+# libcrypto has no lint library, so we can only use it when building
+$(PROG) := LDLIBS += -lcrypto
 
 POFILE_DIR= ..
 
--- old/usr/src/cmd/ssh/ssh-keyscan/Makefile	2014-05-20 11:53:51.529062003 +0400
+++ new/usr/src/cmd/ssh/ssh-keyscan/Makefile	2014-05-20 11:53:51.542503612 +0400
@@ -32,7 +32,10 @@
 include ../../Makefile.cmd
 include ../Makefile.ssh-common
 
-LDLIBS += $(SSH_COMMON_LDLIBS) -lsocket -lnsl -lz -lcrypto
+LDLIBS += $(SSH_COMMON_LDLIBS) -lsocket -lnsl -lz
+
+# libcrypto has no lint library, so we can only use it when building
+$(PROG) := LDLIBS += -lcrypto
 
 POFILE_DIR= ..
 
--- old/usr/src/cmd/ssh/ssh-keysign/Makefile	2014-05-20 11:53:51.824383313 +0400
+++ new/usr/src/cmd/ssh/ssh-keysign/Makefile	2014-05-20 11:53:51.834023393 +0400
@@ -36,7 +36,10 @@
 
 FILEMODE= 04555
 
-LDLIBS += $(SSH_COMMON_LDLIBS) -lsocket -lnsl -lz -lcrypto
+LDLIBS += $(SSH_COMMON_LDLIBS) -lsocket -lnsl -lz
+
+# libcrypto has no lint library, so we can only use it when building
+$(PROG) := LDLIBS += -lcrypto
 
 POFILE_DIR= ..
 
--- old/usr/src/cmd/ssh/ssh/Makefile	2014-05-20 11:53:52.130794932 +0400
+++ new/usr/src/cmd/ssh/ssh/Makefile	2014-05-20 11:53:52.141437591 +0400
@@ -40,9 +40,11 @@
 LDLIBS += $(SSH_COMMON_LDLIBS) -lsocket \
 	-lnsl \
 	-lz \
-	-lcrypto \
 	-lgss
 
+# libcrypto has no lint library, so we can only use it when building
+$(PROG) := LDLIBS += -lcrypto
+
 POFILE_DIR= ..
 
 .KEEP_STATE:
--- old/usr/src/cmd/ssh/sshd/Makefile	2014-05-20 11:53:52.426141988 +0400
+++ new/usr/src/cmd/ssh/sshd/Makefile	2014-05-20 11:53:52.437188946 +0400
@@ -75,12 +75,14 @@
 	-lpam \
 	-lbsm \
 	-lwrap \
-	-lcrypto \
 	-lgss \
 	-lcontract
 MAPFILES = $(MAPFILE.INT) $(MAPFILE.NGB)
 LDFLAGS += $(MAPFILES:%=-M%)
 
+# libcrypto has no lint library, so we can only use it when building
+$(PROG) := LDLIBS += -lcrypto
+
 POFILE_DIR= ..
 
 .KEEP_STATE:
--- old/usr/src/common/net/wanboot/boot_http.c	2014-05-20 11:53:52.725545432 +0400
+++ new/usr/src/common/net/wanboot/boot_http.c	2014-05-20 11:53:52.749224732 +0400
@@ -2254,7 +2254,6 @@
 		return;
 
 	for (i = 0; i < sk_SSL_CIPHER_num(sk); i++) {
-		/* LINTED */
 		c = sk_SSL_CIPHER_value(sk, i);
 		libbootlog(BOOTLOG_VERBOSE, "%08lx %s", c->id, c->name);
 	}
--- old/usr/src/lib/libkmf/plugins/kmf_openssl/Makefile.com	2014-05-20 11:53:53.149750907 +0400
+++ new/usr/src/lib/libkmf/plugins/kmf_openssl/Makefile.com	2014-05-20 11:53:53.173301490 +0400
@@ -40,8 +40,12 @@
 OPENSSLLIBS=	$(BERLIB) -lcrypto -lcryptoutil -lc
 OPENSSLLIBS64=	$(BERLIB64) -lcrypto -lcryptoutil -lc
 
-LINTSSLLIBS	= $(BERLIB) -lcrypto -lcryptoutil -lc
-LINTSSLLIBS64	= $(BERLIB64) -lcrypto -lcryptoutil -lc
+LINTSSLLIBS	= $(BERLIB) -lcryptoutil -lc
+LINTSSLLIBS64	= $(BERLIB64) -lcryptoutil -lc
+
+# OpenSSL 1.0 and 0.9.8 produce different lint warnings
+LINTFLAGS   +=    -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED
+LINTFLAGS64 +=    -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED
 
 SRCDIR=		../common
 INCDIR=		../../include
--- old/usr/src/lib/libkmf/plugins/kmf_openssl/common/openssl_spi.c	2014-05-20 11:53:53.513059964 +0400
+++ new/usr/src/lib/libkmf/plugins/kmf_openssl/common/openssl_spi.c	2014-05-20 11:53:53.556437085 +0400
@@ -2033,7 +2033,7 @@
 #if OPENSSL_VERSION_NUMBER < 0x10000000L
 	STACK *emlst = NULL;
 #else
-        STACK_OF(OPENSSL_STRING) *emlst = NULL;
+	STACK_OF(OPENSSL_STRING) *emlst = NULL;
 #endif
 	X509_EXTENSION *ex;
 	X509_CINF *ci;
@@ -2153,7 +2153,7 @@
 #else
 		for (j = 0; j < sk_OPENSSL_STRING_num(emlst); j++)
 			(void) BIO_printf(mem, "%s\n",
-                            sk_OPENSSL_STRING_value(emlst, j));
+			    sk_OPENSSL_STRING_value(emlst, j));
 #endif
 
 		len = BIO_gets(mem, resultStr, KMF_CERT_PRINTABLE_LEN);
@@ -3778,7 +3778,7 @@
 			if (OBJ_obj2nid(a->object) == nid) {
 				X509_ATTRIBUTE_free(a);
 				/* LINTED E_BAD_PTR_CAST_ALIGN */
-				sk_X509_ATTRIBUTE_set(pkey->attributes,
+				(void) sk_X509_ATTRIBUTE_set(pkey->attributes,
 				    i, attr);
 				return (KMF_OK);
 			}
--- old/usr/src/lib/libpkg/Makefile.com	2014-05-20 11:53:54.005179777 +0400
+++ new/usr/src/lib/libpkg/Makefile.com	2014-05-20 11:53:54.021732360 +0400
@@ -57,14 +57,18 @@
 # openssl forces us to ignore dubious pointer casts, thanks to its clever
 # use of macros for stack management.
 LINTFLAGS=      -umx -errtags \
-		-erroff=E_BAD_PTR_CAST_ALIGN,E_BAD_PTR_CAST
+		-erroff=E_BAD_PTR_CAST_ALIGN,E_BAD_PTR_CAST,E_SUPPRESSION_DIRECTIVE_UNUSED
 $(LINTLIB):=	SRCS = $(SRCDIR)/$(LINTSRC)
 
 
 LIBS = $(DYNLIB) $(LINTLIB)
 
 
-LDLIBS +=	-lc -lssl -lwanboot -lcrypto -lscf -ladm
+LDLIBS +=	-lc -lwanboot -lscf -ladm
+
+# libcrypto and libssl have no lint library, and so can only be used when
+# building
+$(DYNLIB) := LDLIBS += -lcrypto -lssl
 
 CFLAGS +=	$(CCVERBOSE)
 CERRWARN +=	-_gcc=-Wno-unused-label
--- old/usr/src/lib/libpkg/common/security.c	2014-05-20 11:53:54.301853591 +0400
+++ new/usr/src/lib/libpkg/common/security.c	2014-05-20 11:53:54.315281289 +0400
@@ -110,7 +110,6 @@
 
 	/* add all ca certs into the store */
 	for (i = 0; i < sk_X509_num(cas); i++) {
-		/* LINTED pointer cast may result in improper alignment */
 		ca_cert = sk_X509_value(cas, i);
 		if (X509_STORE_add_cert(ca_store, ca_cert) == 0) {
 			pkgerr_add(err, PKGERR_NOMEM, gettext(ERR_MEM));
@@ -174,8 +173,7 @@
 	    NID_commonName, sname,
 	    ATTR_MAX) <= 0) {
 		(void) strncpy(sname,
-		    X509_NAME_oneline(xname,
-			NULL, 0), ATTR_MAX);
+		    X509_NAME_oneline(xname, NULL, 0), ATTR_MAX);
 		sname[ATTR_MAX - 1] = '\0';
 	}
 	return (sname);
@@ -205,8 +203,7 @@
 	    NID_commonName, sname,
 	    ATTR_MAX) <= 0) {
 		(void) strncpy(sname,
-		    X509_NAME_oneline(xname,
-			NULL, 0), ATTR_MAX);
+		    X509_NAME_oneline(xname, NULL, 0), ATTR_MAX);
 		sname[ATTR_MAX - 1] = '\0';
 	}
 	return (sname);
--- old/usr/src/lib/libwanboot/Makefile.com	2014-05-20 11:53:54.607664165 +0400
+++ new/usr/src/lib/libwanboot/Makefile.com	2014-05-20 11:53:54.624993084 +0400
@@ -60,7 +60,12 @@
 
 LIBS +=		$(LINTLIB)
 LDLIBS +=	-lnvpair -lresolv -lnsl -lsocket -ldevinfo -ldhcputil \
-		-linetutil -lc -lcrypto -lssl
+		-linetutil -lc
+
+# libcrypto and libssl have no lint library, so we can only use it when
+# building
+$(DYNLIB) := LDLIBS += -lcrypto -lssl
+
 CPPFLAGS =	-I$(SRC)/common/net/wanboot/crypt $(CPPFLAGS.master)
 CERRWARN +=	-_gcc=-Wno-switch
 CERRWARN +=	-_gcc=-Wno-parentheses
@@ -79,6 +84,10 @@
 LINTFLAGS   +=    -erroff=E_BAD_PTR_CAST_ALIGN
 LINTFLAGS64 +=    -erroff=E_BAD_PTR_CAST_ALIGN
 
+# OpenSSL 1.0 and 0.9.8 produce different lint warnings
+LINTFLAGS   +=    -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED
+LINTFLAGS64 +=    -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED
+
 CFLAGS +=	$(CCVERBOSE)
 CPPFLAGS +=	-I$(LOC_DIR) -I$(COM_DIR) -I$(DHCP_DIR)
 
--- old/usr/src/lib/pkcs11/pkcs11_tpm/Makefile.com	2014-05-20 11:53:54.943440757 +0400
+++ new/usr/src/lib/pkcs11/pkcs11_tpm/Makefile.com	2014-05-20 11:53:54.956066941 +0400
@@ -73,7 +73,12 @@
 TSSLIB64=-L$(TSPILIBDIR)/$(MACH64)
 TSSINC=-I$(TSPIINCDIR)
 
-LDLIBS += $(TSSLIB) -L$(ADJUNCT_PROTO)/lib -lc -luuid -lmd -ltspi -lcrypto
+LDLIBS += $(TSSLIB) -L$(ADJUNCT_PROTO)/lib -lc -luuid -lmd -ltspi
+
+# libcrypto has no lint library, so we can only use it when
+# building
+$(LIBS) := LDLIBS += -lcrypto
+
 CPPFLAGS += -xCC -D_POSIX_PTHREAD_SEMANTICS $(TSSINC)
 CPPFLAGS64 += $(CPPFLAGS)
 C99MODE=        $(C99_ENABLE)
