lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20201030132505.GC2333887@kuha.fi.intel.com>
Date:   Fri, 30 Oct 2020 15:25:05 +0200
From:   Heikki Krogerus <heikki.krogerus@...ux.intel.com>
To:     Prashant Malani <pmalani@...omium.org>
Cc:     linux-kernel@...r.kernel.org, Benson Leung <bleung@...omium.org>,
        Enric Balletbo i Serra <enric.balletbo@...labora.com>,
        Guenter Roeck <groeck@...omium.org>
Subject: Re: [PATCH 6/7] platform/chrome: cros_ec_typec: Parse partner PD ID
 VDOs

On Wed, Oct 28, 2020 at 01:11:35PM -0700, Prashant Malani wrote:
> Hi Heikki,
> 
> Thanks a lot for reviewing the patch!
> 
> On Wed, Oct 28, 2020 at 03:16:33PM +0200, Heikki Krogerus wrote:
> > > +
> > > +	/* Copy the remaining identity VDOs till a maximum of 6. */
> > > +	for (i = 3; i < sop_disc->identity_count && i < VDO_MAX_OBJECTS; i++)
> > > +		port->p_identity.vdo[i - 3] = sop_disc->discovery_vdo[i];
> > 
> > Why do you need to put the product type VDOs in reverse order?
> 
> The Chrome EC returns all the Identity VDOs as an array of 6 VDOs (the
> discovery_vdo[] array). The first three entries are assigned to the
> pd_identity.{id_header,cert_stat,product} members.
> 
> This for loop assigns the next three discovery_vdo entries (i.e indices
> 3-5) to pd_identity.vdo[0-2] respectively.
> 
> The "i-3" is because discovery_vdo[3] corresponds to pd_identity.vdo[0]
> and so on.
> 
> Does that help to clarify the for loop?

Yes. Thanks.

Br,

-- 
heikki

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