Back to index

nordugrid-arc-nox  1.1.0~rc6
Classes | Typedefs | Enumerations | Functions | Variables
Arc Namespace Reference

ARCJSDLParser The ARCJSDLParser class, derived from the JobDescriptionParser class, is primarily a job description parser for the consolidated job description language (ARCJSDL), derived from JSDL, described in the following document http://svn.nordugrid.org/trac/nordugrid/browser/arc1/trunk/doc/tech_doc/client/job_description.odt. More...

Classes

class  Destination
 Abstract class to represent a reporting destination. More...
class  Destinations
 Class to handle a set of reporting destinations. More...
class  JobLogFile
 Class to represent a job log file created by A-REX, and to create OGF Job Usage Records from them. More...
class  LutsDestination
 Reporting destination adapter for SGAS LUTS. More...
class  UsageReporter
 The class for main JURA functionality. More...
class  FTPControl
class  JobControllerARC0
class  JobStateARC0
class  SubmitterARC0
struct  ThreadArg
class  TargetRetrieverARC0
class  AREXClient
 A client class for the A-REX service. More...
class  JobControllerARC1
class  JobControllerBES
class  JobStateARC1
class  JobStateBES
class  SubmitterARC1
class  SubmitterBES
class  TargetRetrieverARC1
class  TargetRetrieverBES
class  cmp
class  BenchmarkBroker
class  DataBroker
class  FastestQueueBroker
class  RandomBroker
struct  creamJobInfo
class  CREAMClient
class  JobControllerCREAM
class  JobStateCREAM
class  SubmitterCREAM
class  TargetRetrieverCREAM
class  PythonLock
class  PyObjectP
class  PythonBroker
class  JobControllerUNICORE
class  JobStateUNICORE
class  SubmitterUNICORE
class  TargetRetrieverUNICORE
class  UNICOREClient
 A client class for the UNICORE service. More...
class  ServerOptions
class  Daemon
struct  ARCInfo_t
class  DataPointARC
class  DataPointFile
class  DataPointGridFTP
class  Lister
struct  HTTPInfo_t
class  ChunkControl
class  PayloadMemConst
class  DataPointHTTP
class  DataPointLDAP
class  ldap_bind_arg
class  LDAPQuery
 LDAPQuery class; querying of LDAP servers. More...
class  DataPointLFC
class  meta_resolve_rls_t
class  meta_unregister_rls_t
class  list_files_rls_t
class  DataPointRLS
class  DataPointSRM
class  HTTPResponseHeader
class  HTTPSClientConnector
class  HTTPSClientConnectorGlobus
class  HTTPSClientConnectorGSSAPI
class  HTTPSClient
class  HTTPSClientSOAP
class  ARCJSDLParser
class  Broker
class  BrokerLoader
 Class responsible for loading Broker plugins The Broker objects returned by a BrokerLoader must not be used after the BrokerLoader goes out of scope. More...
class  BrokerPluginArgument
class  ClientInterface
 Utility base class for MCC. More...
class  ClientTCP
 Class for setting up a MCC chain for TCP communication. More...
struct  HTTPClientInfo
class  ClientHTTP
 Class for setting up a MCC chain for HTTP communication. More...
class  ClientSOAP
 Class with easy interface for sending/receiving SOAP messages over HTTP(S/G). More...
class  SecHandlerConfig
class  DNListHandlerConfig
class  ARCPolicyHandlerConfig
class  ClientHTTPwithSAML2SSO
class  ClientSOAPwithSAML2SSO
class  ClientX509Delegation
class  ApplicationEnvironment
 ApplicationEnvironment. More...
class  ExecutionTarget
 ExecutionTarget. More...
class  JDLParser
class  Job
 Job. More...
class  JobController
 Base class for the JobControllers. More...
class  JobControllerLoader
 Class responsible for loading JobController plugins The JobController objects returned by a JobControllerLoader must not be used after the JobControllerLoader goes out of scope. More...
class  JobControllerPluginArgument
class  Range
class  ScalableTime
class  ScalableTime< int >
class  JobIdentificationType
class  ExecutableType
class  NotificationType
class  ApplicationType
class  ResourceSlotType
class  DiskSpaceRequirementType
class  ResourceTargetType
class  ResourcesType
class  DataSourceType
class  DataTargetType
class  DataType
class  FileType
class  DirectoryType
class  DataStagingType
class  JobMetaType
class  JobDescription
class  JobDescriptionParser
class  JobState
 ARC general state model. More...
class  JobSupervisor
 % JobSupervisor class More...
class  RSLValue
class  RSLLiteral
class  RSLVariable
class  RSLConcat
class  RSLList
class  RSLSequence
class  RSL
class  RSLBoolean
class  RSLCondition
class  RSLParser
class  Software
 Used to represent software (names and version) and comparison. More...
class  SoftwareRequirement
 Class used to express and resolve version requirements on software. More...
class  Submitter
 Base class for the Submitters. More...
class  SubmitterLoader
 Class responsible for loading Submitter plugins The Submitter objects returned by a SubmitterLoader must not be used after the SubmitterLoader goes out of scope. More...
class  SubmitterPluginArgument
class  TargetGenerator
 Target generation class More...
class  TargetRetriever
 TargetRetriever base class More...
class  TargetRetrieverLoader
 Class responsible for loading TargetRetriever plugins The TargetRetriever objects returned by a TargetRetrieverLoader must not be used after the TargetRetrieverLoader goes out of scope. More...
class  TargetRetrieverPluginArgument
class  XRSLParser
class  Config
 Configuration element - represents (sub)tree of ARC configuration. More...
class  BaseConfig
 Configuration for client interface. More...
class  ArcLocation
 Determines ARC installation location. More...
class  RegularExpression
 A regular expression class. More...
class  Base64
class  MemoryAllocationException
class  ByteArray
class  Counter
 A class defining a common interface for counters. More...
class  CounterTicket
 A class for "tickets" that correspond to counter reservations. More...
class  ExpirationReminder
 A class intended for internal use within counters. More...
class  Period
class  Time
 A class for storing and manipulating times. More...
class  Database
 Interface for calling database client library. More...
class  Query
class  DItem
class  DBranch
class  DItemString
class  FileLock
class  IniConfig
class  IntraProcessCounter
 A class for counters used by threads within a single process. More...
class  PrintFBase
class  PrintF
class  IString
struct  LoggerFormat
class  LogMessage
 A class for log messages. More...
class  LogDestination
 A base class for log destinations. More...
class  LogStream
 A class for logging to ostreams. More...
class  LogFile
 A class for logging to files. More...
class  Logger
 A logger class. More...
class  MySQLDatabase
 Implement the database accessing interface in DBInterface.h by using mysql client library for accessing mysql database. More...
class  MySQLQuery
class  OptionBase
class  BoolOption
struct  IntOption
struct  StringOption
struct  StringListOption
class  OptionParser
class  Profile
class  Run
 This class runs external executable. More...
class  RunPump
class  Pid
class  RunInitializerArgument
struct  PipeThreadArg
class  ThreadInc
class  ThreadArgument
class  ThreadPool
class  SimpleCondition
 Helper function to create simple thread. More...
class  ThreadRegistry
 This class is a set of conditions, mutexes, etc. conveniently exposed to moitor running child threads and to wait till they exit. There are no protections against race conditions. So use it carefully. More...
class  ThreadInitializer
class  URL
class  URLLocation
 Class to hold a resolved URL location. More...
class  PathIterator
 Class to iterate through elements of path. More...
class  User
class  UserSwitch
 If this class is created user identity is switched to provided uid and gid. More...
class  initializeCredentialsType
class  UserConfig
 User configuration class More...
class  SIGPIPEIngore
class  AutoPointer
 Wrapper for pointer with automatic destruction. More...
class  CountedPointer
 Wrapper for pointer with automatic destruction and mutiple references. More...
class  NS
class  XMLNode
 Wrapper for LibXML library Tree interface. More...
class  XMLNodeContainer
 Container for multiple XMLNode elements. More...
struct  pw_cb_data
class  AutoBIO
class  CredentialError
 This is an exception class that is used to handle runtime errors discovered in the Credential class. More...
class  Credential
class  VOMSTrustList
 Stores definitions for making decision if VOMS server is trusted. More...
class  CheckSum
 Defines interface for variuos checksum manipulations. More...
class  CRC32Sum
 Implementation of CRC32 checksum. More...
class  MD5Sum
 Implementation of MD5 checksum. More...
class  Adler32Sum
 Implementation of Adler32 checksum. More...
class  CheckSumAny
 Wraper for CheckSum class. More...
class  DataBuffer
 Represents set of buffers. More...
class  DataCallback
 This class is used by DataHandle to report missing space on local filesystem. One of 'cb' functions here will be called if operation initiated by DataHandle::start_reading runs out of disk space. More...
class  DataHandle
 This class is a wrapper around the DataPoint class. More...
struct  transfer_struct
class  DataMover
 A purpose of this class is to provide an interface that moves data between two locations specified by URLs. It's main action is represented by methods DataMover::Transfer. Instance represents only attributes used during transfer. More...
class  DataPoint
 This base class is an abstraction of URL. More...
class  DataPointLoader
class  DataPointPluginArgument
class  DataPointDirect
 This is a kind of generalized file handle. More...
class  DataPointIndex
 Complements DataPoint with attributes common for Indexing Service URLs. More...
class  DataSpeed
 Keeps track of average and instantaneous transfer speed. More...
class  DataStatus
 A class to be used for return types of all major data handling methods. More...
struct  CacheParameters
 Contains data on the parameters of a cache. More...
class  FileCache
 FileCache provides an interface to all cache operations to be used by external classes. More...
class  FileInfo
 FileInfo stores information about files (metadata). More...
class  URLMap
class  XmlContainer
class  XmlDatabase
class  DelegationConsumer
 A consumer of delegated X509 credentials. More...
class  DelegationProvider
 A provider of delegated credentials. More...
class  DelegationConsumerSOAP
 This class extends DelegationConsumer to support SOAP message exchange. More...
class  DelegationProviderSOAP
 Extension of DelegationProvider with SOAP exchange interface. More...
class  DelegationContainerSOAP
 Manages multiple delegated credentials. More...
class  GlobusResult
class  GSSCredential
struct  Registrar_data
class  InfoCache
 Stores XML document in filesystem split into parts. More...
class  InfoCacheInterface
class  InfoPolicy
class  InfoFilter
 Filters information document according to identity of requestor. More...
class  CondExit
class  InfoRegister
 Registration to ISIS interface. More...
class  InfoRegisters
 Handling multiple registrations to ISISes. More...
struct  Register_Info_Type
struct  ISIS_description
class  InfoRegistrar
 Registration process associated with particular ISIS. More...
class  InfoRegisterContainer
 Singleton class for scanning configuration and storing refernces to registration elements. More...
class  MutexSLock
class  InformationInterface
 Information System message processor. More...
class  InformationContainer
 Information System document container and processor. More...
class  InformationRequest
 Request for information in InfoSystem. More...
class  InformationResponse
 Informational response from InfoSystem. More...
class  RegisteredService
 RegisteredService - extension of Service performing self-registration. More...
class  FinderLoader
class  Loader
 Plugins loader. More...
class  LoadableModuleDesciption
class  ModuleManager
 Manager of shared libraries. More...
class  ARCModuleDescriptor
class  Plugin
 Base class for loadable ARC components. More...
class  PluginArgument
 Base class for passing arguments to loadable ARC components. More...
struct  PluginDescriptor
 Description of ARC lodable component. More...
class  PluginDesc
 Description of plugin. More...
class  ModuleDesc
 Description of loadable module. More...
class  PluginsFactory
 Generic ARC plugins loader. More...
class  MCCInterface
 Interface for communication between MCC, Service and Plexer objects. More...
class  MCC
 Message Chain Component - base class for every MCC plugin. More...
class  MCCConfig
class  MCCPluginArgument
class  MCC_Status
 A class for communication of MCC processing results. More...
class  mcc_connector_t
class  plexer_connector_t
class  mcc_connectors_t
class  plexer_connectors_t
class  MCCLoader
 Creator of Message Component Chains (MCC). More...
class  ChainContext
 Interface to chain specific functionality. More...
class  MessagePayload
 Base class for content of message passed through chain. More...
class  MessageContextElement
 Top class for elements contained in message context. More...
class  MessageContext
 Handler for content of message context. More...
class  MessageAuthContext
 Handler for content of message auth* context. More...
class  Message
 Object being passed through chain of MCCs. More...
class  AttributeIterator
 A const iterator class for accessing multiple values of an attribute. More...
class  MessageAttributes
 A class for storage of attribute values. More...
class  _XMLPair
class  MessageAuth
 Contains authencity information, authorization tokens and decisions. More...
class  PayloadRawInterface
 Random Access Payload for Message objects. More...
struct  PayloadRawBuf
class  PayloadRaw
 Raw byte multi-buffer. More...
class  PayloadSOAP
 Payload of Message with SOAP content. More...
class  PayloadStreamInterface
 Stream-like Payload for Message object. More...
class  PayloadStream
 POSIX handle as Payload. More...
class  PlexerEntry
 A pair of label (regex) and pointer to MCC. More...
class  Plexer
 The Plexer class, used for routing messages to services. More...
class  SecAttrFormat
 Export/import format. More...
class  SecAttr
 This is an abstract interface to a security attribute. More...
class  MultiSecAttr
 Container of multiple SecAttr attributes. More...
class  Service
 Service - last component in a Message Chain. More...
class  ServicePluginArgument
class  SOAPMessage
 Message restricted to SOAP payload. More...
class  ClassLoader
class  ClassLoaderPluginArgument
class  WSAEndpointReference
 Interface for manipulation of WS-Adressing Endpoint Reference. More...
class  WSAHeader
 Interface for manipulation WS-Addressing information in SOAP header. More...
class  SAMLToken
 Class for manipulating SAML Token Profile. More...
class  UsernameToken
 Interface for manipulation of WS-Security according to Username Token Profile. More...
class  X509Token
 Class for manipulating X.509 Token Profile. More...
class  WSRP
 Base class for WS-ResourceProperties structures. More...
class  WSRPFault
 Base class for WS-ResourceProperties faults. More...
class  WSRPInvalidResourcePropertyQNameFault
class  WSRPResourcePropertyChangeFailure
 Base class for WS-ResourceProperties faults which contain ResourcePropertyChangeFailure. More...
class  WSRPUnableToPutResourcePropertyDocumentFault
class  WSRPInvalidModificationFault
class  WSRPUnableToModifyResourcePropertyFault
class  WSRPSetResourcePropertyRequestFailedFault
class  WSRPInsertResourcePropertiesRequestFailedFault
class  WSRPUpdateResourcePropertiesRequestFailedFault
class  WSRPDeleteResourcePropertiesRequestFailedFault
class  WSRPGetResourcePropertyDocumentRequest
class  WSRPGetResourcePropertyDocumentResponse
class  WSRPGetResourcePropertyRequest
class  WSRPGetResourcePropertyResponse
class  WSRPGetMultipleResourcePropertiesRequest
class  WSRPGetMultipleResourcePropertiesResponse
class  WSRPPutResourcePropertyDocumentRequest
class  WSRPPutResourcePropertyDocumentResponse
class  WSRPModifyResourceProperties
class  WSRPInsertResourceProperties
class  WSRPUpdateResourceProperties
class  WSRPDeleteResourceProperties
class  WSRPSetResourcePropertiesRequest
class  WSRPSetResourcePropertiesResponse
class  WSRPInsertResourcePropertiesRequest
class  WSRPInsertResourcePropertiesResponse
class  WSRPUpdateResourcePropertiesRequest
class  WSRPUpdateResourcePropertiesResponse
class  WSRPDeleteResourcePropertiesRequest
class  WSRPDeleteResourcePropertiesResponse
class  WSRPQueryResourcePropertiesRequest
class  WSRPQueryResourcePropertiesResponse
class  WSRF
 Base class for every WSRF message. More...
class  WSRFBaseFault
 Base class for WSRF fault messages. More...
class  WSRFResourceUnknownFault
class  WSRFResourceUnavailableFault
class  XMLSecNode
 Extends XMLNode class to support XML security operation. More...
class  MCC_GSI_Context
class  MCC_GSI_Service
class  MCC_GSI_Client
class  PayloadGSIStream
class  HTTPSecAttr
class  MCC_HTTP
 A base class for HTTP client and service MCCs. More...
class  MCC_HTTP_Service
 This class implements MCC to processes HTTP request. More...
class  MCC_HTTP_Client
 This class is a client part of HTTP MCC. More...
class  PayloadHTTP
 This class implements parsing and generation of HTTP messages. More...
class  MCC_MsgValidator
class  MCC_MsgValidator_Service
class  SOAPSecAttr
class  MCC_SOAP
 A base class for SOAP client and service MCCs. More...
class  MCC_SOAP_Service
 This MCC parses SOAP message from input payload. More...
class  MCC_SOAP_Client
class  TCPSecAttr
class  MCC_TCP
 A base class for TCP client and service MCCs. More...
class  MCC_TCP_Service
 This class is MCC implementing TCP server. More...
class  MCC_TCP_Client
 This class is MCC implementing TCP client. More...
class  PayloadTCPSocket
 This class extends PayloadStream with TCP socket specific features. More...
class  BIOMCC
class  ConfigTLSMCC
class  TLSSecAttr
class  MCC_TLS
 A base class for TLS client and service MCCs. More...
class  MCC_TLS_Service
 This MCC implements TLS server side functionality. More...
class  MCC_TLS_Client
 This class is MCC implementing TLS client. More...
class  PayloadTLSMCC
class  PayloadTLSStream
 Implemetation of PayloadStreamInterface for SSL handle. More...
class  Compiler_AREXClientError
 An exception class for the Compiler_AREXClient class. More...
class  Compiler_AREXFile
class  Compiler_AREXClient
 A client class for the A-REX service. More...
class  JobNotFoundException
class  JobSelector
class  JobQueueIterator
class  JobQueue
class  JobRequest
class  JobSchedMetaData
class  Service_JavaWrapper
class  XMLNodeP
class  SOAPMessageP
class  Service_PythonWrapper

Typedefs

typedef bool(* rls_lrc_callback_t )(globus_rls_handle_t *h, const URL &url, void *arg)
typedef JobState::StateType(* JobStateMap )(const std::string &)
typedef std::vector
< std::vector< std::string > > 
QueryArrayResult
typedef std::vector< std::string > QueryRowResult
typedef std::map< std::string,
std::list< URL > > 
URLListMap
typedef std::list< XMLNodeXMLNodeList
typedef struct Arc::pw_cb_data PW_CB_DATA
typedef std::vector< std::string > VOMSTrustChain
typedef std::string VOMSTrustRegex
typedef std::map< std::string,
std::string > 
DelegationRestrictions
typedef std::list< std::pair
< std::string, XMLNode > > 
InfoFilterPolicies
typedef std::map< std::string,
LoadableModuleDesciption
plugin_cache_t
typedef Plugin *(* get_plugin_instance )(PluginArgument *arg)
 Constructor function of ARC lodable component.
typedef std::multimap
< std::string, std::string > 
AttrMap
 A typefed of a multimap for storage of message attributes.
typedef AttrMap::const_iterator AttrConstIter
 A typedef of a const_iterator for AttrMap.
typedef AttrMap::iterator AttrIter
 A typedef of an (non-const) iterator for AttrMap.
typedef Plugin LoadableClass
typedef std::list
< Compiler_AREXFile
Compiler_AREXFileList

Enumerations

enum  HTTPError {
  HTTP_OK = 200, HTTP_NOT_IMPLEMENTED = 501, HTTP_NOT_ALLOWED = 403, HTTP_NOT_FOUND = 404,
  HTTP_ERROR = 500, HTTP_FAILURE = -1
}
enum  SecurityLayer { NoSec, TLSSec, GSISec, SSL3Sec }
enum  DelegationType {
  DELEG_ARC, DELEG_GRIDSITE, DELEG_GT4, DELEG_MYPROXY,
  DELEG_UNKNOWN
}
enum  ComputingActivityType { SINGLE = 0, COLLECTIONELEMENT = 1, PARALLELELEMENT = 2, WORKFLOWNODE = 3 }
enum  SessionDirectoryAccessMode { SDAM_NONE = 0, SDAM_RO = 1, SDAM_RW = 2 }
enum  NodeAccessType { NAT_NONE = 0, NAT_INBOUND = 1, NAT_OUTBOUND = 2, NAT_INOUTBOUND = 3 }
enum  RSLBoolOp { RSLBoolError, RSLMulti, RSLAnd, RSLOr }
enum  RSLRelOp {
  RSLRelError, RSLEqual, RSLNotEqual, RSLLess,
  RSLGreater, RSLLessOrEqual, RSLGreaterOrEqual
}
enum  TimeFormat {
  MDSTime, ASCTime, UserTime, ISOTime,
  UTCTime, RFC1123Time
}
 An enumeration that contains the possible textual timeformats. More...
enum  PeriodBase {
  PeriodMiliseconds, PeriodSeconds, PeriodMinutes, PeriodHours,
  PeriodDays, PeriodWeeks
}
enum  LogLevel {
  DEBUG = 1, VERBOSE = 2, INFO = 4, WARNING = 8,
  ERROR = 16, FATAL = 32
}
 Logging levels. More...
enum  LogFormat { LongFormat, ShortFormat }
enum  ServiceType { COMPUTING, INDEX }
enum  Credformat { CRED_PEM, CRED_DER, CRED_PKCS, CRED_UNKNOWN }
enum  StatusKind {
  STATUS_UNDEFINED = 0, STATUS_OK = 1, GENERIC_ERROR = 2, PARSING_ERROR = 4,
  PROTOCOL_RECOGNIZED_ERROR = 8, UNKNOWN_SERVICE_ERROR = 16, BUSY_ERROR = 32, SESSION_CLOSE = 64
}
 Status kinds (types) More...
enum  WSAFault {
  WSAFaultNone, WSAFaultUnknown, WSAFaultInvalidAddressingHeader, WSAFaultInvalidAddress,
  WSAFaultInvalidEPR, WSAFaultInvalidCardinality, WSAFaultMissingAddressInEPR, WSAFaultDuplicateMessageID,
  WSAFaultActionMismatch, WSAFaultOnlyAnonymousAddressSupported, WSAFaultOnlyNonAnonymousAddressSupported, WSAFaultMessageAddressingHeaderRequired,
  WSAFaultDestinationUnreachable, WSAFaultActionNotSupported, WSAFaultEndpointUnavailable
}
 WS-Addressing possible faults. More...
enum  SignatureMethod { RSA_SHA1, DSA_SHA1 }
enum  SchedJobStatus {
  JOB_STATUS_SCHED_NEW, JOB_STATUS_SCHED_RESCHEDULED, JOB_STATUS_SCHED_STARTING, JOB_STATUS_SCHED_RUNNING,
  JOB_STATUS_SCHED_CANCELLED, JOB_STATUS_SCHED_FAILED, JOB_STATUS_SCHED_FINISHED, JOB_STATUS_SCHED_KILLED,
  JOB_STATUS_SCHED_KILLING, JOB_STATUS_SCHED_UNKNOWN
}
enum  ARexJobStatus {
  JOB_STATUS_AREX_ACCEPTING, JOB_STATUS_AREX_ACCEPTED, JOB_STATUS_AREX_PREPARING, JOB_STATUS_AREX_PREPARED,
  JOB_STATUS_AREX_SUBMITTING, JOB_STATUS_AREX_EXECUTING, JOB_STATUS_AREX_KILLING, JOB_STATUS_AREX_EXECUTED,
  JOB_STATUS_AREX_FINISHING, JOB_STATUS_AREX_FAILED, JOB_STATUS_AREX_HELD, JOB_STATUS_AREX_UNKNOWN
}
enum  PaulJobStatus {
  JOB_STATUS_PAUL_NEW, JOB_STATUS_PAUL_STARTING, JOB_STATUS_PAUL_STAGEIN, JOB_STATUS_PAUL_RUNNING,
  JOB_STATUS_PAUL_STAGEOUT, JOB_STATUS_PAUL_FAILDE, JOB_STATUS_PAUL_KILLING, JOB_STATUS_PAUL_KILLED,
  JOB_STATUS_PAUL_FINISHED, JOB_STATUS_PAUL_UNKNOWN
}

Functions

