From: John Kohl Date: Tue, 9 Oct 1990 16:33:13 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: krb5-1.0-alpha2~241 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=cef536e1a77392a56489e7c811185abdc031b2eb;p=krb5.git *** empty log message *** git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@1170 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/krb5/asn.1/edat2kedat.c b/src/lib/krb5/asn.1/edat2kedat.c new file mode 100644 index 000000000..c5d2f3f8c --- /dev/null +++ b/src/lib/krb5/asn.1/edat2kedat.c @@ -0,0 +1,58 @@ +/* + * $Source$ + * $Author$ + * + * Copyright 1990 by the Massachusetts Institute of Technology. + * + * For copying and distribution information, please see the file + * . + * + * Glue between Kerberos version and ISODE 6.0 version of structures. + */ + +#if !defined(lint) && !defined(SABER) +static char rcsid_edat2kedat_c[] = +"$Id$"; +#endif /* lint || saber */ + +#include +#include + +/*#include */ +#include +#include "KRB5-types.h" +#include "asn1glue.h" +#include "asn1defs.h" + +#include + +/* ISODE defines max(a,b) */ + +krb5_enc_data * +KRB5_EncryptedData2krb5_enc_data(val, error) +const register struct type_KRB5_EncryptedData *val; +register int *error; +{ + register krb5_enc_data *retval; + krb5_data *temp; + + retval = (krb5_enc_data *)xmalloc(sizeof(*retval)); + if (!retval) { + *error = ENOMEM; + return(0); + } + xbzero(retval, sizeof(*retval)); + + temp = qbuf2krb5_data(val->cipher, error); + if (temp) { + retval->ciphertext = *temp; + xfree(temp); + } else { + xfree(retval); + return(0); + } + if (val->optionals & opt_KRB5_EncryptedData_kvno) + retval->kvno = val->kvno; + retval->etype = val->etype; + return(retval); +} diff --git a/src/lib/krb5/asn.1/kedat2edat.c b/src/lib/krb5/asn.1/kedat2edat.c new file mode 100644 index 000000000..c154a7d93 --- /dev/null +++ b/src/lib/krb5/asn.1/kedat2edat.c @@ -0,0 +1,57 @@ +/* + * $Source$ + * $Author$ + * + * Copyright 1990 by the Massachusetts Institute of Technology. + * + * For copying and distribution information, please see the file + * . + * + * Glue between Kerberos version and ISODE 6.0 version of structures. + */ + +#if !defined(lint) && !defined(SABER) +static char rcsid_kedat2edat_c[] = +"$Id$"; +#endif /* lint || saber */ + +#include +#include + +/*#include */ +#include +#include "KRB5-types.h" +#include "asn1glue.h" +#include "asn1defs.h" + +#include + +/* ISODE defines max(a,b) */ + +struct type_KRB5_EncryptedData * +krb5_enc_data2KRB5_EncryptedData(val, error) +const register krb5_enc_data *val; +register int *error; +{ + register struct type_KRB5_EncryptedData *retval; + + retval = (struct type_KRB5_EncryptedData *)xmalloc(sizeof(*retval)); + if (!retval) { + *error = ENOMEM; + return(0); + } + xbzero(retval, sizeof(*retval)); + + retval->etype = val->etype; + retval->cipher = krb5_data2qbuf(&(val->ciphertext)); + if (!retval->cipher) { + xfree(retval); + *error = ENOMEM; + return(0); + } + if (val->kvno) { + retval->optionals = opt_KRB5_EncryptedData_kvno; + retval->kvno = val->kvno; + } + return(retval); +}