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