From 27aed86176caeea76d956d02603639ebf3eefdab Mon Sep 17 00:00:00 2001 From: Nalin Dahyabhai Date: Feb 23 2017 17:02:39 +0000 Subject: Handle the correct version from 'openssl req' When newer versions of 'openssl req' display a request, they add whitespace around the '=' in DNs and correctly interpret a version number field with value 0 as indicating version 1 of the spec. Update the expected output and filter to accept either version. Signed-off-by: Nalin Dahyabhai --- diff --git a/tests/026-local/expected.out b/tests/026-local/expected.out index 776a4c8..1f81c7c 100644 --- a/tests/026-local/expected.out +++ b/tests/026-local/expected.out @@ -3,7 +3,7 @@ OK. [csr] Certificate Request: Data: - Version: 0 (0x0) + Version: 1 (0x0) Subject: CN=Babs Jensen's Signer Attributes: friendlyName :unable to print attribute diff --git a/tests/026-local/run.sh b/tests/026-local/run.sh index b1966a2..6f0e74c 100755 --- a/tests/026-local/run.sh +++ b/tests/026-local/run.sh @@ -17,6 +17,8 @@ template_nscomment=certmonger generated this request template_no_ocsp_check=1 EOF filter() { + sed -re 's,Version: 0 \(0x0\),Version: 1 (0x0),g' |\ + sed -re 's,CN = ,CN=,g' |\ sed -re 's,CN=[[:xdigit:]]{8}-[[:xdigit:]]{8}-[[:xdigit:]]{8}-[[:xdigit:]]{8},CN=$UUID,g' |\ sed -re 's,[[:xdigit:]]{2}:[[:xdigit:]]{2}:[[:xdigit:]]{2}:[[:xdigit:]]{2}:[[:xdigit:]]{2}:[[:xdigit:]]{2}:[[:xdigit:]]{2}:[[:xdigit:]]{2}:[[:xdigit:]]{2}:[[:xdigit:]]{2}:[[:xdigit:]]{2}:[[:xdigit:]]{2}:[[:xdigit:]]{2}:[[:xdigit:]]{2}:[[:xdigit:]]{2}:[[:xdigit:]]{2}:[[:xdigit:]]{2}:[[:xdigit:]]{2}:[[:xdigit:]]{2}:[[:xdigit:]]{2},(160 bits),g' |\ sed s,'^ Signature Algorithm, Signature Algorithm,g'