00001 #ifndef __SEC_ENTITY_H__ 00002 #define __SEC_ENTITY_H__ 00003 /******************************************************************************/ 00004 /* */ 00005 /* X r d S e c E n t i t y . h h */ 00006 /* */ 00007 /* (c) 2005 by the Board of Trustees of the Leland Stanford, Jr., University */ 00008 /* Produced by Andrew Hanushevsky for Stanford University under contract */ 00009 /* DE-AC02-76-SFO0515 with the Department of Energy */ 00010 /* */ 00011 /* This file is part of the XRootD software suite. */ 00012 /* */ 00013 /* XRootD is free software: you can redistribute it and/or modify it under */ 00014 /* the terms of the GNU Lesser General Public License as published by the */ 00015 /* Free Software Foundation, either version 3 of the License, or (at your */ 00016 /* option) any later version. */ 00017 /* */ 00018 /* XRootD is distributed in the hope that it will be useful, but WITHOUT */ 00019 /* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or */ 00020 /* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public */ 00021 /* License for more details. */ 00022 /* */ 00023 /* You should have received a copy of the GNU Lesser General Public License */ 00024 /* along with XRootD in a file called COPYING.LESSER (LGPL license) and file */ 00025 /* COPYING (GPL license). If not, see <http://www.gnu.org/licenses/>. */ 00026 /* */ 00027 /* The copyright holder's institutional names and contributor's names may not */ 00028 /* be used to endorse or promote products derived from this software without */ 00029 /* specific prior written permission of the institution or contributor. */ 00030 /******************************************************************************/ 00031 00032 // This structure is returned during authentication. This is most relevant 00033 // for client authentication unless mutual authentication has been implemented 00034 // in which case the client can also authenticate the server. It is embeded 00035 // in each protocol object to facilitate mutual authentication. Note that the 00036 // destructor does nothing and it is the responsibility of the protocol object 00037 // to delete the XrdSecEntity data members, if need be. This is because 00038 // there can only be one destructor instance for the class and it is ambiguous 00039 // as to which shared library definition should be used. Since protocol objects 00040 // have unique class names, each one can have a private destructor avoiding 00041 // platform specific run-time loader address resolution ecentricities. The OO 00042 // "fix" for this problem would require protocols to define a derived private 00043 // destructor for this object which is more hassle than it's worth. 00044 // 00045 00046 #include <string.h> 00047 00048 #define XrdSecPROTOIDSIZE 8 00049 00050 class XrdSecEntity 00051 { 00052 public: 00053 char prot[XrdSecPROTOIDSIZE]; // Protocol used 00054 char *name; // Entity's name 00055 char *host; // Entity's host name 00056 char *vorg; // Entity's virtual organization 00057 char *role; // Entity's role 00058 char *grps; // Entity's group names 00059 char *endorsements; // Protocol specific endorsements 00060 char *creds; // Raw client credentials or certificate 00061 int credslen; // Length of the 'cert' field 00062 char *moninfo; // Additional information for monitoring 00063 char *tident; // Trace identifier (do not touch) 00064 00065 XrdSecEntity(const char *pName = "") 00066 {strncpy(prot, pName, XrdSecPROTOIDSIZE-1); 00067 prot[XrdSecPROTOIDSIZE-1] = '\0'; 00068 name=host=vorg=role=grps=endorsements=creds=moninfo=tident = 0; 00069 credslen = 0; 00070 } 00071 ~XrdSecEntity() {} 00072 }; 00073 00074 #define XrdSecClientName XrdSecEntity 00075 #define XrdSecServerName XrdSecEntity 00076 #endif