ARM Shanghai IoT Team (Internal) / newMiniTLS-GPL

Fork of MiniTLS-GPL by Donatien Garnier

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers minitls.c Source File

minitls.c

Go to the documentation of this file.
00001 /*
00002 MiniTLS - A super trimmed down TLS/SSL Library for embedded devices
00003 Author: Donatien Garnier
00004 Copyright (C) 2013-2014 AppNearMe Ltd
00005 
00006 This program is free software; you can redistribute it and/or
00007 modify it under the terms of the GNU General Public License
00008 as published by the Free Software Foundation; either version 2
00009 of the License, or (at your option) any later version.
00010 
00011 This program is distributed in the hope that it will be useful,
00012 but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014 GNU General Public License for more details.
00015 
00016 You should have received a copy of the GNU General Public License
00017 along with this program; if not, write to the Free Software
00018 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
00019 *//**
00020  * \file minitls.c
00021  * \copyright Copyright (c) AppNearMe Ltd 2013
00022  * \author Donatien Garnier
00023  */
00024 
00025 #include "core/fwk.h"
00026 #include "inc/minitls_errors.h"
00027 
00028 #include "minitls.h"
00029 
00030 /*  This implementation assumes the following:
00031  *
00032  *  Cipher suite: TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA
00033  *  Compression: None
00034  */
00035 
00036 minitls_err_t minitls_init(minitls_t* minitls, crypto_prng_t* prng)
00037 {
00038   minitls->certificate = NULL;
00039   minitls->prng = prng;
00040   return MINITLS_OK;
00041 }
00042 
00043 minitls_err_t minitls_certificate_add(minitls_t* minitls, const tls_x509_certificate_t* cert)
00044 {
00045   minitls->certificate = cert;
00046   return MINITLS_OK;
00047 }