• Stefan Berger's avatar
    tpm: Fix display of data in pubek sysfs entry · 5a79444f
    Stefan Berger authored
    This patch fixes the TPM's pubek sysfs entry that is accessible as long
    as the TPM doesn't have an owner. It was necessary to shift the access to the
    data by -10 -- the first byte immediately follows the 10 byte header. The
    line
    
     	data = tpm_cmd.params.readpubek_out_buffer;
    
    sets it at the offset '10' in the packet, so we can read the data array
    starting at offset '0'.
    
    Before:
    
    Algorithm: 00 0C 00 00
    Encscheme: 08 00
    Sigscheme: 00 00
    Parameters: 00 00 00 00 01 00 AC E2 5E 3C A0 78
    Modulus length: -563306801
    Modulus:
    28 21 08 0F 82 CD F2 B1 E7 49 F7 74 70 BE 59 8C
    43 78 B1 24 EA 52 E2 FE 52 5C 3A 12 3B DC 61 71
    [...]
    
    After:
    
    Algorithm: 00 00 00 01
    Encscheme: 00 03
    Sigscheme: 00 01
    Parameters: 00 00 08 00 00 00 00 02 00 00 00 00
    Modulus length: 256
    Modulus:
    AC E2 5E 3C A0 78 DE 6C 9E CF 28 21 08 0F 82 CD
    F2 B1 E7 49 F7 74 70 BE 59 8C 43 78 B1 24 EA 52
    [...]
    Signed-off-by: default avatarStefan Berger <stefanb@linux.vnet.ibm.com>
    Signed-off-by: default avatarRajiv Andrade <srajiv@linux.vnet.ibm.com>
    5a79444f
tpm.c 31.1 KB