asn1: Make asn1_print good for benchmarking
This commit is contained in:
@@ -441,11 +441,17 @@ dotype(unsigned char *buf, size_t len, char **argv, size_t *size)
|
|||||||
fprintf(stderr, "Prefix match: %s\n", typename);
|
fprintf(stderr, "Prefix match: %s\n", typename);
|
||||||
}
|
}
|
||||||
if (print_flag) {
|
if (print_flag) {
|
||||||
char *s = NULL;
|
static int warned = 0;
|
||||||
|
|
||||||
|
if (!sorted_types[i].print) {
|
||||||
|
if (!warned)
|
||||||
|
warnx("Missing print support; try enabling / not "
|
||||||
|
"disabling ASN.1 templating in build "
|
||||||
|
"configuration");
|
||||||
|
warned = 1;
|
||||||
|
} else {
|
||||||
|
char *s;
|
||||||
|
|
||||||
if (!sorted_types[i].print)
|
|
||||||
err(1, "Missing print support; try enabling / not "
|
|
||||||
"disabling ASN.1 templating in build configuration");
|
|
||||||
s = sorted_types[i].print(v, indent_flag ? ASN1_PRINT_INDENT : 0);
|
s = sorted_types[i].print(v, indent_flag ? ASN1_PRINT_INDENT : 0);
|
||||||
if (!s) {
|
if (!s) {
|
||||||
ret = errno;
|
ret = errno;
|
||||||
@@ -455,6 +461,7 @@ dotype(unsigned char *buf, size_t len, char **argv, size_t *size)
|
|||||||
printf("%s\n", s);
|
printf("%s\n", s);
|
||||||
free(s);
|
free(s);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (test_encode_flag) {
|
if (test_encode_flag) {
|
||||||
unsigned char *der = emalloc(sz);
|
unsigned char *der = emalloc(sz);
|
||||||
size_t wants = sorted_types[i].len(v);
|
size_t wants = sorted_types[i].len(v);
|
||||||
|
Reference in New Issue
Block a user