Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 8 Jun 2017 04:54:16 +0000 (UTC)
From:      Marcelo Araujo <araujo@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r319682 - head/usr.sbin/bhyve
Message-ID:  <201706080454.v584sGw6087973@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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 <mshirk@daemon-security.com>
  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;
 	}
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201706080454.v584sGw6087973>