gssapi-layer-c++
20230108
|
Go to the documentation of this file.
25 #include <gssapi/gssapi.h>
26 #include <gssapi/gssapi_ext.h>
69 const char*
func =
nullptr;
82 std::string
error2str(OM_uint32 code1, OM_uint32 code2);
105 virtual void error(
const char* func,
const char* subfunc, OM_uint32 code1, OM_uint32 code2)
const;
108 bool sendMessage(
const void*,
size_t,
bool encrypt =
true);
110 bool recvMIC(
const void*,
size_t);
111 bool sendMIC(
const void*,
size_t);
120 std::list<std::string>
mechNames(
void)
const;
138 bool initConnect(std::string_view,
const NameType &,
int flags = GSS_C_MUTUAL_FLAG | GSS_C_REPLAY_FLAG);
gss_ctx_id_t context_handle
Definition: gsslayer.h:89
virtual std::vector< uint8_t > recvToken(void)=0
std::string exportOID(const gss_OID &oid, ErrorCodes *err)
Definition: gsslayer.cpp:106
OM_uint32 code2
Definition: gsslayer.h:71
@ Delegate
delegated credentials are available by means of the delegated_cred_handle parameter
Definition: gsslayer.h:56
bool sendMessage(const void *, size_t, bool encrypt=true)
Definition: gsslayer.cpp:218
bool recvMIC(const void *, size_t)
Definition: gsslayer.cpp:242
const gss_OID & mechTypes(void) const
Definition: gsslayer.h:114
std::list< std::string > mechNames(void) const
Definition: gsslayer.cpp:285
const char * flagName(const ContextFlag &flag)
Definition: gsslayer.cpp:128
const OM_uint32 & supportFlags(void) const
Definition: gsslayer.h:115
gss_name_t service_name
Definition: gsslayer.h:91
@ Both
Identifies applications that can initiate or accept security contexts.
Definition: gsslayer.h:51
NameType
Definition: gsslayer.h:36
@ Transfer
the resultant security context may be transferred to other processes by means of a call to gss_export...
Definition: gsslayer.h:64
OM_uint32 code1
Definition: gsslayer.h:70
@ Integrity
integrity service may be invoked by calling either the gss_get_mic(3GSS) or the gss_wrap(3GSS) routin...
Definition: gsslayer.h:61
@ Protection
the protection services specified by the states of GSS_C_CONF_FLAG and GSS_C_INTEG_FLAG are available...
Definition: gsslayer.h:63
std::string error2str(OM_uint32 code1, OM_uint32 code2)
Definition: gsslayer.cpp:29
Context & operator=(const Context &)=delete
virtual ~Context()
Definition: gsslayer.cpp:161
Definition: gsslayer.h:68
CredentialUsage
Definition: gsslayer.h:48
const char * func
Definition: gsslayer.h:69
@ Mutual
a remote peer asked for mutual authentication
Definition: gsslayer.h:57
bool sendMIC(const void *, size_t)
Definition: gsslayer.cpp:261
virtual void sendToken(const void *, size_t)=0
@ Replay
replay of protected messages will be detected
Definition: gsslayer.h:58
const OM_uint32 & timeRec(void) const
Definition: gsslayer.h:116
@ Accept
Identifies applications that only accept security contexts.
Definition: gsslayer.h:50
std::vector< uint8_t > recvMessage(void)
Definition: gsslayer.cpp:193
bool acceptClient(void)
Definition: gsslayer.cpp:351
@ Initiate
Identifies applications that only initiate security contexts.
Definition: gsslayer.h:49
gss_name_t importName(std::string_view name, const NameType &type, ErrorCodes *err)
Definition: gsslayer.cpp:48
ContextFlag
Definition: gsslayer.h:55
bool initConnect(std::string_view, const NameType &, int flags=GSS_C_MUTUAL_FLAG|GSS_C_REPLAY_FLAG)
Definition: gsslayer.cpp:391
BaseContext.
Definition: gsslayer.h:86
ServiceContext.
Definition: gsslayer.h:125
std::list< ContextFlag > exportFlags(int flags)
Definition: gsslayer.cpp:147
virtual void error(const char *func, const char *subfunc, OM_uint32 code1, OM_uint32 code2) const
Definition: gsslayer.cpp:188
ClientContext.
Definition: gsslayer.h:134
OM_uint32 support_flags
Definition: gsslayer.h:93
gss_cred_id_t creds
Definition: gsslayer.h:92
Context(const Context &)=delete
gss_name_t src_name
Definition: gsslayer.h:90
@ Confidential
confidentiality service may be invoked by calling the gss_wrap() routine
Definition: gsslayer.h:60
bool acquireCredential(std::string_view, const NameType &, const CredentialUsage &=Gss::CredentialUsage::Accept)
Definition: gsslayer.cpp:319
Definition: gsslayer.cpp:28
@ Sequence
out of sequence protected messages will be detected
Definition: gsslayer.h:59
std::string exportName(const gss_name_t &name, ErrorCodes *err)
Definition: gsslayer.cpp:84
const gss_name_t & srcName(void) const
Definition: gsslayer.h:113
OM_uint32 time_rec
Definition: gsslayer.h:94
@ Anonymous
the initiator does not wish to be authenticated. The src_name parameter, if requested,...
Definition: gsslayer.h:62
gss_OID mech_types
Definition: gsslayer.h:88