2N/A/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */
2N/A/*
2N/A * lib/krb5/os/accessor.c
2N/A *
2N/A * Copyright 1990, 2008 by the Massachusetts Institute of Technology.
2N/A * All Rights Reserved.
2N/A *
2N/A * Export of this software from the United States of America may
2N/A * require a specific license from the United States Government.
2N/A * It is the responsibility of any person or organization contemplating
2N/A * export to obtain such a license before exporting.
2N/A *
2N/A * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
2N/A * distribute this software and its documentation for any purpose and
2N/A * without fee is hereby granted, provided that the above copyright
2N/A * notice appear in all copies and that both that copyright notice and
2N/A * this permission notice appear in supporting documentation, and that
2N/A * the name of M.I.T. not be used in advertising or publicity pertaining
2N/A * to distribution of the software without specific, written prior
2N/A * permission. Furthermore if you modify this software you must label
2N/A * your software as modified software and not distribute it in such a
2N/A * fashion that it might be confused with the original M.I.T. software.
2N/A * M.I.T. makes no representations about the suitability of
2N/A * this software for any purpose. It is provided "as is" without express
2N/A * or implied warranty.
2N/A *
2N/A */
2N/A
2N/A#include "k5-int.h"
2N/A#include "os-proto.h"
2N/A
2N/A/* If this trick gets used elsewhere, move it to k5-platform.h. */
2N/A#ifndef DESIGNATED_INITIALIZERS
2N/A#define DESIGNATED_INITIALIZERS \
2N/A /* ANSI/ISO C 1999 supports this... */ \
2N/A (__STDC_VERSION__ >= 199901L \
2N/A /* ...as does GCC, since version 2.something. */ \
2N/A || (!defined __cplusplus && __GNUC__ >= 3))
2N/A#endif
2N/A
2N/Akrb5_error_code KRB5_CALLCONV
2N/Akrb5int_accessor(krb5int_access *internals, krb5_int32 version)
2N/A{
2N/A if (version == KRB5INT_ACCESS_VERSION) {
2N/A#if DESIGNATED_INITIALIZERS
2N/A#define S(FIELD, VAL) .FIELD = VAL
2N/A#if defined __GNUC__ && __STDC_VERSION__ < 199901L
2N/A __extension__
2N/A#endif
2N/A static const krb5int_access internals_temp = {
2N/A#else
2N/A#define S(FIELD, VAL) internals_temp.FIELD = VAL
2N/A krb5int_access internals_temp;
2N/A#endif
2N/A /* S (arcfour_gsscrypt, krb5int_arcfour_gsscrypt), */
2N/A S (free_addrlist, krb5int_free_addrlist),
2N/A /* S (auth_con_get_subkey_enctype, krb5_auth_con_get_subkey_enctype), */
2N/A S (sendto_udp, &krb5int_sendto),
2N/A S (add_host_to_list, krb5int_add_host_to_list),
2N/A
2N/A#ifdef KRB5_DNS_LOOKUP
2N/A#define SC(FIELD, VAL) S(FIELD, VAL)
2N/A#else /* disable */
2N/A#define SC(FIELD, VAL) S(FIELD, 0)
2N/A#endif
2N/A SC (make_srv_query_realm, krb5int_make_srv_query_realm),
2N/A SC (free_srv_dns_data, krb5int_free_srv_dns_data),
2N/A SC (use_dns_kdc, _krb5_use_dns_kdc),
2N/A#undef SC
2N/A S (clean_hostname, krb5int_clean_hostname),
2N/A /*
2N/A * Solaris Kerberos: XXX some of these accessors are commented out
2N/A * but may need to be uncommented as the 1.8 resync continues
2N/A */
2N/A S (mandatory_cksumtype, krb5int_c_mandatory_cksumtype),
2N/A#ifndef LEAN_CLIENT
2N/A#define SC(FIELD, VAL) S(FIELD, VAL)
2N/A#else /* disable */
2N/A#define SC(FIELD, VAL) S(FIELD, 0)
2N/A#endif
2N/A SC (ser_pack_int64, krb5_ser_pack_int64),
2N/A SC (ser_unpack_int64, krb5_ser_unpack_int64),
2N/A#undef SC
2N/A
2N/A#ifdef ENABLE_LDAP
2N/A#define SC(FIELD, VAL) S(FIELD, VAL)
2N/A#else
2N/A#define SC(FIELD, VAL) S(FIELD, 0)
2N/A#endif
2N/A SC (asn1_ldap_encode_sequence_of_keys, krb5int_ldap_encode_sequence_of_keys),
2N/A SC (asn1_ldap_decode_sequence_of_keys, krb5int_ldap_decode_sequence_of_keys),
2N/A#undef SC
2N/A
2N/A#ifndef DISABLE_PKINIT
2N/A#define SC(FIELD, VAL) S(FIELD, VAL)
2N/A#else /* disable */
2N/A#define SC(FIELD, VAL) S(FIELD, 0)
2N/A#endif
2N/A SC (encode_krb5_pa_pk_as_req, encode_krb5_pa_pk_as_req),
2N/A SC (encode_krb5_pa_pk_as_req_draft9, encode_krb5_pa_pk_as_req_draft9),
2N/A SC (encode_krb5_pa_pk_as_rep, encode_krb5_pa_pk_as_rep),
2N/A SC (encode_krb5_pa_pk_as_rep_draft9, encode_krb5_pa_pk_as_rep_draft9),
2N/A SC (encode_krb5_auth_pack, encode_krb5_auth_pack),
2N/A SC (encode_krb5_auth_pack_draft9, encode_krb5_auth_pack_draft9),
2N/A SC (encode_krb5_kdc_dh_key_info, encode_krb5_kdc_dh_key_info),
2N/A SC (encode_krb5_reply_key_pack, encode_krb5_reply_key_pack),
2N/A SC (encode_krb5_reply_key_pack_draft9, encode_krb5_reply_key_pack_draft9),
2N/A SC (encode_krb5_typed_data, encode_krb5_typed_data),
2N/A SC (encode_krb5_td_trusted_certifiers, encode_krb5_td_trusted_certifiers),
2N/A SC (encode_krb5_td_dh_parameters, encode_krb5_td_dh_parameters),
2N/A SC (decode_krb5_pa_pk_as_req, decode_krb5_pa_pk_as_req),
2N/A SC (decode_krb5_pa_pk_as_req_draft9, decode_krb5_pa_pk_as_req_draft9),
2N/A SC (decode_krb5_pa_pk_as_rep, decode_krb5_pa_pk_as_rep),
2N/A SC (decode_krb5_pa_pk_as_rep_draft9, decode_krb5_pa_pk_as_rep_draft9),
2N/A SC (decode_krb5_auth_pack, decode_krb5_auth_pack),
2N/A SC (decode_krb5_auth_pack_draft9, decode_krb5_auth_pack_draft9),
2N/A SC (decode_krb5_kdc_dh_key_info, decode_krb5_kdc_dh_key_info),
2N/A SC (decode_krb5_principal_name, decode_krb5_principal_name),
2N/A SC (decode_krb5_reply_key_pack, decode_krb5_reply_key_pack),
2N/A SC (decode_krb5_reply_key_pack_draft9, decode_krb5_reply_key_pack_draft9),
2N/A SC (decode_krb5_typed_data, decode_krb5_typed_data),
2N/A SC (decode_krb5_td_trusted_certifiers, decode_krb5_td_trusted_certifiers),
2N/A SC (decode_krb5_td_dh_parameters, decode_krb5_td_dh_parameters),
2N/A SC (decode_krb5_as_req, decode_krb5_as_req),
2N/A SC (encode_krb5_kdc_req_body, encode_krb5_kdc_req_body),
2N/A SC (free_kdc_req, krb5_free_kdc_req),
2N/A SC (set_prompt_types, krb5int_set_prompt_types),
2N/A SC (encode_krb5_authdata_elt, encode_krb5_authdata_elt),
2N/A#undef SC
2N/A
2N/A /* S (encode_krb5_sam_response_2, encode_krb5_sam_response_2), */
2N/A /* S (encode_krb5_enc_sam_response_enc_2, encode_krb5_enc_sam_response_enc_2), */
2N/A /* S (encode_enc_ts, encode_krb5_pa_enc_ts), */
2N/A /* S (decode_enc_ts, decode_krb5_pa_enc_ts), */
2N/A /* S (encode_enc_data, encode_krb5_enc_data), */
2N/A /* S(decode_enc_data, decode_krb5_enc_data), */
2N/A /* S(free_enc_ts, krb5_free_pa_enc_ts), */
2N/A /* S(free_enc_data, krb5_free_enc_data), */
2N/A /* S(encrypt_helper, krb5_encrypt_helper), */
2N/A
2N/A#if DESIGNATED_INITIALIZERS
2N/A };
2N/A#else
2N/A 0;
2N/A#endif
2N/A *internals = internals_temp;
2N/A return 0;
2N/A }
2N/A return KRB5_OBSOLETE_FN;
2N/A}