static void CloseCallback (void *arg, globus_ftp_control_handle_t *, globus_object_t *error, globus_ftp_control_response_t *response)
static void ControlCallback (void *arg, globus_ftp_control_handle_t *, globus_object_t *error, globus_ftp_control_response_t *response)
static void ConnectCallback (void *arg, globus_ftp_control_handle_t *, globus_object_t *error, globus_ftp_control_response_t *response)
static void DataConnectCallback (void *arg, globus_ftp_control_handle_t *, unsigned int, globus_bool_t, globus_object_t *)
static void ReadWriteCallback (void *arg, globus_ftp_control_handle_t *, globus_object_t *, globus_byte_t *, globus_size_t, globus_off_t, globus_bool_t)
static int pwck (char *, int, int)
static XMLNode find_xml_node (XMLNode node, const std::string &el_name, const std::string &attr_name, const std::string &attr_value)
static void set_bes_namespaces (NS &ns)
static void set_arex_namespaces (NS &ns)
static char hex_to_char (const char *v)
static std::string extract_job_id (const URL &u)
static std::string char_to_hex (char v)
static std::string disguise_id_into_url (const URL &u, const std::string &id)
const std::string alphanum ("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789")
bool DataCompare (const ExecutionTarget *T1, const ExecutionTarget *T2)
bool CompareExecutionTarget (const ExecutionTarget *T1, const ExecutionTarget *T2)
bool stringtoTime (const std::string &timestring, Time &time)
static void set_cream_namespaces (NS &ns)
static const std::string BES_FACTORY_ACTIONS_BASE_URL ("http://schemas.ggf.org/bes/2006/08/bes-factory/BESFactoryPortType/")
static const std::string BES_MANAGEMENT_ACTIONS_BASE_URL ("http://schemas.ggf.org/bes/2006/08/bes-management/BESManagementPortType/")
static void set_UNICORE_namespaces (NS &ns)
static void set_bes_factory_action (SOAPEnvelope &soap, const char *op)
static bool remove_last_dir (std::string &dir)
static bool add_last_dir (std::string &dir, const std::string &path)
bool SetAttributes (FileInfo &fi, const char *facts)
static bool html2list (const char *html, const URL &base, std::list< FileInfo > &files)
static void ldap_bind_with_timeout (void *arg)
static Glib::Mutex * ldap_lock (void)
static const char * get_path_str (const URL &url)
static bool path_empty (const URL &url)
static globus_result_t globus_rls_client_lrc_attr_put (globus_rls_handle_t *h, char *key, globus_rls_attribute_t *attr, int overwrite)
static bool meta_resolve_callback (globus_rls_handle_t *h, const URL &rlsurl, void *arg)
static bool meta_unregister_callback (globus_rls_handle_t *h, const URL &rlsurl, void *arg)
static bool get_attributes (globus_rls_handle_t *h, const std::string &lfn, FileInfo &f)
static bool list_files_callback (globus_rls_handle_t *h, const URL &rlsurl, void *arg)
static Logger logger (Logger::rootLogger,"RLS")
bool rls_find_lrcs (const URL &url, rls_lrc_callback_t callback, void *arg)
bool rls_find_lrcs (const URL &url, std::list< URL > lrcs)
bool rls_find_lrcs (std::list< URL > rlis, std::list< URL > lrcs, rls_lrc_callback_t callback, void *arg)
bool rls_find_lrcs (std::list< URL > rlis, std::list< URL > lrcs, bool down, bool up, rls_lrc_callback_t callback, void *arg)
static
globus_io_secure_delegation_mode_t 
ChooseDelegationMode (gss_cred_id_t cred)
static std::string gss_error_string (OM_uint32 maj_status, OM_uint32 min_status)
static unsigned int timems (void)
static bool waitsocket (int r, int w, int &timeout)
static void XmlErrorHandler (void *ctx, const char *msg)
static void xml_add_element (XMLNode xml, XMLNode element)
static void xml_add_elements (XMLNode xml, XMLNode elements)
static XMLNode ConfigMakeComponent (XMLNode chain, const char *name, const char *id, const char *next=NULL)
static XMLNode ConfigFindComponent (XMLNode chain, const char *name, const char *id)
static std::string get_http_proxy (const URL &url)
static std::string get_http_proxy_host (const URL &url, const std::string &proxy_host, int proxy_port)
static int get_http_proxy_port (const URL &url, const std::string &proxy_host, int proxy_port)
static MCC_Status process_saml2sso (const std::string &idp_name, const std::string &username, const std::string &password, ClientHTTP *http_client, std::string &cert_file, std::string &privkey_file, std::string &ca_file, std::string &ca_dir, Logger &logger, std::string &cookie)
std::ostream & operator<< (std::ostream &os, const RSLBoolOp op)
std::ostream & operator<< (std::ostream &os, const RSLRelOp op)
std::ostream & operator<< (std::ostream &os, const RSLValue &value)
std::ostream & operator<< (std::ostream &os, const RSL &rsl)
static Software::ComparisonOperator convertOperator (const RSLRelOp &op)
static RSLRelOp convertOperator (const Software::ComparisonOperator &op)
static std::list< const RSL * > SplitRSL (const RSL *r)
static char StateToShortcut (const std::string &state)
static std::string ShortcutToState (char state)
static bool AddNotificationState (NotificationType &notification, const std::string &states)
static bool AddNotification (std::list< NotificationType > &notifications, const std::string &states, const std::string &email)
static void _print (XMLNode &node, int skip)
const Glib::TimeVal ETERNAL (G_MAXLONG, 0)
const Glib::TimeVal HISTORIC (G_MINLONG, 0)
static Logger dateTimeLogger (Logger::getRootLogger(),"DateTime")
std::ostream & operator<< (std::ostream &, const Time &)
 Prints a Time-object to the given ostream -- typically cout.
std::string TimeStamp (const TimeFormat &=Time::GetFormat())
 Returns a time-stamp of the current time in some format.
std::string TimeStamp (Time, const TimeFormat &=Time::GetFormat())
 Returns a time-stamp of some specified time in some format.
std::ostream & operator<< (std::ostream &, const Period &)
 Prints a Period-object to the given ostream -- typically cout.
int FileOpen (const char *path, int flags, mode_t mode)
int FileOpen (const char *path, int flags, uid_t uid, gid_t gid, mode_t mode)
Glib::Dir * DirOpen (const char *path)
Glib::Dir * DirOpen (const char *path, uid_t uid, gid_t gid)
bool FileStat (const char *path, struct stat *st, bool follow_symlinks)
bool FileStat (const char *path, struct stat *st, uid_t uid, gid_t gid, bool follow_symlinks)
bool DirCreate (const char *path, mode_t mode)
bool DirCreate (const char *path, uid_t uid, gid_t gid, mode_t mode)
void GUID (std::string &guid)
 This function generates a random identifier which is quite unique as well.
std::string UUID (void)
 This function generates uuid.
const char * FindTrans (const char *p)
const char * FindNTrans (const char *s, const char *p, unsigned long n)
std::ostream & operator<< (std::ostream &os, const IString &msg)
std::ostream & operator<< (std::ostream &os, LogLevel level)
 Printing of LogLevel values to ostreams.
LogLevel string_to_level (const std::string &str)
 Convert string to a LogLevel.
bool string_to_level (const std::string &str, LogLevel &ll)
 Same as istring_to_level except it is case-sensitive.
bool istring_to_level (const std::string &llStr, LogLevel &ll)
 Case-insensitive parsing of a string to a LogLevel with error response.
std::string level_to_string (const LogLevel &level)
 Convert LogLevel to a string.
std::ostream & operator<< (std::ostream &os, const LoggerFormat &format)
std::ostream & operator<< (std::ostream &os, const LogMessage &message)
static void setopt (struct option &opt, const char *name, int has_arg, int *flag, int val)
static void MapTagToNode (XMLNode node, const std::string &sections, const std::string &tag, XMLNode iniNode)
static void EvaluateNode (XMLNode n, const IniConfig &ini)
void pipe_handler (void *arg)
Logger stringLogger (Logger::getRootLogger(),"StringConv")
std::string lower (const std::string &s)
 This method converts to lower case of the string.
std::string upper (const std::string &s)
 This method converts to upper case of the string.
void tokenize (const std::string &str, std::vector< std::string > &tokens, const std::string &delimiters=" ")
 This method tokenizes string.
void tokenize (const std::string &str, std::list< std::string > &tokens, const std::string &delimiters=" ")
std::string trim (const std::string &str, const char *sep=NULL)
 This method removes given separators from the beginning and the end of the string.
std::string strip (const std::string &str)
 This method removes blank lines from the passed text string. Lines with only space on them are considered blank.
static int unescape_character (const std::string &scanner, int i)
std::string uri_unescape (const std::string &str)
 This method unescape the URI encoded string.
std::string convert_to_rdn (const std::string &dn)
 Convert dn to rdn: /O=Grid/OU=Knowarc/CN=abc ---> CN=abc,OU=Knowarc,O=Grid.
template<typename T >
T stringto (const std::string &s)
 This method converts a string to any type.
template<typename T >
bool stringto (const std::string &s, T &t)
 This method converts a string to any type but lets calling function process errors.
template<typename T >
std::string tostring (T t, const int width=0, const int precision=0)
 This method converts any type to a string of the width given.
static Logger threadLogger (Logger::getRootLogger(),"Thread")
bool CreateThreadFunction (void(*func)(void *), void *arg)
 This macro behaves like function which makes thread of class' method.
void GlibThreadInitialize (void)
static Logger URLLogger (Logger::getRootLogger(),"URL")
static std::list< std::string > ParseAttributes (const std::string &attrstring, char separator)
static std::string AttributeString (const std::list< std::string > attributes, char separator)
std::ostream & operator<< (std::ostream &out, const URL &url)
std::list< URLReadURLList (const URL &urllist)
 Reads a list of URLs from a file.
static uid_t get_user_id (void)
static uid_t get_group_id (void)
std::string tostring (const ServiceType st)
std::string GetEnv (const std::string &var)
 Portable function for getting environment variables.
std::string GetEnv (const std::string &var, bool &found)
 Portable function for getting environment variables.
bool SetEnv (const std::string &var, const std::string &value, bool overwrite=true)
 Portable function for setting environment variables.
void UnsetEnv (const std::string &var)
 Portable function for unsetting environment variables.
std::string StrError (int errnum=errno)
 Portable function for obtaining description of last system error.
bool PersistentLibraryInit (const std::string &name)
static xmlNsPtr GetNamespace (xmlNodePtr node)
static bool MatchXMLName (xmlNodePtr node1, xmlNodePtr node2)
static bool MatchXMLName (xmlNodePtr node, const char *name)
static bool MatchXMLNamespace (xmlNodePtr node1, xmlNodePtr node2)
static bool MatchXMLNamespace (xmlNodePtr node, const char *uri)
bool MatchXMLName (const XMLNode &node1, const XMLNode &node2)
 Returns true if underlying XML elements have same names.
bool MatchXMLName (const XMLNode &node, const char *name)
 Returns true if 'name' matches name of 'node'.
bool MatchXMLName (const XMLNode &node, const std::string &name)
 Returns true if 'name' matches name of 'node'.
bool MatchXMLNamespace (const XMLNode &node1, const XMLNode &node2)
 Returns true if underlying XML elements belong to same namespaces.
bool MatchXMLNamespace (const XMLNode &node, const char *uri)
 Returns true if 'namespace' matches 'node's namespace.
bool MatchXMLNamespace (const XMLNode &node, const std::string &uri)
 Returns true if 'namespace' matches 'node's namespace.
static void ReplaceNamespace (xmlNsPtr ns, xmlNodePtr node, xmlNsPtr new_ns)
static void ReassignNamespace (xmlNsPtr ns, xmlNodePtr node, bool keep=false, int recursion=-1)
static void SetNamespaces (const NS &namespaces, xmlNodePtr node_, bool keep=false, int recursion=-1)
static void GetNamespaces (NS &namespaces, xmlNodePtr node_)
static int write_to_string (void *context, const char *buffer, int len)
static int close_string (void *context)
std::ostream & operator<< (std::ostream &out, const XMLNode &node)
std::istream & operator>> (std::istream &in, XMLNode &node)
static int ssl_err_cb (const char *str, size_t, void *u)
static int passwordcb (char *buf, int bufsiz, int verify, PW_CB_DATA *cb_tmp)
Time asn1_to_utctime (const ASN1_UTCTIME *s)
static void getLifetime (STACK_OF(X509)*certchain, X509 *cert, Time &start, Period &lifetime)
static int keygen_cb (int p, int, BN_GENCB *)
 STACK_OF (X509)*Credential
static void print_ssl_errors ()
int rand_serial (BIGNUM *b, ASN1_INTEGER *ai)
BIGNUM * load_serial (char *serialfile, int create, ASN1_INTEGER **retai)
int save_serial (char *serialfile, char *suffix, BIGNUM *serial, ASN1_INTEGER **retai)
static ASN1_INTEGER * x509_load_serial (char *CAfile, char *serialfile, int create)
static int x509_certify (X509_STORE *ctx, char *CAfile, const EVP_MD *digest, X509 *x, X509 *xca, EVP_PKEY *pkey, char *serialfile, int create, long lifetime, int clrext, CONF *conf, char *section, ASN1_INTEGER *sno)
void InitVOMSAttribute (void)
int createVOMSAC (X509 *issuer, STACK_OF(X509)*issuerstack, X509 *holder, EVP_PKEY *pkey, BIGNUM *serialnum, std::vector< std::string > &fqan, std::vector< std::string > &targets, std::vector< std::string > &attrs, AC **ac, std::string voname, std::string uri, int lifetime)
bool createVOMSAC (std::string &codedac, Credential &issuer_cred, Credential &holder_cred, std::vector< std::string > &fqan, std::vector< std::string > &targets, std::vector< std::string > &attributes, std::string &voname, std::string &uri, int lifetime)
 Create AC(Attribute Certificate) with voms specific format.
bool addVOMSAC (ArcCredential::AC **&aclist, std::string &acorder, std::string &decodedac)
 Add decoded AC string into a list of AC objects.
static int cb (int ok, X509_STORE_CTX *ctx)
static bool check_cert (X509 *cert, const std::string &ca_cert_dir, const std::string &ca_cert_file)
static bool check_cert (STACK_OF(X509)*stack, const std::string &ca_cert_dir, const std::string &ca_cert_file)
static bool check_sig_ac (X509 *cert, AC *ac)
static bool regex_match (std::string &label, std::string &value)
static bool check_trust (const VOMSTrustChain &chain, STACK_OF(X509)*certstack)
static bool check_trust (const RegularExpression &reg, STACK_OF(X509)*certstack)
static bool check_signature (AC *ac, std::string &voname, std::string &hostname, const std::string &ca_cert_dir, const std::string &ca_cert_file, const VOMSTrustList &vomscert_trust_dn, X509 **issuer_cert, bool verify)
static bool checkAttributes (STACK_OF(AC_ATTR)*atts, std::vector< std::string > &attributes)
static int getdomainname (char *name, int length)
static std::string getfqdn (void)
static bool interpret_attributes (AC_FULL_ATTRIBUTES *full_attr, std::vector< std::string > &attributes)
static bool checkExtensions (STACK_OF(X509_EXTENSION)*exts, X509 *iss, std::vector< std::string > &output)
static time_t ASN1_GENERALIZEDTIME_get (const ASN1_GENERALIZEDTIME *const s)
static bool check_acinfo (X509 *cert, X509 *issuer, AC *ac, std::vector< std::string > &output, Period &period_left)
static bool verifyVOMSAC (AC *ac, const std::string &ca_cert_dir, const std::string &ca_cert_file, const VOMSTrustList &vomscert_trust_dn, X509 *holder, std::vector< std::string > &attr_output, std::string &vo_name, Period &period_left, bool verify)
bool parseVOMSAC (X509 *holder, const std::string &ca_cert_dir, const std::string &ca_cert_file, const VOMSTrustList &vomscert_trust_dn, std::vector< std::string > &output, bool verify=true)
 Parse the certificate, and output the attributes.
bool parseVOMSAC (Credential &holder_cred, const std::string &ca_cert_dir, const std::string &ca_cert_file, const VOMSTrustList &vomscert_trust_dn, std::vector< std::string > &output, bool verify=true)
 Parse the certificate.
static char * base64Decode (const char *data, int size, int *j)
static char * MyDecode (const char *data, int size, int *n)
char * VOMSDecode (const char *data, int size, int *j)
 Decode the data which is encoded by voms server.
const std::string get_property (Arc::Credential &u, const std::string property)
 Extract the needed field from the certificate.
static Loggerlogger (void)
void HandleOpenSSLError (void)
 Prints chain of accumulaed OpenSSL errors if any available.
void HandleOpenSSLError (int code)
 Prints chain of accumulaed OpenSSL errors if any available.
static void ssl_locking_cb (int mode, int n, const char *s_, int n_)
static unsigned long ssl_id_cb (void)
bool OpenSSLInit (void)
 This module contains various convenience utilities for using OpenSSL.
void transfer_func (void *arg)
std::ostream & operator<< (std::ostream &o, const DataStatus &d)
static int rand_serial (ASN1_INTEGER *ai)
static bool x509_to_string (X509 *cert, std::string &str)
static bool x509_to_string (RSA *key, std::string &str)
static int passphrase_callback (char *buf, int size, int rwflag, void *)
 callback method for inputing passphrase of key file
static bool string_to_x509 (const std::string &str, X509 *&cert, EVP_PKEY *&pkey, STACK_OF(X509)*&cert_sk)
static bool string_to_x509 (const std::string &cert_file, const std::string &key_file, std::istream *inpwd, X509 *&cert, EVP_PKEY *&pkey, STACK_OF(X509)*&cert_sk)
static bool string_to_x509 (const std::string &str, X509 *&cert, STACK_OF(X509)*&cert_sk)
static bool X509_add_ext_by_nid (X509 *cert, int nid, char *value, int pos)
static int progress_cb (int p, int, BN_GENCB *)
std::ostream & operator<< (std::ostream &o, const GlobusResult &res)
std::ostream & operator<< (std::ostream &o, globus_object_t *err)
std::string globus_object_to_string (globus_object_t *err)
bool GlobusRecoverProxyOpenSSL (void)
static Logger logger (Logger::getRootLogger(),"GSSCredential")
static Logger logger (Logger::getRootLogger(),"InfoCache")
static RegularExpression id_regex ("@id=\"([a-zA-Z0-9_\\\\-]*)\"")
static void merge_xml (std::string &path_base, XMLNode &node)
static bool create_directory (const std::string dir)
static void clean_path (std::string s)
static bool set_path (const std::string &path_base, const std::list< std::string > &tokens, const XMLNode &node)
static bool unset_path (const std::string &path_base, const std::list< std::string > &tokens)
static bool get_path (const std::string &path_base, const std::list< std::string > &tokens, XMLNode &node)
static void RemovePolicies (std::list< std::pair< XMLNode, std::list< InfoPolicy >::iterator > > &policies, XMLNode node)
static void RemoveEmbeddedPolicies (XMLNode node)
static bool FilterNode (MessageAuth &id, XMLNode node, std::list< std::pair< XMLNode, std::list< InfoPolicy >::iterator > > &policies, std::list< InfoPolicy > &epolicies, std::map< std::string, InfoPolicy > &ipolicies)
static Logger logger_ (Logger::rootLogger,"InfoSys")
static void reg_thread (void *data)
static bool name_is_plugin (std::string &name)
static std::string strip_newline (const std::string &str)
static PluginDescriptorfind_constructor (PluginDescriptor *desc, const std::string &kind, int min_version, int max_version)
static PluginDescriptorfind_constructor (PluginDescriptor *desc, const std::string &kind, const std::string &name, int min_version, int max_version)
static void replace_file_suffix (std::string &path, const std::string &suffix)
static ARCModuleDescriptorprobe_descriptor (std::string name, ModuleManager &manager)
static Glib::Module * probe_module (std::string name, ModuleManager &manager)
static Glib::Module * reload_module (Glib::Module *module, ModuleManager &manager)
static void unload_module (Glib::Module *module, ModuleManager &manager)
template<class P >
P * PluginCast (PluginArgument *p)
template<class P >
P * PluginCast (Plugin *p)
std::string string (StatusKind kind)
 Conversion to string.
std::ostream & operator<< (std::ostream &o, const mcc_connector_t &mcc)
static XMLNode FindElementByID (XMLNode node, const std::string &id, const std::string &name)
static ArcSec::SecHandlerMakeSecHandler (Config &cfg, ChainContext *ctx, MCCLoader::sechandler_container_t &sechandlers, PluginsFactory *factory, XMLNode &node)
void copy_xml_elements (XMLNode item, XMLNode elements)
static bool BufferAtPos (const std::vector< PayloadRawBuf > &buf_, PayloadRawInterface::Size_t pos, unsigned int &bufnum, PayloadRawInterface::Size_t &bufpos)
static bool BufferAtPos (std::vector< PayloadRawBuf > &buf_, PayloadRawInterface::Size_t pos, std::vector< PayloadRawBuf >::iterator &bufref, PayloadRawInterface::Size_t &bufpos)
const char * ContentFromPayload (const MessagePayload &payload)
 Returns pointer to main memory chunk of Message payload.
static const char * FaultCodeMatch (const char *base, const char *code)
static void freeClassLoader ()
static std::string strip_spaces (const std::string &s)
static void remove_empty_nodes (XMLNode &parent, const char *name)
static XMLNode get_node (XMLNode &parent, const char *name)
 Generate a new child XMLNode with specified name.
void WSAFaultAssign (SOAPEnvelope &mesage, WSAFault fid)
 Makes WS-Addressing fault.
WSAFault WSAFaultExtract (SOAPEnvelope &message)
 Gets WS-addressing fault.
static bool get_password (std::string &password, bool verify)
static bool get_username (std::string &user)
static std::string get_password_from_file (std::istream &f, const std::string &username)
static std::string get_nonce ()
static std::string get_salt (bool mac)
static std::string digest_password (const std::string &nonce, const std::string &created, const std::string &passwd)
static std::string generate_derivedkey (const std::string &password, const std::string &salt, int iteration)
WSRFCreateWSRPFault (SOAPEnvelope &soap)
WSRFCreateWSRP (SOAPEnvelope &soap)
WSRFCreateWSRFBaseFault (SOAPEnvelope &soap)
std::string SignQuery (std::string query, SignatureMethod sign_method, std::string &privkey_file)
bool VerifyQuery (const std::string query, const std::string &sender_cert_str)
std::string BuildDeflatedQuery (const XMLNode &node)
std::string Base64Encode (const std::string &data)
std::string Base64Decode (const std::string &data)
std::string URIEscape (const std::string &data)
std::string URIUnEscape (const std::string &data)
std::string DeflateData (const std::string &data)
std::string InflateData (const std::string &data)
static bool is_base64 (const char *message)
bool BuildNodefromMsg (const std::string msg, XMLNode &node)
bool init_xmlsec (void)
 Initialize the xml security library, it should be called before the xml security functionality is used.
bool final_xmlsec (void)
 Finalize the xml security library.
std::string get_cert_str (const char *certfile)
 Get certificate in string format from certificate file.
xmlSecKey * get_key_from_keyfile (const char *keyfile)
 Get key in xmlSecKey structure from key file.
xmlSecKey * get_key_from_keystr (const std::string &value)
 Get key in xmlSecKey structure from key in string format.
std::string get_key_from_certfile (const char *certfile)
 Get public key in string format from certificate file.
xmlSecKey * get_key_from_certstr (const std::string &value)
 Get public key in xmlSecKey structure from certificate string (the string under "-----BEGIN CERTIFICATE-----" and "-----END CERTIFICATE-----")
xmlSecKeysMngrPtr load_key_from_keyfile (xmlSecKeysMngrPtr *keys_manager, const char *keyfile)
 Load private or public key from a key file into key manager.
xmlSecKeysMngrPtr load_key_from_certfile (xmlSecKeysMngrPtr *keys_manager, const char *certfile)
 Load public key from a certificate file into key manager.
xmlSecKeysMngrPtr load_key_from_certstr (xmlSecKeysMngrPtr *keys_manager, const std::string &certstr)
 Load public key from a certificate string into key manager.
xmlSecKeysMngrPtr load_trusted_cert_file (xmlSecKeysMngrPtr *keys_manager, const char *cert_file)
 Load trusted certificate from certificate file into key manager.
xmlSecKeysMngrPtr load_trusted_cert_str (xmlSecKeysMngrPtr *keys_manager, const std::string &cert_str)
 Load trusted certificate from cetrtificate string into key manager.
xmlSecKeysMngrPtr load_trusted_certs (xmlSecKeysMngrPtr *keys_manager, const char *cafile, const char *capath)
 Load trusted cetificates from a file or directory into key manager.
