if (!ossl_ssl_init(&obj->ssl, ctx, ctx->method, type))
goto err;
- obj->parent_obj = parent_obj;
+ obj->parent_obj = (QUIC_OBJ *)parent_obj;
obj->is_event_leader = is_event_leader;
obj->is_port_leader = is_port_leader;
obj->engine = engine;
return 0;
}
-static ossl_inline QUIC_OBJ *
-ssl_to_obj(SSL *ssl)
-{
- if (ssl == NULL)
- return NULL;
-
- assert(IS_QUIC(ssl));
- return (QUIC_OBJ *)ssl;
-}
-
static int obj_update_cache(QUIC_OBJ *obj)
{
QUIC_OBJ *p;
for (p = obj; p != NULL && !p->is_event_leader;
- p = ssl_to_obj(p->parent_obj))
+ p = p->parent_obj)
if (!ossl_assert(p == obj || p->init_done))
return 0;
* Offset of ->ssl is guaranteed to be 0 but the NULL check makes ubsan
* happy.
*/
- obj->cached_event_leader = (p != NULL) ? &p->ssl : NULL;
+ obj->cached_event_leader = p;
obj->engine = p->engine;
for (p = obj; p != NULL && !p->is_port_leader;
- p = ssl_to_obj(p->parent_obj));
+ p = p->parent_obj);
- obj->cached_port_leader = (p != NULL) ? &p->ssl : NULL;
+ obj->cached_port_leader = p;
obj->port = (p != NULL) ? p->port : NULL;
return 1;
}
* Pointer to a parent APL object in a QUIC APL object hierarchy, or NULL if
* this is the root object.
*/
- SSL *parent_obj;
+ QUIC_OBJ *parent_obj;
/* invariant: != NULL */
- SSL *cached_event_leader;
+ QUIC_OBJ *cached_event_leader;
/* invariant: != NULL iff this is a port leader or subsidiary object */
- SSL *cached_port_leader;
+ QUIC_OBJ *cached_port_leader;
/*
* Points to the QUIC_ENGINE instance. Always equals
ossl_quic_obj_get0_event_leader(const QUIC_OBJ *obj)
{
assert(obj->init_done);
- return obj->cached_event_leader;
+ return obj->cached_event_leader != NULL
+ ? &obj->cached_event_leader->ssl
+ : NULL;
}
/*
ossl_quic_obj_get0_port_leader(const QUIC_OBJ *obj)
{
assert(obj->init_done);
- return obj->cached_port_leader;
+ return obj->cached_port_leader != NULL
+ ? &obj->cached_port_leader->ssl
+ : NULL;
}
# endif