• Main Page
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

XrdSecProtocolsss.hh

Go to the documentation of this file.
00001 #ifndef _SECPROTOCOLSSS_
00002 #define _SECPROTOCOLSSS_
00003 /******************************************************************************/
00004 /*                                                                            */
00005 /*                  X r d S e c P r o t o c o l s s s . h h                   */
00006 /*                                                                            */
00007 /* (c) 2008 by the Board of Trustees of the Leland Stanford, Jr., University  */
00008 /*                            All Rights Reserved                             */
00009 /*   Produced by Andrew Hanushevsky for Stanford University under contract    */
00010 /*              DE-AC02-76-SFO0515 with the Department of Energy              */
00011 /******************************************************************************/
00012   
00013 //       $Id: XrdSecProtocolsss.hh,v 1.2 2008/11/01 21:35:56 abh Exp $
00014 
00015 #include "XrdCrypto/XrdCryptoLite.hh"
00016 #include "XrdSec/XrdSecInterface.hh"
00017 #include "XrdSecsss/XrdSecsssID.hh"
00018 #include "XrdSecsss/XrdSecsssKT.hh"
00019 #include "XrdSecsss/XrdSecsssRR.hh"
00020 
00021 class XrdOucErrInfo;
00022 
00023 class XrdSecProtocolsss : public XrdSecProtocol
00024 {
00025 public:
00026 friend class XrdSecProtocolDummy; // Avoid stupid gcc warnings about destructor
00027 
00028 
00029         int                Authenticate  (XrdSecCredentials *cred,
00030                                           XrdSecParameters **parms,
00031                                           XrdOucErrInfo     *einfo=0);
00032 
00033         void               Delete();
00034 
00035 static  int                eMsg(const char *epn, int rc, const char *txt1,
00036                                 const char *txt2=0,      const char *txt3=0, 
00037                                 const char *txt4=0);
00038 
00039 static  int                Fatal(XrdOucErrInfo *erP, const char *epn, int rc,
00040                                                      const char *etxt);
00041 
00042         XrdSecCredentials *getCredentials(XrdSecParameters  *parms=0,
00043                                           XrdOucErrInfo     *einfo=0);
00044 
00045         int   Init_Client(XrdOucErrInfo *erp, const char *Parms);
00046 
00047         int   Init_Server(XrdOucErrInfo *erp, const char *Parms);
00048 
00049 static  char *Load_Client(XrdOucErrInfo *erp, const char *Parms);
00050 
00051 static  char *Load_Server(XrdOucErrInfo *erp, const char *Parms);
00052 
00053 static  void  setOpts(int opts) {options = opts;}
00054 
00055         XrdSecProtocolsss(const char                *hname,
00056                           const struct sockaddr     *ipadd)
00057                          : keyTab(0), Crypto(0), idBuff(0), Sequence(0)
00058                          {urName = strdup(hname);}
00059 
00060 struct Crypto {const char *cName; char cType;};
00061 
00062 private:
00063        ~XrdSecProtocolsss() {} // Delete() does it all
00064 
00065 int                Decode(XrdOucErrInfo *error, XrdSecsssKT::ktEnt &decKey,
00066                           char *iBuff, XrdSecsssRR_Data *rrData, int iSize);
00067 XrdSecCredentials *Encode(XrdOucErrInfo *error, XrdSecsssKT::ktEnt &encKey,
00068                           XrdSecsssRR_Hdr *rrHdr, XrdSecsssRR_Data *rrData,
00069                           int dLen);
00070 int            getCred(XrdOucErrInfo *, XrdSecsssRR_Data &);
00071 int            getCred(XrdOucErrInfo *, XrdSecsssRR_Data &, XrdSecParameters *);
00072 char          *getLID(char *buff, int blen);
00073 static
00074 XrdCryptoLite *Load_Crypto(XrdOucErrInfo *erp, const char *eN);
00075 static
00076 XrdCryptoLite *Load_Crypto(XrdOucErrInfo *erp, const char  eT);
00077 int            myClock();
00078 char          *setID(char *id, char **idP);
00079 
00080 static struct Crypto  CryptoTab[];
00081 
00082 static const char    *myName;
00083 static int            myNLen;
00084        char          *urName;
00085 static int            options;
00086 static int            isMutual;
00087 static int            deltaTime;
00088 static int            ktFixed;
00089 
00090 static XrdSecsssKT   *ktObject;  // Both:   Default Key Table object
00091        XrdSecsssKT   *keyTab;    // Both:   Active  Key Table
00092 
00093 static XrdCryptoLite *CryptObj;  // Both:   Default Cryptogrophy object
00094        XrdCryptoLite *Crypto;    // Both:   Active  Cryptogrophy object
00095 
00096 static XrdSecsssID   *idMap;     // Client: Registry
00097        char          *idBuff;    // Server: Underlying buffer for XrdSecEntity
00098 static char          *staticID;  // Client: Static identity
00099 static int            staticIDsz;// Client: Static identity length
00100        int            Sequence;  // Client: Check for sequencing
00101 };
00102 #endif

Generated on Wed Sep 1 2010 for xrootd by  doxygen 1.7.1