/*
*/
/*
*
* Copyright 1990,1991 by the Massachusetts Institute of Technology.
* All Rights Reserved.
*
* Export of this software from the United States of America may
* require a specific license from the United States Government.
* It is the responsibility of any person or organization contemplating
* export to obtain such a license before exporting.
*
* WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
* distribute this software and its documentation for any purpose and
* without fee is hereby granted, provided that the above copyright
* notice appear in all copies and that both that copyright notice and
* this permission notice appear in supporting documentation, and that
* the name of M.I.T. not be used in advertising or publicity pertaining
* to distribution of the software without specific, written prior
* permission. Furthermore if you modify this software you must label
* your software as modified software and not distribute it in such a
* fashion that it might be confused with the original M.I.T. software.
* M.I.T. makes no representations about the suitability of
* this software for any purpose. It is provided "as is" without express
* or implied warranty.
*
*
* krb5_rd_priv()
*/
#include "k5-int.h"
#include "cleanup.h"
#include "auth_con.h"
/*
Parses a KRB_PRIV message from inbuf, placing the confidential user
data in *outbuf.
key specifies the key to be used for decryption of the message.
remote_addr and local_addr specify the full
addresses (host and port) of the sender and receiver.
outbuf points to allocated storage which the caller should
free when finished.
i_vector is used as an initialization vector for the
encryption, and if non-NULL its contents are replaced with the last
block of the encrypted data upon exit.
Returns system errors, integrity errors.
*/
static krb5_error_code
krb5_rd_priv_basic(krb5_context context, const krb5_data *inbuf, const krb5_keyblock *keyblock, const krb5_address *local_addr, const krb5_address *remote_addr, krb5_pointer i_vector, krb5_replay_data *replaydata, krb5_data *outbuf)
{
if (!krb5_is_krb_priv(inbuf))
return KRB5KRB_AP_ERR_MSG_TYPE;
/* decode private message */
return retval;
if (i_vector) {
&blocksize)))
goto cleanup_privmsg;
}
goto cleanup_privmsg;
}
goto cleanup_scratch;
/* now decode the decrypted stuff */
goto cleanup_scratch;
goto cleanup_data;
}
if (privmsg_enc_part->r_address) {
if (local_addr) {
goto cleanup_data;
}
} else {
goto cleanup_data;
}
our_addrs)) {
goto cleanup_data;
}
}
}
/* everything is ok - return data to the user */
retval = 0;
if (retval == 0)
/* Solaris Kerberos */
return retval;
}
krb5_rd_priv(krb5_context context, krb5_auth_context auth_context, const krb5_data *inbuf, krb5_data *outbuf, krb5_replay_data *outdata)
{
/* Get keyblock */
/* Need a better error */
return KRB5_RC_REQUIRED;
return KRB5_RC_REQUIRED;
{
CLEANUP_INIT(2);
if (auth_context->local_addr) {
if (auth_context->local_port) {
&local_fulladdr))){
} else {
return retval;
}
} else {
}
}
if (auth_context->remote_addr) {
if (auth_context->remote_port) {
&remote_fulladdr))){
} else {
CLEANUP_DONE();
return retval;
}
} else {
}
}
&replaydata, outbuf))) {
CLEANUP_DONE();
return retval;
}
CLEANUP_DONE();
}
goto error;
goto error;
goto error;
}
}
replaydata.seq)) {
goto error;
}
}
}
/* everything is ok - return data to the user */
return 0;
error:;
return retval;
}