e97dfb30ec4d9e05500b694c98048b12258fac17
[gssweb.git] / json_gssapi / test / command_mocks / InitSecContextMock.h
1 /*
2  * Copyright (c) 2014 <copyright holder> <email>
3  * 
4  * For license details, see the LICENSE file in the root of this project.
5  * 
6  */
7
8 #ifndef INITSECCONTEXTMOCK_H
9 #define INITSECCONTEXTMOCK_H
10
11 #include <gssapi.h>
12 #include <stdlib.h>
13 #include <iostream>
14
15 class InitSecContextMock
16 {
17 public:
18   static OM_uint32              retVal;
19   static OM_uint32              minor_status;
20   static gss_cred_id_t          claimant_cred_handle;
21   static gss_ctx_id_t           context_handle;
22   static gss_name_t             target_name;
23   static gss_OID                mech_type;
24   static OM_uint32              req_flags;
25   static OM_uint32              time_req;
26   static gss_channel_bindings_t input_chan_bindings;
27   static gss_buffer_desc        input_token;
28   static gss_OID                actual_mech_type;
29   static gss_buffer_desc        output_token;
30   static OM_uint32              ret_flags;
31   static OM_uint32              time_rec;
32   
33   static bool                   visited;
34   static bool                   invalidContextHandle;
35   
36   template <class t>
37     static void nullify(t *&ptr)
38   {
39     if (ptr)
40     {
41       free(ptr);
42       ptr = NULL;
43     }
44   }
45
46   static void reset();
47 };
48
49 #endif // INITSECCONTEXTMOCK_H