static void globus_openldap_lock (ModuleManager &mm)
static Pluginget_mcc_service (PluginArgument *arg)
static Pluginget_mcc_client (PluginArgument *arg)
static MCC_Status make_http_fault (Logger &logger, PayloadStreamInterface &stream, Message &outmsg, int code, const char *desc=NULL)
static MCC_Status make_raw_fault (Message &outmsg, const char *desc=NULL)
static void parse_http_range (PayloadHTTP &http, Message &msg)
static std::string empty_string ("")
static bool ParseHTTPVersion (const std::string &s, int &major, int &minor)
static MCC_Status make_soap_fault (Message &outmsg, const char *=NULL)
static MCC_Status make_soap_fault (Message &outmsg, Message &oldmsg, const char *desc=NULL)
static void fill_arc_string_attribute (XMLNode object, std::string value, const char *id)
static void fill_xacml_string_attribute (XMLNode object, std::string value, const char *id)
static bool get_host_port (struct sockaddr_storage *addr, std::string &host, std::string &port)
static int mcc_write (BIO *h, const char *buf, int num)
static int mcc_read (BIO *h, char *buf, int size)
static int mcc_puts (BIO *h, const char *str)
static long mcc_ctrl (BIO *h, int cmd, long arg1, void *arg2)
static int mcc_new (BIO *h)
static int mcc_free (BIO *data)
BIO_METHOD * BIO_s_MCC (void)
BIO * BIO_new_MCC (MCCInterface *mcc)
BIO * BIO_new_MCC (PayloadStreamInterface *stream)
void BIO_set_MCC (BIO *b, MCCInterface *mcc)
void BIO_set_MCC (BIO *b, PayloadStreamInterface *stream)
static void config_VOMS_add (XMLNode cfg, std::vector< std::string > &vomscert_trust_dn)
static void get_line (std::istream &in, std::string &s)
static void get_word (std::string &s, std::string &word)
static bool get_id (std::string &s, std::string &ca_subject)
static bool get_rights (std::string &s)
static bool get_conditions (std::string s, std::list< std::string > &patterns)
static bool match_all (const std::string &issuer_subject, const std::string &subject, const std::string policy_ca_subject, std::list< std::string > policy_patterns)
static void X509_NAME_to_string (std::string &str, const X509_NAME *name)
bool match_globus_policy (std::istream &in, const X509_NAME *issuer_subject, const X509_NAME *subject)
std::istream * open_globus_policy (const X509_NAME *issuer_subject, const std::string &ca_path)
static unsigned long get_flag_STORE_CTX (X509_STORE_CTX *container)
static void set_flag_STORE_CTX (X509_STORE_CTX *container, unsigned long flags)
static int verify_callback (int ok, X509_STORE_CTX *sctx)
static int no_passphrase_callback (char *, int, int, void *)
std::string sched_status_to_string (SchedJobStatus l)
SchedJobStatus sched_status_from_string (const std::string &s)
ARexJobStatus arex_status_from_string (const std::string &)
PaulJobStatus paul_status_from_string (const std::string &)

Variables

std::map< std::string, long > CacheMappingTable
static bool proxy_initialized = false
static Logger logger (Logger::rootLogger,"Lister") = Logger::getRootLogger()
const Glib::TimeVal ETERNAL
 A time very far in the future.
const Glib::TimeVal HISTORIC
 A time very far in the past.
Glib::Mutex suid_lock
static const int formatindex = std::ios_base::xalloc()
static const char kBlankChars [] = " \t\n\r"
Logger stringLogger
static ThreadPoolpool = NULL
const size_t thread_stacksize = (16 * 1024 * 1024)
 This module provides convenient helpers for Glibmm interface for thread management.
static ThreadInitializer _local_thread_initializer
static SIGPIPEIngore sigpipe_ignore
static Glib::Mutex persistent_libraries_lock
static std::list< std::string > persistent_libraries_list
Logger CredentialLogger (Logger::rootLogger,"Credential")
 Logger to be used by all modules of credentials library.
static bool proxy_init_ = false
static char trans2 [128]
static Glib::Mutex lock
static bool initialized = false
static Glib::Mutex * ssl_locks = NULL
static int ssl_locks_num = 0
static uint32_t T [64]
static const char * status_string [DataStatus::UnknownError+1]
static Logger logger_ (Logger::rootLogger,"InfoSys")
const char * plugins_table_name = PLUGINS_TABLE_SYMB
 Name of symbol refering to table of plugins.
static Config cfg_empty
static const char * WSRPGetResourcePropertyDocumentRequestAction = "http://docs.oasis-open.org/wsrf/rpw-2/GetResourcePropertyDocument/GetResourcePropertyDocumentRequest"
static const char * WSRPGetResourcePropertyDocumentResponseAction = "http://docs.oasis-open.org/wsrf/rpw-2/GetResourcePropertyDocument/GetResourcePropertyDocumentResponse"
static const char * WSRPGetResourcePropertyRequestAction = "http://docs.oasis-open.org/wsrf/rpw-2/GetResourceProperty/GetResourcePropertyRequest"
static const char * WSRPGetResourcePropertyResponseAction = "http://docs.oasis-open.org/wsrf/rpw-2/GetResourceProperty/GetResourcePropertyResponse"
static const char * WSRPGetMultipleResourcePropertiesRequestAction = "http://docs.oasis-open.org/wsrf/rpw-2/GetMultipleResourceProperties/GetMultipleResourcePropertiesRequest"
static const char * WSRPGetMultipleResourcePropertiesResponseAction = "http://docs.oasis-open.org/wsrf/rpw-2/GetMultipleResourceProperties/GetMultipleResourcePropertiesResponse"
static const char * WSRPQueryResourcePropertiesRequestAction = "http://docs.oasis-open.org/wsrf/rpw-2/QueryResourceProperties/QueryResourcePropertiesRequest"
static const char * WSRPQueryResourcePropertiesResponseAction = "http://docs.oasis-open.org/wsrf/rpw-2/QueryResourceProperties/QueryResourcePropertiesResponse"
static const char * WSRPPutResourcePropertyDocumentRequestAction = "http://docs.oasis-open.org/wsrf/rpw-2/PutResourcePropertyDocument/PutResourcePropertyDocumentRequest"
static const char * WSRPPutResourcePropertyDocumentResponseAction = "http://docs.oasis-open.org/wsrf/rpw-2/PutResourcePropertyDocument/PutResourcePropertyDocumentResponse"
static const char * WSRPSetResourcePropertiesRequestAction = "http://docs.oasis-open.org/wsrf/rpw-2/SetResourceProperties/SetResourcePropertiesRequest"
static const char * WSRPSetResourcePropertiesResponseAction = "http://docs.oasis-open.org/wsrf/rpw-2/SetResourceProperties/SetResourcePropertiesResponse"
static const char * WSRPInsertResourcePropertiesRequestAction = "http://docs.oasis-open.org/wsrf/rpw-2/InsertResourceProperties/InsertResourcePropertiesRequest"
static const char * WSRPInsertResourcePropertiesResponseAction = "http://docs.oasis-open.org/wsrf/rpw-2/InsertResourceProperties/InsertResourcePropertiesResponse"
static const char * WSRPUpdateResourcePropertiesRequestAction = "http://docs.oasis-open.org/wsrf/rpw-2/UpdateResourceProperties/UpdateResourcePropertiesRequest"
static const char * WSRPUpdateResourcePropertiesResponseAction = "http://docs.oasis-open.org/wsrf/rpw-2/UpdateResourceProperties/UpdateResourcePropertiesResponse"
static const char * WSRPDeleteResourcePropertiesRequestAction = "http://docs.oasis-open.org/wsrf/rpw-2/DeleteResourceProperties/DeleteResourcePropertiesRequest"
static const char * WSRPDeleteResourcePropertiesResponseAction = "http://docs.oasis-open.org/wsrf/rpw-2/DeleteResourceProperties/DeleteResourcePropertiesResponse"
const char * WSRFBaseFaultAction = "http://docs.oasis-open.org/wsrf/fault"
static Glib::Mutex init_lock_
static bool has_init = false
static BIO_METHOD methods_mcc
const char access_id [] = "access_id_"
const char positive_rights [] = "pos_rights"
const char negative_rights [] = "neg_rights"
const char globus_id [] = "globus"
const char sign_id [] = "CA:sign"
const char conditions_id [] = "cond_"
const char policy_suffix [] = ".signing_policy"
static void * ex_data_id = "ARC_MCC_Payload_TLS"
static JobSelectordefault_selector = new JobSelector()

Detailed Description

ARCJSDLParser The ARCJSDLParser class, derived from the JobDescriptionParser class, is primarily a job description parser for the consolidated job description language (ARCJSDL), derived from JSDL, described in the following document http://svn.nordugrid.org/trac/nordugrid/browser/arc1/trunk/doc/tech_doc/client/job_description.odt.

