00001 // $Id: XrdCryptosslAux.hh 22437 2008-03-04 14:35:16Z rdm $ 00002 #ifndef __CRYPTO_SSLAUX_H__ 00003 #define __CRYPTO_SSLAUX_H__ 00004 /******************************************************************************/ 00005 /* */ 00006 /* X r d C r y p t o S s l A u x . h h */ 00007 /* */ 00008 /* (c) 2004 by the Board of Trustees of the Leland Stanford, Jr., University */ 00009 /* All Rights Reserved. See XrdInfo.cc for complete License Terms */ 00010 /* Produced by Andrew Hanushevsky for Stanford University under contract */ 00011 /* DE-AC03-76-SFO0515 with the Department of Energy */ 00012 /******************************************************************************/ 00013 00014 /* ************************************************************************** */ 00015 /* */ 00016 /* OpenSSL utility functions */ 00017 /* */ 00018 /* ************************************************************************** */ 00019 00020 #include <XrdCrypto/XrdCryptoAux.hh> 00021 #include <XrdCrypto/XrdCryptoX509Chain.hh> 00022 #include <openssl/asn1.h> 00023 00024 #define kSslKDFunDefLen 24 00025 00026 // 00027 // Password-Based Key Derivation Function 2, specified in PKCS #5 00028 // 00029 int XrdCryptosslKDFunLen(); // default buffer length 00030 int XrdCryptosslKDFun(const char *pass, int plen, const char *salt, int slen, 00031 char *key, int len); 00032 // 00033 // X509 manipulation: certificate verification 00034 bool XrdCryptosslX509VerifyCert(XrdCryptoX509 *c, XrdCryptoX509 *r); 00035 // chain verification 00036 bool XrdCryptosslX509VerifyChain(XrdCryptoX509Chain *chain, int &errcode); 00037 // chain export to bucket 00038 XrdSutBucket *XrdCryptosslX509ExportChain(XrdCryptoX509Chain *c, bool key = 0); 00039 // chain export to file (proxy file creation) 00040 int XrdCryptosslX509ChainToFile(XrdCryptoX509Chain *c, const char *fn); 00041 // certificates from file parsing 00042 int XrdCryptosslX509ParseFile(const char *fname, XrdCryptoX509Chain *c); 00043 // certificates from bucket parsing 00044 int XrdCryptosslX509ParseBucket(XrdSutBucket *b, XrdCryptoX509Chain *c); 00045 // 00046 // Function to convert from ASN1 time format into UTC since Epoch (Jan 1, 1970) 00047 int XrdCryptosslASN1toUTC(ASN1_TIME *tsn1); 00048 00049 /******************************************************************************/ 00050 /* E r r o r L o g g i n g / T r a c i n g F l a g s */ 00051 /******************************************************************************/ 00052 #define sslTRACE_ALL 0x0007 00053 #define sslTRACE_Dump 0x0004 00054 #define sslTRACE_Debug 0x0002 00055 #define sslTRACE_Notify 0x0001 00056 00057 #endif 00058