/*
*
* Copyright 1995 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.
*
*/
/*
* ser_cksum.c - Serialize a krb5_checksum structure.
*/
#include "k5-int.h"
#include "int-proto.h"
/*
* Routines to deal with externalizing the krb5_checksum:
* krb5_checksum_esize();
* krb5_checksum_externalize();
* krb5_checksum_internalize();
*/
/* Local data */
KV5M_CHECKSUM, /* Type */
krb5_checksum_esize, /* Sizer routine */
krb5_checksum_externalize, /* Externalize routine */
krb5_checksum_internalize /* Internalize routine */
};
/*
* krb5_checksum_esize() - Determine the size required to externalize
* the krb5_checksum.
*/
/*ARGSUSED*/
static krb5_error_code
{
/*
* krb5_checksum requires:
* krb5_int32 for KV5M_CHECKSUM
* krb5_int32 for checksum_type
* krb5_int32 for length
* krb5_int32 for KV5M_CHECKSUM
* checksum->length for contents
*/
/* Solaris Kerberos */
if (checksum) {
*sizep += (sizeof(krb5_int32) +
sizeof(krb5_int32) +
sizeof(krb5_int32) +
sizeof(krb5_int32) +
kret = 0;
}
return(kret);
}
/*
* krb5_checksum_externalize() - Externalize the krb5_checksum.
*/
static krb5_error_code
krb5_checksum_externalize(krb5_context kcontext, krb5_pointer arg, krb5_octet **buffer, size_t *lenremain)
{
required = 0;
/* Solaris Kerberos */
if (checksum) {
/* Our identifier */
/* Our checksum_type */
/* Our length */
/* Our contents */
/* Finally, our trailer */
kret = 0;
}
}
return(kret);
}
/*
* krb5_checksum_internalize() - Internalize the krb5_checksum.
*/
/*ARGSUSED*/
static krb5_error_code
krb5_checksum_internalize(krb5_context kcontext, krb5_pointer *argp, krb5_octet **buffer, size_t *lenremain)
{
/* Read our magic number */
ibuf = 0;
if (ibuf == KV5M_CHECKSUM) {
/* Get a checksum */
/* Get the checksum_type */
/* Get the length */
/* Get the string */
/* Solaris Kerberos */
if (ibuf)
if (!ibuf ||
/* Get the trailer */
}
else
}
if (kret) {
}
}
}
return(kret);
}
/*
* Register the checksum serializer.
*/
{
}