From 237cb05d342338ac42852cfdec21b900458a537c Mon Sep 17 00:00:00 2001 From: Matt Caswell Date: Thu, 27 May 2021 18:00:07 +0100 Subject: [PATCH] Just look for "Unable to load Public Key" if no SM2 The X509 test was looking for some specific errors when printing an SM2 X509 certificate when SM2 is disabled. In fact these errors appear in the middle of the certificate printing which is quite odd. There is also a separate error "Unable to load Public Key" which is more cleanly printed. With the recent change to using provided keys in certs the old errors are no longer output. However printing them in the middle of the cert is probably not right anyway. So we just rely on the "Unable to load Public Key" message. Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/15504) --- test/recipes/25-test_x509.t | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/recipes/25-test_x509.t b/test/recipes/25-test_x509.t index 1324f754e9..5b6f8279e7 100644 --- a/test/recipes/25-test_x509.t +++ b/test/recipes/25-test_x509.t @@ -127,6 +127,6 @@ ok(test_errors("RC2-40-CBC", "v3-certs-RC2.p12", '-passin', 'pass:v3-certs'), SKIP: { skip "sm2 not disabled", 1 if !disabled("sm2"); - ok(test_errors("unknown group|unsupported algorithm", "sm2.pem", '-text'), + ok(test_errors("Unable to load Public Key", "sm2.pem", '-text'), "error loading unsupported sm2 cert"); }