summaryrefslogtreecommitdiff
path: root/src/lib/libssl/d1_pkt.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libssl/d1_pkt.c')
-rw-r--r--src/lib/libssl/d1_pkt.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/lib/libssl/d1_pkt.c b/src/lib/libssl/d1_pkt.c
index ebf04e3292..7f4261e47e 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.92 2021/02/08 17:17:02 jsing Exp $ */ 1/* $OpenBSD: d1_pkt.c,v 1.93 2021/02/20 14:14:16 tb 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.
@@ -328,7 +328,7 @@ dtls1_process_record(SSL *s)
328 else if (alert_desc == SSL_AD_BAD_RECORD_MAC) 328 else if (alert_desc == SSL_AD_BAD_RECORD_MAC)
329 SSLerror(s, SSL_R_DECRYPTION_FAILED_OR_BAD_RECORD_MAC); 329 SSLerror(s, SSL_R_DECRYPTION_FAILED_OR_BAD_RECORD_MAC);
330 330
331 goto f_err; 331 goto fatal_err;
332 } 332 }
333 333
334 rr->data = out; 334 rr->data = out;
@@ -339,7 +339,7 @@ dtls1_process_record(SSL *s)
339 339
340 return (1); 340 return (1);
341 341
342 f_err: 342 fatal_err:
343 ssl3_send_alert(s, SSL3_AL_FATAL, alert_desc); 343 ssl3_send_alert(s, SSL3_AL_FATAL, alert_desc);
344 err: 344 err:
345 return (0); 345 return (0);
@@ -635,7 +635,7 @@ dtls1_read_bytes(SSL *s, int type, unsigned char *buf, int len, int peek)
635 !tls12_record_layer_read_protected(s->internal->rl)) { 635 !tls12_record_layer_read_protected(s->internal->rl)) {
636 al = SSL_AD_UNEXPECTED_MESSAGE; 636 al = SSL_AD_UNEXPECTED_MESSAGE;
637 SSLerror(s, SSL_R_APP_DATA_IN_HANDSHAKE); 637 SSLerror(s, SSL_R_APP_DATA_IN_HANDSHAKE);
638 goto f_err; 638 goto fatal_err;
639 } 639 }
640 640
641 if (len <= 0) 641 if (len <= 0)
@@ -698,7 +698,7 @@ dtls1_read_bytes(SSL *s, int type, unsigned char *buf, int len, int peek)
698 /* Not certain if this is the right error handling */ 698 /* Not certain if this is the right error handling */
699 al = SSL_AD_UNEXPECTED_MESSAGE; 699 al = SSL_AD_UNEXPECTED_MESSAGE;
700 SSLerror(s, SSL_R_UNEXPECTED_RECORD); 700 SSLerror(s, SSL_R_UNEXPECTED_RECORD);
701 goto f_err; 701 goto fatal_err;
702 } 702 }
703 703
704 if (dest_maxlen > 0) { 704 if (dest_maxlen > 0) {
@@ -735,7 +735,7 @@ dtls1_read_bytes(SSL *s, int type, unsigned char *buf, int len, int peek)
735 (D1I(s)->handshake_fragment[3] != 0)) { 735 (D1I(s)->handshake_fragment[3] != 0)) {
736 al = SSL_AD_DECODE_ERROR; 736 al = SSL_AD_DECODE_ERROR;
737 SSLerror(s, SSL_R_BAD_HELLO_REQUEST); 737 SSLerror(s, SSL_R_BAD_HELLO_REQUEST);
738 goto f_err; 738 goto fatal_err;
739 } 739 }
740 740
741 /* no need to check sequence number on HELLO REQUEST messages */ 741 /* no need to check sequence number on HELLO REQUEST messages */
@@ -821,7 +821,7 @@ dtls1_read_bytes(SSL *s, int type, unsigned char *buf, int len, int peek)
821 } else { 821 } else {
822 al = SSL_AD_ILLEGAL_PARAMETER; 822 al = SSL_AD_ILLEGAL_PARAMETER;
823 SSLerror(s, SSL_R_UNKNOWN_ALERT_TYPE); 823 SSLerror(s, SSL_R_UNKNOWN_ALERT_TYPE);
824 goto f_err; 824 goto fatal_err;
825 } 825 }
826 826
827 goto start; 827 goto start;
@@ -847,7 +847,7 @@ dtls1_read_bytes(SSL *s, int type, unsigned char *buf, int len, int peek)
847 (rr->off != 0) || (rr->data[0] != SSL3_MT_CCS)) { 847 (rr->off != 0) || (rr->data[0] != SSL3_MT_CCS)) {
848 al = SSL_AD_DECODE_ERROR; 848 al = SSL_AD_DECODE_ERROR;
849 SSLerror(s, SSL_R_BAD_CHANGE_CIPHER_SPEC); 849 SSLerror(s, SSL_R_BAD_CHANGE_CIPHER_SPEC);
850 goto f_err; 850 goto fatal_err;
851 } 851 }
852 852
853 rr->length = 0; 853 rr->length = 0;
@@ -941,7 +941,7 @@ dtls1_read_bytes(SSL *s, int type, unsigned char *buf, int len, int peek)
941 } 941 }
942 al = SSL_AD_UNEXPECTED_MESSAGE; 942 al = SSL_AD_UNEXPECTED_MESSAGE;
943 SSLerror(s, SSL_R_UNEXPECTED_RECORD); 943 SSLerror(s, SSL_R_UNEXPECTED_RECORD);
944 goto f_err; 944 goto fatal_err;
945 case SSL3_RT_CHANGE_CIPHER_SPEC: 945 case SSL3_RT_CHANGE_CIPHER_SPEC:
946 case SSL3_RT_ALERT: 946 case SSL3_RT_ALERT:
947 case SSL3_RT_HANDSHAKE: 947 case SSL3_RT_HANDSHAKE:
@@ -950,7 +950,7 @@ dtls1_read_bytes(SSL *s, int type, unsigned char *buf, int len, int peek)
950 * should not happen when type != rr->type */ 950 * should not happen when type != rr->type */
951 al = SSL_AD_UNEXPECTED_MESSAGE; 951 al = SSL_AD_UNEXPECTED_MESSAGE;
952 SSLerror(s, ERR_R_INTERNAL_ERROR); 952 SSLerror(s, ERR_R_INTERNAL_ERROR);
953 goto f_err; 953 goto fatal_err;
954 case SSL3_RT_APPLICATION_DATA: 954 case SSL3_RT_APPLICATION_DATA:
955 /* At this point, we were expecting handshake data, 955 /* At this point, we were expecting handshake data,
956 * but have application data. If the library was 956 * but have application data. If the library was
@@ -972,12 +972,12 @@ dtls1_read_bytes(SSL *s, int type, unsigned char *buf, int len, int peek)
972 } else { 972 } else {
973 al = SSL_AD_UNEXPECTED_MESSAGE; 973 al = SSL_AD_UNEXPECTED_MESSAGE;
974 SSLerror(s, SSL_R_UNEXPECTED_RECORD); 974 SSLerror(s, SSL_R_UNEXPECTED_RECORD);
975 goto f_err; 975 goto fatal_err;
976 } 976 }
977 } 977 }
978 /* not reached */ 978 /* not reached */
979 979
980 f_err: 980 fatal_err:
981 ssl3_send_alert(s, SSL3_AL_FATAL, al); 981 ssl3_send_alert(s, SSL3_AL_FATAL, al);
982 err: 982 err:
983 return (-1); 983 return (-1);