From owner-svn-src-all@freebsd.org Sat Jun 10 16:55:12 2017 Return-Path: Delivered-To: svn-src-all@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 CB416BF1D41; Sat, 10 Jun 2017 16:55:12 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-wr0-x235.google.com (mail-wr0-x235.google.com [IPv6:2a00:1450:400c:c0c::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6055D7F765; Sat, 10 Jun 2017 16:55:12 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-wr0-x235.google.com with SMTP id q97so59278015wrb.2; Sat, 10 Jun 2017 09:55:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=1EBI6kOXAU/Pa+X/YI2eBsb8dByHucsAldh+VCAl7rM=; b=ZMT5YhmuudF35Y77Wim9Yi9bI0Rz069old4B+4oR1x53/mtkDaNkYKZNM6UchQAOFk 85u0p8yWjd4Rgb25JIPxdMFydwuiiP4cxQ8lffUhGIheNh9w2YBynEUnLFhWON1vBrhh WpP1rHZGKsLKCGrO0PygWmbmZBmhnpq657x4bR8yHtHNAxsQq6cGTYZg/DFPECJBAUrM 1OAqxwR54HRRq/UiThVBarRSwYqVVT6+/IsuDangsZDVJgWKUBM+wssuXxr/UX3ruIFx uVqa3bGDxgQabEDpVpl4NuiioAiHVsYf8QcWr4xYx25ExRqwpkSxl6X56oOdWBoicOLn w8dw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=1EBI6kOXAU/Pa+X/YI2eBsb8dByHucsAldh+VCAl7rM=; b=FEv7dff5ti3vmr/IZ2acDE39Ecv4KED0mV2ac5aBnIQKeOQRwuIbhBd+Omu8EXqoSl znHSN4uzysAQAc9kgKh818z4YV0ta7ZvSw7rs2RYTmnyNi8b0V7Nmr7I/6uy6oJm544P 4F9O8YmisdS0WyMZwX1OKNyP+Em83892oY00HzJVF5JMDszKfAYfevG0JuA+Cwc/x/IO pysnwAYaoBzy/fxvTBK73Qi5G6T/EfIpZA7CaeyHPhB5K81NJ9weJb+7Vmt76/amhPUv WJ1G1w1jgZs/S8j1AIWh3VOuWynB2dBYxSLXy46Kc/LAdB6KmbB5TCG1S1Zc131YDS/a T85w== X-Gm-Message-State: AODbwcBa5790XzJ2EvBz0QrQ18A7gPYnex+nZNKrWyXfI88W7m3cLrJR W0bZX3Xyc3jHJaI7c00H+dEFhccpe/1WbJY= X-Received: by 10.80.135.208 with SMTP id 16mr27412870edz.124.1497113710749; Sat, 10 Jun 2017 09:55:10 -0700 (PDT) MIME-Version: 1.0 Received: by 10.80.164.154 with HTTP; Sat, 10 Jun 2017 09:55:10 -0700 (PDT) In-Reply-To: References: <201706020235.v522ZGeC076100@repo.freebsd.org> From: Conrad Meyer Date: Sat, 10 Jun 2017 09:55:10 -0700 Message-ID: Subject: Re: svn commit: r319487 - head/usr.sbin/bhyve To: Marcelo Araujo Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Jun 2017 16:55:12 -0000 Forgot to mention =E2=80=94 this one was CID 1375949. Additionally additionally, On Thu, Jun 1, 2017 at 7:35 PM, Marcelo Araujo wrote: > Author: araujo > Date: Fri Jun 2 02:35:16 2017 > New Revision: 319487 > URL: https://svnweb.freebsd.org/changeset/base/319487 > > Log: > Add VNC Authentication support based on RFC6143 section 7.2.2. > > ... > > Modified: head/usr.sbin/bhyve/rfb.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/usr.sbin/bhyve/rfb.c Fri Jun 2 01:00:40 2017 (r319486) > +++ head/usr.sbin/bhyve/rfb.c Fri Jun 2 02:35:16 2017 (r319487) > ... > @@ -739,8 +754,19 @@ rfb_handle(struct rfb_softc *rc, int cfd) > { > const char *vbuf =3D "RFB 003.008\n"; > unsigned char buf[80]; > + unsigned char *message; > + > +#ifndef NO_OPENSSL > + unsigned char challenge[AUTH_LENGTH]; > + unsigned char keystr[PASSWD_LENGTH]; > + unsigned char crypt_expected[AUTH_LENGTH]; > + > + DES_key_schedule ks; > + int i; > +#endif > + > pthread_t tid; This is uninitialized. > - uint32_t sres; > + uint32_t sres; > int len; > > rc->cfd =3D cfd; > @@ -751,19 +777,91 @@ rfb_handle(struct rfb_softc *rc, int cfd) > ... > + /* 2c. Do VNC authentication */ > + switch (buf[0]) { > + case SECURITY_TYPE_NONE: > + sres =3D 0; > + break; > + case SECURITY_TYPE_VNC_AUTH: ... > > + > + if (memcmp(crypt_expected, buf, AUTH_LENGTH) !=3D 0) { > + message =3D "Auth Failed: Invalid Password."; > + sres =3D htonl(1); > + } else > + sres =3D 0; > +#else > + sres =3D 0; > + WPRINTF(("Auth not supported, no OpenSSL in your system")= ); > +#endif > + > + break; > + } > + > + /* 2d. Write back a status */ > stream_write(cfd, &sres, 4); > > + if (sres) { > + *((uint32_t *) buf) =3D htonl(strlen(message)); > + stream_write(cfd, buf, 4); > + stream_write(cfd, message, strlen(message)); > + goto done; > + } When authentication fails, 'done:' label will pthread_join(tid), which is also uninitialized at this point. This is CID 1375950. Best, Conrad