diff options
Diffstat (limited to 'lib/chibios/os/various/wolfssl_bindings/wolfssl_chibios.h')
-rw-r--r-- | lib/chibios/os/various/wolfssl_bindings/wolfssl_chibios.h | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/lib/chibios/os/various/wolfssl_bindings/wolfssl_chibios.h b/lib/chibios/os/various/wolfssl_bindings/wolfssl_chibios.h new file mode 100644 index 000000000..5b29d7c2f --- /dev/null +++ b/lib/chibios/os/various/wolfssl_bindings/wolfssl_chibios.h | |||
@@ -0,0 +1,70 @@ | |||
1 | /* | ||
2 | ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio | ||
3 | |||
4 | Licensed under the Apache License, Version 2.0 (the "License"); | ||
5 | you may not use this file except in compliance with the License. | ||
6 | You may obtain a copy of the License at | ||
7 | |||
8 | http://www.apache.org/licenses/LICENSE-2.0 | ||
9 | |||
10 | Unless required by applicable law or agreed to in writing, software | ||
11 | distributed under the License is distributed on an "AS IS" BASIS, | ||
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
13 | See the License for the specific language governing permissions and | ||
14 | limitations under the License. | ||
15 | */ | ||
16 | /* | ||
17 | * **** This file incorporates work covered by the following copyright and **** | ||
18 | * **** permission notice: **** | ||
19 | * | ||
20 | * Copyright (C) 2006-2017 wolfSSL Inc. | ||
21 | * | ||
22 | * This file is part of wolfSSL. | ||
23 | * | ||
24 | * wolfSSL is free software; you can redistribute it and/or modify | ||
25 | * it under the terms of the GNU General Public License as published by | ||
26 | * the Free Software Foundation; either version 2 of the License, or | ||
27 | * (at your option) any later version. | ||
28 | * | ||
29 | * wolfSSL is distributed in the hope that it will be useful, | ||
30 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
31 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
32 | * GNU General Public License for more details. | ||
33 | * | ||
34 | * You should have received a copy of the GNU General Public License | ||
35 | * along with this program; if not, write to the Free Software | ||
36 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA | ||
37 | * | ||
38 | */ | ||
39 | #ifndef WOLFSSL_SK_H | ||
40 | #define WOLFSSL_SK_H | ||
41 | #include "user_settings.h" | ||
42 | #include "wolfssl/wolfcrypt/settings.h" | ||
43 | #include "wolfssl/wolfcrypt/types.h" | ||
44 | #include "wolfssl/ssl.h" | ||
45 | #include "lwip/opt.h" | ||
46 | #include "lwip/arch.h" | ||
47 | #include "lwip/api.h" | ||
48 | #define XMALLOC(s,h,t) chibios_alloc(h,s) | ||
49 | #define XFREE(p,h,t) chibios_free(p) | ||
50 | |||
51 | struct sslconn { | ||
52 | WOLFSSL_CTX *ctx; | ||
53 | WOLFSSL *ssl; | ||
54 | struct netconn *conn; | ||
55 | }; | ||
56 | |||
57 | typedef struct sslconn sslconn; | ||
58 | |||
59 | sslconn *sslconn_accept(struct sslconn *sk); | ||
60 | sslconn *sslconn_new(enum netconn_type t, WOLFSSL_METHOD *method); | ||
61 | void sslconn_close(sslconn *sk); | ||
62 | |||
63 | int wolfssl_send_cb(WOLFSSL* ssl, char *buf, int sz, void *ctx); | ||
64 | int wolfssl_recv_cb(WOLFSSL *ssl, char *buf, int sz, void *ctx); | ||
65 | |||
66 | void *chibios_alloc(void *heap, int size); | ||
67 | void chibios_free(void *ptr); | ||
68 | word32 LowResTimer(void); | ||
69 | |||
70 | #endif | ||