~ubuntu-branches/ubuntu/precise/nordugrid-arc/precise

« back to all changes in this revision

Viewing changes to src/hed/libs/credential/CertUtil.cpp

  • Committer: Package Import Robot
  • Author(s): Mattias Ellert
  • Date: 2012-03-01 19:48:16 UTC
  • mfrom: (3.1.5 sid)
  • Revision ID: package-import@ubuntu.com-20120301194816-m1ezrwnwt2qgnc2e
Tags: 1.1.1-1
* 1.1.1 Bugfix Release
* Fixes FTBFS (Closes: #661774) (LP: #935007)
* Fix typo in package description (Closes: #646979)
* Split binary rule in debian/rules for arch and indep

Show diffs side-by-side

added added

removed removed

Lines of Context:
91
91
  }
92
92
 
93
93
  //Replace the trusted certificate chain after verification passed, the
94
 
  //trusted ca certificate is added
95
 
  if(*certchain) { sk_X509_pop_free(*certchain, X509_free); }
96
 
  *certchain = sk_X509_new_null();
97
 
 
98
 
  if(store_ctx != NULL) for (i=0; i < sk_X509_num(store_ctx->chain); i++) {
99
 
    X509* tmp = NULL; tmp = X509_dup(sk_X509_value(store_ctx->chain,i));
100
 
    sk_X509_insert(*certchain, tmp, i);
 
94
  //trusted ca certificate is added but top cert is excluded if already
 
95
  //stored separately.
 
96
  if(store_ctx != NULL) {
 
97
    if(*certchain) { sk_X509_pop_free(*certchain, X509_free); }
 
98
    *certchain = sk_X509_new_null();
 
99
    for (i=(cert)?1:0; i < sk_X509_num(store_ctx->chain); i++) {
 
100
      X509* tmp = NULL; tmp = X509_dup(sk_X509_value(store_ctx->chain,i));
 
101
      sk_X509_insert(*certchain, tmp, i);
 
102
    }
101
103
  }
102
104
 
103
105
  retval = 1;
281
283
      return (0);
282
284
    }
283
285
 
 
286
    /* Limited proxy does not mean it can't be followed by unlimited proxy
 
287
       because proxy chain is checked recusrsively according to RFC3820.
 
288
       Unless specific limitation put on proxy means it can't be used
 
289
       for creating another proxy. But for that purpose proxy depth
 
290
       is used.
 
291
       In general it is task of authorization to check ALL proxies in 
 
292
       the chain for valid policies. */
 
293
    /*
284
294
    if(CERT_IS_LIMITED_PROXY(vctx->cert_type) &&
285
295
       !(CERT_IS_LIMITED_PROXY(type) || CERT_IS_INDEPENDENT_PROXY(type))) {
286
296
      logger.msg(Arc::ERROR,"Can't sign a non-limited, non-independent proxy with a limited proxy");
287
297
      store_ctx->error = X509_V_ERR_CERT_SIGNATURE_FAILURE;
288
298
      return (0);
289
299
    }
 
300
    */
290
301
 
291
302
    vctx->proxy_depth++;
292
 
    if(vctx->max_proxy_depth!=-1 && vctx->max_proxy_depth < vctx->proxy_depth) {
 
303
    if((vctx->max_proxy_depth!=-1) &&
 
304
       (vctx->max_proxy_depth < vctx->proxy_depth)) {
293
305
      logger.msg(Arc::ERROR,"The proxy depth %i is out of maximum limit %i",vctx->proxy_depth,vctx->max_proxy_depth);
294
306
      return (0);
295
307
    }
 
308
    // vctx stores previous certificate type
296
309
    vctx->cert_type=type;
297
310
  }
298
311