Bug 1462565 - RPMs >4GB are not supported with the sign-rpms wire protocol
Summary: RPMs >4GB are not supported with the sign-rpms wire protocol
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora EPEL
Classification: Fedora
Component: sigul
Version: epel7
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Patrick Uiterwijk
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-06-18 23:19 UTC by Patrick Uiterwijk
Modified: 2020-06-09 11:24 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2020-06-09 11:24:02 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Patrick Uiterwijk 2017-06-18 23:19:20 UTC
The current wire protocol encodes the payload size as a 32-bit unsigned integer.
This means that if an RPM is larger than 4GB, it cannot be encoded and the signing fails.

The exception:
Traceback (most recent call last):
  File "/usr/share/sigul/utils.py", line 681, in run
    self._real_run()
  File "/usr/share/sigul/bridge.py", line 693, in _real_run
    self.__handle_one_rpm(rpm)
  File "/usr/share/sigul/bridge.py", line 713, in __handle_one_rpm
    self.__server_buf.write(utils.u32_pack(payload_size))
  File "/usr/share/sigul/utils.py", line 201, in u32_pack
    return struct.pack(_u32_format, v)
error: 'I' format requires 0 <= number <= 4294967295

Fixing this probably requires a change to the wire protocol details for the sign-rpms call.

This was found due to #1456261.

Comment 1 Patrick Uiterwijk 2017-06-19 06:09:21 UTC
Funny detail: this was already marked as FIXME in the protocol design:

** u32 L payload length
   The payload length limit is request-specific.
   FIXME: should be u64?

I don't think there's a sane way to fix this without bumping the protocol_version, so I guess we will just raise this to u64 and increase protocol_version to 1.

This does mean we will need to add the code to the bridge to check the servers' protocol_version, which the code currently mentions as not implemented, which so far with a single protocol version wasn't such a big deal.

I think I'm going to combine this with the moving of signature stripping to the server for the koji case (https://bugzilla.redhat.com/show_bug.cgi?id=1367568#c3).

Comment 2 Patrick Uiterwijk 2020-06-09 11:24:02 UTC
This is now fixed in Sigul v1.0, of which Alpha 1 is now released and built in Rawhide.


Note You need to log in before you can comment on or make changes to this bug.