This commit is contained in:
Jacob Barthelmeh 2014-12-18 11:11:09 -07:00
commit d7a3585a96
5 changed files with 344 additions and 334 deletions

View File

@ -1,15 +1,15 @@
/* cyassl.h
/* ssl.h
*
* Copyright (C) 2006-2014 wolfSSL Inc.
*
* This file is part of CyaSSL.
* This file is part of wolfSSL. (formerly known as CyaSSL)
*
* CyaSSL is free software; you can redistribute it and/or modify
* wolfSSL 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.
*
* CyaSSL is distributed in the hope that it will be useful,
* wolfSSL 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.
@ -21,7 +21,7 @@
/*
* cyassl.h defines cyassl compatibility layer
* ssl.h makes wolfssl backwards compatibile with cyassl
*/
@ -42,7 +42,8 @@
/* wincrypt.h clashes */
#undef X509_NAME
#endif
#define CYASSL WOLFSSL
#define CYASSL WOLFSSL
#define CYASSL_SESSION WOLFSSL_SESSION
#define CYASSL_METHOD WOLFSSL_METHOD
#define CYASSL_CTX WOLFSSL_CTX
@ -54,13 +55,13 @@
/* redeclare guard */
#define CYASSL_TYPES_DEFINED WOLFSSL_TYPES_DEFINED
/* structs */
/* cyassl/ssl.h (structs) */
#define CYASSL_EVP_PKEY WOLFSSL_EVP_PKEY
#define CYASSL_RSA WOLFSSL_RSA
#define CYASSL_DSA WOLFSSL_DSA
#define CYASSL_BIO WOLFSSL_BIO
#define CYASSL_BIO_METHOD WOLFSSL_BIO_METHOD
#define CYASSL_CIPHER WOLFSSL_SSL_CIPHER
#define CYASSL_CIPHER WOLFSSL_CIPHER
#define CYASSL_X509_LOOKUP WOLFSSL_X509_LOOKUP
#define CYASSL_X509_CRL WOLFSSL_X509_CRL
#define CYASSL_X509_EXTENSION WOLFSSL_X509_EXTENSION
@ -81,26 +82,36 @@
#define CYASSL_X509_STORE_CTX WOLFSSL_X509_STORE_CTX
/* src/ssl.c */
#define CYASSL_CLIENT_END WOLFSSL_CLIENT_END
#define CYASSL_CERT_MANAGER WOLFSSL_CERT_MANAGER
#define CYASSL_USER_CA WOLFSSL_USER_CA
#define CYASSL_TLSV1 WOLFSSL_TLSV1
#define CYASSL_TLSV1_1 WOLFSSL_TLSV1_1
#define CYASSL_TLSV1_2 WOLFSSL_TLSV1_2
#define CYASSL_SSLV3 WOLFSSL_SSLV3
#define CyaSSL_session_reused wolfSSL_session_reused
#define CyaSSL_get_version wolfSSL_get_version
#define CyaSSL_get_shutdown wolfSSL_get_shutdown
#define CyaSSL_is_init_finished wolfSSL_is_init_finished
#define CyaSSL_CTX_UnloadCAs wolfSSL_CTX_UnloadCAs
#define CyaSSL_UnloadCertsKeys wolfSSL_UnloadCertsKeys
#define CyaSSL_SetServerID wolfSSL_SetServerID
#define CyaSSL_SetCertCbCtx wolfSSL_SetCertCbCtx
#define CyaSSL_CTX_check_private_key wolfSSL_CTX_check_private_key
#define CyaSSL_get_current_cipher_suite wolfSSL_get_current_cipher_suite
#define CyaSSL_get_cipher wolfSSL_get_cipher
#define CyaSSL_CIPHER_get_name wolfSSL_CIPHER_get_name
#define CyaSSL_get_current_cipher wolfSSL_get_current_cipher
#define CYASSL_CLIENT_END WOLFSSL_CLIENT_END
#define CYASSL_CERT_MANAGER WOLFSSL_CERT_MANAGER
#define CYASSL_USER_CA WOLFSSL_USER_CA
#define CYASSL_TLSV1 WOLFSSL_TLSV1
#define CYASSL_TLSV1_1 WOLFSSL_TLSV1_1
#define CYASSL_TLSV1_2 WOLFSSL_TLSV1_2
#define CYASSL_SSLV3 WOLFSSL_SSLV3
#define CyaSSL_session_reused wolfSSL_session_reused
#define CyaSSL_get_version wolfSSL_get_version
#define CyaSSL_get_shutdown wolfSSL_get_shutdown
#define CyaSSL_is_init_finished wolfSSL_is_init_finished
#define CyaSSL_CTX_UnloadCAs wolfSSL_CTX_UnloadCAs
#define CyaSSL_UnloadCertsKeys wolfSSL_UnloadCertsKeys
#define CyaSSL_SetServerID wolfSSL_SetServerID
#define CyaSSL_SetCertCbCtx wolfSSL_SetCertCbCtx
#define CyaSSL_CTX_check_private_key wolfSSL_CTX_check_private_key
#define CyaSSL_get_current_cipher_suite wolfSSL_get_current_cipher_suite
#define CyaSSL_get_cipher wolfSSL_get_cipher
#define CyaSSL_CIPHER_get_name wolfSSL_CIPHER_get_name
#define CyaSSL_get_current_cipher wolfSSL_get_current_cipher
#define CyaSSL_CTX_load_verify_locations wolfSSL_CTX_load_verify_locations
#define CyaSSL_CertManagerDisableOCSP wolfSSL_CertManagerDisableOCSP
#define CyaSSL_CertManagerEnableOCSP wolfSSL_CertManagerEnableOCSP
#define CyaSSL_SetMinVersion wolfSSL_SetMinVersion
#define CyaSSL_KeyPemToDer wolfSSL_KeyPemToDer
#define CyaSSL_CertPemToDer wolfSSL_CertPemToDer
#define CyaSSL_CertManagerUnloadCAs wolfSSL_CertManagerUnloadCAs
#define CyaSSL_get_alert_history wolfSSL_get_alert_history
#define CyaSSL_get_ciphers wolfSSL_get_ciphers
/* io.c */
#define CYASSL_CBIO_ERR_CONN_CLOSE WOLFSSL_CBIO_ERR_CONN_CLOSE
@ -128,6 +139,7 @@
/* Initialization and Shutdown */
#define CyaSSL_Init wolfSSL_Init
#define CyaSSL_library_init wolfSSL_library_init

