XRootD
Loading...
Searching...
No Matches
XrdCryptoAux.hh File Reference
#include <cstdio>
#include <ctime>
#include "XrdSys/XrdSysHeaders.hh"
#include "XProtocol/XProtocol.hh"
+ Include dependency graph for XrdCryptoAux.hh:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define ABSTRACTMETHOD(x)   {std::cerr <<"Method "<<x<<" must be overridden!" <<std::endl;}
 
#define cryptoTRACE_ALL   0x0007
 
#define cryptoTRACE_Debug   0x0002
 
#define cryptoTRACE_Dump   0x0004
 
#define cryptoTRACE_Notify   0x0001
 
#define XrdCryptoDefRSABits   2048
 
#define XrdCryptoDefRSAExp   0x10001
 
#define XrdCryptoMinRSABits   2048
 

Typedefs

typedef int(* XrdCryptoKDFun_t) (const char *pass, int plen, const char *salt, int slen, char *key, int klen)
 
typedef int(* XrdCryptoKDFunLen_t) ()
 

Functions

int XrdCryptoKDFun (const char *pass, int plen, const char *salt, int slen, char *key, int klen)
 
int XrdCryptoKDFunLen ()
 
void XrdCryptoSetTrace (kXR_int32 trace)
 
time_t XrdCryptoTZCorr ()
 

Variables

const time_t XrdCryptoDSTShift = 3600
 

Macro Definition Documentation

◆ ABSTRACTMETHOD

#define ABSTRACTMETHOD (   x)    {std::cerr <<"Method "<<x<<" must be overridden!" <<std::endl;}

Definition at line 41 of file XrdCryptoAux.hh.

◆ cryptoTRACE_ALL

#define cryptoTRACE_ALL   0x0007

Definition at line 46 of file XrdCryptoAux.hh.

◆ cryptoTRACE_Debug

#define cryptoTRACE_Debug   0x0002

Definition at line 48 of file XrdCryptoAux.hh.

◆ cryptoTRACE_Dump

#define cryptoTRACE_Dump   0x0004

Definition at line 47 of file XrdCryptoAux.hh.

◆ cryptoTRACE_Notify

#define cryptoTRACE_Notify   0x0001

Definition at line 49 of file XrdCryptoAux.hh.

◆ XrdCryptoDefRSABits

#define XrdCryptoDefRSABits   2048

Definition at line 53 of file XrdCryptoAux.hh.

◆ XrdCryptoDefRSAExp

#define XrdCryptoDefRSAExp   0x10001

Definition at line 54 of file XrdCryptoAux.hh.

◆ XrdCryptoMinRSABits

#define XrdCryptoMinRSABits   2048

Definition at line 52 of file XrdCryptoAux.hh.

Typedef Documentation

◆ XrdCryptoKDFun_t

typedef int(* XrdCryptoKDFun_t) (const char *pass, int plen, const char *salt, int slen, char *key, int klen)

Definition at line 60 of file XrdCryptoAux.hh.

◆ XrdCryptoKDFunLen_t

typedef int(* XrdCryptoKDFunLen_t) ()

Definition at line 59 of file XrdCryptoAux.hh.

Function Documentation

◆ XrdCryptoKDFun()

int XrdCryptoKDFun ( const char *  pass,
int  plen,
const char *  salt,
int  slen,
char *  key,
int  klen 
)

◆ XrdCryptoKDFunLen()

int XrdCryptoKDFunLen ( )

◆ XrdCryptoSetTrace()

void XrdCryptoSetTrace ( kXR_int32  trace)

Definition at line 49 of file XrdCryptoAux.cc.

50{
51 // Set trace flags according to 'trace'
52
53 //
54 // Initiate error logging and tracing
56 if (!cryptoTrace)
58 if (cryptoTrace) {
59 // Set debug mask
60 cryptoTrace->What = 0;
61 // Low level only
62 if ((trace & cryptoTRACE_Notify))
64 // Medium level
65 if ((trace & cryptoTRACE_Debug))
67 // High level
68 if ((trace & cryptoTRACE_Dump))
70 }
71}
XrdOucTrace * cryptoTrace
static XrdSysLogger Logger
static XrdSysError eDest(0,"crypto_")
#define cryptoTRACE_Notify
#define cryptoTRACE_Dump
#define cryptoTRACE_Debug
#define cryptoTRACE_ALL
XrdSysLogger * logger(XrdSysLogger *lp=0)

References cryptoTrace, cryptoTRACE_ALL, cryptoTRACE_Debug, cryptoTRACE_Dump, cryptoTRACE_Notify, eDest, Logger, XrdSysError::logger(), and XrdOucTrace::What.

Referenced by XrdSecProtocolgsi::Init(), XrdSecProtocolpwd::Init(), and main().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ XrdCryptoTZCorr()

time_t XrdCryptoTZCorr ( )

Definition at line 77 of file XrdCryptoAux.cc.

78{
79 // Time Zone correction (wrt UTC)
80 // Assumes no DST, the correction is not expected to change during the year
81
82 if (!TZInitialized) {
83 time_t now = time(0);
84 struct tm ltn, gtn;
85 if (localtime_r(&now, &ltn) != 0 && gmtime_r(&now, &gtn) != 0) {
86 TZCorr = time_t(difftime(mktime(&ltn), mktime(&gtn)));
87 TZInitialized = 1;
88 }
89 }
90 // Done
91 return TZCorr;
92}
static time_t TZCorr
static bool TZInitialized

References TZCorr, and TZInitialized.

Referenced by Display(), and XrdCryptosslASN1toUTC().

+ Here is the caller graph for this function:

Variable Documentation

◆ XrdCryptoDSTShift

const time_t XrdCryptoDSTShift = 3600

Definition at line 86 of file XrdCryptoAux.hh.