On Mon, 2020-09-07 at 16:23 +0300, Jarkko Sakkinen wrote: > On Mon, Sep 07, 2020 at 07:38:24AM +0200, Greg KH wrote: > > Please just use a binary blob format. Binary sysfs files are > > exactly what this is for, you are just passing the data through the > > kernel from the hardware to userspace. > > > > You can have 24 binary files if that makes it easier, but the > > existing format really is an abuse of sysfs. There is no existing format for TPM 2.0 ... that's part of the problem since we certainly didn't want to carry over the TPM 1.2 format. I've got to say I think binary attributes are actively evil. I can see they're a necessity when there's no good way to represent the data they contain, like the bios measurement log or firmware code or a raw interface like we do for the SMP frame code in libsas. But when there's a well understood and easy to produce user friendly non-binary representation, I think dumping binary is inimical to being a good API. > > Or use securityfs, that's fine too, but as you say, you have to > > write more code for that. > > > > thanks, > > > > greg k-h > > I suggested this in previous round: to have a single 'pcrs' binary > file with <TPM Alg ID, blob> pairs contained. There's no current use case today that wants all values. Every current use case wants either a single PCR or a selection mostly from a single bank, so forcing every current user to dig out the values they want from a binary blob rather than being able to gather them simply also seems to be an API that makes users' lives harder than they need to be. James