projects
/
openssl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
PR: 2658
[openssl.git]
/
ssl
/
d1_lib.c
diff --git
a/ssl/d1_lib.c
b/ssl/d1_lib.c
index 9fe6b2b8f728e93e411ae68353dddce015e2fb58..e205b5c6e54533cc07a112915e73ec424251185e 100644
(file)
--- a/
ssl/d1_lib.c
+++ b/
ssl/d1_lib.c
@@
-82,6
+82,7
@@
SSL3_ENC_METHOD DTLSv1_enc_data={
TLS_MD_CLIENT_FINISH_CONST,TLS_MD_CLIENT_FINISH_CONST_SIZE,
TLS_MD_SERVER_FINISH_CONST,TLS_MD_SERVER_FINISH_CONST_SIZE,
tls1_alert_code,
TLS_MD_CLIENT_FINISH_CONST,TLS_MD_CLIENT_FINISH_CONST_SIZE,
TLS_MD_SERVER_FINISH_CONST,TLS_MD_SERVER_FINISH_CONST_SIZE,
tls1_alert_code,
+ tls1_export_keying_material,
};
long dtls1_default_timeout(void)
};
long dtls1_default_timeout(void)
@@
-204,7
+205,8
@@
void dtls1_clear(SSL *s)
pqueue buffered_messages;
pqueue sent_messages;
pqueue buffered_app_data;
pqueue buffered_messages;
pqueue sent_messages;
pqueue buffered_app_data;
-
+ unsigned int mtu;
+
if (s->d1)
{
unprocessed_rcds = s->d1->unprocessed_rcds.q;
if (s->d1)
{
unprocessed_rcds = s->d1->unprocessed_rcds.q;
@@
-212,6
+214,7
@@
void dtls1_clear(SSL *s)
buffered_messages = s->d1->buffered_messages;
sent_messages = s->d1->sent_messages;
buffered_app_data = s->d1->buffered_app_data.q;
buffered_messages = s->d1->buffered_messages;
sent_messages = s->d1->sent_messages;
buffered_app_data = s->d1->buffered_app_data.q;
+ mtu = s->d1->mtu;
dtls1_clear_queues(s);
dtls1_clear_queues(s);
@@
-222,6
+225,11
@@
void dtls1_clear(SSL *s)
s->d1->cookie_len = sizeof(s->d1->cookie);
}
s->d1->cookie_len = sizeof(s->d1->cookie);
}
+ if (SSL_get_options(s) & SSL_OP_NO_QUERY_MTU)
+ {
+ s->d1->mtu = mtu;
+ }
+
s->d1->unprocessed_rcds.q = unprocessed_rcds;
s->d1->processed_rcds.q = processed_rcds;
s->d1->buffered_messages = buffered_messages;
s->d1->unprocessed_rcds.q = unprocessed_rcds;
s->d1->processed_rcds.q = processed_rcds;
s->d1->buffered_messages = buffered_messages;
@@
-284,6
+292,15
@@
const SSL_CIPHER *dtls1_get_cipher(unsigned int u)
void dtls1_start_timer(SSL *s)
{
void dtls1_start_timer(SSL *s)
{
+#ifndef OPENSSL_NO_SCTP
+ /* Disable timer for SCTP */
+ if (BIO_dgram_is_sctp(SSL_get_wbio(s)))
+ {
+ memset(&(s->d1->next_timeout), 0, sizeof(struct timeval));
+ return;
+ }
+#endif
+
/* If timer is not set, initialize duration with 1 second */
if (s->d1->next_timeout.tv_sec == 0 && s->d1->next_timeout.tv_usec == 0)
{
/* If timer is not set, initialize duration with 1 second */
if (s->d1->next_timeout.tv_sec == 0 && s->d1->next_timeout.tv_usec == 0)
{
@@
-398,7
+415,7
@@
int dtls1_handle_timeout(SSL *s)
{
/* fail the connection, enough alerts have been sent */
SSLerr(SSL_F_DTLS1_HANDLE_TIMEOUT,SSL_R_READ_TIMEOUT_EXPIRED);
{
/* fail the connection, enough alerts have been sent */
SSLerr(SSL_F_DTLS1_HANDLE_TIMEOUT,SSL_R_READ_TIMEOUT_EXPIRED);
- return
0
;
+ return
-1
;
}
state->timeout.read_timeouts++;
}
state->timeout.read_timeouts++;
@@
-407,6
+424,14
@@
int dtls1_handle_timeout(SSL *s)
state->timeout.read_timeouts = 1;
}
state->timeout.read_timeouts = 1;
}
+#ifndef OPENSSL_NO_HEARTBEATS
+ if (s->tlsext_hb_pending)
+ {
+ s->tlsext_hb_pending = 0;
+ return dtls1_heartbeat(s);
+ }
+#endif
+
dtls1_start_timer(s);
return dtls1_retransmit_buffered_messages(s);
}
dtls1_start_timer(s);
return dtls1_retransmit_buffered_messages(s);
}