Commit Graph

5 Commits

Author SHA1 Message Date
Nicolas Williams
7559f36415 asn1: Add -q option to asn1_print 2021-03-06 14:46:52 -06:00
Nicolas Williams
6ecab8ce51 asn1: Make asn1_print a fuzzing tool 2021-03-05 13:19:38 -06:00
Nicolas Williams
a68ccb6693 asn1: Add --raw-sequence option to asn1_print 2021-03-02 21:39:00 -06:00
Nicolas Williams
52b48de856 asn1: Further enhancements to asn1_print 2021-03-02 13:58:56 -06:00
Nicolas Williams
ece3c688e0 asn1: Enrich asn1_print with schema
Our asn1_print, like OpenSSL's, just knows how to parse and dump DER.
Ours can attempt to decode OCTET STRING and IMPLICIT-tagged constructed
values as DER, which is very useful.

But _now_ it's even better.  Now it knows about all types exported from
all ASN.1 modules in `lib/asn1/` in Heimdal, and if told to print as
some type, it will use the new printing interface to print JSON-like
representations of values:

```
$ ./asn1_print /tmp/t490/ek2.crt Certificate |
  jq '.tbsCertificate.extensions[3]._extnValue[]._values'
[
  {
    "_type": "TPMSpecification",
    "family": "2.0",
    "level": "0",
    "revision": "138"
  }
]
[
  {
    "_type": "TPMSecurityAssertions",
    "version": "0",
    "fieldUpgradable": true,
    "ekGenerationType": "655617",
    "ekGenerationLocation": "655616",
    "ekCertificateGenerationLocation": "655616",
    "ccInfo": {
      "_type": "CommonCriteriaMeasures",
      "version": "3.1",
      "assurancelevel": "4",
      "evaluationStatus": "2",
      "plus": true,
      "strengthOfFunction": null,
      "profileOid": null,
      "profileUri": null,
      "targetOid": null,
      "targetUri": null
    },
    "fipsLevel": {
      "_type": "FIPSLevel",
      "version": "140-2",
      "level": "2",
      "plus": false
    },
    "iso9000Certified": false,
    "iso9000Uri": null
  }
]
```
2021-02-28 18:15:25 -06:00