Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-30 10:27:54

0001 //------------------------------------------------------------------------------
0002 // This file is part of XrdHTTP: A pragmatic implementation of the
0003 // HTTP/WebDAV protocol for the Xrootd framework
0004 //
0005 // Copyright (c) 2013 by European Organization for Nuclear Research (CERN)
0006 // Author: Fabrizio Furano <furano@cern.ch>
0007 // File Date: Nov 2012
0008 //------------------------------------------------------------------------------
0009 // XRootD is free software: you can redistribute it and/or modify
0010 // it under the terms of the GNU Lesser General Public License as published by
0011 // the Free Software Foundation, either version 3 of the License, or
0012 // (at your option) any later version.
0013 //
0014 // XRootD is distributed in the hope that it will be useful,
0015 // but WITHOUT ANY WARRANTY; without even the implied warranty of
0016 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0017 // GNU General Public License for more details.
0018 //
0019 // You should have received a copy of the GNU Lesser General Public License
0020 // along with XRootD.  If not, see <http://www.gnu.org/licenses/>.
0021 //------------------------------------------------------------------------------
0022 
0023 
0024 
0025 
0026 
0027 
0028 
0029 
0030 
0031 
0032 
0033 #ifndef __XRDHTTPSECXTRACTOR_H__
0034 #define __XRDHTTPSECXTRACTOR_H__
0035 
0036 #include <openssl/ssl.h>
0037 
0038 class XrdLink;
0039 class XrdSecEntity;
0040 
0041 class XrdHttpSecXtractor
0042 {
0043 public:
0044 
0045     // Extract security info from the link instance, and use it to populate
0046     // the given XrdSec instance
0047     virtual int GetSecData(XrdLink *, XrdSecEntity &, SSL *) = 0;
0048 
0049 
0050     // Initializes an ssl ctx
0051     virtual int Init(SSL_CTX *, int) = 0;
0052     virtual int InitSSL(SSL *, char *) { return -1; };
0053     virtual int FreeSSL(SSL *) { return -1; };
0054     
0055 //------------------------------------------------------------------------------
0056 //! Constructor
0057 //------------------------------------------------------------------------------
0058 
0059              XrdHttpSecXtractor() {}
0060 
0061 //------------------------------------------------------------------------------
0062 //! Destructor
0063 //------------------------------------------------------------------------------
0064 
0065 virtual     ~XrdHttpSecXtractor() {}
0066 };
0067 
0068 /******************************************************************************/
0069 /*                    X r d H t t p G e t S e c X t r a c t o r               */
0070 /******************************************************************************/
0071   
0072 //------------------------------------------------------------------------------
0073 //! Obtain an instance of the XrdHttpSecXtractor object.
0074 //!
0075 //! This extern "C" function is called when a shared library plug-in containing
0076 //! implementation of this class is loaded. It must exist in the shared library
0077 //! and must be thread-safe.
0078 //!
0079 //! @param  eDest -> The error object that must be used to print any errors or
0080 //!                  other messages (see XrdSysError.hh).
0081 //! @param  confg -> Name of the configuration file that was used. This pointer
0082 //!                  may be null though that would be impossible.
0083 //! @param  parms -> Argument string specified on the namelib directive. It may
0084 //!                  be null or point to a null string if no parms exist.
0085 //!
0086 //! @return Success: A pointer to an instance of the XrdHttpSecXtractor object.
0087 //!         Failure: A null pointer which causes initialization to fail.
0088 //!
0089 
0090 //------------------------------------------------------------------------------
0091 
0092 class XrdSysError;
0093 
0094 #define XrdHttpSecXtractorArgs XrdSysError       *eDest, \
0095                                const char        *confg, \
0096                                const char        *parms
0097 
0098 extern "C" XrdHttpSecXtractor *XrdHttpGetSecXtractor(XrdHttpSecXtractorArgs);
0099 
0100 //------------------------------------------------------------------------------
0101 //! Declare compilation version.
0102 //!
0103 //! Additionally, you *should* declare the xrootd version you used to compile
0104 //! your plug-in. While not currently required, it is highly recommended to
0105 //! avoid execution issues should the class definition change. Declare it as:
0106 //------------------------------------------------------------------------------
0107 
0108 /*! #include "XrdVersion.hh"
0109     XrdVERSIONINFO(XrdHttpGetSecXtractor,<name>);
0110 
0111     where <name> is a 1- to 15-character unquoted name identifying your plugin.
0112 */
0113 #endif