xrootd
XrdCryptosslAux.hh
Go to the documentation of this file.
1 #ifndef __CRYPTO_SSLAUX_H__
2 #define __CRYPTO_SSLAUX_H__
3 /******************************************************************************/
4 /* */
5 /* X r d C r y p t o S s l 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 /* ************************************************************************** */
32 /* */
33 /* OpenSSL utility functions */
34 /* */
35 /* ************************************************************************** */
36 
39 #include <openssl/asn1.h>
40 
41 #define kSslKDFunDefLen 24
42 
43 //
44 // Password-Based Key Derivation Function 2, specified in PKCS #5
45 //
46 int XrdCryptosslKDFunLen(); // default buffer length
47 int XrdCryptosslKDFun(const char *pass, int plen, const char *salt, int slen,
48  char *key, int len);
49 //
50 // X509 manipulation: certificate verification
52 // chain verification
53 bool XrdCryptosslX509VerifyChain(XrdCryptoX509Chain *chain, int &errcode);
54 // chain export to bucket
56 // chain export to file (proxy file creation)
57 int XrdCryptosslX509ChainToFile(XrdCryptoX509Chain *c, const char *fn);
58 // certificates from file parsing
59 int XrdCryptosslX509ParseFile(const char *fname, XrdCryptoX509Chain *c);
60 // certificates from bucket parsing
62 //
63 // Function to convert from ASN1 time format into UTC since Epoch (Jan 1, 1970)
64 int XrdCryptosslASN1toUTC(ASN1_TIME *tsn1);
65 
66 // Function to convert X509_NAME into a one-line human readable string
67 void XrdCryptosslNameOneLine(X509_NAME *nm, XrdOucString &s);
68 
69 /******************************************************************************/
70 /* E r r o r L o g g i n g / T r a c i n g F l a g s */
71 /******************************************************************************/
72 #define sslTRACE_ALL 0x0007
73 #define sslTRACE_Dump 0x0004
74 #define sslTRACE_Debug 0x0002
75 #define sslTRACE_Notify 0x0001
76 
77 #endif
78