00001 //------------------------------------------------------------------------------ 00002 // This file is part of XrdHTTP: A pragmatic implementation of the 00003 // HTTP/WebDAV protocol for the Xrootd framework 00004 // 00005 // Copyright (c) 2013 by European Organization for Nuclear Research (CERN) 00006 // Author: Fabrizio Furano <furano@cern.ch> 00007 // File Date: Nov 2012 00008 //------------------------------------------------------------------------------ 00009 // XRootD is free software: you can redistribute it and/or modify 00010 // it under the terms of the GNU Lesser General Public License as published by 00011 // the Free Software Foundation, either version 3 of the License, or 00012 // (at your option) any later version. 00013 // 00014 // XRootD is distributed in the hope that it will be useful, 00015 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00017 // GNU General Public License for more details. 00018 // 00019 // You should have received a copy of the GNU Lesser General Public License 00020 // along with XRootD. If not, see <http://www.gnu.org/licenses/>. 00021 //------------------------------------------------------------------------------ 00022 00023 00024 00025 00026 00027 00028 00029 00030 00031 00032 00033 #ifndef __XRDHTTPSECXTRACTOR_H__ 00034 #define __XRDHTTPSECXTRACTOR_H__ 00035 00036 #include <openssl/ssl.h> 00037 00038 class XrdLink; 00039 class XrdSecEntity; 00040 00041 class XrdHttpSecXtractor 00042 { 00043 public: 00044 00045 // Extract security info from the link instance, and use it to populate 00046 // the given XrdSec instance 00047 virtual int GetSecData(XrdLink *, XrdSecEntity &, SSL *) = 0; 00048 00049 00050 // Initializes an ssl ctx 00051 virtual int Init(SSL_CTX *, int) = 0; 00052 virtual int InitSSL(SSL *, char *) { return -1; }; 00053 virtual int FreeSSL(SSL *) { return -1; }; 00054 00055 //------------------------------------------------------------------------------ 00057 //------------------------------------------------------------------------------ 00058 00059 XrdHttpSecXtractor() {} 00060 00061 //------------------------------------------------------------------------------ 00063 //------------------------------------------------------------------------------ 00064 00065 virtual ~XrdHttpSecXtractor() {} 00066 }; 00067 00068 /******************************************************************************/ 00069 /* X r d H t t p G e t S e c X t r a c t o r */ 00070 /******************************************************************************/ 00071 00072 //------------------------------------------------------------------------------ 00089 00090 //------------------------------------------------------------------------------ 00091 00092 class XrdSysError; 00093 00094 #define XrdHttpSecXtractorArgs XrdSysError *eDest, \ 00095 const char *confg, \ 00096 const char *parms 00097 00098 extern "C" XrdHttpSecXtractor *XrdHttpGetSecXtractor(XrdHttpSecXtractorArgs); 00099 00100 //------------------------------------------------------------------------------ 00106 //------------------------------------------------------------------------------ 00107 00113 #endif