/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
* NAME
* cred.c
*
* DESCRIPTION
* Provide an interface to assemble and disassemble krb5_cred
* structures.
*
*/
#include "k5-int.h"
#include "cleanup.h"
#include "auth_con.h"
#include <stddef.h> /* NULL */
#include <stdlib.h> /* malloc */
#include <errno.h> /* ENOMEM */
/*-------------------- encrypt_credencpart --------------------*/
/*ARGSUSED*/
/*
* encrypt the enc_part of krb5_cred
*/
static krb5_error_code
encrypt_credencpart(krb5_context context, krb5_cred_enc_part *pcredpart, krb5_keyblock *pkeyblock, krb5_enc_data *pencdata)
{
/* start by encoding to-be-encrypted part of the message */
return retval;
/*
* If the keyblock is NULL, just copy the data from the encoded
* data to the ciphertext area.
*/
return 0;
}
/* call the encryption routine */
if (retval) {
}
return retval;
}
/*----------------------- krb5_mk_ncred_basic -----------------------*/
static krb5_error_code
krb5_mk_ncred_basic(krb5_context context, krb5_creds **ppcreds, krb5_int32 nppcreds, krb5_keyblock *keyblock, krb5_replay_data *replaydata, krb5_address *local_addr, krb5_address *remote_addr, krb5_cred *pcred)
{
int i;
/* Get memory for creds and initialize it */
return ENOMEM;
/*
* For each credential in the list, initialize a cred info
* structure and copy the ticket into the ticket list.
*/
for (i = 0; i < nppcreds; i++) {
goto cleanup;
}
goto cleanup;
goto cleanup;
goto cleanup;
goto cleanup;
goto cleanup;
}
/*
* NULL terminate the lists.
*/
/* encrypt the credential encrypted part */
return retval;
}
/*----------------------- krb5_mk_ncred -----------------------*/
/*
* This functions takes as input an array of krb5_credentials, and
* outputs an encoded KRB_CRED message suitable for krb5_rd_cred
*/
krb5_mk_ncred(krb5_context context, krb5_auth_context auth_context, krb5_creds **ppcreds, krb5_data **ppdata, krb5_replay_data *outdata)
{
local_fulladdr.contents = 0;
remote_fulladdr.contents = 0;
return KRB5KRB_AP_ERR_BADADDR;
}
/*
* Allocate memory for a NULL terminated list of tickets.
*/
return ENOMEM;
}
/* Get keyblock */
/* Get replay info */
return KRB5_RC_REQUIRED;
/* Need a better error */
return KRB5_RC_REQUIRED;
&replaydata.usec)))
return retval;
}
} else {
}
}
if (auth_context->local_addr) {
if (auth_context->local_port) {
&local_fulladdr)))
goto error;
} else {
}
}
if (auth_context->remote_addr) {
if (auth_context->remote_port) {
&remote_fulladdr)))
goto error;
} else {
}
}
/* Setup creds structure */
premote_fulladdr, pcred))) {
goto error;
}
goto error;
/* should we really error out here? XXX */
goto error;
}
}
/* Encode creds structure */
if (local_fulladdr.contents)
if (remote_fulladdr.contents)
if (retval) {
}
return retval;
}
/*----------------------- krb5_mk_1cred -----------------------*/
/*
* A convenience function that calls krb5_mk_ncred.
*/
krb5_mk_1cred(krb5_context context, krb5_auth_context auth_context, krb5_creds *pcreds, krb5_data **ppdata, krb5_replay_data *outdata)
{
return ENOMEM;
}
return retval;
}