From: jsing Date: Wed, 2 Oct 2024 14:12:21 +0000 (+0000) Subject: Enable additional CRYPTO_get_ex_new_index() tests. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=eff6c37d8c4461f70ca2041c37e60ec6f0e0bbd4;p=openbsd Enable additional CRYPTO_get_ex_new_index() tests. It was previously possible to call CRYPTO_get_ex_new_index() with either a negative index or a positive index that equaled or exceeded CRYPTO_EX_INDEX__COUNT. The reimplementation of exdata treats these as error cases. --- diff --git a/regress/lib/libcrypto/exdata/exdata_test.c b/regress/lib/libcrypto/exdata/exdata_test.c index 22483f70619..a82cb4a66ca 100644 --- a/regress/lib/libcrypto/exdata/exdata_test.c +++ b/regress/lib/libcrypto/exdata/exdata_test.c @@ -1,4 +1,4 @@ -/* $OpenBSD: exdata_test.c,v 1.2 2024/03/25 10:41:36 jsing Exp $ */ +/* $OpenBSD: exdata_test.c,v 1.3 2024/10/02 14:12:21 jsing Exp $ */ /* * Copyright (c) 2023 Joel Sing * @@ -231,8 +231,6 @@ ex_data_test(void) return failed; } -#if 0 -/* This insanity currently succeeds... */ static int ex_new_index_test(void) { @@ -257,7 +255,6 @@ ex_new_index_test(void) failure: return failed; } -#endif int main(int argc, char **argv) @@ -265,9 +262,7 @@ main(int argc, char **argv) int failed = 0; failed |= ex_data_test(); -#if 0 failed |= ex_new_index_test(); -#endif /* Force a clean up. */ CRYPTO_cleanup_all_ex_data();