Re: [PATCH v2 1/3] ima-evm-utils: Allow manual setting keyid for signing

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, May 05, 2021 at 02:18:04AM +0300, Vitaly Chikunov wrote:
> Stefan,
> 
> On Tue, May 04, 2021 at 08:51:03AM -0400, Stefan Berger wrote:
> > > @@ -932,8 +932,10 @@ static int sign_hash_v2(const char *algo, const unsigned char *hash,
> > >   		return -1;
> > >   	}
> > > -	calc_keyid_v2(&keyid, name, pkey);
> > > -	hdr->keyid = keyid;
> > > +	if (imaevm_params.keyid)
> > > +		hdr->keyid = htonl(imaevm_params.keyid);
> > 
> > 
> > Nit: Since existing code uses __be32_to_cpup I would use __cpu_to_be32 here.
> 
> That __be32_to_cpup usage is highly dubious. Perhaps, it should be
> converted to some user-space and standard functions like be32toh(3).

By the way, be32toh() is identical to ntohl().

I wonder what was the reason for the existing code to use these obscure
linux-specific functions instead of posix interface described in
byteorder(3)?


-- 
ldv



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux Kernel]     [Linux Kernel Hardening]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux