diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2022-04-02 12:23:21 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2022-04-02 12:23:21 +0000 |
commit | 11beeebfc32a6efc3f5399e7bfb30a2bcd876a22 (patch) | |
tree | 44aa6d993a949ce36ab1c0d90588ff72d754b463 | |
parent | 260927c7c38360bf09e7ebaef5b478f86d72ce9e (diff) |
Adjust test code after addition of cert_parse_pre and change to cert_parse
and ta_parse.
Reminder from tb@
-rw-r--r-- | regress/usr.sbin/rpki-client/test-cert.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/regress/usr.sbin/rpki-client/test-cert.c b/regress/usr.sbin/rpki-client/test-cert.c index f7fb7a4b8cb..03111abe3c7 100644 --- a/regress/usr.sbin/rpki-client/test-cert.c +++ b/regress/usr.sbin/rpki-client/test-cert.c @@ -1,4 +1,4 @@ -/* $Id: test-cert.c,v 1.17 2022/01/19 08:24:43 claudio Exp $ */ +/* $Id: test-cert.c,v 1.18 2022/04/02 12:23:20 claudio Exp $ */ /* * Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv> * @@ -81,9 +81,11 @@ main(int argc, char *argv[]) break; buf = load_file(cert_path, &len); - p = ta_parse(cert_path, buf, len, - tal->pkey, tal->pkeysz); + p = cert_parse_pre(cert_path, buf, len); free(buf); + if (p == NULL) + break; + p = ta_parse(cert_path, p, tal->pkey, tal->pkeysz); tal_free(tal); if (p == NULL) break; @@ -98,12 +100,15 @@ main(int argc, char *argv[]) size_t len; buf = load_file(argv[i], &len); - p = cert_parse(argv[i], buf, len); + p = cert_parse_pre(argv[i], buf, len); + free(buf); + if (p == NULL) + break; + p = cert_parse(argv[i], p); if (p == NULL) break; if (verb) cert_print(p); - free(buf); cert_free(p); } } |