From owner-svn-src-head@freebsd.org Fri Jul 20 01:51:06 2018 Return-Path: Delivered-To: svn-src-head@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 AD22B102AA55; Fri, 20 Jul 2018 01:51:06 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5E37586561; Fri, 20 Jul 2018 01:51:06 +0000 (UTC) (envelope-from cem@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 3F5C5160A; Fri, 20 Jul 2018 01:51:06 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w6K1p6MD011555; Fri, 20 Jul 2018 01:51:06 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w6K1p6Uj011554; Fri, 20 Jul 2018 01:51:06 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201807200151.w6K1p6Uj011554@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 20 Jul 2018 01:51:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r336527 - head/tools/tools/crypto X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/tools/tools/crypto X-SVN-Commit-Revision: 336527 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jul 2018 01:51:06 -0000 Author: cem Date: Fri Jul 20 01:51:05 2018 New Revision: 336527 URL: https://svnweb.freebsd.org/changeset/base/336527 Log: cryptocheck: Correct mismatch between OpenSSL use and OCF Blake2 This corrects a mistake introduced to the cryptocheck tool in r331418. Our CRYPTO_BLAKE2B and CRYPTO_BLAKE2S algorithms refer to either the plain, unkeyed hashes (specified with cri_klen = 0), or a Blake2-specific keyed MAC (when a cri_key is provided). In contrast, OpenSSL's Blake2 algorithms only provide the plain hash. Cryptocheck's T_HMAC corresponds to OpenSSL's HMAC() routine, which is the ordinary HMAC construction applied to any plain, unkeyed hash. We don't have any HMAC-Blake2 cipher modes in OCF, so fix the test to only test Blake2 as a plain hash. (Ideally we would test keyed Blake2 as well, but that is left as future work.) PR: 229795 Modified: head/tools/tools/crypto/cryptocheck.c Modified: head/tools/tools/crypto/cryptocheck.c ============================================================================== --- head/tools/tools/crypto/cryptocheck.c Fri Jul 20 00:44:04 2018 (r336526) +++ head/tools/tools/crypto/cryptocheck.c Fri Jul 20 01:51:05 2018 (r336527) @@ -155,9 +155,9 @@ struct alg { .evp_md = EVP_sha384 }, { .name = "sha512hmac", .mac = CRYPTO_SHA2_512_HMAC, .type = T_HMAC, .evp_md = EVP_sha512 }, - { .name = "blake2b", .mac = CRYPTO_BLAKE2B, .type = T_HMAC, + { .name = "blake2b", .mac = CRYPTO_BLAKE2B, .type = T_HASH, .evp_md = EVP_blake2b512 }, - { .name = "blake2s", .mac = CRYPTO_BLAKE2S, .type = T_HMAC, + { .name = "blake2s", .mac = CRYPTO_BLAKE2S, .type = T_HASH, .evp_md = EVP_blake2s256 }, { .name = "aes-cbc", .cipher = CRYPTO_AES_CBC, .type = T_BLKCIPHER, .evp_cipher = EVP_aes_128_cbc },