This commit is contained in:
Jacob Barthelmeh 2016-06-22 09:14:53 -06:00
commit f6bbe845f5
49 changed files with 240 additions and 126 deletions

View File

@ -6,7 +6,7 @@
#
#
AC_INIT([wolfssl],[3.9.6],[https://github.com/wolfssl/wolfssl/issues],[wolfssl],[http://www.wolfssl.com])
AC_INIT([wolfssl],[3.9.7],[https://github.com/wolfssl/wolfssl/issues],[wolfssl],[http://www.wolfssl.com])
AC_CONFIG_AUX_DIR([build-aux])

View File

@ -517,13 +517,19 @@ THREAD_RETURN WOLFSSL_THREAD client_test(void* args)
WOLFSSL* sslResume = 0;
WOLFSSL_SESSION* session = 0;
char resumeMsg[32] = "resuming wolfssl!";
int resumeSz = (int)strlen(resumeMsg);
#ifndef WOLFSSL_ALT_TEST_STRINGS
char msg[32] = "hello wolfssl!"; /* GET may make bigger */
char resumeMsg[32] = "resuming wolfssl!";
#else
char msg[32] = "hello wolfssl!\n";
char resumeMsg[32] = "resuming wolfssl!\n";
#endif
char reply[80];
int input;
int msgSz = (int)strlen(msg);
int resumeSz = (int)strlen(resumeMsg);
word16 port = wolfSSLPort;
char* host = (char*)wolfSSLIP;

View File

@ -256,7 +256,11 @@ THREAD_RETURN CYASSL_THREAD server_test(void* args)
SSL_CTX* ctx = 0;
SSL* ssl = 0;
#ifndef WOLFSSL_ALT_TEST_STRINGS
const char msg[] = "I hear you fa shizzle!";
#else
const char msg[] = "I hear you fa shizzle!\n";
#endif
char input[80];
int ch;
int version = SERVER_DEFAULT_VERSION;

View File

@ -25,14 +25,14 @@ sleep 1
# client test against our own server - GOOD CERT
./examples/server/server -c certs/ocsp/server1-cert.pem -k certs/ocsp/server1-key.pem &
sleep 1
./examples/client/client -A certs/ocsp/root-ca-cert.pem -W 1
./examples/client/client -X -C -A certs/ocsp/root-ca-cert.pem -W 1
RESULT=$?
[ $RESULT -ne 0 ] && echo -e "\n\nClient connection failed" && exit 1
# client test against our own server - REVOKED CERT
./examples/server/server -c certs/ocsp/server2-cert.pem -k certs/ocsp/server2-key.pem &
sleep 1
./examples/client/client -A certs/ocsp/root-ca-cert.pem -W 1
./examples/client/client -X -C -A certs/ocsp/root-ca-cert.pem -W 1
RESULT=$?
[ $RESULT -ne 1 ] && echo -e "\n\nClient connection suceeded $RESULT" && exit 1

View File

@ -16,39 +16,39 @@ sleep 1
# client test against our own server - GOOD CERTS
./examples/server/server -c certs/ocsp/server3-cert.pem -k certs/ocsp/server3-key.pem &
sleep 1
./examples/client/client -A certs/ocsp/root-ca-cert.pem -W 1
./examples/client/client -X -C -A certs/ocsp/root-ca-cert.pem -W 1
RESULT=$?
[ $RESULT -ne 0 ] && echo -e "\n\nClient connection failed" && exit 1
./examples/server/server -c certs/ocsp/server3-cert.pem -k certs/ocsp/server3-key.pem &
sleep 1
./examples/client/client -A certs/ocsp/root-ca-cert.pem -W 2
./examples/client/client -X -C -A certs/ocsp/root-ca-cert.pem -W 2
RESULT=$?
[ $RESULT -ne 0 ] && echo -e "\n\nClient connection failed" && exit 1
# client test against our own server - REVOKED SERVER CERT
./examples/server/server -c certs/ocsp/server4-cert.pem -k certs/ocsp/server4-key.pem &
sleep 1
./examples/client/client -A certs/ocsp/root-ca-cert.pem -W 1
./examples/client/client -X -C -A certs/ocsp/root-ca-cert.pem -W 1
RESULT=$?
[ $RESULT -ne 1 ] && echo -e "\n\nClient connection suceeded $RESULT" && exit 1
./examples/server/server -c certs/ocsp/server4-cert.pem -k certs/ocsp/server4-key.pem &
sleep 1
./examples/client/client -A certs/ocsp/root-ca-cert.pem -W 2
./examples/client/client -X -C -A certs/ocsp/root-ca-cert.pem -W 2
RESULT=$?
[ $RESULT -ne 1 ] && echo -e "\n\nClient connection suceeded $RESULT" && exit 1
# client test against our own server - REVOKED INTERMEDIATE CERT
./examples/server/server -c certs/ocsp/server5-cert.pem -k certs/ocsp/server5-key.pem &
sleep 1
./examples/client/client -A certs/ocsp/root-ca-cert.pem -W 1
./examples/client/client -X -C -A certs/ocsp/root-ca-cert.pem -W 1
RESULT=$?
[ $RESULT -ne 0 ] && echo -e "\n\nClient connection failed $RESULT" && exit 1
./examples/server/server -c certs/ocsp/server5-cert.pem -k certs/ocsp/server5-key.pem &
sleep 1
./examples/client/client -A certs/ocsp/root-ca-cert.pem -W 2
./examples/client/client -X -C -A certs/ocsp/root-ca-cert.pem -W 2
RESULT=$?
[ $RESULT -ne 1 ] && echo -e "\n\nClient connection suceeded $RESULT" && exit 1

View File

@ -2258,6 +2258,13 @@ void InitSuites(Suites* suites, ProtocolVersion pv, word16 haveRSA,
}
#endif
#ifdef BUILD_TLS_ECDHE_ECDSA_WITH_AES_128_CCM
if (tls1_2 && haveECC) {
suites->suites[idx++] = ECC_BYTE;
suites->suites[idx++] = TLS_ECDHE_ECDSA_WITH_AES_128_CCM;
}
#endif
#ifdef BUILD_TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8
if (tls1_2 && haveECC) {
suites->suites[idx++] = ECC_BYTE;
@ -5284,8 +5291,7 @@ retry:
case WOLFSSL_CBIO_ERR_TIMEOUT:
if (ssl->options.dtls) {
#ifdef WOLFSSL_DTLS
if ((!ssl->options.handShakeDone ||
ssl->options.dtlsHsRetain) &&
if (!ssl->options.handShakeDone &&
DtlsPoolTimeout(ssl) == 0 &&
DtlsPoolSend(ssl) == 0) {
@ -6072,6 +6078,7 @@ static int BuildFinished(WOLFSSL* ssl, Hashes* hashes, const byte* sender)
break;
#endif
case TLS_ECDHE_ECDSA_WITH_AES_128_CCM :
case TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8 :
case TLS_ECDHE_ECDSA_WITH_AES_256_CCM_8 :
if (requirement == REQUIRES_ECC)
@ -8624,7 +8631,8 @@ static int ChachaAEADDecrypt(WOLFSSL* ssl, byte* plain, const byte* input,
/* check tag sent along with packet */
if (ConstantCompare(input + msgLen, tag, ssl->specs.aead_mac_size) != 0) {
WOLFSSL_MSG("MAC did not match");
SendAlert(ssl, alert_fatal, bad_record_mac);
if (!ssl->options.dtls)
SendAlert(ssl, alert_fatal, bad_record_mac);
return VERIFY_MAC_ERROR;
}
@ -8888,7 +8896,8 @@ static INLINE int Decrypt(WOLFSSL* ssl, byte* plain, const byte* input,
input + sz - ssl->specs.aead_mac_size,
ssl->specs.aead_mac_size,
additional, AEAD_AUTH_DATA_SZ) < 0) {
SendAlert(ssl, alert_fatal, bad_record_mac);
if (!ssl->options.dtls)
SendAlert(ssl, alert_fatal, bad_record_mac);
ret = VERIFY_MAC_ERROR;
}
ForceZero(nonce, AESGCM_NONCE_SZ);
@ -8929,7 +8938,8 @@ static INLINE int Decrypt(WOLFSSL* ssl, byte* plain, const byte* input,
input + sz - ssl->specs.aead_mac_size,
ssl->specs.aead_mac_size,
additional, AEAD_AUTH_DATA_SZ) < 0) {
SendAlert(ssl, alert_fatal, bad_record_mac);
if (!ssl->options.dtls)
SendAlert(ssl, alert_fatal, bad_record_mac);
ret = VERIFY_MAC_ERROR;
}
ForceZero(nonce, AESGCM_NONCE_SZ);
@ -9719,6 +9729,15 @@ int ProcessReply(WOLFSSL* ssl)
if (ret < 0) {
WOLFSSL_MSG("Decrypt failed");
WOLFSSL_ERROR(ret);
#ifdef WOLFSSL_DTLS
/* If in DTLS mode, if the decrypt fails for any
* reason, pretend the datagram never happened. */
if (ssl->options.dtls) {
ssl->options.processReply = doProcessInit;
ssl->buffers.inputBuffer.idx =
ssl->buffers.inputBuffer.length;
}
#endif /* WOLFSSL_DTLS */
return DECRYPT_ERROR;
}
if (ssl->options.tls1_1 && ssl->specs.cipher_type == block)
@ -11345,6 +11364,15 @@ int ReceiveData(WOLFSSL* ssl, byte* output, int sz, int peek)
if (ssl->error == WANT_READ || ssl->error == WC_PENDING_E)
ssl->error = 0;
#ifdef WOLFSSL_DTLS
if (ssl->options.dtls) {
/* In DTLS mode, we forgive some errors and allow the session
* to continue despite them. */
if (ssl->error == VERIFY_MAC_ERROR || ssl->error == DECRYPT_ERROR)
ssl->error = 0;
}
#endif /* WOLFSSL_DTLS */
if (ssl->error != 0 && ssl->error != WANT_WRITE) {
WOLFSSL_MSG("User calling wolfSSL_read in error state, not allowed");
return ssl->error;
@ -12032,6 +12060,10 @@ static const char* const cipher_names[] =
"AES256-CCM-8",
#endif
#ifdef BUILD_TLS_ECDHE_ECDSA_WITH_AES_128_CCM
"ECDHE-ECDSA-AES128-CCM",
#endif
#ifdef BUILD_TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8
"ECDHE-ECDSA-AES128-CCM-8",
#endif
@ -12474,6 +12506,10 @@ static int cipher_name_idx[] =
TLS_RSA_WITH_AES_256_CCM_8,
#endif
#ifdef BUILD_TLS_ECDHE_ECDSA_WITH_AES_128_CCM
TLS_ECDHE_ECDSA_WITH_AES_128_CCM,
#endif
#ifdef BUILD_TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8
TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8,
#endif

View File

@ -790,6 +790,24 @@ int SetCipherSpecs(WOLFSSL* ssl)
break;
#endif
#ifdef BUILD_TLS_ECDHE_ECDSA_WITH_AES_128_CCM
case TLS_ECDHE_ECDSA_WITH_AES_128_CCM :
ssl->specs.bulk_cipher_algorithm = wolfssl_aes_ccm;
ssl->specs.cipher_type = aead;
ssl->specs.mac_algorithm = sha256_mac;
ssl->specs.kea = ecc_diffie_hellman_kea;
ssl->specs.sig_algo = ecc_dsa_sa_algo;
ssl->specs.hash_size = SHA256_DIGEST_SIZE;
ssl->specs.pad_size = PAD_SHA;
ssl->specs.static_ecdh = 0;
ssl->specs.key_size = AES_128_KEY_SIZE;
ssl->specs.block_size = AES_BLOCK_SIZE;
ssl->specs.iv_size = AESGCM_IMP_IV_SZ;
ssl->specs.aead_mac_size = AES_CCM_16_AUTH_SZ;
break;
#endif
#ifdef BUILD_TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8
case TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8 :
ssl->specs.bulk_cipher_algorithm = wolfssl_aes_ccm;

View File

@ -14946,7 +14946,17 @@ int wolfSSL_EC_GROUP_get_degree(const WOLFSSL_EC_GROUP *group)
}
switch(group->curve_nid) {
case NID_secp256k1:
case NID_secp112r1:
return 112;
case NID_secp128r1:
return 128;
case NID_secp160r1:
return 160;
case NID_X9_62_prime192v1:
return 192;
case NID_secp224r1:
return 224;
case NID_X9_62_prime256v1:
return 256;
case NID_secp384r1:
return 384;

View File

@ -5,6 +5,6 @@ includedir=${prefix}/include
Name: wolfssl
Description: wolfssl C library.
Version: 3.9.6
Version: 3.9.7
Libs: -L${libdir} -lwolfssl
Cflags: -I${includedir}

View File

@ -1046,6 +1046,19 @@
-v 3
-l PSK-AES256-GCM-SHA384
# server DTLSv1.2 ECDHE-ECDSA-AES128-CCM
-u
-v 3
-l ECDHE-ECDSA-AES128-CCM
-c ./certs/server-ecc.pem
-k ./certs/ecc-key.pem
# client DTLSv1.2 ECDHE-ECDSA-AES128-CCM
-u
-v 3
-l ECDHE-ECDSA-AES128-CCM
-A ./certs/server-ecc.pem
# server DTLSv1.2 ECDHE-ECDSA-AES128-CCM-8
-u
-v 3

View File

@ -1823,6 +1823,17 @@
-v 3
-l QSH:AES256-CCM-8
# server TLSv1.2 ECDHE-ECDSA-AES128-CCM
-v 3
-l QSH:ECDHE-ECDSA-AES128-CCM
-c ./certs/server-ecc.pem
-k ./certs/ecc-key.pem
# client TLSv1.2 ECDHE-ECDSA-AES128-CCM
-v 3
-l QSH:ECDHE-ECDSA-AES128-CCM
-A ./certs/server-ecc.pem
# server TLSv1.2 ECDHE-ECDSA-AES128-CCM-8
-v 3
-l QSH:ECDHE-ECDSA-AES128-CCM-8

View File

@ -185,6 +185,17 @@
-l ECDHE-ECDSA-AES256-GCM-SHA384
-A ./certs/ca-cert.pem
# server TLSv1.2 ECDHE-ECDSA-AES128-CCM
-v 3
-l ECDHE-ECDSA-AES128-CCM
-c ./certs/server-ecc-rsa.pem
-k ./certs/ecc-key.pem
# client TLSv1.2 ECDHE-ECDSA-AES128-CCM
-v 3
-l ECDHE-ECDSA-AES128-CCM
-A ./certs/ca-cert.pem
# server TLSv1.2 ECDHE-ECDSA-AES128-CCM-8
-v 3
-l ECDHE-ECDSA-AES128-CCM-8

View File

@ -1812,6 +1812,17 @@
-v 3
-l AES256-CCM-8
# server TLSv1.2 ECDHE-ECDSA-AES128-CCM
-v 3
-l ECDHE-ECDSA-AES128-CCM
-c ./certs/server-ecc.pem
-k ./certs/ecc-key.pem
# client TLSv1.2 ECDHE-ECDSA-AES128-CCM
-v 3
-l ECDHE-ECDSA-AES128-CCM
-A ./certs/server-ecc.pem
# server TLSv1.2 ECDHE-ECDSA-AES128-CCM-8
-v 3
-l ECDHE-ECDSA-AES128-CCM-8

View File

@ -167,7 +167,7 @@ const ecc_set_type ecc_sets[] = {
#ifdef ECC192
{
24, /* size/bytes */
NID_secp192k1, /* NID */
NID_X9_62_prime192v1, /* NID */
"SECP192R1", /* curve name */
"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF", /* prime */
"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFC", /* A */
@ -193,7 +193,7 @@ const ecc_set_type ecc_sets[] = {
#ifdef ECC256
{
32, /* size/bytes */
NID_secp256k1, /* NID */
NID_X9_62_prime256v1, /* NID */
"SECP256R1", /* curve name */
"FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF", /* prime */
"FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC", /* A */
@ -2067,9 +2067,6 @@ static int ecc_mul2add(ecc_point* A, mp_int* kA,
for (x = 0; x < 16; x++) {
precomp[x] = wc_ecc_new_point_h(heap);
if (precomp[x] == NULL) {
for (y = 0; y < x; ++y) {
wc_ecc_del_point_h(precomp[y], heap);
}
err = GEN_MEM_ERR;
break;
}

View File

@ -28,10 +28,9 @@ void fp_montgomery_reduce_small(fp_int *a, fp_int *m, fp_digit mp)
fp_digit c[FP_SIZE], *_c, *tmpm, mu, cy;
int oldused, x, y, pa;
#if defined(USE_MEMSET)
/* now zero the buff */
memset(c, 0, sizeof c);
#endif
XMEMSET(c, 0, sizeof c);
pa = m->used;
/* copy the input */
@ -39,11 +38,7 @@ void fp_montgomery_reduce_small(fp_int *a, fp_int *m, fp_digit mp)
for (x = 0; x < oldused; x++) {
c[x] = a->dp[x];
}
#if !defined(USE_MEMSET)
for (; x < 2*pa+3; x++) {
c[x] = 0;
}
#endif
MONT_START;
switch (pa) {

View File

@ -26,8 +26,8 @@ void fp_mul_comba12(fp_int *A, fp_int *B, fp_int *C)
{
fp_digit c0, c1, c2, at[24];
memcpy(at, A->dp, 12 * sizeof(fp_digit));
memcpy(at+12, B->dp, 12 * sizeof(fp_digit));
XMEMCPY(at, A->dp, 12 * sizeof(fp_digit));
XMEMCPY(at+12, B->dp, 12 * sizeof(fp_digit));
COMBA_START;
COMBA_CLEAR;

View File

@ -26,8 +26,8 @@ void fp_mul_comba17(fp_int *A, fp_int *B, fp_int *C)
{
fp_digit c0, c1, c2, at[34];
memcpy(at, A->dp, 17 * sizeof(fp_digit));
memcpy(at+17, B->dp, 17 * sizeof(fp_digit));
XMEMCPY(at, A->dp, 17 * sizeof(fp_digit));
XMEMCPY(at+17, B->dp, 17 * sizeof(fp_digit));
COMBA_START;
COMBA_CLEAR;

View File

@ -25,8 +25,8 @@ void fp_mul_comba20(fp_int *A, fp_int *B, fp_int *C)
{
fp_digit c0, c1, c2, at[40];
memcpy(at, A->dp, 20 * sizeof(fp_digit));
memcpy(at+20, B->dp, 20 * sizeof(fp_digit));
XMEMCPY(at, A->dp, 20 * sizeof(fp_digit));
XMEMCPY(at+20, B->dp, 20 * sizeof(fp_digit));
COMBA_START;
COMBA_CLEAR;

View File

@ -26,8 +26,8 @@ void fp_mul_comba24(fp_int *A, fp_int *B, fp_int *C)
{
fp_digit c0, c1, c2, at[48];
memcpy(at, A->dp, 24 * sizeof(fp_digit));
memcpy(at+24, B->dp, 24 * sizeof(fp_digit));
XMEMCPY(at, A->dp, 24 * sizeof(fp_digit));
XMEMCPY(at+24, B->dp, 24 * sizeof(fp_digit));
COMBA_START;
COMBA_CLEAR;

View File

@ -26,8 +26,8 @@ void fp_mul_comba28(fp_int *A, fp_int *B, fp_int *C)
{
fp_digit c0, c1, c2, at[56];
memcpy(at, A->dp, 28 * sizeof(fp_digit));
memcpy(at+28, B->dp, 28 * sizeof(fp_digit));
XMEMCPY(at, A->dp, 28 * sizeof(fp_digit));
XMEMCPY(at+28, B->dp, 28 * sizeof(fp_digit));
COMBA_START;
COMBA_CLEAR;

View File

@ -26,8 +26,8 @@ void fp_mul_comba3(fp_int *A, fp_int *B, fp_int *C)
{
fp_digit c0, c1, c2, at[6];
memcpy(at, A->dp, 3 * sizeof(fp_digit));
memcpy(at+3, B->dp, 3 * sizeof(fp_digit));
XMEMCPY(at, A->dp, 3 * sizeof(fp_digit));
XMEMCPY(at+3, B->dp, 3 * sizeof(fp_digit));
COMBA_START;
COMBA_CLEAR;

View File

@ -28,8 +28,8 @@ void fp_mul_comba32(fp_int *A, fp_int *B, fp_int *C)
int out_size;
out_size = A->used + B->used;
memcpy(at, A->dp, 32 * sizeof(fp_digit));
memcpy(at+32, B->dp, 32 * sizeof(fp_digit));
XMEMCPY(at, A->dp, 32 * sizeof(fp_digit));
XMEMCPY(at+32, B->dp, 32 * sizeof(fp_digit));
COMBA_START;
COMBA_CLEAR;

View File

@ -26,8 +26,8 @@ void fp_mul_comba4(fp_int *A, fp_int *B, fp_int *C)
{
fp_digit c0, c1, c2, at[8];
memcpy(at, A->dp, 4 * sizeof(fp_digit));
memcpy(at+4, B->dp, 4 * sizeof(fp_digit));
XMEMCPY(at, A->dp, 4 * sizeof(fp_digit));
XMEMCPY(at+4, B->dp, 4 * sizeof(fp_digit));
COMBA_START;
COMBA_CLEAR;

View File

@ -26,8 +26,8 @@ void fp_mul_comba48(fp_int *A, fp_int *B, fp_int *C)
{
fp_digit c0, c1, c2, at[96];
memcpy(at, A->dp, 48 * sizeof(fp_digit));
memcpy(at+48, B->dp, 48 * sizeof(fp_digit));
XMEMCPY(at, A->dp, 48 * sizeof(fp_digit));
XMEMCPY(at+48, B->dp, 48 * sizeof(fp_digit));
COMBA_START;
COMBA_CLEAR;

View File

@ -26,8 +26,8 @@ void fp_mul_comba6(fp_int *A, fp_int *B, fp_int *C)
{
fp_digit c0, c1, c2, at[12];
memcpy(at, A->dp, 6 * sizeof(fp_digit));
memcpy(at+6, B->dp, 6 * sizeof(fp_digit));
XMEMCPY(at, A->dp, 6 * sizeof(fp_digit));
XMEMCPY(at+6, B->dp, 6 * sizeof(fp_digit));
COMBA_START;
COMBA_CLEAR;

View File

@ -26,8 +26,8 @@ void fp_mul_comba64(fp_int *A, fp_int *B, fp_int *C)
{
fp_digit c0, c1, c2, at[128];
memcpy(at, A->dp, 64 * sizeof(fp_digit));
memcpy(at+64, B->dp, 64 * sizeof(fp_digit));
XMEMCPY(at, A->dp, 64 * sizeof(fp_digit));
XMEMCPY(at+64, B->dp, 64 * sizeof(fp_digit));
COMBA_START;
COMBA_CLEAR;

View File

@ -26,8 +26,8 @@ void fp_mul_comba7(fp_int *A, fp_int *B, fp_int *C)
{
fp_digit c0, c1, c2, at[14];
memcpy(at, A->dp, 7 * sizeof(fp_digit));
memcpy(at+7, B->dp, 7 * sizeof(fp_digit));
XMEMCPY(at, A->dp, 7 * sizeof(fp_digit));
XMEMCPY(at+7, B->dp, 7 * sizeof(fp_digit));
COMBA_START;
COMBA_CLEAR;

View File

@ -26,8 +26,8 @@ void fp_mul_comba8(fp_int *A, fp_int *B, fp_int *C)
{
fp_digit c0, c1, c2, at[16];
memcpy(at, A->dp, 8 * sizeof(fp_digit));
memcpy(at+8, B->dp, 8 * sizeof(fp_digit));
XMEMCPY(at, A->dp, 8 * sizeof(fp_digit));
XMEMCPY(at+8, B->dp, 8 * sizeof(fp_digit));
COMBA_START;
COMBA_CLEAR;

View File

@ -26,8 +26,8 @@ void fp_mul_comba9(fp_int *A, fp_int *B, fp_int *C)
{
fp_digit c0, c1, c2, at[18];
memcpy(at, A->dp, 9 * sizeof(fp_digit));
memcpy(at+9, B->dp, 9 * sizeof(fp_digit));
XMEMCPY(at, A->dp, 9 * sizeof(fp_digit));
XMEMCPY(at+9, B->dp, 9 * sizeof(fp_digit));
COMBA_START;
COMBA_CLEAR;

View File

@ -28,8 +28,8 @@ void fp_mul_comba_small(fp_int *A, fp_int *B, fp_int *C)
switch (MAX(A->used, B->used)) {
case 1:
memcpy(at, A->dp, 1 * sizeof(fp_digit));
memcpy(at+1, B->dp, 1 * sizeof(fp_digit));
XMEMCPY(at, A->dp, 1 * sizeof(fp_digit));
XMEMCPY(at+1, B->dp, 1 * sizeof(fp_digit));
COMBA_START;
COMBA_CLEAR;
@ -44,8 +44,8 @@ void fp_mul_comba_small(fp_int *A, fp_int *B, fp_int *C)
break;
case 2:
memcpy(at, A->dp, 2 * sizeof(fp_digit));
memcpy(at+2, B->dp, 2 * sizeof(fp_digit));
XMEMCPY(at, A->dp, 2 * sizeof(fp_digit));
XMEMCPY(at+2, B->dp, 2 * sizeof(fp_digit));
COMBA_START;
COMBA_CLEAR;
@ -68,8 +68,8 @@ void fp_mul_comba_small(fp_int *A, fp_int *B, fp_int *C)
break;
case 3:
memcpy(at, A->dp, 3 * sizeof(fp_digit));
memcpy(at+3, B->dp, 3 * sizeof(fp_digit));
XMEMCPY(at, A->dp, 3 * sizeof(fp_digit));
XMEMCPY(at+3, B->dp, 3 * sizeof(fp_digit));
COMBA_START;
COMBA_CLEAR;
@ -100,8 +100,8 @@ void fp_mul_comba_small(fp_int *A, fp_int *B, fp_int *C)
break;
case 4:
memcpy(at, A->dp, 4 * sizeof(fp_digit));
memcpy(at+4, B->dp, 4 * sizeof(fp_digit));
XMEMCPY(at, A->dp, 4 * sizeof(fp_digit));
XMEMCPY(at+4, B->dp, 4 * sizeof(fp_digit));
COMBA_START;
COMBA_CLEAR;
@ -140,8 +140,8 @@ void fp_mul_comba_small(fp_int *A, fp_int *B, fp_int *C)
break;
case 5:
memcpy(at, A->dp, 5 * sizeof(fp_digit));
memcpy(at+5, B->dp, 5 * sizeof(fp_digit));
XMEMCPY(at, A->dp, 5 * sizeof(fp_digit));
XMEMCPY(at+5, B->dp, 5 * sizeof(fp_digit));
COMBA_START;
COMBA_CLEAR;
@ -188,8 +188,8 @@ void fp_mul_comba_small(fp_int *A, fp_int *B, fp_int *C)
break;
case 6:
memcpy(at, A->dp, 6 * sizeof(fp_digit));
memcpy(at+6, B->dp, 6 * sizeof(fp_digit));
XMEMCPY(at, A->dp, 6 * sizeof(fp_digit));
XMEMCPY(at+6, B->dp, 6 * sizeof(fp_digit));
COMBA_START;
COMBA_CLEAR;
@ -244,8 +244,8 @@ void fp_mul_comba_small(fp_int *A, fp_int *B, fp_int *C)
break;
case 7:
memcpy(at, A->dp, 7 * sizeof(fp_digit));
memcpy(at+7, B->dp, 7 * sizeof(fp_digit));
XMEMCPY(at, A->dp, 7 * sizeof(fp_digit));
XMEMCPY(at+7, B->dp, 7 * sizeof(fp_digit));
COMBA_START;
COMBA_CLEAR;
@ -308,8 +308,8 @@ void fp_mul_comba_small(fp_int *A, fp_int *B, fp_int *C)
break;
case 8:
memcpy(at, A->dp, 8 * sizeof(fp_digit));
memcpy(at+8, B->dp, 8 * sizeof(fp_digit));
XMEMCPY(at, A->dp, 8 * sizeof(fp_digit));
XMEMCPY(at+8, B->dp, 8 * sizeof(fp_digit));
COMBA_START;
COMBA_CLEAR;
@ -380,8 +380,8 @@ void fp_mul_comba_small(fp_int *A, fp_int *B, fp_int *C)
break;
case 9:
memcpy(at, A->dp, 9 * sizeof(fp_digit));
memcpy(at+9, B->dp, 9 * sizeof(fp_digit));
XMEMCPY(at, A->dp, 9 * sizeof(fp_digit));
XMEMCPY(at+9, B->dp, 9 * sizeof(fp_digit));
COMBA_START;
COMBA_CLEAR;
@ -460,8 +460,8 @@ void fp_mul_comba_small(fp_int *A, fp_int *B, fp_int *C)
break;
case 10:
memcpy(at, A->dp, 10 * sizeof(fp_digit));
memcpy(at+10, B->dp, 10 * sizeof(fp_digit));
XMEMCPY(at, A->dp, 10 * sizeof(fp_digit));
XMEMCPY(at+10, B->dp, 10 * sizeof(fp_digit));
COMBA_START;
COMBA_CLEAR;
@ -548,8 +548,8 @@ void fp_mul_comba_small(fp_int *A, fp_int *B, fp_int *C)
break;
case 11:
memcpy(at, A->dp, 11 * sizeof(fp_digit));
memcpy(at+11, B->dp, 11 * sizeof(fp_digit));
XMEMCPY(at, A->dp, 11 * sizeof(fp_digit));
XMEMCPY(at+11, B->dp, 11 * sizeof(fp_digit));
COMBA_START;
COMBA_CLEAR;
@ -644,8 +644,8 @@ void fp_mul_comba_small(fp_int *A, fp_int *B, fp_int *C)
break;
case 12:
memcpy(at, A->dp, 12 * sizeof(fp_digit));
memcpy(at+12, B->dp, 12 * sizeof(fp_digit));
XMEMCPY(at, A->dp, 12 * sizeof(fp_digit));
XMEMCPY(at+12, B->dp, 12 * sizeof(fp_digit));
COMBA_START;
COMBA_CLEAR;
@ -748,8 +748,8 @@ void fp_mul_comba_small(fp_int *A, fp_int *B, fp_int *C)
break;
case 13:
memcpy(at, A->dp, 13 * sizeof(fp_digit));
memcpy(at+13, B->dp, 13 * sizeof(fp_digit));
XMEMCPY(at, A->dp, 13 * sizeof(fp_digit));
XMEMCPY(at+13, B->dp, 13 * sizeof(fp_digit));
COMBA_START;
COMBA_CLEAR;
@ -860,8 +860,8 @@ void fp_mul_comba_small(fp_int *A, fp_int *B, fp_int *C)
break;
case 14:
memcpy(at, A->dp, 14 * sizeof(fp_digit));
memcpy(at+14, B->dp, 14 * sizeof(fp_digit));
XMEMCPY(at, A->dp, 14 * sizeof(fp_digit));
XMEMCPY(at+14, B->dp, 14 * sizeof(fp_digit));
COMBA_START;
COMBA_CLEAR;
@ -980,8 +980,8 @@ void fp_mul_comba_small(fp_int *A, fp_int *B, fp_int *C)
break;
case 15:
memcpy(at, A->dp, 15 * sizeof(fp_digit));
memcpy(at+15, B->dp, 15 * sizeof(fp_digit));
XMEMCPY(at, A->dp, 15 * sizeof(fp_digit));
XMEMCPY(at+15, B->dp, 15 * sizeof(fp_digit));
COMBA_START;
COMBA_CLEAR;
@ -1108,8 +1108,8 @@ void fp_mul_comba_small(fp_int *A, fp_int *B, fp_int *C)
break;
case 16:
memcpy(at, A->dp, 16 * sizeof(fp_digit));
memcpy(at+16, B->dp, 16 * sizeof(fp_digit));
XMEMCPY(at, A->dp, 16 * sizeof(fp_digit));
XMEMCPY(at+16, B->dp, 16 * sizeof(fp_digit));
COMBA_START;
COMBA_CLEAR;

View File

@ -152,7 +152,7 @@ void fp_sqr_comba12(fp_int *A, fp_int *B)
B->used = 24;
B->sign = FP_ZPOS;
memcpy(B->dp, b, 24 * sizeof(fp_digit));
XMEMCPY(B->dp, b, 24 * sizeof(fp_digit));
fp_clamp(B);
}
#endif

View File

@ -203,7 +203,7 @@ void fp_sqr_comba17(fp_int *A, fp_int *B)
B->used = 34;
B->sign = FP_ZPOS;
memcpy(B->dp, b, 34 * sizeof(fp_digit));
XMEMCPY(B->dp, b, 34 * sizeof(fp_digit));
fp_clamp(B);
}
#endif

View File

@ -233,7 +233,7 @@ void fp_sqr_comba20(fp_int *A, fp_int *B)
B->used = 40;
B->sign = FP_ZPOS;
memcpy(B->dp, b, 40 * sizeof(fp_digit));
XMEMCPY(B->dp, b, 40 * sizeof(fp_digit));
fp_clamp(B);
}
#endif

View File

@ -273,7 +273,7 @@ void fp_sqr_comba24(fp_int *A, fp_int *B)
B->used = 48;
B->sign = FP_ZPOS;
memcpy(B->dp, b, 48 * sizeof(fp_digit));
XMEMCPY(B->dp, b, 48 * sizeof(fp_digit));
fp_clamp(B);
}
#endif

View File

@ -313,7 +313,7 @@ void fp_sqr_comba28(fp_int *A, fp_int *B)
B->used = 56;
B->sign = FP_ZPOS;
memcpy(B->dp, b, 56 * sizeof(fp_digit));
XMEMCPY(B->dp, b, 56 * sizeof(fp_digit));
fp_clamp(B);
}
#endif

View File

@ -63,7 +63,7 @@ void fp_sqr_comba3(fp_int *A, fp_int *B)
B->used = 6;
B->sign = FP_ZPOS;
memcpy(B->dp, b, 6 * sizeof(fp_digit));
XMEMCPY(B->dp, b, 6 * sizeof(fp_digit));
fp_clamp(B);
}
#endif

View File

@ -353,7 +353,7 @@ void fp_sqr_comba32(fp_int *A, fp_int *B)
B->used = 64;
B->sign = FP_ZPOS;
memcpy(B->dp, b, 64 * sizeof(fp_digit));
XMEMCPY(B->dp, b, 64 * sizeof(fp_digit));
fp_clamp(B);
}
#endif

View File

@ -73,7 +73,7 @@ void fp_sqr_comba4(fp_int *A, fp_int *B)
B->used = 8;
B->sign = FP_ZPOS;
memcpy(B->dp, b, 8 * sizeof(fp_digit));
XMEMCPY(B->dp, b, 8 * sizeof(fp_digit));
fp_clamp(B);
}
#endif

View File

@ -513,7 +513,7 @@ void fp_sqr_comba48(fp_int *A, fp_int *B)
B->used = 96;
B->sign = FP_ZPOS;
memcpy(B->dp, b, 96 * sizeof(fp_digit));
XMEMCPY(B->dp, b, 96 * sizeof(fp_digit));
fp_clamp(B);
}
#endif

View File

@ -93,7 +93,7 @@ void fp_sqr_comba6(fp_int *A, fp_int *B)
B->used = 12;
B->sign = FP_ZPOS;
memcpy(B->dp, b, 12 * sizeof(fp_digit));
XMEMCPY(B->dp, b, 12 * sizeof(fp_digit));
fp_clamp(B);
}
#endif

View File

@ -673,7 +673,7 @@ void fp_sqr_comba64(fp_int *A, fp_int *B)
B->used = 128;
B->sign = FP_ZPOS;
memcpy(B->dp, b, 128 * sizeof(fp_digit));
XMEMCPY(B->dp, b, 128 * sizeof(fp_digit));
fp_clamp(B);
}
#endif

View File

@ -103,7 +103,7 @@ void fp_sqr_comba7(fp_int *A, fp_int *B)
B->used = 14;
B->sign = FP_ZPOS;
memcpy(B->dp, b, 14 * sizeof(fp_digit));
XMEMCPY(B->dp, b, 14 * sizeof(fp_digit));
fp_clamp(B);
}
#endif

View File

@ -113,7 +113,7 @@ void fp_sqr_comba8(fp_int *A, fp_int *B)
B->used = 16;
B->sign = FP_ZPOS;
memcpy(B->dp, b, 16 * sizeof(fp_digit));
XMEMCPY(B->dp, b, 16 * sizeof(fp_digit));
fp_clamp(B);
}
#endif

View File

@ -123,7 +123,7 @@ void fp_sqr_comba9(fp_int *A, fp_int *B)
B->used = 18;
B->sign = FP_ZPOS;
memcpy(B->dp, b, 18 * sizeof(fp_digit));
XMEMCPY(B->dp, b, 18 * sizeof(fp_digit));
fp_clamp(B);
}
#endif

View File

@ -44,7 +44,7 @@ void fp_sqr_comba_small(fp_int *A, fp_int *B)
B->used = 2;
B->sign = FP_ZPOS;
memcpy(B->dp, b, 2 * sizeof(fp_digit));
XMEMCPY(B->dp, b, 2 * sizeof(fp_digit));
fp_clamp(B);
break;
@ -73,7 +73,7 @@ void fp_sqr_comba_small(fp_int *A, fp_int *B)
B->used = 4;
B->sign = FP_ZPOS;
memcpy(B->dp, b, 4 * sizeof(fp_digit));
XMEMCPY(B->dp, b, 4 * sizeof(fp_digit));
fp_clamp(B);
break;
@ -112,7 +112,7 @@ void fp_sqr_comba_small(fp_int *A, fp_int *B)
B->used = 6;
B->sign = FP_ZPOS;
memcpy(B->dp, b, 6 * sizeof(fp_digit));
XMEMCPY(B->dp, b, 6 * sizeof(fp_digit));
fp_clamp(B);
break;
@ -161,7 +161,7 @@ void fp_sqr_comba_small(fp_int *A, fp_int *B)
B->used = 8;
B->sign = FP_ZPOS;
memcpy(B->dp, b, 8 * sizeof(fp_digit));
XMEMCPY(B->dp, b, 8 * sizeof(fp_digit));
fp_clamp(B);
break;
@ -220,7 +220,7 @@ void fp_sqr_comba_small(fp_int *A, fp_int *B)
B->used = 10;
B->sign = FP_ZPOS;
memcpy(B->dp, b, 10 * sizeof(fp_digit));
XMEMCPY(B->dp, b, 10 * sizeof(fp_digit));
fp_clamp(B);
break;
@ -289,7 +289,7 @@ void fp_sqr_comba_small(fp_int *A, fp_int *B)
B->used = 12;
B->sign = FP_ZPOS;
memcpy(B->dp, b, 12 * sizeof(fp_digit));
XMEMCPY(B->dp, b, 12 * sizeof(fp_digit));
fp_clamp(B);
break;
@ -368,7 +368,7 @@ void fp_sqr_comba_small(fp_int *A, fp_int *B)
B->used = 14;
B->sign = FP_ZPOS;
memcpy(B->dp, b, 14 * sizeof(fp_digit));
XMEMCPY(B->dp, b, 14 * sizeof(fp_digit));
fp_clamp(B);
break;
@ -457,7 +457,7 @@ void fp_sqr_comba_small(fp_int *A, fp_int *B)
B->used = 16;
B->sign = FP_ZPOS;
memcpy(B->dp, b, 16 * sizeof(fp_digit));
XMEMCPY(B->dp, b, 16 * sizeof(fp_digit));
fp_clamp(B);
break;
@ -556,7 +556,7 @@ void fp_sqr_comba_small(fp_int *A, fp_int *B)
B->used = 18;
B->sign = FP_ZPOS;
memcpy(B->dp, b, 18 * sizeof(fp_digit));
XMEMCPY(B->dp, b, 18 * sizeof(fp_digit));
fp_clamp(B);
break;
@ -665,7 +665,7 @@ void fp_sqr_comba_small(fp_int *A, fp_int *B)
B->used = 20;
B->sign = FP_ZPOS;
memcpy(B->dp, b, 20 * sizeof(fp_digit));
XMEMCPY(B->dp, b, 20 * sizeof(fp_digit));
fp_clamp(B);
break;
@ -784,7 +784,7 @@ void fp_sqr_comba_small(fp_int *A, fp_int *B)
B->used = 22;
B->sign = FP_ZPOS;
memcpy(B->dp, b, 22 * sizeof(fp_digit));
XMEMCPY(B->dp, b, 22 * sizeof(fp_digit));
fp_clamp(B);
break;
@ -913,7 +913,7 @@ void fp_sqr_comba_small(fp_int *A, fp_int *B)
B->used = 24;
B->sign = FP_ZPOS;
memcpy(B->dp, b, 24 * sizeof(fp_digit));
XMEMCPY(B->dp, b, 24 * sizeof(fp_digit));
fp_clamp(B);
break;
@ -1052,7 +1052,7 @@ void fp_sqr_comba_small(fp_int *A, fp_int *B)
B->used = 26;
B->sign = FP_ZPOS;
memcpy(B->dp, b, 26 * sizeof(fp_digit));
XMEMCPY(B->dp, b, 26 * sizeof(fp_digit));
fp_clamp(B);
break;
@ -1201,7 +1201,7 @@ void fp_sqr_comba_small(fp_int *A, fp_int *B)
B->used = 28;
B->sign = FP_ZPOS;
memcpy(B->dp, b, 28 * sizeof(fp_digit));
XMEMCPY(B->dp, b, 28 * sizeof(fp_digit));
fp_clamp(B);
break;
@ -1360,7 +1360,7 @@ void fp_sqr_comba_small(fp_int *A, fp_int *B)
B->used = 30;
B->sign = FP_ZPOS;
memcpy(B->dp, b, 30 * sizeof(fp_digit));
XMEMCPY(B->dp, b, 30 * sizeof(fp_digit));
fp_clamp(B);
break;
@ -1529,7 +1529,7 @@ void fp_sqr_comba_small(fp_int *A, fp_int *B)
B->used = 32;
B->sign = FP_ZPOS;
memcpy(B->dp, b, 32 * sizeof(fp_digit));
XMEMCPY(B->dp, b, 32 * sizeof(fp_digit));
fp_clamp(B);
break;

View File

@ -610,6 +610,7 @@ typedef byte word24[3];
#endif
#endif
#if defined(HAVE_AESCCM) && !defined(NO_SHA256)
#define BUILD_TLS_ECDHE_ECDSA_WITH_AES_128_CCM
#define BUILD_TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8
#define BUILD_TLS_ECDHE_ECDSA_WITH_AES_256_CCM_8
#endif
@ -814,6 +815,7 @@ enum {
* with non-ECC AES-GCM */
TLS_RSA_WITH_AES_128_CCM_8 = 0xa0,
TLS_RSA_WITH_AES_256_CCM_8 = 0xa1,
TLS_ECDHE_ECDSA_WITH_AES_128_CCM = 0xac,
TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8 = 0xae,
TLS_ECDHE_ECDSA_WITH_AES_256_CCM_8 = 0xaf,
TLS_PSK_WITH_AES_128_CCM = 0xa4,

View File

@ -16,9 +16,9 @@ enum {
NID_secp112r1 = 0,
NID_secp128r1 = 1,
NID_secp160r1 = 2,
NID_secp192k1 = 3,
NID_X9_62_prime192v1 = 3,
NID_secp224r1 = 4,
NID_secp256k1 = 5,
NID_X9_62_prime256v1 = 5,
NID_secp384r1 = 6,
NID_secp521r1 = 7,
NID_X9_62_prime_field = 100,

View File

@ -28,8 +28,8 @@
extern "C" {
#endif
#define LIBWOLFSSL_VERSION_STRING "3.9.6"
#define LIBWOLFSSL_VERSION_HEX 0x03009006
#define LIBWOLFSSL_VERSION_STRING "3.9.7"
#define LIBWOLFSSL_VERSION_HEX 0x03009007
#ifdef __cplusplus
}

View File

@ -181,7 +181,7 @@
}
if (ret && ptr)
memcpy(ret, ptr, sz);
XMEMCPY(ret, ptr, sz);
if (ret) {
#ifdef WOLFSSL_DEBUG_MEMORY