Skip to content

Commit

Permalink
modules: Add stirshaken module
Browse files Browse the repository at this point in the history
This module uses libstirshaken to implement STIR-Shaken authentication and verification functions (STI-AS/VS).
It allows for easy verification of a SIP call containing PASSporT wrapped into SIP Identity Header using a specific certificate,
or a specific key, or by performing complete check on PASSporT including downloading certificate referenced in it's x5u header,
and optionally checking it against trusted root certificates (X509 cert path check). Certificates may be cached and loaded from disk.

Example usage:

loadmodule "stirshaken"
modparam("stirshaken", "as_default_key", "/path/to/key")

modparam("stirshaken", "vs_verify_x509_cert_path", 1)
modparam("stirshaken", "vs_ca_dir", "/path/to/ca")
modparam("stirshaken", "vs_cache_certificates", 1)
modparam("stirshaken", "vs_cache_dir", "/tmp/cert_cache")
modparam("stirshaken", "vs_cache_expire_s", 90)

request_route {
	(...)
	stirshaken_add_identity("https://sp.com/sp.pem", "B", "+44100", "+44200", "ref");
	(...)

request_route {
	(...)
	stirshaken_check_identity();
	(...)
  • Loading branch information
piotr-gregor committed Mar 16, 2021
1 parent b2b7ec8 commit a7f2229
Show file tree
Hide file tree
Showing 2 changed files with 1,000 additions and 0 deletions.
28 changes: 28 additions & 0 deletions src/modules/stirshaken/Makefile
@@ -0,0 +1,28 @@
#
# stirshaken module makefile
#
# WARNING: do not run this directly, it should be run by the main Makefile

include ../../Makefile.defs
auto_gen=
NAME=stirshaken.so

ifeq ($(CROSS_COMPILE),)
BUILDER = $(shell which pkg-config)
ifneq ($(BUILDER),)
PKGLIBSECSIPID = $(shell $(BUILDER) --exists stirshaken > /dev/null 2>&1 ; echo $$? )
ifneq ($(PKGLIBSECSIPID),0)
BUILDER =
endif
endif
endif

ifeq ($(BUILDER),)
DEFS+= -I.
LIBS = -L. -lstirshaken
else
DEFS+= $(shell pkg-config --cflags stirshaken)
LIBS = $(shell pkg-config --libs stirshaken)
endif

include ../../Makefile.modules

0 comments on commit a7f2229

Please sign in to comment.