From 2fc4169a1040fb41912043d6a402741eceda793f Mon Sep 17 00:00:00 2001 From: jsing <> Date: Tue, 10 Mar 2020 17:02:21 +0000 Subject: 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@ --- src/lib/libssl/d1_pkt.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src/lib/libssl/d1_pkt.c') 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 @@ -/* $OpenBSD: d1_pkt.c,v 1.69 2020/02/21 16:15:56 jsing Exp $ */ +/* $OpenBSD: d1_pkt.c,v 1.70 2020/03/10 17:02:21 jsing Exp $ */ /* * DTLS implementation written by Nagendra Modadugu * (nagendra@cs.stanford.edu) for the OpenSSL project 2005. @@ -361,19 +361,17 @@ dtls1_process_record(SSL *s) /* decrypt in place in 'rr->input' */ rr->data = rr->input; - enc_err = s->method->internal->ssl3_enc->enc(s, 0); /* enc_err is: * 0: (in non-constant time) if the record is publically invalid. * 1: if the padding is valid * -1: if the padding is invalid */ - if (enc_err == 0) { + if ((enc_err = dtls1_enc(s, 0)) == 0) { /* For DTLS we simply ignore bad packets. */ rr->length = 0; s->internal->packet_length = 0; goto err; } - /* r->length is now the compressed data plus mac */ if ((sess != NULL) && (s->enc_read_ctx != NULL) && (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) wr->length += bs; } - /* ssl3_enc can only have an error on read */ - s->method->internal->ssl3_enc->enc(s, 1); + /* dtls1_enc can only have an error on read */ + dtls1_enc(s, 1); if (!CBB_add_u16(&cbb, wr->length)) goto err; -- cgit v1.2.3-55-g6feb