6 * Copyright (C) 1987 by the Massachusetts Institute of Technology
7 * For copying and distribution information, please see the file
10 * Handles the client side of the sending of authenticators to
15 static char *rcsid_sms_auth_c = "$Header$";
18 #include <mit-copyright.h>
19 #include "sms_private.h"
23 /* Authenticate this client with the SMS server. prog is the name of the
24 * client program, and will be recorded in the database.
37 register sms_params *params = ¶ms_st;
38 sms_params *reply = NULL;
44 * Build a Kerberos authenticator.
45 * The "service" and "instance" should not be hardcoded here.
48 bzero(host, sizeof(host));
49 if (status = sms_host(host, sizeof(host) - 1))
52 strcpy(realm, krb_realmofhost(host));
54 status = krb_mk_req(&auth, "sms", "sms", realm, 0);
55 if (status != KSUCCESS) {
56 status += ERROR_TABLE_BASE_krb;
59 params->sms_version_no = sending_version_no;
60 params->sms_procno = SMS_AUTH;
62 params->sms_argv = args;
63 params->sms_argl = argl;
64 params->sms_argv[0] = (char *)auth.dat;
65 params->sms_argl[0] = auth.length;
66 params->sms_argv[1] = prog;
67 params->sms_argl[1] = strlen(prog) + 1;
69 if (sending_version_no == SMS_VERSION_1)
72 if ((status = sms_do_call(params, &reply)) == 0)
73 status = reply->sms_status;
75 sms_destroy_reply(reply);