Rudiments
|
#include <gss.h>
Inherits securitycontext.
The gsscontext class implements the securitycontext interface for GSS (Generic Security Services API/Kerberos).
gsscontext::gsscontext | ( | ) |
Creates an instance of the gsscontext class.
|
virtual |
Deletes this instance of the gsscontext class.
bool gsscontext::accept | ( | ) |
Accepts a security context from the client with whom a connection is already established across the filedescriptor previously set using setFileDescriptor().
Note that if this instance is set as the current GSS context of a child of the socketserver class, then this method is called implicitly during a successful call to accept().
Returns true on success and false on failure.
bool gsscontext::close | ( | ) |
bool gsscontext::connect | ( | ) |
Initiates a security context with the server with whom a connection is already established across the filedescriptor previously set using setFileDescriptor().
Note that if this instance is set as the current security context of a child of the socketclient class, then this method is called implicitly during a successful call to connect().
Returns true on success and false on failure.
Returns the name of the principal who accepted this context.
uint32_t gsscontext::getActualFlags | ( | ) |
uint32_t gsscontext::getActualLifetime | ( | ) |
gssmechanism * gsscontext::getActualMechanism | ( | ) |
gsscredentials * gsscontext::getCredentials | ( | ) |
Returns the credentials set by a previous call to setCredentials() or NULL if no credentials have been set.
uint32_t gsscontext::getDesiredFlags | ( | ) |
Returns the context-flags set by a previous call to setDesiredFlags() or 0 if no flags have been set.
uint32_t gsscontext::getDesiredLifetime | ( | ) |
Returns the desired context-lifetime set by a previous call to setDesiredLifetime() or the largest 32-bit integer (indicating an indefinite lifetime, the default) if no desired context-lifetime has been set.
gssmechanism * gsscontext::getDesiredMechanism | ( | ) |
Returns the security mechanism set by a previous call to setDesiredMechanism() or NULL if no security mechanism has been set.
|
virtual |
Returns the filedscriptor by a previous call to setFileDescriptor() or NULL if no filedescriptor has been set.
Implements socketlayer.
Returns the GSS major status string of the most recently failed call.
Returns the GSS minor status string of the most recently failed call.
Returns the name of the principal who initiated this context.
uint32_t gsscontext::getMajorStatus | ( | ) |
Returns the major-status code of the most recently failed call.
Returns the mechanism major status string of the most recently failed call.
Returns the mechanism minor status string of the most recently failed call.
bool gsscontext::getMic | ( | const byte_t * | message, |
size_t | messagesize, | ||
byte_t ** | mic, | ||
size_t * | micsize ) |
Generates a mechanism integrity code for "message" of "messagesize" bytes, allocates a buffer internally to store the code, returns a pointer the buffer in "mic", and returns the number of bytes of the buffer in "micsize". Returns true on success and false on failure.
uint32_t gsscontext::getMinorStatus | ( | ) |
Returns the minor-status code of the most recently failed call.
size_t gsscontext::getPendingSize | ( | ) |
Returns the number of bytes that are buffered and available for immediate read.
uint32_t gsscontext::getRemainingLifetime | ( | ) |
Returns the remaining lifetime of the context.
Returns the service that will be requested during subsequent calls to connect().
size_t gsscontext::getSizeMax | ( | ) |
bool gsscontext::isInitiator | ( | ) |
Returns true if the calling process was the initator of this context and false if it was not.
bool gsscontext::isOpen | ( | ) |
Returns true if the context has been initiated or accepted and false otherwise.
Reads tokens from the file descriptor previously configured by setFileDescriptor(), unwraps them, and writes the unwrapped data to "buf" until "size" bytes have been read. Returns the number of unwrapped bytes that were written to "buf" or RESULT_ERROR if an error occurred.
void gsscontext::setCredentials | ( | gsscredentials * | credentials | ) |
void gsscontext::setDesiredFlags | ( | uint32_t | desiredflags | ) |
void gsscontext::setDesiredLifetime | ( | uint32_t | desiredlifetime | ) |
void gsscontext::setDesiredMechanism | ( | gssmechanism * | desiredmechanism | ) |
|
virtual |
Sets the filedescriptor that will be used during subsequent calls to connect() or accept().
Note that if this instance is set as the current GSS context of a child of the socketclient class, then this method is called implicitly during a successful call to connect().
Note also that if this instance is set as the current GSS context of a child of the socketserver class, then this method is called implicitly during a successful call to accept().
Implements socketlayer.
Sets the service that will be requested during subsequent calls to connect().
bool gsscontext::unwrap | ( | const byte_t * | input, |
size_t | inputsize, | ||
byte_t ** | output, | ||
size_t * | outputsize ) |
Unwraps "input" data of "inputsize" bytes, allocates a buffer internally to store the unwrapped data, returns a pointer the buffer in "output", and returns the number of bytes of the buffer in "outputsize". Returns true on success and false on failure.
bool gsscontext::unwrap | ( | const byte_t * | input, |
size_t | inputsize, | ||
byte_t ** | output, | ||
size_t * | outputsize, | ||
bool * | decryptionused ) |
Unwraps "input" data of "inputsize" bytes, allocates a buffer internally to store the unwrapped data, returns a pointer the buffer in "output", and returns the number of bytes of the buffer in "outputsize". Returns whether decryption was performed or not in "decryptionused". Returns true on success and false on failure.
bool gsscontext::verifyMic | ( | const byte_t * | message, |
size_t | messagesize, | ||
const byte_t * | mic, | ||
size_t | micsize ) |
Performs a mechanism integrity code for "message" of "messagesize" bytes and compares it to the data in "mic" of "micsize" bytes. Returns true if they match and false otherwise.
bool gsscontext::wrap | ( | const byte_t * | input, |
size_t | inputsize, | ||
bool | useencryption, | ||
byte_t ** | output, | ||
size_t * | outputsize, | ||
bool * | encryptionused ) |
Wraps "input" data of "inputsize" bytes, allocates a buffer internally to store the wrapped data, returns a pointer the buffer in "output", and returns the number of bytes of the buffer in "outputsize". Attempts to encrypt the data if "useencryption" is set to true. Returns whether encryption was performed or not in "encryptionused". Returns true on success and false on failure.
bool gsscontext::wrap | ( | const byte_t * | input, |
size_t | inputsize, | ||
byte_t ** | output, | ||
size_t * | outputsize ) |
Wraps "input" data of "inputsize" bytes, allocates a buffer internally to store the wrapped data, returns a pointer the buffer in "output", and returns the number of bytes of the buffer in "outputsize". Returns true on success and false on failure.
Wraps "size" bytes from "buf" and writes them to the file descriptor previously configured by setFileDescriptor(). Returns the number of unwrapped bytes that were written or RESULT_ERROR if an error occurred.