Exemplo n.º 1
0
static cc_int32 ccs_ccache_get_principal (ccs_ccache_t           io_ccache,
                                          ccs_cache_collection_t io_cache_collection,
                                          k5_ipc_stream           in_request_data,
                                          k5_ipc_stream           io_reply_data)
{
    cc_int32 err = ccNoError;
    cc_uint32 version = 0;

    if (!io_ccache          ) { err = cci_check_error (ccErrBadParam); }
    if (!io_cache_collection) { err = cci_check_error (ccErrBadParam); }
    if (!in_request_data    ) { err = cci_check_error (ccErrBadParam); }
    if (!io_reply_data      ) { err = cci_check_error (ccErrBadParam); }

    if (!err) {
        err = krb5int_ipc_stream_read_uint32 (in_request_data, &version);
    }

    if (!err) {
        if (version == cc_credentials_v5) {
            err = krb5int_ipc_stream_write_string (io_reply_data, io_ccache->v5_principal);

        } else {
            err = cci_check_error (ccErrBadCredentialsVersion);
        }
    }

    return cci_check_error (err);
}
Exemplo n.º 2
0
static cc_int32 ccs_cache_collection_get_default_ccache_name (ccs_cache_collection_t io_cache_collection,
                                                               k5_ipc_stream           in_request_data,
                                                               k5_ipc_stream           io_reply_data)
{
    cc_int32 err = ccNoError;
    cc_uint64 count = 0;

    if (!io_cache_collection) { err = cci_check_error (ccErrBadParam); }
    if (!in_request_data    ) { err = cci_check_error (ccErrBadParam); }
    if (!io_reply_data      ) { err = cci_check_error (ccErrBadParam); }

    if (!err) {
        err = ccs_cache_collection_list_count (io_cache_collection->ccaches, &count);
    }

    if (!err) {
        if (count > 0) {
            ccs_ccache_t ccache = NULL;

            err = ccs_cache_collection_get_default_ccache (io_cache_collection, &ccache);

            if (!err) {
                err = ccs_ccache_write_name (ccache, io_reply_data);
            }
        } else {
            err = krb5int_ipc_stream_write_string (io_reply_data,
                                           k_cci_context_initial_ccache_name);
        }
    }

    return cci_check_error (err);
}
Exemplo n.º 3
0
cc_uint32 cci_identifier_write (cci_identifier_t in_identifier,
                                k5_ipc_stream     io_stream)
{
    cc_int32 err = ccNoError;

    if (!in_identifier) { err = cci_check_error (ccErrBadParam); }
    if (!io_stream    ) { err = cci_check_error (ccErrBadParam); }

    if (!err) {
        err = krb5int_ipc_stream_write_string (io_stream, in_identifier->server_id);
    }

    if (!err) {
        err = krb5int_ipc_stream_write_string (io_stream, in_identifier->object_id);
    }

    return cci_check_error (err);
}
Exemplo n.º 4
0
cc_int32 ccs_ccache_write_name (ccs_ccache_t in_ccache,
                                k5_ipc_stream io_stream)
{
    cc_int32 err = ccNoError;

    if (!in_ccache) { err = cci_check_error (ccErrBadParam); }
    if (!io_stream) { err = cci_check_error (ccErrBadParam); }

    if (!err) {
        err = krb5int_ipc_stream_write_string (io_stream, in_ccache->name);
    }

    return cci_check_error (err);
}
Exemplo n.º 5
0
static cc_int32 ccs_ccache_get_name (ccs_ccache_t           io_ccache,
                                     ccs_cache_collection_t io_cache_collection,
                                     k5_ipc_stream           in_request_data,
                                     k5_ipc_stream           io_reply_data)
{
    cc_int32 err = ccNoError;

    if (!io_ccache          ) { err = cci_check_error (ccErrBadParam); }
    if (!io_cache_collection) { err = cci_check_error (ccErrBadParam); }
    if (!in_request_data    ) { err = cci_check_error (ccErrBadParam); }
    if (!io_reply_data      ) { err = cci_check_error (ccErrBadParam); }

    if (!err) {
        err = krb5int_ipc_stream_write_string (io_reply_data, io_ccache->name);
    }

    return cci_check_error (err);
}
Exemplo n.º 6
0
static cc_uint32 cci_credentials_v5_write (cc_credentials_v5_t *in_v5creds,
                                           k5_ipc_stream         io_stream)
{
    cc_int32 err = ccNoError;

    if (!io_stream ) { err = cci_check_error (ccErrBadParam); }
    if (!in_v5creds) { err = cci_check_error (ccErrBadParam); }

    if (!err) {
        err = krb5int_ipc_stream_write_string (io_stream, in_v5creds->client);
    }

    if (!err) {
        err = krb5int_ipc_stream_write_string (io_stream, in_v5creds->server);
    }

    if (!err) {
        err = cci_cc_data_write (&in_v5creds->keyblock, io_stream);
    }

    if (!err) {
        err = krb5int_ipc_stream_write_time (io_stream, in_v5creds->authtime);
    }

    if (!err) {
        err = krb5int_ipc_stream_write_time (io_stream, in_v5creds->starttime);
    }

    if (!err) {
        err = krb5int_ipc_stream_write_time (io_stream, in_v5creds->endtime);
    }

    if (!err) {
        err = krb5int_ipc_stream_write_time (io_stream, in_v5creds->renew_till);
    }

    if (!err) {
        err = krb5int_ipc_stream_write_uint32 (io_stream, in_v5creds->is_skey);
    }

    if (!err) {
        err = krb5int_ipc_stream_write_uint32 (io_stream, in_v5creds->ticket_flags);
    }

    if (!err) {
        err = cci_cc_data_array_write (in_v5creds->addresses, io_stream);
    }

    if (!err) {
        err = cci_cc_data_write (&in_v5creds->ticket, io_stream);
    }

    if (!err) {
        err = cci_cc_data_write (&in_v5creds->second_ticket, io_stream);
    }

    if (!err) {
        err = cci_cc_data_array_write (in_v5creds->authdata, io_stream);
    }


    return cci_check_error (err);
}