skip_unusable (void *dummy, u32 * keyid, PKT_user_id * uid)
{
  int unusable = 0;
  KBNODE keyblock;

  (void) dummy;

  keyblock = get_pubkeyblock (keyid);
  if (!keyblock)
    {
      log_error ("error checking usability status of %s\n", keystr (keyid));
      goto leave;
    }

  /* Is the user ID in question revoked/expired? */
  if (uid)
    {
      KBNODE node;

      for (node = keyblock; node; node = node->next)
	{
	  if (node->pkt->pkttype == PKT_USER_ID)
	    {
	      if (cmp_user_ids (uid, node->pkt->pkt.user_id) == 0
		  && (node->pkt->pkt.user_id->is_revoked
		      || node->pkt->pkt.user_id->is_expired))
		{
		  unusable = 1;
		  break;
		}
	    }
	}
    }

  if (!unusable)
    unusable = pk_is_disabled (keyblock->pkt->pkt.public_key);

leave:
  release_kbnode (keyblock);
  return unusable;
}
skip_unusable (void *dummy, u32 * keyid, PKT_user_id * uid)
{
  int unusable = 0;
  KBNODE keyblock;

  (void) dummy;

  keyblock = get_pubkeyblock (keyid);
  if (!keyblock)
    {
      log_error ("error checking usability status of %s\n", keystr (keyid));
      goto leave;
    }

   
  if (uid)
    {
      KBNODE node;

      for (node = keyblock; node; node = node->next)
	{
	  if (node->pkt->pkttype == PKT_USER_ID)
	    {
	      if (cmp_user_ids (uid, node->pkt->pkt.user_id) == 0
		  && (node->pkt->pkt.user_id->is_revoked
		      || node->pkt->pkt.user_id->is_expired))
		{
		  unusable = 1;
		  break;
		}
	    }
	}
    }

  if (!unusable)
    unusable = pk_is_disabled (keyblock->pkt->pkt.public_key);

leave:
  release_kbnode (keyblock);
  return unusable;
}