mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-30 18:57:27 +02:00
Merge pull request #3459 from haydenroche5/sniffer_fixes
Fix a couple of issues related to the sniffer.
This commit is contained in:
@ -4730,7 +4730,7 @@ static int CheckPreRecord(IpInfo* ipInfo, TcpInfo* tcpInfo,
|
|||||||
word32 i, offset, headerSz, qty, remainder;
|
word32 i, offset, headerSz, qty, remainder;
|
||||||
|
|
||||||
Trace(CHAIN_INPUT_STR);
|
Trace(CHAIN_INPUT_STR);
|
||||||
headerSz = (word32)*sslFrame - (word32)chain[0].iov_base;
|
headerSz = (word32)((const byte*)*sslFrame - (const byte*)chain[0].iov_base);
|
||||||
remainder = *sslBytes;
|
remainder = *sslBytes;
|
||||||
|
|
||||||
if ( (*sslBytes + length) > ssl->buffers.inputBuffer.bufferSize) {
|
if ( (*sslBytes + length) > ssl->buffers.inputBuffer.bufferSize) {
|
||||||
|
@ -519,15 +519,27 @@ int main(int argc, char** argv)
|
|||||||
#endif
|
#endif
|
||||||
ret = ssl_SetPrivateKey(server, port, argv[2],
|
ret = ssl_SetPrivateKey(server, port, argv[2],
|
||||||
FILETYPE_PEM, passwd, err);
|
FILETYPE_PEM, passwd, err);
|
||||||
|
|
||||||
if (ret == 0)
|
if (ret == 0)
|
||||||
loadCount++;
|
loadCount++;
|
||||||
if (loadCount > 0) {
|
|
||||||
ret = 0;
|
if (loadCount == 0) {
|
||||||
}
|
|
||||||
else {
|
|
||||||
printf("Failed loading private key %d\n", ret);
|
printf("Failed loading private key %d\n", ret);
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Only let through TCP/IP packets */
|
||||||
|
ret = pcap_compile(pcap, &fp, "(ip6 or ip) and tcp", 0, 0);
|
||||||
|
if (ret != 0) {
|
||||||
|
printf("pcap_compile failed %s\n", pcap_geterr(pcap));
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
|
|
||||||
|
ret = pcap_setfilter(pcap, &fp);
|
||||||
|
if (ret != 0) {
|
||||||
|
printf("pcap_setfilter failed %s\n", pcap_geterr(pcap));
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
Reference in New Issue
Block a user