]>
Commit | Line | Data |
---|---|---|
e2a67c78 | 1 | /* |
2 | * $Source$ | |
3 | * $Author$ | |
4 | * $Header$ | |
5 | * | |
6 | * Copyright (C) 1987 by the Massachusetts Institute of Technology | |
7 | * | |
8 | * $Log$ | |
83e80378 | 9 | * Revision 1.3 1987-06-16 17:47:20 wesommer |
10 | * Clean up memory allocation, indenting. | |
e2a67c78 | 11 | * |
83e80378 | 12 | * Revision 1.2 87/05/31 22:03:23 wesommer |
13 | * It's working better. | |
14 | * | |
20e1c093 | 15 | * Revision 1.1 87/05/20 03:11:18 wesommer |
16 | * Initial revision | |
17 | * | |
e2a67c78 | 18 | * |
19 | * Handles the client side of the sending of authenticators to | |
20 | * the sms server. | |
21 | */ | |
22 | ||
23 | #ifndef lint | |
24 | static char *rcsid_sms_auth_c = "$Header$"; | |
25 | #endif lint | |
26 | ||
27 | #include "sms_private.h" | |
28 | #include <krb.h> | |
29 | ||
20e1c093 | 30 | extern int krb_err_base; |
31 | ||
e2a67c78 | 32 | int sms_auth() |
33 | { | |
83e80378 | 34 | register int status; |
35 | sms_params params_st; | |
36 | char *args[1]; | |
37 | int argl[1]; | |
38 | ||
39 | register sms_params *params = ¶ms_st; | |
40 | sms_params *reply = NULL; | |
41 | KTEXT_ST auth; | |
42 | ||
43 | CHECK_CONNECTED; | |
e2a67c78 | 44 | |
83e80378 | 45 | /* |
46 | * Build a Kerberos authenticator. | |
47 | * The "service" and "instance" should not be hardcoded here. | |
48 | */ | |
e2a67c78 | 49 | |
83e80378 | 50 | status = mk_ap_req(&auth, "sms", "sms", "ATHENA.MIT.EDU", 0); |
51 | if (status != KSUCCESS) { | |
52 | status += krb_err_base; | |
53 | return status; | |
54 | } | |
55 | params->sms_procno = SMS_AUTH; | |
56 | params->sms_argc = 1; | |
57 | params->sms_argv = args; | |
58 | params->sms_argl = argl; | |
59 | params->sms_argv[0] = (char *)auth.dat; | |
60 | params->sms_argl[0] = auth.length; | |
e2a67c78 | 61 | |
83e80378 | 62 | if ((status = sms_do_call(params, &reply)) == 0) |
63 | status = reply->sms_status; | |
e2a67c78 | 64 | |
83e80378 | 65 | sms_destroy_reply(reply); |
66 | ||
67 | return status; | |
e2a67c78 | 68 | } |
83e80378 | 69 | |
70 | /* | |
71 | * Local Variables: | |
72 | * mode: c | |
73 | * c-indent-level: 4 | |
74 | * c-continued-statement-offset: 4 | |
75 | * c-brace-offset: -4 | |
76 | * c-argdecl-indent: 4 | |
77 | * c-label-offset: -4 | |
78 | * End: | |
79 | */ |