48#include "XrdVersion.hh"
421 static XrdVERSIONINFODEF(myVer,cryptoloader,XrdVNUMBER,XrdVERSION);
424 static int factorynum = 0;
428 char factobjname[80], libfn[80];
429 EPNAME(
"Factory::GetCryptoFactory");
438 PRINT(
"crypto factory ID (NULL) undefined");
441 if (!strlen(factoryid)) {
442 PRINT(
"crypto factory ID (\"\") undefined");
450 for ( ; i < factorynum; i++ ) {
451 if (!strcmp(factoryid,factorylist[i].factoryname)) {
452 if (factorylist[i].status) {
453 DEBUG(factoryid <<
" crypto factory object already loaded ("
454 << factorylist[i].factory <<
")");
457 DEBUG(
"previous attempt to load crypto factory "
458 <<factoryid<<
" failed - do nothing");
468 if (newfactorylist) {
470 for ( ; i < factorynum; i++ ) {
473 strcpy(newfactorylist[i].factoryname,factorylist[i].factoryname);
476 newfactorylist[i].
status = 0;
477 strcpy(newfactorylist[i].factoryname,factoryid);
480 if (factorylist)
delete[] factorylist;
483 factorylist = newfactorylist;
486 PRINT(
"cannot create local record of loaded crypto factories");
490 sprintf(factobjname,
"XrdCrypto%sFactoryObject", factoryid);
496 snprintf(libfn,
sizeof(libfn)-1,
"libXrdCrypto%s.so", factoryid);
497 libfn[
sizeof(libfn)-1] =
'\0';
500 plugins.
Add(factoryid, plug);
503 PRINT(
"problems opening shared library " << libfn);
506 DEBUG(
"shared library '" << libfn <<
"' loaded");
511 PRINT(
"problems finding crypto factory object creator " << factobjname);
517 if (!(factory = (*efact)())) {
518 PRINT(
"problems creating crypto factory object");
524 factorylist[factorynum-1].
factory = factory;
525 factorylist[factorynum-1].
status = 1;
int(*) XrdCryptoKDFun_t(const char *pass, int plen, const char *salt, int slen, char *key, int klen)
#define ABSTRACTMETHOD(x)
int(*) XrdCryptoKDFunLen_t()
XrdCryptoFactory * factory
char factoryname[MAXFACTORYNAMELEN]
int(*) XrdCryptoX509GetVOMSAttr_t(XrdCryptoX509 *, XrdOucString &)
void(*) XrdCryptoSetPathLenConstraint_t(void *, int)
int(*) XrdCryptoX509ChainToFile_t(XrdCryptoX509Chain *, const char *)
int(*) XrdCryptoX509ParseBucket_t(XrdSutBucket *, XrdCryptoX509Chain *)
int(*) XrdCryptoX509ParseStack_t(XrdTlsPeerCerts *pc, XrdCryptoX509Chain *c)
int(*) XrdCryptoX509CreateProxy_t(const char *, const char *, XrdProxyOpt_t *, XrdCryptogsiX509Chain *, XrdCryptoRSA **, const char *)
bool(*) XrdCryptoX509VerifyCert_t(XrdCryptoX509 *c, XrdCryptoX509 *r)
XrdSutBucket *(*) XrdCryptoX509ExportChain_t(XrdCryptoX509Chain *, bool)
bool(*) XrdCryptoX509VerifyChain_t(XrdCryptoX509Chain *chain, int &errcode)
int(*) XrdCryptoX509CheckProxy3_t(XrdCryptoX509 *, XrdOucString &)
#define MAXFACTORYNAMELEN
int(*) XrdCryptoX509ParseFile_t(const char *fname, XrdCryptoX509Chain *, const char *)
bool(*) XrdCryptoProxyCertInfo_t(const void *, int &, bool *)
int(*) XrdCryptoX509CreateProxyReq_t(XrdCryptoX509 *, XrdCryptoX509Req **, XrdCryptoRSA **)
int(*) XrdCryptoX509SignProxyReq_t(XrdCryptoX509 *, XrdCryptoRSA *, XrdCryptoX509Req *, XrdCryptoX509 **)
XrdSysError eDest(0, "HttpMon")
virtual bool HasPaddingSupport()
virtual XrdCryptoX509VerifyChain_t X509VerifyChain()
virtual XrdCryptoX509ParseBucket_t X509ParseBucket()
virtual XrdCryptoX509CreateProxyReq_t X509CreateProxyReq()
virtual XrdCryptoX509 * X509(const char *cf, const char *kf=0)
virtual void SetTrace(kXR_int32 trace)
virtual XrdCryptoX509ParseFile_t X509ParseFile()
virtual XrdCryptoX509CreateProxy_t X509CreateProxy()
virtual XrdCryptoKDFun_t KDFun()
bool operator==(const XrdCryptoFactory factory)
virtual XrdCryptoX509ParseStack_t X509ParseStack()
virtual XrdCryptoX509GetVOMSAttr_t X509GetVOMSAttr()
virtual XrdCryptoX509ChainToFile_t X509ChainToFile()
virtual XrdCryptoCipher * Cipher(const char *t, int l=0)
virtual XrdCryptoX509CheckProxy3_t X509CheckProxy3()
virtual XrdCryptoRSA * RSA(int b=0, int e=0)
virtual bool SupportedMsgDigest(const char *dgst)
XrdCryptoFactory(const char *n="Unknown", int id=-1)
virtual XrdCryptoSetPathLenConstraint_t SetPathLenConstraint()
virtual XrdCryptoMsgDigest * MsgDigest(const char *dgst)
virtual XrdCryptoX509Crl * X509Crl(const char *crlfile, int opt=0)
virtual XrdCryptoKDFunLen_t KDFunLen()
virtual XrdCryptoProxyCertInfo_t ProxyCertInfo()
static XrdCryptoFactory * GetCryptoFactory(const char *factoryname)
virtual bool SupportedCipher(const char *t)
virtual XrdCryptoX509Req * X509Req(XrdSutBucket *bck)
virtual XrdCryptoX509SignProxyReq_t X509SignProxyReq()
virtual XrdCryptoX509ExportChain_t X509ExportChain()
virtual XrdCryptoX509VerifyCert_t X509VerifyCert()
T * Add(const char *KeyVal, T *KeyData, const int LifeTime=0, XrdOucHash_Options opt=Hash_default)
T * Find(const char *KeyVal, time_t *KeyTime=0)
XrdOucPinLoader(XrdSysError *errP, XrdVersionInfo *vInfo, const char *drctv, const char *plib)
void * Resolve(const char *symbl, int mcnt=1)