コード例 #1
0
ファイル: apreq.c プロジェクト: dmr0605/Kerberos
/**
 * shishi_apreq_mutual_required_p:
 * @handle: shishi handle as allocated by shishi_init().
 * @apreq: AP-REQ as allocated by shishi_apreq().
 *
 * Return non-0 iff the "Mutual required" option is set in the AP-REQ.
 *
 * Return value: Returns SHISHI_OK iff successful.
 **/
int
shishi_apreq_mutual_required_p (Shishi * handle, Shishi_asn1 apreq)
{
  uint32_t options = 0;

  shishi_apreq_options (handle, apreq, &options);

  return options & SHISHI_APOPTIONS_MUTUAL_REQUIRED;
}
コード例 #2
0
ファイル: apreq.c プロジェクト: dmr0605/Kerberos
/**
 * shishi_apreq_use_session_key_p:
 * @handle: shishi handle as allocated by shishi_init().
 * @apreq: AP-REQ as allocated by shishi_apreq().
 *
 * Return non-0 iff the "Use session key" option is set in the AP-REQ.
 *
 * Return value: Returns SHISHI_OK iff successful.
 **/
int
shishi_apreq_use_session_key_p (Shishi * handle, Shishi_asn1 apreq)
{
  uint32_t options = 0;

  shishi_apreq_options (handle, apreq, &options);

  return options & SHISHI_APOPTIONS_USE_SESSION_KEY;
}
コード例 #3
0
ファイル: tgs.c プロジェクト: Jactry/shishi
/**
 * shishi_tgs_req_build:
 * @tgs: structure that holds information about TGS exchange
 *
 * Checksum data in authenticator and add ticket and authenticator to
 * TGS-REQ.
 *
 * Return value: Returns SHISHI_OK iff successful.
 **/
int
shishi_tgs_req_build (Shishi_tgs * tgs)
{
  uint32_t apoptions;
  int res;

  if (VERBOSE (tgs->handle))
    printf ("Building TGS-REQ...\n");

  res = shishi_kdcreq_build (tgs->handle, tgs->tgsreq);
  if (res != SHISHI_OK)
    return res;

  res = shishi_apreq_options (tgs->handle, shishi_ap_req (tgs->ap),
			      &apoptions);
  if (res != SHISHI_OK)
    {
      shishi_error_printf (tgs->handle,
			   "Could not get AP-REQ AP-Options: %s\n",
			   shishi_strerror (res));
      return res;
    }

  res = shishi_ap_set_tktoptionsasn1usage
    (tgs->ap, tgs->tgtkt, apoptions, tgs->tgsreq, "req-body",
     SHISHI_KEYUSAGE_TGSREQ_APREQ_AUTHENTICATOR_CKSUM,
     SHISHI_KEYUSAGE_TGSREQ_APREQ_AUTHENTICATOR);
  if (res == SHISHI_OK)
    res = shishi_ap_req_build (tgs->ap);
  if (res != SHISHI_OK)
    {
      shishi_error_printf (tgs->handle, "Could not make AP-REQ: %s\n",
			   shishi_strerror (res));
      return res;
    }


  if (VERBOSE (tgs->handle))
    printf ("Got AP-REQ...\n");

  if (VERBOSEASN1 (tgs->handle))
    shishi_apreq_print (tgs->handle, stdout, shishi_ap_req (tgs->ap));

  res = shishi_kdcreq_add_padata_tgs (tgs->handle, tgs->tgsreq,
				      shishi_ap_req (tgs->ap));
  if (res != SHISHI_OK)
    {
      shishi_error_printf (tgs->handle, "Could not add AP-REQ to TGS: %s\n",
			   shishi_strerror (res));
      return res;
    }

  return SHISHI_OK;
}
コード例 #4
0
ファイル: apreq.c プロジェクト: dmr0605/Kerberos
/**
 * shishi_apreq_options_add:
 * @handle: shishi handle as allocated by shishi_init().
 * @apreq: AP-REQ as allocated by shishi_apreq().
 * @option: Options to add in AP-REQ.
 *
 * Add the AP-Options in AP-REQ.  Options not set in input parameter
 * @option are preserved in the AP-REQ.
 *
 * Return value: Returns SHISHI_OK iff successful.
 **/
int
shishi_apreq_options_add (Shishi * handle, Shishi_asn1 apreq, uint32_t option)
{
  uint32_t options;
  int res;

  res = shishi_apreq_options (handle, apreq, &options);
  if (res != SHISHI_OK)
    return res;

  options |= option;

  res = shishi_apreq_options_set (handle, apreq, options);
  if (res != SHISHI_OK)
    return res;

  return SHISHI_OK;
}
コード例 #5
0
ファイル: apreq.c プロジェクト: dmr0605/Kerberos
/**
 * shishi_apreq_options_remove:
 * @handle: shishi handle as allocated by shishi_init().
 * @apreq: AP-REQ as allocated by shishi_apreq().
 * @option: Options to remove from AP-REQ.
 *
 * Remove the AP-Options from AP-REQ.  Options not set in input
 * parameter @option are preserved in the AP-REQ.
 *
 * Return value: Returns SHISHI_OK iff successful.
 **/
int
shishi_apreq_options_remove (Shishi * handle,
			     Shishi_asn1 apreq, uint32_t option)
{
  uint32_t options;
  int res;

  res = shishi_apreq_options (handle, apreq, &options);
  if (res != SHISHI_OK)
    return res;

  options &= ~(options & option);

  res = shishi_apreq_options_set (handle, apreq, options);
  if (res != SHISHI_OK)
    return res;

  return SHISHI_OK;
}