1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-07-29 13:01:13 +03:00

feat: add tests for gssapi-with-mic

feat: tests set hostname for sshd, make GSSAPIStrictAcceptorCheck yes pass

feat: add GSSAPI_TESTING cmake option

feat: gssapi libssh server test

feat: make kdc setup and teardown functions

feat: add kinit, kadmin scripts to kdc setup function

feat: add some client gssapi auth tests

Signed-off-by: Gauravsingh Sisodia <xaerru@gmail.com>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Sahana Prasad <sahana@redhat.com>
This commit is contained in:
Gauravsingh Sisodia
2024-03-29 06:47:36 +00:00
committed by Sahana Prasad
parent 6d1ed76c7a
commit 74d42ca38b
14 changed files with 867 additions and 19 deletions

52
tests/gss/kdcsetup.sh Executable file
View File

@ -0,0 +1,52 @@
#!/bin/sh
SOCKDIR=$1
WORKDIR=$SOCKDIR/gss
mkdir "$WORKDIR"/k "$WORKDIR"/d
cat<<EOF > "$WORKDIR"/k/kdc.conf
[realms]
LIBSSH.SITE = {
database_name = $WORKDIR/principal
key_stash_file = $WORKDIR/stash
kdc_listen = $(hostname -f)
kdc_tcp_listen = $(hostname -f)
default_principal_flags = +preauth
}
[logging]
kdc = FILE:$WORKDIR/kdc.log
debug = true
EOF
cat<<EOF > "$WORKDIR"/k/krb5.conf
[libdefaults]
default_realm = LIBSSH.SITE
[realms]
LIBSSH.SITE = {
kdc = $(hostname -f)
}
[domain_realm]
.$(hostname -d) = LIBSSH.SITE
EOF
kdb5_util -P foo create -s
bash "$WORKDIR"/kadmin.sh
krb5kdc -w 1 -P "$WORKDIR"/pid
# Wait till KDC binds to the ports, 0x58 is port 88
i=0
while [ ! -S "$SOCKDIR"/T0B0058 ] && [ ! -S "$SOCKDIR"/U0B0058 ]; do
i=$((i + 1))
[ "$i" -eq 5 ] && exit 1
sleep 1
done
bash "$WORKDIR"/kinit.sh
klist
exit 0