asn1: Add der_find_or_parse_heim_oid()

This commit is contained in:
Nicolas Williams
2019-11-07 18:16:08 -06:00
parent 944eae82cf
commit a40d4056bd

View File

@@ -208,6 +208,18 @@ der_find_heim_oid_by_name(const char *str, const heim_oid **oid)
return -1;
}
int
der_find_or_parse_heim_oid(const char *str, const char *sep, heim_oid *oid)
{
const heim_oid *found = NULL;
switch (der_find_heim_oid_by_name(str, &found)) {
case 0: return der_copy_oid(found, oid);
case -1: return der_parse_heim_oid (str, sep, oid);
default: return ENOMEM;
}
}
int
der_find_heim_oid_by_oid(const heim_oid *oid, const char **name)
{