A library for setting up Secure Socket Layer (SSL) connections and verifying remote hosts using certificates. Contains only the source files for mbed platform implementation of the library.

Dependents:   HTTPClient-SSL HTTPClient-SSL HTTPClient-SSL HTTPClient-SSL

Committer:
Vanger
Date:
Mon Jan 19 21:45:42 2015 +0000
Revision:
0:b86d15c6ba29
Updated CyaSSL Library to 3.3.0. Changed Settings and functions to be implemented for mbed platforms

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Vanger 0:b86d15c6ba29 1 /* hmac.h
Vanger 0:b86d15c6ba29 2 *
Vanger 0:b86d15c6ba29 3 * Copyright (C) 2013 wolfSSL Inc.
Vanger 0:b86d15c6ba29 4 *
Vanger 0:b86d15c6ba29 5 * This file is part of CyaSSL.
Vanger 0:b86d15c6ba29 6 *
Vanger 0:b86d15c6ba29 7 * CyaSSL is free software; you can redistribute it and/or modify
Vanger 0:b86d15c6ba29 8 * it under the terms of the GNU General Public License as published by
Vanger 0:b86d15c6ba29 9 * the Free Software Foundation; either version 2 of the License, or
Vanger 0:b86d15c6ba29 10 * (at your option) any later version.
Vanger 0:b86d15c6ba29 11 *
Vanger 0:b86d15c6ba29 12 * CyaSSL is distributed in the hope that it will be useful,
Vanger 0:b86d15c6ba29 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Vanger 0:b86d15c6ba29 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Vanger 0:b86d15c6ba29 15 * GNU General Public License for more details.
Vanger 0:b86d15c6ba29 16 *
Vanger 0:b86d15c6ba29 17 * You should have received a copy of the GNU General Public License
Vanger 0:b86d15c6ba29 18 * along with this program; if not, write to the Free Software
Vanger 0:b86d15c6ba29 19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
Vanger 0:b86d15c6ba29 20 */
Vanger 0:b86d15c6ba29 21
Vanger 0:b86d15c6ba29 22
Vanger 0:b86d15c6ba29 23 /* hmac.h defines mini hamc openssl compatibility layer
Vanger 0:b86d15c6ba29 24 *
Vanger 0:b86d15c6ba29 25 */
Vanger 0:b86d15c6ba29 26
Vanger 0:b86d15c6ba29 27
Vanger 0:b86d15c6ba29 28 #ifndef CYASSL_HMAC_H_
Vanger 0:b86d15c6ba29 29 #define CYASSL_HMAC_H_
Vanger 0:b86d15c6ba29 30
Vanger 0:b86d15c6ba29 31 #include <cyassl/ctaocrypt/settings.h>
Vanger 0:b86d15c6ba29 32
Vanger 0:b86d15c6ba29 33 #ifdef YASSL_PREFIX
Vanger 0:b86d15c6ba29 34 #include "prefix_hmac.h"
Vanger 0:b86d15c6ba29 35 #endif
Vanger 0:b86d15c6ba29 36
Vanger 0:b86d15c6ba29 37 #include <cyassl/openssl/evp.h>
Vanger 0:b86d15c6ba29 38 #include <cyassl/ctaocrypt/hmac.h>
Vanger 0:b86d15c6ba29 39
Vanger 0:b86d15c6ba29 40 #ifdef __cplusplus
Vanger 0:b86d15c6ba29 41 extern "C" {
Vanger 0:b86d15c6ba29 42 #endif
Vanger 0:b86d15c6ba29 43
Vanger 0:b86d15c6ba29 44
Vanger 0:b86d15c6ba29 45 CYASSL_API unsigned char* CyaSSL_HMAC(const CYASSL_EVP_MD* evp_md,
Vanger 0:b86d15c6ba29 46 const void* key, int key_len,
Vanger 0:b86d15c6ba29 47 const unsigned char* d, int n, unsigned char* md,
Vanger 0:b86d15c6ba29 48 unsigned int* md_len);
Vanger 0:b86d15c6ba29 49
Vanger 0:b86d15c6ba29 50
Vanger 0:b86d15c6ba29 51 typedef struct CYASSL_HMAC_CTX {
Vanger 0:b86d15c6ba29 52 Hmac hmac;
Vanger 0:b86d15c6ba29 53 int type;
Vanger 0:b86d15c6ba29 54 } CYASSL_HMAC_CTX;
Vanger 0:b86d15c6ba29 55
Vanger 0:b86d15c6ba29 56
Vanger 0:b86d15c6ba29 57 CYASSL_API void CyaSSL_HMAC_Init(CYASSL_HMAC_CTX* ctx, const void* key,
Vanger 0:b86d15c6ba29 58 int keylen, const EVP_MD* type);
Vanger 0:b86d15c6ba29 59 CYASSL_API void CyaSSL_HMAC_Update(CYASSL_HMAC_CTX* ctx,
Vanger 0:b86d15c6ba29 60 const unsigned char* data, int len);
Vanger 0:b86d15c6ba29 61 CYASSL_API void CyaSSL_HMAC_Final(CYASSL_HMAC_CTX* ctx, unsigned char* hash,
Vanger 0:b86d15c6ba29 62 unsigned int* len);
Vanger 0:b86d15c6ba29 63 CYASSL_API void CyaSSL_HMAC_cleanup(CYASSL_HMAC_CTX* ctx);
Vanger 0:b86d15c6ba29 64
Vanger 0:b86d15c6ba29 65
Vanger 0:b86d15c6ba29 66 typedef struct CYASSL_HMAC_CTX HMAC_CTX;
Vanger 0:b86d15c6ba29 67
Vanger 0:b86d15c6ba29 68 #define HMAC(a,b,c,d,e,f,g) CyaSSL_HMAC((a),(b),(c),(d),(e),(f),(g))
Vanger 0:b86d15c6ba29 69
Vanger 0:b86d15c6ba29 70 #define HMAC_Init CyaSSL_HMAC_Init
Vanger 0:b86d15c6ba29 71 #define HMAC_Update CyaSSL_HMAC_Update
Vanger 0:b86d15c6ba29 72 #define HMAC_Final CyaSSL_HMAC_Final
Vanger 0:b86d15c6ba29 73 #define HMAC_cleanup CyaSSL_HMAC_cleanup
Vanger 0:b86d15c6ba29 74
Vanger 0:b86d15c6ba29 75
Vanger 0:b86d15c6ba29 76 #ifdef __cplusplus
Vanger 0:b86d15c6ba29 77 } /* extern "C" */
Vanger 0:b86d15c6ba29 78 #endif
Vanger 0:b86d15c6ba29 79
Vanger 0:b86d15c6ba29 80
Vanger 0:b86d15c6ba29 81 #endif /* CYASSL_HMAC_H_ */