diff options
author | jsing <> | 2021-07-19 08:39:28 +0000 |
---|---|---|
committer | jsing <> | 2021-07-19 08:39:28 +0000 |
commit | 4de658e74ecddfe0253c2d0c886a1e9a75a076cf (patch) | |
tree | f9f3db275b01fd45587c37e0e8a082819770cb76 | |
parent | 393913f70305174125c2a51b0096420de7c292f7 (diff) | |
download | openbsd-4de658e74ecddfe0253c2d0c886a1e9a75a076cf.tar.gz openbsd-4de658e74ecddfe0253c2d0c886a1e9a75a076cf.tar.bz2 openbsd-4de658e74ecddfe0253c2d0c886a1e9a75a076cf.zip |
Inline DTLS1_CCS_HEADER_LENGTH rather than having a single use variable.
ok tb@
-rw-r--r-- | src/lib/libssl/d1_pkt.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/lib/libssl/d1_pkt.c b/src/lib/libssl/d1_pkt.c index 17be6dd182..36dd255722 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.99 2021/06/19 17:21:39 jsing Exp $ */ | 1 | /* $OpenBSD: d1_pkt.c,v 1.100 2021/07/19 08:39: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. |
@@ -836,14 +836,13 @@ dtls1_read_bytes(SSL *s, int type, unsigned char *buf, int len, int peek) | |||
836 | 836 | ||
837 | if (rr->type == SSL3_RT_CHANGE_CIPHER_SPEC) { | 837 | if (rr->type == SSL3_RT_CHANGE_CIPHER_SPEC) { |
838 | struct ccs_header_st ccs_hdr; | 838 | struct ccs_header_st ccs_hdr; |
839 | unsigned int ccs_hdr_len = DTLS1_CCS_HEADER_LENGTH; | ||
840 | 839 | ||
841 | dtls1_get_ccs_header(rr->data, &ccs_hdr); | 840 | dtls1_get_ccs_header(rr->data, &ccs_hdr); |
842 | 841 | ||
843 | /* 'Change Cipher Spec' is just a single byte, so we know | 842 | /* 'Change Cipher Spec' is just a single byte, so we know |
844 | * exactly what the record payload has to look like */ | 843 | * exactly what the record payload has to look like */ |
845 | /* XDTLS: check that epoch is consistent */ | 844 | /* XDTLS: check that epoch is consistent */ |
846 | if ((rr->length != ccs_hdr_len) || | 845 | if ((rr->length != DTLS1_CCS_HEADER_LENGTH) || |
847 | (rr->off != 0) || (rr->data[0] != SSL3_MT_CCS)) { | 846 | (rr->off != 0) || (rr->data[0] != SSL3_MT_CCS)) { |
848 | al = SSL_AD_DECODE_ERROR; | 847 | al = SSL_AD_DECODE_ERROR; |
849 | SSLerror(s, SSL_R_BAD_CHANGE_CIPHER_SPEC); | 848 | SSLerror(s, SSL_R_BAD_CHANGE_CIPHER_SPEC); |