David Horstmann cdaee54773 Fix incorrect printing of OIDs
The first 2 components of an OID are combined together into the same
subidentifier via the formula:

subidentifier = (component1 * 40) + component2

The current code extracts component1 and component2 using division and
modulo as one would expect. However, there is a subtlety in the
specification[1]:

>This packing of the first two object identifier components recognizes
>that only three values are allocated from the root node, and at most
>39 subsequent values from nodes reached by X = 0 and X = 1.

If the root node (component1) is 2, the subsequent node (component2)
may be greater than 38. For example, the following are real OIDs:
* 2.40.0.25, UPU standard S25
* 2.49.0.0.826.0, Met Office
* 2.999, Allocated example OID

This has 2 implications that the current parsing code does not take
account of:
1. The second component may be > 39, so (subidentifier % 40) is not
correct in all circumstances.
2. The first subidentifier (containing the first 2 components) may be
more than one byte long. Currently we assume it is just 1 byte.

Improve parsing code to deal with these cases correctly.

[1] Rec. ITU-T X.690 (02/2021), 8.19.4

Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-02-20 14:44:18 +00:00
..
2023-01-11 14:52:35 +01:00
2023-01-11 14:52:35 +01:00
2023-01-11 14:52:35 +01:00
2023-01-11 14:52:35 +01:00
2023-01-11 14:52:35 +01:00
2023-01-11 14:52:35 +01:00
2023-01-11 14:52:35 +01:00
2023-02-13 15:07:44 +00:00
2023-01-11 14:52:35 +01:00
2023-01-11 14:52:35 +01:00
2023-02-02 12:46:39 +00:00
2023-01-11 14:52:35 +01:00
2023-01-11 14:52:35 +01:00
2023-01-11 14:52:35 +01:00
2023-01-11 14:52:35 +01:00
2023-01-11 14:52:35 +01:00
2023-01-11 14:52:35 +01:00
2022-12-08 11:05:11 +00:00
2023-01-11 14:52:35 +01:00
2023-01-11 14:52:35 +01:00
2023-01-11 14:52:35 +01:00
2023-01-11 14:52:35 +01:00
2023-01-11 14:52:35 +01:00
2023-01-11 14:52:35 +01:00
2023-01-11 14:52:35 +01:00
2023-01-11 14:52:35 +01:00
2023-01-11 14:52:35 +01:00
2023-01-11 14:52:35 +01:00
2023-02-13 15:07:44 +00:00
2023-01-11 14:52:35 +01:00
2023-02-02 12:46:39 +00:00
2023-01-11 14:52:37 +01:00
2023-01-11 14:52:35 +01:00
2023-01-11 14:52:35 +01:00
2023-01-11 14:52:35 +01:00
2023-01-11 14:52:35 +01:00
2023-01-11 14:52:35 +01:00
2023-01-11 14:52:35 +01:00
2023-01-11 14:52:35 +01:00
2023-01-11 14:52:35 +01:00
2023-01-11 14:52:35 +01:00
2023-01-11 14:52:35 +01:00
2023-01-11 14:52:35 +01:00
2023-01-11 14:52:35 +01:00
2023-01-11 14:52:35 +01:00
2023-01-11 14:52:35 +01:00
2023-01-11 14:52:35 +01:00
2023-01-11 14:52:35 +01:00
2023-02-20 14:44:18 +00:00
2023-01-11 14:52:35 +01:00
2023-01-11 14:52:35 +01:00
2023-01-11 14:52:35 +01:00
2023-01-11 14:52:35 +01:00
2023-01-11 14:52:35 +01:00
2023-01-11 14:52:35 +01:00
2023-01-11 14:52:35 +01:00
2023-01-11 14:52:35 +01:00
2023-01-11 14:52:35 +01:00
2023-01-11 14:52:35 +01:00
2023-01-11 14:52:35 +01:00
2023-01-11 14:52:35 +01:00
2023-01-11 14:52:35 +01:00
2023-01-11 14:52:35 +01:00
2023-01-11 14:52:35 +01:00
2023-01-11 14:52:35 +01:00
2023-01-11 14:52:35 +01:00
2023-01-11 14:52:35 +01:00
2023-01-11 14:52:35 +01:00
2023-01-11 14:52:35 +01:00
2023-01-11 14:52:35 +01:00
2023-01-11 14:52:35 +01:00
2023-01-11 14:52:35 +01:00
2023-01-11 14:52:35 +01:00
2023-01-11 14:52:35 +01:00
2023-01-11 14:52:35 +01:00
2023-01-11 14:52:35 +01:00
2023-01-11 14:52:35 +01:00
2023-02-02 12:46:39 +00:00
2023-01-11 14:52:35 +01:00
2023-01-11 14:52:35 +01:00
2023-01-11 14:52:35 +01:00
2023-01-11 14:52:35 +01:00
2023-01-11 14:52:35 +01:00
2023-01-11 14:52:35 +01:00
2023-01-11 14:52:35 +01:00
2023-01-11 14:52:35 +01:00
2023-01-11 14:52:35 +01:00
2023-01-11 14:52:35 +01:00
2023-01-11 14:52:35 +01:00
2023-01-11 14:52:35 +01:00
2023-01-11 14:52:35 +01:00
2023-01-11 14:52:35 +01:00
2023-01-11 14:52:35 +01:00
2023-01-11 14:52:37 +01:00
2023-01-11 14:52:35 +01:00
2023-01-11 14:52:35 +01:00
2023-01-11 14:52:35 +01:00
2023-01-11 14:52:35 +01:00
2023-01-11 14:52:35 +01:00
2023-01-11 14:52:35 +01:00
2023-01-11 14:52:35 +01:00