Back to index

nordugrid-arc-nox  1.1.0~rc6
Namespaces | Defines | Functions | Variables
VOMSUtil.cpp File Reference
#include <fstream>
#include <glibmm/fileutils.h>
#include <unistd.h>
#include <sys/systeminfo.h>
#include <arc/ArcRegex.h>
#include <arc/Utils.h>
#include <arc/credential/VOMSAttribute.h>
#include <arc/credential/VOMSUtil.h>
#include "listfunc.h"

Go to the source code of this file.

Namespaces

namespace  Arc
 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.

Defines

#define idpkix   "1.3.6.1.5.5.7"
#define idpkcs9   "1.2.840.113549.1.9"
#define idpe   idpkix ".1"
#define idce   "2.5.29"
#define idaca   idpkix ".10"
#define idat   "2.5.4"
#define idpeacauditIdentity   idpe ".4"
#define idcetargetInformation   idce ".55"
#define idceauthKeyIdentifier   idce ".35"
#define idceauthInfoAccess   idpe ".1"
#define idcecRLDistPoints   idce ".31"
#define idcenoRevAvail   idce ".56"
#define idceTargets   idce ".55"
#define idacaauthentInfo   idaca ".1"
#define idacaaccessIdentity   idaca ".2"
#define idacachargIdentity   idaca ".3"
#define idacagroup   idaca ".4"
#define idatclearance   "2.5.1.5.5"
#define voms   "1.3.6.1.4.1.8005.100.100.1"
#define incfile   "1.3.6.1.4.1.8005.100.100.2"
#define vo   "1.3.6.1.4.1.8005.100.100.3"
#define idatcap   "1.3.6.1.4.1.8005.100.100.4"
#define attribs   "1.3.6.1.4.1.8005.100.100.11"
#define acseq   "1.3.6.1.4.1.8005.100.100.5"
#define order   "1.3.6.1.4.1.8005.100.100.6"
#define certseq   "1.3.6.1.4.1.8005.100.100.10"
#define email   idpkcs9 ".1"
#define OBJC(c, n)   OBJ_create(c,n,#c)
#define ERROR(e)   do { err = (e); goto err; } while (0)
#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)

Functions

static time_t timegm (struct tm *tm)
void Arc::InitVOMSAttribute (void)
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)
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.
bool Arc::addVOMSAC (ArcCredential::AC **&aclist, std::string &acorder, std::string &decodedac)
 Add decoded AC string into a list of AC objects.
static int Arc::cb (int ok, X509_STORE_CTX *ctx)
static bool Arc::check_cert (X509 *cert, const std::string &ca_cert_dir, const std::string &ca_cert_file)
static bool Arc::check_cert (STACK_OF(X509)*stack, const std::string &ca_cert_dir, const std::string &ca_cert_file)
static bool Arc::check_sig_ac (X509 *cert, AC *ac)
static bool Arc::regex_match (std::string &label, std::string &value)
static bool Arc::check_trust (const VOMSTrustChain &chain, STACK_OF(X509)*certstack)
static bool Arc::check_trust (const RegularExpression &reg, STACK_OF(X509)*certstack)
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 bool Arc::checkAttributes (STACK_OF(AC_ATTR)*atts, std::vector< std::string > &attributes)
static int Arc::getdomainname (char *name, int length)
static std::string Arc::getfqdn (void)
static bool Arc::interpret_attributes (AC_FULL_ATTRIBUTES *full_attr, std::vector< std::string > &attributes)
static bool Arc::checkExtensions (STACK_OF(X509_EXTENSION)*exts, X509 *iss, std::vector< std::string > &output)
static time_t Arc::ASN1_GENERALIZEDTIME_get (const ASN1_GENERALIZEDTIME *const s)
static bool Arc::check_acinfo (X509 *cert, X509 *issuer, AC *ac, std::vector< std::string > &output, Period &period_left)
static bool Arc::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 Arc::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 Arc::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 * Arc::base64Decode (const char *data, int size, int *j)
static char * Arc::MyDecode (const char *data, int size, int *n)
char * Arc::VOMSDecode (const char *data, int size, int *j)
 Decode the data which is encoded by voms server.
const std::string Arc::get_property (Arc::Credential &u, const std::string property)
 Extract the needed field from the certificate.

Variables

static char Arc::trans2 [128]

Define Documentation

#define acseq   "1.3.6.1.4.1.8005.100.100.5"
#define attribs   "1.3.6.1.4.1.8005.100.100.11"
#define certseq   "1.3.6.1.4.1.8005.100.100.10"
#define email   idpkcs9 ".1"
#define ERROR (   e)    do { err = (e); goto err; } while (0)
#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)
#define idaca   idpkix ".10"
#define idacaaccessIdentity   idaca ".2"
#define idacaauthentInfo   idaca ".1"
#define idacachargIdentity   idaca ".3"
#define idacagroup   idaca ".4"
#define idat   "2.5.4"
#define idatcap   "1.3.6.1.4.1.8005.100.100.4"
#define idatclearance   "2.5.1.5.5"
#define idce   "2.5.29"
#define idceauthInfoAccess   idpe ".1"
#define idceauthKeyIdentifier   idce ".35"
#define idcecRLDistPoints   idce ".31"
#define idcenoRevAvail   idce ".56"
#define idcetargetInformation   idce ".55"
#define idceTargets   idce ".55"
#define idpe   idpkix ".1"
#define idpeacauditIdentity   idpe ".4"
#define idpkcs9   "1.2.840.113549.1.9"
#define idpkix   "1.3.6.1.5.5.7"
#define incfile   "1.3.6.1.4.1.8005.100.100.2"
#define OBJC (   c,
 
)    OBJ_create(c,n,#c)
#define order   "1.3.6.1.4.1.8005.100.100.6"
#define vo   "1.3.6.1.4.1.8005.100.100.3"
#define voms   "1.3.6.1.4.1.8005.100.100.1"

Function Documentation

static time_t timegm ( struct tm *  tm) [static]

Definition at line 39 of file VOMSUtil.cpp.

                                     {
  bool tz_found = false;
  std::string tz = Arc::GetEnv("TZ", tz_found);
  Arc::SetEnv("TZ","UTC");
  tzset();
  tm->tm_isdst = -1;
  time_t ret = mktime(tm);
  if(tz_found) {
    Arc::SetEnv("TZ", tz);
  } else {
    Arc::UnsetEnv("TZ");
  }
  tzset();
  return ret;
}

Here is the call graph for this function: