Blob Blame History Raw
From 1d79c02be61874cd4598d60c18331e2d70228a40 Mon Sep 17 00:00:00 2001
From: Daiki Ueno <ueno@gnu.org>
Date: Fri, 6 Nov 2020 17:46:28 +0100
Subject: [PATCH] anchor: Prefer persistent format when storing anchor

When a new certificate is stored with "trust anchor --store" from a
.p11-kit file, the command treated it as a PEM file, while it should
preserve extra fields in the file.
---
 trust/anchor.c        |  7 ++++---
 trust/test-extract.sh | 27 ++++++++++++++++++++++++---
 2 files changed, 28 insertions(+), 6 deletions(-)

diff --git a/trust/anchor.c b/trust/anchor.c
index fab9cf6..5ba5065 100644
--- a/trust/anchor.c
+++ b/trust/anchor.c
@@ -64,9 +64,10 @@ create_arg_file_parser (void)
 	return_val_if_fail (parser != NULL, NULL);
 
 	p11_parser_formats (parser,
-	                    p11_parser_format_x509,
-	                    p11_parser_format_pem,
-	                    NULL);
+			    p11_parser_format_persist,
+			    p11_parser_format_x509,
+			    p11_parser_format_pem,
+			    NULL);
 
 	return parser;
 }
-- 
2.26.2