rd_cred.c revision 159d09a20817016f09b3ea28d1bdada4a336bb91
/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#include "k5-int.h"
#include "cleanup.h"
#include "auth_con.h"
#include <stddef.h> /* NULL */
#include <stdlib.h> /* malloc */
#include <errno.h> /* ENOMEM */
/*-------------------- decrypt_credencdata --------------------*/
/*
* decrypt the enc_part of a krb5_cred
*/
/*ARGSUSED*/
static krb5_error_code
decrypt_credencdata(krb5_context context, krb5_cred *pcred, krb5_keyblock *pkeyblock, krb5_cred_enc_part *pcredenc)
{
return ENOMEM;
goto cleanup;
} else {
/* Solaris Kerberos */
}
/* now decode the decrypted stuff */
goto cleanup;
retval = 0;
}
/* Solaris Kerberos */
return retval;
}
/*----------------------- krb5_rd_cred_basic -----------------------*/
static krb5_error_code
krb5_rd_cred_basic(krb5_context context, krb5_data *pcreddata, krb5_keyblock *pkeyblock, krb5_replay_data *replaydata, krb5_creds ***pppcreds)
{
krb5_int32 i = 0;
/* decode cred message */
return retval;
/* Solaris Kerberos */
goto cleanup_cred;
/*
* Allocate the list of creds. The memory is allocated so that
* krb5_free_tgt_creds can be used to free the list.
*/
if ((*pppcreds =
goto cleanup_cred;
}
/*
* For each credential, create a strcture in the list of
* credentials and copy the information.
*/
while (i < ncreds) {
krb5_creds * pcur;
goto cleanup;
}
(*pppcreds)[i+1] = 0;
/* Solaris Kerberos */
goto cleanup;
goto cleanup;
goto cleanup;
goto cleanup;
goto cleanup;
/* Solaris Kerberos */
}
/*
* NULL terminate the list
*/
if (retval)
return retval;
}
/*----------------------- krb5_rd_cred -----------------------*/
/*
* This functions takes as input an KRB_CRED message, validates it, and
* outputs the nonce and an array of the forwarded credentials.
*/
krb5_rd_cred(krb5_context context, krb5_auth_context auth_context, krb5_data *pcreddata, krb5_creds ***pppcreds, krb5_replay_data *outdata)
{
/* Get keyblock */
/* Need a better error */
return KRB5_RC_REQUIRED;
return KRB5_RC_REQUIRED;
/* If decrypting with the first keyblock we try fails, perhaps the
* credentials are stored in the session key so try decrypting with
* that.
*/
&replaydata, pppcreds))) {
&replaydata, pppcreds))) {
return retval;
}
}
goto error;
goto error;
}
goto error;
goto error;
}
}
goto error;
}
}
}
error:;
if (retval) {
}
return retval;
}