1 /* Reduced from haproxy's src/ssl_sample.c */
3 /* { dg-require-effective-target ptr_eq_long } */
4 /* { dg-additional-options "-Wno-analyzer-symbol-too-complex" } */
23 struct sample_data data
;
42 CO_FL_EARLY_SSL_HS
= 0x00004000,
43 CO_FL_EARLY_DATA
= 0x00008000,
45 CO_FL_SSL_WAIT_HS
= 0x08000000,
49 enum obj_type obj_type
;
50 unsigned char err_code
;
56 static inline enum obj_type
obj_type(const enum obj_type
*t
)
58 if (!t
|| *t
>= OBJ_TYPE_ENTRIES
)
62 static inline struct connection
*__objt_conn(enum obj_type
*t
)
64 return ((struct connection
*)(((char *)(t
)) - ((long)&((struct connection
*)0)->obj_type
)));
66 static inline struct connection
*objt_conn(enum obj_type
*t
)
68 if (!t
|| *t
!= OBJ_TYPE_CONN
)
69 return (struct connection
*) ((void *)0);
70 return __objt_conn(t
);
74 enum obj_type
*origin
;
77 typedef struct ssl_st SSL
;
78 SSL
*ssl_sock_get_ssl_object(struct connection
*conn
);
80 /*****************************************************************************/
83 smp_fetch_ssl_fc_has_early(const struct arg
*args
, struct sample
*smp
, const char *kw
, void *Private
)
86 struct connection
*conn
;
88 conn
= objt_conn(smp
->sess
->origin
);
89 ssl
= ssl_sock_get_ssl_object(conn
);
94 smp
->data
.type
= SMP_T_BOOL
;
95 smp
->data
.u
.sint
= ((conn
->flags
& CO_FL_EARLY_DATA
) && /* { dg-bogus "dereference of NULL 'conn'" "PR analyzer/108251" { xfail *-*-*} } */
96 (conn
->flags
& (CO_FL_EARLY_SSL_HS
| CO_FL_SSL_WAIT_HS
))) ? 1 : 0;