XRootD
XrdSecProtocolhost Class Reference

#include <XrdSecProtocolhost.hh>

+ Inheritance diagram for XrdSecProtocolhost:
+ Collaboration diagram for XrdSecProtocolhost:

Public Member Functions

 XrdSecProtocolhost (const char *host, XrdNetAddrInfo &endPoint)
 
 ~XrdSecProtocolhost ()
 
int Authenticate (XrdSecCredentials *cred, XrdSecParameters **parms, XrdOucErrInfo *einfo=0)
 
void Delete ()
 Delete the protocol object. DO NOT use C++ delete() on this object. More...
 
XrdSecCredentialsgetCredentials (XrdSecParameters *parm=0, XrdOucErrInfo *einfo=0)
 
const char * getParms (int &psize, const char *hname=0)
 
- Public Member Functions inherited from XrdSecProtocol
 XrdSecProtocol (const char *pName)
 Constructor. More...
 
virtual int Decrypt (const char *inbuff, int inlen, XrdSecBuffer **outbuff)
 
virtual int Encrypt (const char *inbuff, int inlen, XrdSecBuffer **outbuff)
 
virtual int getKey (char *buff=0, int size=0)
 
virtual bool needTLS ()
 Check if this protocol requires TLS to properly function. More...
 
virtual int setKey (char *buff, int size)
 
virtual int Sign (const char *inbuff, int inlen, XrdSecBuffer **outbuff)
 
virtual int Verify (const char *inbuff, int inlen, const char *sigbuff, int siglen)
 

Additional Inherited Members

- Public Attributes inherited from XrdSecProtocol
XrdSecEntity Entity
 
- Protected Member Functions inherited from XrdSecProtocol
virtual ~XrdSecProtocol ()
 Destructor (prevents use of direct delete). More...
 

Detailed Description

Definition at line 39 of file XrdSecProtocolhost.hh.

Constructor & Destructor Documentation

◆ XrdSecProtocolhost()

XrdSecProtocolhost::XrdSecProtocolhost ( const char *  host,
XrdNetAddrInfo endPoint 
)
inline

Definition at line 56 of file XrdSecProtocolhost.hh.

57  : XrdSecProtocol("host")
58  {theHost = strdup(host);
59  epAddr = endPoint;
60  }
XrdSecProtocol(const char *pName)
Constructor.

◆ ~XrdSecProtocolhost()

XrdSecProtocolhost::~XrdSecProtocolhost ( )
inline

Definition at line 61 of file XrdSecProtocolhost.hh.

61 {if (theHost) free(theHost);}

Member Function Documentation

◆ Authenticate()

int XrdSecProtocolhost::Authenticate ( XrdSecCredentials cred,
XrdSecParameters **  parms,
XrdOucErrInfo einfo = 0 
)
virtual

Authenticate a client.

Parameters
credCredentials supplied by the client.
parmsPlace where the address of additional authentication data is to be placed for another autrhentication handshake.
einfoThe error information object where error messages should be placed. The messages are returned to the client. Should einfo be null, messages should be written to stderr.
Returns
> 0 -> parms present (more authentication needed) = 0 -> Entity present (authentication suceeded) < 0 -> einfo present (error has occurred)

Implements XrdSecProtocol.

Definition at line 40 of file XrdSecProtocolhost.cc.

43 {
44  strcpy(Entity.prot, "host");
45  Entity.host = theHost;
46  Entity.addrInfo = &epAddr;
47  return 0;
48 }
XrdNetAddrInfo * addrInfo
Entity's connection details.
Definition: XrdSecEntity.hh:80
char prot[XrdSecPROTOIDSIZE]
Auth protocol used (e.g. krb5)
Definition: XrdSecEntity.hh:67
char * host
Entity's host name dnr dependent.
Definition: XrdSecEntity.hh:70
XrdSecEntity Entity

References XrdSecEntity::addrInfo, XrdSecProtocol::Entity, XrdSecEntity::host, and XrdSecEntity::prot.

◆ Delete()

void XrdSecProtocolhost::Delete ( )
inlinevirtual

Delete the protocol object. DO NOT use C++ delete() on this object.

Implements XrdSecProtocol.

Definition at line 54 of file XrdSecProtocolhost.hh.

54 {delete this;}

◆ getCredentials()

XrdSecCredentials * XrdSecProtocolhost::getCredentials ( XrdSecParameters parm = 0,
XrdOucErrInfo einfo = 0 
)
virtual

Generate client credentials to be used in the authentication process.

Parameters
parmPointer to the information returned by the server either in the initial login response or the authmore response.
einfoThe error information object where error messages should be placed. The messages are returned to the client. Should einfo be null, messages should be written to stderr.
Returns
Success: Pointer to credentials to sent to the server. The caller is responsible for deleting the object. Failure: Null pointer with einfo, if supplied, containing the reason for the failure.

Implements XrdSecProtocol.

Definition at line 54 of file XrdSecProtocolhost.cc.

57 
58  cp->size = 5; cp->buffer = (char *)"host";
59  return cp;
60 }
XrdSecBuffer XrdSecCredentials
Generic structure to pass security information back and forth.
char * buffer
Pointer to the buffer.
int size
Size of the buffer or length of data in the buffer.

References XrdSecBuffer::buffer, and XrdSecBuffer::size.

◆ getParms()

const char* XrdSecProtocolhost::getParms ( int &  psize,
const char *  hname = 0 
)
inline

Definition at line 50 of file XrdSecProtocolhost.hh.

51  {psize = 5; return "host";}

The documentation for this class was generated from the following files: