Skip to content

x509-cert/der fails to read the certificate #690

Description

@lumag

The library fails to parse the attached certificate file with the following error:

Error: Error { kind: TagUnknown { byte: 20 }, position: Some(Length(582)) }

OpenSSL/GnuTLS parse this file without any issues:

X.509 Certificate Information:
Version: 3
Serial Number (hex): 01
Issuer: L=San Diego,O=SecTools,CN=Generated Test Attestation CA,ST=California,C=US
Validity:
	Not Before: Tue Apr 17 03:31:52 UTC 2018
	Not After: Mon Apr 12 03:31:52 UTC 2038
Subject: OU=03 0000000000000002 DEBUG,OU=07 0001 SHA256,OU=06 0000 MODEL_ID,OU=05 000000C8 SW_SIZE,OU=04 0000 OEM_ID,OU=02 0000000000000000 HW_ID,OU=01 0000000000000001 SW_ID,ST=California,O=SecTools,L=San Diego,CN=SecTools Test User,C=US
Subject Public Key Algorithm: RSA
Algorithm Security Level: Medium (2048 bits)
	Modulus (bits 2048):
		00:c6:f8:7c:dd:70:13:ad:e5:41:b8:fa:b2:32:d3:e1
		69:7f:23:62:41:1b:3b:f3:0d:4e:fc:ea:8a:f7:be:f6
		0d:5d:9e:ef:20:21:95:71:c9:53:a3:28:64:51:6d:48
		b7:86:d1:c9:2b:7d:82:52:07:23:06:de:2c:49:af:1a
		da:2d:44:a0:2c:14:b0:d8:12:a9:06:52:6d:c3:d1:c4
		3d:82:7a:f7:f0:22:fb:73:de:c4:1c:57:e5:b8:bb:60
		f1:48:93:85:17:47:70:b2:49:3a:d1:36:db:ad:04:3b
		74:7c:52:ff:34:3b:11:cf:17:ed:d7:3f:7a:a9:85:41
		e5:5d:05:23:b7:e0:f6:1b:db:a6:db:71:43:32:0a:fa
		09:4c:6c:34:3d:d5:71:85:98:d7:6d:de:66:82:f3:4c
		18:7a:15:11:00:71:ac:a9:7a:71:c7:fb:6c:ea:bc:dd
		52:d8:0b:f9:09:9e:1f:a5:1b:41:6c:d4:dd:6a:24:75
		b6:59:5a:6f:d8:5d:74:67:e2:07:3c:2f:0c:dc:73:70
		d6:fd:68:13:cc:26:25:0c:d6:6d:30:54:1a:5b:5e:2a
		84:07:61:df:2a:c8:00:72:13:f6:ee:76:bb:dc:7a:f8
		cf:4e:74:0b:02:f4:02:3b:22:17:6f:39:c5:94:f2:94
		a1
	Exponent (bits 8):
		03
Extensions:
	CRL Distribution points (not critical):
		URI: http://crl.qdst.com/crls/qctdevattest.crl
	Authority Key Identifier (not critical):
		47491b47235eeb0cd422170cddbd4b5c6542349f
	Basic Constraints (not critical):
		Certificate Authority (CA): FALSE
		Path Length Constraint: 0
	Key Usage (not critical):
		Digital signature.
		Non repudiation.
		Key encipherment.
		Data encipherment.
Signature Algorithm: RSA-SHA256
Signature:
	48:25:dc:af:ec:82:66:4f:88:51:26:7c:15:29:64:8c
	de:91:95:c5:a6:11:8e:a1:e5:f5:79:d3:23:75:4a:7d
	78:2e:cb:ba:86:3e:7d:13:c0:de:c5:15:33:74:20:15
	ca:58:e3:25:c1:9b:aa:b4:f2:d7:bd:bd:dc:66:0e:25
	5e:ec:a7:57:27:cf:6d:37:89:d3:84:8a:2a:9c:bb:01
	30:0b:6b:53:e0:69:25:34:b7:aa:37:57:5e:21:a4:7c
	51:9f:4f:4b:42:65:11:f8:8d:49:75:58:3b:cf:eb:4c
	d9:64:0d:7a:88:fc:85:ff:2e:81:7f:df:0d:6a:fd:21
	8f:40:fc:ed:ea:f8:0c:0e:6e:25:c1:5e:71:c7:80:70
	86:85:00:01:a6:0c:e6:0a:29:41:68:60:29:c4:62:0a
	7f:e8:32:9a:dd:41:72:53:7d:bf:f4:c9:ce:ba:42:dc
	1c:2e:96:de:84:53:33:f0:75:dc:3b:47:74:10:80:a3
	79:47:f7:e7:19:e0:e4:e7:a7:ff:da:f6:bf:5b:48:b0
	3e:56:0d:89:81:33:41:c7:f9:c5:cc:98:61:a1:01:1c
	21:bf:2d:76:0b:92:b8:59:25:93:cc:16:92:ac:a2:e9
	8b:9f:b4:ed:19:65:d5:42:cb:d7:84:d8:8f:a1:33:1a
Other Information:
Fingerprint:
	sha1:8871d0e9ee20043ad685f45488dc6024f6a9ba81
	sha256:a19837bf1a6a21528b18f23183bf24218ec56feac815a810db2fa92d5b509704
Public Key ID:
	sha1:ede971ff51468adbc7e789779d173eddb2dc21e8
	sha256:9d3d655a728ef51fefbdba952215739a3bd5b74cd027af84e89c3c9b90b141a2
Public Key PIN:
	pin-sha256:nT1lWnKO9R/vvbqVIhVzmjvVt0zQJ6+E6Jw8m5CxQaI=

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions