+static int supp_data_0_srv_first_cb(SSL *s, unsigned short supp_data_type,
+ const unsigned char **out,
+ unsigned short *outlen, void *arg)
+ {
+ *out = (const unsigned char*)supp_data_0_string;
+ *outlen = strlen(supp_data_0_string);
+ if (arg != s)
+ suppdata_error = 1;
+ return 1;
+ }
+
+static int supp_data_0_srv_second_cb(SSL *s, unsigned short supp_data_type,
+ const unsigned char *in,
+ unsigned short inlen, int *al,
+ void *arg)
+ {
+ if (supp_data_type != CUSTOM_SUPP_DATA_TYPE_0)
+ suppdata_error = 1;
+ if (inlen != strlen(supp_data_0_string))
+ suppdata_error = 1;
+ if (memcmp(in, supp_data_0_string, inlen) != 0)
+ suppdata_error = 1;
+ if (arg != s)
+ suppdata_error = 1;
+ return 1;
+ }
+
+static int supp_data_1_srv_first_cb(SSL *s, unsigned short supp_data_type,
+ const unsigned char **out,
+ unsigned short *outlen, void *arg)
+ {
+ return -1;
+ }
+
+static int supp_data_1_srv_second_cb(SSL *s, unsigned short supp_data_type,
+ const unsigned char *in,
+ unsigned short inlen, int *al,
+ void *arg)
+ {
+ suppdata_error = 1;
+ return 1;
+ }
+
+static int supp_data_2_srv_second_cb(SSL *s, unsigned short supp_data_type,
+ const unsigned char *in,
+ unsigned short inlen, int *al,
+ void *arg)
+ {
+ suppdata_error = 1;
+ return 1;
+ }
+
+static int supp_data_0_cli_first_cb(SSL *s, unsigned short supp_data_type,
+ const unsigned char *in,
+ unsigned short inlen, int *al,
+ void *arg)
+ {
+ if (supp_data_type != CUSTOM_SUPP_DATA_TYPE_0)
+ suppdata_error = 1;
+ if (inlen != strlen(supp_data_0_string))
+ suppdata_error = 1;
+ if (memcmp(in, supp_data_0_string, inlen) != 0)
+ suppdata_error = 1;
+ if (arg != s)
+ suppdata_error = 1;
+ return 1;
+ }
+
+static int supp_data_0_cli_second_cb(SSL *s, unsigned short supp_data_type,
+ const unsigned char **out,
+ unsigned short *outlen, void *arg)
+ {
+ *out = (const unsigned char*)supp_data_0_string;
+ *outlen = strlen(supp_data_0_string);
+ if (arg != s)
+ suppdata_error = 1;
+ return 1;
+ }
+
+static int supp_data_1_cli_first_cb(SSL *s, unsigned short supp_data_type,
+ const unsigned char *in,
+ unsigned short inlen, int *al,
+ void *arg)
+ {
+ suppdata_error = 1;
+ return 1;
+ }
+
+static int supp_data_1_cli_second_cb(SSL *s, unsigned short supp_data_type,
+ const unsigned char **out,
+ unsigned short *outlen, void *arg)
+ {
+ return -1;
+ }
+
+static int supp_data_2_cli_first_cb(SSL *s, unsigned short supp_data_type,
+ const unsigned char *in,
+ unsigned short inlen, int *al,
+ void *arg)
+ {
+ suppdata_error = 1;
+ return 1;
+ }