File: gp_rpc_release_handle.c

package info (click to toggle)
gssproxy 0.8.0-1.1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 2,988 kB
  • sloc: ansic: 17,989; sh: 5,011; python: 1,064; xml: 535; makefile: 394
file content (43 lines) | stat: -rw-r--r-- 1,194 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/* Copyright (C) 2011 the GSS-PROXY contributors, see COPYING for license */

#include "gp_rpc_process.h"

int gp_release_handle(struct gp_call_ctx *gpcall UNUSED,
                      union gp_rpc_arg *arg,
                      union gp_rpc_res *res)
{
    struct gssx_arg_release_handle *rha;
    struct gssx_res_release_handle *rhr;
    uint32_t ret_maj = GSS_S_COMPLETE;
    uint32_t ret_min = 0;
    int ret;

    rha = &arg->release_handle;
    rhr = &res->release_handle;

    GPRPCDEBUG(gssx_arg_release_handle, rha);

    switch (rha->cred_handle.handle_type) {
    case GSSX_C_HANDLE_SEC_CTX:
        /* We do not need release for any security
         * context for now */
        ret_maj = GSS_S_UNAVAILABLE;
        ret_min = 0;
        break;
    case GSSX_C_HANDLE_CRED:
        /* We do not need release for any creds now */
        ret_maj = GSS_S_UNAVAILABLE;
        ret_min = 0;
        break;
    default:
        ret_maj = GSS_S_CALL_BAD_STRUCTURE;
        ret_min = 0;
        break;
    }

    ret = gp_conv_status_to_gssx(ret_maj, ret_min, GSS_C_NO_OID,
                                 &rhr->status);
    GPRPCDEBUG(gssx_res_release_handle, rhr);

    return ret;
}