diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2014-08-26 01:20:26 +0100 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2014-08-28 18:10:21 +0100 |
commit | f9784baf0e36a3f26093af199480b263d7b5ae72 (patch) | |
tree | 7449143e47b97515dd6473b651bfc3999f60733b /ssl/ssltest.c | |
parent | 8fb57b29d61e050fbf2536077d1378b5cce93473 (diff) |
Fix comments, add new test.
Fix comments in ssltest.c: return value of 0 now means extension is
omitted and add_cb is not called for servers if the corresponding
extension is absent in ClientHello.
Test add_cb is not called if extension is not received.
Reviewed-by: Emilia Käsper <emilia@openssl.org>
(cherry picked from commit f47e203975133ddbae3cde20c8c3c0516f62066c)
Diffstat (limited to 'ssl/ssltest.c')
-rw-r--r-- | ssl/ssltest.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/ssl/ssltest.c b/ssl/ssltest.c index 960ed2a772..79b5da9da9 100644 --- a/ssl/ssltest.c +++ b/ssl/ssltest.c @@ -561,20 +561,23 @@ static int custom_ext_3_cli_parse_cb(SSL *s, unsigned int ext_type, return 1; } -/* custom_ext_0_cli_parse_cb returns -1 - the server won't receive a callback for this extension */ +/* custom_ext_0_cli_add_cb returns 0 - the server won't receive a callback for this extension */ static int custom_ext_0_srv_parse_cb(SSL *s, unsigned int ext_type, const unsigned char *in, size_t inlen, int *al, void *arg) { + custom_ext_error = 1; return 1; } -/* 'generate' callbacks are always called, even if the 'receive' callback isn't called */ +/* 'add' callbacks are only called if the 'parse' callback is called */ static int custom_ext_0_srv_add_cb(SSL *s, unsigned int ext_type, const unsigned char **out, size_t *outlen, int *al, void *arg) { + /* Error: should not have been called */ + custom_ext_error = 1; return 0; /* Don't send an extension */ } |