Re: [PATCH] oid_registry: allow arbitrary size OIDs

From: David Howells
Date: Tue Nov 25 2025 - 15:34:21 EST


James Bottomley <James.Bottomley@xxxxxxxxxxxxxxxxxxxxx> wrote:

> This isn't usually a problem
> except that it prevents us from representing the 2.25. prefix OIDs
> which are the OID representation of UUIDs and have a 128 bit number
> following the prefix.

Ewww.

> Rather than import not often used perl arithmetic modules,

Do they not work? Or are they just not commonly installed?

> + # Base128 encode the number
> + my $j;
> + my $b;
> + for ($j = 0; $j < $tmp; $j++) {

I would do:

for (my $j = 0; $j < $tmp; $j++) {

> + $b = oct("0b".substr($c, $j * 7, 7));

I would probably do "my $b = ..." here.

> +
> + push @octets, $b | 0x80;
> }
> - push @octets, $c & 0x7f;
> + $b = oct("0b".substr($c, $j * 7, 7));
> + push @octets, $b;

and just combine these two lines:

push @octets, oct("0b".substr($c, $j * 7, 7));

Using "oct("0b"...)" looks weird, but I guess it should work.

David