forked from wolfSSL/wolfssl
Sniffer Update
1. Collect the SSL Info capture into its own function. 2. Add a Trace function for the SSL Info. 3. When copying the IANA name for the cipher suite, use a strncpy instead of a memcpy and cap the copy at the length of the destination. Force a null terminator at the end of the destination, just in case. 4. Modify the snifftest to collect the SSL Info.
This commit is contained in:
@@ -295,6 +295,7 @@ int main(int argc, char** argv)
|
||||
static int packetNumber = 0;
|
||||
struct pcap_pkthdr header;
|
||||
const unsigned char* packet = pcap_next(pcap, &header);
|
||||
SSLInfo sslInfo;
|
||||
packetNumber++;
|
||||
if (packet) {
|
||||
|
||||
@@ -307,7 +308,8 @@ int main(int argc, char** argv)
|
||||
else
|
||||
continue;
|
||||
|
||||
ret = ssl_DecodePacket(packet, header.caplen, &data, err);
|
||||
ret = ssl_DecodePacketWithSessionInfo(packet, header.caplen, &data,
|
||||
&sslInfo, err);
|
||||
if (ret < 0) {
|
||||
printf("ssl_Decode ret = %d, %s\n", ret, err);
|
||||
hadBadPacket = 1;
|
||||
|
Reference in New Issue
Block a user