diff options
author | Jerry Jelinek <jerry.jelinek@joyent.com> | 2018-09-11 13:13:36 +0000 |
---|---|---|
committer | Jerry Jelinek <jerry.jelinek@joyent.com> | 2018-09-11 13:13:36 +0000 |
commit | 320339a509cdabf5e7ef29b9822e874e35e0c1bf (patch) | |
tree | d974214b8e3d0e834d50b76079681be83683022d | |
parent | 9c4c8cab4de50f98dd50cee2eeef61f204061c10 (diff) | |
parent | eefd54bbb6ed4d7d16358eae44834b65fcb304cd (diff) | |
download | illumos-joyent-320339a509cdabf5e7ef29b9822e874e35e0c1bf.tar.gz |
[illumos-gate merge]
commit eefd54bbb6ed4d7d16358eae44834b65fcb304cd
9826 sha2.3ext should document truncated SHA512 algorithms
commit 2076885612f784f9ddfc09282d62518d0f9b2c4d
9093 want basic utility for Ethernet level pong
commit 56a20711c16596906185d9bfb85f8a4b02e93fc6
9094 want writable uregs[] in dtrace
Conflicts:
usr/src/cmd/dlutil/dlsend.c
usr/src/cmd/dlutil/dlrecv.c
usr/src/cmd/dlutil/Makefile
-rw-r--r-- | usr/src/cmd/dlutil/Makefile | 7 | ||||
-rw-r--r-- | usr/src/cmd/dlutil/dlrecv.c | 42 | ||||
-rw-r--r-- | usr/src/cmd/dlutil/dlsend.c | 29 | ||||
-rw-r--r-- | usr/src/man/man3ext/sha2.3ext | 22 | ||||
-rw-r--r-- | usr/src/pkg/manifests/system-dtrace-tests.mf | 9 | ||||
-rw-r--r-- | usr/src/pkg/manifests/system-network.mf | 2 |
6 files changed, 53 insertions, 58 deletions
diff --git a/usr/src/cmd/dlutil/Makefile b/usr/src/cmd/dlutil/Makefile index 4c7738ec3a..4c0563474d 100644 --- a/usr/src/cmd/dlutil/Makefile +++ b/usr/src/cmd/dlutil/Makefile @@ -23,10 +23,13 @@ CFLAGS += $(CCVERBOSE) dltraninfo := LDLIBS += -ldladm -lsff -lnvpair dlled := LDLIBS += -ldladm +dlsend := LDLIBS += -ldlpi -lsocket +dlrecv := LDLIBS += -ldlpi + dltraninfo.ln := LDLIBS += -ldladm -lsff -lnvpair dlled.ln := LDLIBS += -ldladm -dlsend := LDLIBS += -ldlpi -lsocket -lmd -dlrecv := LDLIBS += -ldlpi +dlsend.ln := LDLIBS += -ldlpi -lsocket +dlrecv.ln := LDLIBS += -ldlpi ROOTLIBDLFILES = $(PROG:%=$(ROOTLIB)/dl/%) diff --git a/usr/src/cmd/dlutil/dlrecv.c b/usr/src/cmd/dlutil/dlrecv.c index 4464baced9..d24bc6f360 100644 --- a/usr/src/cmd/dlutil/dlrecv.c +++ b/usr/src/cmd/dlutil/dlrecv.c @@ -10,7 +10,7 @@ */ /* - * Copyright (c) 2017, Joyent, Inc. + * Copyright (c) 2018, Joyent, Inc. */ /* @@ -32,6 +32,7 @@ #include <stdint.h> #include <endian.h> #include <ctype.h> +#include <err.h> #include "dlsend.h" @@ -40,17 +41,6 @@ static uint_t dlrecv_sap = DLSEND_SAP; static const char *dlrecv_prog; static void -dlrecv_warn(const char *fmt, ...) -{ - va_list ap; - - (void) fprintf(stderr, "%s: ", dlrecv_prog); - va_start(ap, fmt); - (void) vfprintf(stderr, fmt, ap); - va_end(ap); -} - -static void dlrecv_usage(const char *fmt, ...) { if (fmt != NULL) { @@ -77,7 +67,7 @@ dlrecv_isvalid(dlsend_msg_t *msg) for (i = 0; i < sizeof (msg->dm_host); i++) { if (!isprint(msg->dm_host[i]) && msg->dm_host[i] != '\0') { - dlrecv_warn("Encountered bad byte in dm_host[%d]\n", + warnx("Encountered bad byte in dm_host[%d]\n", i); return (B_FALSE); } @@ -87,7 +77,7 @@ dlrecv_isvalid(dlsend_msg_t *msg) } if (!nul) { - dlrecv_warn("Missing NUL in dm_host\n"); + warnx("Missing NUL in dm_host\n"); return (B_FALSE); } @@ -95,7 +85,7 @@ dlrecv_isvalid(dlsend_msg_t *msg) for (i = 0; i < sizeof (msg->dm_mesg); i++) { if (!isprint(msg->dm_mesg[i]) && msg->dm_mesg[i] != '\0') { - dlrecv_warn("Encountered bad byte in dm_mesg[%d]\n", + warnx("Encountered bad byte in dm_mesg[%d]\n", i); return (B_FALSE); } @@ -105,12 +95,12 @@ dlrecv_isvalid(dlsend_msg_t *msg) } if (!nul) { - dlrecv_warn("Missing NUL in dm_mesg\n"); + warnx("Missing NUL in dm_mesg\n"); return (B_FALSE); } if (strcmp(msg->dm_mesg, DLSEND_MSG) != 0) { - dlrecv_warn("Missing expected message (%s)\n", DLSEND_MSG); + warnx("Missing expected message (%s)\n", DLSEND_MSG); return (B_FALSE); } @@ -122,7 +112,8 @@ dlrecv_print(dlsend_msg_t *msg, dlpi_recvinfo_t *rinfo, boolean_t invalid) { uint_t i; - printf("Received %s from ", invalid ? "invalid message" : "Elbereth"); + (void) printf("Received %s from ", invalid ? + "invalid message" : "Elbereth"); for (i = 0; i < rinfo->dri_destaddrlen; i++) { (void) printf("%02x", rinfo->dri_destaddr[i]); @@ -134,7 +125,7 @@ dlrecv_print(dlsend_msg_t *msg, dlpi_recvinfo_t *rinfo, boolean_t invalid) return; } - printf(" seq=%" PRIu64 " host=%s\n", betoh64(msg->dm_count), + (void) printf(" seq=%" PRIu64 " host=%s\n", betoh64(msg->dm_count), msg->dm_host); } @@ -181,19 +172,19 @@ main(int argc, char *argv[]) } if ((ret = dlpi_open(argv[0], &dh, 0)) != DLPI_SUCCESS) { - dlrecv_warn("failed to open %s: %s\n", argv[0], + warnx("failed to open %s: %s\n", argv[0], dlpi_strerror(ret)); exit(1); } if ((ret = dlpi_bind(dh, dlrecv_sap, &bind_sap)) != DLPI_SUCCESS) { - dlrecv_warn("failed to bind to sap 0x%x: %s\n", dlrecv_sap, + warnx("failed to bind to sap 0x%x: %s\n", dlrecv_sap, dlpi_strerror(ret)); exit(1); } if (bind_sap != dlrecv_sap) { - dlrecv_warn("failed to bind to requested sap 0x%x, bound to " + warnx("failed to bind to requested sap 0x%x, bound to " "0x%x\n", dlrecv_sap, bind_sap); exit(1); } @@ -207,20 +198,20 @@ main(int argc, char *argv[]) msglen = sizeof (msg); ret = dlpi_recv(dh, NULL, NULL, &msg, &msglen, -1, &rinfo); if (ret != DLPI_SUCCESS) { - dlrecv_warn("failed to receive data: %s\n", + warnx("failed to receive data: %s\n", dlpi_strerror(ret)); continue; } if (msglen != rinfo.dri_totmsglen) { - dlrecv_warn("message truncated: expected %ld bytes, " + warnx("message truncated: expected %ld bytes, " "got %ld\n", sizeof (dlsend_msg_t), rinfo.dri_totmsglen); invalid = B_TRUE; } if (msglen != sizeof (msg)) { - dlrecv_warn("message too short: expected %ld bytes, " + warnx("message too short: expected %ld bytes, " "got %ld\n", sizeof (dlsend_msg_t), msglen); invalid = B_TRUE; @@ -233,5 +224,6 @@ main(int argc, char *argv[]) dlrecv_print(&msg, &rinfo, invalid); } + /* LINTED: E_STMT_NOT_REACHED */ return (0); } diff --git a/usr/src/cmd/dlutil/dlsend.c b/usr/src/cmd/dlutil/dlsend.c index e77d157f53..995ba45eee 100644 --- a/usr/src/cmd/dlutil/dlsend.c +++ b/usr/src/cmd/dlutil/dlsend.c @@ -10,7 +10,7 @@ */ /* - * Copyright (c) 2017, Joyent, Inc. + * Copyright (c) 2018, Joyent, Inc. */ /* @@ -31,6 +31,7 @@ #include <stddef.h> #include <stdint.h> #include <endian.h> +#include <err.h> #include "dlsend.h" @@ -39,17 +40,6 @@ static const char *dlsend_msg = DLSEND_MSG; static const char *dlsend_prog; static void -dlsend_warn(const char *fmt, ...) -{ - va_list ap; - - (void) fprintf(stderr, "%s: ", dlsend_prog); - va_start(ap, fmt); - (void) vfprintf(stderr, fmt, ap); - va_end(ap); -} - -static void dlsend_usage(const char *fmt, ...) { if (fmt != NULL) { @@ -112,30 +102,30 @@ main(int argc, char *argv[]) } if ((mac = _link_aton(argv[1], &maclen)) == NULL) { - dlsend_warn("failed to convert target address %s\n", argv[1]); + warnx("failed to convert target address %s\n", argv[1]); return (1); } if (gethostname(host, sizeof (host)) != 0) { - dlsend_warn("failed to obtain the system hostname: %s\n", + warnx("failed to obtain the system hostname: %s\n", strerror(errno)); (void) strlcpy(host, "<unknown host>", sizeof (host)); } if ((ret = dlpi_open(argv[0], &dh, 0)) != DLPI_SUCCESS) { - dlsend_warn("failed to open %s: %s\n", argv[0], + warnx("failed to open %s: %s\n", argv[0], dlpi_strerror(ret)); exit(1); } if ((ret = dlpi_bind(dh, dlsend_sap, &bind_sap)) != DLPI_SUCCESS) { - dlsend_warn("failed to bind to sap 0x%x: %s\n", dlsend_sap, + warnx("failed to bind to sap 0x%x: %s\n", dlsend_sap, dlpi_strerror(ret)); exit(1); } if (bind_sap != dlsend_sap) { - dlsend_warn("failed to bind to requested sap 0x%x, bound to " + warnx("failed to bind to requested sap 0x%x, bound to " "0x%x\n", dlsend_sap, bind_sap); exit(1); } @@ -151,13 +141,14 @@ main(int argc, char *argv[]) (void) strlcpy(msg.dm_mesg, dlsend_msg, sizeof (msg.dm_mesg)); ret = dlpi_send(dh, mac, maclen, &msg, sizeof (msg), NULL); if (ret != DLPI_SUCCESS) { - dlsend_warn("failed to send message: %s\n", + warnx("failed to send message: %s\n", dlpi_strerror(ret)); exit(1); } - sleep(1); + (void) sleep(1); } + /* LINTED: E_STMT_NOT_REACHED */ return (0); } diff --git a/usr/src/man/man3ext/sha2.3ext b/usr/src/man/man3ext/sha2.3ext index f55c95c2ef..ae49257dc1 100644 --- a/usr/src/man/man3ext/sha2.3ext +++ b/usr/src/man/man3ext/sha2.3ext @@ -1,9 +1,10 @@ '\" te +.\" Copyright 2018 OmniOS Community Edition (OmniOSce) Association. .\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved. .\" 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] -.TH SHA2 3EXT "Nov 13, 2007" +.TH SHA2 3EXT "Sep 10, 2018" .SH NAME sha2, SHA2Init, SHA2Update, SHA2Final, SHA256Init, SHA256Update, SHA256Final, SHA384Init, SHA384Update, SHA384Final, SHA512Init, SHA512Update, SHA512Final \- @@ -77,15 +78,15 @@ SHA2 digest functions .fi .SH DESCRIPTION -.sp .LP The \fBSHA2Init()\fR, \fBSHA2Update()\fR, \fBSHA2Final()\fR functions implement -the \fBSHA256\fR, \fBSHA384\fR and \fBSHA512\fR message-digest algorithms. The -algorithms take as input a message of arbitrary length and produces a 200-bit -"fingerprint" or "message digest" as output. The \fBSHA2\fR message-digest -algorithms are intended for digital signature applications in which large files -are "compressed" in a secure manner before being encrypted with a private -(secret) key under a public-key cryptosystem such as RSA. +the \fBSHA256\fR, \fBSHA384\fR, \fBSHA512\fR, \fBSHA512/224\fR and +\fBSHA512/256\fR message-digest algorithms. The algorithms take as input a +message of arbitrary length and produce a 200-bit "fingerprint" or "message +digest" as output. The \fBSHA2\fR message-digest algorithms are intended for +digital signature applications in which large files are "compressed" in a +secure manner before being encrypted with a private (secret) key under a +public-key cryptosystem such as RSA. .sp .ne 2 .na @@ -103,7 +104,7 @@ consists of calls to \fBSHA2\fR functions in the following order: one call to .sp The \fBSHA2Init()\fR function initializes the SHA2 context structure pointed to by \fIcontext\fR. The \fImech\fR argument is one of \fBSHA256\fR, \fBSHA512\fR, -\fBSHA384\fR. +\fBSHA384\fR, \fBSHA512_224\fR, \fBSHA512_256\fR. .sp The \fBSHA2Update()\fR function computes a partial \fBSHA2\fR digest on the \fIinlen\fR-byte message block pointed to by \fIinput\fR, and updates the @@ -133,7 +134,6 @@ argument as it is implicit in the function names. .RE .SH RETURN VALUES -.sp .LP These functions do not return a value. .SH EXAMPLES @@ -211,7 +211,6 @@ AuthenticateMsg(unsigned char *auth_buffer, struct iovec .in -2 .SH ATTRIBUTES -.sp .LP See \fBattributes\fR(5) for descriptions of the following attributes: .sp @@ -229,7 +228,6 @@ MT-Level MT-Safe .TE .SH SEE ALSO -.sp .LP \fBlibmd\fR(3LIB) .sp diff --git a/usr/src/pkg/manifests/system-dtrace-tests.mf b/usr/src/pkg/manifests/system-dtrace-tests.mf index e76cef46cc..f39776b305 100644 --- a/usr/src/pkg/manifests/system-dtrace-tests.mf +++ b/usr/src/pkg/manifests/system-dtrace-tests.mf @@ -158,6 +158,12 @@ $(sparc_ONLY)file \ $(sparc_ONLY)file \ path=opt/SUNWdtrt/tst/$(ARCH)/pid/err.D_PROC_ALIGN.misaligned.exe \ mode=0555 +$(i386_ONLY)file path=opt/SUNWdtrt/tst/$(ARCH)/pid/err.uregswrite1.d mode=0444 +$(i386_ONLY)file path=opt/SUNWdtrt/tst/$(ARCH)/pid/err.uregswrite1.exe \ + mode=0555 +$(i386_ONLY)file path=opt/SUNWdtrt/tst/$(ARCH)/pid/err.uregswrite2.d mode=0444 +$(i386_ONLY)file path=opt/SUNWdtrt/tst/$(ARCH)/pid/err.uregswrite2.exe \ + mode=0555 $(i386_ONLY)file path=opt/SUNWdtrt/tst/$(ARCH)/pid/tst.badinstr.d mode=0444 $(i386_ONLY)file path=opt/SUNWdtrt/tst/$(ARCH)/pid/tst.badinstr.exe mode=0555 $(sparc_ONLY)file path=opt/SUNWdtrt/tst/$(ARCH)/pid/tst.br.d mode=0444 @@ -171,6 +177,9 @@ $(i386_ONLY)file path=opt/SUNWdtrt/tst/$(ARCH)/pid/tst.ret.d mode=0444 $(i386_ONLY)file path=opt/SUNWdtrt/tst/$(ARCH)/pid/tst.ret.exe mode=0555 $(i386_ONLY)file path=opt/SUNWdtrt/tst/$(ARCH)/pid/tst.retlist.exe mode=0555 $(i386_ONLY)file path=opt/SUNWdtrt/tst/$(ARCH)/pid/tst.retlist.ksh mode=0444 +$(i386_ONLY)file path=opt/SUNWdtrt/tst/$(ARCH)/pid/tst.uregswrite.d mode=0444 +$(i386_ONLY)file path=opt/SUNWdtrt/tst/$(ARCH)/pid/tst.uregswrite.exe \ + mode=0555 $(sparc_ONLY)file path=opt/SUNWdtrt/tst/$(ARCH)/usdt/tst.tailcall.ksh \ mode=0444 file path=opt/SUNWdtrt/tst/$(ARCH)/ustack/tst.annotated.d mode=0444 diff --git a/usr/src/pkg/manifests/system-network.mf b/usr/src/pkg/manifests/system-network.mf index 4f7a8978ff..61c8bd345f 100644 --- a/usr/src/pkg/manifests/system-network.mf +++ b/usr/src/pkg/manifests/system-network.mf @@ -84,6 +84,8 @@ file path=sbin/flowadm mode=0555 file path=sbin/flowstat mode=0555 file path=sbin/ipadm mode=0555 file path=usr/lib/dl/dlled mode=0555 +file path=usr/lib/dl/dlrecv mode=0555 +file path=usr/lib/dl/dlsend mode=0555 file path=usr/lib/dl/dltraninfo mode=0555 file path=usr/share/man/man1m/dladm.1m file path=usr/share/man/man1m/flowadm.1m |