libasn1: Add OID symbol resolution

This commit adds functions for finding OIDs by symbolic name, meaning by
their symbolic names given in the ASN.1 modules that define them.

TBD:

 - Resolve OIDs to names.
 - Support a file in /etc for additional OID resolution.
 - Add support for resolving OID arc names.
This commit is contained in:
Nicolas Williams
2019-08-24 17:02:33 -05:00
parent 6471fcaa54
commit 5465b2ddec
6 changed files with 330 additions and 18 deletions

View File

@@ -247,10 +247,10 @@ loop (unsigned char *buf, size_t len, int indent)
ret = der_get_oid(buf, length, &o, NULL);
if (ret)
errx (1, "der_get_oid: %s", error_message (ret));
ret = der_print_heim_oid(&o, '.', &p);
ret = der_print_heim_oid_sym(&o, '.', &p);
der_free_oid(&o);
if (ret)
errx (1, "der_print_heim_oid: %s", error_message (ret));
errx (1, "der_print_heim_oid_sym: %s", error_message (ret));
printf("%s\n", p);
free(p);