Don't break out of the custom extension callback loop - continue instead
The contract for custom extension callbacks has changed - all custom extension callbacks are triggered
This commit is contained in:
parent
0a6028757a
commit
9dabfce1a8
@ -576,8 +576,7 @@ static int custom_ext_0_cli_second_cb(SSL *s, unsigned short ext_type,
|
|||||||
unsigned short inlen, int *al,
|
unsigned short inlen, int *al,
|
||||||
void *arg)
|
void *arg)
|
||||||
{
|
{
|
||||||
custom_ext_error = 1; /* Shouldn't be called */
|
return 1;
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int custom_ext_1_cli_first_cb(SSL *s, unsigned short ext_type,
|
static int custom_ext_1_cli_first_cb(SSL *s, unsigned short ext_type,
|
||||||
@ -596,8 +595,7 @@ static int custom_ext_1_cli_second_cb(SSL *s, unsigned short ext_type,
|
|||||||
unsigned short inlen, int *al,
|
unsigned short inlen, int *al,
|
||||||
void *arg)
|
void *arg)
|
||||||
{
|
{
|
||||||
custom_ext_error = 1; /* Shouldn't be called */
|
return 1;
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int custom_ext_2_cli_first_cb(SSL *s, unsigned short ext_type,
|
static int custom_ext_2_cli_first_cb(SSL *s, unsigned short ext_type,
|
||||||
@ -654,8 +652,7 @@ static int custom_ext_0_srv_first_cb(SSL *s, unsigned short ext_type,
|
|||||||
unsigned short inlen, int *al,
|
unsigned short inlen, int *al,
|
||||||
void *arg)
|
void *arg)
|
||||||
{
|
{
|
||||||
custom_ext_error = 1;
|
return 1;
|
||||||
return 0; /* Shouldn't be called */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 'generate' callbacks are always called, even if the 'receive' callback isn't called */
|
/* 'generate' callbacks are always called, even if the 'receive' callback isn't called */
|
||||||
|
@ -1708,14 +1708,14 @@ unsigned char *ssl_add_serverhello_tlsext(SSL *s, unsigned char *p, unsigned cha
|
|||||||
|
|
||||||
/* NULL callback or -1 omits extension */
|
/* NULL callback or -1 omits extension */
|
||||||
if (!record->fn2)
|
if (!record->fn2)
|
||||||
break;
|
continue;
|
||||||
cb_retval = record->fn2(s, record->ext_type,
|
cb_retval = record->fn2(s, record->ext_type,
|
||||||
&out, &outlen, al,
|
&out, &outlen, al,
|
||||||
record->arg);
|
record->arg);
|
||||||
if (cb_retval == 0)
|
if (cb_retval == 0)
|
||||||
return NULL; /* error */
|
return NULL; /* error */
|
||||||
if (cb_retval == -1)
|
if (cb_retval == -1)
|
||||||
break; /* skip this extension */
|
continue; /* skip this extension */
|
||||||
if (limit < ret + 4 + outlen)
|
if (limit < ret + 4 + outlen)
|
||||||
return NULL;
|
return NULL;
|
||||||
s2n(record->ext_type, ret);
|
s2n(record->ext_type, ret);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user