From owner-svn-ports-head@freebsd.org Sat Nov 5 16:56:02 2016 Return-Path: Delivered-To: svn-ports-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1C1BBBEDDE3; Sat, 5 Nov 2016 16:56:02 +0000 (UTC) (envelope-from grembo@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 mx1.freebsd.org (Postfix) with ESMTPS id C4C941B9; Sat, 5 Nov 2016 16:56:01 +0000 (UTC) (envelope-from grembo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uA5Gu02D085813; Sat, 5 Nov 2016 16:56:00 GMT (envelope-from grembo@FreeBSD.org) Received: (from grembo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uA5Gu0TK085812; Sat, 5 Nov 2016 16:56:00 GMT (envelope-from grembo@FreeBSD.org) Message-Id: <201611051656.uA5Gu0TK085812@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: grembo set sender to grembo@FreeBSD.org using -f From: Michael Gmelin Date: Sat, 5 Nov 2016 16:56:00 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r425398 - in head/databases/mariadb101-server: . files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Nov 2016 16:56:02 -0000 Author: grembo Date: Sat Nov 5 16:56:00 2016 New Revision: 425398 URL: https://svnweb.freebsd.org/changeset/ports/425398 Log: Fix data encryption at rest when building with LibreSSL Replace RAND_SSLeay->bytes with arc4random_buf when using LibreSSL, as it supports RAND_SSLeay only for ABI compatibility [0]. Note that the code in question in mariadb mentions that RAND_bytes isn't guaranteed to not block and therefore uses these functions directly. As LibreSSL implements RAND_bytes in terms of arc4random_buf, which shouldn't block, the patch could also use RAND_bytes instead of using arc4random_buf directly, but the current version of the patch has been tested in production and might be less confusing overall. Bumped revision, as this fixes a runtime problem. [0] https://github.com/libressl/libressl/blob/master/src/crypto/rand/rand_lib.c#L36 PR: 213577 Approved by: ssl blanket Added: head/databases/mariadb101-server/files/patch-mysys_ssl-my_crypt.cc (contents, props changed) Modified: head/databases/mariadb101-server/Makefile Modified: head/databases/mariadb101-server/Makefile ============================================================================== --- head/databases/mariadb101-server/Makefile Sat Nov 5 16:54:58 2016 (r425397) +++ head/databases/mariadb101-server/Makefile Sat Nov 5 16:56:00 2016 (r425398) @@ -2,6 +2,7 @@ PORTNAME?= mariadb PORTVERSION= 10.1.18 +PORTREVISION= 1 CATEGORIES= databases ipv6 MASTER_SITES= http://ftp.osuosl.org/pub/${SITESDIR}/ \ http://mirrors.supportex.net/${SITESDIR}/ \ Added: head/databases/mariadb101-server/files/patch-mysys_ssl-my_crypt.cc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/databases/mariadb101-server/files/patch-mysys_ssl-my_crypt.cc Sat Nov 5 16:56:00 2016 (r425398) @@ -0,0 +1,25 @@ +--- mysys_ssl/my_crypt.cc.orig 2016-08-29 16:38:54.000000000 +0200 ++++ mysys_ssl/my_crypt.cc 2016-10-17 19:14:45.146531847 +0200 +@@ -275,10 +275,14 @@ + return MY_AES_OK; + } + #else ++#include + #include + + int my_random_bytes(uchar *buf, int num) + { ++#if defined(LIBRESSL_VERSION_NUMBER) ++ arc4random_buf(buf, num); ++#else + /* + Unfortunately RAND_bytes manual page does not provide any guarantees + in relation to blocking behavior. Here we explicitly use SSLeay random +@@ -288,6 +292,7 @@ + RAND_METHOD *rand = RAND_SSLeay(); + if (rand == NULL || rand->bytes(buf, num) != 1) + return MY_AES_OPENSSL_ERROR; ++#endif + return MY_AES_OK; + } + #endif