Your message dated Sat, 19 Mar 2011 09:32:10 +0000
with message-id <[email protected]>
and subject line Bug#573813: fixed in dumpasn1 20101112-1
has caused the Debian Bug report #573813,
regarding dumpasn1: large number in OID displayed incorrectly
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
573813: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=573813
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: dumpasn1
Version: 20030222-3
Severity: normal
Tags: patch

OID numbers above LONG_MAX (or so) come out as the wrong number.  For
example, dumpasn1 displays an OID '2 25
339980965254958353768657297992075035931' as '2 25 -1512717029'.  

$ /usr/bin/dumpasn1 testie.der |grep '2 25'

0 warnings, 0 errors.
  39   20:           OBJECT IDENTIFIER '2 25 -1512717029'
 107   20:           OBJECT IDENTIFIER '2 25 -1512717029'

$ openssl x509 -in testie.der -inform der -noout -text |fgrep 2.25
        Issuer: 2.25.339980965254958353768657297992075035931=testie
        Subject: 2.25.339980965254958353768657297992075035931=testie

Example and patch attached.

-- System Information:
Debian Release: 5.0.4
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: i386 (i686)

Kernel: Linux 2.6.26-2-686 (SMP w/1 CPU core)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages dumpasn1 depends on:
ii  libc6                       2.7-18lenny2 GNU C Library: Shared libraries

dumpasn1 recommends no packages.

dumpasn1 suggests no packages.

-- no debconf information

Attachment: testie.der
Description: Binary data

--- dumpasn1.c	2010-03-11 00:39:31.462069896 -0500
+++ dumpasn1-jtobey.c	2010-03-11 22:55:01.926066435 -0500
@@ -1221,11 +1221,11 @@
 						const unsigned char *oid, const int oidLength )
 	{
 	long value;
-	int i, length, validEncoding = TRUE;
+	int i, length = 0, validEncoding = TRUE;
 
 	for( i = 0, value = 0; i < oidLength; i++ )
 		{
-		const unsigned char data = oid[ i ];
+		unsigned char data = oid[ i ];
 		const long valTmp = value << 7;
 
 		/* Pick apart the encoding.  We keep going after hitting an encoding
@@ -1238,9 +1238,47 @@
 			}
 		if( value >= ( LONG_MAX >> 7 ) || \
 			valTmp >= LONG_MAX - ( data & 0x7F ) )
-			validEncoding = FALSE;
+			{
+			/* Big integer */
+			char bigValue[ 128 ];
+			int end = 0;
+
+			/* Encode the current value in reverse decimal. */
+			while( value != 0 )
+				{
+				bigValue[ end++ ] = value % 10;
+				value /= 10;
+				}
+			while( 1 )
+				{
+				int carry = ( data & 0x7F );
+				int j;
+
+				/* Multiply by 128 and add base-128 digit. */
+				for( j = 0; j < end; j++ )
+					{
+					int product = ( bigValue[ j ] * 128 ) + carry;
+					bigValue[ j ] = product % 10;
+					carry = product / 10;
+					}
+				while( carry != 0 )
+					{
+					bigValue[ end++ ] = carry % 10;
+					carry /= 10;
+					}
+				if( !( data & 0x80 ) )
+					break;
+				data = oid[ ++i ];
+				}
+			/* Reverse, copy to output, and convert to characters. */
+			textOID[ length++ ] = ' ';
+			while( end > 0 )
+				textOID[ length++ ] = bigValue[ --end ] + '0';
+			continue;
+			}
+
 		value = valTmp | ( data & 0x7F );
-		if( value < 0 || value > LONG_MAX / 2 )
+		if( value < 0 )
 			validEncoding = FALSE;
 		if( !( data & 0x80 ) )
 			{

--- End Message ---
--- Begin Message ---
Source: dumpasn1
Source-Version: 20101112-1

We believe that the bug you reported is fixed in the latest version of
dumpasn1, which is due to be installed in the Debian FTP archive:

dumpasn1_20101112-1.diff.gz
  to main/d/dumpasn1/dumpasn1_20101112-1.diff.gz
dumpasn1_20101112-1.dsc
  to main/d/dumpasn1/dumpasn1_20101112-1.dsc
dumpasn1_20101112-1_amd64.deb
  to main/d/dumpasn1/dumpasn1_20101112-1_amd64.deb
dumpasn1_20101112.orig.tar.gz
  to main/d/dumpasn1/dumpasn1_20101112.orig.tar.gz



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Pierre Habouzit <[email protected]> (supplier of updated dumpasn1 package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.8
Date: Sat, 19 Mar 2011 09:49:14 +0100
Source: dumpasn1
Binary: dumpasn1
Architecture: source amd64
Version: 20101112-1
Distribution: unstable
Urgency: low
Maintainer: Pierre Habouzit <[email protected]>
Changed-By: Pierre Habouzit <[email protected]>
Description: 
 dumpasn1   - ASN.1 object dump program
Closes: 573813 610934
Changes: 
 dumpasn1 (20101112-1) unstable; urgency=low
 .
   * New upstream release (Closes: #610934):
      + Large numbers are now printed properly (Closes: #573813).
   * Migrate to dh 8.
   * Bump standards version to 3.9.1.
   * Switch to dpkg-source 3.0 (quilt) format.
Checksums-Sha1: 
 37a2e20f7d890fbce7214a76b3f349d072ee9558 972 dumpasn1_20101112-1.dsc
 663342df18e52bb22de8e624724749f24bd5a16f 56787 dumpasn1_20101112.orig.tar.gz
 aee347d29a9530d61aad69368b181733269b5cd9 3277 dumpasn1_20101112-1.diff.gz
 90cd05041c65b09277c438b6a3b928fcb89cac02 49060 dumpasn1_20101112-1_amd64.deb
Checksums-Sha256: 
 8bbf775f8e289371cfe8eb47e5389734b77118b981d3dc5362adf4f486f5356d 972 
dumpasn1_20101112-1.dsc
 42304dd5f820596c15fe82e98fd694bb137247fa4f85cbe9cddbfb8dba71bf5e 56787 
dumpasn1_20101112.orig.tar.gz
 2cb7b5e33016695ea9a3b06626a01312f9ba8a834dcd651219d084b5167d2d3f 3277 
dumpasn1_20101112-1.diff.gz
 d566b4f16d11741091d41b0d5e1efeea13ad9c5f82aac6c728d3e0f09e356c4e 49060 
dumpasn1_20101112-1_amd64.deb
Files: 
 9fbdd1a9e347a75773687e563d25f97f 972 utils optional dumpasn1_20101112-1.dsc
 4421e8b4128b75bd1868b80173e075cc 56787 utils optional 
dumpasn1_20101112.orig.tar.gz
 0da40764708c7a7075f5fb890f09f938 3277 utils optional 
dumpasn1_20101112-1.diff.gz
 eb1c62d6491918559e97cac5701e5cdf 49060 utils optional 
dumpasn1_20101112-1_amd64.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iEYEARECAAYFAk2EcLAACgkQvGr7W6HudhxUPgCeIgSJmgI1GnVpuZcVLg1JGQQ7
CE4Ani84AkYYtU+2k7GI2lsIXBJ3QrNH
=1oIM
-----END PGP SIGNATURE-----



--- End Message ---

Reply via email to