summaryrefslogtreecommitdiffstats
path: root/ssl/d1_srvr.c
diff options
context:
space:
mode:
authorAndy Polyakov <appro@openssl.org>2007-10-09 19:31:18 +0000
committerAndy Polyakov <appro@openssl.org>2007-10-09 19:31:18 +0000
commita2115c5d17d0619baf1bea2613a29967fdb6b0dd (patch)
tree1566f3bf6e833997f938ff0cfeca2f11798f15d1 /ssl/d1_srvr.c
parent4fe55663df33ca6afc683b7e76ef08ab18fcb188 (diff)
Respect cookie length set by app_gen_cookie_cb.
Submitted by: Alex Lam
Diffstat (limited to 'ssl/d1_srvr.c')
-rw-r--r--ssl/d1_srvr.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/ssl/d1_srvr.c b/ssl/d1_srvr.c
index 14fdcff03b..9401105002 100644
--- a/ssl/d1_srvr.c
+++ b/ssl/d1_srvr.c
@@ -627,8 +627,6 @@ int dtls1_send_hello_verify_request(SSL *s)
*(p++) = s->version >> 8;
*(p++) = s->version & 0xFF;
- *(p++) = (unsigned char) s->d1->cookie_len;
-
if (s->ctx->app_gen_cookie_cb != NULL &&
s->ctx->app_gen_cookie_cb(s, s->d1->cookie,
&(s->d1->cookie_len)) == 0)
@@ -639,6 +637,7 @@ int dtls1_send_hello_verify_request(SSL *s)
/* else the cookie is assumed to have
* been initialized by the application */
+ *(p++) = (unsigned char) s->d1->cookie_len;
memcpy(p, s->d1->cookie, s->d1->cookie_len);
p += s->d1->cookie_len;
msg_len = p - msg;