summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorderaadt <>2014-05-26 12:11:38 +0000
committerderaadt <>2014-05-26 12:11:38 +0000
commit043e50e025a8f1c5baa37e18d206b24c27356069 (patch)
treedb05f90835af29cf1a571f0b30f5a84e36093481 /src
parent0995a92809472b446ca1bf18277538657c614595 (diff)
downloadopenbsd-043e50e025a8f1c5baa37e18d206b24c27356069.tar.gz
openbsd-043e50e025a8f1c5baa37e18d206b24c27356069.tar.bz2
openbsd-043e50e025a8f1c5baa37e18d206b24c27356069.zip
repair some KNF missed by the script; ok jsing
Diffstat (limited to 'src')
-rw-r--r--src/lib/libssl/d1_lib.c16
-rw-r--r--src/lib/libssl/src/ssl/d1_lib.c16
2 files changed, 20 insertions, 12 deletions
diff --git a/src/lib/libssl/d1_lib.c b/src/lib/libssl/d1_lib.c
index 199653624c..f0b9c1920a 100644
--- a/src/lib/libssl/d1_lib.c
+++ b/src/lib/libssl/d1_lib.c
@@ -314,11 +314,13 @@ dtls1_start_timer(SSL *s)
314 314
315 /* Add duration to current time */ 315 /* Add duration to current time */
316 s->d1->next_timeout.tv_sec += s->d1->timeout_duration; 316 s->d1->next_timeout.tv_sec += s->d1->timeout_duration;
317 BIO_ctrl(SSL_get_rbio(s), BIO_CTRL_DGRAM_SET_NEXT_TIMEOUT, 0, &(s->d1->next_timeout)); 317 BIO_ctrl(SSL_get_rbio(s), BIO_CTRL_DGRAM_SET_NEXT_TIMEOUT, 0,
318 &(s->d1->next_timeout));
318} 319}
319 320
320struct timeval* 321struct timeval*
321dtls1_get_timeout(SSL *s, struct timeval* timeleft) { 322dtls1_get_timeout(SSL *s, struct timeval* timeleft)
323{
322 struct timeval timenow; 324 struct timeval timenow;
323 325
324 /* If no timeout is set, just return NULL */ 326 /* If no timeout is set, just return NULL */
@@ -331,8 +333,8 @@ dtls1_get_timeout(SSL *s, struct timeval* timeleft) {
331 333
332 /* If timer already expired, set remaining time to 0 */ 334 /* If timer already expired, set remaining time to 0 */
333 if (s->d1->next_timeout.tv_sec < timenow.tv_sec || 335 if (s->d1->next_timeout.tv_sec < timenow.tv_sec ||
334 (s->d1->next_timeout.tv_sec == timenow.tv_sec && 336 (s->d1->next_timeout.tv_sec == timenow.tv_sec &&
335 s->d1->next_timeout.tv_usec <= timenow.tv_usec)) { 337 s->d1->next_timeout.tv_usec <= timenow.tv_usec)) {
336 memset(timeleft, 0, sizeof(struct timeval)); 338 memset(timeleft, 0, sizeof(struct timeval));
337 return timeleft; 339 return timeleft;
338 } 340 }
@@ -393,7 +395,8 @@ dtls1_stop_timer(SSL *s)
393 memset(&(s->d1->timeout), 0, sizeof(struct dtls1_timeout_st)); 395 memset(&(s->d1->timeout), 0, sizeof(struct dtls1_timeout_st));
394 memset(&(s->d1->next_timeout), 0, sizeof(struct timeval)); 396 memset(&(s->d1->next_timeout), 0, sizeof(struct timeval));
395 s->d1->timeout_duration = 1; 397 s->d1->timeout_duration = 1;
396 BIO_ctrl(SSL_get_rbio(s), BIO_CTRL_DGRAM_SET_NEXT_TIMEOUT, 0, &(s->d1->next_timeout)); 398 BIO_ctrl(SSL_get_rbio(s), BIO_CTRL_DGRAM_SET_NEXT_TIMEOUT, 0,
399 &(s->d1->next_timeout));
397 /* Clear retransmission buffer */ 400 /* Clear retransmission buffer */
398 dtls1_clear_record_buffer(s); 401 dtls1_clear_record_buffer(s);
399} 402}
@@ -405,7 +408,8 @@ dtls1_check_timeout_num(SSL *s)
405 408
406 /* Reduce MTU after 2 unsuccessful retransmissions */ 409 /* Reduce MTU after 2 unsuccessful retransmissions */
407 if (s->d1->timeout.num_alerts > 2) { 410 if (s->d1->timeout.num_alerts > 2) {
408 s->d1->mtu = BIO_ctrl(SSL_get_wbio(s), BIO_CTRL_DGRAM_GET_FALLBACK_MTU, 0, NULL); 411 s->d1->mtu = BIO_ctrl(SSL_get_wbio(s),
412 BIO_CTRL_DGRAM_GET_FALLBACK_MTU, 0, NULL);
409 413
410 } 414 }
411 415
diff --git a/src/lib/libssl/src/ssl/d1_lib.c b/src/lib/libssl/src/ssl/d1_lib.c
index 199653624c..f0b9c1920a 100644
--- a/src/lib/libssl/src/ssl/d1_lib.c
+++ b/src/lib/libssl/src/ssl/d1_lib.c
@@ -314,11 +314,13 @@ dtls1_start_timer(SSL *s)
314 314
315 /* Add duration to current time */ 315 /* Add duration to current time */
316 s->d1->next_timeout.tv_sec += s->d1->timeout_duration; 316 s->d1->next_timeout.tv_sec += s->d1->timeout_duration;
317 BIO_ctrl(SSL_get_rbio(s), BIO_CTRL_DGRAM_SET_NEXT_TIMEOUT, 0, &(s->d1->next_timeout)); 317 BIO_ctrl(SSL_get_rbio(s), BIO_CTRL_DGRAM_SET_NEXT_TIMEOUT, 0,
318 &(s->d1->next_timeout));
318} 319}
319 320
320struct timeval* 321struct timeval*
321dtls1_get_timeout(SSL *s, struct timeval* timeleft) { 322dtls1_get_timeout(SSL *s, struct timeval* timeleft)
323{
322 struct timeval timenow; 324 struct timeval timenow;
323 325
324 /* If no timeout is set, just return NULL */ 326 /* If no timeout is set, just return NULL */
@@ -331,8 +333,8 @@ dtls1_get_timeout(SSL *s, struct timeval* timeleft) {
331 333
332 /* If timer already expired, set remaining time to 0 */ 334 /* If timer already expired, set remaining time to 0 */
333 if (s->d1->next_timeout.tv_sec < timenow.tv_sec || 335 if (s->d1->next_timeout.tv_sec < timenow.tv_sec ||
334 (s->d1->next_timeout.tv_sec == timenow.tv_sec && 336 (s->d1->next_timeout.tv_sec == timenow.tv_sec &&
335 s->d1->next_timeout.tv_usec <= timenow.tv_usec)) { 337 s->d1->next_timeout.tv_usec <= timenow.tv_usec)) {
336 memset(timeleft, 0, sizeof(struct timeval)); 338 memset(timeleft, 0, sizeof(struct timeval));
337 return timeleft; 339 return timeleft;
338 } 340 }
@@ -393,7 +395,8 @@ dtls1_stop_timer(SSL *s)
393 memset(&(s->d1->timeout), 0, sizeof(struct dtls1_timeout_st)); 395 memset(&(s->d1->timeout), 0, sizeof(struct dtls1_timeout_st));
394 memset(&(s->d1->next_timeout), 0, sizeof(struct timeval)); 396 memset(&(s->d1->next_timeout), 0, sizeof(struct timeval));
395 s->d1->timeout_duration = 1; 397 s->d1->timeout_duration = 1;
396 BIO_ctrl(SSL_get_rbio(s), BIO_CTRL_DGRAM_SET_NEXT_TIMEOUT, 0, &(s->d1->next_timeout)); 398 BIO_ctrl(SSL_get_rbio(s), BIO_CTRL_DGRAM_SET_NEXT_TIMEOUT, 0,
399 &(s->d1->next_timeout));
397 /* Clear retransmission buffer */ 400 /* Clear retransmission buffer */
398 dtls1_clear_record_buffer(s); 401 dtls1_clear_record_buffer(s);
399} 402}
@@ -405,7 +408,8 @@ dtls1_check_timeout_num(SSL *s)
405 408
406 /* Reduce MTU after 2 unsuccessful retransmissions */ 409 /* Reduce MTU after 2 unsuccessful retransmissions */
407 if (s->d1->timeout.num_alerts > 2) { 410 if (s->d1->timeout.num_alerts > 2) {
408 s->d1->mtu = BIO_ctrl(SSL_get_wbio(s), BIO_CTRL_DGRAM_GET_FALLBACK_MTU, 0, NULL); 411 s->d1->mtu = BIO_ctrl(SSL_get_wbio(s),
412 BIO_CTRL_DGRAM_GET_FALLBACK_MTU, 0, NULL);
409 413
410 } 414 }
411 415