Compare commits

...

7 Commits

Author SHA1 Message Date
John Safranek
e86c6d8c84 Merge branch 'master' of github.com:cyassl/cyassl 2015-01-08 15:27:23 -08:00
John Safranek
c1546bf20b In sniffer changed a memcpy to memmove; update for v3.3.2 2015-01-08 15:25:14 -08:00
Chris Conlon
b8c65ec0de fix NO_INLINE word error in misc.h, change to cyassl_word 2015-01-08 10:31:26 -07:00
John Safranek
3c86c16d85 In hash drbg changed assignment to memcpy to fix strict aliasing
warning.
2015-01-06 14:25:57 -08:00
John Safranek
a8803e1e16 1. snifftest.c needs socket.h included for AIX
2. cleaned up whitespace in snifftest.c
2015-01-06 11:08:37 -08:00
John Safranek
06714584f9 fix local variable masking global in SetKeysSide() 2015-01-06 09:27:40 -08:00
John Safranek
46d9037d26 removed some AC_REQUIRE statements for macros that have parameters. causing some trouble under ksh. 2015-01-05 16:20:13 -08:00
11 changed files with 96 additions and 79 deletions

12
README
View File

@@ -34,7 +34,17 @@ before calling SSL_new(); Though it's not recommended.
*** end Notes *** *** end Notes ***
CyaSSL Release 3.3.0 (12/05/2014)
CyaSSL Release 3.3.2 (01/07/2015)
Release 3.3.2 CyaSSL has bug fixes and new features including:
- Improvements in the build configuration under AIX.
- Various compile warnings.
- Changed a memcpy to memmove in the sniffer.
***********CyaSSL Release 3.3.0 (12/05/2014)
- Countermeasuers for Handshake message duplicates, CHANGE CIPHER without - Countermeasuers for Handshake message duplicates, CHANGE CIPHER without
FINISHED, and fast forward attempts. Thanks to Karthikeyan Bhargavan from FINISHED, and fast forward attempts. Thanks to Karthikeyan Bhargavan from

View File

@@ -36,6 +36,15 @@ before calling SSL_new(); Though it's not recommended.
``` ```
# CyaSSL Release 3.3.2 (01/07/2015)
## Release 3.3.2 CyaSSL has bug fixes and new features including:
- Improvements in the build configuration under AIX.
- Various compile warnings.
- Changed a memcpy to memmove in the sniffer.
# CyaSSL Release 3.3.0 (12/05/2014) # CyaSSL Release 3.3.0 (12/05/2014)
- Countermeasuers for Handshake message duplicates, CHANGE CIPHER without - Countermeasuers for Handshake message duplicates, CHANGE CIPHER without

View File

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

View File

