• Jason Gunthorpe's avatar
    tpm_show_pubek is utterly and completely wrong, all the offsets into the · bdcca38c
    Jason Gunthorpe authored
    binary blob are wrong, the output is garbage.  Do it again.
    
    Before:
    Algorithm: 00 0C 00 00
    Encscheme: 08 00
    Sigscheme: 00 00
    Parameters: 00 00 00 00 01 00 AF 6B 30 9B 0D B3
    Modulus length: -1266846667
    Modulus:
    68 45 8D CA A5 EF A8 8A DD 0F D7 84 8E 8D 1F 40
    22 92 09 CF 12 C8 9F 6E 55 57 6A 2C A8 0B 5E 45
    C7 5E 3D 56 DA 64 E6 E1 F7 8C DD 41 92 28 2E 06
    41 02 3E 11 7D B2 C5 46 38 E5 8C 60 D2 96 EE 0C
    D6 3D F8 99 E3 02 3A 32 7A 02 C8 31 29 98 28 B9
    1B EF 30 A1 A0 45 A0 C0 05 0E C5 96 95 FD 91 47
    0A 35 E0 69 B0 8B 49 BD B9 F6 5D 25 21 25 79 1B
    20 0D C3 C7 1F 87 5E 5F 41 4B DE 32 DF 55 F3 BD
    7F CA D8 7D 3A B4 D5 0A EF CF 8E 72 20 52 15 FA
    FB C6 C0 2E C2 AB C6 07 D0 9D 96 6B 2E 30 F7 54
    C4 A5 CD 9B 13 54 A0 D1 71 66 91 97 06 12 B5 2D
    B2 33 62 FB 56 62 64 A8 AA E9 F2 F4 03 C3 F4 49
    2A 09 0D 7D 75 99 6C F0 47 1E 7D D5 A5 CA CE EF
    45 B2 DA 88 93 B4 EE EB FB B0 A6 A4 19 C4 B8 0D
    04 46 AE BD C5 2E 30 84 49 57 25 34 78 E6 ED C4
    50 AF 3B F6 86 43 54 0A D9 DB 54 9C 06 B3 50 7F
    
    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:
    AF 6B 30 9B 0D B3 B4 7D 74 35 68 45 8D CA A5 EF
    A8 8A DD 0F D7 84 8E 8D 1F 40 22 92 09 CF 12 C8
    9F 6E 55 57 6A 2C A8 0B 5E 45 C7 5E 3D 56 DA 64
    E6 E1 F7 8C DD 41 92 28 2E 06 41 02 3E 11 7D B2
    C5 46 38 E5 8C 60 D2 96 EE 0C D6 3D F8 99 E3 02
    3A 32 7A 02 C8 31 29 98 28 B9 1B EF 30 A1 A0 45
    A0 C0 05 0E C5 96 95 FD 91 47 0A 35 E0 69 B0 8B
    49 BD B9 F6 5D 25 21 25 79 1B 20 0D C3 C7 1F 87
    5E 5F 41 4B DE 32 DF 55 F3 BD 7F CA D8 7D 3A B4
    D5 0A EF CF 8E 72 20 52 15 FA FB C6 C0 2E C2 AB
    C6 07 D0 9D 96 6B 2E 30 F7 54 C4 A5 CD 9B 13 54
    A0 D1 71 66 91 97 06 12 B5 2D B2 33 62 FB 56 62
    64 A8 AA E9 F2 F4 03 C3 F4 49 2A 09 0D 7D 75 99
    6C F0 47 1E 7D D5 A5 CA CE EF 45 B2 DA 88 93 B4
    EE EB FB B0 A6 A4 19 C4 B8 0D 04 46 AE BD C5 2E
    30 84 49 57 25 34 78 E6 ED C4 50 AF 3B F6 86 43
    
    I've checked this decoded output in two different ways.
    
    Tested on a winbond WPCT200
    Signed-off-by: default avatarJason Gunthorpe <jgunthorpe@obsidianresearch.com>
    Cc: Debora Velarde <debora@linux.vnet.ibm.com>
    Cc: Rajiv Andrade <srajiv@linux.vnet.ibm.com>
    Cc: Marcel Selhorst <m.selhorst@sirrix.com>
    Cc: James Morris <jmorris@namei.org>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    bdcca38c
tpm.c 29.1 KB