From owner-svn-src-stable-11@freebsd.org Mon Mar 11 21:38:00 2019 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 220B7152F82C; Mon, 11 Mar 2019 21:38:00 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B9FC48501D; Mon, 11 Mar 2019 21:37:59 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AB3F518A62; Mon, 11 Mar 2019 21:37:59 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x2BLbxFD039303; Mon, 11 Mar 2019 21:37:59 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2BLbx9k039302; Mon, 11 Mar 2019 21:37:59 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201903112137.x2BLbx9k039302@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 11 Mar 2019 21:37:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r345028 - stable/11/tools/tools/crypto X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: stable/11/tools/tools/crypto X-SVN-Commit-Revision: 345028 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B9FC48501D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.995,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Mar 2019 21:38:00 -0000 Author: jhb Date: Mon Mar 11 21:37:58 2019 New Revision: 345028 URL: https://svnweb.freebsd.org/changeset/base/345028 Log: MFC 331417,331597: Add the cryptocheck test tool. 331417: Bring in JHB's cryptocheck tool It can be used to validate basic algorithm correctness on a variety of inputs, by comarison to openssl. While here, add some sanity to the crypto/Makefile. The tool may not be perfect, but getting it in tree where collaboration can happen is a nice first step. The pace of development outside of svn seems to have slowed down mid-2017. 331597: Update the license to note my work on cryptocheck was sponsored. Sponsored by: Chelsio Communications Added: stable/11/tools/tools/crypto/cryptocheck.c - copied, changed from r331417, head/tools/tools/crypto/cryptocheck.c Modified: stable/11/tools/tools/crypto/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/tools/tools/crypto/Makefile ============================================================================== --- stable/11/tools/tools/crypto/Makefile Mon Mar 11 21:35:56 2019 (r345027) +++ stable/11/tools/tools/crypto/Makefile Mon Mar 11 21:37:58 2019 (r345028) @@ -1,5 +1,6 @@ # $FreeBSD$ # +# Copyright (c) 2018 Conrad Meyer # Copyright (c) 2002, 2003 Sam Leffler, Errno Consulting # All rights reserved. # @@ -25,40 +26,23 @@ # SUCH DAMAGE. # -ALL= cryptotest cryptokeytest cryptostats \ +PROGS= cryptocheck cryptotest cryptokeytest cryptostats \ ubsecstats hifnstats ipsecstats safestats -BINDIR= /usr/local/bin +MAN= +BINDIR?= /usr/local/bin -all: ${ALL} +# cryptocheck: test symmetric crypto functions +LIBADD.cryptocheck+= crypto ssl util -# program to test asymmetric crypto functions -cryptokeytest: cryptokeytest.c - ${CC} -o cryptokeytest cryptokeytest.c -lcrypto +# cryptokeytest: test asymmetric crypto functions +LIBADD.cryptokeytest+= crypto -# program to dump statistics kept by the core crypto code -cryptostats: cryptostats.c - ${CC} -o cryptostats cryptostats.c +# cryptostats: dump statistics kept by the core crypto code +# ubsecstats: print statistics kept by the Broadcom driver +# hifnstats: print statistics kept by the HIFN driver +# safestats: statistics kept by the SafeNet driver +# ipsecstats: print statistics kept by fast ipsec -# program to print statistics kept by the Broadcom driver -ubsecstats: ubsecstats.c - ${CC} -o ubsecstats ubsecstats.c +CLEANFILES+= core a.out -# program to print statistics kept by the HIFN driver -hifnstats: hifnstats.c - ${CC} -o hifnstats hifnstats.c - -# program to print statistics kept by the SafeNet driver -safestats: safestats.c - ${CC} -o safestats safestats.c - -# program to print statistics kept by fast ipsec -ipsecstats: ipsecstats.c - ${CC} -o ipsecstats ipsecstats.c - -clean: - rm -f ${ALL} core a.out - -install: ${ALL} - for i in ${ALL}; do \ - install $$i ${DESTDIR}${BINDIR}; \ - done +.include Copied and modified: stable/11/tools/tools/crypto/cryptocheck.c (from r331417, head/tools/tools/crypto/cryptocheck.c) ============================================================================== --- head/tools/tools/crypto/cryptocheck.c Fri Mar 23 04:31:19 2018 (r331417, copy source) +++ stable/11/tools/tools/crypto/cryptocheck.c Mon Mar 11 21:37:58 2019 (r345028) @@ -1,5 +1,30 @@ /*- - * Copyright (c) 2017 John Baldwin, + * Copyright (c) 2017 Chelsio Communications, Inc. + * All rights reserved. + * Written by: John Baldwin + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +/*- * Copyright (c) 2004 Sam Leffler, Errno Consulting * All rights reserved. *