diff options
| author | jsing <> | 2020-03-10 17:02:21 +0000 |
|---|---|---|
| committer | jsing <> | 2020-03-10 17:02:21 +0000 |
| commit | 7895b558af2262d6d71a405d98e524b072c4a3d8 (patch) | |
| tree | 2214ec4c580fdd9fa5d8199893b2deab09b04e8c /src/lib/libssl/d1_pkt.c | |
| parent | dc4395e4715e2c37c2833c554afc1d6c976ca7b9 (diff) | |
| download | openbsd-7895b558af2262d6d71a405d98e524b072c4a3d8.tar.gz openbsd-7895b558af2262d6d71a405d98e524b072c4a3d8.tar.bz2 openbsd-7895b558af2262d6d71a405d98e524b072c4a3d8.zip | |
Remove the enc function pointers.
The enc function pointers do not serve any purpose these days - remove
a layer of indirection and call dtls1_enc()/tls1_enc() directly.
ok inoguchi@ tb@
Diffstat (limited to '')
| -rw-r--r-- | src/lib/libssl/d1_pkt.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/lib/libssl/d1_pkt.c b/src/lib/libssl/d1_pkt.c index 2cb2d089c8..101017449c 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.69 2020/02/21 16:15:56 jsing Exp $ */ | 1 | /* $OpenBSD: d1_pkt.c,v 1.70 2020/03/10 17:02:21 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. |
| @@ -361,19 +361,17 @@ dtls1_process_record(SSL *s) | |||
| 361 | /* decrypt in place in 'rr->input' */ | 361 | /* decrypt in place in 'rr->input' */ |
| 362 | rr->data = rr->input; | 362 | rr->data = rr->input; |
| 363 | 363 | ||
| 364 | enc_err = s->method->internal->ssl3_enc->enc(s, 0); | ||
| 365 | /* enc_err is: | 364 | /* enc_err is: |
| 366 | * 0: (in non-constant time) if the record is publically invalid. | 365 | * 0: (in non-constant time) if the record is publically invalid. |
| 367 | * 1: if the padding is valid | 366 | * 1: if the padding is valid |
| 368 | * -1: if the padding is invalid */ | 367 | * -1: if the padding is invalid */ |
| 369 | if (enc_err == 0) { | 368 | if ((enc_err = dtls1_enc(s, 0)) == 0) { |
| 370 | /* For DTLS we simply ignore bad packets. */ | 369 | /* For DTLS we simply ignore bad packets. */ |
| 371 | rr->length = 0; | 370 | rr->length = 0; |
| 372 | s->internal->packet_length = 0; | 371 | s->internal->packet_length = 0; |
| 373 | goto err; | 372 | goto err; |
| 374 | } | 373 | } |
| 375 | 374 | ||
| 376 | |||
| 377 | /* r->length is now the compressed data plus mac */ | 375 | /* r->length is now the compressed data plus mac */ |
| 378 | if ((sess != NULL) && (s->enc_read_ctx != NULL) && | 376 | if ((sess != NULL) && (s->enc_read_ctx != NULL) && |
| 379 | (EVP_MD_CTX_md(s->read_hash) != NULL)) { | 377 | (EVP_MD_CTX_md(s->read_hash) != NULL)) { |
| @@ -1286,8 +1284,8 @@ do_dtls1_write(SSL *s, int type, const unsigned char *buf, unsigned int len) | |||
| 1286 | wr->length += bs; | 1284 | wr->length += bs; |
| 1287 | } | 1285 | } |
| 1288 | 1286 | ||
| 1289 | /* ssl3_enc can only have an error on read */ | 1287 | /* dtls1_enc can only have an error on read */ |
| 1290 | s->method->internal->ssl3_enc->enc(s, 1); | 1288 | dtls1_enc(s, 1); |
| 1291 | 1289 | ||
| 1292 | if (!CBB_add_u16(&cbb, wr->length)) | 1290 | if (!CBB_add_u16(&cbb, wr->length)) |
| 1293 | goto err; | 1291 | goto err; |
