Make it work on OpenBSD and FreeBSD

This commit is contained in:
William Robinet 2023-08-10 16:29:45 +02:00
parent a01f07f999
commit ca5dc95043
No known key found for this signature in database
GPG key ID: 003FA3DF74C7A949
9 changed files with 24 additions and 10 deletions

View file

@ -1,8 +1,6 @@
cmake_minimum_required(VERSION 3.16.3) cmake_minimum_required(VERSION 3.16.3)
include(CheckSymbolExists) include(CheckSymbolExists)
set(CMAKE_VERBOSE_MAKEFILE ON)
project( project(
ssldump ssldump
VERSION 1.8 VERSION 1.8
@ -100,7 +98,7 @@ target_include_directories(ssldump
${OPENSSL_INCLUDE_DIR} ${OPENSSL_INCLUDE_DIR}
${PCAP_INCLUDE_DIR} ${PCAP_INCLUDE_DIR}
${LIBNET_INCLUDE_DIR} ${LIBNET_INCLUDE_DIR}
${JSONC_INCLUDE_DIRS} ${JSONC_INCLUDE_DIR}
) )
target_link_libraries(ssldump target_link_libraries(ssldump

View file

@ -55,21 +55,34 @@ other too (but this is just a collateral damage).
Install dependencies on Debian & Ubuntu (as root): Install dependencies on Debian & Ubuntu (as root):
``` ```
apt install build-essential cmake ninja-build libssl-dev libpcap-dev libnet1-dev libjson-c-dev apt install build-essential git cmake ninja-build libssl-dev libpcap-dev libnet1-dev libjson-c-dev
``` ```
On Fedora, CentOS, RHEL & Rocky (as root): On Fedora, CentOS, RHEL & Rocky (as root):
``` ```
dnf install cmake ninja-build gcc openssl-devel libpcap-devel libnet-devel json-c-devel dnf install git cmake ninja-build gcc openssl-devel libpcap-devel libnet-devel json-c-devel
```
On OpenBSD (as root):
```
pkg_add git cmake ninja json-c libnet
```
On FreeBSD (as root):
```
pkg install git cmake ninja json-c libnet
``` ```
Compile & install: Compile & install:
``` ```
git clone https://github.com/adulau/ssldump.git
cd ssldump
cmake -G Ninja -B build cmake -G Ninja -B build
ninja -C build ninja -C build
./build/ssldump -v ./build/ssldump -v
(optional, as root) ninja -C build install (optional, as root) ninja -C build install
``` ```
# Notes # Notes
The "save to pcap" (-w) option by @ryabkov, is heavily based on the work of The "save to pcap" (-w) option by @ryabkov, is heavily based on the work of

View file

@ -1 +0,0 @@
../build/base/pcap-snoop.c

View file

@ -51,7 +51,9 @@
#include <pcap.h> #include <pcap.h>
#include <unistd.h> #include <unistd.h>
#ifndef __OpenBSD__
#include <pcap-bpf.h> #include <pcap-bpf.h>
#endif
#ifndef _WIN32 #ifndef _WIN32
#include <sys/param.h> #include <sys/param.h>
#endif #endif

View file

@ -1,7 +1,9 @@
#include <pcap.h> #include <pcap.h>
#include <unistd.h> #include <unistd.h>
#ifndef __OpenBSD__
#include <pcap-bpf.h> #include <pcap-bpf.h>
#endif
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <fcntl.h> #include <fcntl.h>

View file

@ -1,4 +1,4 @@
#include <json-c/json.h> #include <json.h>
#include <openssl/md5.h> #include <openssl/md5.h>
#include "network.h" #include "network.h"
#include "ssl_h.h" #include "ssl_h.h"

View file

@ -44,7 +44,7 @@
*/ */
#include <json-c/json.h> #include <json.h>
#include <arpa/inet.h> #include <arpa/inet.h>
#include <netdb.h> #include <netdb.h>
#include "network.h" #include "network.h"

View file

@ -44,7 +44,7 @@
*/ */
#include <json-c/json.h> #include <json.h>
#include <ctype.h> #include <ctype.h>
#include <stdarg.h> #include <stdarg.h>
#include "network.h" #include "network.h"

View file

@ -44,7 +44,7 @@
*/ */
#include <json-c/json.h> #include <json.h>
#include "network.h" #include "network.h"
#include "ssl_h.h" #include "ssl_h.h"
#include "sslprint.h" #include "sslprint.h"