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 <msh...@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;
        }
 
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to