From e9515988b4a8af581e77fcc275f06b6afca1601d Mon Sep 17 00:00:00 2001 From: claudio Date: Sat, 2 Apr 2022 12:23:20 +0000 Subject: [PATCH] Adjust test code after addition of cert_parse_pre and change to cert_parse and ta_parse. Reminder from tb@ --- regress/usr.sbin/rpki-client/test-cert.c | 15 ++++++++++----- 1 file 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 * @@ -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); } } -- 2.20.1