summaryrefslogtreecommitdiffstats
path: root/test/d2i_test.c
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2016-09-28 00:24:58 +0100
committerDr. Stephen Henson <steve@openssl.org>2016-09-29 16:21:46 +0100
commitadffae15d3c6713ecd15d55d51b159b4262c20e6 (patch)
tree7d2bbd4628d1bd646e1c614bd4cf3f2757cb083d /test/d2i_test.c
parent2171a071aa16780962071e93c5c24ff148195c98 (diff)
add item list support to d2i_test
Reviewed-by: Rich Salz <rsalz@openssl.org>
Diffstat (limited to 'test/d2i_test.c')
-rw-r--r--test/d2i_test.c22
1 files changed, 7 insertions, 15 deletions
diff --git a/test/d2i_test.c b/test/d2i_test.c
index 8c99087732..b173cc5c45 100644
--- a/test/d2i_test.c
+++ b/test/d2i_test.c
@@ -144,12 +144,6 @@ int main(int argc, char **argv)
const char *expected_error_string;
size_t i;
- static ASN1_ITEM_EXP *items[] = {
- ASN1_ITEM_ref(ASN1_ANY),
- ASN1_ITEM_ref(X509),
- ASN1_ITEM_ref(GENERAL_NAME),
- ASN1_ITEM_ref(ASN1_INTEGER)
- };
static error_enum expected_errors[] = {
{"OK", ASN1_OK},
@@ -169,18 +163,16 @@ int main(int argc, char **argv)
expected_error_string = argv[2];
test_file = argv[3];
- for (i = 0; i < OSSL_NELEM(items); i++) {
- const ASN1_ITEM *it = ASN1_ITEM_ptr(items[i]);
- if (strcmp(test_type_name, it->sname) == 0) {
- item_type = it;
- break;
- }
- }
+ item_type = ASN1_ITEM_lookup(test_type_name);
+
if (item_type == NULL) {
fprintf(stderr, "Unknown type %s\n", test_type_name);
fprintf(stderr, "Supported types:\n");
- for (i = 0; i < OSSL_NELEM(items); i++) {
- const ASN1_ITEM *it = ASN1_ITEM_ptr(items[i]);
+ for (i = 0;; i++) {
+ const ASN1_ITEM *it = ASN1_ITEM_get(i);
+
+ if (it == NULL)
+ break;
fprintf(stderr, "\t%s\n", it->sname);
}
return 1;