xref: /illumos-gate/usr/src/test/os-tests/tests/tcpsig/tcpsig_init.ksh (revision 8119dad84d6416f13557b0ba8e2aaf9064cbcfd3)
1#!/usr/bin/ksh
2#
3# This file and its contents are supplied under the terms of the
4# Common Development and Distribution License ("CDDL"), version 1.0.
5# You may only use this file in accordance with the terms of version
6# 1.0 of the CDDL.
7#
8# A full copy of the text of the CDDL should have accompanied this
9# source.  A copy of the CDDL is also available via the Internet at
10# http://www.illumos.org/license/CDDL.
11#
12
13#
14# Copyright 2024 Oxide Computer Company
15#
16
17AUTHSTR="I want a biscuit, yes, twice cooked!"
18ALTAUTHSTR="x$AUTHSTR"
19
20for ip in 127.0.0.1 ::1; do
21	/usr/sbin/tcpkey 2>&1 <<- EOM || exit 1
22	# A matching pair
23	add src $ip dst $ip dport 24135 authalg md5 authstring "$AUTHSTR"
24	add src $ip dst $ip sport 24135 authalg md5 authstring "$AUTHSTR"
25	# Mismatched keys
26	add src $ip dst $ip dport 24136 authalg md5 authstring "$AUTHSTR"
27	add src $ip dst $ip sport 24136 authalg md5 authstring "$ALTAUTHSTR"
28	# Outbound entry only
29	add src $ip dst $ip dport 24137 authalg md5 authstring "$AUTHSTR"
30	# Inbound entry only
31	add src $ip dst $ip sport 24138 authalg md5 authstring "$AUTHSTR"
32	EOM
33done
34
35exit 0
36