]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
DPP: Fix test functionality for invalid keys with OpenSSL 1.1.0
authorJouni Malinen <jouni@codeaurora.org>
Mon, 17 Sep 2018 14:23:10 +0000 (17:23 +0300)
committerJouni Malinen <j@w1.fi>
Mon, 17 Sep 2018 14:23:10 +0000 (17:23 +0300)
It looks like at least OpenSSL 1.1.0i includes the extra checks in
EC_POINT_set_affine_coordinates_GFp() that break the previously used
mechanism for generating invalid keys. Fix this by using the alternative
design that was used with OpenSSL 1.1.1 and BoringSSL.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
src/common/dpp.c

index 74a524d21d626544fa55860fa156307046e87634..c359d556141bb1214acea66280b3d88996441822 100644 (file)
@@ -6219,14 +6219,14 @@ static int dpp_test_gen_invalid_key(struct wpabuf *msg,
 
                if (EC_POINT_set_affine_coordinates_GFp(group, point, x, y,
                                                        ctx) != 1) {
-#if OPENSSL_VERSION_NUMBER >= 0x10101000L || defined(OPENSSL_IS_BORINGSSL)
+#if OPENSSL_VERSION_NUMBER >= 0x10100000L || defined(OPENSSL_IS_BORINGSSL)
                /* Unlike older OpenSSL versions, OpenSSL 1.1.1 and BoringSSL
                 * return an error from EC_POINT_set_affine_coordinates_GFp()
                 * when the point is not on the curve. */
                        break;
-#else /* >=1.1.1 or OPENSSL_IS_BORINGSSL */
+#else /* >=1.1.0 or OPENSSL_IS_BORINGSSL */
                        goto fail;
-#endif /* >= 1.1.1 or OPENSSL_IS_BORINGSSL */
+#endif /* >= 1.1.0 or OPENSSL_IS_BORINGSSL */
                }
 
                if (!EC_POINT_is_on_curve(group, point, ctx))