diff options
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/krb5/asn.1/edat2kedat.c | 58 | ||||
| -rw-r--r-- | src/lib/krb5/asn.1/kedat2edat.c | 57 |
2 files changed, 115 insertions, 0 deletions
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 + * <krb5/copyright.h>. + * + * 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 <krb5/copyright.h> +#include <krb5/krb5.h> + +/*#include <time.h> */ +#include <isode/psap.h> +#include "KRB5-types.h" +#include "asn1glue.h" +#include "asn1defs.h" + +#include <krb5/ext-proto.h> + +/* 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 + * <krb5/copyright.h>. + * + * 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 <krb5/copyright.h> +#include <krb5/krb5.h> + +/*#include <time.h> */ +#include <isode/psap.h> +#include "KRB5-types.h" +#include "asn1glue.h" +#include "asn1defs.h" + +#include <krb5/ext-proto.h> + +/* 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); +} |
