diff options
Diffstat (limited to 'regress/usr.sbin/rpki-client/test-mft.c')
-rw-r--r-- | regress/usr.sbin/rpki-client/test-mft.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/regress/usr.sbin/rpki-client/test-mft.c b/regress/usr.sbin/rpki-client/test-mft.c index 7d0343907f8..fe7a08b0e09 100644 --- a/regress/usr.sbin/rpki-client/test-mft.c +++ b/regress/usr.sbin/rpki-client/test-mft.c @@ -1,4 +1,4 @@ -/* $Id: test-mft.c,v 1.16 2021/10/24 17:54:28 claudio Exp $ */ +/* $Id: test-mft.c,v 1.17 2021/10/26 16:59:54 claudio Exp $ */ /* * Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv> * @@ -42,6 +42,8 @@ main(int argc, char *argv[]) struct mft *p; BIO *bio_out = NULL; X509 *xp = NULL; + unsigned char *buf; + size_t len; ERR_load_crypto_strings(); OpenSSL_add_all_ciphers(); @@ -70,8 +72,11 @@ main(int argc, char *argv[]) errx(1, "argument missing"); for (i = 0; i < argc; i++) { - if ((p = mft_parse(&xp, argv[i])) == NULL) - break; + buf = load_file(argv[i], &len); + if ((p = mft_parse(&xp, argv[i], buf, len)) == NULL) { + free(buf); + continue; + } if (verb) mft_print(p); if (ppem) { @@ -79,6 +84,7 @@ main(int argc, char *argv[]) errx(1, "PEM_write_bio_X509: unable to write cert"); } + free(buf); mft_free(p); X509_free(xp); } |