1*7f2fe78bSCy Schubert[Out of date; needs updating for thread safety test support. -- KR 2005-02-09] 2*7f2fe78bSCy Schubert 3*7f2fe78bSCy Schubert# Copyright 1993 by OpenVision Technologies, Inc. 4*7f2fe78bSCy Schubert# 5*7f2fe78bSCy Schubert# Permission to use, copy, modify, distribute, and sell this software 6*7f2fe78bSCy Schubert# and its documentation for any purpose is hereby granted without fee, 7*7f2fe78bSCy Schubert# provided that the above copyright notice appears in all copies and 8*7f2fe78bSCy Schubert# that both that copyright notice and this permission notice appear in 9*7f2fe78bSCy Schubert# supporting documentation, and that the name of OpenVision not be used 10*7f2fe78bSCy Schubert# in advertising or publicity pertaining to distribution of the software 11*7f2fe78bSCy Schubert# without specific, written prior permission. OpenVision makes no 12*7f2fe78bSCy Schubert# representations about the suitability of this software for any 13*7f2fe78bSCy Schubert# purpose. It is provided "as is" without express or implied warranty. 14*7f2fe78bSCy Schubert# 15*7f2fe78bSCy Schubert# OPENVISION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, 16*7f2fe78bSCy Schubert# INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO 17*7f2fe78bSCy Schubert# EVENT SHALL OPENVISION BE LIABLE FOR ANY SPECIAL, INDIRECT OR 18*7f2fe78bSCy Schubert# CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF 19*7f2fe78bSCy Schubert# USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 20*7f2fe78bSCy Schubert# OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 21*7f2fe78bSCy Schubert# PERFORMANCE OF THIS SOFTWARE. 22*7f2fe78bSCy Schubert 23*7f2fe78bSCy SchubertThis directory contains a sample GSS-API client and server 24*7f2fe78bSCy Schubertapplication. In addition to serving as an example of GSS-API 25*7f2fe78bSCy Schubertprogramming, this application is also intended to be a tool for 26*7f2fe78bSCy Schuberttesting the performance of GSS-API implementations. 27*7f2fe78bSCy Schubert 28*7f2fe78bSCy SchubertEach time the client is invoked, it performs one or more exchanges 29*7f2fe78bSCy Schubertwith the server. Each exchange with the server consists primarily of 30*7f2fe78bSCy Schubertthe following steps: 31*7f2fe78bSCy Schubert 32*7f2fe78bSCy Schubert 1. A TCP/IP connection is established. 33*7f2fe78bSCy Schubert 34*7f2fe78bSCy Schubert 2. (optional, on by default) The client and server establish a 35*7f2fe78bSCy Schubert GSS-API context, and the server prints the identify of the 36*7f2fe78bSCy Schubert client. 37*7f2fe78bSCy Schubert 38*7f2fe78bSCy Schubert / 3. The client sends a message to the server. The message may 39*7f2fe78bSCy Schubert / be plaintext, cryptographically "signed" but not encrypted, 40*7f2fe78bSCy Schubert | or encrypted (default). 41*7f2fe78bSCy Schubert | 42*7f2fe78bSCy Schubert0 or | 4. The server decrypts the message (if necessary), verifies 43*7f2fe78bSCy Schubertmore | its signature (if there is one) and prints it. 44*7f2fe78bSCy Schuberttimes| 45*7f2fe78bSCy Schubert | 5. The server sends either a signature block (the default) or an 46*7f2fe78bSCy Schubert | empty token back to the client to acknowledge the message. 47*7f2fe78bSCy Schubert \ 48*7f2fe78bSCy Schubert \ 6. If the server sent a signature block, the client verifies 49*7f2fe78bSCy Schubert it and prints a message indicating that it was verified. 50*7f2fe78bSCy Schubert 51*7f2fe78bSCy Schubert 7. The client sends an empty block to the server to tell it 52*7f2fe78bSCy Schubert that the exchange is finished. 53*7f2fe78bSCy Schubert 54*7f2fe78bSCy Schubert 8. The client and server close the TCP/IP connection and 55*7f2fe78bSCy Schubert destroy the GSS-API context. 56*7f2fe78bSCy Schubert 57*7f2fe78bSCy SchubertThe client also supports the -v1 flag which uses an older exchange 58*7f2fe78bSCy Schubertformat compatible with previous releases of Kerberos and with samples 59*7f2fe78bSCy Schubertshipped in the Microsoft SDK. 60*7f2fe78bSCy Schubert 61*7f2fe78bSCy SchubertThe server's command line usage is 62*7f2fe78bSCy Schubert 63*7f2fe78bSCy Schubert gss-server [-port port] [-verbose] [-once] [-inetd] [-export] 64*7f2fe78bSCy Schubert [-logfile file] service_name 65*7f2fe78bSCy Schubert 66*7f2fe78bSCy Schubertwhere service_name is a GSS-API service name of the form 67*7f2fe78bSCy Schubert"service@host" (or just "service", in which case the local host name 68*7f2fe78bSCy Schubertis used). The command-line options have the following meanings: 69*7f2fe78bSCy Schubert 70*7f2fe78bSCy Schubert-port The TCP port on which to accept connections. Default is 4444. 71*7f2fe78bSCy Schubert 72*7f2fe78bSCy Schubert-once Tells the server to exit after a single exchange, rather than 73*7f2fe78bSCy Schubert persisting. 74*7f2fe78bSCy Schubert 75*7f2fe78bSCy Schubert-inetd Tells the server that it is running out of inetd, so it should 76*7f2fe78bSCy Schubert interact with the client on stdin rather than binding to a 77*7f2fe78bSCy Schubert network port. Implies "-once". 78*7f2fe78bSCy Schubert 79*7f2fe78bSCy Schubert-export Tells the server to test the gss_export_sec_context function 80*7f2fe78bSCy Schubert after establishing a context with a client. 81*7f2fe78bSCy Schubert 82*7f2fe78bSCy Schubert-logfile 83*7f2fe78bSCy Schubert The file to which the server should append its output, rather 84*7f2fe78bSCy Schubert than sending it to stdout. 85*7f2fe78bSCy Schubert 86*7f2fe78bSCy SchubertThe client's command line usage is 87*7f2fe78bSCy Schubert 88*7f2fe78bSCy Schubert gss-client [-port port] [-mech mechanism] [-d] [-f] [-q] 89*7f2fe78bSCy Schubert [-seq] [-noreplay] [-nomutual] 90*7f2fe78bSCy Schubert [-ccount count] [-mcount count] [-na] [-nw] [-nx] [-nm] 91*7f2fe78bSCy Schubert host service_name msg 92*7f2fe78bSCy Schubert 93*7f2fe78bSCy Schubertwhere host is the host running the server, service_name is the service 94*7f2fe78bSCy Schubertname that the server will establish connections as (if you don't 95*7f2fe78bSCy Schubertspecify the host name in the service name when running gss-server, and 96*7f2fe78bSCy Schubertit's running on a different machine from gss-client, make sure to 97*7f2fe78bSCy Schubertspecify the server's host name in the service name you specify to 98*7f2fe78bSCy Schubertgss-client!) and msg is the message. The command-line options have 99*7f2fe78bSCy Schubertthe following meanings: 100*7f2fe78bSCy Schubert 101*7f2fe78bSCy Schubert-port The TCP port to which to connect. Default is 4444. 102*7f2fe78bSCy Schubert 103*7f2fe78bSCy Schubert-mech The OID of the GSS-API mechanism to use. 104*7f2fe78bSCy Schubert 105*7f2fe78bSCy Schubert-d Tells the client to delegate credentials to the server. For 106*7f2fe78bSCy Schubert the Kerberos GSS-API mechanism, this means that a forwardable 107*7f2fe78bSCy Schubert TGT will be sent to the server, which will put it in its 108*7f2fe78bSCy Schubert credential cache (you must have acquired your tickets with 109*7f2fe78bSCy Schubert "kinit -f" for this to work). 110*7f2fe78bSCy Schubert 111*7f2fe78bSCy Schubert-seq Tells the client to enforce ordered message delivery via 112*7f2fe78bSCy Schubert sequencing. 113*7f2fe78bSCy Schubert 114*7f2fe78bSCy Schubert-noreplay Tells the client to disable the use of replay 115*7f2fe78bSCy Schubert detection. 116*7f2fe78bSCy Schubert 117*7f2fe78bSCy Schubert-nomutual Tells the client to disable the use of mutual authentication. 118*7f2fe78bSCy Schubert 119*7f2fe78bSCy Schubert-f Tells the client that the "msg" argument is actually the name 120*7f2fe78bSCy Schubert of a file whose contents should be used as the message. 121*7f2fe78bSCy Schubert 122*7f2fe78bSCy Schubert-q Tells the client to be quiet, i.e., to only print error 123*7f2fe78bSCy Schubert messages. 124*7f2fe78bSCy Schubert 125*7f2fe78bSCy Schubert-ccount Specifies how many sessions the client should initiate with 126*7f2fe78bSCy Schubert the server (the "connection count"). 127*7f2fe78bSCy Schubert 128*7f2fe78bSCy Schubert-mcount Specifies how many times the message should be sent to the 129*7f2fe78bSCy Schubert server in each session (the "message count"). 130*7f2fe78bSCy Schubert 131*7f2fe78bSCy Schubert-na Tells the client not to do any authentication with the 132*7f2fe78bSCy Schubert server. Implies "-nw", "-nx" and "-nm". 133*7f2fe78bSCy Schubert 134*7f2fe78bSCy Schubert-nw Tells the client not to "wrap" messages. Implies "-nx". 135*7f2fe78bSCy Schubert 136*7f2fe78bSCy Schubert-nx Tells the client not to encrypt messages. 137*7f2fe78bSCy Schubert 138*7f2fe78bSCy Schubert-nm Tells the client not to ask the server to send back a 139*7f2fe78bSCy Schubert cryptographic checksum ("MIC"). 140*7f2fe78bSCy Schubert 141*7f2fe78bSCy SchubertTo run the server on a host, you need to make sure that the principal 142*7f2fe78bSCy Schubertcorresponding to service_name is in the default keytab on the server 143*7f2fe78bSCy Schuberthost, and that the gss-server process can read the keytab. For 144*7f2fe78bSCy Schubertexample, the service name "host@server" corresponds to the Kerberos 145*7f2fe78bSCy Schubertprincipal "host/server.domain.com@REALM". 146*7f2fe78bSCy Schubert 147*7f2fe78bSCy SchubertThis sample application uses the following GSS-API functions: 148*7f2fe78bSCy Schubert 149*7f2fe78bSCy Schubert gss_accept_sec_context gss_inquire_names_for_mech 150*7f2fe78bSCy Schubert gss_acquire_cred gss_oid_to_str 151*7f2fe78bSCy Schubert gss_delete_sec_context gss_release_buffer 152*7f2fe78bSCy Schubert gss_display_name gss_release_cred 153*7f2fe78bSCy Schubert gss_display_status gss_release_name 154*7f2fe78bSCy Schubert gss_export_sec_context gss_release_oid 155*7f2fe78bSCy Schubert gss_get_mic gss_release_oid_set 156*7f2fe78bSCy Schubert gss_import_name gss_str_to_oid 157*7f2fe78bSCy Schubert gss_import_sec_context gss_unwrap 158*7f2fe78bSCy Schubert gss_init_sec_context gss_verify_mic 159*7f2fe78bSCy Schubert gss_inquire_context gss_wrap 160*7f2fe78bSCy Schubert 161*7f2fe78bSCy SchubertThis application was originally written by Barry Jaspan of OpenVision 162*7f2fe78bSCy SchubertTechnologies, Inc. It was updated significantly by Jonathan Kamens of 163*7f2fe78bSCy SchubertOpenVision Technologies, Inc. 164*7f2fe78bSCy Schubert 165*7f2fe78bSCy Schubert$Id$ 166