![]() | ![]() | ![]() | Shishi API Reference Manual |
---|
#define SHISHI_VERSION enum Shishi_name_type; enum Shishi_padata_type; enum Shishi_tr_type; enum Shishi_apoptions; enum Shishi_ticketflags; enum Shishi_KDCOptions; enum Shishi_msgtype; enum Shishi_lrtype; enum Shishi_etype; enum Shishi_cksumtype; enum Shishi_filetype; enum Shishi_keyusage; enum Shishi_tkts_hintflags; typedef Shishi_asn1; Shishi* shishi (void); int shishi_init (Shishi **handle); int shishi_init_with_paths (Shishi **handle, const char *tktsfile, const char *systemcfgfile, const char *usercfgfile); int shishi_init_server (Shishi **handle); int shishi_init_server_with_paths (Shishi **handle, const char *systemcfgfile); void shishi_info (Shishi *handle, const char *fmt, ...); void shishi_warn (Shishi *handle, const char *fmt, ...); void shishi_done (Shishi *handle); int shishi_cfg (Shishi *handle, char *option); int shishi_cfg_from_file (Shishi *handle, const char *cfg); int shishi_cfg_print (Shishi *handle, FILE *fh); const char* shishi_cfg_default_systemfile (Shishi *handle); const char* shishi_cfg_default_userdirectory (Shishi *handle); const char* shishi_cfg_default_userfile (Shishi *handle); int shishi_cfg_clientkdcetype (Shishi *handle, int32_t **etypes); int shishi_cfg_clientkdcetype_set (Shishi *handle, char *value); const char* shishi_strerror (int err); const char* shishi_strerror_details (Shishi *handle); void shishi_error_set (Shishi *handle, const char *error); void shishi_error_printf (Shishi *handle, char *format, ...); void shishi_error_clear (Shishi *handle); char* shishi_realm_default_guess (void); const char* shishi_realm_default (Shishi *handle); void shishi_realm_default_set (Shishi *handle, const char *realm); const char* shishi_realm_for_server_file (Shishi *handle, char *server); const char* shishi_realm_for_server_dns (Shishi *handle, char *server); const char* shishi_realm_for_server (Shishi *handle, char *server); char* shishi_principal_default_guess (void); const char* shishi_principal_default (Shishi *handle); void shishi_principal_default_set (Shishi *handle, const char *principal); int shishi_principal_name_get (Shishi *handle, Shishi_asn1 namenode, const char *namefield, char *out, size_t *outlen); int shishi_principal_name_realm_get (Shishi *handle, Shishi_asn1 namenode, const char *namefield, Shishi_asn1 realmnode, const char *realmfield, char *out, size_t *outlen); int shishi_principal_name_set (Shishi *handle, Shishi_asn1 namenode, const char *namefield, Shishi_name_type name_type, const char *name[]); int shishi_principal_set (Shishi *handle, Shishi_asn1 namenode, const char *namefield, const char *name); int shishi_parse_name (Shishi *handle, const char *name, char **principal, char **realm); char* shishi_server_for_local_service (Shishi *handle, const char *service); int shishi_ticket_sname_get (Shishi *handle, Shishi_asn1 ticket, char *server, size_t *serverlen); int shishi_ticket_sname_set (Shishi *handle, Shishi_asn1 ticket, Shishi_name_type name_type, char *sname[]); int shishi_ticket_snamerealm_get (Shishi *handle, Shishi_asn1 ticket, char *serverrealm, int *serverrealmlen); int shishi_ticket_srealmserver_set (Shishi *handle, Shishi_asn1 ticket, char *realm, char *server); int shishi_ticket_set_server (Shishi *handle, Shishi_asn1 ticket, const char *server); int shishi_ticket_realm_get (Shishi *handle, Shishi_asn1 ticket, char *realm, int *realmlen); int shishi_ticket_realm_set (Shishi *handle, Shishi_asn1 ticket, const char *realm); int shishi_ticket_get_enc_part_etype (Shishi *handle, Shishi_asn1 ticket, int32_t *etype); int shishi_ticket_set_enc_part (Shishi *handle, Shishi_asn1 ticket, int etype, int kvno, char *buf, size_t buflen); int shishi_ticket_add_enc_part (Shishi *handle, Shishi_asn1 ticket, Shishi_key *key, Shishi_asn1 encticketpart); int shishi_enckdcreppart_key_set (Shishi *handle, Shishi_asn1 enckdcreppart, Shishi_key *key); int shishi_ticket_decrypt (Shishi *handle, Shishi_asn1 ticket, Shishi_key *key, Shishi_asn1 *encticketpart); Shishi_asn1 shishi_tkt_ticket (Shishi_tkt *tkt); Shishi_asn1 shishi_tkt_kdcrep (Shishi_tkt *tkt); Shishi_asn1 shishi_tkt_enckdcreppart (Shishi_tkt *tkt); void shishi_tkt_enckdcreppart_set (Shishi_tkt *tkt, Shishi_asn1 enckdcreppart); Shishi_asn1 shishi_tkt_encticketpart (Shishi_tkt *tkt); void shishi_tkt_encticketpart_set (Shishi_tkt *tkt, Shishi_asn1 encticketpart); Shishi_key* shishi_tkt_key (Shishi_tkt *tkt); int shishi_tkt_key_set (Shishi_tkt *tkt, Shishi_key *key); int shishi_tkt (Shishi *handle, Shishi_tkt **tkt); Shishi_tkt* shishi_tkt2 (Shishi *handle, Shishi_asn1 ticket, Shishi_asn1 enckdcreppart, Shishi_asn1 kdcrep); int shishi_tkt_pretty_print (Shishi_tkt *tkt, FILE *fh); int shishi_tkt_realm (Shishi_tkt *tkt, char *realm, int *realmlen); int shishi_tkt_cnamerealm (Shishi_tkt *tkt, char *cnamerealm, int *cnamerealmlen); int shishi_tkt_cnamerealm_p (Shishi_tkt *tkt, const char *client); int shishi_tkt_client (Shishi_tkt *tkt, char *client, int *clientlen); int shishi_tkt_client_p (Shishi_tkt *tkt, const char *client); int shishi_tkt_clientrealm_set (Shishi_tkt *tkt, char *realm, char *client); int shishi_tkt_serverrealm_set (Shishi_tkt *tkt, char *realm, char *server); int shishi_tkt_build (Shishi_tkt *tkt, Shishi_key *key); int shishi_tkt_lastreq (Shishi_tkt *tkt, char *lrtime, int *lrtimelen, int lrtype); time_t shishi_tkt_lastreqc (Shishi_tkt *tkt, Shishi_lrtype lrtype); int shishi_tkt_lastreq_pretty_print (Shishi_tkt *tkt, FILE *fh); int shishi_tkt_authtime (Shishi_tkt *tkt, char *authtime, int *authtimelen); time_t shishi_tkt_authctime (Shishi_tkt *tkt); int shishi_tkt_starttime (Shishi_tkt *tkt, char *starttime, int *starttimelen); time_t shishi_tkt_startctime (Shishi_tkt *tkt); int shishi_tkt_endtime (Shishi_tkt *tkt, char *endtime, int *endtimelen); time_t shishi_tkt_endctime (Shishi_tkt *tkt); int shishi_tkt_renew_till (Shishi_tkt *tkt, char *renewtilltime, int *renewtilllen); time_t shishi_tkt_renew_tillc (Shishi_tkt *tkt); int shishi_tkt_keytype (Shishi_tkt *tkt, int32_t *etype); int shishi_tkt_keytype_p (Shishi_tkt *tkt, int32_t etype); int shishi_tkt_server (Shishi_tkt *tkt, char *service, int *servicelen); int shishi_tkt_server_p (Shishi_tkt *tkt, const char *service); int shishi_tkt_server_realm (Shishi_tkt *tkt, char *serverrealm, int *serverrealmlen); int shishi_tkt_valid_at_time_p (Shishi_tkt *tkt, time_t now); int shishi_tkt_valid_now_p (Shishi_tkt *tkt); int shishi_tkt_decrypt (Shishi_tkt *tkt, Shishi_key *key); void shishi_tkt_done (Shishi_tkt *tkt); int shishi_tkt_flags (Shishi_tkt *tkt, int *flags); int shishi_tkt_flags_set (Shishi_tkt *tkt, int flags); int shishi_tkt_forwardable_p (Shishi_tkt *tkt); int shishi_tkt_forwarded_p (Shishi_tkt *tkt); int shishi_tkt_proxiable_p (Shishi_tkt *tkt); int shishi_tkt_proxy_p (Shishi_tkt *tkt); int shishi_tkt_may_postdate_p (Shishi_tkt *tkt); int shishi_tkt_postdated_p (Shishi_tkt *tkt); int shishi_tkt_invalid_p (Shishi_tkt *tkt); int shishi_tkt_renewable_p (Shishi_tkt *tkt); int shishi_tkt_initial_p (Shishi_tkt *tkt); int shishi_tkt_pre_authent_p (Shishi_tkt *tkt); int shishi_tkt_hw_authent_p (Shishi_tkt *tkt); int shishi_tkt_transited_policy_checked_p (Shishi_tkt *tkt); int shishi_tkt_ok_as_delegate_p (Shishi_tkt *tkt); char* shishi_tkts_default_file_guess (void); const char* shishi_tkts_default_file (Shishi *handle); void shishi_tkts_default_file_set (Shishi *handle, const char *tktsfile); Shishi_tkts* shishi_tkts_default (Shishi *handle); int shishi_tkts_default_to_file (Shishi_tkts *tkts); int shishi_tkts (Shishi *handle, Shishi_tkts **tkts); Shishi_tkt* shishi_tkts_nth (Shishi_tkts *tkts, int ticketno); int shishi_tkts_size (Shishi_tkts *tkts); int shishi_tkts_add (Shishi_tkts *tkts, Shishi_tkt *tkt); int shishi_tkts_new (Shishi_tkts *tkts, Shishi_asn1 ticket, Shishi_asn1 enckdcreppart, Shishi_asn1 kdcrep); int shishi_tkts_remove (Shishi_tkts *tkts, int ticketno); int shishi_tkts_expire (Shishi_tkts *tkts); int shishi_tkts_print_for_service (Shishi_tkts *tkts, FILE *fh, const char *service); int shishi_tkts_print (Shishi_tkts *tkts, FILE *fh); int shishi_tkts_write (Shishi_tkts *tkts, FILE *fh); int shishi_tkts_to_file (Shishi_tkts *tkts, const char *filename); int shishi_tkts_read (Shishi_tkts *tkts, FILE *fh); int shishi_tkts_from_file (Shishi_tkts *tkts, const char *filename); void shishi_tkts_done (Shishi_tkts **tkts); int shishi_tkt_match_p (Shishi_tkt *tkt, Shishi_tkts_hint *hint); Shishi_tkt* shishi_tkts_find (Shishi_tkts *tkts, Shishi_tkts_hint *hint); Shishi_tkt* shishi_tkts_find_for_clientserver (Shishi_tkts *tkts, const char *client, const char *server); Shishi_tkt* shishi_tkts_find_for_server (Shishi_tkts *tkts, const char *server); Shishi_tkt* shishi_tkts_get (Shishi_tkts *tkts, Shishi_tkts_hint *hint); Shishi_tkt* shishi_tkts_get_for_clientserver (Shishi_tkts *tkts, const char *client, const char *server); Shishi_tkt* shishi_tkts_get_for_server (Shishi_tkts *tkts, const char *server); Shishi_tkt* shishi_tkts_get_for_localservicepasswd (Shishi_tkts *tkts, const char *service, const char *passwd); int shishi_enckdcreppart_print (Shishi *handle, FILE *fh, Shishi_asn1 enckdcreppart); int shishi_enckdcreppart_save (Shishi *handle, FILE *fh, Shishi_asn1 enckdcreppart); int shishi_enckdcreppart_parse (Shishi *handle, FILE *fh, Shishi_asn1 *enckdcreppart); int shishi_enckdcreppart_read (Shishi *handle, FILE *fh, Shishi_asn1 *enckdcreppart); int shishi_ticket_save (Shishi *handle, FILE *fh, Shishi_asn1 ticket); int shishi_ticket_print (Shishi *handle, FILE *fh, Shishi_asn1 ticket); int shishi_kdc_req_print (Shishi *handle, FILE *fh, Shishi_asn1 asreq); int shishi_kdc_rep_print (Shishi *handle, FILE *fh, Shishi_asn1 asreq); int shishi_kdc_print (Shishi *handle, FILE *fh, Shishi_asn1 asreq, Shishi_asn1 asrep, Shishi_asn1 encasreppart); int shishi_kdc_req_parse (Shishi *handle, FILE *fh, Shishi_asn1 *asreq); int shishi_kdc_rep_parse (Shishi *handle, FILE *fh, Shishi_asn1 *asrep); int shishi_ticket_parse (Shishi *handle, FILE *fh, Shishi_asn1 *ticket); int shishi_ticket_read (Shishi *handle, FILE *fh, Shishi_asn1 *ticket); Shishi_asn1 shishi_authenticator (Shishi *handle); int shishi_authenticator_set_crealm (Shishi *handle, Shishi_asn1 authenticator, const char *crealm); int shishi_authenticator_set_cname (Shishi *handle, Shishi_asn1 authenticator, Shishi_name_type name_type, const char *cname[]); int shishi_authenticator_client_set (Shishi *handle, Shishi_asn1 authenticator, const char *client); int shishi_authenticator_ctime_get (Shishi *handle, Shishi_asn1 authenticator, char *ctime); int shishi_authenticator_ctime_set (Shishi *handle, Shishi_asn1 authenticator, char *ctime); int shishi_authenticator_cusec_get (Shishi *handle, Shishi_asn1 authenticator, int *cusec); int shishi_authenticator_cusec_set (Shishi *handle, Shishi_asn1 authenticator, int cusec); int shishi_authenticator_cname_get (Shishi *handle, Shishi_asn1 authenticator, char *cname, int *cnamelen); int shishi_authenticator_cnamerealm_get (Shishi *handle, Shishi_asn1 authenticator, char *cnamerealm, int *cnamerealmlen); int shishi_authenticator_remove_cksum (Shishi *handle, Shishi_asn1 authenticator); int shishi_authenticator_cksum (Shishi *handle, Shishi_asn1 authenticator, int32_t *cksumtype, char *cksum, size_t *cksumlen); int shishi_authenticator_set_cksum (Shishi *handle, Shishi_asn1 authenticator, int cksumtype, char *cksum, size_t cksumlen); int shishi_authenticator_add_cksum (Shishi *handle, Shishi_asn1 authenticator, Shishi_key *key, int keyusage, char *data, int datalen); int shishi_authenticator_clear_authorizationdata (Shishi *handle, Shishi_asn1 authenticator); int shishi_authenticator_add_authorizationdata (Shishi *handle, Shishi_asn1 authenticator, int adtype, char *addata, int addatalen); int shishi_authenticator_authorizationdata (Shishi *handle, Shishi_asn1 authenticator, int *adtype, char *addata, int *addatalen, int nth); int shishi_authenticator_read (Shishi *handle, FILE *fh, Shishi_asn1 *authenticator); int shishi_authenticator_parse (Shishi *handle, FILE *fh, Shishi_asn1 *authenticator); int shishi_authenticator_from_file (Shishi *handle, Shishi_asn1 *authenticator, int filetype, char *filename); int shishi_authenticator_print (Shishi *handle, FILE *fh, Shishi_asn1 authenticator); int shishi_authenticator_to_file (Shishi *handle, Shishi_asn1 authenticator, int filetype, char *filename); int shishi_authenticator_save (Shishi *handle, FILE *fh, Shishi_asn1 authenticator); Shishi_asn1 shishi_as_req (Shishi_as *as); int shishi_as_req_build (Shishi_as *as); void shishi_as_req_set (Shishi_as *as, Shishi_asn1 asreq); int shishi_as_req_der (Shishi_as *as, char *out, int *outlen); int shishi_as_req_der_set (Shishi_as *as, char *der, size_t derlen); Shishi_asn1 shishi_as_rep (Shishi_as *as); void shishi_as_rep_set (Shishi_as *as, Shishi_asn1 asrep); int shishi_as_rep_build (Shishi_as *as, Shishi_key *key); int shishi_as_rep_der (Shishi_as *as, char *out, int *outlen); int shishi_as_rep_der_set (Shishi_as *as, char *der, size_t derlen); Shishi_asn1 shishi_as_encasreppart (Shishi_as *as); void shishi_as_encasreppart_set (Shishi_as *as, Shishi_asn1 encasreppart); Shishi_asn1 shishi_as_krberror (Shishi_as *as); int shishi_as_krberror_der (Shishi_as *as, char *out, int *outlen); void shishi_as_krberror_set (Shishi_as *as, Shishi_asn1 krberror); Shishi_tkt* shishi_as_tkt (Shishi_as *as); void shishi_as_tkt_set (Shishi_as *as, Shishi_tkt *tkt); int shishi_as (Shishi *handle, Shishi_as **as); int shishi_as_password_cnamerealmsname (Shishi *handle, char *password, Shishi_as **as, char *cname, char *realm, char *sname); int shishi_as_key_cnamerealmsname (Shishi *handle, Shishi_key *key, Shishi_as **as, char *cname, char *realm, char *sname); int shishi_as_cnamerealmsname (Shishi *handle, char *password, Shishi_key *key, Shishi_as **as, char *cname, char *realm, char *sname); int shishi_as_sendrecv (Shishi_as *as); int shishi_as_rep_process (Shishi_as *as, Shishi_key *key, const char *password); int shishi_tgs (Shishi *handle, Shishi_tgs **tgs); Shishi_tkt* shishi_tgs_tgtkt (Shishi_tgs *tgs); void shishi_tgs_tgtkt_set (Shishi_tgs *tgs, Shishi_tkt *tgtkt); Shishi_ap* shishi_tgs_ap (Shishi_tgs *tgs); Shishi_asn1 shishi_tgs_req (Shishi_tgs *tgs); int shishi_tgs_req_build (Shishi_tgs *tgs); Shishi_asn1 shishi_tgs_rep (Shishi_tgs *tgs); int shishi_tgs_rep_process (Shishi_tgs *tgs); Shishi_asn1 shishi_tgs_krberror (Shishi_tgs *tgs); Shishi_tkt* shishi_tgs_tkt (Shishi_tgs *tgs); void shishi_tgs_tkt_set (Shishi_tgs *tgs, Shishi_tkt *tkt); int shishi_tgs_sendrecv (Shishi_tgs *tgs); int shishi_tgs_set_server (Shishi_tgs *tgs, const char *server); int shishi_tgs_set_realm (Shishi_tgs *tgs, const char *realm); int shishi_tgs_set_realmserver (Shishi_tgs *tgs, const char *realm, const char *server); int shishi_kdcreq (Shishi *handle, char *realm, char *service, Shishi_asn1 *req); Shishi_asn1 shishi_asreq (Shishi *handle); Shishi_asn1 shishi_asreq_rsc (Shishi *handle, char *realm, char *server, char *client); Shishi_asn1 shishi_tgsreq (Shishi *handle); Shishi_asn1 shishi_tgsreq_rst (Shishi *handle, char *realm, char *server, Shishi_tkt *tkt); int shishi_kdcreq_save (Shishi *handle, FILE *fh, Shishi_asn1 kdcreq); int shishi_kdcreq_print (Shishi *handle, FILE *fh, Shishi_asn1 kdcreq); int shishi_kdcreq_to_file (Shishi *handle, Shishi_asn1 kdcreq, int filetype, char *filename); int shishi_kdcreq_parse (Shishi *handle, FILE *fh, Shishi_asn1 *kdcreq); int shishi_kdcreq_read (Shishi *handle, FILE *fh, Shishi_asn1 *kdcreq); int shishi_kdcreq_from_file (Shishi *handle, Shishi_asn1 *kdcreq, int filetype, char *filename); int shishi_asreq_cnamerealm_get (Shishi *handle, Shishi_asn1 kdcreq, char *cnamerealm, size_t *cnamerealmlen); int shishi_kdcreq_nonce (Shishi *handle, Shishi_asn1 kdcreq, uint32_t *nonce); int shishi_kdcreq_cname_get (Shishi *handle, Shishi_asn1 kdcreq, char *cname, size_t *cnamelen); int shishi_kdcreq_set_cname (Shishi *handle, Shishi_asn1 kdcreq, Shishi_name_type name_type, const char *principal); int shishi_kdcreq_sname_get (Shishi *handle, Shishi_asn1 kdcreq, char *sname, size_t *snamelen); int shishi_kdcreq_snamerealm_get (Shishi *handle, Shishi_asn1 kdcreq, char *snamerealm, size_t *snamerealmlen); int shishi_kdcreq_set_sname (Shishi *handle, Shishi_asn1 kdcreq, Shishi_name_type name_type, const char *sname[]); int shishi_kdcreq_realm_get (Shishi *handle, Shishi_asn1 kdcreq, char *realm, int *realmlen); int shishi_kdcreq_set_realm (Shishi *handle, Shishi_asn1 kdcreq, const char *realm); int shishi_kdcreq_set_server (Shishi *handle, Shishi_asn1 req, const char *service); int shishi_kdcreq_set_realmserver (Shishi *handle, Shishi_asn1 req, char *realm, char *service); int shishi_kdcreq_etype (Shishi *handle, Shishi_asn1 kdcreq, int32_t *etype, int netype); int shishi_kdcreq_set_etype (Shishi *handle, Shishi_asn1 kdcreq, int32_t *etype, int netype); int shishi_kdcreq_options (Shishi *handle, Shishi_asn1 kdcreq, int *flags); int shishi_kdcreq_renewable_p (Shishi *handle, Shishi_asn1 kdcreq); int shishi_kdcreq_options_set (Shishi *handle, Shishi_asn1 kdcreq, int options); int shishi_kdcreq_options_add (Shishi *handle, Shishi_asn1 kdcreq, int option); int shishi_kdcreq_clear_padata (Shishi *handle, Shishi_asn1 kdcreq); int shishi_kdcreq_add_padata (Shishi *handle, Shishi_asn1 kdcreq, int padatatype, char *data, int datalen); int shishi_kdcreq_add_padata_tgs (Shishi *handle, Shishi_asn1 kdcreq, Shishi_asn1 apreq); int shishi_kdcreq_build (Shishi *handle, Shishi_asn1 kdcreq); Shishi_asn1 shishi_enckdcreppart (Shishi *handle); Shishi_asn1 shishi_encasreppart (Shishi *handle); int shishi_enckdcreppart_srealmserver_set (Shishi *handle, Shishi_asn1 enckdcreppart, const char *srealm, const char *server); int shishi_enckdcreppart_nonce_set (Shishi *handle, Shishi_asn1 enckdcreppart, uint32_t nonce); int shishi_enckdcreppart_populate_encticketpart (Shishi *handle, Shishi_asn1 enckdcreppart, Shishi_asn1 encticketpart); int shishi_enckdcreppart_flags_set (Shishi *handle, Shishi_asn1 enckdcreppart, int flags); int shishi_as_derive_salt (Shishi *handle, Shishi_asn1 asreq, Shishi_asn1 asrep, char *salt, size_t *saltlen); int shishi_tgs_process (Shishi *handle, Shishi_asn1 tgsreq, Shishi_asn1 tgsrep, Shishi_asn1 oldenckdcreppart, Shishi_asn1 *enckdcreppart); int shishi_as_process (Shishi *handle, Shishi_asn1 asreq, Shishi_asn1 asrep, const char *string, Shishi_asn1 *enckdcreppart); int shishi_kdc_process (Shishi *handle, Shishi_asn1 kdcreq, Shishi_asn1 kdcrep, Shishi_key *key, int keyusage, Shishi_asn1 *enckdcreppart); int shishi_kdcreq_sendrecv (Shishi *handle, Shishi_asn1 kdcreq, Shishi_asn1 *kdcrep); int shishi_kdc_copy_crealm (Shishi *handle, Shishi_asn1 kdcrep, Shishi_asn1 encticketpart); int shishi_as_check_crealm (Shishi *handle, Shishi_asn1 asreq, Shishi_asn1 asrep); int shishi_kdc_copy_cname (Shishi *handle, Shishi_asn1 kdcrep, Shishi_asn1 encticketpart); int shishi_as_check_cname (Shishi *handle, Shishi_asn1 asreq, Shishi_asn1 asrep); int shishi_kdc_copy_nonce (Shishi *handle, Shishi_asn1 kdcreq, Shishi_asn1 enckdcreppart); int shishi_kdc_check_nonce (Shishi *handle, Shishi_asn1 kdcreq, Shishi_asn1 enckdcreppart); Shishi_asn1 shishi_asrep (Shishi *handle); Shishi_asn1 shishi_tgsrep (Shishi *handle); int shishi_kdcrep_save (Shishi *handle, FILE *fh, Shishi_asn1 kdcrep); int shishi_kdcrep_print (Shishi *handle, FILE *fh, Shishi_asn1 kdcrep); int shishi_kdcrep_to_file (Shishi *handle, Shishi_asn1 kdcrep, int filetype, char *filename); int shishi_kdcrep_parse (Shishi *handle, FILE *fh, Shishi_asn1 *kdcrep); int shishi_kdcrep_read (Shishi *handle, FILE *fh, Shishi_asn1 *kdcrep); int shishi_kdcrep_from_file (Shishi *handle, Shishi_asn1 *kdcrep, int filetype, char *filename); int shishi_kdcrep_clear_padata (Shishi *handle, Shishi_asn1 kdcrep); int shishi_kdcrep_get_enc_part_etype (Shishi *handle, Shishi_asn1 kdcrep, int32_t *etype); int shishi_kdcrep_add_enc_part (Shishi *handle, Shishi_asn1 kdcrep, Shishi_key *key, int keyusage, Shishi_asn1 enckdcreppart); int shishi_kdcrep_get_ticket (Shishi *handle, Shishi_asn1 kdcrep, Shishi_asn1 *ticket); int shishi_kdcrep_set_ticket (Shishi *handle, Shishi_asn1 kdcrep, Shishi_asn1 ticket); int shishi_kdcrep_crealm_set (Shishi *handle, Shishi_asn1 kdcrep, const char *crealm); int shishi_kdcrep_cname_set (Shishi *handle, Shishi_asn1 kdcrep, Shishi_name_type name_type, const char *cname[]); int shishi_kdcrep_client_set (Shishi *handle, Shishi_asn1 kdcrep, const char *client); int shishi_kdcrep_crealmserver_set (Shishi *handle, Shishi_asn1 kdcrep, const char *crealm, const char *client); int shishi_kdcrep_set_enc_part (Shishi *handle, Shishi_asn1 kdcrep, int etype, int kvno, char *buf, int buflen); Shishi_asn1 shishi_krberror (Shishi *handle); int shishi_krberror_print (Shishi *handle, FILE *fh, Shishi_asn1 krberror); int shishi_krberror_save (Shishi *handle, FILE *fh, Shishi_asn1 krberror); int shishi_krberror_to_file (Shishi *handle, Shishi_asn1 krberror, int filetype, char *filename); int shishi_krberror_parse (Shishi *handle, FILE *fh, Shishi_asn1 *krberror); int shishi_krberror_read (Shishi *handle, FILE *fh, Shishi_asn1 *krberror); int shishi_krberror_from_file (Shishi *handle, Shishi_asn1 *krberror, int filetype, char *filename); const char* shishi_krberror_errorcode_message (Shishi *handle, int errorcode); const char* shishi_krberror_message (Shishi *handle, Shishi_asn1 krberror); int shishi_krberror_etext (Shishi *handle, Shishi_asn1 krberror, char *etext, size_t *etextlen); int shishi_krberror_errorcode (Shishi *handle, Shishi_asn1 krberror, int *errorcode); int shishi_krberror_errorcode_fast (Shishi *handle, Shishi_asn1 krberror); int shishi_krberror_pretty_print (Shishi *handle, FILE *fh, Shishi_asn1 krberror); void shishi_to_base64 (unsigned char *out, unsigned char *in, int len, int olen); int shishi_from_base64 (unsigned char *out, unsigned char *in); int shishi_asprintf (char **result, char *format, ...); const char* shishi_generalize_time (Shishi *handle, time_t t); time_t shishi_generalize_ctime (Shishi *handle, const char *t); int shishi_cipher_supported_p (int type); const char* shishi_cipher_name (int type); int shishi_cipher_blocksize (int type); int shishi_cipher_minpadsize (int type); int shishi_cipher_confoundersize (int type); size_t shishi_cipher_keylen (int type); size_t shishi_cipher_randomlen (int type); int shishi_cipher_defaultcksumtype (int32_t type); int shishi_cipher_parse (const char *cipher); int shishi_checksum_supported_p (int32_t type); const char* shishi_checksum_name (int32_t type); size_t shishi_checksum_cksumlen (int32_t type); int shishi_checksum_parse (const char *checksum); int shishi_string_to_key (Shishi *handle, int32_t keytype, const char *password, size_t passwordlen, const char *salt, size_t saltlen, const char *parameter, Shishi_key *outkey); int shishi_random_to_key (Shishi *handle, int32_t keytype, char *random, size_t randomlen, Shishi_key *outkey); int shishi_encrypt (Shishi *handle, Shishi_key *key, int keyusage, char *in, size_t inlen, char **out, size_t *outlen); int shishi_encrypt_iv (Shishi *handle, Shishi_key *key, int keyusage, char *iv, size_t ivlen, char *in, size_t inlen, char **out, size_t *outlen); int shishi_encrypt_iv_etype (Shishi *handle, Shishi_key *key, int keyusage, int32_t etype, char *iv, size_t ivlen, char *in, size_t inlen, char **out, size_t *outlen); int shishi_decrypt (Shishi *handle, Shishi_key *key, int keyusage, char *in, size_t inlen, char **out, size_t *outlen); int shishi_decrypt_iv (Shishi *handle, Shishi_key *key, int keyusage, char *iv, size_t ivlen, char *in, size_t inlen, char **out, size_t *outlen); int shishi_decrypt_iv_etype (Shishi *handle, Shishi_key *key, int keyusage, int32_t etype, char *iv, size_t ivlen, char *in, size_t inlen, char **out, size_t *outlen); int shishi_checksum (Shishi *handle, Shishi_key *key, int keyusage, int32_t cksumtype, char *in, size_t inlen, char **out, size_t *outlen); int shishi_randomize (Shishi *handle, char *data, size_t datalen); int shishi_dk (Shishi *handle, Shishi_key *key, char *constant, int constantlen, Shishi_key *derivedkey); int shishi_dr (Shishi *handle, Shishi_key *key, char *constant, size_t constantlen, char *derivedrandom, size_t derivedrandomlen); int shishi_n_fold (Shishi *handle, char *in, size_t inlen, char *out, size_t outlen); int shishi_pbkdf2_sha1 (const char *P, size_t Plen, const char *S, size_t Slen, unsigned int c, unsigned int dkLen, char *DK); const char* shishi_check_version (const char *req_version); int shishi_read_password (FILE *fh, char *s, int size); int shishi_prompt_password_raw (FILE *in, char *s, int size, FILE *out, char *format, ...); int shishi_prompt_password (Shishi *handle, FILE *in, char *s, int size, FILE *out, char *format, ...); int shishi_a2d_field (Shishi *handle, Shishi_asn1 node, const char *field, char *der, int *len); int shishi_a2d (Shishi *handle, Shishi_asn1 node, char *der, int *len); int shishi_a2d_new_field (Shishi *handle, Shishi_asn1 node, const char *field, char **der, int *len); int shishi_new_a2d (Shishi *handle, Shishi_asn1 node, char **der, int *len); int shishi_asn1_done (Shishi *handle, Shishi_asn1 node); int shishi_asn1_read (Shishi *handle, Shishi_asn1 node, const char *field, char *data, size_t *datalen); int shishi_asn1_read2 (Shishi *handle, Shishi_asn1 node, const char *field, char **data, size_t *datalen); int shishi_asn1_read_integer (Shishi *handle, Shishi_asn1 node, const char *field, int *i); int shishi_asn1_read_int32 (Shishi *handle, Shishi_asn1 node, const char *field, int32_t *i); int shishi_asn1_read_uint32 (Shishi *handle, Shishi_asn1 node, const char *field, uint32_t *i); int shishi_asn1_read_bitstring (Shishi *handle, Shishi_asn1 node, const char *field, int *flags); int shishi_asn1_read_optional (Shishi *handle, Shishi_asn1 node, const char *field, char *data, size_t *datalen); int shishi_asn1_read_empty_p (Shishi *handle, Shishi_asn1 node, const char *field); int shishi_asn1_write (Shishi *handle, Shishi_asn1 node, const char *field, const char *data, size_t datalen); int shishi_asn1_write_integer (Shishi *handle, Shishi_asn1 node, const char *field, int n); int shishi_asn1_write_int32 (Shishi *handle, Shishi_asn1 node, const char *field, int32_t n); int shishi_asn1_write_uint32 (Shishi *handle, Shishi_asn1 node, const char *field, uint32_t n); int shishi_asn1_write_bitstring (Shishi *handle, Shishi_asn1 node, const char *field, int flags); int shishi_asn1_number_of_elements (Shishi *handle, Shishi_asn1 node, const char *field, int *n); Shishi_asn1 shishi_asn1_asreq (Shishi *handle); Shishi_asn1 shishi_asn1_asrep (Shishi *handle); Shishi_asn1 shishi_asn1_tgsreq (Shishi *handle); Shishi_asn1 shishi_asn1_tgsrep (Shishi *handle); Shishi_asn1 shishi_asn1_apreq (Shishi *handle); Shishi_asn1 shishi_asn1_aprep (Shishi *handle); Shishi_asn1 shishi_asn1_ticket (Shishi *handle); Shishi_asn1 shishi_asn1_encapreppart (Shishi *handle); Shishi_asn1 shishi_asn1_encticketpart (Shishi *handle); Shishi_asn1 shishi_asn1_authenticator (Shishi *handle); Shishi_asn1 shishi_asn1_enckdcreppart (Shishi *handle); Shishi_asn1 shishi_asn1_encasreppart (Shishi *handle); Shishi_asn1 shishi_asn1_krberror (Shishi *handle); Shishi_asn1 shishi_asn1_krbsafe (Shishi *handle); Shishi_asn1 shishi_der2asn1 (Shishi *handle, const char *fieldname, const char *nodename, const char *der, size_t derlen); Shishi_asn1 shishi_der2asn1_ticket (Shishi *handle, const char *der, size_t derlen); Shishi_asn1 shishi_der2asn1_encticketpart (Shishi *handle, const char *der, size_t derlen); Shishi_asn1 shishi_der2asn1_asreq (Shishi *handle, const char *der, size_t derlen); Shishi_asn1 shishi_der2asn1_tgsreq (Shishi *handle, const char *der, size_t derlen); Shishi_asn1 shishi_der2asn1_asrep (Shishi *handle, const char *der, size_t derlen); Shishi_asn1 shishi_der2asn1_tgsrep (Shishi *handle, const char *der, size_t derlen); Shishi_asn1 shishi_der2asn1_kdcrep (Shishi *handle, const char *der, size_t derlen); Shishi_asn1 shishi_der2asn1_kdcreq (Shishi *handle, const char *der, size_t derlen); Shishi_asn1 shishi_der2asn1_encasreppart (Shishi *handle, const char *der, size_t derlen); Shishi_asn1 shishi_der2asn1_enctgsreppart (Shishi *handle, const char *der, size_t derlen); Shishi_asn1 shishi_der2asn1_enckdcreppart (Shishi *handle, const char *der, size_t derlen); Shishi_asn1 shishi_der2asn1_authenticator (Shishi *handle, const char *der, size_t derlen); Shishi_asn1 shishi_der2asn1_krberror (Shishi *handle, const char *der, size_t derlen); Shishi_asn1 shishi_der2asn1_krbsafe (Shishi *handle, const char *der, size_t derlen); Shishi_asn1 shishi_der2asn1_apreq (Shishi *handle, const char *der, size_t derlen); Shishi_asn1 shishi_der2asn1_aprep (Shishi *handle, const char *der, size_t derlen); Shishi_asn1 shishi_der2asn1_encapreppart (Shishi *handle, const char *der, size_t derlen); const char* shishi_ap_option2string (int option); int shishi_ap_string2option (const char *str); int shishi_ap (Shishi *handle, Shishi_ap **ap); int shishi_ap_set_tktoptions (Shishi_ap *ap, Shishi_tkt *tkt, int options); int shishi_ap_tktoptions (Shishi *handle, Shishi_ap **ap, Shishi_tkt *tkt, int options); int shishi_ap_set_tktoptionsdata (Shishi_ap *ap, Shishi_tkt *tkt, int options, char *data, int len); int shishi_ap_tktoptionsdata (Shishi *handle, Shishi_ap **ap, Shishi_tkt *tkt, int options, char *data, int len); int shishi_ap_set_tktoptionsasn1usage (Shishi_ap *ap, Shishi_tkt *tkt, int options, Shishi_asn1 node, char *field, int authenticatorcksumkeyusage, int authenticatorkeyusage); int shishi_ap_tktoptionsasn1usage (Shishi *handle, Shishi_ap **ap, Shishi_tkt *tkt, int options, Shishi_asn1 node, char *field, int authenticatorcksumkeyusage, int authenticatorkeyusage); Shishi_tkt* shishi_ap_tkt (Shishi_ap *ap); void shishi_ap_tkt_set (Shishi_ap *ap, Shishi_tkt *tkt); int shishi_ap_authenticator_cksumdata (Shishi_ap *ap, char *out, int *len); void shishi_ap_authenticator_cksumdata_set (Shishi_ap *ap, char *authenticatorcksumdata, int authenticatorcksumdatalen); Shishi_asn1 shishi_ap_authenticator (Shishi_ap *ap); void shishi_ap_authenticator_set (Shishi_ap *ap, Shishi_asn1 authenticator); Shishi_asn1 shishi_ap_req (Shishi_ap *ap); void shishi_ap_req_set (Shishi_ap *ap, Shishi_asn1 apreq); int shishi_ap_req_der (Shishi_ap *ap, char *out, int *outlen); int shishi_ap_req_der_set (Shishi_ap *ap, char *der, size_t derlen); int shishi_ap_req_der_new (Shishi_ap *ap, char **out, int *outlen); int shishi_ap_req_build (Shishi_ap *ap); int shishi_ap_req_asn1 (Shishi_ap *ap, Shishi_asn1 *apreq); int shishi_ap_req_process (Shishi_ap *ap, Shishi_key *key); Shishi_asn1 shishi_ap_rep (Shishi_ap *ap); void shishi_ap_rep_set (Shishi_ap *ap, Shishi_asn1 aprep); int shishi_ap_rep_der (Shishi_ap *ap, char *out, size_t *outlen); int shishi_ap_rep_der_set (Shishi_ap *ap, char *der, size_t derlen); int shishi_ap_rep_verify (Shishi_ap *ap); int shishi_ap_rep_verify_der (Shishi_ap *ap, char *der, size_t derlen); int shishi_ap_rep_verify_asn1 (Shishi_ap *ap, Shishi_asn1 aprep); int shishi_ap_rep_asn1 (Shishi_ap *ap, Shishi_asn1 *aprep); int shishi_ap_rep_build (Shishi_ap *ap); Shishi_asn1 shishi_ap_encapreppart (Shishi_ap *ap); void shishi_ap_encapreppart_set (Shishi_ap *ap, Shishi_asn1 encapreppart); const char* shishi_key_principal (Shishi_key *key); void shishi_key_principal_set (Shishi_key *key, const char *principal); const char* shishi_key_realm (Shishi_key *key); void shishi_key_realm_set (Shishi_key *key, const char *realm); int shishi_key_type (Shishi_key *key); void shishi_key_type_set (Shishi_key *key, int32_t type); char* shishi_key_value (Shishi_key *key); void shishi_key_value_set (Shishi_key *key, const char *value); int shishi_key_value_set_random (Shishi_key *key, char *random, size_t randomlen); const char* shishi_key_name (Shishi_key *key); size_t shishi_key_length (Shishi_key *key); int shishi_key_version (Shishi_key *key); void shishi_key_version_set (Shishi_key *key, int version); int shishi_key (Shishi *handle, Shishi_key **key); void shishi_key_done (Shishi_key **key); void shishi_key_copy (Shishi_key *dstkey, Shishi_key *srckey); int shishi_key_print (Shishi *handle, FILE *fh, Shishi_key *key); int shishi_key_to_file (Shishi *handle, const char *filename, Shishi_key *key); int shishi_key_parse (Shishi *handle, FILE *fh, Shishi_key **key); int shishi_key_random (Shishi *handle, int32_t type, Shishi_key **key); int shishi_key_from_value (Shishi *handle, int32_t type, char *value, Shishi_key **key); int shishi_key_from_base64 (Shishi *handle, int32_t type, char *value, Shishi_key **key); int shishi_key_from_random (Shishi *handle, int32_t type, char *random, size_t randomlen, Shishi_key **outkey); int shishi_key_from_string (Shishi *handle, int32_t type, const char *password, size_t passwordlen, const char *salt, size_t saltlen, const char *parameter, Shishi_key **outkey); Shishi_key* shishi_keys_for_serverrealm_in_file (Shishi *handle, const char *filename, const char *server, const char *realm); Shishi_key* shishi_keys_for_server_in_file (Shishi *handle, const char *filename, const char *server); Shishi_key* shishi_keys_for_localservicerealm_in_file (Shishi *handle, const char *filename, const char *service, const char *realm); const char* shishi_hostkeys_default_file (Shishi *handle); void shishi_hostkeys_default_file_set (Shishi *handle, const char *hostkeysfile); Shishi_key* shishi_hostkeys_for_server (Shishi *handle, const char *server); Shishi_key* shishi_hostkeys_for_serverrealm (Shishi *handle, const char *server, const char *realm); Shishi_key* shishi_hostkeys_for_localservicerealm (Shishi *handle, const char *service, const char *realm); Shishi_key* shishi_hostkeys_for_localservice (Shishi *handle, const char *service); Shishi_asn1 shishi_encapreppart (Shishi *handle); int shishi_encapreppart_time_copy (Shishi *handle, Shishi_asn1 encapreppart, Shishi_asn1 authenticator); int shishi_encapreppart_ctime_get (Shishi *handle, Shishi_asn1 encapreppart, char *ctime); int shishi_encapreppart_ctime_set (Shishi *handle, Shishi_asn1 encapreppart, char *ctime); int shishi_encapreppart_cusec_get (Shishi *handle, Shishi_asn1 encapreppart, int *cusec); int shishi_encapreppart_cusec_set (Shishi *handle, Shishi_asn1 encapreppart, int cusec); int shishi_encapreppart_print (Shishi *handle, FILE *fh, Shishi_asn1 encapreppart); int shishi_encapreppart_save (Shishi *handle, FILE *fh, Shishi_asn1 encapreppart); int shishi_encapreppart_to_file (Shishi *handle, Shishi_asn1 encapreppart, int filetype, char *filename); int shishi_encapreppart_read (Shishi *handle, FILE *fh, Shishi_asn1 *encapreppart); int shishi_encapreppart_parse (Shishi *handle, FILE *fh, Shishi_asn1 *encapreppart); int shishi_encapreppart_from_file (Shishi *handle, Shishi_asn1 *encapreppart, int filetype, char *filename); int shishi_encapreppart_get_key (Shishi *handle, Shishi_asn1 encapreppart, int32_t *keytype, char *keyvalue, size_t *keyvalue_len); int shishi_encapreppart_seqnumber_get (Shishi *handle, Shishi_asn1 encapreppart, uint32_t *seqnumber); Shishi_asn1 shishi_apreq (Shishi *handle); int shishi_apreq_parse (Shishi *handle, FILE *fh, Shishi_asn1 *apreq); int shishi_apreq_from_file (Shishi *handle, Shishi_asn1 *apreq, int filetype, char *filename); int shishi_apreq_print (Shishi *handle, FILE *fh, Shishi_asn1 apreq); int shishi_apreq_to_file (Shishi *handle, Shishi_asn1 apreq, int filetype, char *filename); int shishi_apreq_read (Shishi *handle, FILE *fh, Shishi_asn1 *apreq); int shishi_apreq_save (Shishi *handle, FILE *fh, Shishi_asn1 apreq); int shishi_apreq_options (Shishi *handle, Shishi_asn1 apreq, int *flags); int shishi_apreq_options_set (Shishi *handle, Shishi_asn1 apreq, int options); int shishi_apreq_set_ticket (Shishi *handle, Shishi_asn1 apreq, Shishi_asn1 ticket); int shishi_apreq_set_authenticator (Shishi *handle, Shishi_asn1 apreq, int32_t etype, char *buf, int buflen); int shishi_apreq_add_authenticator (Shishi *handle, Shishi_asn1 apreq, Shishi_key *key, int keyusage, Shishi_asn1 authenticator); int shishi_apreq_use_session_key_p (Shishi *handle, Shishi_asn1 apreq); int shishi_apreq_mutual_required_p (Shishi *handle, Shishi_asn1 apreq); int shishi_apreq_options_add (Shishi *handle, Shishi_asn1 apreq, int option); int shishi_apreq_get_ticket (Shishi *handle, Shishi_asn1 apreq, Shishi_asn1 *ticket); int shishi_apreq_get_authenticator_etype (Shishi *handle, Shishi_asn1 apreq, int32_t *etype); int shishi_apreq_decrypt (Shishi *handle, Shishi_asn1 apreq, Shishi_key *key, int keyusage, Shishi_asn1 *authenticator); int shishi_kdcrep_decrypt (Shishi *handle, Shishi_asn1 kdcrep, Shishi_key *key, int keyusage, Shishi_asn1 *enckdcreppart); int shishi_enckdcreppart_get_key (Shishi *handle, Shishi_asn1 enckdcreppart, Shishi_key **key); int shishi_enckdcreppart_srealm_set (Shishi *handle, Shishi_asn1 enckdcreppart, const char *srealm); int shishi_enckdcreppart_sname_set (Shishi *handle, Shishi_asn1 enckdcreppart, Shishi_name_type name_type, char *sname[]); int shishi_enckdcreppart_server_set (Shishi *handle, Shishi_asn1 enckdcreppart, const char *server); Shishi_asn1 shishi_aprep (Shishi *handle); int shishi_aprep_print (Shishi *handle, FILE *fh, Shishi_asn1 aprep); int shishi_aprep_save (Shishi *handle, FILE *fh, Shishi_asn1 aprep); int shishi_aprep_to_file (Shishi *handle, Shishi_asn1 aprep, int filetype, char *filename); int shishi_aprep_read (Shishi *handle, FILE *fh, Shishi_asn1 *aprep); int shishi_aprep_parse (Shishi *handle, FILE *fh, Shishi_asn1 *aprep); int shishi_aprep_from_file (Shishi *handle, Shishi_asn1 *aprep, int filetype, char *filename); int shishi_aprep_decrypt (Shishi *handle, Shishi_asn1 aprep, Shishi_key *key, int keyusage, Shishi_asn1 *encapreppart); int shishi_aprep_verify (Shishi *handle, Shishi_asn1 authenticator, Shishi_asn1 encapreppart); int shishi_aprep_enc_part_set (Shishi *handle, Shishi_asn1 aprep, int etype, const char *buf, int buflen); int shishi_aprep_enc_part_add (Shishi *handle, Shishi_asn1 aprep, Shishi_asn1 encticketpart, Shishi_asn1 encapreppart); int shishi_aprep_enc_part_make (Shishi *handle, Shishi_asn1 aprep, Shishi_asn1 authenticator, Shishi_asn1 encticketpart); int shishi_aprep_get_enc_part_etype (Shishi *handle, Shishi_asn1 aprep, int32_t *etype); int shishi_kdc_sendrecv (Shishi *handle, char *realm, const char *indata, size_t inlen, char **outdata, size_t *outlen); Shishi_asn1 shishi_encticketpart (Shishi *handle); int shishi_encticketpart_key_set (Shishi *handle, Shishi_asn1 encticketpart, Shishi_key *key); int shishi_encticketpart_get_enc_part_etype (Shishi *handle, Shishi_asn1 encticketpart, int32_t *etype); int shishi_encticketpart_get_key (Shishi *handle, Shishi_asn1 encticketpart, Shishi_key **key); int shishi_encticketpart_crealm_set (Shishi *handle, Shishi_asn1 encticketpart, const char *realm); int shishi_encticketpart_cname_get (Shishi *handle, Shishi_asn1 encticketpart, char *cname, int *cnamelen); int shishi_encticketpart_cname_set (Shishi *handle, Shishi_asn1 encticketpart, Shishi_name_type name_type, const char *principal); int shishi_encticketpart_cnamerealm_get (Shishi *handle, Shishi_asn1 encticketpart, char *cnamerealm, int *cnamerealmlen); int shishi_encticketpart_print (Shishi *handle, FILE *fh, Shishi_asn1 encticketpart); int shishi_encticketpart_flags_set (Shishi *handle, Shishi_asn1 encticketpart, int flags); int shishi_encticketpart_transited_set (Shishi *handle, Shishi_asn1 encticketpart, int trtype, char *trdata, size_t trdatalen); int shishi_encticketpart_authtime_set (Shishi *handle, Shishi_asn1 encticketpart, const char *authtime); int shishi_encticketpart_endtime_set (Shishi *handle, Shishi_asn1 encticketpart, const char *endtime); int shishi_encticketpart_authtime (Shishi *handle, Shishi_asn1 encticketpart, char *authtime, int *authtimelen); time_t shishi_encticketpart_authctime (Shishi *handle, Shishi_asn1 encticketpart); int shishi_safe (Shishi *handle, Shishi_safe **safe); Shishi_key* shishi_safe_key (Shishi_safe *safe); void shishi_safe_key_set (Shishi_safe *safe, Shishi_key *key); Shishi_asn1 shishi_safe_safe (Shishi_safe *safe); void shishi_safe_safe_set (Shishi_safe *safe, Shishi_asn1 asn1safe); int shishi_safe_safe_der (Shishi_safe *safe, char *out, int *outlen); int shishi_safe_safe_der_set (Shishi_safe *safe, char *der, size_t derlen); int shishi_safe_print (Shishi *handle, FILE *fh, Shishi_asn1 safe); int shishi_safe_save (Shishi *handle, FILE *fh, Shishi_asn1 safe); int shishi_safe_to_file (Shishi *handle, Shishi_asn1 safe, int filetype, char *filename); int shishi_safe_parse (Shishi *handle, FILE *fh, Shishi_asn1 *safe); int shishi_safe_read (Shishi *handle, FILE *fh, Shishi_asn1 *safe); int shishi_safe_from_file (Shishi *handle, Shishi_asn1 *safe, int filetype, char *filename); int shishi_safe_cksum (Shishi *handle, Shishi_asn1 safe, int32_t *cksumtype, char *cksum, size_t *cksumlen); int shishi_safe_set_cksum (Shishi *handle, Shishi_asn1 safe, int32_t cksumtype, char *cksum, size_t cksumlen); int shishi_safe_user_data (Shishi *handle, Shishi_asn1 safe, char *userdata, size_t *userdatalen); int shishi_safe_set_user_data (Shishi *handle, Shishi_asn1 safe, char *userdata, size_t userdatalen); int shishi_safe_build (Shishi_safe *safe, Shishi_key *key); int shishi_safe_verify (Shishi_safe *safe, Shishi_key *key);
typedef enum { SHISHI_NT_UNKNOWN = 0, /* Name type not known */ SHISHI_NT_PRINCIPAL, /* Just the name of the principal as in */ /* DCE, or for users */ SHISHI_NT_SRV_INST, /* Service and other unique instance (krbtgt) */ SHISHI_NT_SRV_HST, /* Service with host name as instance */ /* (telnet, rcommands) */ SHISHI_NT_SRV_XHST, /* Service with host as remaining components */ SHISHI_NT_UID /* Unique ID */ } Shishi_name_type;
typedef enum { SHISHI_PA_TGS_REQ = 1, /* padata is APREQ */ SHISHI_PA_ENC_TIMESTAMP, /* timestamp pre authentication */ SHISHI_PA_PW_SALT, /* salt for string-to-key */ SHISHI_PA_ETYPE_INFO = 10, /* in krb-error, request for preauth */ SHISHI_PA_USE_SPECIFIED_KVNO = 20 /* use specified kvno */ } Shishi_padata_type;
typedef enum { SHISHI_APOPTIONS_RESERVED = 0x1, /* bit 0 */ SHISHI_APOPTIONS_USE_SESSION_KEY = 0x2, /* bit 1 */ SHISHI_APOPTIONS_MUTUAL_REQUIRED = 0x4 /* bit 2 */ } Shishi_apoptions;
typedef enum { SHISHI_TICKETFLAGS_RESERVED = 0x1, /* bit 0 */ SHISHI_TICKETFLAGS_FORWARDABLE = 0x2, /* bit 1 */ SHISHI_TICKETFLAGS_FORWARDED = 0x4, /* bit 2 */ SHISHI_TICKETFLAGS_PROXIABLE = 0x8, /* bit 3 */ SHISHI_TICKETFLAGS_PROXY = 0x10, /* bit 4 */ SHISHI_TICKETFLAGS_MAY_POSTDATE = 0x20, /* bit 5 */ SHISHI_TICKETFLAGS_POSTDATED = 0x40, /* bit 6 */ SHISHI_TICKETFLAGS_INVALID = 0x80, /* bit 7 */ SHISHI_TICKETFLAGS_RENEWABLE = 0x100, /* bit 8 */ SHISHI_TICKETFLAGS_INITIAL = 0x200, /* bit 9 */ SHISHI_TICKETFLAGS_PRE_AUTHENT = 0x400, /* bit 10 */ SHISHI_TICKETFLAGS_HW_AUTHENT = 0x800, /* bit 11 */ SHISHI_TICKETFLAGS_TRANSITED_POLICY_CHECKED = 0x1000, /* bit 12 */ SHISHI_TICKETFLAGS_OK_AS_DELEGATE = 0x2000 /* bit 13 */ } Shishi_ticketflags;
typedef enum { SHISHI_KDCOPTIONS_RESERVED = 0x1, /* bit 0 */ SHISHI_KDCOPTIONS_FORWARDABLE = 0x2, /* bit 1 */ SHISHI_KDCOPTIONS_FORWARDED = 0x4, /* bit 2 */ SHISHI_KDCOPTIONS_PROXIABLE = 0x8, /* bit 3 */ SHISHI_KDCOPTIONS_PROXY = 0x10, /* bit 4 */ SHISHI_KDCOPTIONS_ALLOW_POSTDATE = 0x20, /* bit 5 */ SHISHI_KDCOPTIONS_POSTDATED = 0x40, /* bit 6 */ SHISHI_KDCOPTIONS_UNUSED7 = 0x80, /* bit 7 */ SHISHI_KDCOPTIONS_RENEWABLE = 0x100, /* bit 8 */ SHISHI_KDCOPTIONS_UNUSED9 = 0x200, /* bit 9 */ SHISHI_KDCOPTIONS_UNUSED10 = 0x400, /* bit 10 */ SHISHI_KDCOPTIONS_UNUSED11 = 0x800, /* bit 11 */ SHISHI_KDCOPTIONS_DISABLE_TRANSITED_CHECK = 0x4000000, /* bit 26 */ SHISHI_KDCOPTIONS_RENEWABLE_OK = 0x8000000, /* bit 27 */ SHISHI_KDCOPTIONS_ENC_TKT_IN_SKEY = 0x10000000, /* bit 28 */ SHISHI_KDCOPTIONS_RENEW = 0x40000000, /* bit 30 */ SHISHI_KDCOPTIONS_VALIDATE = 0x80000000 /* bit 31 */ } Shishi_KDCOptions;
typedef enum { SHISHI_MSGTYPE_AS_REQ = 0x10, SHISHI_MSGTYPE_AS_REP = 0x11, SHISHI_MSGTYPE_TGS_REQ = 0x12, SHISHI_MSGTYPE_TGS_REP = 0x13 } Shishi_msgtype;
typedef enum { SHISHI_LRTYPE_LAST_INITIAL_TGT_REQUEST = 1, SHISHI_LRTYPE_LAST_INITIAL_REQUEST = 2, SHISHI_LRTYPE_NEWEST_TGT_ISSUE = 3, SHISHI_LRTYPE_LAST_RENEWAL = 4, SHISHI_LRTYPE_LAST_REQUEST = 5 } Shishi_lrtype;
typedef enum { SHISHI_NULL = 0, SHISHI_DES_CBC_CRC = 1, SHISHI_DES_CBC_MD4 = 2, SHISHI_DES_CBC_MD5 = 3, SHISHI_DES_CBC_NONE = 4, SHISHI_DES3_CBC_NONE = 6, SHISHI_DES3_CBC_HMAC_SHA1_KD = 16, SHISHI_AES128_CTS_HMAC_SHA1_96 = 17, SHISHI_AES256_CTS_HMAC_SHA1_96 = 18 } Shishi_etype;
typedef enum { SHISHI_CRC32 = 1, SHISHI_RSA_MD4 = 2, SHISHI_RSA_MD4_DES = 3, SHISHI_DES_MAC = 4, SHISHI_DES_MAC_K = 5, SHISHI_RSA_MD4_DES_K = 6, SHISHI_RSA_MD5 = 7, SHISHI_RSA_MD5_DES = 8, SHISHI_RSA_MD5_DES_GSS = 9, /* XXX */ SHISHI_HMAC_SHA1_96_AES128 = 10, SHISHI_HMAC_SHA1_96_AES256 = 11, SHISHI_HMAC_SHA1_DES3_KD = 12 } Shishi_cksumtype;
typedef enum { SHISHI_FILETYPE_TEXT = 0, SHISHI_FILETYPE_DER, SHISHI_FILETYPE_HEX, SHISHI_FILETYPE_BASE64, SHISHI_FILETYPE_BINARY } Shishi_filetype;
typedef enum { /* 1. AS-REQ PA-ENC-TIMESTAMP padata timestamp, encrypted with the client key */ SHISHI_KEYUSAGE_ASREQ_PA_ENC_TIMESTAMP = 1, /* 2. AS-REP Ticket and TGS-REP Ticket (includes TGS session key or application session key), encrypted with the service key */ SHISHI_KEYUSAGE_ENCTICKETPART = 2, /* 3. AS-REP encrypted part (includes TGS session key or application session key), encrypted with the client key */ SHISHI_KEYUSAGE_ENCASREPPART = 3, /* 4. TGS-REQ KDC-REQ-BODY AuthorizationData, encrypted with the TGS session key */ SHISHI_KEYUSAGE_TGSREQ_AUTHORIZATIONDATA_TGS_SESSION_KEY = 4, /* 5. TGS-REQ KDC-REQ-BODY AuthorizationData, encrypted with the TGS authenticator subkey (section 5.4.1) */ SHISHI_KEYUSAGE_TGSREQ_AUTHORIZATIONDATA_TGS_AUTHENTICATOR_KEY = 5, /* 6. TGS-REQ PA-TGS-REQ padata AP-REQ Authenticator cksum, keyed with the TGS session key */ SHISHI_KEYUSAGE_TGSREQ_APREQ_AUTHENTICATOR_CKSUM = 6, /* 7. TGS-REQ PA-TGS-REQ padata AP-REQ Authenticator (includes TGS authenticator subkey), encrypted with the TGS session key */ SHISHI_KEYUSAGE_TGSREQ_APREQ_AUTHENTICATOR = 7, /* 8. TGS-REP encrypted part (includes application session key), encrypted with the TGS session key */ SHISHI_KEYUSAGE_ENCTGSREPPART_SESSION_KEY = 8, /* 9. TGS-REP encrypted part (includes application session key), encrypted with the TGS authenticator subkey */ SHISHI_KEYUSAGE_ENCTGSREPPART_AUTHENTICATOR_KEY = 9, /* 10. AP-REQ Authenticator cksum, keyed with the application session key */ SHISHI_KEYUSAGE_APREQ_AUTHENTICATOR_CKSUM = 10, /* 11. AP-REQ Authenticator (includes application authenticator subkey), encrypted with the application session key */ SHISHI_KEYUSAGE_APREQ_AUTHENTICATOR = 11, /* 12. AP-REP encrypted part (includes application session subkey), encrypted with the application session key */ SHISHI_KEYUSAGE_ENCAPREPPART = 12, /* 13. KRB-PRIV encrypted part, encrypted with a key chosen by the application */ SHISHI_KEYUSAGE_KRB_PRIV = 13, /* 14. KRB-CRED encrypted part, encrypted with a key chosen by the application */ SHISHI_KEYUSAGE_KRB_CRED = 14, /* 15. KRB-SAFE cksum, keyed with a key chosen by the application */ SHISHI_KEYUSAGE_KRB_SAFE = 15, /* 18. KRB-ERROR checksum (e-cksum) */ SHISHI_KEYUSAGE_KRB_ERROR = 18, /* 19. AD-KDCIssued checksum (ad-checksum) */ SHISHI_KEYUSAGE_AD_KDCISSUED = 19, /* 20. Checksum for Mandatory Ticket Extensions */ SHISHI_KEYUSAGE_TICKET_EXTENSION = 20, /* 21. Checksum in Authorization Data in Ticket Extensions */ SHISHI_KEYUSAGE_TICKET_EXTENSION_AUTHORIZATION = 21, /* 22-24. Reserved for use in GSSAPI mechanisms derived from RFC 1964. (raeburn/MIT) */ SHISHI_KEYUSAGE_GSS_R1 = 22, SHISHI_KEYUSAGE_GSS_R2 = 23, SHISHI_KEYUSAGE_GSS_R3 = 24 /* 25-511. Reserved for future use in Kerberos and related protocols. */ /* 512-1023. Reserved for uses internal to a Kerberos implementation. */ } Shishi_keyusage;
typedef enum { SHISHI_TKTSHINTFLAGS_ACCEPT_EXPIRED = 1 } Shishi_tkts_hintflags;
Shishi* shishi (void);
Initializes the Shishi library. If this function fails, it may print diagnostic errors to stderr.
Returns : | Returns Shishi library handle, or NULL on error. |
int shishi_init (Shishi **handle);
Create a Shishi library handle and read the system configuration file, user configuration file and user tickets from the default paths. The paths to the system configuration file is decided at compile time, and is $sysconfdir/shishi.conf. The user configuration file is $HOME/.shishi/config, and the user ticket file is $HOME/.shishi/ticket. The handle is allocated regardless of return values, except for SHISHI_HANDLE_ERROR which indicates a problem allocating the handle. (The other error conditions comes from reading the files.)
handle : | pointer to handle to be created. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_init_with_paths (Shishi **handle, const char *tktsfile, const char *systemcfgfile, const char *usercfgfile);
Like shishi_init() but use explicit paths. Like shishi_init(), the handle is allocated regardless of return values, except for SHISHI_HANDLE_ERROR which indicates a problem allocating the handle. (The other error conditions comes from reading the files.)
handle : | pointer to handle to be created. |
tktsfile : | Filename of ticket file, or NULL. |
systemcfgfile : | Filename of system configuration, or NULL. |
usercfgfile : | Filename of user configuration, or NULL. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_init_server (Shishi **handle);
Like shishi_init() but only read the system configuration file. Like shishi_init(), the handle is allocated regardless of return values, except for SHISHI_HANDLE_ERROR which indicates a problem allocating the handle. (The other error conditions comes from reading the configuration file.)
handle : | pointer to handle to be created. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_init_server_with_paths (Shishi **handle, const char *systemcfgfile);
Like shishi_init() but only read the system configuration file from specified location. Like shishi_init(), the handle is allocated regardless of return values, except for SHISHI_HANDLE_ERROR which indicates a problem allocating the handle. (The other error conditions comes from reading the configuration file.)
handle : | pointer to handle to be created. |
systemcfgfile : | Filename of system configuration, or NULL. |
Returns : | Returns SHISHI_OK iff successful. |
void shishi_done (Shishi *handle);
Deallocates the shishi library handle. The handle must not be used in any calls to shishi functions after this. If there is a default tkts, it is written to the default tkts file (call shishi_tkts_default_file_set() to change the default tkts file). If you do not wish to write the default tkts file, close the default tkts with shishi_tkts_done(handle, NULL) before calling this function.
handle : | shishi handle as allocated by shishi_init(). |
int shishi_cfg (Shishi *handle, char *option);
Configure shishi library with given option.
handle : | Shishi library handle create by shishi_init(). |
option : | string with shishi library option. |
Returns : | Returns SHISHI_OK if option was valid. |
int shishi_cfg_from_file (Shishi *handle, const char *cfg);
Configure shishi library using configuration file.
handle : | Shishi library handle create by shishi_init(). |
cfg : | filename to read configuration from. |
Returns : | Returns SHISHI_OK iff succesful. |
int shishi_cfg_print (Shishi *handle, FILE *fh);
Print library configuration status, mostly for debugging purposes.
handle : | Shishi library handle create by shishi_init(). |
fh : | file descriptor opened for writing. |
Returns : | Returns SHISHI_OK. |
const char* shishi_cfg_default_systemfile (Shishi *handle);
handle : | Shishi library handle create by shishi_init(). |
Returns : | Return system configuration filename. |
const char* shishi_cfg_default_userdirectory (Shishi *handle);
handle : | Shishi library handle create by shishi_init(). |
Returns : | Return directory with configuration files etc. |
const char* shishi_cfg_default_userfile (Shishi *handle);
handle : | Shishi library handle create by shishi_init(). |
Returns : | Return user configuration filename. |
int shishi_cfg_clientkdcetype (Shishi *handle, int32_t **etypes);
Set the etypes variable to the array of preferred client etypes.
handle : | Shishi library handle create by shishi_init(). |
etypes : | output array with encryption types. |
Returns : | Return the number of encryption types in the array, 0 means none. |
int shishi_cfg_clientkdcetype_set (Shishi *handle, char *value);
Set the "client-kdc-etypes" configuration option from given string. The string contains encryption types (integer or names) separated by comma or whitespace, e.g. "aes256-cts-hmac-sha1-96 des3-cbc-sha1-kd des-cbc-md5".
handle : | Shishi library handle create by shishi_init(). |
value : | string with encryption types. |
Returns : | Return SHISHI_OK iff successful. |
const char* shishi_strerror (int err);
err : | shishi error code |
Returns : | Returns a pointer to a statically allocated string containing a description of the error with the error value err. This string can be used to output a diagnostic message to the user. |
void shishi_error_printf (Shishi *handle, char *format, ...);
handle : | |
format : | |
... : |
|
char* shishi_realm_default_guess (void);
Guesses a realm based on getdomainname() (which really is NIS/YP domain, but if it is set it might be a good guess), or if it fails, based on gethostname(), or if it fails, the string "could-not-guess-default-realm". Note that the hostname is not trimmed off of the data returned by gethostname() to get the domain name and use that as the realm.
Returns : | Returns guessed realm for host as a string that has to be deallocated with free() by the caller. |
const char* shishi_realm_default (Shishi *handle);
handle : | Shishi library handle create by shishi_init(). |
Returns : | Returns the default realm used in the library. (Not a copy of it, so don't modify or deallocate it.) |
void shishi_realm_default_set (Shishi *handle, const char *realm);
Set the default realm used in the library. The string is copied into the library, so you can dispose of the variable immediately after calling this function.
handle : | Shishi library handle create by shishi_init(). |
realm : | string with new default realm name, or NULL to reset to default. |
const char* shishi_realm_for_server_file (Shishi *handle, char *server);
handle : | |
server : | |
Returns : |
|
const char* shishi_realm_for_server_dns (Shishi *handle, char *server);
handle : | |
server : | |
Returns : |
|
const char* shishi_realm_for_server (Shishi *handle, char *server);
handle : | |
server : | |
Returns : |
|
char* shishi_principal_default_guess (void);
Guesses a principal using getpwuid(getuid)), or if it fails, the string "user".
Returns : | Returns guessed default principal for user as a string that has to be deallocated with free() by the caller. |
const char* shishi_principal_default (Shishi *handle);
handle : | Shishi library handle create by shishi_init(). |
Returns : | Returns the default principal name used in the library. (Not a copy of it, so don't modify or deallocate it.) |
void shishi_principal_default_set (Shishi *handle, const char *principal);
Set the default realm used in the library. The string is copied into the library, so you can dispose of the variable immediately after calling this function.
handle : | Shishi library handle create by shishi_init(). |
principal : | string with new default principal name, or NULL to reset to default. |
int shishi_principal_name_get (Shishi *handle, Shishi_asn1 namenode, const char *namefield, char *out, size_t *outlen);
handle : | |
namenode : | |
namefield : | |
out : | |
outlen : | |
Returns : |
|
int shishi_principal_name_realm_get (Shishi *handle, Shishi_asn1 namenode, const char *namefield, Shishi_asn1 realmnode, const char *realmfield, char *out, size_t *outlen);
handle : | |
namenode : | |
namefield : | |
realmnode : | |
realmfield : | |
out : | |
outlen : | |
Returns : |
|
int shishi_principal_name_set (Shishi *handle, Shishi_asn1 namenode, const char *namefield, Shishi_name_type name_type, const char *name[]);
Set the given principal name field to given name.
handle : | shishi handle as allocated by shishi_init(). |
namenode : | ASN.1 structure with principal in namefield. |
namefield : | name of field in namenode containing principal name. |
name_type : | type of principial, see Shishi_name_type, usually SHISHI_NT_UNKNOWN. |
name : | zero-terminated input array with principal name. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_principal_set (Shishi *handle, Shishi_asn1 namenode, const char *namefield, const char *name);
Set principal name field in ASN.1 structure to given name.
handle : | shishi handle as allocated by shishi_init(). |
namenode : | ASN.1 structure with principal in namefield. |
namefield : | name of field in namenode containing principal name. |
name : | zero-terminated string with principal name on RFC 1964 form. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_parse_name (Shishi *handle, const char *name, char **principal, char **realm);
handle : | |
name : | |
principal : | |
realm : | |
Returns : |
|
char* shishi_server_for_local_service (Shishi *handle, const char *service);
handle : | |
service : | |
Returns : |
|
int shishi_ticket_sname_get (Shishi *handle, Shishi_asn1 ticket, char *server, size_t *serverlen);
handle : | |
ticket : | |
server : | |
serverlen : | |
Returns : |
|
int shishi_ticket_sname_set (Shishi *handle, Shishi_asn1 ticket, Shishi_name_type name_type, char *sname[]);
Set the server name field in the Ticket.
handle : | shishi handle as allocated by shishi_init(). |
ticket : | Ticket variable to set server name field in. |
name_type : | type of principial, see Shishi_name_type, usually SHISHI_NT_UNKNOWN. |
sname : | input array with principal name. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_ticket_snamerealm_get (Shishi *handle, Shishi_asn1 ticket, char *serverrealm, int *serverrealmlen);
handle : | |
ticket : | |
serverrealm : | |
serverrealmlen : | |
Returns : |
|
int shishi_ticket_srealmserver_set (Shishi *handle, Shishi_asn1 ticket, char *realm, char *server);
handle : | |
ticket : | |
realm : | |
server : | |
Returns : |
|
int shishi_ticket_set_server (Shishi *handle, Shishi_asn1 ticket, const char *server);
handle : | |
ticket : | |
server : | |
Returns : |
|
int shishi_ticket_realm_get (Shishi *handle, Shishi_asn1 ticket, char *realm, int *realmlen);
handle : | |
ticket : | |
realm : | |
realmlen : | |
Returns : |
|
int shishi_ticket_realm_set (Shishi *handle, Shishi_asn1 ticket, const char *realm);
Set the realm field in the Ticket.
handle : | shishi handle as allocated by shishi_init(). |
ticket : | input variable with ticket info. |
realm : | input array with name of realm. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_ticket_get_enc_part_etype (Shishi *handle, Shishi_asn1 ticket, int32_t *etype);
Extract Ticket.enc-part.etype.
handle : | shishi handle as allocated by shishi_init(). |
ticket : | Ticket variable to get value from. |
etype : | output variable that holds the value. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_ticket_set_enc_part (Shishi *handle, Shishi_asn1 ticket, int etype, int kvno, char *buf, size_t buflen);
Set the encrypted enc-part field in the Ticket. The encrypted data is usually created by calling shishi_encrypt() on the DER encoded enc-part. To save time, you may want to use shishi_ticket_add_enc_part() instead, which calculates the encrypted data and calls this function in one step.
handle : | shishi handle as allocated by shishi_init(). |
ticket : | Ticket to add enc-part field to. |
etype : | encryption type used to encrypt enc-part. |
kvno : | key version number. |
buf : | input array with encrypted enc-part. |
buflen : | size of input array with encrypted enc-part. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_ticket_add_enc_part (Shishi *handle, Shishi_asn1 ticket, Shishi_key *key, Shishi_asn1 encticketpart);
Encrypts DER encoded EncTicketPart using key and stores it in the Ticket.
handle : | shishi handle as allocated by shishi_init(). |
ticket : | Ticket to add enc-part field to. |
key : | key used to encrypt enc-part. |
encticketpart : | EncTicketPart to add. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_enckdcreppart_key_set (Shishi *handle, Shishi_asn1 enckdcreppart, Shishi_key *key);
Set the EncKDCRepPart.key field to key type and value of supplied key.
handle : | shishi handle as allocated by shishi_init(). |
enckdcreppart : | input EncKDCRepPart variable. |
key : | key handle with information to store in enckdcreppart. |
Returns : | Returns SHISHI_OK iff succesful. |
int shishi_ticket_decrypt (Shishi *handle, Shishi_asn1 ticket, Shishi_key *key, Shishi_asn1 *encticketpart);
handle : | |
ticket : | |
key : | |
encticketpart : | |
Returns : |
|
Shishi_asn1 shishi_tkt_ticket (Shishi_tkt *tkt);
tkt : | input variable with ticket info. |
Returns : | Returns actual ticket. |
Shishi_asn1 shishi_tkt_kdcrep (Shishi_tkt *tkt);
tkt : | input variable with ticket info. |
Returns : | Returns KDC-REP information. |
Shishi_asn1 shishi_tkt_enckdcreppart (Shishi_tkt *tkt);
tkt : | input variable with ticket info. |
Returns : | Returns auxilliary ticket information. |
void shishi_tkt_enckdcreppart_set (Shishi_tkt *tkt, Shishi_asn1 enckdcreppart);
tkt : | |
enckdcreppart : |
|
Shishi_asn1 shishi_tkt_encticketpart (Shishi_tkt *tkt);
tkt : | input variable with ticket info. |
Returns : | Returns EncTicketPart information. |
void shishi_tkt_encticketpart_set (Shishi_tkt *tkt, Shishi_asn1 encticketpart);
Set the EncTicketPart in the Ticket.
tkt : | input variable with ticket info. |
encticketpart : | encticketpart to store in ticket. |
Shishi_key* shishi_tkt_key (Shishi_tkt *tkt);
tkt : | input variable with ticket info. |
Returns : | Returns key extracted from enckdcreppart. |
int shishi_tkt_key_set (Shishi_tkt *tkt, Shishi_key *key);
Set the key in the EncTicketPart.
tkt : | input variable with ticket info. |
key : | key to store in ticket. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_tkt (Shishi *handle, Shishi_tkt **tkt);
Create a new ticket handle.
handle : | shishi handle as allocated by shishi_init(). |
tkt : | output variable with newly allocated ticket. |
Returns : | Returns SHISHI_OK iff successful. |
Shishi_tkt* shishi_tkt2 (Shishi *handle, Shishi_asn1 ticket, Shishi_asn1 enckdcreppart, Shishi_asn1 kdcrep);
handle : | |
ticket : | |
enckdcreppart : | |
kdcrep : | |
Returns : |
|
int shishi_tkt_pretty_print (Shishi_tkt *tkt, FILE *fh);
tkt : | |
fh : | |
Returns : |
|
int shishi_tkt_realm (Shishi_tkt *tkt, char *realm, int *realmlen);
tkt : | |
realm : | |
realmlen : | |
Returns : |
|
int shishi_tkt_cnamerealm (Shishi_tkt *tkt, char *cnamerealm, int *cnamerealmlen);
tkt : | |
cnamerealm : | |
cnamerealmlen : | |
Returns : |
|
int shishi_tkt_cnamerealm_p (Shishi_tkt *tkt, const char *client);
tkt : | |
client : | |
Returns : |
|
int shishi_tkt_client (Shishi_tkt *tkt, char *client, int *clientlen);
tkt : | |
client : | |
clientlen : | |
Returns : |
|
int shishi_tkt_client_p (Shishi_tkt *tkt, const char *client);
tkt : | |
client : | |
Returns : |
|
int shishi_tkt_clientrealm_set (Shishi_tkt *tkt, char *realm, char *client);
tkt : | |
realm : | |
client : | |
Returns : |
|
int shishi_tkt_serverrealm_set (Shishi_tkt *tkt, char *realm, char *server);
tkt : | |
realm : | |
server : | |
Returns : |
|
int shishi_tkt_lastreq (Shishi_tkt *tkt, char *lrtime, int *lrtimelen, int lrtype);
tkt : | |
lrtime : | |
lrtimelen : | |
lrtype : | |
Returns : |
|
time_t shishi_tkt_lastreqc (Shishi_tkt *tkt, Shishi_lrtype lrtype);
tkt : | |
lrtype : | |
Returns : |
|
int shishi_tkt_lastreq_pretty_print (Shishi_tkt *tkt, FILE *fh);
tkt : | |
fh : | |
Returns : |
|
int shishi_tkt_authtime (Shishi_tkt *tkt, char *authtime, int *authtimelen);
tkt : | |
authtime : | |
authtimelen : | |
Returns : |
|
int shishi_tkt_starttime (Shishi_tkt *tkt, char *starttime, int *starttimelen);
tkt : | |
starttime : | |
starttimelen : | |
Returns : |
|
int shishi_tkt_endtime (Shishi_tkt *tkt, char *endtime, int *endtimelen);
tkt : | |
endtime : | |
endtimelen : | |
Returns : |
|
int shishi_tkt_renew_till (Shishi_tkt *tkt, char *renewtilltime, int *renewtilllen);
tkt : | |
renewtilltime : | |
renewtilllen : | |
Returns : |
|
int shishi_tkt_keytype_p (Shishi_tkt *tkt, int32_t etype);
tkt : | |
etype : | |
Returns : |
|
int shishi_tkt_server (Shishi_tkt *tkt, char *service, int *servicelen);
tkt : | |
service : | |
servicelen : | |
Returns : |
|
int shishi_tkt_server_p (Shishi_tkt *tkt, const char *service);
tkt : | |
service : | |
Returns : |
|
int shishi_tkt_server_realm (Shishi_tkt *tkt, char *serverrealm, int *serverrealmlen);
tkt : | |
serverrealm : | |
serverrealmlen : | |
Returns : |
|
int shishi_tkt_valid_at_time_p (Shishi_tkt *tkt, time_t now);
tkt : | |
now : | |
Returns : |
|
int shishi_tkt_transited_policy_checked_p (Shishi_tkt *tkt);
tkt : | |
Returns : |
|
char* shishi_tkts_default_file_guess (void);
Guesses the default ticket filename; it is $HOME/.shishi/tickets.
Returns : | Returns default tkts filename as a string that has to be deallocated with free() by the caller. |
const char* shishi_tkts_default_file (Shishi *handle);
handle : | Shishi library handle create by shishi_init(). |
Returns : | Returns the default ticket set filename used in the library. (Not a copy of it, so don't modify or deallocate it.) |
void shishi_tkts_default_file_set (Shishi *handle, const char *tktsfile);
Set the default ticket set filename used in the library. The string is copied into the library, so you can dispose of the variable immediately after calling this function.
handle : | Shishi library handle create by shishi_init(). |
tktsfile : | string with new default tkts file name, or NULL to reset to default. |
Shishi_tkts* shishi_tkts_default (Shishi *handle);
handle : | Shishi library handle create by shishi_init(). |
Returns : | Return the handle global ticket set. |
int shishi_tkts (Shishi *handle, Shishi_tkts **tkts);
handle : | shishi handle as allocated by shishi_init(). |
tkts : | output pointer to newly allocated tkts handle. |
Returns : | Returns SHISHI_OK iff successful. |
Shishi_tkt* shishi_tkts_nth (Shishi_tkts *tkts, int ticketno);
tkts : | ticket set handle as allocated by shishi_tkts(). |
ticketno : | integer indicating requested ticket in ticket set. |
Returns : | Returns a ticket handle to the ticketno:th ticket in the ticket set, or NULL if ticket set is invalid or ticketno is out of bounds. The first ticket is ticketno 0, the second ticketno 1, and so on. |
int shishi_tkts_size (Shishi_tkts *tkts);
tkts : | ticket set handle as allocated by shishi_tkts(). |
Returns : | Returns number of tickets stored in ticket set. |
int shishi_tkts_add (Shishi_tkts *tkts, Shishi_tkt *tkt);
tkts : | ticket set handle as allocated by shishi_tkts(). |
tkt : | ticket to be added to ticket set. |
Returns : | Returns SHISHI_OK iff succesful. |
int shishi_tkts_new (Shishi_tkts *tkts, Shishi_asn1 ticket, Shishi_asn1 enckdcreppart, Shishi_asn1 kdcrep);
Allocate a new ticket and add it to the ticket set.
tkts : | ticket set handle as allocated by shishi_tkts(). |
ticket : | input ticket variable. |
enckdcreppart : | input ticket detail variable. |
kdcrep : | input KDC-REP variable. |
Returns : | Returns SHISHI_OK iff succesful. |
int shishi_tkts_remove (Shishi_tkts *tkts, int ticketno);
tkts : | ticket set handle as allocated by shishi_tkts(). |
ticketno : | ticket number of ticket in the set to remove. The first ticket is ticket number 0. |
Returns : | Returns SHISHI_OK if succesful or if ticketno larger than size of ticket set. |
int shishi_tkts_expire (Shishi_tkts *tkts);
Remove expired tickets from ticket set.
tkts : | ticket set handle as allocated by shishi_tkts(). |
Returns : | Returns SHISHI_OK iff succesful. |
int shishi_tkts_print_for_service (Shishi_tkts *tkts, FILE *fh, const char *service);
Print description of tickets for specified service to file descriptor. If service is NULL, all tickets are printed.
tkts : | ticket set handle as allocated by shishi_tkts(). |
fh : | file descriptor to print to. |
service : | service to limit tickets printed to, or NULL. |
Returns : | Returns SHISHI_OK iff succesful. |
int shishi_tkts_print (Shishi_tkts *tkts, FILE *fh);
Print description of all tickets to file descriptor.
tkts : | ticket set handle as allocated by shishi_tkts(). |
fh : | file descriptor to print to. |
Returns : | Returns SHISHI_OK iff succesful. |
int shishi_tkts_write (Shishi_tkts *tkts, FILE *fh);
Write tickets in set to file descriptor.
tkts : | ticket set handle as allocated by shishi_tkts(). |
fh : | file descriptor to write tickets to. |
Returns : | Returns SHISHI_OK iff succesful. |
int shishi_tkts_to_file (Shishi_tkts *tkts, const char *filename);
Write tickets in set to file.
tkts : | ticket set handle as allocated by shishi_tkts(). |
filename : | filename to write tickets to. |
Returns : | Returns SHISHI_OK iff succesful. |
int shishi_tkts_read (Shishi_tkts *tkts, FILE *fh);
Read tickets from file descriptor and add them to the ticket set.
tkts : | ticket set handle as allocated by shishi_tkts(). |
fh : | file descriptor to read from. |
Returns : | Returns SHISHI_OK iff succesful. |
int shishi_tkts_from_file (Shishi_tkts *tkts, const char *filename);
Read tickets from file and add them to the ticket set.
tkts : | ticket set handle as allocated by shishi_tkts(). |
filename : | filename to read tickets from. |
Returns : | Returns SHISHI_OK iff succesful. |
void shishi_tkts_done (Shishi_tkts **tkts);
Deallocates all resources associated with ticket set. The ticket set handle must not be used in calls to other shishi_tkts_*() functions after this.
tkts : | ticket set handle as allocated by shishi_tkts(). |
int shishi_tkt_match_p (Shishi_tkt *tkt, Shishi_tkts_hint *hint);
tkt : | ticket to test hints on. |
hint : | structure with characteristics of ticket to be found. |
Returns : | Returns 0 iff ticket fails to match given criteria. |
Shishi_tkt* shishi_tkts_find (Shishi_tkts *tkts, Shishi_tkts_hint *hint);
Search the ticketset sequentially (from ticket number 0 through all tickets in the set) for a ticket that fits the given characteristics. If a ticket is found, the hint->startpos field is updated to point to the next ticket in the set, so this function can be called repeatedly with the same hint argument in order to find all tickets matching a certain criterium. Note that if tickets are added to, or removed from, the ticketset during a query with the same hint argument, the hint->startpos field must be updated appropriately.
Here is how you would typically use this function:
Shishi_tkts_hint hint;
Shishi_tkt tkt;
...
memset(&hint, 0, sizeof(hint));
hint.server = "imap/mail.example.org";
tkt = shishi_tkts_find (shishi_tkts_default(handle), &hint);
if (!tkt)
printf("No ticket found...\n");
else
...do something with ticket
tkts : | ticket set handle as allocated by shishi_tkts(). |
hint : | structure with characteristics of ticket to be found. |
Returns : | Returns a ticket if found, or NULL if no further matching tickets could be found. |
Shishi_tkt* shishi_tkts_find_for_clientserver (Shishi_tkts *tkts, const char *client, const char *server);
Short-hand function for searching the ticket set for a ticket for the given client and server. See shishi_tkts_find().
tkts : | ticket set handle as allocated by shishi_tkts(). |
client : | client name to find ticket for. |
server : | server name to find ticket for. |
Returns : | Returns a ticket if found, or NULL. |
Shishi_tkt* shishi_tkts_find_for_server (Shishi_tkts *tkts, const char *server);
Short-hand function for searching the ticket set for a ticket for the given server using the default client principal. See shishi_tkts_find_for_clientserver() and shishi_tkts_find().
tkts : | ticket set handle as allocated by shishi_tkts(). |
server : | server name to find ticket for. |
Returns : | Returns a ticket if found, or NULL. |
Shishi_tkt* shishi_tkts_get (Shishi_tkts *tkts, Shishi_tkts_hint *hint);
Get a ticket matching given characteristics. This function first looks in the ticket set for the ticket, then tries to find a TGT for the realm (possibly by using an AS exchange) and then use the TGT in a TGS exchange to get the ticket. Currently this function do not implement cross realm logic.
tkts : | ticket set handle as allocated by shishi_tkts(). |
hint : | structure with characteristics of ticket to begot. |
Returns : | Returns a ticket if found, or NULL if this function is unable to get the ticket. |
Shishi_tkt* shishi_tkts_get_for_clientserver (Shishi_tkts *tkts, const char *client, const char *server);
Short-hand function for getting a ticket for the given client and server. See shishi_tkts_get().
tkts : | ticket set handle as allocated by shishi_tkts(). |
client : | client name to get ticket for. |
server : | server name to get ticket for. |
Returns : | Returns a ticket if found, or NULL. |
Shishi_tkt* shishi_tkts_get_for_server (Shishi_tkts *tkts, const char *server);
Short-hand function for getting a ticket for the given server and the default principal client. See shishi_tkts_get().
tkts : | ticket set handle as allocated by shishi_tkts(). |
server : | server name to get ticket for. |
Returns : | Returns a ticket if found, or NULL. |
Shishi_tkt* shishi_tkts_get_for_localservicepasswd (Shishi_tkts *tkts, const char *service, const char *passwd);
tkts : | |
service : | |
passwd : | |
Returns : |
|
int shishi_enckdcreppart_print (Shishi *handle, FILE *fh, Shishi_asn1 enckdcreppart);
handle : | |
fh : | |
enckdcreppart : | |
Returns : |
|
int shishi_enckdcreppart_save (Shishi *handle, FILE *fh, Shishi_asn1 enckdcreppart);
handle : | |
fh : | |
enckdcreppart : | |
Returns : |
|
int shishi_enckdcreppart_parse (Shishi *handle, FILE *fh, Shishi_asn1 *enckdcreppart);
handle : | |
fh : | |
enckdcreppart : | |
Returns : |
|
int shishi_enckdcreppart_read (Shishi *handle, FILE *fh, Shishi_asn1 *enckdcreppart);
handle : | |
fh : | |
enckdcreppart : | |
Returns : |
|
int shishi_ticket_save (Shishi *handle, FILE *fh, Shishi_asn1 ticket);
handle : | |
fh : | |
ticket : | |
Returns : |
|
int shishi_ticket_print (Shishi *handle, FILE *fh, Shishi_asn1 ticket);
handle : | |
fh : | |
ticket : | |
Returns : |
|
int shishi_kdc_req_print (Shishi *handle, FILE *fh, Shishi_asn1 asreq);
handle : | |
fh : | |
asreq : | |
Returns : |
|
int shishi_kdc_rep_print (Shishi *handle, FILE *fh, Shishi_asn1 asreq);
handle : | |
fh : | |
asreq : | |
Returns : |
|
int shishi_kdc_print (Shishi *handle, FILE *fh, Shishi_asn1 asreq, Shishi_asn1 asrep, Shishi_asn1 encasreppart);
handle : | |
fh : | |
asreq : | |
asrep : | |
encasreppart : | |
Returns : |
|
int shishi_kdc_req_parse (Shishi *handle, FILE *fh, Shishi_asn1 *asreq);
handle : | |
fh : | |
asreq : | |
Returns : |
|
int shishi_kdc_rep_parse (Shishi *handle, FILE *fh, Shishi_asn1 *asrep);
handle : | |
fh : | |
asrep : | |
Returns : |
|
int shishi_ticket_parse (Shishi *handle, FILE *fh, Shishi_asn1 *ticket);
handle : | |
fh : | |
ticket : | |
Returns : |
|
int shishi_ticket_read (Shishi *handle, FILE *fh, Shishi_asn1 *ticket);
handle : | |
fh : | |
ticket : | |
Returns : |
|
Shishi_asn1 shishi_authenticator (Shishi *handle);
This function creates a new Authenticator, populated with some default values. It uses the current time as returned by the system for the ctime and cusec fields.
handle : | shishi handle as allocated by shishi_init(). |
Returns : | Returns the authenticator or NULL on failure. |
int shishi_authenticator_set_crealm (Shishi *handle, Shishi_asn1 authenticator, const char *crealm);
Set realm field in authenticator to specified value.
handle : | shishi handle as allocated by shishi_init(). |
authenticator : | authenticator as allocated by shishi_authenticator(). |
crealm : | input array with realm. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_authenticator_set_cname (Shishi *handle, Shishi_asn1 authenticator, Shishi_name_type name_type, const char *cname[]);
Set principal field in authenticator to specified value.
handle : | shishi handle as allocated by shishi_init(). |
authenticator : | authenticator as allocated by shishi_authenticator(). |
name_type : | type of principial, see Shishi_name_type, usually SHISHI_NT_UNKNOWN. |
cname : | input array with principal name. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_authenticator_client_set (Shishi *handle, Shishi_asn1 authenticator, const char *client);
Set the client name field in the Authenticator.
handle : | shishi handle as allocated by shishi_init(). |
authenticator : | Authenticator to set client name field in. |
client : | zero-terminated string with principal name on RFC 1964 form. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_authenticator_ctime_get (Shishi *handle, Shishi_asn1 authenticator, char *ctime);
handle : | |
authenticator : | |
ctime : | |
Returns : |
|
int shishi_authenticator_ctime_set (Shishi *handle, Shishi_asn1 authenticator, char *ctime);
Store client time in Authenticator.
handle : | shishi handle as allocated by shishi_init(). |
authenticator : | Authenticator as allocated by shishi_authenticator(). |
ctime : | string with generalized time value to store in Authenticator. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_authenticator_cusec_get (Shishi *handle, Shishi_asn1 authenticator, int *cusec);
Extract client microseconds field from Authenticator.
handle : | shishi handle as allocated by shishi_init(). |
authenticator : | Authenticator as allocated by shishi_authenticator(). |
cusec : | output integer with client microseconds field. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_authenticator_cusec_set (Shishi *handle, Shishi_asn1 authenticator, int cusec);
Set the cusec field in the Authenticator.
handle : | shishi handle as allocated by shishi_init(). |
authenticator : | authenticator as allocated by shishi_authenticator(). |
cusec : | client microseconds to set in authenticator, 0-999999. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_authenticator_cname_get (Shishi *handle, Shishi_asn1 authenticator, char *cname, int *cnamelen);
handle : | |
authenticator : | |
cname : | |
cnamelen : | |
Returns : |
|
int shishi_authenticator_cnamerealm_get (Shishi *handle, Shishi_asn1 authenticator, char *cnamerealm, int *cnamerealmlen);
handle : | |
authenticator : | |
cnamerealm : | |
cnamerealmlen : | |
Returns : |
|
int shishi_authenticator_remove_cksum (Shishi *handle, Shishi_asn1 authenticator);
handle : | |
authenticator : | |
Returns : |
|
int shishi_authenticator_cksum (Shishi *handle, Shishi_asn1 authenticator, int32_t *cksumtype, char *cksum, size_t *cksumlen);
Read checksum value from authenticator.
handle : | shishi handle as allocated by shishi_init(). |
authenticator : | authenticator as allocated by shishi_authenticator(). |
cksumtype : | output checksum type. |
cksum : | output checksum data from authenticator. |
cksumlen : | on input, maximum size of output checksum data buffer, on output, actual size of output checksum data buffer. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_authenticator_set_cksum (Shishi *handle, Shishi_asn1 authenticator, int cksumtype, char *cksum, size_t cksumlen);
Store checksum value in authenticator. A checksum is usually created by calling shishi_checksum() on some application specific data using the key from the ticket that is being used. To save time, you may want to use shishi_authenticator_add_cksum() instead, which calculates the checksum and calls this function in one step.
handle : | shishi handle as allocated by shishi_init(). |
authenticator : | authenticator as allocated by shishi_authenticator(). |
cksumtype : | input checksum type to store in authenticator. |
cksum : | input checksum data to store in authenticator. |
cksumlen : | size of input checksum data to store in authenticator. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_authenticator_add_cksum (Shishi *handle, Shishi_asn1 authenticator, Shishi_key *key, int keyusage, char *data, int datalen);
Calculate checksum for data and store it in the authenticator.
handle : | shishi handle as allocated by shishi_init(). |
authenticator : | authenticator as allocated by shishi_authenticator(). |
key : | key to to use for encryption. |
keyusage : | kerberos key usage value to use in encryption. |
data : | input array with data to calculate checksum on. |
datalen : | size of input array with data to calculate checksum on. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_authenticator_clear_authorizationdata (Shishi *handle, Shishi_asn1 authenticator);
Remove the authorization-data field from Authenticator.
handle : | shishi handle as allocated by shishi_init(). |
authenticator : | Authenticator as allocated by shishi_authenticator(). |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_authenticator_add_authorizationdata (Shishi *handle, Shishi_asn1 authenticator, int adtype, char *addata, int addatalen);
Add authorization data to authenticator.
handle : | shishi handle as allocated by shishi_init(). |
authenticator : | authenticator as allocated by shishi_authenticator(). |
adtype : | input authorization data type to add. |
addata : | input authorization data to add. |
addatalen : | size of input authorization data to add. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_authenticator_authorizationdata (Shishi *handle, Shishi_asn1 authenticator, int *adtype, char *addata, int *addatalen, int nth);
Extract n:th authorization data from authenticator. The first field is 1.
handle : | shishi handle as allocated by shishi_init(). |
authenticator : | authenticator as allocated by shishi_authenticator(). |
adtype : | output authorization data type. |
addata : | output authorization data. |
addatalen : | on input, maximum size of output authorization data, on output, actual size of authorization data. |
nth : | element number of authorization-data to extract. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_authenticator_read (Shishi *handle, FILE *fh, Shishi_asn1 *authenticator);
Read DER encoded authenticator from file and populate given authenticator variable.
handle : | shishi handle as allocated by shishi_init(). |
fh : | file handle open for reading. |
authenticator : | output variable with newly allocated authenticator. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_authenticator_parse (Shishi *handle, FILE *fh, Shishi_asn1 *authenticator);
Read ASCII armored DER encoded authenticator from file and populate given authenticator variable.
handle : | shishi handle as allocated by shishi_init(). |
fh : | file handle open for reading. |
authenticator : | output variable with newly allocated authenticator. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_authenticator_from_file (Shishi *handle, Shishi_asn1 *authenticator, int filetype, char *filename);
Read Authenticator from file in specified TYPE.
handle : | shishi handle as allocated by shishi_init(). |
authenticator : | output variable with newly allocated Authenticator. |
filetype : | input variable specifying type of file to be read, see Shishi_filetype. |
filename : | input variable with filename to read from. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_authenticator_print (Shishi *handle, FILE *fh, Shishi_asn1 authenticator);
Print ASCII armored DER encoding of authenticator to file.
handle : | shishi handle as allocated by shishi_init(). |
fh : | file handle open for writing. |
authenticator : | authenticator as allocated by shishi_authenticator(). |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_authenticator_to_file (Shishi *handle, Shishi_asn1 authenticator, int filetype, char *filename);
Write Authenticator to file in specified TYPE. The file will be truncated if it exists.
handle : | shishi handle as allocated by shishi_init(). |
authenticator : | Authenticator to save. |
filetype : | input variable specifying type of file to be written, see Shishi_filetype. |
filename : | input variable with filename to write to. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_authenticator_save (Shishi *handle, FILE *fh, Shishi_asn1 authenticator);
Save DER encoding of authenticator to file.
handle : | shishi handle as allocated by shishi_init(). |
fh : | file handle open for writing. |
authenticator : | authenticator as allocated by shishi_authenticator(). |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_as_req_build (Shishi_as *as);
Possibly remove unset fields (e.g., rtime).
as : | structure that holds information about AS exchange |
Returns : | Returns SHISHI_OK iff successful. |
void shishi_as_req_set (Shishi_as *as, Shishi_asn1 asreq);
Set the AS-REQ in the AP exchange.
as : | structure that holds information about AS exchange |
asreq : | asreq to store in AS. |
int shishi_as_req_der (Shishi_as *as, char *out, int *outlen);
DER encode AS-REQ.
as : | structure that holds information about AS exchange |
out : | output array with der encoding of AS-REQ. |
outlen : | length of output array with der encoding of AS-REQ. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_as_req_der_set (Shishi_as *as, char *der, size_t derlen);
DER decode AS-REQ and set it AS exchange. If decoding fails, the AS-REQ in the AS exchange remains.
as : | structure that holds information about AS exchange |
der : | input array with DER encoded AP-REQ. |
derlen : | length of input array with DER encoded AP-REQ. |
Returns : | Returns SHISHI_OK. |
Shishi_asn1 shishi_as_rep (Shishi_as *as);
as : | structure that holds information about AS exchange |
Returns : | Returns the received AS-REP packet from the AS exchange, or NULL if not yet set or an error occured. |
void shishi_as_rep_set (Shishi_as *as, Shishi_asn1 asrep);
Set the AS-REP in the AP exchange.
as : | structure that holds information about AS exchange |
asrep : | asrep to store in AS. |
int shishi_as_rep_build (Shishi_as *as, Shishi_key *key);
Build AS-REP.
as : | structure that holds information about AS exchange |
key : | user's key, used to encrypt the encrypted part of the AS-REP. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_as_rep_der (Shishi_as *as, char *out, int *outlen);
DER encode AS-REP.
as : | structure that holds information about AS exchange |
out : | output array with der encoding of AS-REP. |
outlen : | length of output array with der encoding of AS-REP. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_as_rep_der_set (Shishi_as *as, char *der, size_t derlen);
DER decode AS-REP and set it AS exchange. If decoding fails, the AS-REP in the AS exchange remains.
as : | structure that holds information about AS exchange |
der : | input array with DER encoded AP-REP. |
derlen : | length of input array with DER encoded AP-REP. |
Returns : | Returns SHISHI_OK. |
void shishi_as_encasreppart_set (Shishi_as *as, Shishi_asn1 encasreppart);
as : | |
encasreppart : |
|
int shishi_as_krberror_der (Shishi_as *as, char *out, int *outlen);
DER encode KRB-ERROR.
as : | structure that holds information about AS exchange |
out : | output array with der encoding of KRB-ERROR. |
outlen : | length of output array with der encoding of KRB-ERROR. |
Returns : | Returns SHISHI_OK iff successful. |
void shishi_as_krberror_set (Shishi_as *as, Shishi_asn1 krberror);
Set the KRB-ERROR in the AP exchange.
as : | structure that holds information about AS exchange |
krberror : | krberror to store in AS. |
void shishi_as_tkt_set (Shishi_as *as, Shishi_tkt *tkt);
Set the Tkt in the AP exchange.
as : | structure that holds information about AS exchange |
tkt : | tkt to store in AS. |
int shishi_as (Shishi *handle, Shishi_as **as);
Allocate a new AS exchange variable.
handle : | shishi handle as allocated by shishi_init(). |
as : | holds pointer to newly allocate Shishi_as structure. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_as_password_cnamerealmsname (Shishi *handle, char *password, Shishi_as **as, char *cname, char *realm, char *sname);
handle : | |
password : | |
as : | |
cname : | |
realm : | |
sname : | |
Returns : |
|
int shishi_as_key_cnamerealmsname (Shishi *handle, Shishi_key *key, Shishi_as **as, char *cname, char *realm, char *sname);
handle : | |
key : | |
as : | |
cname : | |
realm : | |
sname : | |
Returns : |
|
int shishi_as_cnamerealmsname (Shishi *handle, char *password, Shishi_key *key, Shishi_as **as, char *cname, char *realm, char *sname);
handle : | |
password : | |
key : | |
as : | |
cname : | |
realm : | |
sname : | |
Returns : |
|
int shishi_as_sendrecv (Shishi_as *as);
Send AS-REQ and receive AS-REP or KRB-ERROR. This is the initial authentication, usually used to acquire a Ticket Granting Ticket.
as : | structure that holds information about AS exchange |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_as_rep_process (Shishi_as *as, Shishi_key *key, const char *password);
Process new AS-REP and set ticket. The key is used to decrypt the AP-REP. If both key and password is NULL, the user is queried for it.
as : | structure that holds information about AS exchange |
key : | user's key, used to encrypt the encrypted part of the AS-REP. |
password : | user's password, used if key is NULL. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_tgs (Shishi *handle, Shishi_tgs **tgs);
Allocate a new TGS exchange variable.
handle : | shishi handle as allocated by shishi_init(). |
tgs : | holds pointer to newly allocate Shishi_tgs structure. |
Returns : | Returns SHISHI_OK iff successful. |
Shishi_tkt* shishi_tgs_tgtkt (Shishi_tgs *tgs);
tgs : | structure that holds information about TGS exchange |
Returns : | Returns the ticket-granting-ticket used in the TGS exchange, or NULL if not yet set or an error occured. |
void shishi_tgs_tgtkt_set (Shishi_tgs *tgs, Shishi_tkt *tgtkt);
Set the Ticket in the AP exchange.
tgs : | structure that holds information about TGS exchange |
tgtkt : | ticket granting ticket to store in TGS. |
Shishi_ap* shishi_tgs_ap (Shishi_tgs *tgs);
tgs : | structure that holds information about TGS exchange |
Returns : | Returns the AP exchange (part of TGS-REQ) from the TGS exchange, or NULL if not yet set or an error occured. |
Shishi_asn1 shishi_tgs_req (Shishi_tgs *tgs);
tgs : | structure that holds information about TGS exchange |
Returns : | Returns the generated TGS-REQ from the TGS exchange, or NULL if not yet set or an error occured. |
int shishi_tgs_req_build (Shishi_tgs *tgs);
Checksum data in authenticator and add ticket and authenticator to TGS-REQ.
tgs : | structure that holds information about TGS exchange |
Returns : | Returns SHISHI_OK iff successful. |
Shishi_asn1 shishi_tgs_rep (Shishi_tgs *tgs);
tgs : | structure that holds information about TGS exchange |
Returns : | Returns the received TGS-REP from the TGS exchange, or NULL if not yet set or an error occured. |
int shishi_tgs_rep_process (Shishi_tgs *tgs);
Process new TGS-REP and set ticket. The key to decrypt the TGS-REP is taken from the EncKDCRepPart of the TGS tgticket.
tgs : | structure that holds information about TGS exchange |
Returns : | Returns SHISHI_OK iff successful. |
Shishi_asn1 shishi_tgs_krberror (Shishi_tgs *tgs);
tgs : | structure that holds information about TGS exchange |
Returns : | Returns the received TGS-REP from the TGS exchange, or NULL if not yet set or an error occured. |
Shishi_tkt* shishi_tgs_tkt (Shishi_tgs *tgs);
tgs : | structure that holds information about TGS exchange |
Returns : | Returns the newly aquired ticket from the TGS exchange, or NULL if not yet set or an error occured. |
void shishi_tgs_tkt_set (Shishi_tgs *tgs, Shishi_tkt *tkt);
Set the Ticket in the AP exchange.
tgs : | structure that holds information about TGS exchange |
tkt : | ticket to store in TGS. |
int shishi_tgs_sendrecv (Shishi_tgs *tgs);
Send TGS-REQ and receive TGS-REP or KRB-ERROR. This is the subsequent authentication, usually used to acquire server tickets.
tgs : | structure that holds information about TGS exchange |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_tgs_set_server (Shishi_tgs *tgs, const char *server);
Set the server in the TGS-REQ.
tgs : | structure that holds information about TGS exchange |
server : | indicates the server to acquire ticket for. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_tgs_set_realm (Shishi_tgs *tgs, const char *realm);
Set the server in the TGS-REQ.
tgs : | structure that holds information about TGS exchange |
realm : | indicates the realm to acquire ticket for. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_tgs_set_realmserver (Shishi_tgs *tgs, const char *realm, const char *server);
Set the realm and server in the TGS-REQ.
tgs : | structure that holds information about TGS exchange |
realm : | indicates the realm to acquire ticket for. |
server : | indicates the server to acquire ticket for. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_kdcreq (Shishi *handle, char *realm, char *service, Shishi_asn1 *req);
handle : | |
realm : | |
service : | |
req : | |
Returns : |
|
Shishi_asn1 shishi_asreq (Shishi *handle);
This function creates a new AS-REQ, populated with some default values.
handle : | shishi handle as allocated by shishi_init(). |
Returns : | Returns the AS-REQ or NULL on failure. |
Shishi_asn1 shishi_asreq_rsc (Shishi *handle, char *realm, char *server, char *client);
handle : | |
realm : | |
server : | |
client : | |
Returns : |
|
Shishi_asn1 shishi_tgsreq (Shishi *handle);
This function creates a new TGS-REQ, populated with some default values.
handle : | shishi handle as allocated by shishi_init(). |
Returns : | Returns the TGS-REQ or NULL on failure. |
Shishi_asn1 shishi_tgsreq_rst (Shishi *handle, char *realm, char *server, Shishi_tkt *tkt);
handle : | |
realm : | |
server : | |
tkt : | |
Returns : |
|
int shishi_kdcreq_save (Shishi *handle, FILE *fh, Shishi_asn1 kdcreq);
Print DER encoding of KDC-REQ to file.
handle : | shishi handle as allocated by shishi_init(). |
fh : | file handle open for writing. |
kdcreq : | KDC-REQ to save. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_kdcreq_print (Shishi *handle, FILE *fh, Shishi_asn1 kdcreq);
Print ASCII armored DER encoding of KDC-REQ to file.
handle : | shishi handle as allocated by shishi_init(). |
fh : | file handle open for writing. |
kdcreq : | KDC-REQ to print. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_kdcreq_to_file (Shishi *handle, Shishi_asn1 kdcreq, int filetype, char *filename);
Write KDC-REQ to file in specified TYPE. The file will be truncated if it exists.
handle : | shishi handle as allocated by shishi_init(). |
kdcreq : | KDC-REQ to save. |
filetype : | input variable specifying type of file to be written, see Shishi_filetype. |
filename : | input variable with filename to write to. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_kdcreq_parse (Shishi *handle, FILE *fh, Shishi_asn1 *kdcreq);
Read ASCII armored DER encoded KDC-REQ from file and populate given variable.
handle : | shishi handle as allocated by shishi_init(). |
fh : | file handle open for reading. |
kdcreq : | output variable with newly allocated KDC-REQ. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_kdcreq_read (Shishi *handle, FILE *fh, Shishi_asn1 *kdcreq);
Read DER encoded KDC-REQ from file and populate given variable.
handle : | shishi handle as allocated by shishi_init(). |
fh : | file handle open for reading. |
kdcreq : | output variable with newly allocated KDC-REQ. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_kdcreq_from_file (Shishi *handle, Shishi_asn1 *kdcreq, int filetype, char *filename);
Read KDC-REQ from file in specified TYPE.
handle : | shishi handle as allocated by shishi_init(). |
kdcreq : | output variable with newly allocated KDC-REQ. |
filetype : | input variable specifying type of file to be read, see Shishi_filetype. |
filename : | input variable with filename to read from. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_asreq_cnamerealm_get (Shishi *handle, Shishi_asn1 kdcreq, char *cnamerealm, size_t *cnamerealmlen);
handle : | |
kdcreq : | |
cnamerealm : | |
cnamerealmlen : | |
Returns : |
|
int shishi_kdcreq_nonce (Shishi *handle, Shishi_asn1 kdcreq, uint32_t *nonce);
handle : | |
kdcreq : | |
nonce : | |
Returns : |
|
int shishi_kdcreq_cname_get (Shishi *handle, Shishi_asn1 kdcreq, char *cname, size_t *cnamelen);
handle : | |
kdcreq : | |
cname : | |
cnamelen : | |
Returns : |
|
int shishi_kdcreq_set_cname (Shishi *handle, Shishi_asn1 kdcreq, Shishi_name_type name_type, const char *principal);
Set the client name field in the KDC-REQ.
handle : | shishi handle as allocated by shishi_init(). |
kdcreq : | KDC-REQ variable to set client name field in. |
name_type : | type of principial, see Shishi_name_type, usually SHISHI_NT_UNKNOWN. |
principal : | input array with principal name. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_kdcreq_sname_get (Shishi *handle, Shishi_asn1 kdcreq, char *sname, size_t *snamelen);
handle : | |
kdcreq : | |
sname : | |
snamelen : | |
Returns : |
|
int shishi_kdcreq_snamerealm_get (Shishi *handle, Shishi_asn1 kdcreq, char *snamerealm, size_t *snamerealmlen);
handle : | |
kdcreq : | |
snamerealm : | |
snamerealmlen : | |
Returns : |
|
int shishi_kdcreq_set_sname (Shishi *handle, Shishi_asn1 kdcreq, Shishi_name_type name_type, const char *sname[]);
Set the server name field in the KDC-REQ.
handle : | shishi handle as allocated by shishi_init(). |
kdcreq : | KDC-REQ variable to set server name field in. |
name_type : | type of principial, see Shishi_name_type, usually SHISHI_NT_UNKNOWN. |
sname : | input array with principal name. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_kdcreq_realm_get (Shishi *handle, Shishi_asn1 kdcreq, char *realm, int *realmlen);
handle : | |
kdcreq : | |
realm : | |
realmlen : | |
Returns : |
|
int shishi_kdcreq_set_realm (Shishi *handle, Shishi_asn1 kdcreq, const char *realm);
Set the realm field in the KDC-REQ.
handle : | shishi handle as allocated by shishi_init(). |
kdcreq : | KDC-REQ variable to set realm field in. |
realm : | input array with name of realm. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_kdcreq_set_server (Shishi *handle, Shishi_asn1 req, const char *service);
handle : | |
req : | |
service : | |
Returns : |
|
int shishi_kdcreq_set_realmserver (Shishi *handle, Shishi_asn1 req, char *realm, char *service);
handle : | |
req : | |
realm : | |
service : | |
Returns : |
|
int shishi_kdcreq_etype (Shishi *handle, Shishi_asn1 kdcreq, int32_t *etype, int netype);
Return the netype:th encryption type from KDC-REQ. The first etype is number 1.
handle : | shishi handle as allocated by shishi_init(). |
kdcreq : | KDC-REQ variable to get etype field from. |
etype : | output encryption type. |
netype : | element number to return. |
Returns : | Returns SHISHI_OK iff etype successful set. |
int shishi_kdcreq_set_etype (Shishi *handle, Shishi_asn1 kdcreq, int32_t *etype, int netype);
Set the list of supported or wanted encryption types in the request. The list should be sorted in priority order.
handle : | shishi handle as allocated by shishi_init(). |
kdcreq : | KDC-REQ variable to set etype field in. |
etype : | input array with encryption types. |
netype : | number of elements in input array with encryption types. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_kdcreq_options (Shishi *handle, Shishi_asn1 kdcreq, int *flags);
handle : | |
kdcreq : | |
flags : | |
Returns : |
|
int shishi_kdcreq_renewable_p (Shishi *handle, Shishi_asn1 kdcreq);
handle : | |
kdcreq : | |
Returns : |
|
int shishi_kdcreq_options_set (Shishi *handle, Shishi_asn1 kdcreq, int options);
handle : | |
kdcreq : | |
options : | |
Returns : |
|
int shishi_kdcreq_options_add (Shishi *handle, Shishi_asn1 kdcreq, int option);
handle : | |
kdcreq : | |
option : | |
Returns : |
|
int shishi_kdcreq_clear_padata (Shishi *handle, Shishi_asn1 kdcreq);
Remove the padata field from KDC-REQ.
handle : | shishi handle as allocated by shishi_init(). |
kdcreq : | KDC-REQ to remove PA-DATA from. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_kdcreq_add_padata (Shishi *handle, Shishi_asn1 kdcreq, int padatatype, char *data, int datalen);
Add new pre authentication data (PA-DATA) to KDC-REQ. This is used to pass various information to KDC, such as in case of a SHISHI_PA_TGS_REQ padatatype the AP-REQ that authenticates the user to get the ticket. (But also see shishi_kdcreq_add_padata_tgs() which takes an AP-REQ directly.)
handle : | shishi handle as allocated by shishi_init(). |
kdcreq : | KDC-REQ to add PA-DATA to. |
padatatype : | type of PA-DATA, see Shishi_padata_type. |
data : | input array with PA-DATA value. |
datalen : | size of input array with PA-DATA value. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_kdcreq_add_padata_tgs (Shishi *handle, Shishi_asn1 kdcreq, Shishi_asn1 apreq);
Add TGS pre-authentication data to KDC-REQ. The data is an AP-REQ that authenticates the request. This functions simply DER encodes the AP-REQ and calls shishi_kdcreq_add_padata() with a SHISHI_PA_TGS_REQ padatatype.
handle : | shishi handle as allocated by shishi_init(). |
kdcreq : | KDC-REQ to add PA-DATA to. |
apreq : | AP-REQ to add as PA-DATA. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_kdcreq_build (Shishi *handle, Shishi_asn1 kdcreq);
handle : | |
kdcreq : | |
Returns : |
|
int shishi_enckdcreppart_srealmserver_set (Shishi *handle, Shishi_asn1 enckdcreppart, const char *srealm, const char *server);
handle : | |
enckdcreppart : | |
srealm : | |
server : | |
Returns : |
|
int shishi_enckdcreppart_nonce_set (Shishi *handle, Shishi_asn1 enckdcreppart, uint32_t nonce);
Set the EncKDCRepPart.nonce field.
handle : | shishi handle as allocated by shishi_init(). |
enckdcreppart : | input EncKDCRepPart variable. |
nonce : | nonce to set in EncKDCRepPart. |
Returns : | Returns SHISHI_OK iff succesful. |
int shishi_enckdcreppart_populate_encticketpart (Shishi *handle, Shishi_asn1 enckdcreppart, Shishi_asn1 encticketpart);
Set the flags, authtime, starttime, endtime, renew-till and caddr fields of the EncKDCRepPart to the corresponding values in the EncTicketPart.
handle : | shishi handle as allocated by shishi_init(). |
enckdcreppart : | input EncKDCRepPart variable. |
encticketpart : | input EncTicketPart variable. |
Returns : | Returns SHISHI_OK iff succesful. |
int shishi_enckdcreppart_flags_set (Shishi *handle, Shishi_asn1 enckdcreppart, int flags);
Set the EncKDCRepPart.flags field.
handle : | shishi handle as allocated by shishi_init(). |
enckdcreppart : | input EncKDCRepPart variable. |
flags : | flags to set in EncKDCRepPart. |
Returns : | Returns SHISHI_OK iff succesful. |
int shishi_as_derive_salt (Shishi *handle, Shishi_asn1 asreq, Shishi_asn1 asrep, char *salt, size_t *saltlen);
Derive the salt that should be used when deriving a key via shishi_string_to_key() for an AS exchange. Currently this searches for PA-DATA of type SHISHI_PA_PW_SALT in the AS-REP and returns it if found, otherwise the salt is derived from the client name and realm in AS-REQ.
handle : | shishi handle as allocated by shishi_init(). |
asreq : | input AS-REQ variable. |
asrep : | input AS-REP variable. |
salt : | output array with salt. |
saltlen : | on input, maximum size of output array with salt, on output, holds actual size of output array with salt. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_tgs_process (Shishi *handle, Shishi_asn1 tgsreq, Shishi_asn1 tgsrep, Shishi_asn1 oldenckdcreppart, Shishi_asn1 *enckdcreppart);
Process a TGS client exchange and output decrypted EncKDCRepPart which holds details for the new ticket received. This function simply derives the encryption key from the ticket used to construct the TGS request and calls shishi_kdc_process(), which see.
handle : | shishi handle as allocated by shishi_init(). |
tgsreq : | input variable that holds the sent KDC-REQ. |
tgsrep : | input variable that holds the received KDC-REP. |
oldenckdcreppart : | input variable with EncKDCRepPart used in request. |
enckdcreppart : | output variable that holds new EncKDCRepPart. |
Returns : | Returns SHISHI_OK iff the TGS client exchange was successful. |
int shishi_as_process (Shishi *handle, Shishi_asn1 asreq, Shishi_asn1 asrep, const char *string, Shishi_asn1 *enckdcreppart);
Process an AS client exchange and output decrypted EncKDCRepPart which holds details for the new ticket received. This function simply derives the encryption key from the password and calls shishi_kdc_process(), which see.
handle : | shishi handle as allocated by shishi_init(). |
asreq : | input variable that holds the sent KDC-REQ. |
asrep : | input variable that holds the received KDC-REP. |
string : | input variable with zero terminated password. |
enckdcreppart : | output variable that holds new EncKDCRepPart. |
Returns : | Returns SHISHI_OK iff the AS client exchange was successful. |
int shishi_kdc_process (Shishi *handle, Shishi_asn1 kdcreq, Shishi_asn1 kdcrep, Shishi_key *key, int keyusage, Shishi_asn1 *enckdcreppart);
Process a KDC client exchange and output decrypted EncKDCRepPart which holds details for the new ticket received. Use shishi_kdcrep_get_ticket() to extract the ticket. This function verifies the various conditions that must hold if the response is to be considered valid, specifically it compares nonces (shishi_check_nonces()) and if the exchange was a AS exchange, it also compares cname and crealm (shishi_check_cname() and shishi_check_crealm()).
Usually the shishi_as_process() and shishi_tgs_process() functions should be used instead, since they simplify the decryption key computation.
handle : | shishi handle as allocated by shishi_init(). |
kdcreq : | input variable that holds the sent KDC-REQ. |
kdcrep : | input variable that holds the received KDC-REP. |
key : | input array with key to decrypt encrypted part of KDC-REP with. |
keyusage : | kereros key usage value. |
enckdcreppart : | output variable that holds new EncKDCRepPart. |
Returns : | Returns SHISHI_OK iff the KDC client exchange was successful. |
int shishi_kdcreq_sendrecv (Shishi *handle, Shishi_asn1 kdcreq, Shishi_asn1 *kdcrep);
handle : | |
kdcreq : | |
kdcrep : | |
Returns : |
|
int shishi_kdc_copy_crealm (Shishi *handle, Shishi_asn1 kdcrep, Shishi_asn1 encticketpart);
Set crealm in KDC-REP to value in EncTicketPart.
handle : | shishi handle as allocated by shishi_init(). |
kdcrep : | KDC-REP to read crealm from. |
encticketpart : | EncTicketPart to set crealm in. |
Returns : | Returns SHISHI_OK if successful. |
int shishi_as_check_crealm (Shishi *handle, Shishi_asn1 asreq, Shishi_asn1 asrep);
Verify that AS-REQ.req-body.realm and AS-REP.crealm fields matches. This is one of the steps that has to be performed when processing a AS-REQ and AS-REP exchange, see shishi_kdc_process().
handle : | shishi handle as allocated by shishi_init(). |
asreq : | AS-REQ to compare realm field in. |
asrep : | AS-REP to compare realm field in. |
Returns : | Returns SHISHI_OK if successful, SHISHI_REALM_MISMATCH if the values differ, or an error code. |
int shishi_kdc_copy_cname (Shishi *handle, Shishi_asn1 kdcrep, Shishi_asn1 encticketpart);
Set cname in KDC-REP to value in EncTicketPart.
handle : | shishi handle as allocated by shishi_init(). |
kdcrep : | KDC-REQ to read cname from. |
encticketpart : | EncTicketPart to set cname in. |
Returns : | Returns SHISHI_OK if successful. |
int shishi_as_check_cname (Shishi *handle, Shishi_asn1 asreq, Shishi_asn1 asrep);
Verify that AS-REQ.req-body.realm and AS-REP.crealm fields matches. This is one of the steps that has to be performed when processing a AS-REQ and AS-REP exchange, see shishi_kdc_process().
handle : | shishi handle as allocated by shishi_init(). |
asreq : | AS-REQ to compare client name field in. |
asrep : | AS-REP to compare client name field in. |
Returns : | Returns SHISHI_OK if successful, SHISHI_CNAME_MISMATCH if the values differ, or an error code. |
int shishi_kdc_copy_nonce (Shishi *handle, Shishi_asn1 kdcreq, Shishi_asn1 enckdcreppart);
Set nonce in EncKDCRepPart to value in KDC-REQ.
handle : | shishi handle as allocated by shishi_init(). |
kdcreq : | KDC-REQ to read nonce from. |
enckdcreppart : | EncKDCRepPart to set nonce in. |
Returns : | Returns SHISHI_OK if successful. |
int shishi_kdc_check_nonce (Shishi *handle, Shishi_asn1 kdcreq, Shishi_asn1 enckdcreppart);
Verify that KDC-REQ.req-body.nonce and EncKDCRepPart.nonce fields matches. This is one of the steps that has to be performed when processing a KDC-REQ and KDC-REP exchange.
handle : | shishi handle as allocated by shishi_init(). |
kdcreq : | KDC-REQ to compare nonce field in. |
enckdcreppart : | Encrypted KDC-REP part to compare nonce field in. |
Returns : | Returns SHISHI_OK if successful, SHISHI_NONCE_LENGTH_MISMATCH if the nonces have different lengths (usually indicates that buggy server truncated nonce to 4 bytes), SHISHI_NONCE_MISMATCH if the values differ, or an error code. |
Shishi_asn1 shishi_asrep (Shishi *handle);
This function creates a new AS-REP, populated with some default values.
handle : | shishi handle as allocated by shishi_init(). |
Returns : | Returns the AS-REP or NULL on failure. |
Shishi_asn1 shishi_tgsrep (Shishi *handle);
This function creates a new TGS-REP, populated with some default values.
handle : | shishi handle as allocated by shishi_init(). |
Returns : | Returns the TGS-REP or NULL on failure. |
int shishi_kdcrep_save (Shishi *handle, FILE *fh, Shishi_asn1 kdcrep);
Print DER encoding of KDC-REP to file.
handle : | shishi handle as allocated by shishi_init(). |
fh : | file handle open for writing. |
kdcrep : | KDC-REP to save. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_kdcrep_print (Shishi *handle, FILE *fh, Shishi_asn1 kdcrep);
Print ASCII armored DER encoding of KDC-REP to file.
handle : | shishi handle as allocated by shishi_init(). |
fh : | file handle open for writing. |
kdcrep : | KDC-REP to print. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_kdcrep_to_file (Shishi *handle, Shishi_asn1 kdcrep, int filetype, char *filename);
Write KDC-REP to file in specified TYPE. The file will be truncated if it exists.
handle : | shishi handle as allocated by shishi_init(). |
kdcrep : | KDC-REP to save. |
filetype : | input variable specifying type of file to be written, see Shishi_filetype. |
filename : | input variable with filename to write to. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_kdcrep_parse (Shishi *handle, FILE *fh, Shishi_asn1 *kdcrep);
Read ASCII armored DER encoded KDC-REP from file and populate given variable.
handle : | shishi handle as allocated by shishi_init(). |
fh : | file handle open for reading. |
kdcrep : | output variable with newly allocated KDC-REP. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_kdcrep_read (Shishi *handle, FILE *fh, Shishi_asn1 *kdcrep);
Read DER encoded KDC-REP from file and populate given variable.
handle : | shishi handle as allocated by shishi_init(). |
fh : | file handle open for reading. |
kdcrep : | output variable with newly allocated KDC-REP. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_kdcrep_from_file (Shishi *handle, Shishi_asn1 *kdcrep, int filetype, char *filename);
Read KDC-REP from file in specified TYPE.
handle : | shishi handle as allocated by shishi_init(). |
kdcrep : | output variable with newly allocated KDC-REP. |
filetype : | input variable specifying type of file to be read, see Shishi_filetype. |
filename : | input variable with filename to read from. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_kdcrep_clear_padata (Shishi *handle, Shishi_asn1 kdcrep);
Remove the padata field from KDC-REP.
handle : | shishi handle as allocated by shishi_init(). |
kdcrep : | KDC-REP to remove PA-DATA from. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_kdcrep_get_enc_part_etype (Shishi *handle, Shishi_asn1 kdcrep, int32_t *etype);
Extract KDC-REP.enc-part.etype.
handle : | shishi handle as allocated by shishi_init(). |
kdcrep : | KDC-REP variable to get value from. |
etype : | output variable that holds the value. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_kdcrep_add_enc_part (Shishi *handle, Shishi_asn1 kdcrep, Shishi_key *key, int keyusage, Shishi_asn1 enckdcreppart);
Encrypts DER encoded EncKDCRepPart using key and stores it in the KDC-REP.
handle : | shishi handle as allocated by shishi_init(). |
kdcrep : | KDC-REP to add enc-part field to. |
key : | key used to encrypt enc-part. |
keyusage : | key usage to use, normally SHISHI_KEYUSAGE_ENCASREPPART, SHISHI_KEYUSAGE_ENCTGSREPPART_SESSION_KEY or SHISHI_KEYUSAGE_ENCTGSREPPART_AUTHENTICATOR_KEY. |
enckdcreppart : | EncKDCRepPart to add. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_kdcrep_get_ticket (Shishi *handle, Shishi_asn1 kdcrep, Shishi_asn1 *ticket);
Extract ticket from KDC-REP.
handle : | shishi handle as allocated by shishi_init(). |
kdcrep : | KDC-REP variable to get ticket from. |
ticket : | output variable to hold extracted ticket. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_kdcrep_set_ticket (Shishi *handle, Shishi_asn1 kdcrep, Shishi_asn1 ticket);
Copy ticket into KDC-REP.
handle : | shishi handle as allocated by shishi_init(). |
kdcrep : | KDC-REP to add ticket field to. |
ticket : | input ticket to copy into KDC-REP ticket field. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_kdcrep_crealm_set (Shishi *handle, Shishi_asn1 kdcrep, const char *crealm);
Set the client realm field in the KDC-REP.
handle : | shishi handle as allocated by shishi_init(). |
kdcrep : | Kdcrep variable to set realm field in. |
crealm : | input array with name of realm. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_kdcrep_cname_set (Shishi *handle, Shishi_asn1 kdcrep, Shishi_name_type name_type, const char *cname[]);
Set the server name field in the KDC-REP.
handle : | shishi handle as allocated by shishi_init(). |
kdcrep : | Kdcrep variable to set server name field in. |
name_type : | type of principial, see Shishi_name_type, usually SHISHI_NT_UNKNOWN. |
cname : | input array with principal name. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_kdcrep_client_set (Shishi *handle, Shishi_asn1 kdcrep, const char *client);
Set the client name field in the KDC-REP.
handle : | shishi handle as allocated by shishi_init(). |
kdcrep : | Kdcrep variable to set server name field in. |
client : | zero-terminated string with principal name on RFC 1964 form. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_kdcrep_crealmserver_set (Shishi *handle, Shishi_asn1 kdcrep, const char *crealm, const char *client);
handle : | |
kdcrep : | |
crealm : | |
client : | |
Returns : |
|
int shishi_kdcrep_set_enc_part (Shishi *handle, Shishi_asn1 kdcrep, int etype, int kvno, char *buf, int buflen);
Set the encrypted enc-part field in the KDC-REP. The encrypted data is usually created by calling shishi_encrypt() on the DER encoded enc-part. To save time, you may want to use shishi_kdcrep_add_enc_part() instead, which calculates the encrypted data and calls this function in one step.
handle : | shishi handle as allocated by shishi_init(). |
kdcrep : | KDC-REP to add enc-part field to. |
etype : | encryption type used to encrypt enc-part. |
kvno : | key version number. |
buf : | input array with encrypted enc-part. |
buflen : | size of input array with encrypted enc-part. |
Returns : | Returns SHISHI_OK iff successful. |
Shishi_asn1 shishi_krberror (Shishi *handle);
This function creates a new KRB-ERROR, populated with some default values.
handle : | shishi handle as allocated by shishi_init(). |
Returns : | Returns the KRB-ERROR or NULL on failure. |
int shishi_krberror_print (Shishi *handle, FILE *fh, Shishi_asn1 krberror);
Print ASCII armored DER encoding of KRB-ERROR to file.
handle : | shishi handle as allocated by shishi_init(). |
fh : | file handle open for writing. |
krberror : | KRB-ERROR to print. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_krberror_save (Shishi *handle, FILE *fh, Shishi_asn1 krberror);
Save DER encoding of KRB-ERROR to file.
handle : | shishi handle as allocated by shishi_init(). |
fh : | file handle open for writing. |
krberror : | KRB-ERROR to save. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_krberror_to_file (Shishi *handle, Shishi_asn1 krberror, int filetype, char *filename);
Write KRB-ERROR to file in specified TYPE. The file will be truncated if it exists.
handle : | shishi handle as allocated by shishi_init(). |
krberror : | KRB-ERROR to save. |
filetype : | input variable specifying type of file to be written, see Shishi_filetype. |
filename : | input variable with filename to write to. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_krberror_parse (Shishi *handle, FILE *fh, Shishi_asn1 *krberror);
Read ASCII armored DER encoded KRB-ERROR from file and populate given variable.
handle : | shishi handle as allocated by shishi_init(). |
fh : | file handle open for reading. |
krberror : | output variable with newly allocated KRB-ERROR. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_krberror_read (Shishi *handle, FILE *fh, Shishi_asn1 *krberror);
Read DER encoded KRB-ERROR from file and populate given variable.
handle : | shishi handle as allocated by shishi_init(). |
fh : | file handle open for reading. |
krberror : | output variable with newly allocated KRB-ERROR. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_krberror_from_file (Shishi *handle, Shishi_asn1 *krberror, int filetype, char *filename);
Read KRB-ERROR from file in specified TYPE.
handle : | shishi handle as allocated by shishi_init(). |
krberror : | output variable with newly allocated KRB-ERROR. |
filetype : | input variable specifying type of file to be read, see Shishi_filetype. |
filename : | input variable with filename to read from. |
Returns : | Returns SHISHI_OK iff successful. |
const char* shishi_krberror_errorcode_message (Shishi *handle, int errorcode);
handle : | shishi handle as allocated by shishi_init(). |
errorcode : | integer KRB-ERROR error code. |
Returns : | Return a string describing error code. This function will always return a string even if the error code isn't known. |
const char* shishi_krberror_message (Shishi *handle, Shishi_asn1 krberror);
Extract error code (see shishi_krberror_errorcode_fast()) and return error message (see shishi_krberror_errorcode_message()).
handle : | shishi handle as allocated by shishi_init(). |
krberror : | KRB-ERROR structure with error code. |
Returns : | Return a string describing error code. This function will always return a string even if the error code isn't known. |
int shishi_krberror_etext (Shishi *handle, Shishi_asn1 krberror, char *etext, size_t *etextlen);
Extract additional error text from server (possibly empty).
handle : | shishi handle as allocated by shishi_init(). |
krberror : | KRB-ERROR structure with error code. |
etext : | output array with error text. |
etextlen : | on input, maximum size of output array with error text, on output, actual size of output array with error text. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_krberror_errorcode (Shishi *handle, Shishi_asn1 krberror, int *errorcode);
Extract error code from KRB-ERROR.
handle : | shishi handle as allocated by shishi_init(). |
krberror : | KRB-ERROR structure with error code. |
errorcode : | output integer KRB-ERROR error code. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_krberror_errorcode_fast (Shishi *handle, Shishi_asn1 krberror);
handle : | shishi handle as allocated by shishi_init(). |
krberror : | KRB-ERROR structure with error code. |
Returns : | Return error code (see shishi_krberror_errorcode()) directly, or -1 on error. |
int shishi_krberror_pretty_print (Shishi *handle, FILE *fh, Shishi_asn1 krberror);
Print KRB-ERROR error condition and some explanatory text to file descriptor.
handle : | shishi handle as allocated by shishi_init(). |
fh : | file handle opened for writing. |
krberror : | KRB-ERROR structure with error code. |
Returns : | Returns SHISHI_OK iff successful. |
void shishi_to_base64 (unsigned char *out, unsigned char *in, int len, int olen);
out : | |
in : | |
len : | |
olen : |
|
int shishi_from_base64 (unsigned char *out, unsigned char *in);
out : | |
in : | |
Returns : |
|
int shishi_asprintf (char **result, char *format, ...);
result : | |
format : | |
... : | |
Returns : |
|
const char* shishi_generalize_time (Shishi *handle, time_t t);
handle : | |
t : | |
Returns : |
|
time_t shishi_generalize_ctime (Shishi *handle, const char *t);
handle : | |
t : | |
Returns : |
|
int shishi_cipher_supported_p (int type);
type : | encryption type, see Shishi_etype. |
Returns : | Return 0 iff cipher is unsupported. |
const char* shishi_cipher_name (int type);
type : | encryption type, see Shishi_etype. |
Returns : | Return name of encryption type, e.g. "des3-cbc-sha1-kd", as defined in the standards. |
int shishi_cipher_blocksize (int type);
type : | encryption type, see Shishi_etype. |
Returns : | Return block size for encryption type, as defined in the standards. |
int shishi_cipher_minpadsize (int type);
type : | encryption type, see Shishi_etype. |
Returns : | Return the minimum pad size for encryption type, as defined in the standards. |
int shishi_cipher_confoundersize (int type);
type : | encryption type, see Shishi_etype. |
Returns : | Returns the size of the confounder (random data) for encryption type, as defined in the standards. |
size_t shishi_cipher_keylen (int type);
type : | encryption type, see Shishi_etype. |
Returns : | Return length of key used for the encryption type, as defined in the standards. |
size_t shishi_cipher_randomlen (int type);
type : | encryption type, see Shishi_etype. |
Returns : | Return length of random used for the encryption type, as defined in the standards. |
int shishi_cipher_defaultcksumtype (int32_t type);
type : | encryption type, see Shishi_etype. |
Returns : | Return associated checksum mechanism for the encryption type, as defined in the standards. |
int shishi_cipher_parse (const char *cipher);
cipher : | name of encryption type, e.g. "des3-cbc-sha1-kd". |
Returns : | Return encryption type corresponding to a string. |
int shishi_checksum_supported_p (int32_t type);
type : | encryption type, see Shishi_etype. |
Returns : | Return 0 iff checksum is unsupported. |
const char* shishi_checksum_name (int32_t type);
type : | encryption type, see Shishi_etype. |
Returns : | Return name of checksum type, e.g. "hmac-sha1-96-aes256", as defined in the standards. |
size_t shishi_checksum_cksumlen (int32_t type);
type : | encryption type, see Shishi_etype. |
Returns : | Return length of checksum used for the encryption type, as defined in the standards. |
int shishi_checksum_parse (const char *checksum);
checksum : | name of checksum type, e.g. "hmac-sha1-96-aes256". |
Returns : | Return checksum type corresponding to a string. |
int shishi_string_to_key (Shishi *handle, int32_t keytype, const char *password, size_t passwordlen, const char *salt, size_t saltlen, const char *parameter, Shishi_key *outkey);
Derive key from a string (password) and salt (commonly concatenation of realm and principal) for specified key type, and set the type and value in the given key to the computed values. The parameter value is specific for each keytype, and can be set if the parameter information is not available.
handle : | shishi handle as allocated by shishi_init(). |
keytype : | cryptographic encryption type, see Shishi_etype. |
password : | input array with password. |
passwordlen : | length of input array with password. |
salt : | input array with salt. |
saltlen : | length of input array with salt. |
parameter : | input array with opaque encryption type specific information. |
outkey : | allocated key handle that will contain new key. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_random_to_key (Shishi *handle, int32_t keytype, char *random, size_t randomlen, Shishi_key *outkey);
Derive key from random data for specified key type, and set the type and value in the given key to the computed values.
handle : | shishi handle as allocated by shishi_init(). |
keytype : | cryptographic encryption type, see Shishi_etype. |
random : | input array with random data. |
randomlen : | length of input array with random data. |
outkey : | allocated key handle that will contain new key. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_encrypt (Shishi *handle, Shishi_key *key, int keyusage, char *in, size_t inlen, char **out, size_t *outlen);
Encrypts data using key, possibly altered by supplied key usage. If key usage is 0, no key derivation is used.
If OUT is NULL, this functions only set OUTLEN. This usage may be used by the caller to allocate the proper buffer size.
handle : | shishi handle as allocated by shishi_init(). |
key : | key to encrypt with. |
keyusage : | integer specifying what this key is encrypting. |
in : | input array with data to encrypt. |
inlen : | size of input array with data to encrypt. |
out : | output array with encrypted data. |
outlen : | on input, holds maximum size of output array, on output, holds actual size of output array. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_encrypt_iv (Shishi *handle, Shishi_key *key, int keyusage, char *iv, size_t ivlen, char *in, size_t inlen, char **out, size_t *outlen);
handle : | |
key : | |
keyusage : | |
iv : | |
ivlen : | |
in : | |
inlen : | |
out : | |
outlen : | |
Returns : |
|
int shishi_encrypt_iv_etype (Shishi *handle, Shishi_key *key, int keyusage, int32_t etype, char *iv, size_t ivlen, char *in, size_t inlen, char **out, size_t *outlen);
Encrypts data using key, possibly altered by supplied key usage. If key usage is 0, no key derivation is used.
If OUT is NULL, this functions only set OUTLEN. This usage may be used by the caller to allocate the proper buffer size.
handle : | shishi handle as allocated by shishi_init(). |
key : | key to encrypt with. |
keyusage : | integer specifying what this key is encrypting. |
etype : | integer specifying what decryption method to use. |
iv : | input array with initialization vector. |
ivlen : | size of input array with initialization vector. |
in : | input array with data to encrypt. |
inlen : | size of input array with data to encrypt. |
out : | output array with encrypted data. |
outlen : | on input, holds maximum size of output array, on output, holds actual size of output array. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_decrypt (Shishi *handle, Shishi_key *key, int keyusage, char *in, size_t inlen, char **out, size_t *outlen);
Decrypts data using key, possibly altered by supplied key usage. If key usage is 0, no key derivation is used.
If OUT is NULL, this functions only set OUTLEN. This usage may be used by the caller to allocate the proper buffer size.
handle : | shishi handle as allocated by shishi_init(). |
key : | key to decrypt with. |
keyusage : | integer specifying what this key is decrypting. |
in : | input array with data to decrypt. |
inlen : | size of input array with data to decrypt. |
out : | output array with decrypted data. |
outlen : | on input, holds maximum size of output array, on output, holds actual size of output array. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_decrypt_iv (Shishi *handle, Shishi_key *key, int keyusage, char *iv, size_t ivlen, char *in, size_t inlen, char **out, size_t *outlen);
Decrypts data using key, possibly altered by supplied key usage. If key usage is 0, no key derivation is used.
If OUT is NULL, this functions only set OUTLEN. This usage may be used by the caller to allocate the proper buffer size.
handle : | shishi handle as allocated by shishi_init(). |
key : | key to decrypt with. |
keyusage : | integer specifying what this key is decrypting. |
iv : | input array with initialization vector. |
ivlen : | size of input array with initialization vector. |
in : | input array with data to decrypt. |
inlen : | size of input array with data to decrypt. |
out : | output array with decrypted data. |
outlen : | on input, holds maximum size of output array, on output, holds actual size of output array. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_decrypt_iv_etype (Shishi *handle, Shishi_key *key, int keyusage, int32_t etype, char *iv, size_t ivlen, char *in, size_t inlen, char **out, size_t *outlen);
Decrypts data using key, possibly altered by supplied key usage. If key usage is 0, no key derivation is used.
If OUT is NULL, this functions only set OUTLEN. This usage may be used by the caller to allocate the proper buffer size.
handle : | shishi handle as allocated by shishi_init(). |
key : | key to decrypt with. |
keyusage : | integer specifying what this key is decrypting. |
etype : | integer specifying what decryption method to use. |
iv : | input array with initialization vector. |
ivlen : | size of input array with initialization vector. |
in : | input array with data to decrypt. |
inlen : | size of input array with data to decrypt. |
out : | output array with decrypted data. |
outlen : | on input, holds maximum size of output array, on output, holds actual size of output array. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_checksum (Shishi *handle, Shishi_key *key, int keyusage, int32_t cksumtype, char *in, size_t inlen, char **out, size_t *outlen);
Integrity protect data using key, possibly altered by supplied key usage. If key usage is 0, no key derivation is used.
If OUT is NULL, this functions only set OUTLEN. This usage may be used by the caller to allocate the proper buffer size.
handle : | shishi handle as allocated by shishi_init(). |
key : | key to encrypt with. |
keyusage : | integer specifying what this key is encrypting. |
cksumtype : | the checksum algorithm to use. |
in : | input array with data to integrity protect. |
inlen : | size of input array with data to integrity protect. |
out : | output array with integrity protected data. |
outlen : | on input, holds maximum size of output array, on output, holds actual size of output array. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_randomize (Shishi *handle, char *data, size_t datalen);
Store cryptographically strong random data of given size in the provided buffer.
handle : | shishi handle as allocated by shishi_init(). |
data : | output array to be filled with random data. |
datalen : | size of output array. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_dk (Shishi *handle, Shishi_key *key, char *constant, int constantlen, Shishi_key *derivedkey);
Derive a key from a key and a constant thusly: DK(KEY, CONSTANT) = SHISHI_RANDOM-TO-KEY(SHISHI_DR(KEY, CONSTANT)).
handle : | shishi handle as allocated by shishi_init(). |
key : | input cryptographic key to use. |
constant : | input array with the constant string. |
constantlen : | size of input array with the constant string. |
derivedkey : | pointer to derived key (allocated by caller). |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_dr (Shishi *handle, Shishi_key *key, char *constant, size_t constantlen, char *derivedrandom, size_t derivedrandomlen);
Derive "random" data from a key and a constant thusly: DR(KEY, CONSTANT) = TRUNCATE(DERIVEDRANDOMLEN, SHISHI_ENCRYPT(KEY, CONSTANT)).
handle : | shishi handle as allocated by shishi_init(). |
key : | input array with cryptographic key to use. |
constant : | input array with the constant string. |
constantlen : | size of input array with the constant string. |
derivedrandom : | output array with derived random data. |
derivedrandomlen : | size of output array with derived random data. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_n_fold (Shishi *handle, char *in, size_t inlen, char *out, size_t outlen);
Fold data into a fixed length output array, with the intent to give each input bit approximately equal weight in determining the value of each output bit.
The algorithm is from "A Better Key Schedule For DES-like Ciphers" by Uri Blumenthal and Steven M. Bellovin, <URL:http://www.research.att.com/~smb/papers/ides.pdf>, although the sample vectors provided by the paper are incorrect.
handle : | shishi handle as allocated by shishi_init(). |
in : | input array with data to decrypt. |
inlen : | size of input array with data to decrypt ("M"). |
out : | output array with decrypted data. |
outlen : | size of output array ("N"). |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_pbkdf2_sha1 (const char *P, size_t Plen, const char *S, size_t Slen, unsigned int c, unsigned int dkLen, char *DK);
P : | |
Plen : | |
S : | |
Slen : | |
c : | |
dkLen : | |
DK : | |
Returns : |
|
const char* shishi_check_version (const char *req_version);
Check that the the version of the library is at minimum the one given as a string in req_version.
req_version : | version string to compare with, or NULL |
Returns : | the actual version string of the library; NULL if the condition is not met. If NULL is passed to this function no check is done and only the version string is returned. It is a pretty good idea to run this function as soon as possible, because it may also intializes some subsystems. In a multithreaded environment if should be called before any more threads are created. |
int shishi_read_password (FILE *fh, char *s, int size);
fh : | |
s : | |
size : | |
Returns : |
|
int shishi_prompt_password_raw (FILE *in, char *s, int size, FILE *out, char *format, ...);
in : | |
s : | |
size : | |
out : | |
format : | |
... : | |
Returns : |
|
int shishi_prompt_password (Shishi *handle, FILE *in, char *s, int size, FILE *out, char *format, ...);
handle : | |
in : | |
s : | |
size : | |
out : | |
format : | |
... : | |
Returns : |
|
int shishi_a2d_field (Shishi *handle, Shishi_asn1 node, const char *field, char *der, int *len);
handle : | |
node : | |
field : | |
der : | |
len : | |
Returns : |
|
int shishi_a2d (Shishi *handle, Shishi_asn1 node, char *der, int *len);
handle : | |
node : | |
der : | |
len : | |
Returns : |
|
int shishi_a2d_new_field (Shishi *handle, Shishi_asn1 node, const char *field, char **der, int *len);
handle : | |
node : | |
field : | |
der : | |
len : | |
Returns : |
|
int shishi_new_a2d (Shishi *handle, Shishi_asn1 node, char **der, int *len);
handle : | |
node : | |
der : | |
len : | |
Returns : |
|
int shishi_asn1_read (Shishi *handle, Shishi_asn1 node, const char *field, char *data, size_t *datalen);
handle : | |
node : | |
field : | |
data : | |
datalen : | |
Returns : |
|
int shishi_asn1_read2 (Shishi *handle, Shishi_asn1 node, const char *field, char **data, size_t *datalen);
handle : | |
node : | |
field : | |
data : | |
datalen : | |
Returns : |
|
int shishi_asn1_read_integer (Shishi *handle, Shishi_asn1 node, const char *field, int *i);
handle : | |
node : | |
field : | |
i : | |
Returns : |
|
int shishi_asn1_read_int32 (Shishi *handle, Shishi_asn1 node, const char *field, int32_t *i);
handle : | |
node : | |
field : | |
i : | |
Returns : |
|
int shishi_asn1_read_uint32 (Shishi *handle, Shishi_asn1 node, const char *field, uint32_t *i);
handle : | |
node : | |
field : | |
i : | |
Returns : |
|
int shishi_asn1_read_bitstring (Shishi *handle, Shishi_asn1 node, const char *field, int *flags);
handle : | |
node : | |
field : | |
flags : | |
Returns : |
|
int shishi_asn1_read_optional (Shishi *handle, Shishi_asn1 node, const char *field, char *data, size_t *datalen);
handle : | |
node : | |
field : | |
data : | |
datalen : | |
Returns : |
|
int shishi_asn1_read_empty_p (Shishi *handle, Shishi_asn1 node, const char *field);
handle : | |
node : | |
field : | |
Returns : |
|
int shishi_asn1_write (Shishi *handle, Shishi_asn1 node, const char *field, const char *data, size_t datalen);
handle : | |
node : | |
field : | |
data : | |
datalen : | |
Returns : |
|
int shishi_asn1_write_integer (Shishi *handle, Shishi_asn1 node, const char *field, int n);
handle : | |
node : | |
field : | |
n : | |
Returns : |
|
int shishi_asn1_write_int32 (Shishi *handle, Shishi_asn1 node, const char *field, int32_t n);
handle : | |
node : | |
field : | |
n : | |
Returns : |
|
int shishi_asn1_write_uint32 (Shishi *handle, Shishi_asn1 node, const char *field, uint32_t n);
handle : | |
node : | |
field : | |
n : | |
Returns : |
|
int shishi_asn1_write_bitstring (Shishi *handle, Shishi_asn1 node, const char *field, int flags);
handle : | |
node : | |
field : | |
flags : | |
Returns : |
|
int shishi_asn1_number_of_elements (Shishi *handle, Shishi_asn1 node, const char *field, int *n);
handle : | |
node : | |
field : | |
n : | |
Returns : |
|
Shishi_asn1 shishi_asn1_encticketpart (Shishi *handle);
handle : | |
Returns : |
|
Shishi_asn1 shishi_asn1_authenticator (Shishi *handle);
handle : | |
Returns : |
|
Shishi_asn1 shishi_asn1_enckdcreppart (Shishi *handle);
handle : | |
Returns : |
|
Shishi_asn1 shishi_der2asn1 (Shishi *handle, const char *fieldname, const char *nodename, const char *der, size_t derlen);
handle : | |
fieldname : | |
nodename : | |
der : | |
derlen : | |
Returns : |
|
Shishi_asn1 shishi_der2asn1_ticket (Shishi *handle, const char *der, size_t derlen);
handle : | |
der : | |
derlen : | |
Returns : |
|
Shishi_asn1 shishi_der2asn1_encticketpart (Shishi *handle, const char *der, size_t derlen);
handle : | |
der : | |
derlen : | |
Returns : |
|
Shishi_asn1 shishi_der2asn1_asreq (Shishi *handle, const char *der, size_t derlen);
handle : | |
der : | |
derlen : | |
Returns : |
|
Shishi_asn1 shishi_der2asn1_tgsreq (Shishi *handle, const char *der, size_t derlen);
handle : | |
der : | |
derlen : | |
Returns : |
|
Shishi_asn1 shishi_der2asn1_asrep (Shishi *handle, const char *der, size_t derlen);
handle : | |
der : | |
derlen : | |
Returns : |
|
Shishi_asn1 shishi_der2asn1_tgsrep (Shishi *handle, const char *der, size_t derlen);
handle : | |
der : | |
derlen : | |
Returns : |
|
Shishi_asn1 shishi_der2asn1_kdcrep (Shishi *handle, const char *der, size_t derlen);
handle : | |
der : | |
derlen : | |
Returns : |
|
Shishi_asn1 shishi_der2asn1_kdcreq (Shishi *handle, const char *der, size_t derlen);
handle : | |
der : | |
derlen : | |
Returns : |
|
Shishi_asn1 shishi_der2asn1_encasreppart (Shishi *handle, const char *der, size_t derlen);
handle : | |
der : | |
derlen : | |
Returns : |
|
Shishi_asn1 shishi_der2asn1_enctgsreppart (Shishi *handle, const char *der, size_t derlen);
handle : | |
der : | |
derlen : | |
Returns : |
|
Shishi_asn1 shishi_der2asn1_enckdcreppart (Shishi *handle, const char *der, size_t derlen);
handle : | |
der : | |
derlen : | |
Returns : |
|
Shishi_asn1 shishi_der2asn1_authenticator (Shishi *handle, const char *der, size_t derlen);
handle : | |
der : | |
derlen : | |
Returns : |
|
Shishi_asn1 shishi_der2asn1_krberror (Shishi *handle, const char *der, size_t derlen);
handle : | |
der : | |
derlen : | |
Returns : |
|
Shishi_asn1 shishi_der2asn1_krbsafe (Shishi *handle, const char *der, size_t derlen);
handle : | |
der : | |
derlen : | |
Returns : |
|
Shishi_asn1 shishi_der2asn1_apreq (Shishi *handle, const char *der, size_t derlen);
handle : | |
der : | |
derlen : | |
Returns : |
|
Shishi_asn1 shishi_der2asn1_aprep (Shishi *handle, const char *der, size_t derlen);
handle : | |
der : | |
derlen : | |
Returns : |
|
Shishi_asn1 shishi_der2asn1_encapreppart (Shishi *handle, const char *der, size_t derlen);
handle : | |
der : | |
derlen : | |
Returns : |
|
int shishi_ap (Shishi *handle, Shishi_ap **ap);
Create a new AP exchange.
handle : | shishi handle as allocated by shishi_init(). |
ap : | pointer to new structure that holds information about AP exchange |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_ap_set_tktoptions (Shishi_ap *ap, Shishi_tkt *tkt, int options);
Set the ticket (see shishi_ap_tkt_set()) and set the AP-REQ apoptions (see shishi_apreq_options_set()).
ap : | structure that holds information about AP exchange |
tkt : | ticket to set in AP. |
options : | AP-REQ options to set in AP. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_ap_tktoptions (Shishi *handle, Shishi_ap **ap, Shishi_tkt *tkt, int options);
Create a new AP exchange using shishi_ap(), and set the ticket and AP-REQ apoptions using shishi_ap_set_tktoption().
handle : | shishi handle as allocated by shishi_init(). |
ap : | pointer to new structure that holds information about AP exchange |
tkt : | ticket to set in newly created AP. |
options : | AP-REQ options to set in newly created AP. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_ap_set_tktoptionsdata (Shishi_ap *ap, Shishi_tkt *tkt, int options, char *data, int len);
Set the ticket (see shishi_ap_tkt_set()) and set the AP-REQ apoptions (see shishi_apreq_options_set()) and set the Authenticator checksum data.
ap : | structure that holds information about AP exchange |
tkt : | ticket to set in AP. |
options : | AP-REQ options to set in AP. |
data : | input array with data to checksum in Authenticator. |
len : | length of input array with data to checksum in Authenticator. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_ap_tktoptionsdata (Shishi *handle, Shishi_ap **ap, Shishi_tkt *tkt, int options, char *data, int len);
Create a new AP exchange using shishi_ap(), and set the ticket, AP-REQ apoptions and the Authenticator checksum data using shishi_ap_set_tktoptionsdata().
handle : | shishi handle as allocated by shishi_init(). |
ap : | pointer to new structure that holds information about AP exchange |
tkt : | ticket to set in newly created AP. |
options : | AP-REQ options to set in newly created AP. |
data : | input array with data to checksum in Authenticator. |
len : | length of input array with data to checksum in Authenticator. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_ap_set_tktoptionsasn1usage (Shishi_ap *ap, Shishi_tkt *tkt, int options, Shishi_asn1 node, char *field, int authenticatorcksumkeyusage, int authenticatorkeyusage);
ap : | |
tkt : | |
options : | |
node : | |
field : | |
authenticatorcksumkeyusage : | |
authenticatorkeyusage : | |
Returns : |
|
int shishi_ap_tktoptionsasn1usage (Shishi *handle, Shishi_ap **ap, Shishi_tkt *tkt, int options, Shishi_asn1 node, char *field, int authenticatorcksumkeyusage, int authenticatorkeyusage);
handle : | |
ap : | |
tkt : | |
options : | |
node : | |
field : | |
authenticatorcksumkeyusage : | |
authenticatorkeyusage : | |
Returns : |
|
Shishi_tkt* shishi_ap_tkt (Shishi_ap *ap);
ap : | structure that holds information about AP exchange |
Returns : | Returns the ticket from the AP exchange, or NULL if not yet set or an error occured. |
void shishi_ap_tkt_set (Shishi_ap *ap, Shishi_tkt *tkt);
Set the Ticket in the AP exchange.
ap : | structure that holds information about AP exchange |
tkt : | ticket to store in AP. |
int shishi_ap_authenticator_cksumdata (Shishi_ap *ap, char *out, int *len);
ap : | |
out : | |
len : | |
Returns : |
|
void shishi_ap_authenticator_cksumdata_set (Shishi_ap *ap, char *authenticatorcksumdata, int authenticatorcksumdatalen);
Set the Authenticator Checksum Data in the AP exchange.
ap : | structure that holds information about AP exchange |
authenticatorcksumdata : | input array with authenticator checksum data to use in AP. |
authenticatorcksumdatalen : | length of input array with authenticator checksum data to use in AP. |
Shishi_asn1 shishi_ap_authenticator (Shishi_ap *ap);
ap : | structure that holds information about AP exchange |
Returns : | Returns the Authenticator from the AP exchange, or NULL if not yet set or an error occured. |
void shishi_ap_authenticator_set (Shishi_ap *ap, Shishi_asn1 authenticator);
Set the Authenticator in the AP exchange.
ap : | structure that holds information about AP exchange |
authenticator : | authenticator to store in AP. |
Shishi_asn1 shishi_ap_req (Shishi_ap *ap);
ap : | structure that holds information about AP exchange |
Returns : | Returns the AP-REQ from the AP exchange, or NULL if not yet set or an error occured. |
void shishi_ap_req_set (Shishi_ap *ap, Shishi_asn1 apreq);
Set the AP-REQ in the AP exchange.
ap : | structure that holds information about AP exchange |
apreq : | apreq to store in AP. |
int shishi_ap_req_der (Shishi_ap *ap, char *out, int *outlen);
Build AP-REQ using shishi_ap_req_build() and DER encode it.
ap : | structure that holds information about AP exchange |
out : | output array with der encoding of AP-REQ. |
outlen : | length of output array with der encoding of AP-REQ. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_ap_req_der_set (Shishi_ap *ap, char *der, size_t derlen);
DER decode AP-REQ and set it AP exchange. If decoding fails, the AP-REQ in the AP exchange is lost.
ap : | structure that holds information about AP exchange |
der : | input array with DER encoded AP-REQ. |
derlen : | length of input array with DER encoded AP-REQ. |
Returns : | Returns SHISHI_OK. |
int shishi_ap_req_der_new (Shishi_ap *ap, char **out, int *outlen);
Build AP-REQ using shishi_ap_req_build() and DER encode it. out is allocated by this function, and it is the responsibility of caller to deallocate it.
ap : | structure that holds information about AP exchange |
out : | pointer to output array with der encoding of AP-REQ. |
outlen : | pointer to length of output array with der encoding of AP-REQ. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_ap_req_build (Shishi_ap *ap);
Checksum data in authenticator and add ticket and authenticator to AP-REQ.
ap : | structure that holds information about AP exchange |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_ap_req_asn1 (Shishi_ap *ap, Shishi_asn1 *apreq);
Build AP-REQ using shishi_ap_req_build() and return it.
ap : | structure that holds information about AP exchange |
apreq : | output AP-REQ variable. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_ap_req_process (Shishi_ap *ap, Shishi_key *key);
Decrypt ticket in AP-REQ using supplied key and decrypt Authenticator in AP-REQ using key in decrypted ticket, and on success set the Ticket and Authenticator fields in the AP exchange.
ap : | structure that holds information about AP exchange |
key : | cryptographic key used to decrypt ticket in AP-REQ. |
Returns : | Returns SHISHI_OK iff successful. |
Shishi_asn1 shishi_ap_rep (Shishi_ap *ap);
ap : | structure that holds information about AP exchange |
Returns : | Returns the EncAPREPPart from the AP exchange, or NULL if not yet set or an error occured. |
void shishi_ap_rep_set (Shishi_ap *ap, Shishi_asn1 aprep);
Set the AP-REP in the AP exchange.
ap : | structure that holds information about AP exchange |
aprep : | aprep to store in AP. |
int shishi_ap_rep_der (Shishi_ap *ap, char *out, size_t *outlen);
Build AP-REP using shishi_ap_rep_build() and DER encode it.
ap : | structure that holds information about AP exchange |
out : | output array with der encoding of AP-REP. |
outlen : | length of output array with der encoding of AP-REP. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_ap_rep_der_set (Shishi_ap *ap, char *der, size_t derlen);
DER decode AP-REP and set it AP exchange. If decoding fails, the AP-REP in the AP exchange remains.
ap : | structure that holds information about AP exchange |
der : | input array with DER encoded AP-REP. |
derlen : | length of input array with DER encoded AP-REP. |
Returns : | Returns SHISHI_OK. |
int shishi_ap_rep_verify (Shishi_ap *ap);
Verify AP-REP compared to Authenticator.
ap : | structure that holds information about AP exchange |
Returns : | Returns SHISHI_OK, SHISHI_APREP_VERIFY_FAILED or an error. |
int shishi_ap_rep_verify_der (Shishi_ap *ap, char *der, size_t derlen);
DER decode AP-REP and set it in AP exchange using shishi_ap_rep_der_set() and verify it using shishi_ap_rep_verify().
ap : | structure that holds information about AP exchange |
der : | input array with DER encoded AP-REP. |
derlen : | length of input array with DER encoded AP-REP. |
Returns : | Returns SHISHI_OK, SHISHI_APREP_VERIFY_FAILED or an error. |
int shishi_ap_rep_verify_asn1 (Shishi_ap *ap, Shishi_asn1 aprep);
Set the AP-REP in the AP exchange using shishi_ap_rep_set() and verify it using shishi_ap_rep_verify().
ap : | structure that holds information about AP exchange |
aprep : | input AP-REP. |
Returns : | Returns SHISHI_OK, SHISHI_APREP_VERIFY_FAILED or an error. |
int shishi_ap_rep_asn1 (Shishi_ap *ap, Shishi_asn1 *aprep);
Build AP-REP using shishi_ap_rep_build() and return it.
ap : | structure that holds information about AP exchange |
aprep : | output AP-REP variable. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_ap_rep_build (Shishi_ap *ap);
Checksum data in authenticator and add ticket and authenticator to AP-REQ.
ap : | structure that holds information about AP exchange |
Returns : | Returns SHISHI_OK iff successful. |
void shishi_ap_encapreppart_set (Shishi_ap *ap, Shishi_asn1 encapreppart);
Set the EncAPRepPart in the AP exchange.
ap : | structure that holds information about AP exchange |
encapreppart : | EncAPRepPart to store in AP. |
const char* shishi_key_principal (Shishi_key *key);
key : | structure that holds key information |
Returns : | Returns the principal owning the key. (Not a copy of it, so don't modify or deallocate it.) |
void shishi_key_principal_set (Shishi_key *key, const char *principal);
Set the principal owning the key. The string is copied into the key, so you can dispose of the variable immediately after calling this function.
key : | structure that holds key information |
principal : | string with new principal name. |
const char* shishi_key_realm (Shishi_key *key);
key : | structure that holds key information |
Returns : | Returns the realm for the principal owning the key. (Not a copy of it, so don't modify or deallocate it.) |
void shishi_key_realm_set (Shishi_key *key, const char *realm);
Set the realm for the principal owning the key. The string is copied into the key, so you can dispose of the variable immediately after calling this function.
key : | structure that holds key information |
realm : | string with new realm name. |
int shishi_key_type (Shishi_key *key);
key : | structure that holds key information |
Returns : | Returns the type of key as an integer as described in the standard. |
void shishi_key_type_set (Shishi_key *key, int32_t type);
Set the type of key in key structure.
key : | structure that holds key information |
type : | type to set in key. |
char* shishi_key_value (Shishi_key *key);
key : | structure that holds key information |
Returns : | Returns the key value as a pointer which is valid throughout the lifetime of the key structure. |
void shishi_key_value_set (Shishi_key *key, const char *value);
Set the key value and length in key structure.
key : | structure that holds key information |
value : | input array with key data. |
int shishi_key_value_set_random (Shishi_key *key, char *random, size_t randomlen);
key : | |
random : | |
randomlen : | |
Returns : |
|
const char* shishi_key_name (Shishi_key *key);
Calls shishi_cipher_name for key type.
key : | structure that holds key information |
Returns : | Return name of key. |
size_t shishi_key_length (Shishi_key *key);
Calls shishi_cipher_keylen for key type.
key : | structure that holds key information |
Returns : | Returns the length of the key value. |
int shishi_key_version (Shishi_key *key);
key : | structure that holds key information |
Returns : | Returns the version of key ("kvno"). |
void shishi_key_version_set (Shishi_key *key, int version);
Set the version of key ("kvno") in key structure.
key : | structure that holds key information |
version : | new version integer. |
int shishi_key (Shishi *handle, Shishi_key **key);
Create a new Key information structure.
handle : | Shishi library handle create by shishi_init(). |
key : | pointer to structure that will hold newly created key information |
Returns : | Returns SHISHI_MALLOC_ERROR on memory allocation errors, and SHISHI_OK on success. |
void shishi_key_done (Shishi_key **key);
Deallocates key information structure and set key handle to NULL.
key : | pointer to structure that holds key information. |
void shishi_key_copy (Shishi_key *dstkey, Shishi_key *srckey);
Copies source key into existing allocated destination key.
dstkey : | structure that holds destination key information |
srckey : | structure that holds source key information |
int shishi_key_print (Shishi *handle, FILE *fh, Shishi_key *key);
Print an ASCII representation of a key structure to file descriptor. Example output:
-----BEGIN SHISHI KEY----- Keytype: 18 (aes256-cts-hmac-sha1-96) Principal: host/latte.josefsson.org Realm: JOSEFSSON.ORG Key-Version-Number: 1
P1QdeW/oSiag/bTyVEBAY2msiGSTmgLXlopuCKoppDs= -----END SHISHI KEY-----
handle : | shishi handle as allocated by shishi_init(). |
fh : | file handle opened for writing. |
key : | key to print. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_key_to_file (Shishi *handle, const char *filename, Shishi_key *key);
Print an ASCII representation of a key structure to a file. The file is appended to if it exists. See shishi_key_print() for format of output.
handle : | shishi handle as allocated by shishi_init(). |
filename : | filename to append key to. |
key : | key to print. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_key_parse (Shishi *handle, FILE *fh, Shishi_key **key);
handle : | |
fh : | |
key : | |
Returns : |
|
int shishi_key_random (Shishi *handle, int32_t type, Shishi_key **key);
Create a new Key information structure for the key type and some random data. KEY contains a newly allocated structure only if this function is successful.
handle : | Shishi library handle create by shishi_init(). |
type : | type of key. |
key : | pointer to structure that will hold newly created key information |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_key_from_value (Shishi *handle, int32_t type, char *value, Shishi_key **key);
Create a new Key information structure, and set the key type and key value. KEY contains a newly allocated structure only if this function is successful.
handle : | Shishi library handle create by shishi_init(). |
type : | type of key. |
value : | input array with key value, or NULL. |
key : | pointer to structure that will hold newly created key information |
Returns : | Returns SHISHI_MALLOC_ERROR on memory allocation errors, and SHISHI_OK on success. |
int shishi_key_from_base64 (Shishi *handle, int32_t type, char *value, Shishi_key **key);
Create a new Key information structure, and set the key type and key value. KEY contains a newly allocated structure only if this function is successful.
handle : | Shishi library handle create by shishi_init(). |
type : | type of key. |
value : | input string with base64 encoded key value, or NULL. |
key : | pointer to structure that will hold newly created key information |
Returns : | Returns SHISHI_MALLOC_ERROR on memory allocation errors, SHISHI_INVALID_KEY if the base64 encoded key length doesn't match the key type, and SHISHI_OK on success. |
int shishi_key_from_random (Shishi *handle, int32_t type, char *random, size_t randomlen, Shishi_key **outkey);
Create a new Key information structure, and set the key type and key value using shishi_random_to_key(). KEY contains a newly allocated structure only if this function is successful.
handle : | Shishi library handle create by shishi_init(). |
type : | type of key. |
random : | random data. |
randomlen : | length of random data. |
outkey : | pointer to structure that will hold newly created key information |
Returns : | Returns SHISHI_MALLOC_ERROR on memory allocation errors, and SHISHI_OK on success. |
int shishi_key_from_string (Shishi *handle, int32_t type, const char *password, size_t passwordlen, const char *salt, size_t saltlen, const char *parameter, Shishi_key **outkey);
Create a new Key information structure, and set the key type and key value using shishi_string_to_key(). KEY contains a newly allocated structure only if this function is successful.
handle : | Shishi library handle create by shishi_init(). |
type : | type of key. |
password : | input array containing password. |
passwordlen : | length of input array containing password. |
salt : | input array containing salt. |
saltlen : | length of input array containing salt. |
parameter : | input array with opaque encryption type specific information. |
outkey : | pointer to structure that will hold newly created key information |
Returns : | Returns SHISHI_MALLOC_ERROR on memory allocation errors, and SHISHI_OK on success. |
Shishi_key* shishi_keys_for_serverrealm_in_file (Shishi *handle, const char *filename, const char *server, const char *realm);
handle : | Shishi library handle create by shishi_init(). |
filename : | file to read keys from. |
server : | server name to get key for. |
realm : | realm of server to get key for. |
Returns : | Returns the key for specific server and realm, read from the indicated file, or NULL if no key could be found or an error encountered. |
Shishi_key* shishi_keys_for_server_in_file (Shishi *handle, const char *filename, const char *server);
handle : | Shishi library handle create by shishi_init(). |
filename : | file to read keys from. |
server : | server name to get key for. |
Returns : | Returns the key for specific server, read from the indicated file, or NULL if no key could be found or an error encountered. |
Shishi_key* shishi_keys_for_localservicerealm_in_file (Shishi *handle, const char *filename, const char *service, const char *realm);
handle : | |
filename : | |
service : | |
realm : | |
Returns : |
|
const char* shishi_hostkeys_default_file (Shishi *handle);
handle : | Shishi library handle create by shishi_init(). |
Returns : | Returns the default host key filename used in the library. (Not a copy of it, so don't modify or deallocate it.) |
void shishi_hostkeys_default_file_set (Shishi *handle, const char *hostkeysfile);
Set the default host key filename used in the library. The string is copied into the library, so you can dispose of the variable immediately after calling this function.
handle : | Shishi library handle create by shishi_init(). |
hostkeysfile : | string with new default hostkeys file name, or NULL to reset to default. |
Shishi_key* shishi_hostkeys_for_server (Shishi *handle, const char *server);
handle : | Shishi library handle create by shishi_init(). |
server : | server name to get key for |
Returns : | Returns the key for specific server, read from the default host keys file (see shishi_hostkeys_default_file()), or NULL if no key could be found or an error encountered. |
Shishi_key* shishi_hostkeys_for_serverrealm (Shishi *handle, const char *server, const char *realm);
handle : | Shishi library handle create by shishi_init(). |
server : | server name to get key for |
realm : | realm of server to get key for. |
Returns : | Returns the key for specific server and realm, read from the default host keys file (see shishi_hostkeys_default_file()), or NULL if no key could be found or an error encountered. |
Shishi_key* shishi_hostkeys_for_localservicerealm (Shishi *handle, const char *service, const char *realm);
handle : | Shishi library handle create by shishi_init(). |
service : | service to get key for. |
realm : | realm of server to get key for, or NULL for default realm. |
Returns : | Returns the key for the server "SERVICE/HOSTNAMEREALM" (where HOSTNAME is the current system's hostname), read from the default host keys file (see shishi_hostkeys_default_file()), or NULL if no key could be found or an error encountered. |
Shishi_key* shishi_hostkeys_for_localservice (Shishi *handle, const char *service);
handle : | Shishi library handle create by shishi_init(). |
service : | service to get key for. |
Returns : | Returns the key for the server "SERVICE/HOSTNAME" (where HOSTNAME is the current system's hostname), read from the default host keys file (see shishi_hostkeys_default_file()), or NULL if no key could be found or an error encountered. |
int shishi_encapreppart_time_copy (Shishi *handle, Shishi_asn1 encapreppart, Shishi_asn1 authenticator);
handle : | |
encapreppart : | |
authenticator : | |
Returns : |
|
int shishi_encapreppart_ctime_get (Shishi *handle, Shishi_asn1 encapreppart, char *ctime);
handle : | |
encapreppart : | |
ctime : | |
Returns : |
|
int shishi_encapreppart_ctime_set (Shishi *handle, Shishi_asn1 encapreppart, char *ctime);
Store client time in EncAPRepPart.
handle : | shishi handle as allocated by shishi_init(). |
encapreppart : | EncAPRepPart as allocated by shishi_encapreppart(). |
ctime : | string with generalized time value to store in EncAPRepPart. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_encapreppart_cusec_get (Shishi *handle, Shishi_asn1 encapreppart, int *cusec);
Extract client microseconds field from EncAPRepPart.
handle : | shishi handle as allocated by shishi_init(). |
encapreppart : | EncAPRepPart as allocated by shishi_encapreppart(). |
cusec : | output integer with client microseconds field. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_encapreppart_cusec_set (Shishi *handle, Shishi_asn1 encapreppart, int cusec);
Set the cusec field in the Authenticator.
handle : | shishi handle as allocated by shishi_init(). |
encapreppart : | EncAPRepPart as allocated by shishi_encapreppart(). |
cusec : | client microseconds to set in authenticator, 0-999999. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_encapreppart_print (Shishi *handle, FILE *fh, Shishi_asn1 encapreppart);
Print ASCII armored DER encoding of EncAPRepPart to file.
handle : | shishi handle as allocated by shishi_init(). |
fh : | file handle open for writing. |
encapreppart : | EncAPRepPart to print. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_encapreppart_save (Shishi *handle, FILE *fh, Shishi_asn1 encapreppart);
Save DER encoding of EncAPRepPart to file.
handle : | shishi handle as allocated by shishi_init(). |
fh : | file handle open for writing. |
encapreppart : | EncAPRepPart to save. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_encapreppart_to_file (Shishi *handle, Shishi_asn1 encapreppart, int filetype, char *filename);
Write EncAPRepPart to file in specified TYPE. The file will be truncated if it exists.
handle : | shishi handle as allocated by shishi_init(). |
encapreppart : | EncAPRepPart to save. |
filetype : | input variable specifying type of file to be written, see Shishi_filetype. |
filename : | input variable with filename to write to. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_encapreppart_read (Shishi *handle, FILE *fh, Shishi_asn1 *encapreppart);
Read DER encoded EncAPRepPart from file and populate given variable.
handle : | shishi handle as allocated by shishi_init(). |
fh : | file handle open for reading. |
encapreppart : | output variable with newly allocated EncAPRepPart. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_encapreppart_parse (Shishi *handle, FILE *fh, Shishi_asn1 *encapreppart);
Read ASCII armored DER encoded EncAPRepPart from file and populate given variable.
handle : | shishi handle as allocated by shishi_init(). |
fh : | file handle open for reading. |
encapreppart : | output variable with newly allocated EncAPRepPart. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_encapreppart_from_file (Shishi *handle, Shishi_asn1 *encapreppart, int filetype, char *filename);
Read EncAPRepPart from file in specified TYPE.
handle : | shishi handle as allocated by shishi_init(). |
encapreppart : | output variable with newly allocated EncAPRepPart. |
filetype : | input variable specifying type of file to be read, see Shishi_filetype. |
filename : | input variable with filename to read from. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_encapreppart_get_key (Shishi *handle, Shishi_asn1 encapreppart, int32_t *keytype, char *keyvalue, size_t *keyvalue_len);
Extract the subkey from the encrypted AP-REP part.
handle : | shishi handle as allocated by shishi_init(). |
encapreppart : | input EncAPRepPart variable. |
keytype : | output variable that holds key type. |
keyvalue : | output array with key. |
keyvalue_len : | on input, maximum size of output array with key, on output, holds the actual size of output array with key. |
Returns : | Returns SHISHI_OK iff succesful. |
int shishi_encapreppart_seqnumber_get (Shishi *handle, Shishi_asn1 encapreppart, uint32_t *seqnumber);
Extract sequence number field from EncAPRepPart.
handle : | shishi handle as allocated by shishi_init(). |
encapreppart : | EncAPRepPart as allocated by shishi_encapreppart(). |
seqnumber : | output integer with sequence number field. |
Returns : | Returns SHISHI_OK iff successful. |
Shishi_asn1 shishi_apreq (Shishi *handle);
This function creates a new AP-REQ, populated with some default values.
handle : | shishi handle as allocated by shishi_init(). |
Returns : | Returns the AP-REQ or NULL on failure. |
int shishi_apreq_parse (Shishi *handle, FILE *fh, Shishi_asn1 *apreq);
Read ASCII armored DER encoded AP-REQ from file and populate given variable.
handle : | shishi handle as allocated by shishi_init(). |
fh : | file handle open for reading. |
apreq : | output variable with newly allocated AP-REQ. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_apreq_from_file (Shishi *handle, Shishi_asn1 *apreq, int filetype, char *filename);
Read AP-REQ from file in specified TYPE.
handle : | shishi handle as allocated by shishi_init(). |
apreq : | output variable with newly allocated AP-REQ. |
filetype : | input variable specifying type of file to be read, see Shishi_filetype. |
filename : | input variable with filename to read from. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_apreq_print (Shishi *handle, FILE *fh, Shishi_asn1 apreq);
Print ASCII armored DER encoding of AP-REQ to file.
handle : | shishi handle as allocated by shishi_init(). |
fh : | file handle open for writing. |
apreq : | AP-REQ to print. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_apreq_to_file (Shishi *handle, Shishi_asn1 apreq, int filetype, char *filename);
Write AP-REQ to file in specified TYPE. The file will be truncated if it exists.
handle : | shishi handle as allocated by shishi_init(). |
apreq : | AP-REQ to save. |
filetype : | input variable specifying type of file to be written, see Shishi_filetype. |
filename : | input variable with filename to write to. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_apreq_read (Shishi *handle, FILE *fh, Shishi_asn1 *apreq);
Read DER encoded AP-REQ from file and populate given variable.
handle : | shishi handle as allocated by shishi_init(). |
fh : | file handle open for reading. |
apreq : | output variable with newly allocated AP-REQ. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_apreq_save (Shishi *handle, FILE *fh, Shishi_asn1 apreq);
Save DER encoding of AP-REQ to file.
handle : | shishi handle as allocated by shishi_init(). |
fh : | file handle open for writing. |
apreq : | AP-REQ to save. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_apreq_options (Shishi *handle, Shishi_asn1 apreq, int *flags);
handle : | |
apreq : | |
flags : | |
Returns : |
|
int shishi_apreq_options_set (Shishi *handle, Shishi_asn1 apreq, int options);
handle : | |
apreq : | |
options : | |
Returns : |
|
int shishi_apreq_set_ticket (Shishi *handle, Shishi_asn1 apreq, Shishi_asn1 ticket);
Copy ticket into AP-REQ.
handle : | shishi handle as allocated by shishi_init(). |
apreq : | AP-REQ to add ticket field to. |
ticket : | input ticket to copy into AP-REQ ticket field. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_apreq_set_authenticator (Shishi *handle, Shishi_asn1 apreq, int32_t etype, char *buf, int buflen);
Set the encrypted authenticator field in the AP-REP. The encrypted data is usually created by calling shishi_encrypt() on the DER encoded authenticator. To save time, you may want to use shishi_apreq_add_authenticator() instead, which calculates the encrypted data and calls this function in one step.
handle : | shishi handle as allocated by shishi_init(). |
apreq : | AP-REQ to add authenticator field to. |
etype : | encryption type used to encrypt authenticator. |
buf : | input array with encrypted authenticator. |
buflen : | size of input array with encrypted authenticator. |
Returns : |
int shishi_apreq_add_authenticator (Shishi *handle, Shishi_asn1 apreq, Shishi_key *key, int keyusage, Shishi_asn1 authenticator);
Encrypts DER encoded authenticator using key and store it in the AP-REQ.
handle : | shishi handle as allocated by shishi_init(). |
apreq : | AP-REQ to add authenticator field to. |
key : | key to to use for encryption. |
keyusage : | kerberos key usage value to use in encryption. |
authenticator : | authenticator as allocated by shishi_authenticator(). |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_apreq_use_session_key_p (Shishi *handle, Shishi_asn1 apreq);
handle : | |
apreq : | |
Returns : |
|
int shishi_apreq_mutual_required_p (Shishi *handle, Shishi_asn1 apreq);
handle : | |
apreq : | |
Returns : |
|
int shishi_apreq_options_add (Shishi *handle, Shishi_asn1 apreq, int option);
handle : | |
apreq : | |
option : | |
Returns : |
|
int shishi_apreq_get_ticket (Shishi *handle, Shishi_asn1 apreq, Shishi_asn1 *ticket);
Extract ticket from AP-REQ.
handle : | shishi handle as allocated by shishi_init(). |
apreq : | AP-REQ variable to get ticket from. |
ticket : | output variable to hold extracted ticket. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_apreq_get_authenticator_etype (Shishi *handle, Shishi_asn1 apreq, int32_t *etype);
handle : | |
apreq : | |
etype : | |
Returns : |
|
int shishi_apreq_decrypt (Shishi *handle, Shishi_asn1 apreq, Shishi_key *key, int keyusage, Shishi_asn1 *authenticator);
handle : | |
apreq : | |
key : | |
keyusage : | |
authenticator : | |
Returns : |
|
int shishi_kdcrep_decrypt (Shishi *handle, Shishi_asn1 kdcrep, Shishi_key *key, int keyusage, Shishi_asn1 *enckdcreppart);
handle : | |
kdcrep : | |
key : | |
keyusage : | |
enckdcreppart : | |
Returns : |
|
int shishi_enckdcreppart_get_key (Shishi *handle, Shishi_asn1 enckdcreppart, Shishi_key **key);
Extract the key to use with the ticket sent in the KDC-REP associated with the EndKDCRepPart input variable.
handle : | shishi handle as allocated by shishi_init(). |
enckdcreppart : | input EncKDCRepPart variable. |
key : | newly allocated encryption key handle. |
Returns : | Returns SHISHI_OK iff succesful. |
int shishi_enckdcreppart_srealm_set (Shishi *handle, Shishi_asn1 enckdcreppart, const char *srealm);
Set the server realm field in the EncKDCRepPart.
handle : | shishi handle as allocated by shishi_init(). |
enckdcreppart : | EncKDCRepPart variable to set realm field in. |
srealm : | input array with name of realm. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_enckdcreppart_sname_set (Shishi *handle, Shishi_asn1 enckdcreppart, Shishi_name_type name_type, char *sname[]);
Set the server name field in the EncKDCRepPart.
handle : | shishi handle as allocated by shishi_init(). |
enckdcreppart : | EncKDCRepPart variable to set server name field in. |
name_type : | type of principial, see Shishi_name_type, usually SHISHI_NT_UNKNOWN. |
sname : | input array with principal name. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_enckdcreppart_server_set (Shishi *handle, Shishi_asn1 enckdcreppart, const char *server);
handle : | |
enckdcreppart : | |
server : | |
Returns : |
|
Shishi_asn1 shishi_aprep (Shishi *handle);
This function creates a new AP-REP, populated with some default values.
handle : | shishi handle as allocated by shishi_init(). |
Returns : | Returns the authenticator or NULL on failure. |
int shishi_aprep_print (Shishi *handle, FILE *fh, Shishi_asn1 aprep);
Print ASCII armored DER encoding of AP-REP to file.
handle : | shishi handle as allocated by shishi_init(). |
fh : | file handle open for writing. |
aprep : | AP-REP to print. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_aprep_save (Shishi *handle, FILE *fh, Shishi_asn1 aprep);
Save DER encoding of AP-REP to file.
handle : | shishi handle as allocated by shishi_init(). |
fh : | file handle open for writing. |
aprep : | AP-REP to save. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_aprep_to_file (Shishi *handle, Shishi_asn1 aprep, int filetype, char *filename);
Write AP-REP to file in specified TYPE. The file will be truncated if it exists.
handle : | shishi handle as allocated by shishi_init(). |
aprep : | AP-REP to save. |
filetype : | input variable specifying type of file to be written, see Shishi_filetype. |
filename : | input variable with filename to write to. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_aprep_read (Shishi *handle, FILE *fh, Shishi_asn1 *aprep);
Read DER encoded AP-REP from file and populate given variable.
handle : | shishi handle as allocated by shishi_init(). |
fh : | file handle open for reading. |
aprep : | output variable with newly allocated AP-REP. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_aprep_parse (Shishi *handle, FILE *fh, Shishi_asn1 *aprep);
Read ASCII armored DER encoded AP-REP from file and populate given variable.
handle : | shishi handle as allocated by shishi_init(). |
fh : | file handle open for reading. |
aprep : | output variable with newly allocated AP-REP. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_aprep_from_file (Shishi *handle, Shishi_asn1 *aprep, int filetype, char *filename);
Read AP-REP from file in specified TYPE.
handle : | shishi handle as allocated by shishi_init(). |
aprep : | output variable with newly allocated AP-REP. |
filetype : | input variable specifying type of file to be read, see Shishi_filetype. |
filename : | input variable with filename to read from. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_aprep_decrypt (Shishi *handle, Shishi_asn1 aprep, Shishi_key *key, int keyusage, Shishi_asn1 *encapreppart);
handle : | |
aprep : | |
key : | |
keyusage : | |
encapreppart : | |
Returns : |
|
int shishi_aprep_verify (Shishi *handle, Shishi_asn1 authenticator, Shishi_asn1 encapreppart);
handle : | |
authenticator : | |
encapreppart : | |
Returns : |
|
int shishi_aprep_enc_part_set (Shishi *handle, Shishi_asn1 aprep, int etype, const char *buf, int buflen);
handle : | |
aprep : | |
etype : | |
buf : | |
buflen : | |
Returns : |
|
int shishi_aprep_enc_part_add (Shishi *handle, Shishi_asn1 aprep, Shishi_asn1 encticketpart, Shishi_asn1 encapreppart);
handle : | |
aprep : | |
encticketpart : | |
encapreppart : | |
Returns : |
|
int shishi_aprep_enc_part_make (Shishi *handle, Shishi_asn1 aprep, Shishi_asn1 authenticator, Shishi_asn1 encticketpart);
handle : | |
aprep : | |
authenticator : | |
encticketpart : | |
Returns : |
|
int shishi_aprep_get_enc_part_etype (Shishi *handle, Shishi_asn1 aprep, int32_t *etype);
Extract AP-REP.enc-part.etype.
handle : | shishi handle as allocated by shishi_init(). |
aprep : | AP-REP variable to get value from. |
etype : | output variable that holds the value. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_kdc_sendrecv (Shishi *handle, char *realm, const char *indata, size_t inlen, char **outdata, size_t *outlen);
handle : | |
realm : | |
indata : | |
inlen : | |
outdata : | |
outlen : | |
Returns : |
|
int shishi_encticketpart_key_set (Shishi *handle, Shishi_asn1 encticketpart, Shishi_key *key);
Set the EncTicketPart.key field to key type and value of supplied key.
handle : | shishi handle as allocated by shishi_init(). |
encticketpart : | input EncTicketPart variable. |
key : | key handle with information to store in encticketpart. |
Returns : | Returns SHISHI_OK iff succesful. |
int shishi_encticketpart_get_enc_part_etype (Shishi *handle, Shishi_asn1 encticketpart, int32_t *etype);
handle : | |
encticketpart : | |
etype : | |
Returns : |
|
int shishi_encticketpart_get_key (Shishi *handle, Shishi_asn1 encticketpart, Shishi_key **key);
Extract the session key in the Ticket.
handle : | shishi handle as allocated by shishi_init(). |
encticketpart : | input EncTicketPart variable. |
key : | newly allocated key. |
Returns : | Returns SHISHI_OK iff succesful. |
int shishi_encticketpart_crealm_set (Shishi *handle, Shishi_asn1 encticketpart, const char *realm);
Set the realm field in the KDC-REQ.
handle : | shishi handle as allocated by shishi_init(). |
encticketpart : | input EncTicketPart variable. |
realm : | input array with name of realm. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_encticketpart_cname_get (Shishi *handle, Shishi_asn1 encticketpart, char *cname, int *cnamelen);
handle : | |
encticketpart : | |
cname : | |
cnamelen : | |
Returns : |
|
int shishi_encticketpart_cname_set (Shishi *handle, Shishi_asn1 encticketpart, Shishi_name_type name_type, const char *principal);
Set the client name field in the EncTicketPart.
handle : | shishi handle as allocated by shishi_init(). |
encticketpart : | input EncTicketPart variable. |
name_type : | type of principial, see Shishi_name_type, usually SHISHI_NT_UNKNOWN. |
principal : | input array with principal name. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_encticketpart_cnamerealm_get (Shishi *handle, Shishi_asn1 encticketpart, char *cnamerealm, int *cnamerealmlen);
handle : | |
encticketpart : | |
cnamerealm : | |
cnamerealmlen : | |
Returns : |
|
int shishi_encticketpart_print (Shishi *handle, FILE *fh, Shishi_asn1 encticketpart);
handle : | |
fh : | |
encticketpart : | |
Returns : |
|
int shishi_encticketpart_flags_set (Shishi *handle, Shishi_asn1 encticketpart, int flags);
Set the EncTicketPart.flags to supplied value.
handle : | shishi handle as allocated by shishi_init(). |
encticketpart : | input EncTicketPart variable. |
flags : | flags to set in encticketpart. |
Returns : | Returns SHISHI_OK iff succesful. |
int shishi_encticketpart_transited_set (Shishi *handle, Shishi_asn1 encticketpart, int trtype, char *trdata, size_t trdatalen);
Set the EncTicketPart.transited field to supplied value.
handle : | shishi handle as allocated by shishi_init(). |
encticketpart : | input EncTicketPart variable. |
trtype : | transitedencoding type, e.g. SHISHI_TR_DOMAIN_X500_COMPRESS. |
trdata : | actual transited realm data. |
trdatalen : | length of actual transited realm data. |
Returns : | Returns SHISHI_OK iff succesful. |
int shishi_encticketpart_authtime_set (Shishi *handle, Shishi_asn1 encticketpart, const char *authtime);
Set the EncTicketPart.authtime to supplied value.
handle : | shishi handle as allocated by shishi_init(). |
encticketpart : | input EncTicketPart variable. |
authtime : | character buffer containing a generalized time string. |
Returns : | Returns SHISHI_OK iff succesful. |
int shishi_encticketpart_endtime_set (Shishi *handle, Shishi_asn1 encticketpart, const char *endtime);
Set the EncTicketPart.endtime to supplied value.
handle : | shishi handle as allocated by shishi_init(). |
encticketpart : | input EncTicketPart variable. |
endtime : | character buffer containing a generalized time string. |
Returns : | Returns SHISHI_OK iff succesful. |
int shishi_encticketpart_authtime (Shishi *handle, Shishi_asn1 encticketpart, char *authtime, int *authtimelen);
handle : | |
encticketpart : | |
authtime : | |
authtimelen : | |
Returns : |
|
time_t shishi_encticketpart_authctime (Shishi *handle, Shishi_asn1 encticketpart);
handle : | |
encticketpart : | |
Returns : |
|
int shishi_safe (Shishi *handle, Shishi_safe **safe);
Create a new SAFE exchange.
handle : | shishi handle as allocated by shishi_init(). |
safe : | pointer to new structure that holds information about SAFE exchange |
Returns : | Returns SHISHI_OK iff successful. |
Shishi_key* shishi_safe_key (Shishi_safe *safe);
safe : | structure that holds information about SAFE exchange |
Returns : | Returns the key used in the SAFE exchange, or NULL if not yet set or an error occured. |
void shishi_safe_key_set (Shishi_safe *safe, Shishi_key *key);
Set the Key in the SAFE exchange.
safe : | structure that holds information about SAFE exchange |
key : | key to store in SAFE. |
Shishi_asn1 shishi_safe_safe (Shishi_safe *safe);
safe : | structure that holds information about SAFE exchange |
Returns : | Returns the ASN.1 safe in the SAFE exchange, or NULL if not yet set or an error occured. |
void shishi_safe_safe_set (Shishi_safe *safe, Shishi_asn1 asn1safe);
Set the KRB-SAFE in the SAFE exchange.
safe : | structure that holds information about SAFE exchange |
asn1safe : | KRB-SAFE to store in SAFE exchange. |
int shishi_safe_safe_der (Shishi_safe *safe, char *out, int *outlen);
DER encode SAFE structure. Typically shishi_safe_build() is used instead to build the SAFE structure first.
safe : | safe as allocated by shishi_safe(). |
out : | output array with der encoding of SAFE. |
outlen : | length of output array with der encoding of SAFE. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_safe_safe_der_set (Shishi_safe *safe, char *der, size_t derlen);
DER decode KRB-SAFE and set it SAFE exchange. If decoding fails, the KRB-SAFE in the SAFE exchange remains.
safe : | safe as allocated by shishi_safe(). |
der : | input array with DER encoded KRB-SAFE. |
derlen : | length of input array with DER encoded KRB-SAFE. |
Returns : | Returns SHISHI_OK. |
int shishi_safe_print (Shishi *handle, FILE *fh, Shishi_asn1 safe);
Print ASCII armored DER encoding of SAFE to file.
handle : | shishi handle as allocated by shishi_init(). |
fh : | file handle open for writing. |
safe : | SAFE to print. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_safe_save (Shishi *handle, FILE *fh, Shishi_asn1 safe);
Save DER encoding of SAFE to file.
handle : | shishi handle as allocated by shishi_init(). |
fh : | file handle open for writing. |
safe : | SAFE to save. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_safe_to_file (Shishi *handle, Shishi_asn1 safe, int filetype, char *filename);
Write SAFE to file in specified TYPE. The file will be truncated if it exists.
handle : | shishi handle as allocated by shishi_init(). |
safe : | SAFE to save. |
filetype : | input variable specifying type of file to be written, see Shishi_filetype. |
filename : | input variable with filename to write to. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_safe_parse (Shishi *handle, FILE *fh, Shishi_asn1 *safe);
Read ASCII armored DER encoded SAFE from file and populate given variable.
handle : | shishi handle as allocated by shishi_init(). |
fh : | file handle open for reading. |
safe : | output variable with newly allocated SAFE. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_safe_read (Shishi *handle, FILE *fh, Shishi_asn1 *safe);
Read DER encoded SAFE from file and populate given variable.
handle : | shishi handle as allocated by shishi_init(). |
fh : | file handle open for reading. |
safe : | output variable with newly allocated SAFE. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_safe_from_file (Shishi *handle, Shishi_asn1 *safe, int filetype, char *filename);
Read SAFE from file in specified TYPE.
handle : | shishi handle as allocated by shishi_init(). |
safe : | output variable with newly allocated SAFE. |
filetype : | input variable specifying type of file to be read, see Shishi_filetype. |
filename : | input variable with filename to read from. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_safe_cksum (Shishi *handle, Shishi_asn1 safe, int32_t *cksumtype, char *cksum, size_t *cksumlen);
Read checksum value from KRB-SAFE.
handle : | shishi handle as allocated by shishi_init(). |
safe : | safe as allocated by shishi_safe(). |
cksumtype : | output checksum type. |
cksum : | output checksum data from SAFE. |
cksumlen : | on input, maximum size of output checksum data buffer, on output, actual size of output checksum data buffer. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_safe_set_cksum (Shishi *handle, Shishi_asn1 safe, int32_t cksumtype, char *cksum, size_t cksumlen);
Store checksum value in SAFE. A checksum is usually created by calling shishi_checksum() on some application specific data using the key from the ticket that is being used. To save time, you may want to use shishi_safe_build() instead, which calculates the checksum and calls this function in one step.
handle : | shishi handle as allocated by shishi_init(). |
safe : | safe as allocated by shishi_safe(). |
cksumtype : | input checksum type to store in SAFE. |
cksum : | input checksum data to store in SAFE. |
cksumlen : | size of input checksum data to store in SAFE. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_safe_user_data (Shishi *handle, Shishi_asn1 safe, char *userdata, size_t *userdatalen);
Read user data value from KRB-SAFE.
handle : | shishi handle as allocated by shishi_init(). |
safe : | safe as allocated by shishi_safe(). |
userdata : | output user data from KRB-SAFE. |
userdatalen : | on input, maximum size of output user data buffer, on output, actual size of output user data buffer. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_safe_set_user_data (Shishi *handle, Shishi_asn1 safe, char *userdata, size_t userdatalen);
Set the application data in SAFE.
handle : | shishi handle as allocated by shishi_init(). |
safe : | safe as allocated by shishi_safe(). |
userdata : | input user application to store in SAFE. |
userdatalen : | size of input user application to store in SAFE. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_safe_build (Shishi_safe *safe, Shishi_key *key);
Build checksum and set it in KRB-SAFE. Note that this follows RFC 1510bis and is incompatible with RFC 1510, although presumably few implementations use the RFC1510 algorithm.
safe : | safe as allocated by shishi_safe(). |
key : | key for session, used to compute checksum. |
Returns : | Returns SHISHI_OK iff successful. |
int shishi_safe_verify (Shishi_safe *safe, Shishi_key *key);
Verify checksum in KRB-SAFE. Note that this follows RFC 1510bis and is incompatible with RFC 1510, although presumably few implementations use the RFC1510 algorithm.
safe : | safe as allocated by shishi_safe(). |
key : | key for session, used to verify checksum. |
Returns : | Returns SHISHI_OK iff successful, SHISHI_SAFE_BAD_KEYTYPE if an incompatible key type is used, or SHISHI_SAFE_VERIFY_FAILED if the actual verification failed. |
<<< Shishi API Reference Manual |