xrootd
XrdCryptoAux.hh
Go to the documentation of this file.
00001 #ifndef __CRYPTO_AUX_H__
00002 #define __CRYPTO_AUX_H__
00003 /******************************************************************************/
00004 /*                                                                            */
00005 /*                      X r d C r y p t o A u x . h h                         */
00006 /*                                                                            */
00007 /* (c) 2004 by the Board of Trustees of the Leland Stanford, Jr., University  */
00008 /*   Produced by Gerri Ganis for CERN                                         */
00009 /*                                                                            */
00010 /* This file is part of the XRootD software suite.                            */
00011 /*                                                                            */
00012 /* XRootD is free software: you can redistribute it and/or modify it under    */
00013 /* the terms of the GNU Lesser General Public License as published by the     */
00014 /* Free Software Foundation, either version 3 of the License, or (at your     */
00015 /* option) any later version.                                                 */
00016 /*                                                                            */
00017 /* XRootD is distributed in the hope that it will be useful, but WITHOUT      */
00018 /* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or      */
00019 /* FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public       */
00020 /* License for more details.                                                  */
00021 /*                                                                            */
00022 /* You should have received a copy of the GNU Lesser General Public License   */
00023 /* along with XRootD in a file called COPYING.LESSER (LGPL license) and file  */
00024 /* COPYING (GPL license).  If not, see <http://www.gnu.org/licenses/>.        */
00025 /*                                                                            */
00026 /* The copyright holder's institutional names and contributor's names may not */
00027 /* be used to endorse or promote products derived from this software without  */
00028 /* specific prior written permission of the institution or contributor.       */
00029 /******************************************************************************/
00030 
00031 #include <stdio.h>
00032 #include <time.h>
00033 #ifndef WIN32
00034 #include "XrdSys/XrdSysHeaders.hh"
00035 #endif
00036 #include "XProtocol/XProtocol.hh"
00037 
00038 /******************************************************************************/
00039 /*                 M i s c e l l a n e o u s   D e f i n e s                  */
00040 /******************************************************************************/
00041 #define ABSTRACTMETHOD(x) {cerr <<"Method "<<x<<" must be overridden!" <<endl;}
00042 
00043 /******************************************************************************/
00044 /*          E r r o r   L o g g i n g / T r a c i n g   F l a g s             */
00045 /******************************************************************************/
00046 #define cryptoTRACE_ALL       0x0007
00047 #define cryptoTRACE_Dump      0x0004
00048 #define cryptoTRACE_Debug     0x0002
00049 #define cryptoTRACE_Notify    0x0001
00050 
00051 // RSA parameters
00052 #define XrdCryptoMinRSABits 512
00053 #define XrdCryptoDefRSABits 1024
00054 #define XrdCryptoDefRSAExp  0x10001
00055 
00056 /******************************************************************************/
00057 /*                     U t i l i t y   F u n c t i o n s                      */
00058 /******************************************************************************/
00059 typedef int (*XrdCryptoKDFunLen_t)();
00060 typedef int (*XrdCryptoKDFun_t)(const char *pass, int plen,
00061                                 const char *salt, int slen,
00062                                 char *key, int klen);
00063 int XrdCryptoKDFunLen();
00064 int XrdCryptoKDFun(const char *pass, int plen, const char *salt, int slen,
00065                    char *key, int klen);
00066 
00067 
00068 /******************************************************************************/
00069 /*  X r d C r y p t o S e t T r a c e                                         */
00070 /*                                                                            */
00071 /*  Set trace flags according to 'trace'                                      */
00072 /*                                                                            */
00073 /******************************************************************************/
00074 //______________________________________________________________________________
00075 void XrdCryptoSetTrace(kXR_int32 trace);
00076 
00077 
00078 /******************************************************************************/
00079 /*  X r d C r y p t o T Z C o r r                                             */
00080 /*                                                                            */
00081 /*  Time Zone correction (calculated once)                                    */
00082 /*                                                                            */
00083 /******************************************************************************/
00084 //______________________________________________________________________________
00085 int XrdCryptoTZCorr();
00086 const int XrdCryptoDSTShift = 3600;
00087 
00088 #endif