@@ -232,7 +232,7 @@ static int Hash_gen(DRBG* drbg, byte* out, word32 outSz, const byte* V)
return DRBG_FAILURE; return DRBG_FAILURE;
} }
checkBlock = *(word32*)drbg->digest; XMEMCPY(&checkBlock, drbg->digest, sizeof(word32));
if (drbg->reseedCtr > 1 && checkBlock == drbg->lastBlock) { if (drbg->reseedCtr > 1 && checkBlock == drbg->lastBlock) {
if (drbg->matchCount == 1) { if (drbg->matchCount == 1) {
return DRBG_CONT_FAILURE; return DRBG_CONT_FAILURE;

View File

@@ -44,7 +44,7 @@ CYASSL_LOCAL
void ByteReverseWords(word32*, const word32*, word32); void ByteReverseWords(word32*, const word32*, word32);
CYASSL_LOCAL CYASSL_LOCAL
void XorWords(word*, const word*, word32); void XorWords(cyassl_word*, const cyassl_word*, word32);
CYASSL_LOCAL CYASSL_LOCAL
void xorbuf(void*, const void*, word32); void xorbuf(void*, const void*, word32);

View File

@@ -26,8 +26,8 @@
extern "C" { extern "C" {
#endif #endif
#define LIBCYASSL_VERSION_STRING "3.3.0" #define LIBCYASSL_VERSION_STRING "3.3.2"
#define LIBCYASSL_VERSION_HEX 0x03003000 #define LIBCYASSL_VERSION_HEX 0x03003002
#ifdef __cplusplus #ifdef __cplusplus
} }

View File

@@ -33,7 +33,7 @@
# and this notice are preserved. This file is offered as-is, without any # and this notice are preserved. This file is offered as-is, without any
# warranty. # warranty.
#serial 7 #serial 7.1
AC_DEFUN([AX_AM_JOBSERVER], [ AC_DEFUN([AX_AM_JOBSERVER], [
AC_REQUIRE([AX_COUNT_CPUS]) AC_REQUIRE([AX_COUNT_CPUS])

View File

@@ -62,10 +62,9 @@
# AX_APPEND_COMPILE_FLAGS([-floop-parallelize-all],,[$ax_append_compile_cflags_extra]) -- causes RSA verify problem on x64 # AX_APPEND_COMPILE_FLAGS([-floop-parallelize-all],,[$ax_append_compile_cflags_extra]) -- causes RSA verify problem on x64
# AX_APPEND_COMPILE_FLAGS([-Wunreachable-code],,[$ax_append_compile_cflags_extra]) -- older clang and when gcc had it are buggy # AX_APPEND_COMPILE_FLAGS([-Wunreachable-code],,[$ax_append_compile_cflags_extra]) -- older clang and when gcc had it are buggy
#serial 4 #serial 4.1
AC_DEFUN([AX_HARDEN_LINKER_FLAGS], [ AC_DEFUN([AX_HARDEN_LINKER_FLAGS], [
AC_REQUIRE([AX_CHECK_LINK_FLAG])
AC_REQUIRE([AX_VCS_CHECKOUT]) AC_REQUIRE([AX_VCS_CHECKOUT])
AC_REQUIRE([AX_DEBUG]) AC_REQUIRE([AX_DEBUG])
@@ -94,7 +93,6 @@
]) ])
AC_DEFUN([AX_HARDEN_CC_COMPILER_FLAGS], [ AC_DEFUN([AX_HARDEN_CC_COMPILER_FLAGS], [
AC_REQUIRE([AX_APPEND_COMPILE_FLAGS])
AC_REQUIRE([AX_HARDEN_LINKER_FLAGS]) AC_REQUIRE([AX_HARDEN_LINKER_FLAGS])
AC_LANG_PUSH([C]) AC_LANG_PUSH([C])
@@ -229,7 +227,6 @@
]) ])
AC_DEFUN([AX_CC_OTHER_FLAGS], [ AC_DEFUN([AX_CC_OTHER_FLAGS], [
AC_REQUIRE([AX_APPEND_COMPILE_FLAGS])
AC_REQUIRE([AX_HARDEN_CC_COMPILER_FLAGS]) AC_REQUIRE([AX_HARDEN_CC_COMPILER_FLAGS])
AC_LANG_PUSH([C]) AC_LANG_PUSH([C])

View File

@@ -2325,8 +2325,8 @@ static int SetAuthKeys(OneTimeAuth* authentication, Keys* keys,
int SetKeysSide(CYASSL* ssl, enum encrypt_side side) int SetKeysSide(CYASSL* ssl, enum encrypt_side side)
{ {
int devId = NO_CAVIUM_DEVICE, ret, copy = 0; int devId = NO_CAVIUM_DEVICE, ret, copy = 0;
Ciphers* encrypt = NULL; Ciphers* enc = NULL;
Ciphers* decrypt = NULL; Ciphers* dec = NULL;
Keys* keys = &ssl->keys; Keys* keys = &ssl->keys;
(void)copy; (void)copy;
@@ -2344,16 +2344,16 @@ int SetKeysSide(CYASSL* ssl, enum encrypt_side side)
switch (side) { switch (side) {
case ENCRYPT_SIDE_ONLY: case ENCRYPT_SIDE_ONLY:
encrypt = &ssl->encrypt; enc = &ssl->encrypt;
break; break;
case DECRYPT_SIDE_ONLY: case DECRYPT_SIDE_ONLY:
decrypt = &ssl->decrypt; dec = &ssl->decrypt;
break; break;
case ENCRYPT_AND_DECRYPT_SIDE: case ENCRYPT_AND_DECRYPT_SIDE:
encrypt = &ssl->encrypt; enc = &ssl->encrypt;
decrypt = &ssl->decrypt; dec = &ssl->decrypt;
break; break;
default: default:
@@ -2368,16 +2368,16 @@ int SetKeysSide(CYASSL* ssl, enum encrypt_side side)
} }
#endif #endif
ret = SetKeys(encrypt, decrypt, keys, &ssl->specs, ssl->options.side, ret = SetKeys(enc, dec, keys, &ssl->specs, ssl->options.side,
ssl->heap, devId); ssl->heap, devId);
#ifdef HAVE_SECURE_RENEGOTIATION #ifdef HAVE_SECURE_RENEGOTIATION
if (copy) { if (copy) {
int clientCopy = 0; int clientCopy = 0;
if (ssl->options.side == CYASSL_CLIENT_END && encrypt) if (ssl->options.side == CYASSL_CLIENT_END && enc)
clientCopy = 1; clientCopy = 1;
else if (ssl->options.side == CYASSL_SERVER_END && decrypt) else if (ssl->options.side == CYASSL_SERVER_END && dec)
clientCopy = 1; clientCopy = 1;
if (clientCopy) { if (clientCopy) {
@@ -2395,7 +2395,7 @@ int SetKeysSide(CYASSL* ssl, enum encrypt_side side)
XMEMCPY(ssl->keys.server_write_IV, XMEMCPY(ssl->keys.server_write_IV,
keys->server_write_IV, AES_IV_SIZE); keys->server_write_IV, AES_IV_SIZE);
} }
if (encrypt) { if (enc) {
ssl->keys.sequence_number = keys->sequence_number; ssl->keys.sequence_number = keys->sequence_number;
#ifdef HAVE_AEAD #ifdef HAVE_AEAD
if (ssl->specs.cipher_type == aead) { if (ssl->specs.cipher_type == aead) {
@@ -2405,7 +2405,7 @@ int SetKeysSide(CYASSL* ssl, enum encrypt_side side)
} }
#endif #endif
} }
if (decrypt) if (dec)
ssl->keys.peer_sequence_number = keys->peer_sequence_number; ssl->keys.peer_sequence_number = keys->peer_sequence_number;
ssl->secure_renegotiation->cache_status++; ssl->secure_renegotiation->cache_status++;
} }

View File

@@ -2673,7 +2673,7 @@ doMessage:
return -1; return -1;
} }
} }
XMEMCPY(ssl->buffers.inputBuffer.buffer, sslFrame, sslBytes); XMEMMOVE(ssl->buffers.inputBuffer.buffer, sslFrame, sslBytes);
ssl->buffers.inputBuffer.length = sslBytes; ssl->buffers.inputBuffer.length = sslBytes;
} }
if (HaveMoreInput(session, &sslFrame, &sslBytes, &end, error)) if (HaveMoreInput(session, &sslFrame, &sslBytes, &end, error))

View File

@@ -44,8 +44,8 @@ int main(void)
/* do a full build */ /* do a full build */
#ifdef _MSC_VER #ifdef _MSC_VER
/* builds on *nix too, for scanf device and port */ /* builds on *nix too, for scanf device and port */
#define _CRT_SECURE_NO_WARNINGS #define _CRT_SECURE_NO_WARNINGS
#endif #endif
#include <pcap/pcap.h> /* pcap stuff */ #include <pcap/pcap.h> /* pcap stuff */
@@ -53,6 +53,7 @@ int main(void)
#include <stdlib.h> /* EXIT_SUCCESS */ #include <stdlib.h> /* EXIT_SUCCESS */
#include <string.h> /* strcmp */ #include <string.h> /* strcmp */
#include <signal.h> /* signal */ #include <signal.h> /* signal */
#include <sys/socket.h> /* AF_INET */
#include <cyassl/sniffer.h> #include <cyassl/sniffer.h>
@@ -95,44 +96,44 @@ static void sig_handler(const int sig)
static void err_sys(const char* msg) static void err_sys(const char* msg)
{ {
fprintf(stderr, "%s\n", msg); fprintf(stderr, "%s\n", msg);
if (msg) if (msg)
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
#ifdef _WIN32 #ifdef _WIN32
#define SNPRINTF _snprintf #define SNPRINTF _snprintf
#else #else
#define SNPRINTF snprintf #define SNPRINTF snprintf
#endif #endif
static char* iptos(unsigned int addr) static char* iptos(unsigned int addr)
{ {
static char output[32]; static char output[32];
byte *p = (byte*)&addr; byte *p = (byte*)&addr;
SNPRINTF(output, sizeof(output), "%d.%d.%d.%d", p[0], p[1], p[2], p[3]); SNPRINTF(output, sizeof(output), "%d.%d.%d.%d", p[0], p[1], p[2], p[3]);
return output; return output;
} }
int main(int argc, char** argv) int main(int argc, char** argv)
{ {
int ret = 0; int ret = 0;
int inum; int inum;
int port; int port;
int saveFile = 0; int saveFile = 0;
int i = 0; int i = 0;
int frame = ETHER_IF_FRAME_LEN; int frame = ETHER_IF_FRAME_LEN;
char err[PCAP_ERRBUF_SIZE]; char err[PCAP_ERRBUF_SIZE];
char filter[32]; char filter[32];
const char *server = NULL; const char *server = NULL;
struct bpf_program fp; struct bpf_program fp;
pcap_if_t *d; pcap_if_t *d;
pcap_addr_t *a; pcap_addr_t *a;
signal(SIGINT, sig_handler); signal(SIGINT, sig_handler);
@@ -144,52 +145,52 @@ int main(int argc, char** argv)
if (argc == 1) { if (argc == 1) {
/* normal case, user chooses device and port */ /* normal case, user chooses device and port */
if (pcap_findalldevs(&alldevs, err) == -1) if (pcap_findalldevs(&alldevs, err) == -1)
err_sys("Error in pcap_findalldevs"); err_sys("Error in pcap_findalldevs");
for (d = alldevs; d; d=d->next) { for (d = alldevs; d; d=d->next) {
printf("%d. %s", ++i, d->name); printf("%d. %s", ++i, d->name);
if (d->description) if (d->description)
printf(" (%s)\n", d->description); printf(" (%s)\n", d->description);
else else
printf(" (No description available)\n"); printf(" (No description available)\n");
} }
if (i == 0) if (i == 0)
err_sys("No interfaces found! Make sure pcap or WinPcap is" err_sys("No interfaces found! Make sure pcap or WinPcap is"
" installed correctly and you have sufficient permissions"); " installed correctly and you have sufficient permissions");
printf("Enter the interface number (1-%d): ", i); printf("Enter the interface number (1-%d): ", i);
ret = scanf("%d", &inum); ret = scanf("%d", &inum);
if (ret != 1) if (ret != 1)
printf("scanf port failed\n"); printf("scanf port failed\n");
if (inum < 1 || inum > i) if (inum < 1 || inum > i)
err_sys("Interface number out of range"); err_sys("Interface number out of range");
/* Jump to the selected adapter */ /* Jump to the selected adapter */
for (d = alldevs, i = 0; i < inum - 1; d = d->next, i++); for (d = alldevs, i = 0; i < inum - 1; d = d->next, i++);
pcap = pcap_create(d->name, err); pcap = pcap_create(d->name, err);
if (pcap == NULL) printf("pcap_create failed %s\n", err); if (pcap == NULL) printf("pcap_create failed %s\n", err);
/* get an IPv4 address */ /* get an IPv4 address */
for (a = d->addresses; a; a = a->next) { for (a = d->addresses; a; a = a->next) {
switch(a->addr->sa_family) switch(a->addr->sa_family)
{ {
case AF_INET: case AF_INET:
server = server =
iptos(((struct sockaddr_in *)a->addr)->sin_addr.s_addr); iptos(((struct sockaddr_in *)a->addr)->sin_addr.s_addr);
printf("server = %s\n", server); printf("server = %s\n", server);
break; break;
default: default:
break; break;
} }
} }
if (server == NULL) if (server == NULL)
err_sys("Unable to get device IPv4 address"); err_sys("Unable to get device IPv4 address");
ret = pcap_set_snaplen(pcap, 65536); ret = pcap_set_snaplen(pcap, 65536);
if (ret != 0) printf("pcap_set_snaplen failed %s\n", pcap_geterr(pcap)); if (ret != 0) printf("pcap_set_snaplen failed %s\n", pcap_geterr(pcap));
@@ -199,7 +200,7 @@ int main(int argc, char** argv)
ret = pcap_set_buffer_size(pcap, 1000000); ret = pcap_set_buffer_size(pcap, 1000000);
if (ret != 0) if (ret != 0)
printf("pcap_set_buffer_size failed %s\n", pcap_geterr(pcap)); printf("pcap_set_buffer_size failed %s\n", pcap_geterr(pcap));
ret = pcap_set_promisc(pcap, 1); ret = pcap_set_promisc(pcap, 1);
if (ret != 0) printf("pcap_set_promisc failed %s\n", pcap_geterr(pcap)); if (ret != 0) printf("pcap_set_promisc failed %s\n", pcap_geterr(pcap));
@@ -208,14 +209,14 @@ int main(int argc, char** argv)
ret = pcap_activate(pcap); ret = pcap_activate(pcap);
if (ret != 0) printf("pcap_activate failed %s\n", pcap_geterr(pcap)); if (ret != 0) printf("pcap_activate failed %s\n", pcap_geterr(pcap));
printf("Enter the port to scan: "); printf("Enter the port to scan: ");
ret = scanf("%d", &port); ret = scanf("%d", &port);
if (ret != 1) if (ret != 1)
printf("scanf port failed\n"); printf("scanf port failed\n");
SNPRINTF(filter, sizeof(filter), "tcp and port %d", port); SNPRINTF(filter, sizeof(filter), "tcp and port %d", port);
ret = pcap_compile(pcap, &fp, filter, 0, 0); ret = pcap_compile(pcap, &fp, filter, 0, 0);
if (ret != 0) printf("pcap_compile failed %s\n", pcap_geterr(pcap)); if (ret != 0) printf("pcap_compile failed %s\n", pcap_geterr(pcap));
ret = pcap_setfilter(pcap, &fp); ret = pcap_setfilter(pcap, &fp);
@@ -295,8 +296,8 @@ int main(int argc, char** argv)
byte data[65535+16384]; /* may have a partial 16k record cached */ byte data[65535+16384]; /* may have a partial 16k record cached */
if (header.caplen > 40) { /* min ip(20) + min tcp(20) */ if (header.caplen > 40) { /* min ip(20) + min tcp(20) */
packet += frame; packet += frame;
header.caplen -= frame; header.caplen -= frame;
} }
else else
continue; continue;
@@ -306,7 +307,7 @@ int main(int argc, char** argv)
printf("ssl_Decode ret = %d, %s\n", ret, err); printf("ssl_Decode ret = %d, %s\n", ret, err);
if (ret > 0) { if (ret > 0) {
data[ret] = 0; data[ret] = 0;
printf("SSL App Data(%d:%d):%s\n", packetNumber, ret, data); printf("SSL App Data(%d:%d):%s\n", packetNumber, ret, data);
} }
} }
else if (saveFile) else if (saveFile)