From: Andy Polyakov Date: Tue, 9 Oct 2007 19:31:53 +0000 (+0000) Subject: Respect cookie length set by app_gen_cookie_cb [from HEAD]. X-Git-Tag: OpenSSL_0_9_8f~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=49f42ec0f6d85fbf5230041755685b878b36b32f;p=thirdparty%2Fopenssl.git Respect cookie length set by app_gen_cookie_cb [from HEAD]. Submitted by: Alex Lam --- diff --git a/ssl/d1_srvr.c b/ssl/d1_srvr.c index 7ebba51b8e3..927b01f3c47 100644 --- a/ssl/d1_srvr.c +++ b/ssl/d1_srvr.c @@ -631,8 +631,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) @@ -643,6 +641,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;