2 # Blackbox tests for pkinit and pac verification
3 # Copyright (C) 2006-2008 Stefan Metzmacher
7 Usage: test_pkinit_pac_heimdal.sh SERVER USERNAME PASSWORD REALM DOMAIN PREFIX ENCTYPE
22 samba4bindir
="$BINDIR"
23 samba4srcdir
="$SRCDIR/source4"
25 if test -x $BINDIR/samba4kinit
; then
26 samba4kinit
=$BINDIR/samba4kinit
29 smbtorture4
="$samba4bindir/smbtorture"
31 .
`dirname $0`/subunit.sh
32 .
`dirname $0`/common_test_fns.inc
37 KRB5CCNAME_PATH
="$PREFIX/tmpccache"
38 KRB5CCNAME
="FILE:$KRB5CCNAME_PATH"
40 rm -f $KRB5CCNAME_PATH
41 PASSFILE_PATH
="$PREFIX/tmppassfile"
43 echo $PASSWORD > $PASSFILE_PATH
45 USER_PRINCIPAL_NAME
=`echo "${USERNAME}@${REALM}" | tr A-Z a-z`
46 PKUSER
="--pk-user=FILE:$PREFIX/pkinit/USER-${USER_PRINCIPAL_NAME}-cert.pem,$PREFIX/pkinit/USER-${USER_PRINCIPAL_NAME}-private-key.pem"
48 testit
"STEP1 kinit with pkinit (name specified) " $samba4kinit $enctype --request-pac --renewable $PKUSER $USERNAME@
$REALM || failed
=`expr $failed + 1`
49 testit
"STEP1 remote.pac verification" $smbtorture4 ncacn_np
:$SERVER rpc.pac
--workgroup=$DOMAIN -U$USERNAME%$PASSWORD --krb5-ccache=$KRB5CCNAME --option=torture
:pkinit_in_use
=yes || failed
=`expr $failed + 1`
52 rm -f $KRB5CCNAME_PATH