From owner-svn-src-head@freebsd.org Thu Jun 8 04:54:17 2017 Return-Path: Delivered-To: svn-src-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 3A984BF57C0; Thu, 8 Jun 2017 04:54:17 +0000 (UTC) (envelope-from araujo@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 0938573DC3; Thu, 8 Jun 2017 04:54:16 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v584sGeQ087974; Thu, 8 Jun 2017 04:54:16 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v584sGw6087973; Thu, 8 Jun 2017 04:54:16 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201706080454.v584sGw6087973@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Thu, 8 Jun 2017 04:54:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319682 - head/usr.sbin/bhyve X-SVN-Group: head 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.23 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: Thu, 08 Jun 2017 04:54:17 -0000 Author: araujo Date: Thu Jun 8 04:54:15 2017 New Revision: 319682 URL: https://svnweb.freebsd.org/changeset/base/319682 Log: Make the VNC authentication build with LibreSSL on HardenedBSD and TrueOS. PR: 219790 Submitted by: Shirkdog Reviewed by: grehan and rgrimes MFC after: 4 weeks. Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D11071 Modified: head/usr.sbin/bhyve/rfb.c Modified: head/usr.sbin/bhyve/rfb.c ============================================================================== --- head/usr.sbin/bhyve/rfb.c Thu Jun 8 04:50:50 2017 (r319681) +++ head/usr.sbin/bhyve/rfb.c Thu Jun 8 04:54:15 2017 (r319682) @@ -832,12 +832,14 @@ rfb_handle(struct rfb_softc *rc, int cfd) memcpy(crypt_expected, challenge, AUTH_LENGTH); /* Encrypt the Challenge with DES */ - DES_set_key((C_Block *)keystr, &ks); - DES_ecb_encrypt((C_Block *)challenge, - (C_Block *)crypt_expected, &ks, DES_ENCRYPT); - DES_ecb_encrypt((C_Block *)(challenge + PASSWD_LENGTH), - (C_Block *)(crypt_expected + PASSWD_LENGTH), + DES_set_key((const_DES_cblock *)keystr, &ks); + DES_ecb_encrypt((const_DES_cblock *)challenge, + (const_DES_cblock *)crypt_expected, &ks, DES_ENCRYPT); + DES_ecb_encrypt((const_DES_cblock *)(challenge + PASSWD_LENGTH), + (const_DES_cblock *)(crypt_expected + + PASSWD_LENGTH), + &ks, DES_ENCRYPT); if (memcmp(crypt_expected, buf, AUTH_LENGTH) != 0) { message = "Auth Failed: Invalid Password."; @@ -858,7 +860,7 @@ rfb_handle(struct rfb_softc *rc, int cfd) if (sres) { *((uint32_t *) buf) = htonl(strlen(message)); stream_write(cfd, buf, 4); - stream_write(cfd, message, strlen(message)); + stream_write(cfd, message, strlen(message)); goto done; }