1 /*
2 * Copyright (c) 1996,1997, by Sun Microsystems, Inc.
3 * All rights reserved.
4 */
5
6 #pragma ident "@(#)g_context_time.c 1.13 04/09/08 SMI"
7
8 /*
9 * glue routines for gss_context_time
10 */
11
12 #include <mechglueP.h>
13
14 OM_uint32
15 gss_context_time(minor_status,
16 context_handle,
17 time_rec)
18
19 OM_uint32 * minor_status;
20 const gss_ctx_id_t context_handle;
21 OM_uint32 * time_rec;
22 {
23 OM_uint32 status;
24 gss_union_ctx_id_t ctx;
25 gss_mechanism mech;
26
27 gss_initialize();
28
29 /*
30 * select the approprate underlying mechanism routine and
31 * call it.
32 */
33
34 ctx = (gss_union_ctx_id_t) context_handle;
35 mech = __gss_get_mechanism(ctx->mech_type);
36
37 if (mech) {
38
39 if (mech->gss_context_time)
40 status = mech->gss_context_time(
41 mech->context,
42 minor_status,
43 ctx->internal_ctx_id,
44 time_rec);
45 else
46 status = GSS_S_BAD_BINDINGS;
47
48 return (status);
49 }
50
51 return (GSS_S_NO_CONTEXT);
52 }
|
1 /*
2 * Copyright (c) 1996,1997, by Sun Microsystems, Inc.
3 * All rights reserved.
4 */
5
6 #pragma ident "@(#)g_context_time.c 1.12 98/01/22 SMI"
7
8 /*
9 * glue routines for gss_context_time
10 */
11
12 #include <mechglueP.h>
13
14 OM_uint32
15 gss_context_time(minor_status,
16 context_handle,
17 time_rec)
18
19 OM_uint32 * minor_status;
20 const gss_ctx_id_t context_handle;
21 OM_uint32 * time_rec;
22 {
23 OM_uint32 status;
24 gss_union_ctx_id_t ctx;
25 gss_mechanism mech;
26
27 if (minor_status == NULL)
28 return (GSS_S_CALL_INACCESSIBLE_WRITE);
29 *minor_status = 0;
30
31 if (time_rec == NULL)
32 return (GSS_S_CALL_INACCESSIBLE_WRITE);
33
34 if (context_handle == GSS_C_NO_CONTEXT)
35 return (GSS_S_CALL_INACCESSIBLE_READ | GSS_S_NO_CONTEXT);
36
37 /*
38 * select the approprate underlying mechanism routine and
39 * call it.
40 */
41
42 ctx = (gss_union_ctx_id_t) context_handle;
43 mech = __gss_get_mechanism(ctx->mech_type);
44
45 if (mech) {
46
47 if (mech->gss_context_time)
48 status = mech->gss_context_time(
49 mech->context,
50 minor_status,
51 ctx->internal_ctx_id,
52 time_rec);
53 else
54 status = GSS_S_UNAVAILABLE;
55
56 return (status);
57 }
58
59 return (GSS_S_BAD_MECH);
60 }
|