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