6 * Copyright (C) 1987 by the Massachusetts Institute of Technology
9 * Revision 1.7 1988-06-21 13:46:05 mar
10 * changed name of kerberos call
12 * Revision 1.6 88/06/01 15:31:53 mar
13 * make auth do the right thing for version 2 of the protocol
15 * Revision 1.5 88/04/19 12:40:29 mar
16 * pass version number on queries
18 * Revision 1.4 87/10/20 15:09:22 mar
19 * replace hardcoded ATHENA realm with call to get_krbrlm();
21 * Revision 1.3 87/06/16 17:47:20 wesommer
22 * Clean up memory allocation, indenting.
24 * Revision 1.2 87/05/31 22:03:23 wesommer
25 * It's working better.
27 * Revision 1.1 87/05/20 03:11:18 wesommer
31 * Handles the client side of the sending of authenticators to
36 static char *rcsid_sms_auth_c = "$Header$";
39 #include "sms_private.h"
42 extern int krb_err_base;
44 /* Authenticate this client with the SMS server. prog is the name of the
45 * client program, and will be recorded in the database.
57 register sms_params *params = ¶ms_st;
58 sms_params *reply = NULL;
64 * Build a Kerberos authenticator.
65 * The "service" and "instance" should not be hardcoded here.
68 if ((status = get_krbrlm(realm, 1)) != KSUCCESS) {
71 status = krb_mk_req(&auth, "sms", "sms", realm, 0);
72 if (status != KSUCCESS) {
73 status += krb_err_base;
76 params->sms_version_no = sending_version_no;
77 params->sms_procno = SMS_AUTH;
79 params->sms_argv = args;
80 params->sms_argl = argl;
81 params->sms_argv[0] = (char *)auth.dat;
82 params->sms_argl[0] = auth.length;
83 params->sms_argv[1] = prog;
84 params->sms_argl[1] = strlen(prog) + 1;
86 if (sending_version_no == SMS_VERSION_1)
89 if ((status = sms_do_call(params, &reply)) == 0)
90 status = reply->sms_status;
92 sms_destroy_reply(reply);
101 * c-continued-statement-offset: 4
103 * c-argdecl-indent: 4