File diff suppressed because it is too large Load Diff

View File

@ -2,7 +2,7 @@
*
* Copyright (C) 2006-2014 wolfSSL Inc.
*
* This file is part of wolfSSL.
* This file is part of wolfSSL. (formerly known as CyaSSL)
*
* wolfSSL is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View File

@ -2,14 +2,14 @@
*
* Copyright (C) 2006-2014 wolfSSL Inc.
*
* This file is part of CyaSSL.
* This file is part of wolfSSL.
*
* CyaSSL is free software; you can redistribute it and/or modify
* wolfSSL 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.
*
* CyaSSL is distributed in the hope that it will be useful,
* wolfSSL 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.
@ -38,7 +38,7 @@ typedef void *(*wolfSSL_Realloc_cb)(void *ptr, size_t size);
/* Public set function */
WOLFSSL_API int CyaSSL_SetAllocators(wolfSSL_Malloc_cb malloc_function,
WOLFSSL_API int wolfSSL_SetAllocators(wolfSSL_Malloc_cb malloc_function,
wolfSSL_Free_cb free_function,
wolfSSL_Realloc_cb realloc_function);
@ -52,4 +52,4 @@ WOLFSSL_API void* wolfSSL_Realloc(void *ptr, size_t size);
}
#endif
#endif /* CYASSL_MEMORY_H */
#endif /* WOLFSSL_MEMORY_H */

View File

@ -19,15 +19,14 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef WOLF_CRYPT_TYPES_H
#if !defined(WOLF_CRYPT_TYPES_H && CTAO_CRYPT_TYPES_H)
#define WOLF_CRYPT_TYPES_H
#include <wolfssl/wolfcrypt/settings.h>
#include <wolfssl/wolfcrypt/wc_port.h>
/* wolfssl_cyassl compatibility layer */
#include <cyassl/ssl.h>
/* wolfssl_wolfssl compatibility layer */
#include <wolfssl/ssl.h>
#ifdef __cplusplus
extern "C" {
@ -42,7 +41,7 @@
#define LITTLE_ENDIAN_ORDER
#endif
#ifndef CYASSL_TYPES
#ifndef WOLFSSL_TYPES
#ifndef byte
typedef unsigned char byte;
#endif
@ -91,9 +90,9 @@
/* These platforms have 64-bit CPU registers. */
#if (defined(__alpha__) || defined(__ia64__) || defined(_ARCH_PPC64) || \
defined(__mips64) || defined(__x86_64__) || defined(_M_X64))
typedef word64 cyassl_word;
typedef word64 wolfssl_word;
#else
typedef word32 cyassl_word;
typedef word32 wolfssl_word;
#ifdef WORD64_AVAILABLE
#define WOLFCRYPT_SLOW_WORD64
#endif
@ -101,7 +100,7 @@
enum {
WOLFSSL_WORD_SIZE = sizeof(cyassl_word),
WOLFSSL_WORD_SIZE = sizeof(wolfssl_word),
WOLFSSL_BIT_SIZE = 8,
WOLFSSL_WORD_BITS = WOLFSSL_WORD_SIZE * WOLFSSL_BIT_SIZE
};
@ -181,7 +180,7 @@ enum {
&& !defined(WOLFSSL_SAFERTOS) && !defined(FREESCALE_MQX) \
&& !defined(WOLFSSL_LEANPSK)
/* default C runtime, can install different routines at runtime via cbs */
#include <cyassl/ctaocrypt/memory.h>
#include <wolfssl/wolfcrypt/memory.h>
#define XMALLOC(s, h, t) ((void)h, (void)t, wolfSSL_Malloc((s)))
#define XFREE(p, h, t) {void* xp = (p); if((xp)) wolfSSL_Free((xp));}
#define XREALLOC(p, n, h, t) wolfSSL_Realloc((p), (n))
@ -230,6 +229,7 @@ enum {
/* memory allocation types for user hints */
enum {
DYNAMIC_TYPE_CA = 1,
DYNAMIC_TYPE_CERT = 2,
@ -326,6 +326,4 @@ WOLFSSL_API word32 CheckRunTimeSettings(void);
} /* extern "C" */
#endif
#endif /* WOLF_CRYPT_TYPES_H */