forked from wolfSSL/wolfssl
auto-tools and wc_ updates
This commit is contained in:
10
configure.ac
10
configure.ac
@ -317,8 +317,8 @@ fi
|
|||||||
ENABLED_SNIFFTEST=no
|
ENABLED_SNIFFTEST=no
|
||||||
AC_ARG_ENABLE([sniffer],
|
AC_ARG_ENABLE([sniffer],
|
||||||
[AS_HELP_STRING([--enable-sniffer],[ Enable CyaSSL sniffer support (default: disabled) ])],[
|
[AS_HELP_STRING([--enable-sniffer],[ Enable CyaSSL sniffer support (default: disabled) ])],[
|
||||||
ENABLED_SNIFFER=yes
|
ENABLED_SNIFFER=yes
|
||||||
AM_CFLAGS="$AM_CFLAGS -DCYASSL_SNIFFER -DOPENSSL_EXTRA"
|
AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SNIFFER -DOPENSSL_EXTRA"
|
||||||
AS_IF([ test "x$enableval" = "xyes" ],[ AC_CHECK_HEADERS([pcap/pcap.h],[
|
AS_IF([ test "x$enableval" = "xyes" ],[ AC_CHECK_HEADERS([pcap/pcap.h],[
|
||||||
ENABLED_SNIFFTEST=yes
|
ENABLED_SNIFFTEST=yes
|
||||||
],[ AC_MSG_WARN([cannot enable sniffer test without having libpcap available.]) ]) ])
|
],[ AC_MSG_WARN([cannot enable sniffer test without having libpcap available.]) ]) ])
|
||||||
@ -1446,12 +1446,12 @@ then
|
|||||||
if test "x$ENABLED_CERTGEN" = "xno"
|
if test "x$ENABLED_CERTGEN" = "xno"
|
||||||
then
|
then
|
||||||
ENABLED_CERTGEN="yes"
|
ENABLED_CERTGEN="yes"
|
||||||
AM_CFLAGS="$AM_CFLAGS -DCYASSL_CERT_GEN"
|
AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_CERT_GEN"
|
||||||
fi
|
fi
|
||||||
if test "x$ENABLED_CERTREQ" = "xno"
|
if test "x$ENABLED_CERTREQ" = "xno"
|
||||||
then
|
then
|
||||||
ENABLED_CERTREQ="yes"
|
ENABLED_CERTREQ="yes"
|
||||||
AM_CFLAGS="$AM_CFLAGS -DCYASSL_CERT_REQ"
|
AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_CERT_REQ"
|
||||||
fi
|
fi
|
||||||
if test "x$ENABLED_PKCS7" = "xno"
|
if test "x$ENABLED_PKCS7" = "xno"
|
||||||
then
|
then
|
||||||
@ -1459,7 +1459,7 @@ then
|
|||||||
AM_CFLAGS="$AM_CFLAGS -DHAVE_PKCS7"
|
AM_CFLAGS="$AM_CFLAGS -DHAVE_PKCS7"
|
||||||
AM_CONDITIONAL([BUILD_PKCS7], [test "x$ENABLED_PKCS7" = "xyes"])
|
AM_CONDITIONAL([BUILD_PKCS7], [test "x$ENABLED_PKCS7" = "xyes"])
|
||||||
fi
|
fi
|
||||||
AM_CFLAGS="$AM_CFLAGS -DCYASSL_HAVE_WOLFSCEP"
|
AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_HAVE_WOLFSCEP"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
37
cyassl/ssl.h
37
cyassl/ssl.h
@ -19,12 +19,10 @@
|
|||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* ssl.h makes wolfssl backwards compatibile with cyassl
|
* ssl.h makes wolfssl backwards compatibile with cyassl
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifndef WOLFSSL_CYASSL_H_
|
#ifndef WOLFSSL_CYASSL_H_
|
||||||
#define WOLFSSL_CYASSL_H_
|
#define WOLFSSL_CYASSL_H_
|
||||||
/*
|
/*
|
||||||
@ -47,8 +45,6 @@
|
|||||||
#define CYASSL_METHOD WOLFSSL_METHOD
|
#define CYASSL_METHOD WOLFSSL_METHOD
|
||||||
#define CYASSL_SESSION WOLFSSL_SESSION
|
#define CYASSL_SESSION WOLFSSL_SESSION
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#define CYASSL_X509 WOLFSSL_X509
|
#define CYASSL_X509 WOLFSSL_X509
|
||||||
#define CYASSL_X509_NAME WOLFSSL_X509_NAME
|
#define CYASSL_X509_NAME WOLFSSL_X509_NAME
|
||||||
#define CYASSL_X509_CHAIN WOLFSSL_X509_CHAIN
|
#define CYASSL_X509_CHAIN WOLFSSL_X509_CHAIN
|
||||||
@ -86,7 +82,7 @@
|
|||||||
|
|
||||||
/* cyassl/test.h */
|
/* cyassl/test.h */
|
||||||
#ifdef CyaSSL_TEST_H
|
#ifdef CyaSSL_TEST_H
|
||||||
#define CYASSL_THREAD WOLFSSL_THREAD
|
#define CYASSL_THREAD WOLFSSL_THREAD
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* src/ssl.c */
|
/* src/ssl.c */
|
||||||
@ -105,6 +101,7 @@
|
|||||||
#define CyaSSL_KeyPemToDer wolfSSL_KeyPemToDer
|
#define CyaSSL_KeyPemToDer wolfSSL_KeyPemToDer
|
||||||
#define CyaSSL_get_version wolfSSL_get_version
|
#define CyaSSL_get_version wolfSSL_get_version
|
||||||
#define CyaSSL_SetServerID wolfSSL_SetServerID
|
#define CyaSSL_SetServerID wolfSSL_SetServerID
|
||||||
|
#define CyaSSL_use_old_poly wolfSSL_use_old_poly
|
||||||
#define CyaSSL_SetCertCbCtx wolfSSL_SetCertCbCtx
|
#define CyaSSL_SetCertCbCtx wolfSSL_SetCertCbCtx
|
||||||
#define CyaSSL_CertPemToDer wolfSSL_CertPemToDer
|
#define CyaSSL_CertPemToDer wolfSSL_CertPemToDer
|
||||||
#define CyaSSL_get_shutdown wolfSSL_get_shutdown
|
#define CyaSSL_get_shutdown wolfSSL_get_shutdown
|
||||||
@ -124,8 +121,6 @@
|
|||||||
#define CyaSSL_CTX_load_verify_locations wolfSSL_CTX_load_verify_locations
|
#define CyaSSL_CTX_load_verify_locations wolfSSL_CTX_load_verify_locations
|
||||||
#define CyaSSL_CTX_set_default_passwd_cb wolfSSL_CTX_set_default_passwd_cb
|
#define CyaSSL_CTX_set_default_passwd_cb wolfSSL_CTX_set_default_passwd_cb
|
||||||
|
|
||||||
#define CyaSSL_use_old_poly wolfSSL_use_old_poly
|
|
||||||
|
|
||||||
/* io.c */
|
/* io.c */
|
||||||
#define CYASSL_CBIO_ERR_ISR WOLFSSL_CBIO_ERR_ISR
|
#define CYASSL_CBIO_ERR_ISR WOLFSSL_CBIO_ERR_ISR
|
||||||
#define CYASSL_CBIO_ERR_TIMEOUT WOLFSSL_CBIO_ERR_TIMEOUT
|
#define CYASSL_CBIO_ERR_TIMEOUT WOLFSSL_CBIO_ERR_TIMEOUT
|
||||||
@ -146,7 +141,6 @@
|
|||||||
#define CyaSSL_make_eap_keys wolfSSL_make_eap_keys
|
#define CyaSSL_make_eap_keys wolfSSL_make_eap_keys
|
||||||
#define CyaSSL_MakeTlsMasterSecret wolfSSL_MakeTlsMasterSecret
|
#define CyaSSL_MakeTlsMasterSecret wolfSSL_MakeTlsMasterSecret
|
||||||
|
|
||||||
|
|
||||||
/* src/internal.c */
|
/* src/internal.c */
|
||||||
#define CYASSL_CHAIN_CA WOLFSSL_CHAIN_CA
|
#define CYASSL_CHAIN_CA WOLFSSL_CHAIN_CA
|
||||||
#define CYASSL_ALERT_HISTORY WOLFSSL_ALERT_HISTORY
|
#define CYASSL_ALERT_HISTORY WOLFSSL_ALERT_HISTORY
|
||||||
@ -275,13 +269,13 @@
|
|||||||
#define CyaSSL_ERR_print_errors_fp wolfSSL_ERR_print_errors_fp
|
#define CyaSSL_ERR_print_errors_fp wolfSSL_ERR_print_errors_fp
|
||||||
|
|
||||||
/* OCSP and CRL */
|
/* OCSP and CRL */
|
||||||
#define CYASSL_OCSP_NO_NONCE WOLFSSL_OCSP_NO_NONCE
|
#define CYASSL_OCSP_NO_NONCE WOLFSSL_OCSP_NO_NONCE /**/
|
||||||
#define CYASSL_OCSP_URL_OVERRIDE WOLFSSL_OCSP_URL_OVERRIDE
|
#define CYASSL_OCSP_URL_OVERRIDE WOLFSSL_OCSP_URL_OVERRIDE
|
||||||
|
|
||||||
#define CyaSSL_CTX_EnableOCSP wolfSSL_CTX_EnableOCSP
|
#define CyaSSL_CTX_EnableOCSP wolfSSL_CTX_EnableOCSP
|
||||||
#define CyaSSL_CTX_OCSP_set_options wolfSSL_CTX_OCSP_set_options
|
#define CyaSSL_CTX_OCSP_set_options wolfSSL_CTX_OCSP_set_options /**/
|
||||||
#define CyaSSL_CTX_SetOCSP_OverrideURL wolfSSL_CTX_SetOCSP_OverrideURL
|
#define CyaSSL_CTX_SetOCSP_OverrideURL wolfSSL_CTX_SetOCSP_OverrideURL /**/
|
||||||
#define CyaSSL_CTX_OCSP_set_override_url wolfSSL_CTX_OCSP_set_override_url
|
#define CyaSSL_CTX_OCSP_set_override_url wolfSSL_CTX_OCSP_set_override_url /**/
|
||||||
|
|
||||||
/* Informational */
|
/* Informational */
|
||||||
#define CyaSSL_GetSide wolfSSL_GetSide
|
#define CyaSSL_GetSide wolfSSL_GetSide
|
||||||
@ -348,7 +342,6 @@
|
|||||||
#define CyaSSL_CTX_use_RSAPrivateKey_file wolfSSL_CTX_use_RSAPrivateKey_file
|
#define CyaSSL_CTX_use_RSAPrivateKey_file wolfSSL_CTX_use_RSAPrivateKey_file
|
||||||
#define CyaSSL_use_certificate_chain_file wolfSSL_use_certificate_chain_file
|
#define CyaSSL_use_certificate_chain_file wolfSSL_use_certificate_chain_file
|
||||||
|
|
||||||
|
|
||||||
/* TLS Extensions */
|
/* TLS Extensions */
|
||||||
#define CyaSSL_UseSNI wolfSSL_UseSNI
|
#define CyaSSL_UseSNI wolfSSL_UseSNI
|
||||||
#define CyaSSL_CTX_UseSNI wolfSSL_CTX_UseSNI
|
#define CyaSSL_CTX_UseSNI wolfSSL_CTX_UseSNI
|
||||||
@ -372,9 +365,6 @@
|
|||||||
#include <wolfssl/wolfcrypt/aes.h>
|
#include <wolfssl/wolfcrypt/aes.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef WOLFSSL_SMALL_STACK
|
#ifdef WOLFSSL_SMALL_STACK
|
||||||
#define CYASSL_SMALL_STACK
|
#define CYASSL_SMALL_STACK
|
||||||
#endif
|
#endif
|
||||||
@ -382,25 +372,26 @@
|
|||||||
#if !defined(CYASSL_MAX_ERROR_SZ) && !defined(HAVE_FIPS)
|
#if !defined(CYASSL_MAX_ERROR_SZ) && !defined(HAVE_FIPS)
|
||||||
#define CYASSL_MAX_ERROR_SZ WOLFSSL_MAX_ERROR_SZ
|
#define CYASSL_MAX_ERROR_SZ WOLFSSL_MAX_ERROR_SZ
|
||||||
#endif
|
#endif
|
||||||
/* wrapper around macros until they are changed in cyassl code
|
|
||||||
* needs investigation in regards to macros in fips */
|
/*
|
||||||
#define NO_WOLFSSL_ALLOC_ALIGN NO_CYASSL_ALLOC_ALIGN /* @TODO*/
|
* wrapper around macros until they are changed in cyassl code
|
||||||
|
* needs investigation in regards to macros in fips
|
||||||
|
*/
|
||||||
|
#define NO_WOLFSSL_ALLOC_ALIGN NO_CYASSL_ALLOC_ALIGN /* @TODO */
|
||||||
|
|
||||||
/* for pwdbased reverse compatibility */
|
/* for pwdbased reverse compatibility */
|
||||||
#ifndef NO_PWDBASED
|
#ifndef NO_PWDBASED
|
||||||
#define PBKDF1 wc_PBKDF1
|
#define PBKDF1 wc_PBKDF1
|
||||||
#define PBKDF2 wc_PBKDF2
|
#define PBKDF2 wc_PBKDF2
|
||||||
#define PKCS12_PBKDF wc_PKCS12_PBKDF
|
#define PKCS12_PBKDF wc_PKCS12_PBKDF
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/* examples/client/client.h */
|
/* examples/client/client.h */
|
||||||
#define CYASSL_THREAD WOLFSSL_THREAD
|
#define CYASSL_THREAD WOLFSSL_THREAD
|
||||||
|
|
||||||
/* examples/client/client.c */
|
/* examples/client/client.c */
|
||||||
#define LIBCYASSL_VERSION_STRING LIBWOLFSSL_VERSION_STRING
|
#define LIBCYASSL_VERSION_STRING LIBWOLFSSL_VERSION_STRING
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
} /* extern "C" */
|
} /* extern "C" */
|
||||||
#endif
|
#endif
|
||||||
|
@ -1859,7 +1859,7 @@ static int Decrypt(SSL* ssl, byte* output, const byte* input, word32 sz)
|
|||||||
switch (ssl->specs.bulk_cipher_algorithm) {
|
switch (ssl->specs.bulk_cipher_algorithm) {
|
||||||
#ifdef BUILD_ARC4
|
#ifdef BUILD_ARC4
|
||||||
case wolfssl_rc4:
|
case wolfssl_rc4:
|
||||||
Arc4Process(ssl->decrypt.arc4, output, input, sz);
|
wc_Arc4Process(ssl->decrypt.arc4, output, input, sz);
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -2548,12 +2548,12 @@ static int ProcessBuffer(WOLFSSL_CTX* ctx, const unsigned char* buff,
|
|||||||
word32 idx = 0;
|
word32 idx = 0;
|
||||||
ecc_key key;
|
ecc_key key;
|
||||||
|
|
||||||
ecc_init(&key);
|
wc_ecc_init(&key);
|
||||||
if (EccPrivateKeyDecode(der.buffer,&idx,&key,der.length) != 0) {
|
if (wc_EccPrivateKeyDecode(der.buffer,&idx,&key,der.length) != 0) {
|
||||||
ecc_free(&key);
|
wc_ecc_free(&key);
|
||||||
return SSL_BAD_FILE;
|
return SSL_BAD_FILE;
|
||||||
}
|
}
|
||||||
ecc_free(&key);
|
wc_ecc_free(&key);
|
||||||
eccKey = 1;
|
eccKey = 1;
|
||||||
if (ctx)
|
if (ctx)
|
||||||
ctx->haveStaticECC = 1;
|
ctx->haveStaticECC = 1;
|
||||||
|
@ -3282,7 +3282,7 @@ int rsa_test(void)
|
|||||||
return -414;
|
return -414;
|
||||||
}
|
}
|
||||||
|
|
||||||
pemSz = DerToPem(derCert, certSz, pem, FOURK_BUF, CERT_TYPE);
|
pemSz = wc_DerToPem(derCert, certSz, pem, FOURK_BUF, CERT_TYPE);
|
||||||
if (pemSz < 0) {
|
if (pemSz < 0) {
|
||||||
free(derCert);
|
free(derCert);
|
||||||
free(pem);
|
free(pem);
|
||||||
@ -3420,7 +3420,7 @@ int rsa_test(void)
|
|||||||
return -416;
|
return -416;
|
||||||
}
|
}
|
||||||
|
|
||||||
pemSz = DerToPem(derCert, certSz, pem, FOURK_BUF, CERT_TYPE);
|
pemSz = wc_DerToPem(derCert, certSz, pem, FOURK_BUF, CERT_TYPE);
|
||||||
if (pemSz < 0) {
|
if (pemSz < 0) {
|
||||||
free(derCert);
|
free(derCert);
|
||||||
free(pem);
|
free(pem);
|
||||||
@ -3557,7 +3557,7 @@ int rsa_test(void)
|
|||||||
return -5414;
|
return -5414;
|
||||||
}
|
}
|
||||||
|
|
||||||
pemSz = DerToPem(derCert, certSz, pem, FOURK_BUF, CERT_TYPE);
|
pemSz = wc_DerToPem(derCert, certSz, pem, FOURK_BUF, CERT_TYPE);
|
||||||
if (pemSz < 0) {
|
if (pemSz < 0) {
|
||||||
free(pem);
|
free(pem);
|
||||||
free(derCert);
|
free(derCert);
|
||||||
@ -3737,7 +3737,7 @@ int rsa_test(void)
|
|||||||
return -473;
|
return -473;
|
||||||
}
|
}
|
||||||
|
|
||||||
pemSz = DerToPem(derCert, certSz, pem, FOURK_BUF, CERT_TYPE);
|
pemSz = wc_DerToPem(derCert, certSz, pem, FOURK_BUF, CERT_TYPE);
|
||||||
if (pemSz < 0) {
|
if (pemSz < 0) {
|
||||||
free(derCert);
|
free(derCert);
|
||||||
free(pem);
|
free(pem);
|
||||||
@ -3822,7 +3822,7 @@ int rsa_test(void)
|
|||||||
return -466;
|
return -466;
|
||||||
}
|
}
|
||||||
|
|
||||||
pemSz = DerToPem(der, derSz, pem, FOURK_BUF, CERTREQ_TYPE);
|
pemSz = wc_DerToPem(der, derSz, pem, FOURK_BUF, CERTREQ_TYPE);
|
||||||
if (pemSz < 0) {
|
if (pemSz < 0) {
|
||||||
free(pem);
|
free(pem);
|
||||||
free(der);
|
free(der);
|
||||||
@ -4672,7 +4672,7 @@ int ecc_test(void)
|
|||||||
FILE* keyFile;
|
FILE* keyFile;
|
||||||
FILE* pemFile;
|
FILE* pemFile;
|
||||||
|
|
||||||
derSz = EccKeyToDer(&userB, der, FOURK_BUF);
|
derSz = wc_EccKeyToDer(&userB, der, FOURK_BUF);
|
||||||
if (derSz < 0) {
|
if (derSz < 0) {
|
||||||
return -1024;
|
return -1024;
|
||||||
}
|
}
|
||||||
@ -4687,7 +4687,7 @@ int ecc_test(void)
|
|||||||
return -1026;
|
return -1026;
|
||||||
}
|
}
|
||||||
|
|
||||||
pemSz = DerToPem(der, derSz, pem, FOURK_BUF, ECC_PRIVATEKEY_TYPE);
|
pemSz = wc_DerToPem(der, derSz, pem, FOURK_BUF, ECC_PRIVATEKEY_TYPE);
|
||||||
if (pemSz < 0) {
|
if (pemSz < 0) {
|
||||||
return -1027;
|
return -1027;
|
||||||
}
|
}
|
||||||
|
@ -1601,12 +1601,12 @@ static INLINE int myEccSign(WOLFSSL* ssl, const byte* in, word32 inSz,
|
|||||||
if (ret != 0)
|
if (ret != 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
ecc_init(&myKey);
|
wc_ecc_init(&myKey);
|
||||||
|
|
||||||
ret = EccPrivateKeyDecode(key, &idx, &myKey, keySz);
|
ret = wc_EccPrivateKeyDecode(key, &idx, &myKey, keySz);
|
||||||
if (ret == 0)
|
if (ret == 0)
|
||||||
ret = ecc_sign_hash(in, inSz, out, outSz, &rng, &myKey);
|
ret = wc_ecc_sign_hash(in, inSz, out, outSz, &rng, &myKey);
|
||||||
ecc_free(&myKey);
|
wc_ecc_free(&myKey);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -1622,12 +1622,12 @@ static INLINE int myEccVerify(WOLFSSL* ssl, const byte* sig, word32 sigSz,
|
|||||||
(void)ssl;
|
(void)ssl;
|
||||||
(void)ctx;
|
(void)ctx;
|
||||||
|
|
||||||
ecc_init(&myKey);
|
wc_ecc_init(&myKey);
|
||||||
|
|
||||||
ret = ecc_import_x963(key, keySz, &myKey);
|
ret = wc_ecc_import_x963(key, keySz, &myKey);
|
||||||
if (ret == 0)
|
if (ret == 0)
|
||||||
ret = ecc_verify_hash(sig, sigSz, hash, hashSz, result, &myKey);
|
ret = wc_ecc_verify_hash(sig, sigSz, hash, hashSz, result, &myKey);
|
||||||
ecc_free(&myKey);
|
wc_ecc_free(&myKey);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user