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.c40
1 files changed, 2 insertions, 38 deletions
diff --git a/src/lib/libssl/d1_pkt.c b/src/lib/libssl/d1_pkt.c
index 0416ee9c59..acd66e622c 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.103 2021/07/21 08:42:14 jsing Exp $ */ 1/* $OpenBSD: d1_pkt.c,v 1.104 2021/07/26 03:17:38 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.
@@ -126,10 +126,6 @@
126#include "pqueue.h" 126#include "pqueue.h"
127#include "ssl_locl.h" 127#include "ssl_locl.h"
128 128
129static int do_dtls1_write(SSL *s, int type, const unsigned char *buf,
130 unsigned int len);
131
132
133/* mod 128 saturating subtract of two 64-bit values in big-endian order */ 129/* mod 128 saturating subtract of two 64-bit values in big-endian order */
134static int 130static int
135satsub64be(const unsigned char *v1, const unsigned char *v2) 131satsub64be(const unsigned char *v1, const unsigned char *v2)
@@ -1057,7 +1053,7 @@ do_dtls1_write(SSL *s, int type, const unsigned char *buf, unsigned int len)
1057 1053
1058 /* If we have an alert to send, let's send it */ 1054 /* If we have an alert to send, let's send it */
1059 if (S3I(s)->alert_dispatch) { 1055 if (S3I(s)->alert_dispatch) {
1060 if ((ret = s->method->ssl_dispatch_alert(s)) <= 0) 1056 if ((ret = ssl3_dispatch_alert(s)) <= 0)
1061 return (ret); 1057 return (ret);
1062 /* If it went, fall through and send more stuff. */ 1058 /* If it went, fall through and send more stuff. */
1063 } 1059 }
@@ -1139,38 +1135,6 @@ dtls1_record_bitmap_update(SSL *s, DTLS1_BITMAP *bitmap,
1139 } 1135 }
1140} 1136}
1141 1137
1142int
1143dtls1_dispatch_alert(SSL *s)
1144{
1145 int i, j;
1146 void (*cb)(const SSL *ssl, int type, int val) = NULL;
1147
1148 S3I(s)->alert_dispatch = 0;
1149
1150 i = do_dtls1_write(s, SSL3_RT_ALERT, &S3I(s)->send_alert[0], 2);
1151 if (i <= 0) {
1152 S3I(s)->alert_dispatch = 1;
1153 } else {
1154 if (S3I(s)->send_alert[0] == SSL3_AL_FATAL)
1155 (void)BIO_flush(s->wbio);
1156
1157 if (s->internal->msg_callback)
1158 s->internal->msg_callback(1, s->version, SSL3_RT_ALERT,
1159 S3I(s)->send_alert, 2, s, s->internal->msg_callback_arg);
1160
1161 if (s->internal->info_callback != NULL)
1162 cb = s->internal->info_callback;
1163 else if (s->ctx->internal->info_callback != NULL)
1164 cb = s->ctx->internal->info_callback;
1165
1166 if (cb != NULL) {
1167 j = (S3I(s)->send_alert[0]<<8)|S3I(s)->send_alert[1];
1168 cb(s, SSL_CB_WRITE_ALERT, j);
1169 }
1170 }
1171 return (i);
1172}
1173
1174static DTLS1_BITMAP * 1138static DTLS1_BITMAP *
1175dtls1_get_bitmap(SSL *s, SSL3_RECORD_INTERNAL *rr, unsigned int *is_next_epoch) 1139dtls1_get_bitmap(SSL *s, SSL3_RECORD_INTERNAL *rr, unsigned int *is_next_epoch)
1176{ 1140{