return 0;
}
+#ifndef OPENSSL_NO_DEPRECATED_4_0
STACK_OF(X509_OBJECT) *X509_STORE_get0_objects(const X509_STORE *xs)
{
X509_STORE *store = (X509_STORE *)xs;
return xs->objs;
}
+#endif
STACK_OF(X509_OBJECT) *X509_STORE_get1_objects(X509_STORE *store)
{
cache. The cache contains B<X509> and B<X509_CRL> objects. The caller is
responsible for freeing the returned list.
-X509_STORE_get0_objects() retrieves an internal pointer to the store's
-X509 object cache. The cache contains B<X509> and B<X509_CRL> objects. The
-returned pointer must not be freed by the calling application. If the store is
-shared across multiple threads, it is not safe to use the result of this
-function. Use X509_STORE_get1_objects() instead, which avoids this problem.
+X509_STORE_get0_objects() was deprecated in OpenSSL 4.0. Applications
+should instead use X509_STORE_get1_objects() to avoid potential
+issues associated with X509_STORE_get0_objects(). The
+X509_STORE_get0_objects() returns an internal pointer to the
+store's cache of X509 and X509_CRL objects. This pointer
+references internal data structures and must not be freed by the
+application. Since the returned pointer exposes shared internal state, its use in
+multithreaded contexts is inherently unsafe without external
+synchronisation. When a store is shared across threads, callers are
+required to acquire the store lock via X509_STORE_lock() before
+invoking X509_STORE_get0_objects().
X509_STORE_get1_all_certs() returns a list of all certificates in the store.
The caller is responsible for freeing the returned list.
* 'no-deprecated'.
*/
+# undef OPENSSL_NO_DEPRECATED_4_0
# undef OPENSSL_NO_DEPRECATED_3_6
# undef OPENSSL_NO_DEPRECATED_3_4
# undef OPENSSL_NO_DEPRECATED_3_1
# undef OPENSSL_NO_DEPRECATED_1_0_0
# undef OPENSSL_NO_DEPRECATED_0_9_8
+# if OPENSSL_API_LEVEL >= 40000
+# ifndef OPENSSL_NO_DEPRECATED
+# define OSSL_DEPRECATEDIN_4_0 OSSL_DEPRECATED(4.0)
+# define OSSL_DEPRECATEDIN_4_0_FOR(msg) OSSL_DEPRECATED_FOR(4.0, msg)
+# else
+# define OPENSSL_NO_DEPRECATED_4_0
+# endif
+# else
+# define OSSL_DEPRECATEDIN_4_0
+# define OSSL_DEPRECATEDIN_4_0_FOR(msg)
+# endif
# if OPENSSL_API_LEVEL >= 30600
# ifndef OPENSSL_NO_DEPRECATED
# define OSSL_DEPRECATEDIN_3_6 OSSL_DEPRECATED(3.6)
int X509_STORE_lock(X509_STORE *xs);
int X509_STORE_unlock(X509_STORE *xs);
int X509_STORE_up_ref(X509_STORE *xs);
+# ifndef OPENSSL_NO_DEPRECATED_4_0
+OSSL_DEPRECATEDIN_4_0_FOR("Use X509_STORE_get1_objects")
STACK_OF(X509_OBJECT) *X509_STORE_get0_objects(const X509_STORE *xs);
+# endif
STACK_OF(X509_OBJECT) *X509_STORE_get1_objects(X509_STORE *xs);
STACK_OF(X509) *X509_STORE_get1_all_certs(X509_STORE *xs);
STACK_OF(X509) *X509_STORE_CTX_get1_certs(X509_STORE_CTX *xs,
|| !TEST_true(X509_load_cert_file(lookup, chain, X509_FILETYPE_PEM))
|| !TEST_ptr(certs = X509_STORE_get1_all_certs(store))
|| !TEST_int_eq(sk_X509_num(certs), 4)
+#ifndef OPENSSL_NO_DEPRECATED_4_0
|| !TEST_ptr(objs = X509_STORE_get0_objects(store))
|| !TEST_int_eq(sk_X509_OBJECT_num(objs), 4)
+#endif
|| !TEST_ptr(objs = X509_STORE_get1_objects(store))
|| !TEST_int_eq(sk_X509_OBJECT_num(objs), 4))
goto err;
int ret = 0;
X509_STORE *store = NULL;
X509_STORE_CTX *s_ctx = NULL;
+#ifndef OPENSSL_NO_DEPRECATED_4_0
STACK_OF(X509_OBJECT) *objs = NULL;
+#endif
STACK_OF(X509_CRL) *sk_x509_crl = NULL;
STACK_OF(X509) *sk_x509 = NULL;
X509_NAME *nm = NULL;
|| !TEST_true(X509_STORE_add_crl(store, crl2))
|| !TEST_true(X509_STORE_add_cert(store, cert2))
/* deliberately not taking lock in a single thread */
+#ifndef OPENSSL_NO_DEPRECATED_4_0
|| !TEST_ptr(objs = X509_STORE_get0_objects(store))
|| !TEST_int_eq(sk_X509_OBJECT_num(objs), 3)
+#endif
|| !TEST_ptr(sk_x509 = X509_STORE_CTX_get1_certs(s_ctx, nm))
|| !TEST_int_eq(sk_X509_num(sk_x509), 2)
|| !TEST_ptr(sk_x509_crl = X509_STORE_CTX_get1_crls(s_ctx, nm))
OPENSSL_hexchar2int 4083 4_0_0 EXIST::FUNCTION:
X509_STORE_set_ex_data 4084 4_0_0 EXIST::FUNCTION:
X509_STORE_get_ex_data 4085 4_0_0 EXIST::FUNCTION:
-X509_STORE_get0_objects 4086 4_0_0 EXIST::FUNCTION:
+X509_STORE_get0_objects 4086 4_0_0 EXIST::FUNCTION:DEPRECATEDIN_4_0
X509_OBJECT_get_type 4087 4_0_0 EXIST::FUNCTION:
X509_STORE_set_verify 4088 4_0_0 EXIST::FUNCTION:
X509_OBJECT_new 4089 4_0_0 EXIST::FUNCTION: