Improve testing of elliptic curve validation
This involves:
- A directory of valid and invalid PEM-encoded curves.
This is non-exhaustive and can be added to.
- A minor patch to 'openssl ecparam' to make it exit non-zero
when curve validation fails.
- A test recipe is added in a separate commit.
Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/2544)
diff --git a/test/recipes/15-test_ecparam_data/valid/sect239k1-explicit.pem b/test/recipes/15-test_ecparam_data/valid/sect239k1-explicit.pem
new file mode 100644
index 0000000..8e23a4c
--- /dev/null
+++ b/test/recipes/15-test_ecparam_data/valid/sect239k1-explicit.pem
@@ -0,0 +1,5 @@
+-----BEGIN EC PARAMETERS-----
+MIGNAgEBMB4GByqGSM49AQIwEwICAO8GCSqGSM49AQIDAgICAJ4wBgQBAAQBAQQ9
+BCmgtqiHqYPpcwmIpocnqLLRJsRMwsx7KmVVGTA13HYxCATxLlSb2wEcEDCJ5zUQ
+rLJ1/DEqXca3ZVPwygIeIAAAAAAAAAAAAAAAAAAAWnn+xny26R8cHagA5HilAgEE
+-----END EC PARAMETERS-----