From cef536e1a77392a56489e7c811185abdc031b2eb Mon Sep 17 00:00:00 2001 From: John Kohl Date: Tue, 9 Oct 1990 16:33:13 +0000 Subject: [PATCH] *** empty log message *** git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@1170 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/krb5/asn.1/edat2kedat.c | 58 +++++++++++++++++++++++++++++++++ src/lib/krb5/asn.1/kedat2edat.c | 57 ++++++++++++++++++++++++++++++++ 2 files changed, 115 insertions(+) create mode 100644 src/lib/krb5/asn.1/edat2kedat.c create mode 100644 src/lib/krb5/asn.1/kedat2edat.c 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); +} -- 2.26.2