You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Verifying a sharded signature without a hashing config fails: shard_size is read back as a float #690
Verifying a shard-serialized signature without an explicit hashing config fails with a TypeError instead of verifying.
The signing payload goes through a protobuf Struct, so shard_size is written as a double ("shard_size": 4.0 in the DSSE payload). When verifying.Config has no hashing config, _guess_hashing_config passes that float to use_shard_serialization, and _endpoints then calls range() with it.
Reproducer on main (05e665f), using the test keys in scripts/tests/keys/certificate:
File ".../model_signing/_serialization/file_shard.py", line 50, in _endpoints
yield from range(step, end, step)
TypeError: 'float' object cannot be interpreted as an integer
The existing sharded tests all pass an explicit set_hashing_config(...use_shard_serialization()) to the verifier, so the guessed path is not covered.
The spec defines shard_size as a positive integer, and existing signatures already carry the .0 form, so I think the fix belongs on the reading side: accept a whole-number float when the manifest is rebuilt from the signature (_ShardSerialization._from_args) and reject anything that is not a positive whole number. I have a small patch with tests and will open a PR linking this issue.
Activity