From 81c63b0eed39432878f78727f60a1e7499645199 Mon Sep 17 00:00:00 2001 From: Yves-Alexis Perez Date: Fri, 11 Jul 2014 07:23:31 +0200 Subject: Imported Upstream version 5.2.0 --- src/pki/commands/acert.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/pki/commands/acert.c') diff --git a/src/pki/commands/acert.c b/src/pki/commands/acert.c index d49365db5..185aa40b4 100644 --- a/src/pki/commands/acert.c +++ b/src/pki/commands/acert.c @@ -53,8 +53,7 @@ static int acert() case 'h': goto usage; case 'g': - digest = enum_from_name(hash_algorithm_short_names, arg); - if (digest == -1) + if (!enum_from_name(hash_algorithm_short_names, arg, &digest)) { error = "invalid --digest type"; goto usage; @@ -197,6 +196,7 @@ static int acert() } else { + set_file_mode(stdin, CERT_ASN1_DER); if (!chunk_from_fd(0, &encoding)) { fprintf(stderr, "%s: ", strerror(errno)); @@ -233,6 +233,7 @@ static int acert() error = "encoding attribute certificate failed"; goto end; } + set_file_mode(stdout, form); if (fwrite(encoding.ptr, encoding.len, 1, stdout) != 1) { error = "writing attribute certificate key failed"; -- cgit v1.2.3