From ca5dc95043ff902f0b65d9c848b885ab016ffa14 Mon Sep 17 00:00:00 2001 From: William Robinet Date: Thu, 10 Aug 2023 16:29:45 +0200 Subject: [PATCH] Make it work on OpenBSD and FreeBSD --- CMakeLists.txt | 4 +--- README.md | 17 +++++++++++++++-- base/pcap-snoop.c | 1 - base/pcap-snoop.c.in | 2 ++ pcap/pcap_logger.c | 2 ++ ssl/ssl.enums.c | 2 +- ssl/ssl_analyze.c | 2 +- ssl/sslprint.c | 2 +- ssl/sslxprint.c | 2 +- 9 files changed, 24 insertions(+), 10 deletions(-) delete mode 120000 base/pcap-snoop.c diff --git a/CMakeLists.txt b/CMakeLists.txt index fd79bdd..8e9964f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,8 +1,6 @@ cmake_minimum_required(VERSION 3.16.3) include(CheckSymbolExists) -set(CMAKE_VERBOSE_MAKEFILE ON) - project( ssldump VERSION 1.8 @@ -100,7 +98,7 @@ target_include_directories(ssldump ${OPENSSL_INCLUDE_DIR} ${PCAP_INCLUDE_DIR} ${LIBNET_INCLUDE_DIR} - ${JSONC_INCLUDE_DIRS} + ${JSONC_INCLUDE_DIR} ) target_link_libraries(ssldump diff --git a/README.md b/README.md index e01df02..43f299c 100644 --- a/README.md +++ b/README.md @@ -55,21 +55,34 @@ other too (but this is just a collateral damage). 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): ``` -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: ``` +git clone https://github.com/adulau/ssldump.git +cd ssldump cmake -G Ninja -B build ninja -C build ./build/ssldump -v (optional, as root) ninja -C build install ``` + # Notes The "save to pcap" (-w) option by @ryabkov, is heavily based on the work of diff --git a/base/pcap-snoop.c b/base/pcap-snoop.c deleted file mode 120000 index a087352..0000000 --- a/base/pcap-snoop.c +++ /dev/null @@ -1 +0,0 @@ -../build/base/pcap-snoop.c \ No newline at end of file diff --git a/base/pcap-snoop.c.in b/base/pcap-snoop.c.in index e7ddd8e..b28435b 100644 --- a/base/pcap-snoop.c.in +++ b/base/pcap-snoop.c.in @@ -51,7 +51,9 @@ #include #include +#ifndef __OpenBSD__ #include +#endif #ifndef _WIN32 #include #endif diff --git a/pcap/pcap_logger.c b/pcap/pcap_logger.c index 4f76eed..a2ada57 100644 --- a/pcap/pcap_logger.c +++ b/pcap/pcap_logger.c @@ -1,7 +1,9 @@ #include #include +#ifndef __OpenBSD__ #include +#endif #include #include #include diff --git a/ssl/ssl.enums.c b/ssl/ssl.enums.c index 2ecbd63..0f4eb4f 100644 --- a/ssl/ssl.enums.c +++ b/ssl/ssl.enums.c @@ -1,4 +1,4 @@ -#include +#include #include #include "network.h" #include "ssl_h.h" diff --git a/ssl/ssl_analyze.c b/ssl/ssl_analyze.c index 188f2b7..de2d7f0 100644 --- a/ssl/ssl_analyze.c +++ b/ssl/ssl_analyze.c @@ -44,7 +44,7 @@ */ -#include +#include #include #include #include "network.h" diff --git a/ssl/sslprint.c b/ssl/sslprint.c index 355db29..7e62bbb 100644 --- a/ssl/sslprint.c +++ b/ssl/sslprint.c @@ -44,7 +44,7 @@ */ -#include +#include #include #include #include "network.h" diff --git a/ssl/sslxprint.c b/ssl/sslxprint.c index 4127eb4..3e0f02a 100644 --- a/ssl/sslxprint.c +++ b/ssl/sslxprint.c @@ -44,7 +44,7 @@ */ -#include +#include #include "network.h" #include "ssl_h.h" #include "sslprint.h"