1 |
afaq |
1.1 |
#ifndef _GSS_hpp_included_
|
2 |
|
|
#define _GSS_hpp_included_
|
3 |
|
|
#define GSS_SUCCESS 1
|
4 |
|
|
#define GSS_MAX_MESSAGE_LENGTH 1024
|
5 |
|
|
|
6 |
|
|
|
7 |
|
|
#include "globus_gss_assist.h"
|
8 |
|
|
#include "Socket.hpp"
|
9 |
|
|
#include <string>
|
10 |
|
|
#include <openssl/x509.h>
|
11 |
|
|
|
12 |
|
|
|
13 |
|
|
class GSS {
|
14 |
|
|
private:
|
15 |
|
|
OM_uint32 major_status;
|
16 |
|
|
OM_uint32 minor_status;
|
17 |
|
|
gss_ctx_id_t global_context_handle;
|
18 |
|
|
gss_cred_id_t credential_handle;
|
19 |
|
|
std::string dn;
|
20 |
|
|
int token_status;
|
21 |
|
|
FILE * socket_in_out_file;
|
22 |
|
|
|
23 |
|
|
void displayMessage(std::string message);
|
24 |
|
|
int activate();
|
25 |
|
|
int acquireCredentials();
|
26 |
|
|
void releaseCredential();
|
27 |
|
|
void deleteContext();
|
28 |
|
|
public:
|
29 |
|
|
GSS();
|
30 |
|
|
~GSS();
|
31 |
|
|
int cOpen(int des);
|
32 |
|
|
int sOpen(int des);
|
33 |
|
|
int send(std::string message);
|
34 |
|
|
std::string recv();
|
35 |
|
|
void recv(char* data);
|
36 |
|
|
std::string getDN();
|
37 |
|
|
void close();
|
38 |
|
|
};
|
39 |
|
|
#endif
|
40 |
|
|
|