Skip to content

CSR GEN tries to unhexlify a bit string instead of hex #6

@tuupola

Description

@tuupola

When calculating the cSHAKE128 hash the code tries to unhexlify a bit string.

h_orchid_left = unhexlify(b_prefix + b_hid + b_ogaid)

This produces 32 bytes of meaningless data instead of 8 bytes the 64 bits represent. You can confirm this by adding some debug logging.

	print("XXX org:", b_prefix + b_hid + b_ogaid)
	h_orchid_left = unhexlify(b_prefix + b_hid + b_ogaid)
	print("XXX unhexlified:", h_orchid_left)
$ python3 ../csr-gen.py --keyname=raa16376 --serialnumber=x2344 --keynameexists=N --raa 16376 --hda 20 | grep XXX
XXX org: 0010000000000001000000000011111111111110000000000001010000000101
XXX unhexlified: b'\x00\x10\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x11\x11\x11\x11\x11\x11\x10\x00\x00\x00\x00\x00\x01\x01\x00\x00\x00\x01\x01'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions