mirror of https://github.com/wolfSSL/wolfssl.git
auto-tools and wc_ updates
parent
62a5548009
commit
59eb83c6e9
|
@ -318,7 +318,7 @@ ENABLED_SNIFFTEST=no
|
|||
AC_ARG_ENABLE([sniffer],
|
||||
[AS_HELP_STRING([--enable-sniffer],[ Enable CyaSSL sniffer support (default: disabled) ])],[
|
||||
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],[
|
||||
ENABLED_SNIFFTEST=yes
|
||||
],[ AC_MSG_WARN([cannot enable sniffer test without having libpcap available.]) ]) ])
|
||||
|
@ -1446,12 +1446,12 @@ then
|
|||
if test "x$ENABLED_CERTGEN" = "xno"
|
||||
then
|
||||
ENABLED_CERTGEN="yes"
|
||||
AM_CFLAGS="$AM_CFLAGS -DCYASSL_CERT_GEN"
|
||||
AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_CERT_GEN"
|
||||
fi
|
||||
if test "x$ENABLED_CERTREQ" = "xno"
|
||||
then
|
||||
ENABLED_CERTREQ="yes"
|
||||
AM_CFLAGS="$AM_CFLAGS -DCYASSL_CERT_REQ"
|
||||
AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_CERT_REQ"
|
||||
fi
|
||||
if test "x$ENABLED_PKCS7" = "xno"
|
||||
then
|
||||
|
@ -1459,7 +1459,7 @@ then
|
|||
AM_CFLAGS="$AM_CFLAGS -DHAVE_PKCS7"
|
||||
AM_CONDITIONAL([BUILD_PKCS7], [test "x$ENABLED_PKCS7" = "xyes"])
|
||||
fi
|
||||
AM_CFLAGS="$AM_CFLAGS -DCYASSL_HAVE_WOLFSCEP"
|
||||
AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_HAVE_WOLFSCEP"
|
||||
fi
|
||||
|
||||
|
||||
|
|
29
cyassl/ssl.h
29
cyassl/ssl.h
|
@ -19,12 +19,10 @@
|
|||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* ssl.h makes wolfssl backwards compatibile with cyassl
|
||||
*/
|
||||
|
||||
|
||||
#ifndef WOLFSSL_CYASSL_H_
|
||||
#define WOLFSSL_CYASSL_H_
|
||||
/*
|
||||
|
@ -47,8 +45,6 @@
|
|||
#define CYASSL_METHOD WOLFSSL_METHOD
|
||||
#define CYASSL_SESSION WOLFSSL_SESSION
|
||||
|
||||
|
||||
|
||||
#define CYASSL_X509 WOLFSSL_X509
|
||||
#define CYASSL_X509_NAME WOLFSSL_X509_NAME
|
||||
#define CYASSL_X509_CHAIN WOLFSSL_X509_CHAIN
|
||||
|
@ -105,6 +101,7 @@
|
|||
#define CyaSSL_KeyPemToDer wolfSSL_KeyPemToDer
|
||||
#define CyaSSL_get_version wolfSSL_get_version
|
||||
#define CyaSSL_SetServerID wolfSSL_SetServerID
|
||||
#define CyaSSL_use_old_poly wolfSSL_use_old_poly
|
||||
#define CyaSSL_SetCertCbCtx wolfSSL_SetCertCbCtx
|
||||
#define CyaSSL_CertPemToDer wolfSSL_CertPemToDer
|
||||
#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_set_default_passwd_cb wolfSSL_CTX_set_default_passwd_cb
|
||||
|
||||
#define CyaSSL_use_old_poly wolfSSL_use_old_poly
|
||||
|
||||
/* io.c */
|
||||
#define CYASSL_CBIO_ERR_ISR WOLFSSL_CBIO_ERR_ISR
|
||||
#define CYASSL_CBIO_ERR_TIMEOUT WOLFSSL_CBIO_ERR_TIMEOUT
|
||||
|
@ -146,7 +141,6 @@
|
|||
#define CyaSSL_make_eap_keys wolfSSL_make_eap_keys
|
||||
#define CyaSSL_MakeTlsMasterSecret wolfSSL_MakeTlsMasterSecret
|
||||
|
||||
|
||||
/* src/internal.c */
|
||||
#define CYASSL_CHAIN_CA WOLFSSL_CHAIN_CA
|
||||
#define CYASSL_ALERT_HISTORY WOLFSSL_ALERT_HISTORY
|
||||
|
@ -275,13 +269,13 @@
|
|||
#define CyaSSL_ERR_print_errors_fp wolfSSL_ERR_print_errors_fp
|
||||
|
||||
/* 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_CTX_EnableOCSP wolfSSL_CTX_EnableOCSP
|
||||
#define CyaSSL_CTX_OCSP_set_options wolfSSL_CTX_OCSP_set_options
|
||||
#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_options wolfSSL_CTX_OCSP_set_options /**/
|
||||
#define CyaSSL_CTX_SetOCSP_OverrideURL wolfSSL_CTX_SetOCSP_OverrideURL /**/
|
||||
#define CyaSSL_CTX_OCSP_set_override_url wolfSSL_CTX_OCSP_set_override_url /**/
|
||||
|
||||
/* Informational */
|
||||
#define CyaSSL_GetSide wolfSSL_GetSide
|
||||
|
@ -348,7 +342,6 @@
|
|||
#define CyaSSL_CTX_use_RSAPrivateKey_file wolfSSL_CTX_use_RSAPrivateKey_file
|
||||
#define CyaSSL_use_certificate_chain_file wolfSSL_use_certificate_chain_file
|
||||
|
||||
|
||||
/* TLS Extensions */
|
||||
#define CyaSSL_UseSNI wolfSSL_UseSNI
|
||||
#define CyaSSL_CTX_UseSNI wolfSSL_CTX_UseSNI
|
||||
|
@ -372,9 +365,6 @@
|
|||
#include <wolfssl/wolfcrypt/aes.h>
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
#ifdef WOLFSSL_SMALL_STACK
|
||||
#define CYASSL_SMALL_STACK
|
||||
#endif
|
||||
|
@ -382,8 +372,11 @@
|
|||
#if !defined(CYASSL_MAX_ERROR_SZ) && !defined(HAVE_FIPS)
|
||||
#define CYASSL_MAX_ERROR_SZ WOLFSSL_MAX_ERROR_SZ
|
||||
#endif
|
||||
/* wrapper around macros until they are changed in cyassl code
|
||||
* needs investigation in regards to macros in fips */
|
||||
|
||||
/*
|
||||
* 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 */
|
||||
|
@ -393,14 +386,12 @@
|
|||
#define PKCS12_PBKDF wc_PKCS12_PBKDF
|
||||
#endif
|
||||
|
||||
|
||||
/* examples/client/client.h */
|
||||
#define CYASSL_THREAD WOLFSSL_THREAD
|
||||
|
||||
/* examples/client/client.c */
|
||||
#define LIBCYASSL_VERSION_STRING LIBWOLFSSL_VERSION_STRING
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
|
|
@ -1859,7 +1859,7 @@ static int Decrypt(SSL* ssl, byte* output, const byte* input, word32 sz)
|
|||
switch (ssl->specs.bulk_cipher_algorithm) {
|
||||
#ifdef BUILD_ARC4
|
||||
case wolfssl_rc4:
|
||||
Arc4Process(ssl->decrypt.arc4, output, input, sz);
|
||||
wc_Arc4Process(ssl->decrypt.arc4, output, input, sz);
|
||||
break;
|
||||
#endif
|
||||
|
||||
|
|
|
@ -2548,12 +2548,12 @@ static int ProcessBuffer(WOLFSSL_CTX* ctx, const unsigned char* buff,
|
|||
word32 idx = 0;
|
||||
ecc_key key;
|
||||
|
||||
ecc_init(&key);
|
||||
if (EccPrivateKeyDecode(der.buffer,&idx,&key,der.length) != 0) {
|
||||
ecc_free(&key);
|
||||
wc_ecc_init(&key);
|
||||
if (wc_EccPrivateKeyDecode(der.buffer,&idx,&key,der.length) != 0) {
|
||||
wc_ecc_free(&key);
|
||||
return SSL_BAD_FILE;
|
||||
}
|
||||
ecc_free(&key);
|
||||
wc_ecc_free(&key);
|
||||
eccKey = 1;
|
||||
if (ctx)
|
||||
ctx->haveStaticECC = 1;
|
||||
|
|
|
@ -3282,7 +3282,7 @@ int rsa_test(void)
|
|||
return -414;
|
||||
}
|
||||
|
||||
pemSz = DerToPem(derCert, certSz, pem, FOURK_BUF, CERT_TYPE);
|
||||
pemSz = wc_DerToPem(derCert, certSz, pem, FOURK_BUF, CERT_TYPE);
|
||||
if (pemSz < 0) {
|
||||
free(derCert);
|
||||
free(pem);
|
||||
|
@ -3420,7 +3420,7 @@ int rsa_test(void)
|
|||
return -416;
|
||||
}
|
||||
|
||||
pemSz = DerToPem(derCert, certSz, pem, FOURK_BUF, CERT_TYPE);
|
||||
pemSz = wc_DerToPem(derCert, certSz, pem, FOURK_BUF, CERT_TYPE);
|
||||
if (pemSz < 0) {
|
||||
free(derCert);
|
||||
free(pem);
|
||||
|
@ -3557,7 +3557,7 @@ int rsa_test(void)
|
|||
return -5414;
|
||||
}
|
||||
|
||||
pemSz = DerToPem(derCert, certSz, pem, FOURK_BUF, CERT_TYPE);
|
||||
pemSz = wc_DerToPem(derCert, certSz, pem, FOURK_BUF, CERT_TYPE);
|
||||
if (pemSz < 0) {
|
||||
free(pem);
|
||||
free(derCert);
|
||||
|
@ -3737,7 +3737,7 @@ int rsa_test(void)
|
|||
return -473;
|
||||
}
|
||||
|
||||
pemSz = DerToPem(derCert, certSz, pem, FOURK_BUF, CERT_TYPE);
|
||||
pemSz = wc_DerToPem(derCert, certSz, pem, FOURK_BUF, CERT_TYPE);
|
||||
if (pemSz < 0) {
|
||||
free(derCert);
|
||||
free(pem);
|
||||
|
@ -3822,7 +3822,7 @@ int rsa_test(void)
|
|||
return -466;
|
||||
}
|
||||
|
||||
pemSz = DerToPem(der, derSz, pem, FOURK_BUF, CERTREQ_TYPE);
|
||||
pemSz = wc_DerToPem(der, derSz, pem, FOURK_BUF, CERTREQ_TYPE);
|
||||
if (pemSz < 0) {
|
||||
free(pem);
|
||||
free(der);
|
||||
|
@ -4672,7 +4672,7 @@ int ecc_test(void)
|
|||
FILE* keyFile;
|
||||
FILE* pemFile;
|
||||
|
||||
derSz = EccKeyToDer(&userB, der, FOURK_BUF);
|
||||
derSz = wc_EccKeyToDer(&userB, der, FOURK_BUF);
|
||||
if (derSz < 0) {
|
||||
return -1024;
|
||||
}
|
||||
|
@ -4687,7 +4687,7 @@ int ecc_test(void)
|
|||
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) {
|
||||
return -1027;
|
||||
}
|
||||
|
|
|
@ -1601,12 +1601,12 @@ static INLINE int myEccSign(WOLFSSL* ssl, const byte* in, word32 inSz,
|
|||
if (ret != 0)
|
||||
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)
|
||||
ret = ecc_sign_hash(in, inSz, out, outSz, &rng, &myKey);
|
||||
ecc_free(&myKey);
|
||||
ret = wc_ecc_sign_hash(in, inSz, out, outSz, &rng, &myKey);
|
||||
wc_ecc_free(&myKey);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@ -1622,12 +1622,12 @@ static INLINE int myEccVerify(WOLFSSL* ssl, const byte* sig, word32 sigSz,
|
|||
(void)ssl;
|
||||
(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)
|
||||
ret = ecc_verify_hash(sig, sigSz, hash, hashSz, result, &myKey);
|
||||
ecc_free(&myKey);
|
||||
ret = wc_ecc_verify_hash(sig, sigSz, hash, hashSz, result, &myKey);
|
||||
wc_ecc_free(&myKey);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue