diff options
author | jsing <> | 2020-10-03 17:11:28 +0000 |
---|---|---|
committer | jsing <> | 2020-10-03 17:11:28 +0000 |
commit | fac102d465f978281849ca9c5bed44b183599623 (patch) | |
tree | e2103f832c32430171cb20282326fef1ef2f996c | |
parent | a35481173a912332211359d38b0864da866bc568 (diff) | |
download | openbsd-fac102d465f978281849ca9c5bed44b183599623.tar.gz openbsd-fac102d465f978281849ca9c5bed44b183599623.tar.bz2 openbsd-fac102d465f978281849ca9c5bed44b183599623.zip |
Make dtls1_copy_record() take a DTLS1_RECORD_DATA_INTERNAL *.
This removes the need for extra variables and casts.
ok inoguchi@ tb@
-rw-r--r-- | src/lib/libssl/d1_pkt.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/src/lib/libssl/d1_pkt.c b/src/lib/libssl/d1_pkt.c index f115e1a478..859043a3ce 100644 --- a/src/lib/libssl/d1_pkt.c +++ b/src/lib/libssl/d1_pkt.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: d1_pkt.c,v 1.83 2020/10/03 17:10:09 jsing Exp $ */ | 1 | /* $OpenBSD: d1_pkt.c,v 1.84 2020/10/03 17:11:28 jsing Exp $ */ |
2 | /* | 2 | /* |
3 | * DTLS implementation written by Nagendra Modadugu | 3 | * DTLS implementation written by Nagendra Modadugu |
4 | * (nagendra@cs.stanford.edu) for the OpenSSL project 2005. | 4 | * (nagendra@cs.stanford.edu) for the OpenSSL project 2005. |
@@ -194,12 +194,8 @@ static int dtls1_process_record(SSL *s); | |||
194 | 194 | ||
195 | /* copy buffered record into SSL structure */ | 195 | /* copy buffered record into SSL structure */ |
196 | static int | 196 | static int |
197 | dtls1_copy_record(SSL *s, pitem *item) | 197 | dtls1_copy_record(SSL *s, DTLS1_RECORD_DATA_INTERNAL *rdata) |
198 | { | 198 | { |
199 | DTLS1_RECORD_DATA_INTERNAL *rdata; | ||
200 | |||
201 | rdata = (DTLS1_RECORD_DATA_INTERNAL *)item->data; | ||
202 | |||
203 | ssl3_release_buffer(&S3I(s)->rbuf); | 199 | ssl3_release_buffer(&S3I(s)->rbuf); |
204 | 200 | ||
205 | s->internal->packet = rdata->packet; | 201 | s->internal->packet = rdata->packet; |
@@ -213,7 +209,6 @@ dtls1_copy_record(SSL *s, pitem *item) | |||
213 | return (1); | 209 | return (1); |
214 | } | 210 | } |
215 | 211 | ||
216 | |||
217 | static int | 212 | static int |
218 | dtls1_buffer_record(SSL *s, record_pqueue *queue, unsigned char *priority) | 213 | dtls1_buffer_record(SSL *s, record_pqueue *queue, unsigned char *priority) |
219 | { | 214 | { |
@@ -268,7 +263,7 @@ dtls1_retrieve_buffered_record(SSL *s, record_pqueue *queue) | |||
268 | 263 | ||
269 | item = pqueue_pop(queue->q); | 264 | item = pqueue_pop(queue->q); |
270 | if (item) { | 265 | if (item) { |
271 | dtls1_copy_record(s, item); | 266 | dtls1_copy_record(s, item->data); |
272 | 267 | ||
273 | free(item->data); | 268 | free(item->data); |
274 | pitem_free(item); | 269 | pitem_free(item); |
@@ -675,8 +670,7 @@ dtls1_read_bytes(SSL *s, int type, unsigned char *buf, int len, int peek) | |||
675 | pitem *item; | 670 | pitem *item; |
676 | item = pqueue_pop(D1I(s)->buffered_app_data.q); | 671 | item = pqueue_pop(D1I(s)->buffered_app_data.q); |
677 | if (item) { | 672 | if (item) { |
678 | 673 | dtls1_copy_record(s, item->data); | |
679 | dtls1_copy_record(s, item); | ||
680 | 674 | ||
681 | free(item->data); | 675 | free(item->data); |
682 | pitem_free(item); | 676 | pitem_free(item); |