Some utility methods for using xml security library (http://www.aleksey.com/xmlsec/)

Some implicit idea in the ClassLoader/ModuleManager stuff: share_lib_name (e.g.

Credential class covers the functionality about general processing about certificate/key files, including:

XRSLParser The XRSLParser class, derived from the JobDescriptionParser class, is a job description parser for the Extended Resource Specification Language (XRSL) specified in the NORDUGRID-MANUAL-4 document.

JobDescriptionParser The JobDescriptionParser class is abstract which provide a interface for job description parsers.

JobDescription The JobDescription class is the internal representation of a job description in the ARC-lib.

JDLParser The JDLParser class, derived from the JobDescriptionParser class, is a job description parser for the Job Description Language (JDL) specified in CREAM Job Description Language Attributes Specification for the EGEE middleware (EGEE-JRA1-TEC-592336) and Job Description Language Attributes Specification for the gLite middleware (EGEE-JRA1-TEC-590869-JDL-Attributes-v0-8).

However it is also capable of parsing regular JSDL (GFD 136), the POSIX-JSDL extension (GFD 136) and the JSDL HPC Profile Application Extension (GFD 111 and GFD 114). When parsing ARCJSDL takes precedence over other non-ARCJSDL, so if a non-ARCJSDL element specifies the same attribute as ARCJSDL, the ARCJSDL element will be saved. The output generated by the ARCJSDLParser::UnParse method will follow that of the ARCJSDL document, see reference above.

It is structured into a number of other classes/objects which should strictly follow the description given in the job description document http://svn.nordugrid.org/trac/nordugrid/browser/arc1/trunk/doc/tech_doc/client/job_description.odt.

The class consist of a parsing method JobDescription::Parse which tries to parse the passed source using a number of different parsers. The parser method is complemented by the JobDescription::UnParse method, a method to generate a job description document in one of the supported formats. Additionally the internal representation is contained in public members which makes it directly accessible and modifiable from outside the scope of the class.

A job description parser should inherit this class and overwrite the JobDescriptionParser::Parse and JobDescriptionParser::UnParse methods.

  1. cerficate/key parsing, information extracting (such as subject name, issuer name, lifetime, etc.), chain verifying, extension processing about proxy certinfo, extension processing about other general certificate extension (such as voms attributes, it should be the extension-specific code itself to create, parse and verify the extension, not the Credential class. For voms, it is some code about writing and parsing voms-implementing Attibute Certificate/ RFC3281, the voms-attibute is then be looked as a binary part and embeded into extension of X509 certificate/proxy certificate);
    1. certificate request, extension emeding and certificate signing, for both proxy certificate and EEC (end entity certificate) certificate The Crendential class support PEM, DER PKCS12 credential.

mccsoap) should be global identical plugin_name (e.g. arc_attrfactory_modules) should be global identical desc->name (e.g. attr.factory) should also be global identical


Class Documentation

struct Arc::ThreadArg

Definition at line 22 of file TargetRetrieverARC0.cpp.

Collaboration diagram for Arc::ThreadArg:
Class Members
int detailLevel
TargetGenerator * mom
int targetType
URL url
const UserConfig * usercfg
struct Arc::creamJobInfo

Definition at line 19 of file CREAMClient.h.

Collaboration diagram for Arc::creamJobInfo:
Class Members
string creamURL
string ISB_URI
string jobId
string OSB_URI
struct Arc::ARCInfo_t

Definition at line 35 of file DataPointARC.cpp.

Collaboration diagram for Arc::ARCInfo_t:
Class Members
ClientSOAP * client
DataPointARC * point
struct Arc::HTTPInfo_t

Definition at line 31 of file DataPointHTTP.cpp.

Collaboration diagram for Arc::HTTPInfo_t:
Class Members
ClientHTTP * client
DataPointHTTP * point
struct Arc::HTTPClientInfo

Definition at line 87 of file ClientInterface.h.

Collaboration diagram for Arc::HTTPClientInfo:
Class Members
int code
list< string > cookies
Time lastModified
string location
string reason
uint64_t size
string type
class Arc::ExecutableType

Definition at line 87 of file JobDescription.h.

Collaboration diagram for Arc::ExecutableType:
Class Members
list< string > Argument
string Name
class Arc::NotificationType

Definition at line 93 of file JobDescription.h.

Collaboration diagram for Arc::NotificationType:
Class Members
string Email
list< string > States
class Arc::ResourceTargetType

Definition at line 147 of file JobDescription.h.

Collaboration diagram for Arc::ResourceTargetType:
Class Members
URL EndPointURL
string QueueName
class Arc::DataStagingType

Definition at line 235 of file JobDescription.h.

Collaboration diagram for Arc::DataStagingType:
Class Members
list< DirectoryType > Directory
list< FileType > File
struct Arc::PipeThreadArg

Definition at line 19 of file Run_win32.cpp.

Class Members
HANDLE child
HANDLE parent
struct Arc::pw_cb_data

Definition at line 72 of file Credential.cpp.

Class Members
const void * password
const char * prompt_info
struct Arc::transfer_struct

Definition at line 84 of file DataMover.cpp.

Collaboration diagram for Arc::transfer_struct:
Class Members
void * arg
FileCache * cache
callback cb
DataPoint * destination
DataMover * it
const URLMap * map
time_t max_inactivity_time
unsigned long long int min_average_speed
unsigned long long int min_speed
time_t min_speed_time
const char * prefix
DataPoint * source
struct Arc::CacheParameters

Contains data on the parameters of a cache.

Definition at line 22 of file FileCache.h.

Collaboration diagram for Arc::CacheParameters:
Class Members
string cache_link_path
string cache_path
struct Arc::Registrar_data

Definition at line 23 of file BootstrapISIS.cpp.

Collaboration diagram for Arc::Registrar_data:
Class Members
ISIS_description isis
InfoRegistrar * registrar
struct Arc::Register_Info_Type

Definition at line 66 of file InfoRegister.h.

Collaboration diagram for Arc::Register_Info_Type:
Class Members
string endpoint
string expiration
Time next_registration
InfoRegister * p_register
Period period
string serviceid
string serviceid_
struct Arc::ISIS_description

Definition at line 80 of file InfoRegister.h.

Collaboration diagram for Arc::ISIS_description:
Class Members
string cadir
string cafile
string cert
string key
string proxy
string url
struct Arc::PluginDescriptor

Description of ARC lodable component.

Definition at line 81 of file Plugin.h.

Collaboration diagram for Arc::PluginDescriptor:
Class Members
get_plugin_instance instance
const char * kind
const char * name
uint32_t version
class Arc::PluginDesc

Description of plugin.

This class is used for reports

Definition at line 91 of file Plugin.h.

Collaboration diagram for Arc::PluginDesc:
Class Members
string kind
string name
uint32_t version
class Arc::ModuleDesc

Description of loadable module.

This class is used for reports

Definition at line 100 of file Plugin.h.

Collaboration diagram for Arc::ModuleDesc:
Class Members
string name
list< PluginDesc > plugins
struct Arc::PayloadRawBuf

Definition at line 51 of file PayloadRaw.h.

Class Members
bool allocated size of used memory - size of buffer
char * data
int length size of allocated memory
int size pointer to buffer in memory

Typedef Documentation

typedef AttrMap::const_iterator Arc::AttrConstIter

A typedef of a const_iterator for AttrMap.

This typedef is used as a shorthand for a const_iterator for AttrMap. It is used extensively within the MessageAttributes class as well as the AttributesIterator class, but is not visible externally.

Definition at line 26 of file MessageAttributes.h.

typedef AttrMap::iterator Arc::AttrIter

A typedef of an (non-const) iterator for AttrMap.

This typedef is used as a shorthand for a (non-const) iterator for AttrMap. It is used in one method within the MessageAttributes class, but is not visible externally.

Definition at line 34 of file MessageAttributes.h.

typedef std::multimap<std::string,std::string> Arc::AttrMap

A typefed of a multimap for storage of message attributes.

This typedef is used as a shorthand for a multimap that uses strings for keys as well as values. It is used within the MesssageAttributes class for internal storage of message attributes, but is not visible externally.

Definition at line 17 of file MessageAttributes.h.

Definition at line 46 of file arex_client.h.

typedef std::map<std::string,std::string> Arc::DelegationRestrictions

Definition at line 15 of file DelegationInterface.h.

Constructor function of ARC lodable component.

This function is called with plugin-specific argument and should produce and return valid instance of plugin. If plugin can't be produced by any reason (for example because passed argument is not applicable) then NULL is returned. No exceptions should be raised.

Definition at line 78 of file Plugin.h.

typedef std::list< std::pair<std::string,XMLNode> > Arc::InfoFilterPolicies

Definition at line 35 of file InfoFilter.h.

typedef JobState::StateType(* Arc::JobStateMap)(const std::string &)

Definition at line 76 of file JobState.h.

Definition at line 18 of file ClassLoader.h.

typedef std::map<std::string, LoadableModuleDesciption> Arc::plugin_cache_t

Definition at line 39 of file ModuleManager.h.

typedef std::vector<std::vector<std::string> > Arc::QueryArrayResult

Definition at line 49 of file DBInterface.h.

typedef std::vector<std::string> Arc::QueryRowResult

Definition at line 50 of file DBInterface.h.

typedef bool(* Arc::rls_lrc_callback_t)(globus_rls_handle_t *h, const URL &url, void *arg)

Definition at line 17 of file RLS.h.

typedef std::map<std::string, std::list<URL> > Arc::URLListMap

Definition at line 17 of file UserConfig.h.

typedef std::vector<std::string> Arc::VOMSTrustChain

Definition at line 13 of file VOMSUtil.h.

typedef std::string Arc::VOMSTrustRegex

Definition at line 15 of file VOMSUtil.h.

typedef std::list<XMLNode> Arc::XMLNodeList

Definition at line 42 of file XMLNode.h.


Enumeration Type Documentation

Enumerator:
JOB_STATUS_AREX_ACCEPTING 
JOB_STATUS_AREX_ACCEPTED 
JOB_STATUS_AREX_PREPARING 
JOB_STATUS_AREX_PREPARED 
JOB_STATUS_AREX_SUBMITTING 
JOB_STATUS_AREX_EXECUTING 
JOB_STATUS_AREX_KILLING 
JOB_STATUS_AREX_EXECUTED 
JOB_STATUS_AREX_FINISHING 
JOB_STATUS_AREX_FAILED 
JOB_STATUS_AREX_HELD 
JOB_STATUS_AREX_UNKNOWN 

Definition at line 23 of file job_status.h.

Enumerator:
SINGLE 
COLLECTIONELEMENT 
PARALLELELEMENT 
WORKFLOWNODE 

Definition at line 68 of file JobDescription.h.

Enumerator:
CRED_PEM 
CRED_DER 
CRED_PKCS 
CRED_UNKNOWN 

Definition at line 49 of file Credential.h.

Enumerator:
DELEG_ARC 
DELEG_GRIDSITE 
DELEG_GT4 
DELEG_MYPROXY 
DELEG_UNKNOWN 

Definition at line 41 of file ClientX509Delegation.h.

Enumerator:
HTTP_OK 
HTTP_NOT_IMPLEMENTED 
HTTP_NOT_ALLOWED 
HTTP_NOT_FOUND 
HTTP_ERROR 
HTTP_FAILURE 

Definition at line 21 of file HTTPSClient.h.

Enumerator:
LongFormat 
ShortFormat 

Definition at line 38 of file Logger.h.

Logging levels.

Logging levels for tagging and filtering log messages. FATAL level designates very severe error events that will presumably lead the application to abort. ERROR level designates error events that might still allow the application to continue running. WARNING level designates potentially harmful situations. INFO level designates informational messages that highlight the progress of the application at coarse-grained level. VERBOSE level designates fine-grained informational events that will give additional information about the application. DEBUG level designates finer-grained informational events which should only be used for debugging purposes.

Enumerator:
DEBUG 
VERBOSE 
INFO 
WARNING 
ERROR 
FATAL 

Definition at line 29 of file Logger.h.

                {
    DEBUG = 1,
    VERBOSE = 2,
    INFO = 4,
    WARNING = 8,
    ERROR = 16,
    FATAL = 32
  };
Enumerator:
NAT_NONE 
NAT_INBOUND 
NAT_OUTBOUND 
NAT_INOUTBOUND 

Definition at line 159 of file JobDescription.h.

Enumerator:
JOB_STATUS_PAUL_NEW 
JOB_STATUS_PAUL_STARTING 
JOB_STATUS_PAUL_STAGEIN 
JOB_STATUS_PAUL_RUNNING 
JOB_STATUS_PAUL_STAGEOUT 
JOB_STATUS_PAUL_FAILDE 
JOB_STATUS_PAUL_KILLING 
JOB_STATUS_PAUL_KILLED 
JOB_STATUS_PAUL_FINISHED 
JOB_STATUS_PAUL_UNKNOWN 

Definition at line 39 of file job_status.h.

Enumerator:
PeriodMiliseconds 
PeriodSeconds 
PeriodMinutes 
PeriodHours 
PeriodDays 
PeriodWeeks 

Definition at line 24 of file DateTime.h.

Enumerator:
RSLBoolError 
RSLMulti 
RSLAnd 
RSLOr 

Definition at line 15 of file RSLParser.h.

Enumerator:
RSLRelError 
RSLEqual 
RSLNotEqual 
RSLLess 
RSLGreater 
RSLLessOrEqual 
RSLGreaterOrEqual 

Definition at line 22 of file RSLParser.h.

Enumerator:
JOB_STATUS_SCHED_NEW 
JOB_STATUS_SCHED_RESCHEDULED 
JOB_STATUS_SCHED_STARTING 
JOB_STATUS_SCHED_RUNNING 
JOB_STATUS_SCHED_CANCELLED 
JOB_STATUS_SCHED_FAILED 
JOB_STATUS_SCHED_FINISHED 
JOB_STATUS_SCHED_KILLED 
JOB_STATUS_SCHED_KILLING 
JOB_STATUS_SCHED_UNKNOWN 

Definition at line 10 of file job_status.h.

Enumerator:
NoSec 
TLSSec 
GSISec 
SSL3Sec 

Definition at line 56 of file ClientInterface.h.

Enumerator:
COMPUTING 
INDEX 

Definition at line 22 of file UserConfig.h.

Enumerator:
SDAM_NONE 
SDAM_RO 
SDAM_RW 

Definition at line 153 of file JobDescription.h.

                                  {
    SDAM_NONE = 0,
    SDAM_RO = 1,
    SDAM_RW = 2
  };
Enumerator:
RSA_SHA1 
DSA_SHA1 

Definition at line 20 of file saml_util.h.

Status kinds (types)

This enum defines a set of possible status kinds.

Enumerator:
STATUS_UNDEFINED 
STATUS_OK 

Default status - undefined error.

GENERIC_ERROR 

No error.

PARSING_ERROR 

Error does not fit any class.

PROTOCOL_RECOGNIZED_ERROR 

Error detected while parsing request/response.

UNKNOWN_SERVICE_ERROR 

Message does not fit into expected protocol.

BUSY_ERROR 

There is no destination configured for this message.

SESSION_CLOSE 

Message can't be processed now.

Definition at line 13 of file MCC_Status.h.

An enumeration that contains the possible textual timeformats.

Enumerator:
MDSTime 
ASCTime 
UserTime 
ISOTime 
UTCTime 
RFC1123Time 

Definition at line 15 of file DateTime.h.

                  {
    MDSTime,       // YYYYMMDDHHMMSSZ
    ASCTime,       // Day Mon DD HH:MM:SS YYYY
    UserTime,      // YYYY-MM-DD HH:MM:SS
    ISOTime,       // YYYY-MM-DDTHH:MM:SS+HH:MM
    UTCTime,       // YYYY-MM-DDTHH:MM:SSZ
    RFC1123Time    // Day, DD Mon YYYY HH:MM:SS GMT
  };

WS-Addressing possible faults.

Enumerator:
WSAFaultNone 
WSAFaultUnknown 

This is not a fault.

WSAFaultInvalidAddressingHeader 

This is not a WS-Addressing fault.

WSAFaultInvalidAddress 
WSAFaultInvalidEPR 
WSAFaultInvalidCardinality 
WSAFaultMissingAddressInEPR 
WSAFaultDuplicateMessageID 
WSAFaultActionMismatch 
WSAFaultOnlyAnonymousAddressSupported 
WSAFaultOnlyNonAnonymousAddressSupported 
WSAFaultMessageAddressingHeaderRequired 
WSAFaultDestinationUnreachable 
WSAFaultActionNotSupported 
WSAFaultEndpointUnavailable 

Definition at line 111 of file WSA.h.


Function Documentation

static void Arc::_print ( XMLNode &  node,
int  skip 
) [static]

Definition at line 28 of file ArcConfig.cpp.

                                              {
    int n;
    for (n = 0; n < skip; n++)
      std::cout << " ";
    std::string content = (std::string)node;
    std::cout << "* " << node.Name() << "(" << node.Size() << ")"
              << " = " << content << std::endl;
    for (n = 0;; n++) {
      XMLNode _node = node.Child(n);
      if (!_node)
        break;
      _print(_node, skip + 2);
    }
  }

Here is the call graph for this function:

Here is the caller graph for this function:

static bool Arc::add_last_dir ( std::string &  dir,
const std::string &  path 
) [static]

Definition at line 207 of file DataPointGridFTP.cpp.

                                                                  {
    int l = dir.length();
    std::string::size_type n = path.find('/', l + 1);
    if (n == std::string::npos)
      return false;
    dir = path;
    dir.resize(n);
    return true;
  }

Here is the caller graph for this function:

static bool Arc::AddNotification ( std::list< NotificationType > &  notifications,
const std::string &  states,
const std::string &  email 
) [static]

Definition at line 206 of file XRSLParser.cpp.

                                                          {
    for(std::list<NotificationType>::iterator it =
                 notifications.begin(); it != notifications.end(); it++) {
      if(it->Email == email) {
        return AddNotificationState(*it,states);
      }
    }
    NotificationType notification;
    notification.Email = email;
    if(!AddNotificationState(notification,states)) return false;
    notifications.push_back(notification);
    return true;
  }

Here is the call graph for this function:

Here is the caller graph for this function:

static bool Arc::AddNotificationState ( NotificationType &  notification,
const std::string &  states 
) [static]

Definition at line 188 of file XRSLParser.cpp.

                                  {
    for (int n = 0; n<states.length(); n++) {
      std::string state = ShortcutToState(states[n]);
      if(state.empty()) return false;
      for (std::list<std::string>::iterator s = notification.States.begin();
                     s != notification.States.end(); s++) {
        if(*s == state) {
          state.resize(0);
          break;
        }
      }
      if(!state.empty()) notification.States.push_back(state);
    }
    return true;
  }

Here is the call graph for this function:

Here is the caller graph for this function:

bool Arc::addVOMSAC ( ArcCredential::AC **&  aclist,
std::string &  acorder,
std::string &  decodedac 
)

Add decoded AC string into a list of AC objects.

Parameters:
aclistThe list of AC objects (output)
acorderThe order of AC objects (output)
decodedacThe AC string that is decoded from the string returned from voms server (input)

Definition at line 566 of file VOMSUtil.cpp.

                                                                       {
    AC* received_ac;
    AC** actmplist = NULL;
    char *p, *pp;
    BIGNUM* dataorder = NULL;

    InitVOMSAttribute();

    int l = codedac.size();

    pp = (char *)malloc(codedac.size());
    if(!pp) {
      CredentialLogger.msg(ERROR,"VOMS: Can not allocate memory for parsing AC");
      return false; 
    }

    pp = (char *)memcpy(pp, codedac.data(), codedac.size());
    p = pp;

    dataorder = BN_new();
    if (!dataorder) {
      free(pp);
      CredentialLogger.msg(ERROR,"VOMS: Can not allocate memory for storing the order of AC");
      return false;
    }
    BN_one(dataorder);

    //Parse the AC, and insert it into an AC list
    if((received_ac = d2i_AC(NULL, (SSLCONST unsigned char**)&p, l))) {
      actmplist = (AC **)listadd((char **)aclist, (char *)received_ac, sizeof(AC *));
      if (actmplist) {
        aclist = actmplist; 
        (void)BN_lshift1(dataorder, dataorder);
        (void)BN_set_bit(dataorder, 0);
        char *buffer = BN_bn2hex(dataorder);
        acorder = std::string(buffer);
        OPENSSL_free(buffer);
        free(pp); BN_free(dataorder); return true;
      }
      else {
        listfree((char **)aclist, (freefn)AC_free);  free(pp); BN_free(dataorder); return false;
      }
    }
    else {
      CredentialLogger.msg(ERROR,"VOMS: Can not parse AC");
      free(pp); BN_free(dataorder); return false;
    }
  }

Here is the call graph for this function:

Here is the caller graph for this function:

const std::string Arc::alphanum ( "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"  )
ARexJobStatus Arc::arex_status_from_string ( const std::string &  )

Definition at line 60 of file job_status.cpp.

static time_t Arc::ASN1_GENERALIZEDTIME_get ( const ASN1_GENERALIZEDTIME *const  s) [static]

Definition at line 1286 of file VOMSUtil.cpp.

                                                                              {
    struct tm tm;
    int offset;
    memset(&tm,'\0',sizeof tm);

#define g1(n) ((n)-'0')
#define g2(p) (g1((p)[0])*10+g1((p)[1]))
#define g4(p) g1((p)[0])*1000+g1((p)[1])*100+g2(p+2)

    tm.tm_year=g4(s->data)-1900;
    tm.tm_mon=g2(s->data+4)-1;
    tm.tm_mday=g2(s->data+6);
    tm.tm_hour=g2(s->data+8);
    tm.tm_min=g2(s->data+10);
    tm.tm_sec=g2(s->data+12);
    if(s->data[14] == 'Z')
      offset=0;
    else {
      offset=g2(s->data+15)*60+g2(s->data+17);
      if(s->data[14] == '-')
        offset= -offset;
    }
#undef g1
#undef g2
#undef g4

    return timegm(&tm)-offset*60;
  }

Here is the call graph for this function:

Here is the caller graph for this function:

Time Arc::asn1_to_utctime ( const ASN1_UTCTIME *  s)

Definition at line 176 of file Credential.cpp.

                                              {
    if(s == NULL) return Time();
    std::string t_str;
    if(s->type == V_ASN1_UTCTIME) {
      t_str.append("20");
      t_str.append((char*)(s->data));
    }
    else {//V_ASN1_GENERALIZEDTIME
      t_str.append((char*)(s->data));
    }
    return Time(t_str);
  }

Here is the caller graph for this function:

static std::string Arc::AttributeString ( const std::list< std::string >  attributes,
char  separator 
) [static]

Definition at line 85 of file URL.cpp.

                                                     {

    std::string attrstring;

    if (attributes.empty())
      return attrstring;

    for (std::list<std::string>::const_iterator it = attributes.begin();
         it != attributes.end(); it++) {
      if (it != attributes.begin())
        attrstring += separator;
      attrstring += *it;
    }
    return attrstring;
  }

Here is the caller graph for this function:

std::string Arc::Base64Decode ( const std::string &  data)

Definition at line 277 of file saml_util.cpp.

                                                {
    unsigned long len;
    xmlChar *out = NULL;
    len = data.length();
    out = (xmlChar*)(xmlMalloc(len*4));
    len = xmlSecBase64Decode((xmlChar*)(data.c_str()), out, len*4);
    std::string ret;
    if(out != NULL) {
      ret.append((char*)out, len);
      xmlFree(out);
    }
    return ret;
  }
static char* Arc::base64Decode ( const char *  data,
int  size,
int *  j 
) [static]

Definition at line 1599 of file VOMSUtil.cpp.

                                                                {
    BIO *b64 = NULL;
    BIO *in = NULL;

    char *buffer = (char *)malloc(size);
    if (!buffer)
      return NULL;

    memset(buffer, 0, size);

    b64 = BIO_new(BIO_f_base64());
    in = BIO_new_mem_buf((void*)data, size);
    in = BIO_push(b64, in);

    *j = BIO_read(in, buffer, size);

    BIO_free_all(in);
    return buffer;
  }

Here is the caller graph for this function:

std::string Arc::Base64Encode ( const std::string &  data)

Definition at line 264 of file saml_util.cpp.

                                                {
    unsigned long len;
    xmlChar *b64_out = NULL;
    len = data.length();
    b64_out = xmlSecBase64Encode((xmlChar*)(data.c_str()), data.length(), 0);
    std::string ret;
    if(b64_out != NULL) {
      ret.append((char*)b64_out);
      xmlFree(b64_out);
    }
    return ret;
  }

Here is the caller graph for this function:

static const std::string Arc::BES_FACTORY_ACTIONS_BASE_URL ( "http://schemas.ggf.org/bes/2006/08/bes-factory/BESFactoryPortType/"  ) [static]

Here is the caller graph for this function:

static const std::string Arc::BES_MANAGEMENT_ACTIONS_BASE_URL ( "http://schemas.ggf.org/bes/2006/08/bes-management/BESManagementPortType/"  ) [static]
BIO * Arc::BIO_new_MCC ( MCCInterface *  mcc)

Definition at line 54 of file BIOMCC.cpp.

                                    {
  BIO *ret;
  ret=BIO_new(BIO_s_MCC());
  if (ret == NULL) return(NULL);
  BIO_set_MCC(ret,mcc);
  return(ret);
}

Here is the call graph for this function:

Here is the caller graph for this function:

BIO * Arc::BIO_new_MCC ( PayloadStreamInterface *  stream)

Definition at line 62 of file BIOMCC.cpp.

                                                 {
  BIO *ret;
  ret=BIO_new(BIO_s_MCC());
  if (ret == NULL) return(NULL);
  BIO_set_MCC(ret,stream);
  return(ret);
}

Here is the call graph for this function:

BIO_METHOD * Arc::BIO_s_MCC ( void  )

Definition at line 50 of file BIOMCC.cpp.

                            {
  return(&methods_mcc);
}

Here is the caller graph for this function:

void Arc::BIO_set_MCC ( BIO *  b,
MCCInterface *  mcc 
)

Definition at line 70 of file BIOMCC.cpp.

                                           {
  BIOMCC* biomcc = (BIOMCC*)(b->ptr);
  if(biomcc == NULL) {
    biomcc=new BIOMCC(mcc);
    b->ptr=biomcc;
  };
}

Here is the caller graph for this function:

void Arc::BIO_set_MCC ( BIO *  b,
PayloadStreamInterface *  stream 
)

Definition at line 78 of file BIOMCC.cpp.

                                                        {
  BIOMCC* biomcc = (BIOMCC*)(b->ptr);
  if(biomcc == NULL) {
    biomcc=new BIOMCC(stream);
    b->ptr=biomcc;
  };
}
static bool Arc::BufferAtPos ( const std::vector< PayloadRawBuf > &  buf_,
PayloadRawInterface::Size_t  pos,
unsigned int &  bufnum,
PayloadRawInterface::Size_t &  bufpos 
) [static]

Definition at line 18 of file PayloadRaw.cpp.

                                                                                                                                                   {
  if(pos == -1) pos=0;
  if(pos < 0) return false;
  PayloadRawInterface::Size_t cpos = 0;
  for(bufnum = 0;bufnum<buf_.size();++bufnum) {
    cpos+=buf_[bufnum].length;
    if(cpos>pos) {
      bufpos=pos-(cpos-buf_[bufnum].length);
      return true;
    };
  };
  return false;
}

Here is the caller graph for this function:

static bool Arc::BufferAtPos ( std::vector< PayloadRawBuf > &  buf_,
PayloadRawInterface::Size_t  pos,
std::vector< PayloadRawBuf >::iterator &  bufref,
PayloadRawInterface::Size_t &  bufpos 
) [static]

Definition at line 32 of file PayloadRaw.cpp.

                                                                                                                                                                 {
  if(pos == -1) pos=0;
  if(pos < 0) return false;
  PayloadRawInterface::Size_t cpos = 0;
  for(bufref = buf_.begin();bufref!=buf_.end();++bufref) {
    cpos+=bufref->length;
    if(cpos>pos) {
      bufpos=pos-(cpos-bufref->length);
      return true;
    };
  };
  return false;
}
std::string Arc::BuildDeflatedQuery ( const XMLNode &  node)

Definition at line 239 of file saml_util.cpp.

                                                    {
    //deflated, b64'ed and url-escaped
    std::string encoding("utf-8");
    std::string query;
    node.GetXML(query, encoding);

    //std::ostringstream oss (std::ostringstream::out);
    //node.SaveToStream(oss);
    //query = oss.str();
   
    //XMLNode node1(query);
    //std::string query1;
    //node1.GetXML(query1, encoding);  

    //std::cout<<"Query:  "<<query<<std::endl;

    std::string deflated_str = DeflateData(query);

    std::string b64_str = Base64Encode(deflated_str);

    std::string escaped_str = URIEscape(b64_str);

    return escaped_str;
  }

Here is the call graph for this function:

Here is the caller graph for this function:

bool Arc::BuildNodefromMsg ( const std::string  msg,
XMLNode &  node 
)

Definition at line 401 of file saml_util.cpp.

                                                            {
    bool b64 = false;
    char* str = (char*)(msg.c_str());
    if (is_base64(msg.c_str())) {   
      str = (char*)malloc(msg.length());
      int r = xmlSecBase64Decode((xmlChar*)(msg.c_str()), (xmlChar*)str, msg.length());
      if (r >= 0) b64 = true;
      else {
        free(str);
        str = (char*)(msg.c_str());
      }
    }

    if (strchr(str, '<')) {
      XMLNode nd(str);
      if(!nd) { std::cerr<<"Message format unknown"<<std::endl; free(str); return false; }
      if (b64) free(str);
      nd.New(node);
      return true;
    }

    //if (strchr(str, '&') || strchr(str, '='))
    if(b64) free(str);
    return false;
  }  

Here is the call graph for this function:

Here is the caller graph for this function:

static int Arc::cb ( int  ok,
X509_STORE_CTX *  ctx 
) [static]

Definition at line 615 of file VOMSUtil.cpp.

                                             {
    if (!ok) {
      if (ctx->error == X509_V_ERR_CERT_HAS_EXPIRED) ok=1;
      /* since we are just checking the certificates, it is
       * ok if they are self signed. But we should still warn
       * the user.
       */
      if (ctx->error == X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT) ok=1;
      /* Continue after extension errors too */
      if (ctx->error == X509_V_ERR_INVALID_CA) ok=1;
      if (ctx->error == X509_V_ERR_PATH_LENGTH_EXCEEDED) ok=1;
      if (ctx->error == X509_V_ERR_CERT_CHAIN_TOO_LONG) ok=1;
      if (ctx->error == X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT) ok=1;
    }
    return(ok);
  }

Here is the caller graph for this function:

static std::string Arc::char_to_hex ( char  v) [static]

Definition at line 23 of file SubmitterBES.cpp.

                                       {
    std::string s;
    unsigned int n;
    n = (unsigned int)((v & 0xf0) >> 4);
    if(n < 10) { s+=(char)('0'+n); } else { s+=(char)('a'+n-10); }
    n = (unsigned int)(v & 0x0f);
    if(n < 10) { s+=(char)('0'+n); } else { s+=(char)('a'+n-10); }
    return s;
  }

Here is the caller graph for this function:

static bool Arc::check_acinfo ( X509 *  cert,
X509 *  issuer,
AC ac,
std::vector< std::string > &  output,
Period &  period_left 
) [static]

Definition at line 1315 of file VOMSUtil.cpp.

                                                       {
    if(!ac || !cert || !(ac->acinfo) || !(ac->acinfo->version) || !(ac->acinfo->holder) 
       || (ac->acinfo->holder->digest) || !(ac->acinfo->form) || !(ac->acinfo->form->names) 
       || (ac->acinfo->form->is) || (ac->acinfo->form->digest) || !(ac->acinfo->serial) 
       || !(ac->acinfo->validity) || !(ac->acinfo->alg) || !(ac->acinfo->validity) 
       || !(ac->acinfo->validity->notBefore) || !(ac->acinfo->validity->notAfter) 
       || !(ac->acinfo->attrib) || !(ac->sig_alg) || !(ac->signature)) return false;

    //Check the validity time  
    ASN1_GENERALIZEDTIME *start;
    ASN1_GENERALIZEDTIME *end;
    start = ac->acinfo->validity->notBefore;
    end = ac->acinfo->validity->notAfter;

    time_t ctime, dtime;
    time (&ctime);
    ctime += 300;
    dtime = ctime-600;

    if ((start->type != V_ASN1_GENERALIZEDTIME) || (end->type != V_ASN1_GENERALIZEDTIME)) {
      CredentialLogger.msg(ERROR,"VOMS: unsupported time format format in AC - expecting GENERALIZED TIME");
      return false;
    }
    if ((X509_cmp_current_time(start) >= 0) &&
        (X509_cmp_time(start, &ctime) >= 0)) {
      CredentialLogger.msg(ERROR,"VOMS: AC is not yet valid");
      return false;
    }
    if ((X509_cmp_current_time(end) <= 0) &&
        (X509_cmp_time(end, &dtime) <= 0)) {
      CredentialLogger.msg(ERROR,"VOMS: AC has expired");
      return false;
    }
    period_left = Time(ASN1_GENERALIZEDTIME_get(end)) - Time();

    STACK_OF(GENERAL_NAME) *names;
    GENERAL_NAME  *name;

    if (ac->acinfo->holder->baseid) {
      if(!(ac->acinfo->holder->baseid->serial) ||
         !(ac->acinfo->holder->baseid->issuer)) {
        CredentialLogger.msg(ERROR,"VOMS: AC is not complete - missing Serial or Issuer information");
        return false;
      }

      if (ASN1_INTEGER_cmp(ac->acinfo->holder->baseid->serial, cert->cert_info->serialNumber)) {
        CredentialLogger.msg(WARNING,"VOMS: the holder serial number %i is not the same as the serial number in AC %i",
          ASN1_INTEGER_get(cert->cert_info->serialNumber),
          ASN1_INTEGER_get(ac->acinfo->holder->baseid->serial));
        // return false;
      }
       
      names = ac->acinfo->holder->baseid->issuer;
      if ((sk_GENERAL_NAME_num(names) != 1) || !(name = sk_GENERAL_NAME_value(names,0)) ||
        (name->type != GEN_DIRNAME)) {
        CredentialLogger.msg(ERROR,"VOMS: the holder issuer information in AC is wrong");
        return false;
      }
      
      //If the holder is self-signed, and the holder also self sign the AC
      CredentialLogger.msg(DEBUG,"VOMS: DN of holder in AC: %s",X509_NAME_oneline(name->d.dirn,NULL,0));
      CredentialLogger.msg(DEBUG,"VOMS: DN of holder: %s",X509_NAME_oneline(cert->cert_info->subject,NULL,0));
      CredentialLogger.msg(DEBUG,"VOMS: DN of issuer: %s",X509_NAME_oneline(cert->cert_info->issuer,NULL,0));
      if (X509_NAME_cmp(name->d.dirn, cert->cert_info->subject) && 
        X509_NAME_cmp(name->d.dirn, cert->cert_info->issuer)) {
        CredentialLogger.msg(ERROR,"VOMS: the holder itself can not sign an AC by using a self-sign certificate"); 
        return false;
      }

      if ((ac->acinfo->holder->baseid->uid && cert->cert_info->issuerUID) ||
          (!cert->cert_info->issuerUID && !ac->acinfo->holder->baseid->uid)) {
        if (ac->acinfo->holder->baseid->uid) {
          if (M_ASN1_BIT_STRING_cmp(ac->acinfo->holder->baseid->uid, cert->cert_info->issuerUID)) {
            CredentialLogger.msg(ERROR,"VOMS: the holder issuerUID is not the same as that in AC");
            return false;
          }
        }
      }
      else {
        CredentialLogger.msg(ERROR,"VOMS: the holder issuerUID is not the same as that in AC");
        return false;
      }
    }
    else if (ac->acinfo->holder->name) {
      names = ac->acinfo->holder->name;
      if ((sk_GENERAL_NAME_num(names) == 1) ||      //??? 
          ((name = sk_GENERAL_NAME_value(names,0))) ||
          (name->type != GEN_DIRNAME)) {
        if (X509_NAME_cmp(name->d.dirn, cert->cert_info->issuer)) {
          /* CHECK ALT_NAMES */
          /* in VOMS ACs, checking into alt names is assumed to always fail. */
          CredentialLogger.msg(ERROR,"VOMS: the holder issuer name is not the same as that in AC");
          return false;
        }
      }
    }
  
    names = ac->acinfo->form->names;
    if ((sk_GENERAL_NAME_num(names) != 1) || !(name = sk_GENERAL_NAME_value(names,0)) || 
       (name->type != GEN_DIRNAME) || X509_NAME_cmp(name->d.dirn, issuer->cert_info->subject)) {
      CredentialLogger.msg(ERROR,"VOMS: the issuer name %s is not the same as that in AC - %s",
        X509_NAME_oneline(issuer->cert_info->subject,NULL,0),
        X509_NAME_oneline(name->d.dirn,NULL,0));
      return false;
    }

    if (ac->acinfo->serial->length > 20) {
      CredentialLogger.msg(ERROR,"VOMS: the serial number of AC INFO is too long - expecting no more than 20 octets");
      return false;
    }
  
    bool ret = false;
 
    //Check AC's extension
    ret = checkExtensions(ac->acinfo->exts, issuer, output);
    if(!ret)return false;
 
    //Check AC's attribute    
    checkAttributes(ac->acinfo->attrib, output);
    if(!ret)return false;

    return true;
  }

Here is the call graph for this function:

Here is the caller graph for this function:

static bool Arc::check_cert ( X509 *  cert,
const std::string &  ca_cert_dir,
const std::string &  ca_cert_file 
) [static]

Definition at line 632 of file VOMSUtil.cpp.

                                                                                                  {
    X509_STORE *ctx = NULL;
    X509_STORE_CTX *csc = NULL;
    X509_LOOKUP *lookup = NULL;
    int i = 0;

    if(ca_cert_dir.empty() && ca_cert_file.empty()) {
      CredentialLogger.msg(ERROR,"VOMS: CA directory or CA file must be provided");
      return false;
    }

    csc = X509_STORE_CTX_new();
    ctx = X509_STORE_new();
    if (ctx && csc) {
      X509_STORE_set_verify_cb_func(ctx,cb);
//#ifdef SIGPIPE
//      signal(SIGPIPE,SIG_IGN);
//#endif
      CRYPTO_malloc_init();
      if (!(ca_cert_dir.empty()) && (lookup = X509_STORE_add_lookup(ctx,X509_LOOKUP_hash_dir()))) {
        X509_LOOKUP_add_dir(lookup, ca_cert_dir.c_str(), X509_FILETYPE_PEM);
        ERR_clear_error();
        X509_STORE_CTX_init(csc,ctx,cert,NULL);
        i = X509_verify_cert(csc);
      }
      else if (!(ca_cert_file.empty()) && (lookup = X509_STORE_add_lookup(ctx, X509_LOOKUP_file()))) {
        X509_LOOKUP_load_file(lookup, NULL, X509_FILETYPE_PEM);
        ERR_clear_error();
        X509_STORE_CTX_init(csc,ctx,cert,NULL);
        i = X509_verify_cert(csc);
      }
    }
    if (ctx) X509_STORE_free(ctx);
    if (csc) X509_STORE_CTX_free(csc);

    return (i != 0);
  }

Here is the call graph for this function:

Here is the caller graph for this function:

static bool Arc::check_cert ( STACK_OF(X509)*  stack,
const std::string &  ca_cert_dir,
const std::string &  ca_cert_file 
) [static]

Definition at line 670 of file VOMSUtil.cpp.

                                                                                                             {
    X509_STORE *ctx = NULL;
    X509_STORE_CTX *csc = NULL;
    X509_LOOKUP *lookup = NULL;
    int index = 0;

    if(ca_cert_dir.empty() && ca_cert_file.empty()) {
      CredentialLogger.msg(ERROR,"VOMS: CA direcory or CA file must be provided");
      return false;
    }

    csc = X509_STORE_CTX_new();
    ctx = X509_STORE_new();
    if (ctx && csc) {
      X509_STORE_set_verify_cb_func(ctx,cb);
//#ifdef SIGPIPE
//      signal(SIGPIPE,SIG_IGN);
//#endif
      CRYPTO_malloc_init();

      if (!(ca_cert_dir.empty()) && (lookup = X509_STORE_add_lookup(ctx,X509_LOOKUP_hash_dir()))) {
        X509_LOOKUP_add_dir(lookup, ca_cert_dir.c_str(), X509_FILETYPE_PEM);
        //Check the AC issuer certificate's chain
        for (int i = sk_X509_num(stack)-1; i >=0; i--) {
          //Firstly, try to verify the certificate which is issues by CA;
          //Then try to verify the next one; the last one is the certificate
          //(voms server certificate) which issues AC.
          //Normally the voms server certificate is directly issued by a CA,
          //in this case, sk_X509_num(stack) should be 1.
          //On the other hand, if the voms server certificate is issued by a CA
          //which is issued by an parent CA, and so on, then the AC issuer should 
          //put those CA certificates (except the root CA certificate which has 
          //been configured to be trusted on the AC consumer side) together with 
          //the voms server certificate itself in the 'certseq' part of AC.
          //
          //The CA certificates are checked one by one: the certificate which
          //is signed by root CA is checked firstly; the voms server certificate
          //is checked lastly.
          //
          X509_STORE_CTX_init(csc, ctx, sk_X509_value(stack, i), NULL);
          index = X509_verify_cert(csc);
          if(!index) break;
          //If the 'i'th certificate is verified, then add it as trusted certificate,
          //then 'i'th certificate will be used as 'trusted certificate' to check
          //the 'i-1'th certificate
          X509_STORE_add_cert(ctx,sk_X509_value(stack, i));
        }
/*
        for (int i = 1; i < sk_X509_num(stack); i++)
          X509_STORE_add_cert(ctx,sk_X509_value(stack, i)); 
        ERR_clear_error();
        X509_STORE_CTX_init(csc, ctx, sk_X509_value(stack, 0), NULL);
        index = X509_verify_cert(csc);
*/
      }
      else if (!(ca_cert_file.empty()) && (lookup = X509_STORE_add_lookup(ctx, X509_LOOKUP_file()))) {
        X509_LOOKUP_load_file(lookup, NULL, X509_FILETYPE_PEM);
        for (int i = sk_X509_num(stack)-1; i >=0; i--) {
          X509_STORE_CTX_init(csc, ctx, sk_X509_value(stack, i), NULL);
          index = X509_verify_cert(csc);
          if(!index) break;
          X509_STORE_add_cert(ctx,sk_X509_value(stack, i));
        }
/*
        for (int i = 1; i < sk_X509_num(stack); i++)
          X509_STORE_add_cert(ctx,sk_X509_value(stack, i));
        ERR_clear_error();
        X509_STORE_CTX_init(csc, ctx, sk_X509_value(stack, 0), NULL);
        index = X509_verify_cert(csc);
*/
      }
    }
    if (ctx) X509_STORE_free(ctx);
    if (csc) X509_STORE_CTX_free(csc);

    return (index != 0);
  }

Here is the call graph for this function:

static bool Arc::check_sig_ac ( X509 *  cert,
AC ac 
) [static]

Definition at line 748 of file VOMSUtil.cpp.

                                              {
    if (!cert || !ac) return false;

    EVP_PKEY *key = X509_extract_key(cert);
    if (!key) return false;

    int res;
#ifdef HAVE_OPENSSL_OLDRSA
    res = ASN1_verify((int (*)())i2d_AC_INFO, ac->sig_alg, ac->signature,
                        (char *)ac->acinfo, key);
#else
    res = ASN1_verify((int (*)(void*, unsigned char**))i2d_AC_INFO, ac->sig_alg, ac->signature,
                        (char *)ac->acinfo, key);
#endif

    if (!res) CredentialLogger.msg(ERROR,"VOMS: unable to verify AC signature");
  
    EVP_PKEY_free(key);
    return (res == 1);
  }

Here is the call graph for this function:

Here is the caller graph for this function:

static bool Arc::check_signature ( AC ac,
std::string &  voname,
std::string &  hostname,
const std::string &  ca_cert_dir,
const std::string &  ca_cert_file,
const VOMSTrustList &  vomscert_trust_dn,
X509 **  issuer_cert,
bool  verify 
) [static]

Definition at line 839 of file VOMSUtil.cpp.

                                     {
    X509* issuer = NULL;

    int nid = OBJ_txt2nid("certseq");
    STACK_OF(X509_EXTENSION) *exts = ac->acinfo->exts;
    int pos = X509v3_get_ext_by_NID(exts, nid, -1);
    if (pos >= 0) {
      //Check if the DN/CA file is installed for a given VO.
      X509_EXTENSION* ext = sk_X509_EXTENSION_value(exts, pos);
      AC_CERTS* certs = (AC_CERTS *)X509V3_EXT_d2i(ext);
      //The relatively new version of VOMS server is supposed to
      //create AC which includes the certificate stack:
      //the certificate of voms server; the non-CA certificate/s 
      //(if there are) that signs the voms server' certificate.
      STACK_OF(X509)* certstack = certs->stackcert;

      if(verify) {
        bool success = false;

        //Check if the DN of those certificates in the certificate stack
        //corresponds to the trusted DN chain in the configuration 
        if(certstack) {
          for(int n = 0;n < vomscert_trust_dn.SizeChains();++n) {
            const VOMSTrustChain& chain = vomscert_trust_dn.GetChain(n);
            if(check_trust(chain,certstack)) {
              success = true;
              break;
            }
          }
          if(!success) for(int n = 0;n < vomscert_trust_dn.SizeRegexs();++n) {
            const RegularExpression& reg = vomscert_trust_dn.GetRegex(n);
            if(check_trust(reg,certstack)) {
              success = true;
              break;
            }
          }
        }

        if (!success) {
          AC_CERTS_free(certs);
          CredentialLogger.msg(ERROR,"VOMS: unable to match certificate chain against VOMS trusted DNs");
          return false;
        }
      };
                  
      //If the certificate stack does correspond to some of the trusted DN chain, 
      //then check if the AC signature is valid by using the voms server 
      //certificate (voms server certificate is supposed to be the first on
      //in the certificate stack).
#ifdef HAVE_OPENSSL_OLDRSA
      X509 *cert = (X509 *)ASN1_dup((int (*)())i2d_X509, 
        (char * (*)())d2i_X509, (char *)sk_X509_value(certstack, 0));
#else
      X509 *cert = (X509 *)ASN1_dup((int (*)(void*, unsigned char**))i2d_X509, 
        (void*(*)(void**, const unsigned char**, long int))d2i_X509, (char *)sk_X509_value(certstack, 0));
#endif

      //for (int i=0; i <sk_X509_num(certstack); i ++)
      //fprintf(stderr, "+++ stk[%i] = %d  %s\n", i , sk_X509_value(certstack, i),  X509_NAME_oneline(X509_get_subject_name((X509 *)sk_X509_value(certstack, i)), NULL, 0));

      bool found = false;

      if (check_sig_ac(cert, ac))
        found = true;
      else
        CredentialLogger.msg(ERROR,"VOMS: unable to verify AC signature");
   
      if(verify) { 
        //Check if those certificate in the certificate stack are trusted.
        if (found) {
          if (!check_cert(certstack, ca_cert_dir, ca_cert_file)) {
            X509_free(cert);
            cert = NULL;
            CredentialLogger.msg(ERROR,"VOMS: unable to verify certificate chain");
          }
        }
        else
          CredentialLogger.msg(ERROR,"VOMS: cannot find certificate of AC issuer for VO %s",voname);
      }; 
 
      AC_CERTS_free(certs);
     
      if(cert != NULL) issuer = cert;
    }

#if 0 
    //For those old-stype voms configuration, there is no 
    //certificate stack in the AC. So there should be a local
    //directory which includes the voms server certificate.
    //It is deprecated here.
    /*check if able to find the signing certificate 
     among those specific for the vo or else in the vomsdir
     *directory 
     */
    if(issuer == NULL){
      bool found  = false;
      BIO * in = NULL;
      X509 * x = NULL;
      for(int i = 0; (i < 2 && !found); ++i) {
        std::string directory = vomsdir + (i ? "" : "/" + voname);
        CredentialLogger.msg(DEBUG,"VOMS: directory for trusted service certificates: %s",directory);
        Glib::Dir dir(directory); 
        while(true){
          std::string filename = dir.read_name(); 
          if (!filename.empty()) {
            in = BIO_new(BIO_s_file());
            if (in) {
              std::string temp = directory + "/" + filename;
              if (BIO_read_filename(in, temp.c_str()) > 0) {
                x = PEM_read_bio_X509(in, NULL, 0, NULL);
                if (x) {
                  if (check_sig_ac(x, ac)) { found = true; break; }
                  else { X509_free(x); x = NULL; }
                }
              }
              BIO_free(in); in = NULL;
            }
          }
          else break;
        }
      }
      if (in) BIO_free(in);
      if (found) {
        if (!check_cert(x, ca_cert_dir, ca_cert_file)) { X509_free(x); x = NULL; }
      }
      else {
        CredentialLogger.msg(ERROR,"VOMS: Cannot find certificate of AC issuer for VO %s",voname);

      issuer = x;
    }
#endif

    if(issuer == NULL) {
      CredentialLogger.msg(ERROR,"VOMS: unable to verify AC signature");
      return false;
    } 

    *issuer_cert = issuer; return true; 
  }

Here is the call graph for this function:

Here is the caller graph for this function:

static bool Arc::check_trust ( const VOMSTrustChain &  chain,
STACK_OF(X509)*  certstack 
) [static]

Definition at line 780 of file VOMSUtil.cpp.

                                                                                 {
    int n = 0;
    X509 *current = NULL;
    //A trusted chain is like following:
    // /O=Grid/O=NorduGrid/CN=host/arthur.hep.lu.se
    // /O=Grid/O=NorduGrid/CN=NorduGrid Certification Authority
    // ----NEXT CHAIN----
    if(chain.size()-1 > (sk_X509_num(certstack)+1)) return false;
#if 0
    for(;n < sk_X509_num(certstack);++n) {
      if(n >= chain.size()) return true;
      current = sk_X509_value(certstack,n);
      if(!current) return false;
      if(chain[n] != X509_NAME_oneline(X509_get_subject_name(current),NULL,0)) {
        return false;
      }
    }
    if(n < chain.size()) {
      if(!current) return false;
      if(chain[n] != X509_NAME_oneline(X509_get_issuer_name(current),NULL,0)) {
        return false;
      }
    }
#endif

    for(;n < sk_X509_num(certstack);++n) {
      if((n+1) >= chain.size()) return true;
      current = sk_X509_value(certstack,n);
      if(!current) return false;
      if(chain[n] != X509_NAME_oneline(X509_get_subject_name(current),NULL,0)) {
        CredentialLogger.msg(ERROR,"VOMS: the DN does in certificate: %s does not match that in trusted DN list: %s",
          X509_NAME_oneline(X509_get_subject_name(current),NULL,0), chain[n]);
        return false;
      }
      if(chain[n+1] != X509_NAME_oneline(X509_get_issuer_name(current),NULL,0)) {
        CredentialLogger.msg(ERROR,"VOMS: the Issuer identity does in certificate: %s does not match that in trusted DN list: %s",
          X509_NAME_oneline(X509_get_issuer_name(current),NULL,0), chain[n+1]);
        return false;
      }
    }

    return true;
  }

Here is the call graph for this function:

Here is the caller graph for this function:

static bool Arc::check_trust ( const RegularExpression &  reg,
STACK_OF(X509)*  certstack 
) [static]

Definition at line 824 of file VOMSUtil.cpp.

                                                                                  {
    if(sk_X509_num(certstack) <= 0) return false;
    X509 *current = sk_X509_value(certstack,0);
#if 0
    std::string subject(X509_NAME_oneline(X509_get_subject_name(current),NULL,0));
    std::list<std::string> unmatched, matched;
    return reg.match(subject,unmatched,matched);
#endif
    std::string subject(X509_NAME_oneline(X509_get_subject_name(current),NULL,0));
    std::string issuer(X509_NAME_oneline(X509_get_issuer_name(current),NULL,0));
    std::list<std::string> unmatched, matched;
    return (reg.match(subject,unmatched,matched) && reg.match(issuer,unmatched,matched));

  }

Here is the call graph for this function:

static bool Arc::checkAttributes ( STACK_OF(AC_ATTR)*  atts,
std::vector< std::string > &  attributes 
) [static]

Definition at line 985 of file VOMSUtil.cpp.

                                                                                         {
    AC_ATTR *caps;
    STACK_OF(AC_IETFATTRVAL) *values;
    AC_IETFATTR *capattr;
    AC_IETFATTRVAL *capname;
    GENERAL_NAME *data;

    /* find AC_ATTR with IETFATTR type */
    int  nid = OBJ_txt2nid("idatcap");
    int pos = X509at_get_attr_by_NID((STACK_OF(X509_ATTRIBUTE)*)atts, nid, -1);
    if (!(pos >=0)) { 
      CredentialLogger.msg(ERROR,"VOMS: Can not find AC_ATTR with IETFATTR type");
      return false;
    }
    caps = sk_AC_ATTR_value(atts, pos);
  
    /* check there's exactly one IETFATTR attribute */
    if (sk_AC_IETFATTR_num(caps->ietfattr) != 1) {
      CredentialLogger.msg(ERROR,"VOMS: case of multiple IETFATTR attributes not supported");
      return false; 
    }

    /* retrieve the only AC_IETFFATTR */
    capattr = sk_AC_IETFATTR_value(caps->ietfattr, 0);
    values = capattr->values;
  
    /* check it has exactly one policyAuthority */
    if (sk_GENERAL_NAME_num(capattr->names) != 1) {
      CredentialLogger.msg(ERROR,"VOMS: case of multiple policyAuthority not supported");
      return false;
    }

    /* store policyAuthority */
    data = sk_GENERAL_NAME_value(capattr->names, 0);
    if (data->type == GEN_URI) {
      std::string voname("/voname=");
      voname.append((const char*)(data->d.ia5->data), data->d.ia5->length);
      std::string::size_type pos = voname.find("://");
      if(pos != std::string::npos) {
        voname.replace(pos,3,"/hostname=");
      }
      attributes.push_back(voname);
    }
    else {
      CredentialLogger.msg(ERROR,"VOMS: the format of policyAuthority is unsupported - expecting URI");
      return false;
    }

    /* scan the stack of IETFATTRVAL to store attribute */
    for (int i=0; i<sk_AC_IETFATTRVAL_num(values); i++) {
      capname = sk_AC_IETFATTRVAL_value(values, i);

      if (capname->type != V_ASN1_OCTET_STRING) {
        CredentialLogger.msg(ERROR,"VOMS: the format of IETFATTRVAL is not supported - expecting OCTET STRING");
        return false;
      }

      std::string fqan((const char*)(capname->data), capname->length);
      if(fqan[0] == '/') fqan.erase(0,1);
      std::size_t group_pos = fqan.find("/",0);
      std::size_t role_pos = std::string::npos;
      if(group_pos != std::string::npos) {
        role_pos = fqan.find("/Role=",group_pos);
        if(role_pos == group_pos) {
          fqan.insert(group_pos,"/Group=NULL");
        } else {
          fqan.insert(group_pos+1,"Group=");
        }
      }
      fqan.insert(0,"/VO=");

      // if the attribute is like: /VO=knowarc.eu/Group=NULL/Role=NULL/Capability=NULL
      // or /VO=knowarc.eu/Group=NULL/Role=tester/Capability=NULL
      // then remove the element with "=NULL" to be:
      // /VO=knowarc.eu
      // /VO=knowarc.eu/Role=tester

      std::string str = fqan;
      std::size_t pos = str.find("/Role=NULL");
      if(pos != std::string::npos) str.erase(pos, 10);
      pos = str.find("/Group=NULL");
      if(pos != std::string::npos) str.erase(pos, 11);
      pos = str.find("/Capability=NULL");
      if(pos != std::string::npos) str.erase(pos, 16);

      attributes.push_back(str);
    }

    return true;
  }

Here is the call graph for this function:

Here is the caller graph for this function:

static bool Arc::checkExtensions ( STACK_OF(X509_EXTENSION)*  exts,
X509 *  iss,
std::vector< std::string > &  output 
) [static]

Definition at line 1173 of file VOMSUtil.cpp.

                                                                                                       {
    int nid1 = OBJ_txt2nid("idcenoRevAvail");
    int nid2 = OBJ_txt2nid("authorityKeyIdentifier");
    int nid3 = OBJ_txt2nid("idceTargets");
    int nid5 = OBJ_txt2nid("attributes");

    int pos1 = X509v3_get_ext_by_NID(exts, nid1, -1);
    int pos2 = X509v3_get_ext_by_NID(exts, nid2, -1);
    int pos3 = X509v3_get_ext_by_critical(exts, 1, -1);
    int pos4 = X509v3_get_ext_by_NID(exts, nid3, -1);
    int pos5 = X509v3_get_ext_by_NID(exts, nid5, -1);

    /* noRevAvail, Authkeyid MUST be present */
    if ((pos1 < 0) || (pos2 < 0)) {
      CredentialLogger.msg(ERROR,"VOMS: both idcenoRevAvail and authorityKeyIdentifier certificate extensions must be present");
      return false;
    }

    //Check if the target fqan matches idceTargets
    while (pos3 >=0) {
      X509_EXTENSION *ex;
      AC_TARGETS *targets;
      AC_TARGET *name;

      ex = sk_X509_EXTENSION_value(exts, pos3);
      if (pos3 == pos4) {     //The only critical extension allowed is idceTargets,
        std::string fqdn = getfqdn();
        int ok = 0;
        int i;
        ASN1_IA5STRING* fqdns = ASN1_IA5STRING_new();
        if (fqdns) {
          ASN1_STRING_set(fqdns, fqdn.c_str(), fqdn.size());
          targets = (AC_TARGETS *)X509V3_EXT_d2i(ex);
          if (targets)
            for (i = 0; i < sk_AC_TARGET_num(targets->targets); i++) {
              name = sk_AC_TARGET_value(targets->targets, i);
              if (name->name && name->name->type == GEN_URI) {
                ok = !ASN1_STRING_cmp(name->name->d.ia5, fqdns);
                if (ok)
                  break;
              }
            }
          ASN1_STRING_free(fqdns);
        }
        if (!ok) {
          CredentialLogger.msg(WARNING,"VOMS: FQDN of this host %s does not match any target in AC", fqdn);
          // return false;
        }
      }
      else {
        CredentialLogger.msg(ERROR,"VOMS: the only supported critical extension of the AC is idceTargets");
        return false;
      }
      pos3 = X509v3_get_ext_by_critical(exts, 1, pos3);
    }

    //Parse the attributes
    if (pos5 >= 0) {
      X509_EXTENSION *ex = NULL;
      AC_FULL_ATTRIBUTES *full_attr = NULL;
      ex = sk_X509_EXTENSION_value(exts, pos5);
      full_attr = (AC_FULL_ATTRIBUTES *)X509V3_EXT_d2i(ex);
      if (full_attr) {
        if (!interpret_attributes(full_attr, output)) {
          CredentialLogger.msg(ERROR,"VOMS: failed to parse attributes from AC"); 
          AC_FULL_ATTRIBUTES_free(full_attr); return false; 
        }
      }
      AC_FULL_ATTRIBUTES_free(full_attr);
    }

    //Check the authorityKeyIdentifier
    if (pos2 >= 0) {
      X509_EXTENSION *ex;
      bool keyerr = false; 
      AUTHORITY_KEYID *key;
      ex = sk_X509_EXTENSION_value(exts, pos2);
      key = (AUTHORITY_KEYID *)X509V3_EXT_d2i(ex);
      if (key) {
        if (iss) {
          if (key->keyid) {
            unsigned char hashed[20];
            if (!SHA1(iss->cert_info->key->public_key->data,
                      iss->cert_info->key->public_key->length,
                      hashed))
              keyerr = true;
          
            if ((memcmp(key->keyid->data, hashed, 20) != 0) && 
                (key->keyid->length == 20))
              keyerr = true;
          }
          else {
            if (!(key->issuer && key->serial)) keyerr = true;
            if (M_ASN1_INTEGER_cmp((key->serial), (iss->cert_info->serialNumber))) keyerr = true;
            if (key->serial->type != GEN_DIRNAME) keyerr = true;
            if (X509_NAME_cmp(sk_GENERAL_NAME_value((key->issuer), 0)->d.dirn, (iss->cert_info->subject))) keyerr = true;
          }
        }
        AUTHORITY_KEYID_free(key);
      }
      else {
        keyerr = true;
      }

      if(keyerr) {
        CredentialLogger.msg(ERROR,"VOMS: authorityKey is wrong");
        return false;
      }
    }

    return true;
  }

Here is the call graph for this function:

Here is the caller graph for this function:

static globus_io_secure_delegation_mode_t Arc::ChooseDelegationMode ( gss_cred_id_t  cred) [static]

Definition at line 38 of file HTTPSClientConnector.cpp.

                                                                                     {
    globus_io_secure_delegation_mode_t mode = GLOBUS_IO_SECURE_DELEGATION_MODE_NONE;
    gss_cred_id_desc cred_desc;
    if(cred == GSS_C_NO_CREDENTIAL) {
      globus_gsi_cred_handle_init(&cred_desc.cred_handle,NULL);
      if(globus_gsi_cred_read(cred_desc.cred_handle,NULL) == GLOBUS_SUCCESS) {
        cred = &cred_desc;
      };
    }
    if(cred != GSS_C_NO_CREDENTIAL) {
      globus_gsi_cert_utils_cert_type_t cred_type;
      if(globus_gsi_cred_get_cert_type(cred->cred_handle,&cred_type) ==
         GLOBUS_SUCCESS) {
        if(GLOBUS_GSI_CERT_UTILS_IS_LIMITED_PROXY(cred_type)) {
          mode=GLOBUS_IO_SECURE_DELEGATION_MODE_LIMITED_PROXY;
        } else {
          mode=GLOBUS_IO_SECURE_DELEGATION_MODE_FULL_PROXY;
        };
      };
    };
    if(cred == &cred_desc) {
      globus_gsi_cred_handle_destroy(cred_desc.cred_handle);
    };
    return mode;
  }

Here is the caller graph for this function:

static void Arc::clean_path ( std::string  s) [static]

Definition at line 88 of file InfoCache.cpp.

{
    size_t idx;
    do {
        idx = s.find("//", 0);
        if (idx != std::string::npos) {
            s.replace(idx, 2, "/", 0, 1);
        }
    } while (idx != std::string::npos);
}

Here is the caller graph for this function:

static int Arc::close_string ( void *  context) [static]

Definition at line 904 of file XMLNode.cpp.

                                         {
    if(!context) return -1;
    return 0;
  }

Here is the caller graph for this function:

static void Arc::CloseCallback ( void *  arg,
globus_ftp_control_handle_t *  ,
globus_object_t *  error,
globus_ftp_control_response_t *  response 
) [static]

Definition at line 55 of file FTPControl.cpp.

                                                                     {
    FTPControl::CBArg *cb = (FTPControl::CBArg*)arg;
    // TODO: handle error - if ever can happen here
    cb->close = true;
    cb->cond.signal();
    cb->release();
  }

Here is the call graph for this function:

Here is the caller graph for this function:

bool Arc::CompareExecutionTarget ( const ExecutionTarget *  T1,
const ExecutionTarget *  T2 
)

Definition at line 16 of file FastestQueueBroker.cpp.

                                                         {
    //Scale queue to become cluster size independent
    float T1queue = (float)T1->WaitingJobs / T1->TotalSlots;
    float T2queue = (float)T2->WaitingJobs / T2->TotalSlots;
    return T1queue < T2queue;
  }

Here is the caller graph for this function:

static void Arc::config_VOMS_add ( XMLNode  cfg,
std::vector< std::string > &  vomscert_trust_dn 
) [static]

Definition at line 13 of file ConfigTLSMCC.cpp.

                                                                                 {
  XMLNode nd = cfg["VOMSCertTrustDNChain"];
  for(;(bool)nd;++nd) {
    XMLNode cnd = nd["VOMSCertTrustDN"];
    if((bool)cnd) {
      for(;(bool)cnd;++cnd) {
        vomscert_trust_dn.push_back((std::string)cnd);
      }
      vomscert_trust_dn.push_back("----NEXT CHAIN----");
    } else {
      XMLNode rnd = nd["VOMSCertTrustRegex"];
      if(rnd) {
        std::string rgx = (std::string)rnd;
        if(rgx[0] != '^') rgx.insert(0,"^");
        if(rgx[rgx.length()-1] != '$') rgx+="$";
        vomscert_trust_dn.push_back(rgx);
        vomscert_trust_dn.push_back("----NEXT CHAIN----");
      }
    }
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

static XMLNode Arc::ConfigFindComponent ( XMLNode  chain,
const char *  name,
const char *  id 
) [static]

Definition at line 65 of file ClientInterface.cpp.

                                                     {
    XMLNode comp = chain["Component"];
    for (; (bool)comp; ++comp)
      if ((comp.Attribute("name") == name) &&
          (comp.Attribute("id") == id))
        return comp;
  }

Here is the call graph for this function:

Here is the caller graph for this function:

static XMLNode Arc::ConfigMakeComponent ( XMLNode  chain,
const char *  name,
const char *  id,
const char *  next = NULL 
) [static]

Definition at line 53 of file ClientInterface.cpp.

                                                                              {
    XMLNode comp = chain.NewChild("Component");

    // Make sure namespaces and names are correct
    comp.NewAttribute("name") = name;
    comp.NewAttribute("id") = id;
    if (next)
      comp.NewChild("next").NewAttribute("id") = next;
    return comp;
  }

Here is the call graph for this function:

Here is the caller graph for this function:

static void Arc::ConnectCallback ( void *  arg,
globus_ftp_control_handle_t *  ,
globus_object_t *  error,
globus_ftp_control_response_t *  response 
) [static]

Definition at line 96 of file FTPControl.cpp.

                                                                       {
    FTPControl::CBArg *cb = (FTPControl::CBArg*)arg;
    ControlCallback(arg,NULL,error,response);
    cb->release();
  }

Here is the call graph for this function:

Here is the caller graph for this function:

const char * Arc::ContentFromPayload ( const MessagePayload &  payload)

Returns pointer to main memory chunk of Message payload.

If no buffer is present or if payload is not of PayloadRawInterface type NULL is returned.

Definition at line 181 of file PayloadRaw.cpp.

                                                              {
  try {
    const PayloadRawInterface& buffer = dynamic_cast<const PayloadRawInterface&>(payload);
    return ((PayloadRawInterface&)buffer).Content();
  } catch(std::exception& e) { };
  return "";
}

Here is the caller graph for this function:

static void Arc::ControlCallback ( void *  arg,
globus_ftp_control_handle_t *  ,
globus_object_t *  error,
globus_ftp_control_response_t *  response 
) [static]

Definition at line 65 of file FTPControl.cpp.

                                                                       {
    FTPControl::CBArg *cb = (FTPControl::CBArg*)arg;
    if (error != GLOBUS_SUCCESS) {
      cb->response = Arc::globus_object_to_string(error);
      cb->responseok = false;
    }
    if (response && response->response_buffer) {
      int len = response->response_length;
      while (len > 0 && (response->response_buffer[len - 1] == '\r' ||
                         response->response_buffer[len - 1] == '\n' ||
                         response->response_buffer[len - 1] == '\0'))
        len--;
      cb->response.assign((const char*)response->response_buffer, len);
      switch (response->response_class) {
      case GLOBUS_FTP_POSITIVE_PRELIMINARY_REPLY:
      case GLOBUS_FTP_POSITIVE_COMPLETION_REPLY:
      case GLOBUS_FTP_POSITIVE_INTERMEDIATE_REPLY:
        cb->responseok = true;
        break;

      default:
        cb->responseok = false;
        break;
      }
    }
    cb->ctrl = true;
    cb->cond.signal();
  }

Here is the call graph for this function:

Here is the caller graph for this function:

std::string Arc::convert_to_rdn ( const std::string &  dn)

Convert dn to rdn: /O=Grid/OU=Knowarc/CN=abc ---> CN=abc,OU=Knowarc,O=Grid.

Definition at line 139 of file StringConv.cpp.

                                                {
    std::string ret;
    size_t pos1 = std::string::npos;
    size_t pos2;
    do {
      std::string str;
      pos2 = dn.find_last_of("/", pos1);
      if(pos2 != std::string::npos && pos1 == std::string::npos) {
        str = dn.substr(pos2+1);
        ret.append(str);
        pos1 = pos2-1;
      }
      else if (pos2 != std::string::npos && pos1 != std::string::npos) {
        str = dn.substr(pos2+1, pos1-pos2);
        ret.append(str);
        pos1 = pos2-1;
      }
      if(pos2 != (std::string::npos+1)) ret.append(",");
    }while(pos2 != std::string::npos && pos2 != (std::string::npos+1));
    return ret;
  }

Here is the caller graph for this function:

static Software::ComparisonOperator Arc::convertOperator ( const RSLRelOp &  op) [static]

Definition at line 28 of file XRSLParser.cpp.

                                                                        {
    if (op == RSLNotEqual) return &Software::operator!=;
    if (op == RSLLess) return &Software::operator<;
    if (op == RSLGreater) return &Software::operator>;
    if (op == RSLLessOrEqual) return &Software::operator <=;
    if (op == RSLGreaterOrEqual) return &Software::operator>=;
    return &Software::operator==;
  }

Here is the caller graph for this function:

static RSLRelOp Arc::convertOperator ( const Software::ComparisonOperator &  op) [static]

Definition at line 37 of file XRSLParser.cpp.

                                                                        {
    if (op == &Software::operator==) return RSLEqual;
    if (op == &Software::operator<)  return RSLLess;
    if (op == &Software::operator>)  return RSLGreater;
    if (op == &Software::operator<=) return RSLLessOrEqual;
    if (op == &Software::operator>=) return RSLGreaterOrEqual;
    return RSLNotEqual;
  }
void Arc::copy_xml_elements ( XMLNode  item,
XMLNode  elements 
)

Definition at line 51 of file MessageAuth.cpp.

                                                      {
  for(;(bool)elements;++elements) {
    item.NewChild(elements);
  };
}

Here is the call graph for this function:

Here is the caller graph for this function:

static bool Arc::create_directory ( const std::string  dir) [static]

Definition at line 47 of file InfoCache.cpp.

                                                  {
    if (!Glib::file_test(dir, Glib::FILE_TEST_IS_DIR)) {
        // create directory
        if (mkdir(dir.c_str(), 0700) != 0) {
            logger.msg(ERROR,"cannot create directory: %s",dir);
            return false;
        }
    }
    return true;
}

Here is the call graph for this function:

Here is the caller graph for this function:

bool Arc::CreateThreadFunction ( void(*)(void *)  func,
void *  arg 
)

This macro behaves like function which makes thread of class' method.

It accepts class instance and full name of method - like class::method. 'method' should not be static member of the class. Result is true if creation of thread succeeded. Specified instance must be valid during whole lifetime of thread. So probably it is safer to destroy 'instance' in 'method' just before exiting. Helper function to create simple thread. It takes care of all pecularities of Glib::Thread API. As result it runs function 'func' with argument 'arg' in a separate thread. Returns true on success.

Definition at line 179 of file Thread.cpp.

                                                            {
#ifdef USE_THREAD_POOL
    if(!pool) return false;
    ThreadArgument *argument = new ThreadArgument(func, arg);
    pool->PushQueue(argument);
#else
    ThreadArgument *argument = new ThreadArgument(func, arg);
    try {
      UserSwitch usw(0,0);
      Glib::Thread::create(sigc::mem_fun(*argument, &ThreadArgument::thread),
                           thread_stacksize, false, false,
                           Glib::THREAD_PRIORITY_NORMAL);
    } catch (std::exception& e) {
      threadLogger.msg(ERROR, e.what());
      delete argument;
      return false;
    };
#endif
    return true;
  }

Here is the call graph for this function:

Here is the caller graph for this function:

int Arc::createVOMSAC ( X509 *  issuer,
STACK_OF(X509)*  issuerstack,
X509 *  holder,
EVP_PKEY *  pkey,
BIGNUM *  serialnum,
std::vector< std::string > &  fqan,
std::vector< std::string > &  targets,
std::vector< std::string > &  attrs,
AC **  ac,
std::string  voname,
std::string  uri,
int  lifetime 
)

Definition at line 224 of file VOMSUtil.cpp.

                                                                     {
    #define ERROR(e) do { err = (e); goto err; } while (0)
    AC *a = NULL;
    X509_NAME *subname = NULL, *issname = NULL;
    GENERAL_NAME *dirn1 = NULL, *dirn2 = NULL;
    ASN1_INTEGER  *serial = NULL, *holdserial = NULL, *version = NULL;
    ASN1_BIT_STRING *uid = NULL;
    AC_ATTR *capabilities = NULL;
    AC_IETFATTR *capnames = NULL;
    AC_FULL_ATTRIBUTES *ac_full_attrs = NULL;
    ASN1_OBJECT *cobj = NULL, *aobj = NULL;
    X509_ALGOR *alg1, *alg2;
    ASN1_GENERALIZEDTIME *time1 = NULL, *time2 = NULL;
    X509_EXTENSION *norevavail = NULL, *targetsext = NULL, *auth = NULL, *certstack = NULL;
    AC_ATT_HOLDER *ac_att_holder = NULL;
    //char *qual = NULL, *name = NULL, *value = NULL, *tmp1 = NULL, *tmp2 = NULL;
    STACK_OF(X509) *stk = NULL;
    int err = AC_ERR_UNKNOWN;
    time_t curtime;

    InitVOMSAttribute();

    if (!issuer || !holder || !serialnum || fqan.empty() || !ac || !pkey)
      return AC_ERR_PARAMETERS;

    a = *ac;
    subname = X509_NAME_dup(X509_get_issuer_name(holder)); //old or new version?
    issname = X509_NAME_dup(X509_get_subject_name(issuer));

    time(&curtime);
    time1 = ASN1_GENERALIZEDTIME_set(NULL, curtime);
    time2 = ASN1_GENERALIZEDTIME_set(NULL, curtime+lifetime);

    dirn1  = GENERAL_NAME_new();
    dirn2  = GENERAL_NAME_new();
    holdserial      = M_ASN1_INTEGER_dup(holder->cert_info->serialNumber);
    serial          = BN_to_ASN1_INTEGER(serialnum, NULL);
    version         = BN_to_ASN1_INTEGER((BIGNUM *)(BN_value_one()), NULL);
    capabilities    = AC_ATTR_new();
    cobj            = OBJ_txt2obj("idatcap",0);
    aobj            = OBJ_txt2obj("attributes",0);
    capnames        = AC_IETFATTR_new();
    ac_full_attrs   = AC_FULL_ATTRIBUTES_new();
    ac_att_holder   = AC_ATT_HOLDER_new();

    std::string buffer, complete;

    GENERAL_NAME *g = GENERAL_NAME_new();
    ASN1_IA5STRING *tmpr = ASN1_IA5STRING_new();


    if (!subname || !issuer || !dirn1 || !dirn2 || !holdserial || !serial ||
      !capabilities || !cobj || !capnames || !time1 || !time2 || !ac_full_attrs || !ac_att_holder)
      ERROR(AC_ERR_MEMORY);

    for (std::vector<std::string>::iterator i = targets.begin(); i != targets.end(); i++) {
      if (i == targets.begin()) complete = (*i);
      else complete.append(",").append(*i);
    }

    // prepare AC_IETFATTR
    for (std::vector<std::string>::iterator i = fqan.begin(); i != fqan.end(); i++) {
      ASN1_OCTET_STRING *tmpc = ASN1_OCTET_STRING_new();
      if (!tmpc) {
        ASN1_OCTET_STRING_free(tmpc);
        ERROR(AC_ERR_MEMORY);
      }

      CredentialLogger.msg(DEBUG,"VOMS: create FQAN: %s",*i);

#ifdef HAVE_OPENSSL_OLDRSA
      ASN1_OCTET_STRING_set(tmpc, (unsigned char*)((*i).c_str()), (*i).length());
#else
      ASN1_OCTET_STRING_set(tmpc, (const unsigned char*)((*i).c_str()), (*i).length());
#endif

      sk_AC_IETFATTRVAL_push(capnames->values, (AC_IETFATTRVAL *)tmpc);
    }
 
    //GENERAL_NAME *g = GENERAL_NAME_new();
    //ASN1_IA5STRING *tmpr = ASN1_IA5STRING_new();
    buffer.append(voname);
    buffer.append("://");
    buffer.append(uri);
    if (!tmpr || !g) {
      GENERAL_NAME_free(g);
      ASN1_IA5STRING_free(tmpr);
      ERROR(AC_ERR_MEMORY);
    }

    ASN1_STRING_set(tmpr, buffer.c_str(), buffer.size());
    g->type  = GEN_URI;
    g->d.ia5 = tmpr;
    sk_GENERAL_NAME_push(capnames->names, g);
 
    // stuff the created AC_IETFATTR in ietfattr (values) and define its object
    sk_AC_IETFATTR_push(capabilities->ietfattr, capnames);
    capabilities->get_type = GET_TYPE_FQAN;
    ASN1_OBJECT_free(capabilities->type);
    capabilities->type = cobj;

    // prepare AC_FULL_ATTRIBUTES
    for (std::vector<std::string>::iterator i = attrs.begin(); i != attrs.end(); i++) {
      std::string qual, name, value;

      CredentialLogger.msg(DEBUG,"VOMS: create attribute: %s",*i); 
 
      AC_ATTRIBUTE *ac_attr = AC_ATTRIBUTE_new();
      if (!ac_attr) {
        AC_ATTRIBUTE_free(ac_attr);
        ERROR(AC_ERR_MEMORY);
      }

      //Accoding to the definition of voms, the attributes will be like "qualifier::name=value" or "::name=value"
      size_t pos =(*i).find_first_of("::");
      if (pos != std::string::npos) {
        qual = (*i).substr(0, pos);
        pos += 2;
      }
      else { pos = 2; } 

      size_t pos1 = (*i).find_first_of("=");
      if (pos1 == std::string::npos) {
        ERROR(AC_ERR_PARAMETERS);
      }
      else {
        name = (*i).substr(pos, pos1 - pos);
        value = (*i).substr(pos1 + 1);
      }

#ifdef HAVE_OPENSSL_OLDRSA
      if (!qual.empty())
        ASN1_OCTET_STRING_set(ac_attr->qualifier, (unsigned char*)(qual.c_str()), qual.length());
      else
        ASN1_OCTET_STRING_set(ac_attr->qualifier, (unsigned char*)(voname.c_str()), voname.length());

      ASN1_OCTET_STRING_set(ac_attr->name, (unsigned char*)(name.c_str()), name.length());
      ASN1_OCTET_STRING_set(ac_attr->value, (unsigned char*)(value.c_str()), value.length());
#else
      if (!qual.empty())
        ASN1_OCTET_STRING_set(ac_attr->qualifier, (const unsigned char*)(qual.c_str()), qual.length());
      else
        ASN1_OCTET_STRING_set(ac_attr->qualifier, (const unsigned char*)(voname.c_str()), voname.length());

      ASN1_OCTET_STRING_set(ac_attr->name, (const unsigned char*)(name.c_str()), name.length());
      ASN1_OCTET_STRING_set(ac_attr->value, (const unsigned char*)(value.c_str()), value.length());
#endif

      sk_AC_ATTRIBUTE_push(ac_att_holder->attributes, ac_attr);
    }

    if (attrs.empty()) 
      AC_ATT_HOLDER_free(ac_att_holder);
    else {
      GENERAL_NAME *g = GENERAL_NAME_new();
      ASN1_IA5STRING *tmpr = ASN1_IA5STRING_new();
      if (!tmpr || !g) {
        GENERAL_NAME_free(g);
        ASN1_IA5STRING_free(tmpr);
        ERROR(AC_ERR_MEMORY);
      }
    
      std::string buffer(voname);
      buffer.append("://");
      buffer.append(uri);

      ASN1_STRING_set(tmpr, buffer.c_str(), buffer.length());
      g->type  = GEN_URI;
      g->d.ia5 = tmpr;
      sk_GENERAL_NAME_push(ac_att_holder->grantor, g);

      sk_AC_ATT_HOLDER_push(ac_full_attrs->providers, ac_att_holder);
    }  
  
    // push both AC_ATTR into STACK_OF(AC_ATTR)
    sk_AC_ATTR_push(a->acinfo->attrib, capabilities);

    if (ac_full_attrs) {
      X509_EXTENSION *ext = NULL;

      ext = X509V3_EXT_conf_nid(NULL, NULL, OBJ_txt2nid("attributes"), (char *)(ac_full_attrs->providers));
      AC_FULL_ATTRIBUTES_free(ac_full_attrs);
      if (!ext)
        ERROR(AC_ERR_NO_EXTENSION);

      sk_X509_EXTENSION_push(a->acinfo->exts, ext);
      ac_full_attrs = NULL;
    }

    stk = sk_X509_new_null();
    
    if (issuerstack) {
      for (int j =0; j < sk_X509_num(issuerstack); j++)
        sk_X509_push(stk, X509_dup(sk_X509_value(issuerstack, j)));
    }

   //for (int i=0; i < sk_X509_num(stk); i++) 
   //  fprintf(stderr, "stk[%i] = %s\n", i , 
   //  X509_NAME_oneline(X509_get_subject_name((X509 *)sk_X509_value(stk, i)), NULL, 0)); 

#ifdef HAVE_OPENSSL_OLDRSA
    sk_X509_push(stk, (X509 *)ASN1_dup((int (*)())i2d_X509,
          (char*(*)())d2i_X509, (char *)issuer));
#else
    sk_X509_push(stk, (X509 *)ASN1_dup((int (*)(void*, unsigned char**))i2d_X509,
          (void*(*)(void**, const unsigned char**, long int))d2i_X509, (char *)issuer));
#endif

   //for(int i=0; i<sk_X509_num(stk); i++)
   //  fprintf(stderr, "stk[%i] = %d  %s\n", i , sk_X509_value(stk, i),  
   //  X509_NAME_oneline(X509_get_subject_name((X509 *)sk_X509_value(stk, i)), NULL, 0));

    certstack = X509V3_EXT_conf_nid(NULL, NULL, OBJ_txt2nid("certseq"), (char*)stk);
    sk_X509_pop_free(stk, X509_free);

    /* Create extensions */
    norevavail = X509V3_EXT_conf_nid(NULL, NULL, OBJ_txt2nid("idcenoRevAvail"), (char*)"loc");
    if (!norevavail)
      ERROR(AC_ERR_NO_EXTENSION);
    X509_EXTENSION_set_critical(norevavail, 0); 

    auth = X509V3_EXT_conf_nid(NULL, NULL, OBJ_txt2nid("authKeyId"), (char *)issuer);
    if (!auth)
      ERROR(AC_ERR_NO_EXTENSION);
    X509_EXTENSION_set_critical(auth, 0); 

    if (!complete.empty()) {
      targetsext = X509V3_EXT_conf_nid(NULL, NULL, OBJ_txt2nid("idceTargets"), (char*)(complete.c_str()));
      if (!targetsext)
        ERROR(AC_ERR_NO_EXTENSION);

      X509_EXTENSION_set_critical(targetsext,1);
      sk_X509_EXTENSION_push(a->acinfo->exts, targetsext);
    }

    sk_X509_EXTENSION_push(a->acinfo->exts, norevavail);
    sk_X509_EXTENSION_push(a->acinfo->exts, auth);
    if (certstack)
      sk_X509_EXTENSION_push(a->acinfo->exts, certstack);

    alg1 = X509_ALGOR_dup(issuer->cert_info->signature);
    alg2 = X509_ALGOR_dup(issuer->sig_alg);

    if (issuer->cert_info->issuerUID)
      if (!(uid = M_ASN1_BIT_STRING_dup(issuer->cert_info->issuerUID)))
        ERROR(AC_ERR_MEMORY);

    ASN1_INTEGER_free(a->acinfo->holder->baseid->serial);
    ASN1_INTEGER_free(a->acinfo->serial);
    ASN1_INTEGER_free(a->acinfo->version);
    ASN1_GENERALIZEDTIME_free(a->acinfo->validity->notBefore);
    ASN1_GENERALIZEDTIME_free(a->acinfo->validity->notAfter);
    dirn1->d.dirn = subname;
    dirn1->type = GEN_DIRNAME;
    sk_GENERAL_NAME_push(a->acinfo->holder->baseid->issuer, dirn1);
    dirn2->d.dirn = issname;
    dirn2->type = GEN_DIRNAME;
    sk_GENERAL_NAME_push(a->acinfo->form->names, dirn2);
    a->acinfo->holder->baseid->serial = holdserial;
    a->acinfo->serial = serial;
    a->acinfo->version = version;
    a->acinfo->validity->notBefore = time1;
    a->acinfo->validity->notAfter  = time2;
    a->acinfo->id = uid;
    X509_ALGOR_free(a->acinfo->alg);
    a->acinfo->alg = alg1;
    X509_ALGOR_free(a->sig_alg);
    a->sig_alg = alg2;

#ifdef HAVE_OPENSSL_OLDRSA
    ASN1_sign((int (*)())i2d_AC_INFO, a->acinfo->alg, a->sig_alg, a->signature,
           (char *)a->acinfo, pkey, EVP_md5());
#else
    ASN1_sign((int (*)(void*, unsigned char**))i2d_AC_INFO, a->acinfo->alg, a->sig_alg, a->signature,
            (char *)a->acinfo, pkey, EVP_md5());
#endif

    *ac = a;
    return 0;

err:
    X509_EXTENSION_free(auth);
    X509_EXTENSION_free(norevavail);
    X509_EXTENSION_free(targetsext);
    X509_EXTENSION_free(certstack);
    X509_NAME_free(subname);
    X509_NAME_free(issname);
    GENERAL_NAME_free(dirn1);
    GENERAL_NAME_free(dirn2);
    ASN1_INTEGER_free(holdserial);
    ASN1_INTEGER_free(serial);
    AC_ATTR_free(capabilities);
    ASN1_OBJECT_free(cobj);
    AC_IETFATTR_free(capnames);
    ASN1_UTCTIME_free(time1);
    ASN1_UTCTIME_free(time2);
    AC_ATT_HOLDER_free(ac_att_holder);
    AC_FULL_ATTRIBUTES_free(ac_full_attrs);
    return err;
  }

Here is the call graph for this function:

Here is the caller graph for this function:

bool Arc::createVOMSAC ( std::string &  codedac,
Credential &  issuer_cred,
Credential &  holder_cred,
std::vector< std::string > &  fqan,
std::vector< std::string > &  targets,
std::vector< std::string > &  attributes,
std::string &  voname,
std::string &  uri,
int  lifetime 
)

Create AC(Attribute Certificate) with voms specific format.

Parameters:
codedacThe coded AC as output of this method
issuer_credThe issuer credential which is used to sign the AC
holder_credThe holder credential, the holder certificate is the one which carries AC The rest arguments are the same as the above method

Definition at line 527 of file VOMSUtil.cpp.

                                                                                                {

    EVP_PKEY* issuerkey = NULL;
    X509* holder = NULL;
    X509* issuer = NULL;
    STACK_OF(X509)* issuerchain = NULL;

    issuer = issuer_cred.GetCert();
    issuerchain = issuer_cred.GetCertChain();
    issuerkey = issuer_cred.GetPrivKey();
    holder = holder_cred.GetCert();

    AC* ac = NULL;
    ac = AC_new();

    if(createVOMSAC(issuer, issuerchain, holder, issuerkey, (BIGNUM *)(BN_value_one()),
             fqan, targets, attributes, &ac, voname, uri, lifetime)){
      AC_free(ac); return false;
    }

    unsigned int len = i2d_AC(ac, NULL);
    unsigned char *tmp = (unsigned char *)OPENSSL_malloc(len);

    if (tmp) {
      unsigned char *ttmp = tmp;
      i2d_AC(ac, &ttmp);
      //codedac = std::string((char *)tmp, len);
      codedac.append((const char*)tmp, len);
    }
    free(tmp);

    AC_free(ac);
  
    return true;
  }

Here is the call graph for this function:

WSRF & Arc::CreateWSRFBaseFault ( SOAPEnvelope &  soap)

Definition at line 129 of file WSRFBaseFault.cpp.

                                              {
  // Not the most efective way to extract type of message
  WSRFBaseFault& v = *(new WSRFBaseFault(soap));
  std::string type = v.Type();
  delete &v;
  if(v.Type() == "wsrf-r:ResourceUnknownFault") return *(new WSRFResourceUnknownFault(soap));
  if(v.Type() == "wsrf-r:ResourceUnavailableFault") return *(new WSRFResourceUnavailableFault(soap));
  return *(new WSRF());
}

Here is the call graph for this function:

Here is the caller graph for this function:

WSRF & Arc::CreateWSRP ( SOAPEnvelope &  soap)

Definition at line 600 of file WSResourceProperties.cpp.

                                     {
  NS ns;
  ns["wsa"]="http://www.w3.org/2005/08/addressing";
  ns["wsrf-r"]="http://docs.oasis-open.org/wsrf/r-2";
  ns["wsrf-rw"]="http://docs.oasis-open.org/wsrf/rw-2";
  ns["wsrf-bf"]="http://docs.oasis-open.org/wsrf/bf-2";
  ns["wsrf-rp"]="http://docs.oasis-open.org/wsrf/rp-2";
  ns["wsrf-rpw"]="http://docs.oasis-open.org/wsrf/rpw-2";
  soap.Namespaces(ns);

  std::string action = WSAHeader(soap).Action();

  if(action == WSRFBaseFaultAction) {
    WSRF& fault = CreateWSRFBaseFault(soap);
    if(fault) return fault;
    return CreateWSRPFault(soap);
  };
  if(action == WSRPGetResourcePropertyDocumentRequestAction) return *(new WSRPGetResourcePropertyDocumentRequest(soap));
  if(action == WSRPGetResourcePropertyDocumentResponseAction) return *(new WSRPGetResourcePropertyDocumentResponse(soap));
  if(action == WSRPGetResourcePropertyRequestAction) return *(new WSRPGetResourcePropertyRequest(soap));
  if(action == WSRPGetResourcePropertyResponseAction) return *(new WSRPGetResourcePropertyResponse(soap));
  if(action == WSRPGetMultipleResourcePropertiesRequestAction) return *(new WSRPGetMultipleResourcePropertiesRequest(soap));
  if(action == WSRPGetMultipleResourcePropertiesResponseAction) return *(new WSRPGetMultipleResourcePropertiesResponse(soap));
  if(action == WSRPQueryResourcePropertiesRequestAction) return *(new WSRPQueryResourcePropertiesRequest(soap));
  if(action == WSRPQueryResourcePropertiesResponseAction) return *(new WSRPQueryResourcePropertiesResponse(soap));
  if(action == WSRPPutResourcePropertyDocumentRequestAction) return *(new WSRPPutResourcePropertyDocumentRequest(soap));
  if(action == WSRPPutResourcePropertyDocumentResponseAction) return *(new WSRPPutResourcePropertyDocumentResponse(soap));
  if(action == WSRPSetResourcePropertiesRequestAction) return *(new WSRPSetResourcePropertiesRequest(soap));
  if(action == WSRPSetResourcePropertiesResponseAction) return *(new WSRPSetResourcePropertiesResponse(soap));
  if(action == WSRPInsertResourcePropertiesRequestAction) return *(new WSRPInsertResourcePropertiesRequest(soap));
  if(action == WSRPInsertResourcePropertiesResponseAction) return *(new WSRPInsertResourcePropertiesResponse(soap));
  if(action == WSRPUpdateResourcePropertiesRequestAction) return *(new WSRPUpdateResourcePropertiesRequest(soap));
  if(action == WSRPUpdateResourcePropertiesResponseAction) return *(new WSRPUpdateResourcePropertiesResponse(soap));
  if(action == WSRPDeleteResourcePropertiesRequestAction) return *(new WSRPDeleteResourcePropertiesRequest(soap));
  if(action == WSRPDeleteResourcePropertiesResponseAction) return *(new WSRPDeleteResourcePropertiesResponse(soap));
  return *(new WSRP());
}

Here is the call graph for this function:

Here is the caller graph for this function:

WSRF& Arc::CreateWSRPFault ( SOAPEnvelope &  soap)

Definition at line 584 of file WSResourceProperties.cpp.

                                          {
  // Not the most efective way to extract type of message
  WSRPFault& v = *(new WSRPFault(soap));
  std::string type = v.Type();
  delete &v;
  if(v.Type() == "wsrf-rp:WSRPInvalidResourcePropertyQNameFault") return *(new WSRPInvalidResourcePropertyQNameFault(soap));
  if(v.Type() == "wsrf-rp:WSRPUnableToPutResourcePropertyDocumentFault") return *(new WSRPUnableToPutResourcePropertyDocumentFault(soap));
  if(v.Type() == "wsrf-rp:WSRPInvalidModificationFault") return *(new WSRPInvalidModificationFault(soap));
  if(v.Type() == "wsrf-rp:WSRPUnableToModifyResourcePropertyFault") return *(new WSRPUnableToModifyResourcePropertyFault(soap));
  if(v.Type() == "wsrf-rp:WSRPSetResourcePropertyRequestFailedFault") return *(new WSRPSetResourcePropertyRequestFailedFault(soap));
  if(v.Type() == "wsrf-rp:WSRPInsertResourcePropertiesRequestFailedFault") return *(new WSRPInsertResourcePropertiesRequestFailedFault(soap));
  if(v.Type() == "wsrf-rp:WSRPUpdateResourcePropertiesRequestFailedFault") return *(new WSRPUpdateResourcePropertiesRequestFailedFault(soap));
  if(v.Type() == "wsrf-rp:WSRPDeleteResourcePropertiesRequestFailedFault") return *(new WSRPDeleteResourcePropertiesRequestFailedFault(soap));
  return *(new WSRF());
}

Here is the call graph for this function:

Here is the caller graph for this function:

bool Arc::DataCompare ( const ExecutionTarget *  T1,
const ExecutionTarget *  T2 
)

Definition at line 72 of file DataBroker.cpp.

                                                                         {
    return CacheMappingTable[T1->url.fullstr()] > CacheMappingTable[T2->url.fullstr()];
  }

Here is the call graph for this function:

Here is the caller graph for this function:

static void Arc::DataConnectCallback ( void *  arg,
globus_ftp_control_handle_t *  ,
unsigned  int,
globus_bool_t  ,
globus_object_t *   
) [static]

Definition at line 104 of file FTPControl.cpp.

                                                                             {
    FTPControl::CBArg *cb = (FTPControl::CBArg*)arg;
    cb->data = true;
    cb->cond.signal();
  }

Here is the call graph for this function:

Here is the caller graph for this function:

static Logger Arc::dateTimeLogger ( Logger::  getRootLogger(),
"DateTime"   
) [static]

Here is the caller graph for this function:

std::string Arc::DeflateData ( const std::string &  data)

Definition at line 307 of file saml_util.cpp.

                                               {
    unsigned long len;
    char *out;
    len = data.length();
    out = (char*)(malloc(len * 2));
    z_stream stream;
    stream.next_in = (Bytef*)(data.c_str());
    stream.avail_in = len;
    stream.next_out = (Bytef*)out;
    stream.avail_out = len * 2;

    stream.zalloc = NULL;
    stream.zfree = NULL;
    stream.opaque = NULL;

    int rc;
    /* -MAX_WBITS to disable zib headers */
    rc = deflateInit2(&stream, Z_DEFAULT_COMPRESSION, Z_DEFLATED, -MAX_WBITS, 5, 0);
    if (rc == Z_OK) {
      rc = deflate(&stream, Z_FINISH);
      if (rc != Z_STREAM_END) {
        deflateEnd(&stream);
        if (rc == Z_OK) {
          rc = Z_BUF_ERROR;
        }
      } 
      else {
        rc = deflateEnd(&stream);
      }
    }
    if (rc != Z_OK) {
      free(out);
      std::cerr<<"Failed to deflate the data"<<std::endl;
      return std::string();
    }
    std::string ret;
    ret.append(out,stream.total_out);

    free(out);
    return ret;
  }

Here is the call graph for this function:

Here is the caller graph for this function:

static std::string Arc::digest_password ( const std::string &  nonce,
const std::string &  created,
const std::string &  passwd 
) [static]

Definition at line 171 of file UsernameToken.cpp.

                                                                                                            {
  EVP_MD_CTX mdctx;       
  unsigned char md_value[SHA_DIGEST_LENGTH];
  unsigned int md_len;

  char plain[1024];
  Base64::decode(plain, nonce.c_str());
  std::string todigest(plain);

  //UTF-8?
  todigest.append(created);
  todigest.append(passwd);

  //std::cout<<"To digest:"<<todigest<<std::endl;
    
  EVP_MD_CTX_init(&mdctx);
  EVP_DigestInit_ex(&mdctx, EVP_sha1(), NULL);
  EVP_DigestUpdate(&mdctx, todigest.c_str(), todigest.length());
  EVP_DigestFinal_ex(&mdctx, md_value, &md_len);
  EVP_MD_CTX_cleanup(&mdctx);

  char encoded [256];
  Base64::encode(encoded, (const char*)md_value, SHA_DIGEST_LENGTH);
  std::string ret(encoded);

  return ret;
}

Here is the call graph for this function:

Here is the caller graph for this function:

bool Arc::DirCreate ( const char *  path,
mode_t  mode 
)

Definition at line 103 of file FileUtils.cpp.

                                             {
  return DirCreate(path,0,0,mode);
}

Here is the caller graph for this function:

bool Arc::DirCreate ( const char *  path,
uid_t  uid,
gid_t  gid,
mode_t  mode 
)

Definition at line 108 of file FileUtils.cpp.

                                                                 {
  int r = -1;
  {
    UserSwitch usw(uid,gid);
    if(!usw) return false;
    r = mkdir(path,mode);
  };
  return (r == 0);
}
Glib::Dir * Arc::DirOpen ( const char *  path)

Definition at line 64 of file FileUtils.cpp.

                                   {
  return DirOpen(path,0,0);
}

Here is the caller graph for this function:

Glib::Dir * Arc::DirOpen ( const char *  path,
uid_t  uid,
gid_t  gid 
)

Definition at line 69 of file FileUtils.cpp.

                                                       {
  Glib::Dir* dir = NULL;
  {
    UserSwitch usw(uid,gid);
    if(!usw) return NULL;
    try {
      dir = new Glib::Dir(path);
    } catch(Glib::FileError& e) {
      // err=e.what();
    };
  };
  return dir;
}
static std::string Arc::disguise_id_into_url ( const URL &  u,
const std::string &  id 
) [static]

Definition at line 33 of file SubmitterBES.cpp.

                                                                          {
    std::string jobid = u.str();
    jobid+="#";
    for(std::string::size_type p = 0;p < id.length();++p) {
      jobid+=char_to_hex(id[p]);
    }
    return jobid;
  }

Here is the call graph for this function:

Here is the caller graph for this function:

static std::string Arc::empty_string ( ""  ) [static]

Here is the caller graph for this function:

const Glib::TimeVal Arc::ETERNAL ( G_MAXLONG  ,
 
)
static void Arc::EvaluateNode ( XMLNode  n,
const IniConfig &  ini 
) [static]

Definition at line 34 of file Profile.cpp.

                                                             {
    XMLNode iniNode = const_cast<IniConfig&>(ini);

    // First map attributes.
    while (XMLNode attrMap = n["AttributeRepresentation"]) {
      const std::string id = (std::string)attrMap.Attribute("id");
      if (!id.empty()) {
        if (!n.Attribute(id))
          n.NewAttribute(id);
        MapTagToNode(n.Attribute(id), attrMap.Attribute("inisections"), attrMap.Attribute("initag"), iniNode);
        if (((std::string)n.Attribute(id)).empty())
          n.Attribute(id).Destroy();
      }
      attrMap.Destroy();
    }

    // Then map elements.
    XMLNode sections = n.Attribute("inisections");
    XMLNode tag = n.Attribute("initag");
    MapTagToNode(n, sections, tag, iniNode);
    sections.Destroy();
    tag.Destroy();
    for (int i = 0; n.Child(i); i++)
      EvaluateNode(n.Child(i), ini);

    // Trimming leaf-node.
    if (!n.Child()) {
      const std::string content = n;
      if (n != trim(n))
        n = trim(content);
    }
  }

Here is the call graph for this function:

Here is the caller graph for this function:

static std::string Arc::extract_job_id ( const URL &  u) [static]

Definition at line 37 of file JobControllerBES.cpp.

                                                {
    std::string jobid = u.Path();
    if(jobid.empty()) return jobid;
    std::string::size_type p = jobid.find('#');
    if(p == std::string::npos) { p=0; } else { ++p; }
    std::string s;
    for(;p < jobid.length();p+=2) {
      char r = hex_to_char(jobid.c_str() + p);
      if(r == 0) { s.resize(0); break; }
      s += r;
    }
    return s;
  }

Here is the call graph for this function:

Here is the caller graph for this function:

static const char* Arc::FaultCodeMatch ( const char *  base,
const char *  code 
) [static]

Definition at line 272 of file SOAPEnvelope.cpp.

                                                                     {
  int l = strlen(base);
  if(strncasecmp(base,code,l) != 0) return NULL;
  if(code[l] == 0) return code+l;
  if(code[l] == '.') return code+l+1;
  return NULL;
}
int Arc::FileOpen ( const char *  path,
int  flags,
mode_t  mode 
)

Definition at line 27 of file FileUtils.cpp.

                                                     {
  return FileOpen(path,flags,0,0,mode);
}

Here is the caller graph for this function:

int Arc::FileOpen ( const char *  path,
int  flags,
uid_t  uid,
gid_t  gid,
mode_t  mode 
)

Definition at line 31 of file FileUtils.cpp.

                                                                         {
  int h = -1;
  {
    UserSwitch usw(uid,gid);
    if(!usw) return -1;
    h = open(path,flags | O_NONBLOCK,mode);
  };
  if(h == -1) return -1;
  if(flags & O_NONBLOCK) return h;
  while(1) {
    pollfd ph;
    ph.fd=h; ph.events=POLLOUT; ph.revents=0;
    if(poll(&ph,1,-1) <= 0) {
      if(errno != EINTR) {
        close(h);
        return -1;
      };
    };
    if(ph.revents & POLLOUT) break;
  };
  int fl = fcntl(h,F_GETFL);
  if(fl == -1) {
    close(h);
    return -1;
  };
  fl &= ~O_NONBLOCK;
  if(fcntl(h,F_SETFL,fl) == -1) {
    close(h);
    return -1;
  };
  return h;
}
bool Arc::FileStat ( const char *  path,
struct stat *  st,
bool  follow_symlinks 
)

Definition at line 83 of file FileUtils.cpp.

                                                                     {
  return FileStat(path,st,0,0,follow_symlinks);
}
bool Arc::FileStat ( const char *  path,
struct stat *  st,
uid_t  uid,
gid_t  gid,
bool  follow_symlinks 
)

Definition at line 89 of file FileUtils.cpp.

                                                                                         {
  int r = -1;
  {
    UserSwitch usw(uid,gid);
    if(!usw) return false;
    if(follow_symlinks) {
      r = stat(path,st);
    } else {
      r = lstat(path,st);
    };
  };
  return (r == 0);
}
static void Arc::fill_arc_string_attribute ( XMLNode  object,
std::string  value,
const char *  id 
) [static]

Definition at line 376 of file MCCTCP.cpp.

                                                                                     {
  object=value;
  object.NewAttribute("Type")="string";
  object.NewAttribute("AttributeId")=id;
}

Here is the caller graph for this function:

static void Arc::fill_xacml_string_attribute ( XMLNode  object,
std::string  value,
const char *  id 
) [static]

Definition at line 382 of file MCCTCP.cpp.

                                                                                       {
  object.NewChild("ra:AttributeValue")=value;
  object.NewAttribute("DataType")="xs:string";
  object.NewAttribute("AttributeId")=id;
}

Here is the caller graph for this function:

static bool Arc::FilterNode ( MessageAuth &  id,
XMLNode  node,
std::list< std::pair< XMLNode, std::list< InfoPolicy >::iterator > > &  policies,
std::list< InfoPolicy > &  epolicies,
std::map< std::string, InfoPolicy > &  ipolicies 
) [static]

Definition at line 117 of file InfoFilter.cpp.

                                                                                                                                                                                              {
  // Check if node has external policy
  for(std::list< std::pair<XMLNode,std::list<InfoPolicy>::iterator> >::iterator p = policies.begin();
                                         p != policies.end();) {
    if(node == p->first) {
      // Node has assigned policy - evaluate it
      if(!p->second->Evaluate(id)) { // Policy evaluation failed
        return false;
      };
      if(p->second->res != ArcSec::DECISION_PERMIT) {
        RemovePolicies(policies,node);
        node.Destroy();
        break;
      };
    };
    ++p;
  };
  if((bool)node) {
    // Check for internal policy
    // 1. Pick policy definitions
    XMLNode def = node["InfoFilterDefinition"];
    for(;(bool)def;++def) {
      // Create policy and store it in map
      // TODO: policies without identifier
      std::string pid = def.Attribute("id");
      ipolicies[pid]=InfoPolicy(def.Child());
    };
    // 2. Check for tag
    // TODO: policies without ids and tags
    std::string tag = node.Attribute("InfoFilterTag");
    if(!tag.empty()) {
      InfoPolicy& policy = ipolicies[tag];
      if(!policy.xml) { // No such policy defined
        return false;
      };
      if(!policy.Evaluate(id)) { // Failed to evaluate policy
        return false;
      };
      if(policy.res != ArcSec::DECISION_PERMIT) {
        RemovePolicies(policies,node);
        node.Destroy();
        return true;
      };
    };
  };
  if((bool)node) {
    // Process children nodes
    for(int n = 0;;++n) {
      XMLNode cnode = node.Child(n);
      if(!cnode) break;
      if(!FilterNode(id,cnode,policies,epolicies,ipolicies)) return false;
    };
  };
  return true;
}

Here is the call graph for this function:

bool Arc::final_xmlsec ( void  )

Finalize the xml security library.

Definition at line 117 of file XmlSecUtils.cpp.

                        {
  if(has_init) {
    init_lock_.lock();
    has_init = false;
    init_lock_.unlock();

    //Shutdown xmlsec-crypto library
    xmlSecCryptoShutdown();
    //Shutdown crypto library 
    xmlSecCryptoAppShutdown();  
    //Shutdown xmlsec library
    xmlSecShutdown();
    //Shutdown libxml
    xmlCleanupParser();
  }
}

Here is the caller graph for this function:

static PluginDescriptor* Arc::find_constructor ( PluginDescriptor *  desc,
const std::string &  kind,
int  min_version,
int  max_version 
) [static]

Definition at line 23 of file Plugin.cpp.

                                                                                                                          {
    if(!desc) return NULL;
    for(;(desc->kind) && (desc->name);++desc) {
      if((kind == desc->kind) || (kind.empty())) {
        if((min_version <= desc->version) && (max_version >= desc->version)) {
          if(desc->instance) return desc;
        };
      };
    };
    return NULL;
  }

Here is the caller graph for this function:

static PluginDescriptor* Arc::find_constructor ( PluginDescriptor *  desc,
const std::string &  kind,
const std::string &  name,
int  min_version,
int  max_version 
) [static]

Definition at line 35 of file Plugin.cpp.

                                                                                                                                                {
    if(!desc) return NULL;
    for(;(desc->kind) && (desc->name);++desc) {
      if(((kind == desc->kind) || (kind.empty())) &&
         ((name == desc->name) || (name.empty()))) {
        if((min_version <= desc->version) && (max_version >= desc->version)) {
          if(desc->instance) return desc;
        };
      };
    };
    return NULL;
  }
static Arc::XMLNode Arc::find_xml_node ( Arc::XMLNode  node,
const std::string &  el_name,
const std::string &  attr_name,
const std::string &  attr_value 
) [static]

Definition at line 25 of file AREXClient.cpp.

                                                            {
    if (MatchXMLName(node, el_name) &&
        (((std::string)node.Attribute(attr_name)) == attr_value))
      return node;
    for (XMLNode cn = node[el_name]; cn; cn = cn[1]) {
      XMLNode fn = find_xml_node(cn, el_name, attr_name, attr_value);
      if (fn)
        return fn;
    }
    return XMLNode();
  }

Here is the call graph for this function:

Here is the caller graph for this function:

static XMLNode Arc::FindElementByID ( XMLNode  node,
const std::string &  id,
const std::string &  name 
) [static]

Definition at line 89 of file MCCLoader.cpp.

                                                                                           {
    for(int n = 0;; ++n) {
      XMLNode cn = node.Child(n);
      if(!cn) break;

      if(MatchXMLName(cn, "ArcConfig")) {
        XMLNode result = FindElementByID(cn, id, name);
        if(result) return result;
        continue;
      }

      if(MatchXMLName(cn, "Chain")) {
        XMLNode result = FindElementByID(cn, id, name);
        if(result) return result;
      continue;
      }

      if(MatchXMLName(cn, name)) {
        if((std::string)(cn.Attribute("id")) == id) return cn;
      }
    }
    return XMLNode();
  }

Here is the call graph for this function:

Here is the caller graph for this function:

const char * Arc::FindNTrans ( const char *  s,
const char *  p,
unsigned long  n 
)

Definition at line 38 of file IString.cpp.

                                                                        {
#ifdef ENABLE_NLS
    return dngettext(PACKAGE,
                     s ? *s ? s : istring("(empty)") : istring("(null)"),
                     p ? *p ? p : istring("(empty)") : istring("(null)"), n);
#else
    return n == 1 ?
      s ? *s ? s : "(empty)" : "(null)" :
      p ? *p ? p : "(empty)" : "(null)";
#endif
  }

Here is the caller graph for this function:

const char * Arc::FindTrans ( const char *  p)

Definition at line 29 of file IString.cpp.

                                       {
#ifdef ENABLE_NLS
    return dgettext(PACKAGE,
                    p ? *p ? p : istring("(empty)") : istring("(null)"));
#else
    return p ? *p ? p : "(empty)" : "(null)";
#endif
  }

Here is the caller graph for this function:

static void Arc::freeClassLoader ( ) [static]

Definition at line 22 of file ClassLoader.cpp.

                              {
  ClassLoader* cl = ClassLoader::getClassLoader();
  if(cl) delete cl;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static std::string Arc::generate_derivedkey ( const std::string &  password,
const std::string &  salt,
int  iteration 
) [static]

Definition at line 199 of file UsernameToken.cpp.

                                                                                                       {
  EVP_MD_CTX mdctx;
  unsigned char md_value[SHA_DIGEST_LENGTH];
  unsigned int md_len;
  int i;

  std::string todigest(password);
  todigest.append(salt);

  //std::cout<<"To digest:"<<todigest<<" "<<iteration<<std::endl;

  EVP_MD_CTX_init(&mdctx);
  for(i = 0; i< iteration; i++) {
    EVP_DigestInit_ex(&mdctx, EVP_sha1(), NULL);
    EVP_DigestUpdate(&mdctx, todigest.c_str(), todigest.length());
    memset(md_value, 0, SHA_DIGEST_LENGTH);
    EVP_DigestFinal_ex(&mdctx, md_value, &md_len);
    todigest.assign((char*)md_value,md_len);
  }

  EVP_MD_CTX_cleanup(&mdctx);

  return todigest;
}

Here is the caller graph for this function:

static bool Arc::get_attributes ( globus_rls_handle_t *  h,
const std::string &  lfn,
FileInfo &  f 
) [static]

Definition at line 968 of file DataPointRLS.cpp.

                                          {
    globus_list_t *attr_list;
    char errmsg[MAXERRMSG + 32];
    globus_result_t err;
    int errcode;
    err = globus_rls_client_lrc_attr_value_get
            (h, const_cast<char*>(lfn.c_str()),
            NULL, globus_rls_obj_lrc_lfn, &attr_list);
    if (err != GLOBUS_SUCCESS) {
      globus_rls_client_error_info(err, &errcode, errmsg, MAXERRMSG + 32,
                                   GLOBUS_FALSE);
      if (errcode != GLOBUS_RLS_ATTR_NEXIST)
        // logger.msg(INFO, "Warning: Failed to retrieve attributes: %s",
        // errmsg);
        return false;
      return true;
    }
    for (globus_list_t *pa = attr_list; pa; pa = globus_list_rest(pa)) {
      globus_rls_attribute_t *attr =
        (globus_rls_attribute_t*)globus_list_first(pa);
      if (attr->type != globus_rls_attr_type_str)
        continue;
      // logger.msg(VERBOSE, "Attribute: %s - %s", attr->name, attr->val.s);
      if (strcmp(attr->name, "filechecksum") == 0)
        f.SetCheckSum(attr->val.s);
      else if (strcmp(attr->name, "size") == 0)
        f.SetSize(stringtoull(attr->val.s));
      else if (strcmp(attr->name, "modifytime") == 0) {
        Time created(attr->val.s);
        if (created == -1)
          created.SetTime(stringtoull(attr->val.s));
        f.SetCreated(created);
      }
      else if (strcmp(attr->name, "created") == 0) {
        Time created(attr->val.s);
        if (created == -1)
          created.SetTime(stringtoull(attr->val.s));
        f.SetCreated(created);
      }
    }
    globus_rls_client_free_list(attr_list);
    return true;
  }

Here is the call graph for this function:

Here is the caller graph for this function:

std::string Arc::get_cert_str ( const char *  certfile)

Get certificate in string format from certificate file.

Definition at line 135 of file XmlSecUtils.cpp.

                                             {
  std::ifstream is(certfile);
  std::string cert;
  std::getline(is,cert, char(0));
  std::size_t pos = cert.find("BEGIN CERTIFICATE");
  if(pos != std::string::npos) {
    std::size_t pos1 = cert.find_first_of("---", pos);
    std::size_t pos2 = cert.find_first_not_of("-", pos1);
    std::size_t pos3 = cert.find_first_of("---", pos2);
    std::string str = cert.substr(pos2+1, pos3-pos2-2);
    return str;
  }
  return ("");
}

Here is the caller graph for this function:

static bool Arc::get_conditions ( std::string  s,
std::list< std::string > &  patterns 
) [static]

Definition at line 115 of file GlobusSigningPolicy.cpp.

                                                                     {
  std::string id;
  patterns.resize(0);
  get_word(s,id);
  if(id.empty()) return true;
  if(id.compare(0,strlen(conditions_id),conditions_id) != 0) {
    logger.msg(WARNING,"Was expecting %s at the beginning of \"%s\"",conditions_id,id);
    return false;
  };
  id=id.substr(strlen(conditions_id));
  if(id != "subjects") {
    logger.msg(WARNING,"We only support subjects conditions in Globus signing policy - %s is not supported",id);
    return false;
  };
  get_word(s,id);
  if(id != globus_id) {
    logger.msg(WARNING,"We only support globus conditions in Globus signing policy - %s is not supported",id);
    return false;
  };
  std::string subjects;
  get_word(s,subjects);
  if(subjects.empty()) {
    logger.msg(WARNING,"Missing condition subjects in Globus signing policy");
    return false;
  };
  std::string subject;
  for(;;) {
    get_word(subjects,subject);
    if(subject.empty()) break;
    patterns.push_back(subject);
  };
  return true;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static unsigned long Arc::get_flag_STORE_CTX ( X509_STORE_CTX *  container) [static]

Definition at line 22 of file PayloadTLSMCC.cpp.

                                                                   {
  PayloadTLSMCC* it = PayloadTLSMCC::RetrieveInstance(container);
  if(!it) return 0;
  return it->Flags();
}

Here is the call graph for this function:

Here is the caller graph for this function:

static uid_t Arc::get_group_id ( void  ) [static]

Definition at line 41 of file User.cpp.

                                  {
    return getgid();
  }

Here is the caller graph for this function:

static bool Arc::get_host_port ( struct sockaddr_storage *  addr,
std::string &  host,
std::string &  port 
) [static]

Definition at line 426 of file MCCTCP.cpp.

{
    char buf[INET6_ADDRSTRLEN];
    memset(buf,0,sizeof(buf));
    const char *ret = NULL;
    switch (addr->ss_family) {
        case AF_INET: {
            struct sockaddr_in *sin = (struct sockaddr_in *)addr;
            ret = inet_ntop(AF_INET, &(sin->sin_addr), buf, sizeof(buf)-1);
            if (ret != NULL) {
                port = tostring(ntohs(sin->sin_port));
            }
            break;
        }
        case AF_INET6: {
            struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)addr;
            if (!IN6_IS_ADDR_V4MAPPED(&(sin6->sin6_addr))) {
                ret = inet_ntop(AF_INET6, &(sin6->sin6_addr), buf, sizeof(buf)-1);
            } else {
                // ipv4 address mapped to ipv6 so resolve as ipv4 address
                struct sockaddr_in sin;
                memset(&sin, 0, sizeof(struct sockaddr_in));
                sin.sin_family = AF_INET;
                sin.sin_port = sin6->sin6_port;
                sin.sin_addr.s_addr = ((uint32_t *)&sin6->sin6_addr)[3];
                memcpy(addr, &sin, sizeof(struct sockaddr_in));
                ret = inet_ntop(AF_INET, &(sin.sin_addr), buf, sizeof(buf)-1);
            }
            if (ret != NULL) {
                port = tostring(ntohs(sin6->sin6_port));
            }
            break;
        }
        default:
            return false;
            break;
    }
    if (ret != NULL) {
        buf[sizeof(buf)-1] = 0;
        host = buf;
    } else {
        return false;
    }
    return true;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static std::string Arc::get_http_proxy ( const URL &  url) [static]

Definition at line 242 of file ClientInterface.cpp.

                                                  {
    if(url.Protocol() == "http") return GetEnv("ARC_HTTP_PROXY");
    if(url.Protocol() == "https") return GetEnv("ARC_HTTPS_PROXY");
    if(url.Protocol() == "httpg") return GetEnv("ARC_HTTPG_PROXY");
    return "";
  }

Here is the call graph for this function:

Here is the caller graph for this function:

static std::string Arc::get_http_proxy_host ( const URL &  url,
const std::string &  proxy_host,
int  proxy_port 
) [static]

Definition at line 249 of file ClientInterface.cpp.

                                                                                                    {
    if(!proxy_host.empty()) return proxy_host;
    std::string proxy = get_http_proxy(url);
    if(proxy.empty()) return url.Host();
    std::string::size_type p = proxy.find(':');
    if(p != std::string::npos) proxy.resize(p);
    return proxy;
  }

Here is the call graph for this function:

static int Arc::get_http_proxy_port ( const URL &  url,
const std::string &  proxy_host,
int  proxy_port 
) [static]

Definition at line 258 of file ClientInterface.cpp.

                                                                                              {
    int port = 0;
    if(!proxy_host.empty()) {
      port = proxy_port;
    } else {
      std::string proxy = get_http_proxy(url);
      if(proxy.empty()) return url.Port();
      std::string::size_type p = proxy.find(':');
      if(p != std::string::npos) stringto(proxy.substr(p+1),port);
    }
    if(port == 0) {
      if(url.Protocol() == "http") port=HTTP_DEFAULT_PORT;
      else if(url.Protocol() == "https") port=HTTPS_DEFAULT_PORT;
      else if(url.Protocol() == "httpg") port=HTTPG_DEFAULT_PORT;
    }
    return port;
  }

Here is the call graph for this function:

static bool Arc::get_id ( std::string &  s,
std::string &  ca_subject 
) [static]

Definition at line 64 of file GlobusSigningPolicy.cpp.

                                                       {
  std::string id;
  ca_subject.resize(0);
  get_word(s,id);
  if(id.empty()) return true;
  if(id.compare(0,strlen(access_id),access_id) != 0) {
    logger.msg(WARNING,"Was expecting %s at the beginning of \"%s\"",access_id,id);
    return false;
  };
  id=id.substr(strlen(access_id));
  if(id != "CA") { 
    logger.msg(WARNING,"We only support CAs in Globus signing policy - %s is not supported",id);
    return false;
  };
  get_word(s,id);
  if(id != "X509") {
    logger.msg(WARNING,"We only support X509 CAs in Globus signing policy - %s is not supported",id);
    return false;
  };
  get_word(s,ca_subject);
  if(ca_subject.empty()) {
    logger.msg(WARNING,"Missing CA subject in Globus signing policy");
    return false;
  };
  return true;
}

Here is the call graph for this function:

Here is the caller graph for this function:

std::string Arc::get_key_from_certfile ( const char *  certfile)

Get public key in string format from certificate file.

Definition at line 213 of file XmlSecUtils.cpp.

                                                      {
  BIO* certbio = NULL;
  certbio = BIO_new_file(certfile, "r");
  X509* cert = NULL;
  cert = PEM_read_bio_X509(certbio, NULL, NULL, NULL); 
  EVP_PKEY* key = NULL;
  key = X509_get_pubkey(cert);

  BIO* out = NULL;
  out = BIO_new(BIO_s_mem());
  PEM_write_bio_PUBKEY(out, key);

  std::string pubkey_str;
  for(;;) {
    char s[256];
    int l = BIO_read(out,s,sizeof(s));
    if(l <= 0) break;
    pubkey_str.append(s,l);;
  }

  EVP_PKEY_free(key);
  X509_free(cert);
  BIO_free_all(certbio);
  BIO_free_all(out);

  if(!pubkey_str.empty()) {
    std::size_t pos = pubkey_str.find("BEGIN PUBLIC KEY");
    if(pos != std::string::npos) {
      std::size_t pos1 = pubkey_str.find_first_of("---", pos);
      std::size_t pos2 = pubkey_str.find_first_not_of("-", pos1);
      std::size_t pos3 = pubkey_str.find_first_of("---", pos2);
      std::string str = pubkey_str.substr(pos2+1, pos3-pos2-2);
      return str;
    }
    return ("");
  }
  return pubkey_str;
}

Here is the caller graph for this function:

xmlSecKey * Arc::get_key_from_certstr ( const std::string &  value)

Get public key in xmlSecKey structure from certificate string (the string under "-----BEGIN CERTIFICATE-----" and "-----END CERTIFICATE-----")

Definition at line 253 of file XmlSecUtils.cpp.

                                                        {
  xmlSecKey *key = NULL;
  xmlSecKeyDataFormat key_formats[] = {
    xmlSecKeyDataFormatDer,
    xmlSecKeyDataFormatCertDer,
    xmlSecKeyDataFormatPkcs8Der,
    xmlSecKeyDataFormatCertPem,
    xmlSecKeyDataFormatPkcs8Pem,
    xmlSecKeyDataFormatPem,
    xmlSecKeyDataFormatBinary,
    (xmlSecKeyDataFormat)0
  };

  int rc;
  xmlSecErrorsDefaultCallbackEnableOutput(FALSE);

  BIO* certbio = NULL;
  std::string cert_value;
  //Here need to compose a complete certificate
  cert_value.append("-----BEGIN CERTIFICATE-----").append("\n").append(value).append("\n").append("-----END CERTIFICATE-----"
);

  for (int i=0; key_formats[i] && key == NULL; i++) {
    certbio = BIO_new_mem_buf((void*)(cert_value.c_str()), cert_value.size());
    key = xmlSecOpenSSLAppKeyFromCertLoadBIO(certbio, key_formats[i]);
    BIO_free(certbio);
    if(key != NULL) break;
    unsigned long e = ERR_get_error();
    while(e != SSL_ERROR_NONE) {
      e = ERR_get_error();
    }
  }

  xmlSecErrorsDefaultCallbackEnableOutput(TRUE);

  return key;
}

Here is the caller graph for this function:

xmlSecKey * Arc::get_key_from_keyfile ( const char *  keyfile)

Get key in xmlSecKey structure from key file.

Definition at line 150 of file XmlSecUtils.cpp.

                                                     {
  std::string key_str;
  std::ifstream is(keyfile);
  std::getline(is,key_str, char(0));

  xmlSecKeyPtr key = NULL;
  key = get_key_from_keystr(key_str);
  return key;
}

Here is the call graph for this function:

Here is the caller graph for this function:

xmlSecKey * Arc::get_key_from_keystr ( const std::string &  value)

Get key in xmlSecKey structure from key in string format.

Definition at line 161 of file XmlSecUtils.cpp.

                                                       {//, const bool usage) { 
  xmlSecKey *key = NULL;
  xmlSecKeyDataFormat key_formats[] = {
    xmlSecKeyDataFormatDer,
    xmlSecKeyDataFormatCertDer,
    xmlSecKeyDataFormatPkcs8Der,
    xmlSecKeyDataFormatCertPem,
    xmlSecKeyDataFormatPkcs8Pem,
    xmlSecKeyDataFormatPem,
    xmlSecKeyDataFormatBinary,
    (xmlSecKeyDataFormat)0
  };

  int rc;

  //We need to remove the "BEGIN RSA PRIVATE KEY" and "END RSA PRIVATE KEY" 
  //if they exit in the input parameter
  std::string v;
  std::size_t pos1, pos2;
  pos1 = value.find("BEGIN RSA PRIVATE KEY");
  if(pos1 == std::string::npos) {
    pos1 = value.find("BEGIN RSA PUBLIC KEY");
  }
  if(pos1 != std::string::npos) {
    pos1 = pos1 + 21;
    pos2 = value.find_first_not_of("-", pos1);
    v = value.substr(pos2);
    pos2 = v.find_first_of("-");
    v.resize(pos2);
  }
  else v = value;

  xmlSecErrorsDefaultCallbackEnableOutput(FALSE);
  xmlSecByte* tmp_str = new xmlSecByte[v.size()];
  memset(tmp_str,0,v.size());

  rc = xmlSecBase64Decode((const xmlChar*)(v.c_str()), tmp_str, v.size());
  if (rc < 0) {
    //bad base-64
    memcpy(tmp_str,v.c_str(),v.size());
    rc = v.size();
  }
  for (int i=0; key_formats[i] && key == NULL; i++) {
    key = xmlSecCryptoAppKeyLoadMemory(tmp_str, rc, key_formats[i], NULL, NULL, NULL);
  }
  delete[] tmp_str;
  xmlSecErrorsDefaultCallbackEnableOutput(TRUE);

  return key;
}

Here is the caller graph for this function:

static void Arc::get_line ( std::istream &  in,
std::string &  s 
) [static]

Definition at line 29 of file GlobusSigningPolicy.cpp.

                                                  {
  for(;;) {
    s.resize(0);
    if(in.fail() || in.eof()) return;
    getline(in,s);
    std::string::size_type p;
    p=s.find_first_not_of(" \t");
    if(p != std::string::npos) s=s.substr(p);
    if((!s.empty()) && (s[0] != '#')) break;
  };
  return;
}

Here is the caller graph for this function:

static Plugin* Arc::get_mcc_client ( PluginArgument *  arg) [static]

Definition at line 77 of file MCCGSI.cpp.

                                                     {
    MCCPluginArgument *mccarg =
      arg ? dynamic_cast<MCCPluginArgument*>(arg) : NULL;
    if (!mccarg)
      return NULL;
    return new MCC_GSI_Client(*(Config*)(*mccarg),
                              *(PluginsFactory*)(*(ChainContext*)(*mccarg)));
  }
static Plugin* Arc::get_mcc_service ( PluginArgument *  arg) [static]

Definition at line 68 of file MCCGSI.cpp.

                                                      {
    MCCPluginArgument *mccarg =
      arg ? dynamic_cast<MCCPluginArgument*>(arg) : NULL;
    if (!mccarg)
      return NULL;
    return new MCC_GSI_Service(*(Config*)(*mccarg),
                               *(PluginsFactory*)(*(ChainContext*)(*mccarg)));
  }
XMLNode Arc::get_node ( XMLNode &  parent,
const char *  name 
) [static]

Generate a new child XMLNode with specified name.

Definition at line 31 of file WSA.cpp.

                                                          {
  XMLNode n = parent[name];
  if(!n) n=parent.NewChild(name);
  return n;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static std::string Arc::get_nonce ( ) [static]

Definition at line 139 of file UsernameToken.cpp.

                             {
  unsigned char buf[16];
  int i = RAND_pseudo_bytes(buf, 16);
  if (i < 0) {
    std::cout<<"Something wrong with random generator"<<std::endl;
  }
  char encoded [25];
  Base64::encode(encoded ,(const char*)buf,16);
  
  std::string ret(encoded);
  //std::cout<<"Generated nonce: "<<ret<<std::endl;
  return ret;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static bool Arc::get_password ( std::string &  password,
bool  verify 
) [static]

Definition at line 41 of file UsernameToken.cpp.

                                                           {
  char pwd[1024];
  int len = sizeof(pwd);
  int j, r;
  char prompt[128];
  for(;;) {
    snprintf(prompt, sizeof(prompt), "Enter password for Username Token: "); 
    r = EVP_read_pw_string(pwd, len, prompt, 0);
    if(r != 0) {
      std::cerr<<"Failed to read read input password"<<std::endl;
      memset(pwd,0,(unsigned int)len);
      return false;
    }
    j = strlen(pwd);
    if(j < PASS_MIN_LENGTH) {
      std::cerr<<"Input phrase is too short (must be at least "<<PASS_MIN_LENGTH<<" chars)"<<std::endl;
    }
    else if(!verify) {
      password=pwd;
      return true;
    } 
    else {
      snprintf(prompt, sizeof(prompt), "Enter password again: ");
      char buf[1024];
      r = EVP_read_pw_string(buf, len, prompt, 0);
      if(r != 0) {
        std::cerr<<"Failed to read input password"<<std::endl;
        return false;
      }
      if(strcmp(pwd, buf) != 0) {
        std::cerr<<"Two input passwords do not match, try again"<<std::endl;    
      }
      else {
        password=pwd;
        return true;
      }
    }//end else
  }//end for  
  return false;
}

Here is the caller graph for this function:

static std::string Arc::get_password_from_file ( std::istream &  f,
const std::string &  username 
) [static]

Definition at line 101 of file UsernameToken.cpp.

                                                                                  {
  size_t left, right, found, found1, found2;
  std::string str, user, passwd;
  while (!f.eof() && !f.fail()) {
    std::getline(f, str);

    left = str.find_first_not_of(" ");
    found1 = str.find_first_of(" ", left);
    found2 = str.find_first_of(",", left);
    right = found1 <= found2 ? found1 : found2;
    if(right!=std::string::npos) {
      user = str.substr(left, right - left);
      if(user.compare(username)!=0){continue;}

      found = str.find_first_not_of(" ", right);
      left = found;
      found = str.find_first_not_of(",", left);
      left = found;
      found = str.find_first_not_of(" ", left);
      left = found;

      found1 = str.find_first_of(" ", left);
      found2 = str.find_first_of("\n", left);
      right = found1 <= found2 ? found1 : found2;
      passwd = str.substr(left, right - left);
      break;
    }
  }
  //f.close();
  return passwd;  
}

Here is the caller graph for this function:

static bool Arc::get_path ( const std::string &  path_base,
const std::list< std::string > &  tokens,
XMLNode &  node 
) [static]

Definition at line 130 of file InfoCache.cpp.

{
    if(tokens.size() < 1) return false;
    std::string dir = path_base;
    const std::list<std::string>::const_iterator itLastElement = --tokens.end();
    for (std::list<std::string>::const_iterator it = tokens.begin();
         it != itLastElement; it++) {
        dir = Glib::build_filename(dir, *it);
        if (!create_directory(dir)) return false;
    };
    std::string file = Glib::build_filename(dir, tokens.back() + ".xml");
    return node.ReadFromFile(file);
}

Here is the call graph for this function:

Here is the caller graph for this function:

static const char* Arc::get_path_str ( const URL &  url) [static]

Definition at line 65 of file DataPointRLS.cpp.

                                                  {
    const std::string& path = url.Path();
    if(path.empty() || (path[0] != '/')) return path.c_str();
    return (path.c_str()+1);
  }

Here is the call graph for this function:

Here is the caller graph for this function:

const std::string Arc::get_property ( Arc::Credential u,
const std::string  property 
)

Extract the needed field from the certificate.

Definition at line 1674 of file VOMSUtil.cpp.

                                                                          {
    if (property == "dn"){
        return u.GetIdentityName();
    }
// If it was not DN, then we have to deal with VOMS
    std::vector<std::string> output;
    std::string emptystring = "";
    VOMSTrustList emptylist;
    parseVOMSAC(u,emptystring,emptystring,emptylist,output,false);
    if (property == "voms:vo"){
        if (output.empty())return ""; // if it's not possible to determine the VO -- such jobs will go into generic share
        else { // the  name of the VO is in the first string. Strip hostname from it, leave only voname parameter;
                size_t pos1, pos2;
                pos1 = output[0].find("=",1);
                pos2 = output[0].find("/",1);
                return output[0].substr(pos1+1,pos2-pos1-1);
        }
    }
    else if (property == "voms:role"){
       if (output.empty()) return "";
        else{
                size_t pos1, pos2;
                unsigned int i,j;
                std::string role = "null";
                std::string vo_name;
                pos1 = output[0].find("=",1);
                pos2 = output[0].find("/",1);
                vo_name = output[0].substr(pos1+1,pos2-pos1-1);
                for (i=1;i<output.size();i++){
                        pos1 = output[i].find("/Role=");
                        if(pos1 != std::string::npos){
                                pos2 = output[i].find("/",pos1+1);
                                if(pos2 == std::string::npos)
                                        role = output[i].substr(pos1+6,output[i].length()-pos1-6);
                                else
                                        role = output[i].substr(pos1+6,pos2-pos1-6);
                                break;
                        }
                }
              vo_name.insert(vo_name.end(),':');
                vo_name.insert(vo_name.length(),role);
                return vo_name;
        }
    }
    else if (property == "voms:group"){
        if (output.empty()) return "";
        else{
                size_t pos1, pos2;
                unsigned int i,j;
                std::string group = "";
                std::string vo_name;
                pos1 = output[0].find("=",1);
                pos2 = output[0].find("/",1);
                vo_name = output[0].substr(pos1+1,pos2-pos1-1);
                vo_name.insert(vo_name.begin(),'/');
                for (i=1;i<output.size();i++){
                        pos1 = output[i].find("/Group=");
                        if(pos1 != std::string::npos){
                                pos2 = output[i].find("/",pos1+1);
                                if(pos2 == std::string::npos)
                                   group = output[i].substr(pos1+7,output[i].length()-pos1-7);
                                else
                                        group = output[i].substr(pos1+7,pos2-pos1-7);
                                break;
                        }
                }
                if(group != ""){
                        vo_name.insert(vo_name.end(),'/');
                        vo_name.insert(vo_name.length(),group);
                }
                return vo_name;
        }
    }
    else return "";
  }

Here is the call graph for this function:

Here is the caller graph for this function:

static bool Arc::get_rights ( std::string &  s) [static]

Definition at line 91 of file GlobusSigningPolicy.cpp.

                                     {
  std::string id;
  get_word(s,id);
  if(id == negative_rights) {
    logger.msg(WARNING,"Negative rights are not supported in Globus signing policy");
    return false;
  };
  if(id != positive_rights) {
    logger.msg(WARNING,"Unknown rights in Globus signing policy - %s",id);
    return false;
  };
  get_word(s,id);
  if(id != globus_id) {
    logger.msg(WARNING,"Only globus rights are supported in Globus signing policy - %s is not supported",id);
    return false;
  };
  get_word(s,id);
  if(id != sign_id) {
    logger.msg(WARNING,"Only signing rights are supported in Globus signing policy - %s is not supported",id);
    return false;
  };
  return true;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static std::string Arc::get_salt ( bool  mac) [static]

Definition at line 153 of file UsernameToken.cpp.

                                    {
  unsigned char buf[16];
  int i = RAND_pseudo_bytes(buf, 16);
  if (i < 0) {
    std::cout<<"Something wrong with random generator"<<std::endl;
  }

  if(mac){buf[15] = 0x01;}
  else {buf[15] = 0x02;}

  char encoded [25];
  Base64::encode(encoded ,(const char*)buf,16);

  std::string ret(encoded);
  //std::cout<<"Generated salt: "<<ret<<std::endl;
  return ret;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static uid_t Arc::get_user_id ( void  ) [static]

Definition at line 30 of file User.cpp.

                                 {
    uid_t user_id = getuid();
    if (user_id != 0)
      return user_id;
    std::string user_s = GetEnv("USER_ID");
    if (user_s.empty())
      return 0;
    user_id = stringtoui(user_s);
    return user_id;
  }

Here is the call graph for this function:

Here is the caller graph for this function:

static bool Arc::get_username ( std::string &  user) [static]

Definition at line 82 of file UsernameToken.cpp.

                                          {
  int r;
  char buf[256];
  setvbuf(stdin, (char *)NULL, _IONBF, 0);
  std::cout<<"Enter username for Username Token: ";
  if (!(fgets(buf, 256, stdin))) {
    std::cerr<<"Failed to read username"<<std::endl;
    return false;
  }
  r = strlen(buf);
  if (buf[r-1] == '\n') {
    buf[r-1] = '\0';
    r--;
  }
  user = buf;
  return (r == 0);  
}

Here is the caller graph for this function:

static void Arc::get_word ( std::string &  s,
std::string &  word 
) [static]

Definition at line 42 of file GlobusSigningPolicy.cpp.

                                                   {
  std::string::size_type w_s;
  std::string::size_type w_e;
  word.resize(0);
  w_s=s.find_first_not_of(" \t");
  if(w_s == std::string::npos) { s.resize(0); return; };
  if(s[w_s] == '\'') {
    w_e=s.find('\'',++w_s);
  } else if(s[w_s] == '"') {
    w_e=s.find('"',++w_s);
  } else {
    w_e=s.find_first_of(" \t",w_s);
  };
  if(w_e == std::string::npos) w_e=s.length();
  word=s.substr(w_s,w_e-w_s);
  if((s[w_e] == '\'') || (s[w_e] == '"')) ++w_e;
  w_s=s.find_first_not_of(" \t",w_e);
  if(w_s == std::string::npos) w_s=w_e;
  s=s.substr(w_s);
  return;
}

Here is the caller graph for this function:

static int Arc::getdomainname ( char *  name,
int  length 
) [static]

Definition at line 1077 of file VOMSUtil.cpp.

                                                   {
    char      szBuffer[256];
    long      nBufSize = sizeof(szBuffer);
    char      *pBuffer = szBuffer;      

    long result_len = sysinfo( SI_SRPC_DOMAIN, pBuffer, nBufSize );          

    if (result_len > length) {
      return -1;
    }

    memcpy (name, pBuffer, result_len);
    if (result_len < length)
      name[result_len] = '\0';
   
    return 0;
  }

Here is the caller graph for this function:

std::string Arc::GetEnv ( const std::string &  var)

Portable function for getting environment variables.

Definition at line 64 of file Utils.cpp.

                                         {
#ifdef HAVE_GLIBMM_GETENV
    return Glib::getenv(var);
#else
    char val* = getenv(var.c_str());
    return val ? val : "";
#endif
  }

Here is the caller graph for this function:

std::string Arc::GetEnv ( const std::string &  var,
bool &  found 
)

Portable function for getting environment variables.

Definition at line 73 of file Utils.cpp.

                                                      {
#ifdef HAVE_GLIBMM_GETENV
    return Glib::getenv(var, found);
#else
    char val* = getenv(var.c_str());
    found = (val != NULL)
    return val ? val : "";
#endif
  }
static std::string Arc::getfqdn ( void  ) [static]

Definition at line 1096 of file VOMSUtil.cpp.

                                 {
    std::string name;
    char hostname[256];
    char domainname[256];

    if ((!gethostname(hostname, 255)) && (!getdomainname(domainname, 255))) {
      name.append(hostname); 
      if(strcmp(domainname, "(none)")) {
        if (*domainname == '.')
          name.append(domainname);
        else {
          name.append(".").append(domainname);
        }
      }
    }
    return name;
  }

Here is the call graph for this function:

Here is the caller graph for this function:

static void Arc::getLifetime ( STACK_OF(X509)*  certchain,
X509 *  cert,
Time &  start,
Period &  lifetime 
) [static]

Definition at line 190 of file Credential.cpp.

                                                                                                {
    X509* tmp_cert = NULL;
    Time start_time(-1), end_time(-1);
    int n;
    ASN1_UTCTIME* atime = NULL;

    if((cert == NULL) || (certchain == NULL)) {
      start = Time();
      lifetime = Period();
      return;
    }

    for (n = 0; n < sk_X509_num(certchain); n++) {
      tmp_cert = sk_X509_value(certchain, n);

      atime = X509_get_notAfter(tmp_cert);
      Time end = asn1_to_utctime(atime);
      if (end_time == Time(-1) || end < end_time) { end_time = end; }

      atime = X509_get_notBefore(tmp_cert);
      Time start = asn1_to_utctime(atime);
      if (start_time == Time(-1) || start > start_time) { start_time = start; }
    }

    atime = X509_get_notAfter(cert);
    Time e = asn1_to_utctime(atime);
    if (end_time == Time(-1) || e < end_time) { end_time = e; }

    atime = X509_get_notBefore(cert);
    Time s = asn1_to_utctime(atime);
    if (start_time == Time(-1) || s > start_time) { start_time = s; }

    start = start_time;
    lifetime = end_time - start_time;
  }

Here is the call graph for this function:

Here is the caller graph for this function: