change some parameters in the library to meet the needs of the website httpbin.org
Fork of MiniTLS-GPL by
tls/minitls.c@1:27b41ba7e847, 2014-06-09 (annotated)
- Committer:
- MiniTLS
- Date:
- Mon Jun 09 14:57:32 2014 +0000
- Revision:
- 1:27b41ba7e847
Renamed to MiniTLS and added doc
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
MiniTLS | 1:27b41ba7e847 | 1 | /* |
MiniTLS | 1:27b41ba7e847 | 2 | MiniTLS - A super trimmed down TLS/SSL Library for embedded devices |
MiniTLS | 1:27b41ba7e847 | 3 | Author: Donatien Garnier |
MiniTLS | 1:27b41ba7e847 | 4 | Copyright (C) 2013-2014 AppNearMe Ltd |
MiniTLS | 1:27b41ba7e847 | 5 | |
MiniTLS | 1:27b41ba7e847 | 6 | This program is free software; you can redistribute it and/or |
MiniTLS | 1:27b41ba7e847 | 7 | modify it under the terms of the GNU General Public License |
MiniTLS | 1:27b41ba7e847 | 8 | as published by the Free Software Foundation; either version 2 |
MiniTLS | 1:27b41ba7e847 | 9 | of the License, or (at your option) any later version. |
MiniTLS | 1:27b41ba7e847 | 10 | |
MiniTLS | 1:27b41ba7e847 | 11 | This program is distributed in the hope that it will be useful, |
MiniTLS | 1:27b41ba7e847 | 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
MiniTLS | 1:27b41ba7e847 | 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
MiniTLS | 1:27b41ba7e847 | 14 | GNU General Public License for more details. |
MiniTLS | 1:27b41ba7e847 | 15 | |
MiniTLS | 1:27b41ba7e847 | 16 | You should have received a copy of the GNU General Public License |
MiniTLS | 1:27b41ba7e847 | 17 | along with this program; if not, write to the Free Software |
MiniTLS | 1:27b41ba7e847 | 18 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
MiniTLS | 1:27b41ba7e847 | 19 | *//** |
MiniTLS | 1:27b41ba7e847 | 20 | * \file minitls.c |
MiniTLS | 1:27b41ba7e847 | 21 | * \copyright Copyright (c) AppNearMe Ltd 2013 |
MiniTLS | 1:27b41ba7e847 | 22 | * \author Donatien Garnier |
MiniTLS | 1:27b41ba7e847 | 23 | */ |
MiniTLS | 1:27b41ba7e847 | 24 | |
MiniTLS | 1:27b41ba7e847 | 25 | #include "core/fwk.h" |
MiniTLS | 1:27b41ba7e847 | 26 | #include "inc/minitls_errors.h" |
MiniTLS | 1:27b41ba7e847 | 27 | |
MiniTLS | 1:27b41ba7e847 | 28 | #include "minitls.h" |
MiniTLS | 1:27b41ba7e847 | 29 | |
MiniTLS | 1:27b41ba7e847 | 30 | /* This implementation assumes the following: |
MiniTLS | 1:27b41ba7e847 | 31 | * |
MiniTLS | 1:27b41ba7e847 | 32 | * Cipher suite: TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA |
MiniTLS | 1:27b41ba7e847 | 33 | * Compression: None |
MiniTLS | 1:27b41ba7e847 | 34 | */ |
MiniTLS | 1:27b41ba7e847 | 35 | |
MiniTLS | 1:27b41ba7e847 | 36 | minitls_err_t minitls_init(minitls_t* minitls, crypto_prng_t* prng) |
MiniTLS | 1:27b41ba7e847 | 37 | { |
MiniTLS | 1:27b41ba7e847 | 38 | minitls->certificate = NULL; |
MiniTLS | 1:27b41ba7e847 | 39 | minitls->prng = prng; |
MiniTLS | 1:27b41ba7e847 | 40 | return MINITLS_OK; |
MiniTLS | 1:27b41ba7e847 | 41 | } |
MiniTLS | 1:27b41ba7e847 | 42 | |
MiniTLS | 1:27b41ba7e847 | 43 | minitls_err_t minitls_certificate_add(minitls_t* minitls, const tls_x509_certificate_t* cert) |
MiniTLS | 1:27b41ba7e847 | 44 | { |
MiniTLS | 1:27b41ba7e847 | 45 | minitls->certificate = cert; |
MiniTLS | 1:27b41ba7e847 | 46 | return MINITLS_OK; |
MiniTLS | 1:27b41ba7e847 | 47 | } |