From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 372A51DDC2C for ; Tue, 25 Nov 2025 20:34:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764102849; cv=none; b=XidBZpklKCoArccC648nJV1HgVuJkX7btc1ACJu8RgJfCu70yHxqwRKogZPQQHwTX1oO3yag0jI2jnw34/OjmG+VUqyXNTfTi/dz2HqTNCcTf3xQaDwjUdKAIh1sbkVriecM2OfFLJNao+grvmaHNEkJh1WCkIYYGNclk2ATdIQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764102849; c=relaxed/simple; bh=/Tcr6ECus9bNKW3RGn5PeANcnYuktG/4Va8iiqujVMc=; h=From:In-Reply-To:References:To:Cc:Subject:MIME-Version: Content-Type:Date:Message-ID; b=Dr/M3tfVJTWqMXzU3poYH2J0fZjSbVCUn31LyVdUEYo93qlqm4moSI7T+VTXgkU+qdbZxE/IIIfTQmICuW5PBf5Eh7mTZpTxxWxcxHZqSXf/N3mwyuJ5dXd54Q9FUyShdg6vA9S++DyKp0XyLCZtW0EKzs27SYdOP4x1yBAlEyA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=fgFkvU8g; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="fgFkvU8g" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1764102845; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=MiZyPz+HTuOfE6YfTHz6F/IRPmWYIWGxUzHZXwvu6Aw=; b=fgFkvU8gTUDr/g51kqjBXZoFwXfTV6RPFj7iaXQpcj21a7dTCjLW03HoXA4XxzbqdMv8hl wi6BboztFZjyz0k3UkDGZEsbWGgOMnxuLYljkWp8eK6GuH3V+LaI+263NBCb9y6B8F4g/3 4WkQcpMES//rIOU/YpcGVCjFCxz/QxE= Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-609-bP5O_AKyN4O-san-YG4TSA-1; Tue, 25 Nov 2025 15:34:02 -0500 X-MC-Unique: bP5O_AKyN4O-san-YG4TSA-1 X-Mimecast-MFC-AGG-ID: bP5O_AKyN4O-san-YG4TSA_1764102841 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 061261955F15; Tue, 25 Nov 2025 20:34:01 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.42.28.14]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 7347F18004D8; Tue, 25 Nov 2025 20:33:58 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells In-Reply-To: <833c858cd74533203b43180208734b84f1137af0.camel@HansenPartnership.com> References: <833c858cd74533203b43180208734b84f1137af0.camel@HansenPartnership.com> To: James Bottomley Cc: dhowells@redhat.com, linux-kernel , Andrew Morton , Blaise Boscaccy Subject: Re: [PATCH] oid_registry: allow arbitrary size OIDs Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3954379.1764102837.1@warthog.procyon.org.uk> Date: Tue, 25 Nov 2025 20:33:57 +0000 Message-ID: <3954380.1764102837@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 James Bottomley 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