XRootD
XrdCryptoAux.hh
Go to the documentation of this file.
1 #ifndef __CRYPTO_AUX_H__
2 #define __CRYPTO_AUX_H__
3 /******************************************************************************/
4 /* */
5 /* X r d C r y p t o A u x . h h */
6 /* */
7 /* (c) 2004 by the Board of Trustees of the Leland Stanford, Jr., University */
8 /* Produced by Gerri Ganis for CERN */
9 /* */
10 /* This file is part of the XRootD software suite. */
11 /* */
12 /* XRootD is free software: you can redistribute it and/or modify it under */
13 /* the terms of the GNU Lesser General Public License as published by the */
14 /* Free Software Foundation, either version 3 of the License, or (at your */
15 /* option) any later version. */
16 /* */
17 /* XRootD is distributed in the hope that it will be useful, but WITHOUT */
18 /* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or */
19 /* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public */
20 /* License for more details. */
21 /* */
22 /* You should have received a copy of the GNU Lesser General Public License */
23 /* along with XRootD in a file called COPYING.LESSER (LGPL license) and file */
24 /* COPYING (GPL license). If not, see <http://www.gnu.org/licenses/>. */
25 /* */
26 /* The copyright holder's institutional names and contributor's names may not */
27 /* be used to endorse or promote products derived from this software without */
28 /* specific prior written permission of the institution or contributor. */
29 /******************************************************************************/
30 
31 #include <cstdio>
32 #include <ctime>
33 #ifndef WIN32
34 #include "XrdSys/XrdSysHeaders.hh"
35 #endif
36 #include "XProtocol/XProtocol.hh"
37 
38 /******************************************************************************/
39 /* M i s c e l l a n e o u s D e f i n e s */
40 /******************************************************************************/
41 #define ABSTRACTMETHOD(x) {std::cerr <<"Method "<<x<<" must be overridden!" <<std::endl;}
42 
43 /******************************************************************************/
44 /* E r r o r L o g g i n g / T r a c i n g F l a g s */
45 /******************************************************************************/
46 #define cryptoTRACE_ALL 0x0007
47 #define cryptoTRACE_Dump 0x0004
48 #define cryptoTRACE_Debug 0x0002
49 #define cryptoTRACE_Notify 0x0001
50 
51 // RSA parameters
52 #define XrdCryptoMinRSABits 2048
53 #define XrdCryptoDefRSABits 2048
54 #define XrdCryptoDefRSAExp 0x10001
55 
56 /******************************************************************************/
57 /* U t i l i t y F u n c t i o n s */
58 /******************************************************************************/
59 typedef int (*XrdCryptoKDFunLen_t)();
60 typedef int (*XrdCryptoKDFun_t)(const char *pass, int plen,
61  const char *salt, int slen,
62  char *key, int klen);
64 int XrdCryptoKDFun(const char *pass, int plen, const char *salt, int slen,
65  char *key, int klen);
66 
67 
68 /******************************************************************************/
69 /* X r d C r y p t o S e t T r a c e */
70 /* */
71 /* Set trace flags according to 'trace' */
72 /* */
73 /******************************************************************************/
74 //______________________________________________________________________________
75 void XrdCryptoSetTrace(kXR_int32 trace);
76 
77 
78 /******************************************************************************/
79 /* X r d C r y p t o T Z C o r r */
80 /* */
81 /* Time Zone correction (calculated once) */
82 /* */
83 /******************************************************************************/
84 //______________________________________________________________________________
85 time_t XrdCryptoTZCorr();
86 const time_t XrdCryptoDSTShift = 3600;
87 
88 #endif
int kXR_int32
Definition: XPtypes.hh:89
void XrdCryptoSetTrace(kXR_int32 trace)
Definition: XrdCryptoAux.cc:49
time_t XrdCryptoTZCorr()
Definition: XrdCryptoAux.cc:77
const time_t XrdCryptoDSTShift
Definition: XrdCryptoAux.hh:86
int XrdCryptoKDFunLen()
int(* XrdCryptoKDFunLen_t)()
Definition: XrdCryptoAux.hh:59
int(* XrdCryptoKDFun_t)(const char *pass, int plen, const char *salt, int slen, char *key, int klen)
Definition: XrdCryptoAux.hh:60
int XrdCryptoKDFun(const char *pass, int plen, const char *salt, int slen, char *key, int klen)