New der_put_heim_integer signature.

Test der_parse_heim_oid


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@18431 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2006-10-14 04:55:37 +00:00
parent 7c81914b6e
commit da6e710e29
2 changed files with 19 additions and 5 deletions

View File

@@ -706,17 +706,30 @@ test_heim_oid_format_same(const char *str, const heim_oid *oid)
{
int ret;
char *p;
heim_oid o2;
ret = der_print_heim_oid(oid, &p);
ret = der_print_heim_oid(oid, ' ', &p);
if (ret) {
printf("fail to print oid: %s\n", str);
return 1;
}
ret = strcmp(p, str);
if (ret)
if (ret) {
printf("oid %s != formated oid %s\n", str, p);
free(p);
return ret != 0;
free(p);
return ret;
}
ret = der_parse_heim_oid(p, " ", &o2);
if (ret) {
printf("failed to parse %s\n", p);
free(p);
return ret;
}
ret = heim_oid_cmp(&o2, oid);
free_oid(&o2);
return ret;
}
static int

View File

@@ -243,7 +243,8 @@ 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 **);
int der_print_heim_oid (const heim_oid *, char, char **);
int der_parse_heim_oid (const char *, const char *, heim_oid *);
#endif /* __DER_H__ */