blob: b821ab317151b223cae647b96309b52df31eb310 [file] [log] [blame]
Adam Langleyd9e397b2015-01-22 14:27:53 -08001/* DTLS implementation written by Nagendra Modadugu
2 * (nagendra@cs.stanford.edu) for the OpenSSL project 2005. */
3/* ====================================================================
4 * Copyright (c) 1998-2005 The OpenSSL Project. All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 *
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 *
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in
15 * the documentation and/or other materials provided with the
16 * distribution.
17 *
18 * 3. All advertising materials mentioning features or use of this
19 * software must display the following acknowledgment:
20 * "This product includes software developed by the OpenSSL Project
21 * for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
22 *
23 * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
24 * endorse or promote products derived from this software without
25 * prior written permission. For written permission, please contact
26 * openssl-core@openssl.org.
27 *
28 * 5. Products derived from this software may not be called "OpenSSL"
29 * nor may "OpenSSL" appear in their names without prior written
30 * permission of the OpenSSL Project.
31 *
32 * 6. Redistributions of any form whatsoever must retain the following
33 * acknowledgment:
34 * "This product includes software developed by the OpenSSL Project
35 * for use in the OpenSSL Toolkit (http://www.openssl.org/)"
36 *
37 * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
38 * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
39 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
40 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
41 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
42 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
43 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
44 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
45 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
46 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
47 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
48 * OF THE POSSIBILITY OF SUCH DAMAGE.
49 * ====================================================================
50 *
51 * This product includes cryptographic software written by Eric Young
52 * (eay@cryptsoft.com). This product includes software written by Tim
53 * Hudson (tjh@cryptsoft.com).
54 *
55 */
56/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
57 * All rights reserved.
58 *
59 * This package is an SSL implementation written
60 * by Eric Young (eay@cryptsoft.com).
61 * The implementation was written so as to conform with Netscapes SSL.
62 *
63 * This library is free for commercial and non-commercial use as long as
64 * the following conditions are aheared to. The following conditions
65 * apply to all code found in this distribution, be it the RC4, RSA,
66 * lhash, DES, etc., code; not just the SSL code. The SSL documentation
67 * included with this distribution is covered by the same copyright terms
68 * except that the holder is Tim Hudson (tjh@cryptsoft.com).
69 *
70 * Copyright remains Eric Young's, and as such any Copyright notices in
71 * the code are not to be removed.
72 * If this package is used in a product, Eric Young should be given attribution
73 * as the author of the parts of the library used.
74 * This can be in the form of a textual message at program startup or
75 * in documentation (online or textual) provided with the package.
76 *
77 * Redistribution and use in source and binary forms, with or without
78 * modification, are permitted provided that the following conditions
79 * are met:
80 * 1. Redistributions of source code must retain the copyright
81 * notice, this list of conditions and the following disclaimer.
82 * 2. Redistributions in binary form must reproduce the above copyright
83 * notice, this list of conditions and the following disclaimer in the
84 * documentation and/or other materials provided with the distribution.
85 * 3. All advertising materials mentioning features or use of this software
86 * must display the following acknowledgement:
87 * "This product includes cryptographic software written by
88 * Eric Young (eay@cryptsoft.com)"
89 * The word 'cryptographic' can be left out if the rouines from the library
90 * being used are not cryptographic related :-).
91 * 4. If you include any Windows specific code (or a derivative thereof) from
92 * the apps directory (application code) you must include an acknowledgement:
93 * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
94 *
95 * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
96 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
97 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
98 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
99 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
100 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
101 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
102 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
103 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
104 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
105 * SUCH DAMAGE.
106 *
107 * The licence and distribution terms for any publically available version or
108 * derivative of this code cannot be changed. i.e. this code cannot simply be
109 * copied and put under another distribution licence
110 * [including the GNU Public Licence.] */
111
Kenny Rootb8494592015-09-25 02:29:14 +0000112#include <openssl/ssl.h>
113
Adam Langleyd9e397b2015-01-22 14:27:53 -0800114#include <assert.h>
Adam Langleye9ada862015-05-11 17:20:37 -0700115#include <string.h>
Adam Langleyd9e397b2015-01-22 14:27:53 -0800116
David Benjamin6e899c72016-06-09 18:02:18 -0400117#include <openssl/bio.h>
Adam Langleyd9e397b2015-01-22 14:27:53 -0800118#include <openssl/buf.h>
David Benjamin6e899c72016-06-09 18:02:18 -0400119#include <openssl/bytestring.h>
Adam Langleyd9e397b2015-01-22 14:27:53 -0800120#include <openssl/mem.h>
121#include <openssl/evp.h>
122#include <openssl/err.h>
123#include <openssl/rand.h>
124
Adam Langleye9ada862015-05-11 17:20:37 -0700125#include "internal.h"
Adam Langleyd9e397b2015-01-22 14:27:53 -0800126
127
David Benjamin6e899c72016-06-09 18:02:18 -0400128int dtls1_get_record(SSL *ssl) {
Kenny Roota04d78d2015-09-25 00:26:37 +0000129again:
David Benjamind316cba2016-06-02 16:17:39 -0400130 switch (ssl->s3->recv_shutdown) {
131 case ssl_shutdown_none:
132 break;
133 case ssl_shutdown_fatal_alert:
134 OPENSSL_PUT_ERROR(SSL, SSL_R_PROTOCOL_IS_SHUTDOWN);
135 return -1;
136 case ssl_shutdown_close_notify:
137 return 0;
138 }
139
Kenny Rootb8494592015-09-25 02:29:14 +0000140 /* Read a new packet if there is no unconsumed one. */
141 if (ssl_read_buffer_len(ssl) == 0) {
David Benjamin6e899c72016-06-09 18:02:18 -0400142 int read_ret = ssl_read_buffer_extend_to(ssl, 0 /* unused */);
143 if (read_ret < 0 && dtls1_is_timer_expired(ssl)) {
144 /* For blocking BIOs, retransmits must be handled internally. */
145 int timeout_ret = DTLSv1_handle_timeout(ssl);
146 if (timeout_ret <= 0) {
147 return timeout_ret;
148 }
149 goto again;
150 }
151 if (read_ret <= 0) {
152 return read_ret;
Kenny Roota04d78d2015-09-25 00:26:37 +0000153 }
Kenny Rootb8494592015-09-25 02:29:14 +0000154 }
155 assert(ssl_read_buffer_len(ssl) > 0);
Kenny Roota04d78d2015-09-25 00:26:37 +0000156
David Benjamin6e899c72016-06-09 18:02:18 -0400157 CBS body;
Kenny Rootb8494592015-09-25 02:29:14 +0000158 uint8_t type, alert;
David Benjamin6e899c72016-06-09 18:02:18 -0400159 size_t consumed;
160 enum ssl_open_record_t open_ret =
161 dtls_open_record(ssl, &type, &body, &consumed, &alert,
162 ssl_read_buffer(ssl), ssl_read_buffer_len(ssl));
163 ssl_read_buffer_consume(ssl, consumed);
164 switch (open_ret) {
165 case ssl_open_record_partial:
166 /* Impossible in DTLS. */
167 break;
Kenny Roota04d78d2015-09-25 00:26:37 +0000168
David Benjamin6e899c72016-06-09 18:02:18 -0400169 case ssl_open_record_success:
170 if (CBS_len(&body) > 0xffff) {
Kenny Rootb8494592015-09-25 02:29:14 +0000171 OPENSSL_PUT_ERROR(SSL, ERR_R_OVERFLOW);
172 return -1;
Kenny Roota04d78d2015-09-25 00:26:37 +0000173 }
Kenny Roota04d78d2015-09-25 00:26:37 +0000174
Kenny Rootb8494592015-09-25 02:29:14 +0000175 SSL3_RECORD *rr = &ssl->s3->rrec;
176 rr->type = type;
David Benjamin6e899c72016-06-09 18:02:18 -0400177 rr->length = (uint16_t)CBS_len(&body);
178 rr->data = (uint8_t *)CBS_data(&body);
Kenny Rootb8494592015-09-25 02:29:14 +0000179 return 1;
180
181 case ssl_open_record_discard:
Kenny Roota04d78d2015-09-25 00:26:37 +0000182 goto again;
Kenny Roota04d78d2015-09-25 00:26:37 +0000183
David Benjamin6e899c72016-06-09 18:02:18 -0400184 case ssl_open_record_close_notify:
185 return 0;
186
187 case ssl_open_record_fatal_alert:
188 return -1;
189
Kenny Rootb8494592015-09-25 02:29:14 +0000190 case ssl_open_record_error:
191 ssl3_send_alert(ssl, SSL3_AL_FATAL, alert);
192 return -1;
Kenny Roota04d78d2015-09-25 00:26:37 +0000193 }
194
Kenny Rootb8494592015-09-25 02:29:14 +0000195 assert(0);
196 OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR);
197 return -1;
Adam Langleyd9e397b2015-01-22 14:27:53 -0800198}
199
Adam Langleyf4e42722015-06-04 17:45:09 -0700200int dtls1_read_app_data(SSL *ssl, uint8_t *buf, int len, int peek) {
David Benjamin4969cc92016-04-22 15:02:23 -0400201 assert(!SSL_in_init(ssl));
Adam Langleyf4e42722015-06-04 17:45:09 -0700202
David Benjamin6e899c72016-06-09 18:02:18 -0400203 SSL3_RECORD *rr = &ssl->s3->rrec;
Adam Langley4139edb2016-01-13 15:00:54 -0800204
David Benjamin6e899c72016-06-09 18:02:18 -0400205again:
Kenny Rootb8494592015-09-25 02:29:14 +0000206 if (rr->length == 0) {
David Benjamin6e899c72016-06-09 18:02:18 -0400207 int ret = dtls1_get_record(ssl);
Adam Langleyd9e397b2015-01-22 14:27:53 -0800208 if (ret <= 0) {
David Benjamin6e899c72016-06-09 18:02:18 -0400209 return ret;
Adam Langleyd9e397b2015-01-22 14:27:53 -0800210 }
211 }
212
Adam Langley4139edb2016-01-13 15:00:54 -0800213 if (rr->type == SSL3_RT_HANDSHAKE) {
Adam Langley4139edb2016-01-13 15:00:54 -0800214 /* Parse the first fragment header to determine if this is a pre-CCS or
215 * post-CCS handshake record. DTLS resets handshake message numbers on each
216 * handshake, so renegotiations and retransmissions are ambiguous. */
David Benjamin6e899c72016-06-09 18:02:18 -0400217 CBS cbs, body;
Adam Langleyd9e397b2015-01-22 14:27:53 -0800218 struct hm_header_st msg_hdr;
David Benjamin6e899c72016-06-09 18:02:18 -0400219 CBS_init(&cbs, rr->data, rr->length);
220 if (!dtls1_parse_fragment(&cbs, &msg_hdr, &body)) {
221 ssl3_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR);
222 OPENSSL_PUT_ERROR(SSL, SSL_R_BAD_HANDSHAKE_RECORD);
223 return -1;
224 }
Adam Langleyd9e397b2015-01-22 14:27:53 -0800225
Adam Langleyd9e397b2015-01-22 14:27:53 -0800226 if (msg_hdr.type == SSL3_MT_FINISHED) {
Adam Langleye9ada862015-05-11 17:20:37 -0700227 if (msg_hdr.frag_off == 0) {
228 /* Retransmit our last flight of messages. If the peer sends the second
229 * Finished, they may not have received ours. Only do this for the
230 * first fragment, in case the Finished was fragmented. */
Adam Langley4139edb2016-01-13 15:00:54 -0800231 if (dtls1_check_timeout_num(ssl) < 0) {
Adam Langleye9ada862015-05-11 17:20:37 -0700232 return -1;
233 }
234
Adam Langley4139edb2016-01-13 15:00:54 -0800235 dtls1_retransmit_buffered_messages(ssl);
Adam Langleyd9e397b2015-01-22 14:27:53 -0800236 }
237
Adam Langleyd9e397b2015-01-22 14:27:53 -0800238 rr->length = 0;
David Benjamin6e899c72016-06-09 18:02:18 -0400239 goto again;
Adam Langleyd9e397b2015-01-22 14:27:53 -0800240 }
Adam Langleyd9e397b2015-01-22 14:27:53 -0800241
Adam Langley4139edb2016-01-13 15:00:54 -0800242 /* Otherwise, this is a pre-CCS handshake message from an unsupported
243 * renegotiation attempt. Fall through to the error path. */
244 }
Adam Langleyd9e397b2015-01-22 14:27:53 -0800245
David Benjamin6e899c72016-06-09 18:02:18 -0400246 if (rr->type != SSL3_RT_APPLICATION_DATA) {
247 ssl3_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_UNEXPECTED_MESSAGE);
248 OPENSSL_PUT_ERROR(SSL, SSL_R_UNEXPECTED_RECORD);
249 return -1;
250 }
Adam Langleyd9e397b2015-01-22 14:27:53 -0800251
David Benjamin6e899c72016-06-09 18:02:18 -0400252 /* Discard empty records. */
253 if (rr->length == 0) {
254 goto again;
255 }
256
257 if (len <= 0) {
258 return len;
259 }
260
261 if ((unsigned)len > rr->length) {
262 len = rr->length;
263 }
264
265 memcpy(buf, rr->data, len);
266 if (!peek) {
267 /* TODO(davidben): Should the record be truncated instead? This is a
268 * datagram transport. See https://crbug.com/boringssl/65. */
269 rr->length -= len;
270 rr->data += len;
271 if (rr->length == 0) {
272 /* The record has been consumed, so we may now clear the buffer. */
273 ssl_read_buffer_discard(ssl);
274 }
275 }
276
277 return len;
278}
279
280int dtls1_read_change_cipher_spec(SSL *ssl) {
281 SSL3_RECORD *rr = &ssl->s3->rrec;
282
283again:
284 if (rr->length == 0) {
285 int ret = dtls1_get_record(ssl);
286 if (ret <= 0) {
287 return ret;
288 }
289 }
290
291 /* Drop handshake records silently. The epochs match, so this must be a
292 * retransmit of a message we already received. */
293 if (rr->type == SSL3_RT_HANDSHAKE) {
294 rr->length = 0;
295 goto again;
296 }
297
298 /* Other record types are illegal in this epoch. Note all application data
299 * records come in the encrypted epoch. */
300 if (rr->type != SSL3_RT_CHANGE_CIPHER_SPEC) {
301 ssl3_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_UNEXPECTED_MESSAGE);
302 OPENSSL_PUT_ERROR(SSL, SSL_R_UNEXPECTED_RECORD);
303 return -1;
304 }
305
306 if (rr->length != 1 || rr->data[0] != SSL3_MT_CCS) {
307 OPENSSL_PUT_ERROR(SSL, SSL_R_BAD_CHANGE_CIPHER_SPEC);
308 ssl3_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_ILLEGAL_PARAMETER);
309 return -1;
310 }
311
312 ssl_do_msg_callback(ssl, 0 /* read */, ssl->version,
313 SSL3_RT_CHANGE_CIPHER_SPEC, rr->data, rr->length);
314
315 rr->length = 0;
316 ssl_read_buffer_discard(ssl);
317 return 1;
318}
319
320void dtls1_read_close_notify(SSL *ssl) {
321 /* Bidirectional shutdown doesn't make sense for an unordered transport. DTLS
322 * alerts also aren't delivered reliably, so we may even time out because the
323 * peer never received our close_notify. Report to the caller that the channel
324 * has fully shut down. */
325 if (ssl->s3->recv_shutdown == ssl_shutdown_none) {
326 ssl->s3->recv_shutdown = ssl_shutdown_close_notify;
327 }
Adam Langleyd9e397b2015-01-22 14:27:53 -0800328}
329
Adam Langley4139edb2016-01-13 15:00:54 -0800330int dtls1_write_app_data(SSL *ssl, const void *buf_, int len) {
David Benjamin4969cc92016-04-22 15:02:23 -0400331 assert(!SSL_in_init(ssl));
Adam Langleyd9e397b2015-01-22 14:27:53 -0800332
333 if (len > SSL3_RT_MAX_PLAIN_LENGTH) {
Kenny Rootb8494592015-09-25 02:29:14 +0000334 OPENSSL_PUT_ERROR(SSL, SSL_R_DTLS_MESSAGE_TOO_BIG);
Adam Langleyd9e397b2015-01-22 14:27:53 -0800335 return -1;
336 }
337
David Benjamin6e899c72016-06-09 18:02:18 -0400338 if (len < 0) {
339 OPENSSL_PUT_ERROR(SSL, SSL_R_BAD_LENGTH);
340 return -1;
341 }
342
343 if (len == 0) {
344 return 0;
345 }
346
347 int ret = dtls1_write_record(ssl, SSL3_RT_APPLICATION_DATA, buf_, (size_t)len,
348 dtls1_use_current_epoch);
349 if (ret <= 0) {
350 return ret;
351 }
352 return len;
Adam Langleyd9e397b2015-01-22 14:27:53 -0800353}
354
David Benjamin6e899c72016-06-09 18:02:18 -0400355int dtls1_write_record(SSL *ssl, int type, const uint8_t *buf, size_t len,
356 enum dtls1_use_epoch_t use_epoch) {
Adam Langleyd9e397b2015-01-22 14:27:53 -0800357 assert(len <= SSL3_RT_MAX_PLAIN_LENGTH);
Adam Langleyfad63272015-11-12 12:15:39 -0800358 /* There should never be a pending write buffer in DTLS. One can't write half
359 * a datagram, so the write buffer is always dropped in
360 * |ssl_write_buffer_flush|. */
Adam Langley4139edb2016-01-13 15:00:54 -0800361 assert(!ssl_write_buffer_is_pending(ssl));
Adam Langleyd9e397b2015-01-22 14:27:53 -0800362
363 /* If we have an alert to send, lets send it */
Adam Langley4139edb2016-01-13 15:00:54 -0800364 if (ssl->s3->alert_dispatch) {
365 int ret = ssl->method->ssl_dispatch_alert(ssl);
Adam Langleyf4e42722015-06-04 17:45:09 -0700366 if (ret <= 0) {
367 return ret;
Adam Langleyd9e397b2015-01-22 14:27:53 -0800368 }
369 /* if it went, fall through and send more stuff */
370 }
371
Kenny Rootb8494592015-09-25 02:29:14 +0000372 if (len > SSL3_RT_MAX_PLAIN_LENGTH) {
373 OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR);
Adam Langleyf4e42722015-06-04 17:45:09 -0700374 return -1;
375 }
376
Adam Langley4139edb2016-01-13 15:00:54 -0800377 size_t max_out = len + ssl_max_seal_overhead(ssl);
Kenny Rootb8494592015-09-25 02:29:14 +0000378 uint8_t *out;
Adam Langleyf4e42722015-06-04 17:45:09 -0700379 size_t ciphertext_len;
Adam Langley4139edb2016-01-13 15:00:54 -0800380 if (!ssl_write_buffer_init(ssl, &out, max_out) ||
381 !dtls_seal_record(ssl, out, &ciphertext_len, max_out, type, buf, len,
Kenny Rootb8494592015-09-25 02:29:14 +0000382 use_epoch)) {
Adam Langley4139edb2016-01-13 15:00:54 -0800383 ssl_write_buffer_clear(ssl);
Adam Langleye9ada862015-05-11 17:20:37 -0700384 return -1;
385 }
Adam Langley4139edb2016-01-13 15:00:54 -0800386 ssl_write_buffer_set_len(ssl, ciphertext_len);
Adam Langleyd9e397b2015-01-22 14:27:53 -0800387
Adam Langley4139edb2016-01-13 15:00:54 -0800388 int ret = ssl_write_buffer_flush(ssl);
Adam Langleyfad63272015-11-12 12:15:39 -0800389 if (ret <= 0) {
390 return ret;
391 }
David Benjamin6e899c72016-06-09 18:02:18 -0400392 return 1;
Adam Langleyd9e397b2015-01-22 14:27:53 -0800393}
394
Adam Langley4139edb2016-01-13 15:00:54 -0800395int dtls1_dispatch_alert(SSL *ssl) {
Adam Langley4139edb2016-01-13 15:00:54 -0800396 ssl->s3->alert_dispatch = 0;
David Benjamin6e899c72016-06-09 18:02:18 -0400397 int ret = dtls1_write_record(ssl, SSL3_RT_ALERT, &ssl->s3->send_alert[0], 2,
398 dtls1_use_current_epoch);
David Benjamin4969cc92016-04-22 15:02:23 -0400399 if (ret <= 0) {
Adam Langley4139edb2016-01-13 15:00:54 -0800400 ssl->s3->alert_dispatch = 1;
David Benjamin4969cc92016-04-22 15:02:23 -0400401 return ret;
Adam Langleyd9e397b2015-01-22 14:27:53 -0800402 }
403
David Benjamin4969cc92016-04-22 15:02:23 -0400404 /* If the alert is fatal, flush the BIO now. */
405 if (ssl->s3->send_alert[0] == SSL3_AL_FATAL) {
406 BIO_flush(ssl->wbio);
407 }
408
David Benjamin6e899c72016-06-09 18:02:18 -0400409 ssl_do_msg_callback(ssl, 1 /* write */, ssl->version, SSL3_RT_ALERT,
410 ssl->s3->send_alert, 2);
David Benjamin4969cc92016-04-22 15:02:23 -0400411
David Benjamin6e899c72016-06-09 18:02:18 -0400412 int alert = (ssl->s3->send_alert[0] << 8) | ssl->s3->send_alert[1];
413 ssl_do_info_callback(ssl, SSL_CB_WRITE_ALERT, alert);
David Benjamin4969cc92016-04-22 15:02:23 -0400414
415 return 1;
Adam Langleyd9e397b2015-01-22 14:27:53 -0800416}