(der_print_heim_oid): new function

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@17677 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2006-06-22 03:49:20 +00:00
parent 8586a88524
commit 14e6b9204d
2 changed files with 25 additions and 0 deletions

View File

@@ -243,4 +243,7 @@ int der_get_tag_num(const char *);
int der_parse_hex_heim_integer(const char *, heim_integer *);
int der_print_hex_heim_integer(const heim_integer *, char **);
int der_print_heim_oid (const heim_oid *data, char **);
#endif /* __DER_H__ */

View File

@@ -103,3 +103,25 @@ der_print_hex_heim_integer (const heim_integer *data, char **p)
}
return 0;
}
int
der_print_heim_oid (const heim_oid *oid, char **str)
{
struct rk_strpool *p = NULL;
int i;
for (i = 0; i < oid->length ; i++) {
p = rk_strpoolprintf(p, "%d%s",
oid->components[i],
i < oid->length - 1 ? " " : "");
if (p == NULL) {
*str = NULL;
return ENOMEM;
}
}
*str = rk_strpoolcollect(p);
if (*str == NULL)
return ENOMEM;
return 0;
}