35 #include <sys/param.h>
36 #include <sys/types.h>
38 #include "XrdVersion.hh"
58 XrdVersionInfo &vInfo)
59 :
eDest(Eroute), cfgFN(cFN), CksLib(0), CksParm(0),
60 CksList(0), CksLast(0), LibList(0), LibLast(0),
67 if (vInfo.vNum <= 0 || vInfo.vNum == myVer.vNum
93 if (!ep) {myLib->
Unload(
true);
return 0;}
98 theParm = (tP->val ? (tP->
text) + tP->val : 0);
99 pCks = ep(*pCks, eDest, cfgFN, theParm,
envP);
125 if (!myCks)
return 0;
129 myCks = addCks(myCks,
envP);
130 if (!myCks)
return 0;
134 while(tP) {NoGo |= myCks->
Config(
"ckslib", tP->
text); tP = tP->
next;}
138 if (!NoGo) NoGo = !myCks->
Init(cfgFN, dfltCalc);
142 if (NoGo) {
delete myCks; myCks = 0;}
165 if (!(myLib =
new XrdOucPinLoader(eDest, &myVersion,
"ckslib", CksLib)))
171 if (!ep) {myLib->
Unload(
true);
return 0;}
176 return ep(eDest, cfgFN, CksParm);
197 if (CksLib) free(CksLib);
198 CksLib = strdup(
Path);
199 if (CksParm) free(CksParm);
200 CksParm = (Parms && *Parms ? strdup(Parms) : 0);
223 static const int pathSize = MAXPATHLEN;
224 static const int parmSize = 1024;
226 char *val, buff[nameSize + pathSize + parmSize + 8], parms[parmSize], *bP;
231 if (!(val =
Config.GetWord()) || !val[0])
232 {eDest->
Emsg(
"Config",
"ckslib digest not specified");
return 1;}
235 {eDest->
Emsg(
"Config",
"ckslib digest name too long -", val);
return 1;}
240 if (!(val =
Config.GetWord()) || !val[0])
241 {eDest->
Emsg(
"Config",
"ckslib path not specified for", buff);
return 1;}
244 {eDest->
Emsg(
"Config",
"ckslib path name too long -", val);
return 1;}
245 strcpy(bP, val); bP += n;
250 if (!
Config.GetRest(parms, parmSize))
251 {eDest->
Emsg(
"Config",
"ckslib parameters too long for", buff);
return 1;}
255 if ((*buff ==
'*' || *buff ==
'=') && *(buff+1) ==
' ')
256 {libType = (*buff ==
'*' ? -1 : 1);
262 n = (strncmp(buff,
"++ ", 3) ? 0 : 3);
263 *bP =
' '; strcpy(bP+1, parms);
269 {n = (bP - buff) - n;
271 tP->val = (*parms ? n+1 : 0);
272 if (LibLast) LibLast->
next = tP;
276 if (CksLast) CksLast->
next = tP;
static XrdSysError eDest(0,"crypto_")
XrdCks * Configure(const char *dfltCalc=0, int rdsz=0, XrdOss *ossP=0, XrdOucEnv *envP=0)
XrdCksConfig(const char *cFN, XrdSysError *Eroute, int &aOK, XrdVersionInfo &vInfo)
int ParseLib(XrdOucStream &Config, int &libType)
static const int NameSize
virtual int Init(const char *ConfigFN, const char *DfltCalc=0)=0
virtual int Config(const char *Token, char *Line)=0
void * Resolve(const char *symbl, int mcnt=1)
void Unload(bool dodel=false)
static void toLower(char *str)
int Emsg(const char *esfx, int ecode, const char *text1, const char *text2=0)
static bool VerCmp(XrdVersionInfo &vInf1, XrdVersionInfo &vInf2, bool noMsg=false)
XrdVERSIONINFODEF(myVersion, cmsclient, XrdVNUMBER, XrdVERSION)