Skip to content

Conversation

@stefanberger
Copy link
Owner

This PR adds but does not enable the new SvnLimited and FirmwareLimited hierarchies.

The OBJECT now gets a new field 'hierarchy' that is written to and read from. In addition to the sync with the upstream code we need to make sure that OBJECTs always have their hierarchy field set now, which means we have to set it after unmarshalling and converting from older OBJECT types of written by previous versions. The hierachy can be easily derived from an OBJECT's attribute flags.

Bump up the StateFormatLevel to 6 and use it to drive changes to the marshalling of an OBJECT that in its new version 4 now always marshals the hierarchy field but also only marshals the private exponent in case the OBJECT represents an RSA key.

@stefanberger stefanberger force-pushed the stefanberger/rev180.new_hierarchies branch 2 times, most recently from 7c7e2cb to ba936eb Compare July 24, 2024 20:56
Move code that determines an OBJECT's hierarchy by its attribute flags
into BackwardsCompatibilityObject.c since it will soon only serve the
purpose of backwards compatibility.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Add new field hierarchy to OBJECT and assign values to it and access it.

Beyond the sync with upstream we need to also set the hierachy when
- an older OBJECT is converted to the current OBJECT
- an OBJECT is unmarshalled

Remove ObjectGetHierarchy since it is not needed anymore.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Introduce new hierarchies SvnLimited and FirmwareLimited but do not enable
them.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
@stefanberger stefanberger force-pushed the stefanberger/rev180.new_hierarchies branch from ba936eb to f58a5af Compare July 24, 2024 21:37
Bump up the StateFormatLevel to 6 and use it to introduce a new OBJECT
marshalling format version '4' that slighly changes how an OBJECT is
marshalled:

- only marshal the private exponent for an RSA key
- always marshal the new hierarchy field

The marshalling code can still write previous version '3' when an older
StateFormatLevel is used to support backwards compatibility.

Adjust the test cases marshalling an RSA key OBJECT to check against
expected sizes across a series of StateFormatLevels.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
@stefanberger stefanberger force-pushed the stefanberger/rev180.new_hierarchies branch from f58a5af to 4db4fa2 Compare July 25, 2024 00:55
@stefanberger stefanberger mentioned this pull request Jul 25, 2024
8 tasks
@stefanberger stefanberger merged commit 1df35f6 into master Jul 25, 2024
@stefanberger stefanberger deleted the stefanberger/rev180.new_hierarchies branch July 25, 2024 15:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants