A super trimmed down TLS stack, GPL licensed
Dependents: MiniTLS-HTTPS-Example
MiniTLS - A super trimmed down TLS/SSL Library for embedded devices Author: Donatien Garnier Copyright (C) 2013-2014 AppNearMe Ltd
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Diff: cpp/MiniTLS.cpp
- Revision:
- 3:eb324ffffd2b
- Parent:
- 1:27b41ba7e847
--- a/cpp/MiniTLS.cpp Mon Jun 09 14:57:54 2014 +0000 +++ b/cpp/MiniTLS.cpp Tue Jun 10 14:22:36 2014 +0000 @@ -80,15 +80,17 @@ */ minitls_err_t MiniTLS::addCertificate(const uint8_t* cert, size_t certSize, const uint8_t* pubKey, size_t pubKeySize) { + + minitls_err_t ret; +#if CRYPTO_ECC const crypto_ecc_curve_t* curve; - minitls_err_t ret = crypto_ecc_curve_get(&curve, secp192r1); + ret = crypto_ecc_curve_get(&curve, secp192r1); if(ret) { ERR("Unsupported elliptic curve"); return ret; } -#if CRYPTO_ECC ret = crypto_ecc_ansi_x963_import(&m_cert.public_key.ecc, curve, pubKey, pubKeySize); if(ret) {