From 4c24ac7a064119284583d1c84feada7dbb0de01b Mon Sep 17 00:00:00 2001 From: Theodore Tso Date: Thu, 2 Feb 1995 06:30:03 +0000 Subject: [PATCH] Removal of ISODE (and there was much rejoicing) git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@4876 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/krb5/asn.1/adat2kadat.c | 125 ------------ src/lib/krb5/asn.1/addr2kaddr.c | 127 ------------- src/lib/krb5/asn.1/adr2kadr.c | 70 ------- src/lib/krb5/asn.1/aprp2kaprp.c | 63 ------ src/lib/krb5/asn.1/aprq2kaprq.c | 71 ------- src/lib/krb5/asn.1/arep2karep.c | 72 ------- src/lib/krb5/asn.1/auth2kauth.c | 94 --------- src/lib/krb5/asn.1/ck2kck.c | 71 ------- src/lib/krb5/asn.1/cred2kcred.c | 99 ---------- src/lib/krb5/asn.1/crep2kcrep.c | 189 ------------------ src/lib/krb5/asn.1/cvt_flags.c | 126 ------------ src/lib/krb5/asn.1/decode.c | 75 -------- src/lib/krb5/asn.1/edat2kedat.c | 66 ------- src/lib/krb5/asn.1/ekrp2kekrp.c | 108 ----------- src/lib/krb5/asn.1/enck2kkey.c | 73 ------- src/lib/krb5/asn.1/encode.c | 96 ---------- src/lib/krb5/asn.1/err2kerr.c | 109 ----------- src/lib/krb5/asn.1/etpt2ketpt.c | 122 ------------ src/lib/krb5/asn.1/g2unix.c | 69 ------- src/lib/krb5/asn.1/kadat2adat.c | 124 ------------ src/lib/krb5/asn.1/kaddr2addr.c | 134 ------------- src/lib/krb5/asn.1/kadr2adr.c | 60 ------ src/lib/krb5/asn.1/kaprp2aprp.c | 62 ------ src/lib/krb5/asn.1/kaprq2aprq.c | 75 -------- src/lib/krb5/asn.1/karep2arep.c | 72 ------- src/lib/krb5/asn.1/kauth2auth.c | 93 --------- src/lib/krb5/asn.1/kck2ck.c | 72 ------- src/lib/krb5/asn.1/kcred2cred.c | 105 ---------- src/lib/krb5/asn.1/kcrep2crep.c | 197 ------------------- src/lib/krb5/asn.1/kdcr2kkdcr.c | 140 -------------- src/lib/krb5/asn.1/kdcr2ktgsr.c | 45 ----- src/lib/krb5/asn.1/kedat2edat.c | 65 ------- src/lib/krb5/asn.1/kekrp2ekrp.c | 111 ----------- src/lib/krb5/asn.1/kerr2err.c | 116 ------------ src/lib/krb5/asn.1/ketpt2etpt.c | 109 ----------- src/lib/krb5/asn.1/kkdcr2kdcr.c | 134 ------------- src/lib/krb5/asn.1/kkey2enck.c | 73 ------- src/lib/krb5/asn.1/klsrq2lsrq.c | 121 ------------ src/lib/krb5/asn.1/kprep2prep.c | 84 -------- src/lib/krb5/asn.1/kprin2prin.c | 85 --------- src/lib/krb5/asn.1/kpriv2priv.c | 63 ------ src/lib/krb5/asn.1/kpwd2pwd.c | 89 --------- src/lib/krb5/asn.1/kpwds2pwds.c | 126 ------------ src/lib/krb5/asn.1/ksafe2safe.c | 101 ---------- src/lib/krb5/asn.1/ktgrq2tgrq.c | 326 -------------------------------- src/lib/krb5/asn.1/ktgsr2kdcr.c | 46 ----- src/lib/krb5/asn.1/ktkt2tkt.c | 72 ------- src/lib/krb5/asn.1/ktran2tran.c | 61 ------ src/lib/krb5/asn.1/lsrq2klsrq.c | 108 ----------- src/lib/krb5/asn.1/prep2kprep.c | 95 ---------- src/lib/krb5/asn.1/prin2kprin.c | 103 ---------- src/lib/krb5/asn.1/priv2kpriv.c | 63 ------ src/lib/krb5/asn.1/pwd2kpwd.c | 65 ------- src/lib/krb5/asn.1/pwds2kpwds.c | 89 --------- src/lib/krb5/asn.1/qbuf2data.c | 71 ------- src/lib/krb5/asn.1/safe2ksafe.c | 101 ---------- src/lib/krb5/asn.1/tgrq2ktgrq.c | 277 --------------------------- src/lib/krb5/asn.1/tkt2ktkt.c | 72 ------- src/lib/krb5/asn.1/tran2ktran.c | 64 ------- src/lib/krb5/asn.1/u2gen.c | 66 ------- 60 files changed, 5960 deletions(-) delete mode 100644 src/lib/krb5/asn.1/adat2kadat.c delete mode 100644 src/lib/krb5/asn.1/addr2kaddr.c delete mode 100644 src/lib/krb5/asn.1/adr2kadr.c delete mode 100644 src/lib/krb5/asn.1/aprp2kaprp.c delete mode 100644 src/lib/krb5/asn.1/aprq2kaprq.c delete mode 100644 src/lib/krb5/asn.1/arep2karep.c delete mode 100644 src/lib/krb5/asn.1/auth2kauth.c delete mode 100644 src/lib/krb5/asn.1/ck2kck.c delete mode 100644 src/lib/krb5/asn.1/cred2kcred.c delete mode 100644 src/lib/krb5/asn.1/crep2kcrep.c delete mode 100644 src/lib/krb5/asn.1/cvt_flags.c delete mode 100644 src/lib/krb5/asn.1/decode.c delete mode 100644 src/lib/krb5/asn.1/edat2kedat.c delete mode 100644 src/lib/krb5/asn.1/ekrp2kekrp.c delete mode 100644 src/lib/krb5/asn.1/enck2kkey.c delete mode 100644 src/lib/krb5/asn.1/encode.c delete mode 100644 src/lib/krb5/asn.1/err2kerr.c delete mode 100644 src/lib/krb5/asn.1/etpt2ketpt.c delete mode 100644 src/lib/krb5/asn.1/g2unix.c delete mode 100644 src/lib/krb5/asn.1/kadat2adat.c delete mode 100644 src/lib/krb5/asn.1/kaddr2addr.c delete mode 100644 src/lib/krb5/asn.1/kadr2adr.c delete mode 100644 src/lib/krb5/asn.1/kaprp2aprp.c delete mode 100644 src/lib/krb5/asn.1/kaprq2aprq.c delete mode 100644 src/lib/krb5/asn.1/karep2arep.c delete mode 100644 src/lib/krb5/asn.1/kauth2auth.c delete mode 100644 src/lib/krb5/asn.1/kck2ck.c delete mode 100644 src/lib/krb5/asn.1/kcred2cred.c delete mode 100644 src/lib/krb5/asn.1/kcrep2crep.c delete mode 100644 src/lib/krb5/asn.1/kdcr2kkdcr.c delete mode 100644 src/lib/krb5/asn.1/kdcr2ktgsr.c delete mode 100644 src/lib/krb5/asn.1/kedat2edat.c delete mode 100644 src/lib/krb5/asn.1/kekrp2ekrp.c delete mode 100644 src/lib/krb5/asn.1/kerr2err.c delete mode 100644 src/lib/krb5/asn.1/ketpt2etpt.c delete mode 100644 src/lib/krb5/asn.1/kkdcr2kdcr.c delete mode 100644 src/lib/krb5/asn.1/kkey2enck.c delete mode 100644 src/lib/krb5/asn.1/klsrq2lsrq.c delete mode 100644 src/lib/krb5/asn.1/kprep2prep.c delete mode 100644 src/lib/krb5/asn.1/kprin2prin.c delete mode 100644 src/lib/krb5/asn.1/kpriv2priv.c delete mode 100644 src/lib/krb5/asn.1/kpwd2pwd.c delete mode 100644 src/lib/krb5/asn.1/kpwds2pwds.c delete mode 100644 src/lib/krb5/asn.1/ksafe2safe.c delete mode 100644 src/lib/krb5/asn.1/ktgrq2tgrq.c delete mode 100644 src/lib/krb5/asn.1/ktgsr2kdcr.c delete mode 100644 src/lib/krb5/asn.1/ktkt2tkt.c delete mode 100644 src/lib/krb5/asn.1/ktran2tran.c delete mode 100644 src/lib/krb5/asn.1/lsrq2klsrq.c delete mode 100644 src/lib/krb5/asn.1/prep2kprep.c delete mode 100644 src/lib/krb5/asn.1/prin2kprin.c delete mode 100644 src/lib/krb5/asn.1/priv2kpriv.c delete mode 100644 src/lib/krb5/asn.1/pwd2kpwd.c delete mode 100644 src/lib/krb5/asn.1/pwds2kpwds.c delete mode 100644 src/lib/krb5/asn.1/qbuf2data.c delete mode 100644 src/lib/krb5/asn.1/safe2ksafe.c delete mode 100644 src/lib/krb5/asn.1/tgrq2ktgrq.c delete mode 100644 src/lib/krb5/asn.1/tkt2ktkt.c delete mode 100644 src/lib/krb5/asn.1/tran2ktran.c delete mode 100644 src/lib/krb5/asn.1/u2gen.c diff --git a/src/lib/krb5/asn.1/adat2kadat.c b/src/lib/krb5/asn.1/adat2kadat.c deleted file mode 100644 index 86f5c742b..000000000 --- a/src/lib/krb5/asn.1/adat2kadat.c +++ /dev/null @@ -1,125 +0,0 @@ -/* - * lib/krb5/asn.1/adat2kadat.c - * - * Copyright 1989,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. 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. - * - * - * Glue between Kerberos version and ISODE 6.0 version of structures. - */ - - -#include - -/*#include */ -#include -#include -#include "asn1glue.h" - -#include - -/* ISODE defines max(a,b) */ - -krb5_authdata ** -KRB5_AuthorizationData2krb5_authdata(val, error) -const struct type_KRB5_AuthorizationData *val; -register int *error; -{ -#if 0 - /* this code is for -h2 style ISODE structures. However, pepsy - generates horribly broken when given -h2. */ - - register krb5_authdata **retval; - register int i; - - /* plus one for null terminator */ - retval = (krb5_authdata **) xcalloc(val->nelem + 1, - sizeof(krb5_authdata *)); - if (!retval) { - nomem: - *error = ENOMEM; - return(0); - } - for (i = 0; i < val->nelem; i++) { - if (qb_pullup(val->element_KRB5_2[i]->ad__data) != OK) { - krb5_xfree(retval); - goto nomem; - } - retval[i] = (krb5_authdata *) xmalloc(sizeof(*retval[i])); - if (!retval[i]) { - krb5_free_authdata(retval); - goto nomem; - } - retval[i]->contents = (unsigned char *)xmalloc(val->element_KRB5_2[i]->ad__data->qb_forw->qb_len); - if (!retval[i]->contents) { - krb5_xfree(retval[i]); - retval[i] = 0; - krb5_free_authdata(retval); - goto nomem; - } - retval[i]->ad_type = val->element_KRB5_2[i]->ad__type; - retval[i]->length = val->element_KRB5_2[i]->ad__data->qb_forw->qb_len; - memcpy(&retval[i]->contents[0], - val->element_KRB5_2[i]->ad__data->qb_forw->qb_data, - retval[i]->length); - } - retval[i] = 0; - return(retval); -#endif - - register krb5_authdata **retval; - register int i; - register const struct type_KRB5_AuthorizationData *rv; - - for (i = 0, rv = val; rv; i++, rv = rv->next) - ; - - /* plus one for null terminator */ - retval = (krb5_authdata **) xcalloc(i + 1, sizeof(*retval)); - if (!retval) { - nomem: - *error = ENOMEM; - return(0); - } - for (i = 0, rv = val; rv; rv = rv->next, i++) { - if (qb_pullup(rv->element_KRB5_2->ad__data) != OK) { - krb5_xfree(retval); - goto nomem; - } - retval[i] = (krb5_authdata *) xmalloc(sizeof(*retval[i])); - if (!retval[i]) { - krb5_free_authdata(retval); - goto nomem; - } - retval[i]->contents = (unsigned char *)xmalloc(rv->element_KRB5_2->ad__data->qb_forw->qb_len); - if (!retval[i]->contents) { - krb5_xfree(retval[i]); - retval[i] = 0; - krb5_free_authdata(retval); - goto nomem; - } - retval[i]->ad_type = rv->element_KRB5_2->ad__type; - retval[i]->length = rv->element_KRB5_2->ad__data->qb_forw->qb_len; - memcpy(retval[i]->contents, - rv->element_KRB5_2->ad__data->qb_forw->qb_data, - retval[i]->length); - } - retval[i] = 0; - return(retval); -} diff --git a/src/lib/krb5/asn.1/addr2kaddr.c b/src/lib/krb5/asn.1/addr2kaddr.c deleted file mode 100644 index b16fb8855..000000000 --- a/src/lib/krb5/asn.1/addr2kaddr.c +++ /dev/null @@ -1,127 +0,0 @@ -/* - * lib/krb5/asn.1/addr2kaddr.c - * - * Copyright 1989,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. 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. - * - * - * Glue between Kerberos version and ISODE 6.0 version of structures. - */ - - -#include - -/*#include */ -#include -#include -#include "asn1glue.h" - -#include - -/* ISODE defines max(a,b) */ - - - -krb5_address ** -KRB5_HostAddresses2krb5_address(val, error) -const struct type_KRB5_HostAddresses *val; -register int *error; -{ -#if 0 - /* this code is for -h2 style ISODE structures. However, pepsy - generates horribly broken when given -h2. */ - - register krb5_address **retval; - register int i; - - /* plus one for null terminator */ - retval = (krb5_address **) xcalloc(val->nelem + 1, sizeof(krb5_address *)); - if (!retval) { - nomem: - *error = ENOMEM; - return(0); - } - for (i = 0; i < val->nelem; i++) { - if (qb_pullup(val->element_KRB5_0[i]->address) != OK) { - krb5_xfree(retval); - goto nomem; - } - retval[i] = (krb5_address *) xmalloc(sizeof(*retval[i])); - if (!retval[i]) { - krb5_free_addresses(retval); - goto nomem; - } - retval[i]->contents = (unsigned char *)xmalloc(val->element_KRB5_0[i]->address->qb_forw->qb_len); - if (!retval[i]->contents) { - krb5_xfree(retval[i]); - retval[i] = 0; - krb5_free_addresses(retval); - goto nomem; - } - retval[i]->addrtype = val->element_KRB5_0[i]->addr__type; - retval[i]->length = val->element_KRB5_0[i]->address->qb_forw->qb_len; - memcpy(retval[i]->contents, - val->element_KRB5_0[i]->address->qb_forw->qb_data, - retval[i]->length); - } - retval[i] = 0; - return(retval); -#endif - - register krb5_address **retval; - register int i; - register const struct type_KRB5_HostAddresses *rv; - - for (i = 0, rv = val; rv; i++, rv = rv->next) - ; - - /* plus one for null terminator */ - retval = (krb5_address **) xcalloc(i + 1, sizeof(*retval)); - if (!retval) { - nomem: - *error = ENOMEM; - return(0); - } - for (i = 0, rv = val; rv; rv = rv->next, i++) { - if (qb_pullup(rv->element_KRB5_0->address) != OK) { - krb5_xfree(retval); - goto nomem; - } - retval[i] = (krb5_address *) xmalloc(sizeof(*retval[i])); - if (!retval[i]) { - krb5_free_addresses(retval); - goto nomem; - } - retval[i]->contents = (unsigned char *)xmalloc(rv->element_KRB5_0->address->qb_forw->qb_len); - if (!retval[i]->contents) { - krb5_xfree(retval[i]); - retval[i] = 0; - krb5_free_addresses(retval); - goto nomem; - } - retval[i]->addrtype = rv->element_KRB5_0->addr__type; - retval[i]->length = rv->element_KRB5_0->address->qb_forw->qb_len; - memcpy(retval[i]->contents, - rv->element_KRB5_0->address->qb_forw->qb_data, - retval[i]->length); - } - retval[i] = 0; - return(retval); -} - diff --git a/src/lib/krb5/asn.1/adr2kadr.c b/src/lib/krb5/asn.1/adr2kadr.c deleted file mode 100644 index fd7070cf9..000000000 --- a/src/lib/krb5/asn.1/adr2kadr.c +++ /dev/null @@ -1,70 +0,0 @@ -/* - * lib/krb5/asn.1/adr2kadr.c - * - * Copyright 1989,1990 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. 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. - * - * - * Glue between Kerberos version and ISODE 6.0 version of structures. - */ - - -#include - -/*#include */ -#include -#include -#include "asn1glue.h" - -#include - -/* ISODE defines max(a,b) */ - - - -krb5_address * -KRB5_HostAddress2krb5_addr(val, error) -const struct type_KRB5_HostAddress *val; -register int *error; -{ - register krb5_address *retval; - - retval = (krb5_address *) xmalloc(sizeof(*retval)); - if (!retval) { - nomem: - *error = ENOMEM; - return 0; - } - memset(retval, 0, sizeof(*retval)); - - if (qb_pullup(val->address) != OK) { - krb5_xfree(retval); - goto nomem; - } - retval->contents = (unsigned char *)xmalloc(val->address->qb_forw->qb_len); - if (!retval->contents) { - krb5_xfree(retval); - goto nomem; - } - retval->addrtype = val->addr__type; - retval->length = val->address->qb_forw->qb_len; - memcpy(retval->contents, val->address->qb_forw->qb_data, retval->length); - return(retval); -} - diff --git a/src/lib/krb5/asn.1/aprp2kaprp.c b/src/lib/krb5/asn.1/aprp2kaprp.c deleted file mode 100644 index e17b9b8ef..000000000 --- a/src/lib/krb5/asn.1/aprp2kaprp.c +++ /dev/null @@ -1,63 +0,0 @@ -/* - * lib/krb5/asn.1/aprp2kaprp.c - * - * Copyright 1989,1990 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. 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. - * - * - * Glue between Kerberos version and ISODE 6.0 version of structures. - */ - - -#include - -/*#include */ -#include -#include -#include "asn1glue.h" - -#include - -/* ISODE defines max(a,b) */ - -krb5_ap_rep * -KRB5_AP__REP2krb5_ap_rep(val, error) -register const struct type_KRB5_AP__REP *val; -register int *error; -{ - register krb5_ap_rep *retval; - krb5_enc_data *temp; - - retval = (krb5_ap_rep *)xmalloc(sizeof(*retval)); - if (!retval) { - *error = ENOMEM; - return(0); - } - memset(retval, 0, sizeof(*retval)); - - temp = KRB5_EncryptedData2krb5_enc_data(val->enc__part, error); - if (temp) { - retval->enc_part = *temp; - krb5_xfree(temp); - } else { - krb5_xfree(retval); - return(0); - } - return(retval); -} diff --git a/src/lib/krb5/asn.1/aprq2kaprq.c b/src/lib/krb5/asn.1/aprq2kaprq.c deleted file mode 100644 index 60f1184d9..000000000 --- a/src/lib/krb5/asn.1/aprq2kaprq.c +++ /dev/null @@ -1,71 +0,0 @@ -/* - * lib/krb5/asn.1/aprq2kaprq.c - * - * Copyright 1989,1990 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. 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. - * - * - * Glue between Kerberos version and ISODE 6.0 version of structures. - */ - - -#include - -/*#include */ -#include -#include -#include "asn1glue.h" - -#include - -/* ISODE defines max(a,b) */ - -krb5_ap_req * -KRB5_AP__REQ2krb5_ap_req(val, error) -register const struct type_KRB5_AP__REQ *val; -register int *error; -{ - register krb5_ap_req *retval; - krb5_enc_data *temp; - - retval = (krb5_ap_req *)xmalloc(sizeof(*retval)); - if (!retval) { - *error = ENOMEM; - return(0); - } - memset(retval, 0, sizeof(*retval)); - - retval->ap_options = KRB5_APOptions2krb5_apoptions(val->ap__options, - error); - retval->ticket = KRB5_Ticket2krb5_ticket(val->ticket, error); - if (!retval->ticket) { - krb5_free_ap_req(retval); - return(0); - } - temp = KRB5_EncryptedData2krb5_enc_data(val->authenticator, error); - if (temp) { - retval->authenticator = *temp; - krb5_xfree(temp); - } else { - krb5_free_ap_req(retval); - return(0); - } - - return(retval); -} diff --git a/src/lib/krb5/asn.1/arep2karep.c b/src/lib/krb5/asn.1/arep2karep.c deleted file mode 100644 index f3353821d..000000000 --- a/src/lib/krb5/asn.1/arep2karep.c +++ /dev/null @@ -1,72 +0,0 @@ -/* - * lib/krb5/asn.1/arep2karep.c - * - * Copyright 1989,1990 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. 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. - * - * - * Glue between Kerberos version and ISODE 6.0 version of structures. - */ - - -#include - -/*#include */ -#include -#include -#include "asn1glue.h" - -#include - -/* ISODE defines max(a,b) */ - -krb5_ap_rep_enc_part * -KRB5_EncAPRepPart2krb5_ap_rep_enc_part(val, error) -register const struct type_KRB5_EncAPRepPart *val; -register int *error; -{ - register krb5_ap_rep_enc_part *retval; - - retval = (krb5_ap_rep_enc_part *)xmalloc(sizeof(*retval)); - if (!retval) { - *error = ENOMEM; - return(0); - } - memset(retval, 0, sizeof(*retval)); - - retval->ctime = gentime2unix(val->ctime, error); - if (*error) { - krb5_xfree(retval); - return(0); - } - retval->cusec = val->cusec; - - if (val->subkey) { - retval->subkey = KRB5_EncryptionKey2krb5_keyblock(val->subkey, - error); - if (!retval->subkey) { - krb5_free_ap_rep_enc_part(retval); - return 0; - } - } - if (val->optionals & opt_KRB5_EncAPRepPart_seq__number) - retval->seq_number = val->seq__number; - - return(retval); -} diff --git a/src/lib/krb5/asn.1/auth2kauth.c b/src/lib/krb5/asn.1/auth2kauth.c deleted file mode 100644 index 9ee3773d7..000000000 --- a/src/lib/krb5/asn.1/auth2kauth.c +++ /dev/null @@ -1,94 +0,0 @@ -/* - * lib/krb5/asn.1/auth2kauth.c - * - * Copyright 1989,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. 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. - * - * - * Glue between Kerberos version and ISODE 6.0 version of structures. - */ - - -#include - -/*#include */ -#include -#include -#include "asn1glue.h" - -#include - -/* ISODE defines max(a,b) */ - -krb5_authenticator * -KRB5_Authenticator2krb5_authenticator(val, error) -register const struct type_KRB5_Authenticator *val; -register int *error; -{ - register krb5_authenticator *retval; - - retval = (krb5_authenticator *)xmalloc(sizeof(*retval)); - if (!retval) { - *error = ENOMEM; - return(0); - } - - memset(retval, 0, sizeof(*retval)); - - retval->client = KRB5_PrincipalName2krb5_principal(val->cname, - val->crealm, - error); - if (!retval->client) { - krb5_xfree(retval); - return(0); - } - if (val->cksum) { - retval->checksum = KRB5_Checksum2krb5_checksum(val->cksum, error); - if (!retval->checksum) { - krb5_free_authenticator(retval); - return(0); - } - } - retval->cusec = val->cusec; - retval->ctime = gentime2unix(val->ctime, error); - if (*error) { - krb5_free_authenticator(retval); - return(0); - } - if (val->subkey) { - retval->subkey = KRB5_EncryptionKey2krb5_keyblock(val->subkey, error); - if (!retval->subkey) { - krb5_free_authenticator(retval); - return(0); - } - } - if (val->optionals & opt_KRB5_Authenticator_seq__number) { - retval->seq_number = val->seq__number; - } - if (val->authorization__data) { - retval->authorization_data = - KRB5_AuthorizationData2krb5_authdata(val->authorization__data, - error); - if (!retval->authorization_data) { - krb5_free_authenticator(retval); - return(0); - } - } - return(retval); -} diff --git a/src/lib/krb5/asn.1/ck2kck.c b/src/lib/krb5/asn.1/ck2kck.c deleted file mode 100644 index 74469de02..000000000 --- a/src/lib/krb5/asn.1/ck2kck.c +++ /dev/null @@ -1,71 +0,0 @@ -/* - * lib/krb5/asn.1/ck2kck.c - * - * Copyright 1989,1990 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. 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. - * - * - * Glue between Kerberos version and ISODE 6.0 version of structures. - */ - - -#include - -/*#include */ -#include -#include -#include "asn1glue.h" - -#include - -/* ISODE defines max(a,b) */ - -krb5_checksum * -KRB5_Checksum2krb5_checksum(val, error) -register const struct type_KRB5_Checksum *val; -register int *error; -{ - krb5_checksum *retval; - - if (!val->checksum) { - *error = EINVAL; - return(0); - } else - *error = 0; - /* pull up, then play with the single string */ - if (qb_pullup(val->checksum) != OK) { - nomem: - *error = ENOMEM; - return(0); - } - retval = (krb5_checksum *)xmalloc(sizeof(*retval)); - if (!retval) { - goto nomem; - } - retval->contents = (unsigned char *)xmalloc(val->checksum->qb_forw->qb_len); - if (!retval->contents) { - krb5_xfree(retval); - goto nomem; - } - retval->checksum_type = val->cksumtype; - retval->length = val->checksum->qb_forw->qb_len; - memcpy(retval->contents, val->checksum->qb_forw->qb_data, - val->checksum->qb_forw->qb_len); - return(retval); -} diff --git a/src/lib/krb5/asn.1/cred2kcred.c b/src/lib/krb5/asn.1/cred2kcred.c deleted file mode 100644 index 44088b46a..000000000 --- a/src/lib/krb5/asn.1/cred2kcred.c +++ /dev/null @@ -1,99 +0,0 @@ -/* - * lib/krb5/asn.1/cred2kcred.c - * - * Copyright 1989,1990 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. 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. - * - * - * Glue between Kerberos version and ISODE 6.0 version of structures. - */ - - -#include - -/*#include */ -#include -#include -#include "asn1glue.h" - -#include - -/* ISODE defines max(a,b) */ - -krb5_cred * -KRB5_KRB__CRED2krb5_cred(val, error) -register const struct type_KRB5_KRB__CRED *val; -register int *error; -{ - register krb5_cred *retval; - register int i; - register struct element_KRB5_12 *rv; - krb5_enc_data *temp; - - retval = (krb5_cred *)xmalloc(sizeof(*retval)); - if (!retval) { - *error = ENOMEM; - return(0); - } - memset((char *)retval, 0, sizeof(*retval)); - - /* Count tickets */ - for (i = 0, rv = val->tickets; rv; i++, rv = rv->next); - - /* plus one for null terminator */ - retval->tickets = (krb5_ticket **) xcalloc(i + 1, sizeof(*retval->tickets)); - if (!retval->tickets) { - *error = ENOMEM; - krb5_xfree(retval); - return(0); - } - - /* Copy tickets */ - for (i = 0, rv = val->tickets; rv; rv = rv->next, i++) { - retval->tickets[i] = (krb5_ticket *) xmalloc(sizeof(*retval->tickets[i])); - if (!retval->tickets[i]) { - krb5_free_tickets(retval->tickets); - *error = ENOMEM; - krb5_xfree(retval); - return(0); - } - memset((char *)retval->tickets[i], 0, sizeof(*retval->tickets[i])); - - retval->tickets[i] = KRB5_Ticket2krb5_ticket(rv->Ticket, error); - if (!retval->tickets[i]) { - krb5_free_tickets(retval->tickets); - krb5_xfree(retval); - return(0); - } - } - retval->tickets[i] = 0; - - /* Copy encrypted part */ - temp = KRB5_EncryptedData2krb5_enc_data(val->enc__part, error); - if (temp) { - retval->enc_part = *temp; - krb5_xfree(temp); - } else { - krb5_free_tickets(retval->tickets); - krb5_xfree(retval); - return(0); - } - - return(retval); -} diff --git a/src/lib/krb5/asn.1/crep2kcrep.c b/src/lib/krb5/asn.1/crep2kcrep.c deleted file mode 100644 index 41aa44008..000000000 --- a/src/lib/krb5/asn.1/crep2kcrep.c +++ /dev/null @@ -1,189 +0,0 @@ -/* - * lib/krb5/asn.1/crep2kcrep.c - * - * Copyright 1989,1990 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. 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. - * - * - * Glue between Kerberos version and ISODE 6.0 version of structures. - */ - - -#include - -/*#include */ -#include -#include -#include "asn1glue.h" - -#include - -/* ISODE defines max(a,b) */ - -krb5_cred_enc_part * -KRB5_EncKrbCredPart2krb5_cred_enc_part(val, error) -register const struct type_KRB5_EncKrbCredPart *val; -register int *error; -{ - register krb5_cred_enc_part *retval; - register int i; - register const struct element_KRB5_13 *rv; - - retval = (krb5_cred_enc_part *)xmalloc(sizeof(*retval)); - if (!retval) { - *error = ENOMEM; - return(0); - } - memset((char *)retval, 0, sizeof(*retval)); - - /* Count ticket_info */ - for (i = 0, rv = val->ticket__info; rv; i++, rv = rv->next); - - /* plus one for null terminator */ - retval->ticket_info = (krb5_cred_info **) - xcalloc(i + 1, sizeof(*retval->ticket_info)); - if (!retval->ticket_info) { - *error = ENOMEM; - krb5_xfree(retval); - return(0); - } - - if (val->optionals & opt_KRB5_EncKrbCredPart_nonce) - retval->nonce = val->nonce; - else - retval->nonce = 0; - - if (val->timestamp) { - if (!(val->optionals & opt_KRB5_EncKrbCredPart_usec)) { - /* must have usec if we have timestamp */ - *error = ISODE_50_LOCAL_ERR_BADCOMBO; - goto errout; - } - - retval->timestamp = gentime2unix(val->timestamp, error); - if (*error) { - errout: - krb5_free_cred_enc_part(retval); - return(0); - } - retval->usec = val->usec; - } else { - retval->timestamp = 0; - retval->usec = 0; - } - - if (val->s__address) { - retval->s_address = - KRB5_HostAddress2krb5_addr(val->s__address, - error); - if (!retval->s_address) { - goto errout; - } - } - - if (val->r__address) { - retval->r_address = - KRB5_HostAddress2krb5_addr(val->r__address, - error); - if (!retval->r_address) { - goto errout; - } - } - - for (i = 0, rv = val->ticket__info; rv; rv = rv->next, i++) { - retval->ticket_info[i] = (krb5_cred_info *) - xmalloc(sizeof(*retval->ticket_info[i])); - if (!retval->ticket_info[i]) { - *error = ENOMEM; - goto errout; - } - memset((char *)retval->ticket_info[i], 0, - sizeof(*retval->ticket_info[i])); - - retval->ticket_info[i]->session = - KRB5_EncryptionKey2krb5_keyblock(rv->KRB__CRED__INFO->key, error); - if (!retval->ticket_info[i]->session) - goto errout; - - if (rv->KRB__CRED__INFO->pname && rv->KRB__CRED__INFO->prealm) { - retval->ticket_info[i]->client = - KRB5_PrincipalName2krb5_principal(rv->KRB__CRED__INFO->pname, - rv->KRB__CRED__INFO->prealm, - error); - if (!retval->ticket_info[i]->client) - goto errout; - } - - if (rv->KRB__CRED__INFO->sname && rv->KRB__CRED__INFO->srealm) { - retval->ticket_info[i]->server = - KRB5_PrincipalName2krb5_principal(rv->KRB__CRED__INFO->sname, - rv->KRB__CRED__INFO->srealm, - error); - if (!retval->ticket_info[i]->server) - goto errout; - } - - if (rv->KRB__CRED__INFO->flags) { - retval->ticket_info[i]->flags = - KRB5_TicketFlags2krb5_flags(rv->KRB__CRED__INFO->flags, error); - if (*error) - goto errout; - } - - if (rv->KRB__CRED__INFO->authtime) { - retval->ticket_info[i]->times.authtime = - gentime2unix(rv->KRB__CRED__INFO->authtime, error); - if (*error) - goto errout; - } - - if (rv->KRB__CRED__INFO->starttime) { - retval->ticket_info[i]->times.starttime = - gentime2unix(rv->KRB__CRED__INFO->starttime, error); - if (*error) - goto errout; - } - - if (rv->KRB__CRED__INFO->endtime) { - retval->ticket_info[i]->times.endtime = - gentime2unix(rv->KRB__CRED__INFO->endtime, error); - if (*error) - goto errout; - } - - if ((retval->ticket_info[i]->flags & TKT_FLG_RENEWABLE) && - rv->KRB__CRED__INFO->renew__till) { - retval->ticket_info[i]->times.renew_till = - gentime2unix(rv->KRB__CRED__INFO->renew__till, error); - if (*error) - goto errout; - } - - if (rv->KRB__CRED__INFO->caddr) { - retval->ticket_info[i]->caddrs = - KRB5_HostAddresses2krb5_address(rv->KRB__CRED__INFO->caddr, - error); - if (!retval->ticket_info[i]->caddrs) - goto errout; - } - } - - retval->ticket_info[i] = 0; - return(retval); -} diff --git a/src/lib/krb5/asn.1/cvt_flags.c b/src/lib/krb5/asn.1/cvt_flags.c deleted file mode 100644 index 433c3a944..000000000 --- a/src/lib/krb5/asn.1/cvt_flags.c +++ /dev/null @@ -1,126 +0,0 @@ -/* - * lib/krb5/asn.1/cvt_flags.c - * - * Copyright 1989,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. 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. - * - * - * Glue between Kerberos version and ISODE 6.0 version of structures. - */ - - -#include - -/*#include */ -#include -#include -#include "asn1glue.h" - -#include - -/* ISODE defines max(a,b) */ - -static int swbits[256] = { -0x00, 0x80, 0x40, 0xc0, 0x20, 0xa0, 0x60, 0xe0, -0x10, 0x90, 0x50, 0xd0, 0x30, 0xb0, 0x70, 0xf0, -0x08, 0x88, 0x48, 0xc8, 0x28, 0xa8, 0x68, 0xe8, -0x18, 0x98, 0x58, 0xd8, 0x38, 0xb8, 0x78, 0xf8, -0x04, 0x84, 0x44, 0xc4, 0x24, 0xa4, 0x64, 0xe4, -0x14, 0x94, 0x54, 0xd4, 0x34, 0xb4, 0x74, 0xf4, -0x0c, 0x8c, 0x4c, 0xcc, 0x2c, 0xac, 0x6c, 0xec, -0x1c, 0x9c, 0x5c, 0xdc, 0x3c, 0xbc, 0x7c, 0xfc, -0x02, 0x82, 0x42, 0xc2, 0x22, 0xa2, 0x62, 0xe2, -0x12, 0x92, 0x52, 0xd2, 0x32, 0xb2, 0x72, 0xf2, -0x0a, 0x8a, 0x4a, 0xca, 0x2a, 0xaa, 0x6a, 0xea, -0x1a, 0x9a, 0x5a, 0xda, 0x3a, 0xba, 0x7a, 0xfa, -0x06, 0x86, 0x46, 0xc6, 0x26, 0xa6, 0x66, 0xe6, -0x16, 0x96, 0x56, 0xd6, 0x36, 0xb6, 0x76, 0xf6, -0x0e, 0x8e, 0x4e, 0xce, 0x2e, 0xae, 0x6e, 0xee, -0x1e, 0x9e, 0x5e, 0xde, 0x3e, 0xbe, 0x7e, 0xfe, -0x01, 0x81, 0x41, 0xc1, 0x21, 0xa1, 0x61, 0xe1, -0x11, 0x91, 0x51, 0xd1, 0x31, 0xb1, 0x71, 0xf1, -0x09, 0x89, 0x49, 0xc9, 0x29, 0xa9, 0x69, 0xe9, -0x19, 0x99, 0x59, 0xd9, 0x39, 0xb9, 0x79, 0xf9, -0x05, 0x85, 0x45, 0xc5, 0x25, 0xa5, 0x65, 0xe5, -0x15, 0x95, 0x55, 0xd5, 0x35, 0xb5, 0x75, 0xf5, -0x0d, 0x8d, 0x4d, 0xcd, 0x2d, 0xad, 0x6d, 0xed, -0x1d, 0x9d, 0x5d, 0xdd, 0x3d, 0xbd, 0x7d, 0xfd, -0x03, 0x83, 0x43, 0xc3, 0x23, 0xa3, 0x63, 0xe3, -0x13, 0x93, 0x53, 0xd3, 0x33, 0xb3, 0x73, 0xf3, -0x0b, 0x8b, 0x4b, 0xcb, 0x2b, 0xab, 0x6b, 0xeb, -0x1b, 0x9b, 0x5b, 0xdb, 0x3b, 0xbb, 0x7b, 0xfb, -0x07, 0x87, 0x47, 0xc7, 0x27, 0xa7, 0x67, 0xe7, -0x17, 0x97, 0x57, 0xd7, 0x37, 0xb7, 0x77, 0xf7, -0x0f, 0x8f, 0x4f, 0xcf, 0x2f, 0xaf, 0x6f, 0xef, -0x1f, 0x9f, 0x5f, 0xdf, 0x3f, 0xbf, 0x7f, 0xff, -}; - -struct type_KRB5_TicketFlags * -krb5_flags2KRB5_TicketFlags(val, error) -const krb5_flags val; -register int *error; -{ - char *tmp; - PE pe; - krb5_flags useval = val; - - /* need to reverse bits in val, so that 0 is lsb */ - useval = (swbits[(val & 0xff)] << 24) | (swbits[(val >> 8) & 0xff] << 16) | - (swbits[(val >> 16) & 0xff] << 8) | swbits[(val >> 24) & 0xff]; - - tmp = int2strb(useval, 32); /* XXX hardcode 32 bits */ - /* tmp points to static buffer */ - - pe = strb2bitstr(tmp, 32, PE_CLASS_UNIV, PE_PRIM_BITS); - if (!pe) - *error = ENOMEM; - else - *error = 0; - - return(pe); -} - -krb5_flags -KRB5_TicketFlags2krb5_flags(val, error) -const struct type_KRB5_TicketFlags *val; -register int *error; -{ - char *tmp; - int length; - krb5_flags result; - - tmp = bitstr2strb(val, &length); - - if (!tmp) { - *error = ENOMEM; - return(0); - } else - *error = 0; - - result = strb2int(tmp, length); - - free(tmp); - - /* need to reverse bits in result, so that 0 is msb */ - result = (swbits[(result & 0xff)] << 24) | - (swbits[(result >> 8) & 0xff] << 16) | - (swbits[(result >> 16) & 0xff] << 8) | - swbits[(result >> 24) & 0xff]; - return(result); -} diff --git a/src/lib/krb5/asn.1/decode.c b/src/lib/krb5/asn.1/decode.c deleted file mode 100644 index fc219268b..000000000 --- a/src/lib/krb5/asn.1/decode.c +++ /dev/null @@ -1,75 +0,0 @@ -/* - * lib/krb5/asn.1/decode.c - * - * 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. 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. - * - * - * decoding glue routines. - */ - - -#include -#include -#include -#include "asn1glue.h" - -#include - -#include - -krb5_error_code -krb5_decode_generic(input, output, decoder, translator, free_translation) -const krb5_data *input; -register krb5_pointer *output; -decoder_func decoder; -translator_func translator; -free_func free_translation; -{ - krb5_pointer isode_temp; - PE pe; - PS ps; - krb5_error_code error = 0; - - if (!(ps = ps_alloc(str_open))) { - return(ENOMEM); - } - if (str_setup(ps, input->data, input->length, 1) != OK) { - error = ps->ps_errno + ISODE_50_PS_ERR_NONE; - ps_free(ps); - return(error); - } - if (!(pe = ps2pe(ps))) { - error = ps->ps_errno + ISODE_50_PS_ERR_NONE; - ps_free(ps); - return(error); - } - if ((*decoder)(pe, 1, 0, 0, &isode_temp) != OK) { - error = ISODE_50_LOCAL_ERR_BADDECODE; - pe_free(pe); - ps_free(ps); - return(error); - } - *output = (*translator)(isode_temp, &error); - pe_free(pe); - ps_free(ps); - (*free_translation)(isode_temp); - return(error); /* may be error if output - failed above */ -} diff --git a/src/lib/krb5/asn.1/edat2kedat.c b/src/lib/krb5/asn.1/edat2kedat.c deleted file mode 100644 index c674755d0..000000000 --- a/src/lib/krb5/asn.1/edat2kedat.c +++ /dev/null @@ -1,66 +0,0 @@ -/* - * lib/krb5/asn.1/edat2kedat.c - * - * Copyright 1990 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. 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. - * - * - * Glue between Kerberos version and ISODE 6.0 version of structures. - */ - - -#include - -/*#include */ -#include -#include -#include "asn1glue.h" - -#include - -/* ISODE defines max(a,b) */ - -krb5_enc_data * -KRB5_EncryptedData2krb5_enc_data(val, error) -register const 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); - } - memset(retval, 0, sizeof(*retval)); - - temp = qbuf2krb5_data(val->cipher, error); - if (temp) { - retval->ciphertext = *temp; - krb5_xfree(temp); - } else { - krb5_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/ekrp2kekrp.c b/src/lib/krb5/asn.1/ekrp2kekrp.c deleted file mode 100644 index 0c1444e2a..000000000 --- a/src/lib/krb5/asn.1/ekrp2kekrp.c +++ /dev/null @@ -1,108 +0,0 @@ -/* - * lib/krb5/asn.1/ekrp2kekrp.c - * - * Copyright 1989,1990 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. 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. - * - * - * Glue between Kerberos version and ISODE 6.0 version of structures. - */ - - -#include - -/*#include */ -#include -#include -#include "asn1glue.h" - -#include - -/* ISODE defines max(a,b) */ - -krb5_enc_kdc_rep_part * -KRB5_EncKDCRepPart2krb5_enc_kdc_rep_part(val, error) -register const struct type_KRB5_EncKDCRepPart *val; -register int *error; -{ - register krb5_enc_kdc_rep_part *retval; - - retval = (krb5_enc_kdc_rep_part *)xmalloc(sizeof(*retval)); - if (!retval) { - *error = ENOMEM; - return(0); - } - memset(retval, 0, sizeof(*retval)); - - retval->session = KRB5_EncryptionKey2krb5_keyblock(val->key, error); - if (!retval->session) { - krb5_xfree(retval); - return(0); - } - - retval->last_req = KRB5_LastReq2krb5_last_req(val->last__req, error); - if (!retval->last_req) { - errout: - krb5_free_enc_kdc_rep_part(retval); - return(0); - } - - retval->nonce = val->nonce; - - if (val->key__expiration) { - retval->key_exp = gentime2unix(val->key__expiration, error); - if (*error) { - goto errout; - } - } - retval->flags = KRB5_TicketFlags2krb5_flags(val->flags, error); - if (*error) { - goto errout; - } - retval->times.authtime = gentime2unix(val->authtime, error); - if (*error) { - goto errout; - } - if (val->starttime) { - retval->times.starttime = gentime2unix(val->starttime, error); - if (*error) { - goto errout; - } - } - retval->times.endtime = gentime2unix(val->endtime, error); - if (retval->flags & TKT_FLG_RENEWABLE) { - retval->times.renew_till = gentime2unix(val->renew__till, error); - if (*error) { - goto errout; - } - } - retval->server = KRB5_PrincipalName2krb5_principal(val->sname, - val->srealm, - error); - if (!retval->server) { - goto errout; - } - if (val->caddr) { - retval->caddrs = KRB5_HostAddresses2krb5_address(val->caddr, error); - if (!retval->caddrs) { - goto errout; - } - } - return(retval); -} diff --git a/src/lib/krb5/asn.1/enck2kkey.c b/src/lib/krb5/asn.1/enck2kkey.c deleted file mode 100644 index e6f5e8587..000000000 --- a/src/lib/krb5/asn.1/enck2kkey.c +++ /dev/null @@ -1,73 +0,0 @@ -/* - * lib/krb5/asn.1/enck2kkey.c - * - * Copyright 1989,1990 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. 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. - * - * - * Glue between Kerberos version and ISODE 6.0 version of structures. - */ - - -#include - -/*#include */ -#include -#include -#include "asn1glue.h" - -#include - -/* ISODE defines max(a,b) */ - - -krb5_keyblock * -KRB5_EncryptionKey2krb5_keyblock(val, error) -register const struct type_KRB5_EncryptionKey *val; -register int *error; -{ - krb5_keyblock *retval; - - if (!val->keyvalue) { - *error = EINVAL; - return(0); - } else - *error = 0; - /* pull up, then play with the single string */ - if (qb_pullup(val->keyvalue) != OK) { - nomem: - *error = ENOMEM; - return(0); - } - retval = (krb5_keyblock *)xmalloc(sizeof(*retval)); - if (!retval) { - goto nomem; - } - retval->contents = (unsigned char *) xmalloc(val->keyvalue->qb_forw->qb_len); - if (!retval->contents) { - krb5_xfree(retval); - goto nomem; - } - retval->keytype = val->keytype; - retval->length = val->keyvalue->qb_forw->qb_len; - memcpy(retval->contents, val->keyvalue->qb_forw->qb_data, - val->keyvalue->qb_forw->qb_len); - return(retval); -} - diff --git a/src/lib/krb5/asn.1/encode.c b/src/lib/krb5/asn.1/encode.c deleted file mode 100644 index 7453995e6..000000000 --- a/src/lib/krb5/asn.1/encode.c +++ /dev/null @@ -1,96 +0,0 @@ -/* - * lib/krb5/asn.1/encode.c - * - * 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. 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. - * - * - * encoding glue routines. - */ - - -#include -#include -#include -#include "asn1glue.h" - -#include - -#include - -krb5_error_code -krb5_encode_generic(input, data_out, encoder, translator, free_translation) -krb5_const_pointer input; -register krb5_data **data_out; -int (*encoder) PROTOTYPE((PE *, int, int, char *, krb5_pointer)); -krb5_pointer (*translator) PROTOTYPE((krb5_const_pointer, int * )); -void (*free_translation) PROTOTYPE((krb5_pointer )); -{ - krb5_pointer isode_out; - PE pe; - PS ps; - krb5_error_code error; - - ps_len_strategy = PS_LEN_LONG; /* force use of definite form */ - - if (!(isode_out = (*translator)(input, &error))) - return(error); - if ((*encoder)(&pe, 0, 0, 0, isode_out)) { - error = ENOMEM; - goto errout; - } - *data_out = (krb5_data *)malloc(sizeof(**data_out)); - if (!*data_out) { - error = ENOMEM; - goto peout; - } - (*data_out)->length = ps_get_abs(pe); - (*data_out)->data = malloc((*data_out)->length); - if (!(*data_out)->data) { - error = ENOMEM; - goto datout; - } - if (!(ps = ps_alloc(str_open))) { - error = ENOMEM; - goto alldatout; - } - if (str_setup(ps, (*data_out)->data, (*data_out)->length, 1) != OK) { - error = ps->ps_errno + ISODE_50_PS_ERR_NONE; - goto oops; - } - if (pe2ps(ps, pe) != OK || ps_flush(ps) != OK) { - error = ps->ps_errno + ISODE_50_PS_ERR_NONE; - oops: - ps_free(ps); - alldatout: - free((*data_out)->data); - datout: - krb5_xfree(*data_out); - *data_out = 0; - peout: - pe_free(pe); - errout: - (*free_translation)(isode_out); - return(error); - } - ps_free(ps); - pe_free(pe); - (*free_translation)(isode_out); - return(0); -} diff --git a/src/lib/krb5/asn.1/err2kerr.c b/src/lib/krb5/asn.1/err2kerr.c deleted file mode 100644 index 8d6fa557b..000000000 --- a/src/lib/krb5/asn.1/err2kerr.c +++ /dev/null @@ -1,109 +0,0 @@ -/* - * lib/krb5/asn.1/err2kerr.c - * - * Copyright 1989,1990 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. 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. - * - * - * Glue between Kerberos version and ISODE 6.0 version of structures. - */ - - -#include - -/*#include */ -#include -#include -#include "asn1glue.h" - -#include - -/* ISODE defines max(a,b) */ - -krb5_error * -KRB5_KRB__ERROR2krb5_error(val, error) -register const struct type_KRB5_KRB__ERROR *val; -register int *error; -{ - register krb5_error *retval; - krb5_data *temp; - - retval = (krb5_error *)xmalloc(sizeof(*retval)); - if (!retval) { - *error = ENOMEM; - return(0); - } - memset(retval, 0, sizeof(*retval)); - - - if (val->ctime) { - retval->ctime = gentime2unix(val->ctime, error); - if (*error) { - errout: - krb5_free_error(retval); - return(0); - } - } - if (val->optionals & opt_KRB5_KRB__ERROR_cusec) - retval->cusec = val->cusec; - else - retval->cusec = 0; - - retval->stime = gentime2unix(val->stime, error); - if (*error) { - goto errout; - } - retval->susec = val->susec; - retval->error = val->error__code; - if (val->crealm && val->cname) { - retval->client = KRB5_PrincipalName2krb5_principal(val->cname, - val->crealm, - error); - if (!retval->client) { - goto errout; - } - } - if (val->sname && val->realm) { - retval->server = KRB5_PrincipalName2krb5_principal(val->sname, - val->realm, - error); - if (!retval->server) { - goto errout; - } - } - if (val->e__text) { - temp = qbuf2krb5_data(val->e__text, error); - if (temp) { - retval->text = *temp; - krb5_xfree(temp); - } else { - goto errout; - } - } - if (val->e__data) { - temp = qbuf2krb5_data(val->e__data, error); - if (temp) { - retval->e_data = *temp; - krb5_xfree(temp); - } else { - goto errout; - } - } - return(retval); -} diff --git a/src/lib/krb5/asn.1/etpt2ketpt.c b/src/lib/krb5/asn.1/etpt2ketpt.c deleted file mode 100644 index 3306a4c71..000000000 --- a/src/lib/krb5/asn.1/etpt2ketpt.c +++ /dev/null @@ -1,122 +0,0 @@ -/* - * lib/krb5/asn.1/etpt2ketpt.c - * - * Copyright 1989,1990 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. 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. - * - * - * Glue between Kerberos version and ISODE 6.0 version of structures. - */ - - -#include - -/*#include */ -#include -#include -#include "asn1glue.h" - -#include - -/* ISODE defines max(a,b) */ - -krb5_enc_tkt_part * -KRB5_EncTicketPart2krb5_enc_tkt_part(val, error) -register const struct type_KRB5_EncTicketPart *val; -register int *error; -{ - register krb5_enc_tkt_part *retval; - krb5_transited *temp; - - if (!val) { - *error = EINVAL; - return 0; - } - - retval = (krb5_enc_tkt_part *)xmalloc(sizeof(*retval)); - if (!retval) { - *error = ENOMEM; - return(0); - } - memset(retval, 0, sizeof(*retval)); - - - retval->flags = KRB5_TicketFlags2krb5_flags(val->flags, error); - if (*error) { - krb5_xfree(retval); - return(0); - } - - retval->session = KRB5_EncryptionKey2krb5_keyblock(val->key, error); - if (!retval->session) { - errout: - krb5_free_enc_tkt_part(retval); - return(0); - } - retval->client = KRB5_PrincipalName2krb5_principal(val->cname, - val->crealm, - error); - if (!retval->client) { - goto errout; - } - - temp = KRB5_TransitedEncoding2krb5_transited(val->transited, error); - if (temp) { - retval->transited = *temp; - krb5_xfree(temp); - } else { - goto errout; - } - - retval->times.authtime = gentime2unix(val->authtime, error); - if (*error) { - goto errout; - } - if (val->starttime) { - retval->times.starttime = gentime2unix(val->starttime, error); - if (*error) { - goto errout; - } - } - retval->times.endtime = gentime2unix(val->endtime, error); - if (*error) { - goto errout; - } - if (val->renew__till) { - retval->times.renew_till = gentime2unix(val->renew__till, error); - if (*error) { - goto errout; - } - } - if (val->caddr) { - retval->caddrs = KRB5_HostAddresses2krb5_address(val->caddr, error); - if (!retval->caddrs) { - goto errout; - } - } - if (val->authorization__data) { - retval->authorization_data = - KRB5_AuthorizationData2krb5_authdata(val->authorization__data, - error); - if (!retval->authorization_data) { - goto errout; - } - } - return(retval); -} diff --git a/src/lib/krb5/asn.1/g2unix.c b/src/lib/krb5/asn.1/g2unix.c deleted file mode 100644 index 38b83c45a..000000000 --- a/src/lib/krb5/asn.1/g2unix.c +++ /dev/null @@ -1,69 +0,0 @@ -/* - * lib/krb5/asn.1/g2unix.c - * - * Copyright 1989,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. 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. - * - * - * Glue between Kerberos version and ISODE 6.0 version of structures. - */ - - -#include - -/*#include */ -#include -#include -#include "asn1glue.h" - -#include - -/* ISODE defines max(a,b) */ - -long -gentime2unix(val, error) -const struct type_UNIV_GeneralizedTime *val; -register int *error; -{ - UTC utcp; - char *tmp; - long retval; - - tmp = qb2str(val); - if (!tmp) { - *error = ENOMEM; - return(0); - } else - *error = 0; - - utcp = str2gent(tmp, strlen(tmp)); - if (utcp == NULLUTC) { - *error = EINVAL; - free(tmp); - return(0); - } - retval = gtime(ut2tm(utcp)); - if (retval == NOTOK) { - *error = EINVAL; - free(tmp); - return(0); - } - free(tmp); - return(retval); -} diff --git a/src/lib/krb5/asn.1/kadat2adat.c b/src/lib/krb5/asn.1/kadat2adat.c deleted file mode 100644 index a06732e87..000000000 --- a/src/lib/krb5/asn.1/kadat2adat.c +++ /dev/null @@ -1,124 +0,0 @@ -/* - * lib/krb5/asn.1/kadat2adat.c - * - * Copyright 1989,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. 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. - * - * - * Glue between Kerberos version and ISODE 6.0 version of structures. - */ - - -#include - -/*#include */ -#include -#include -#include "asn1glue.h" - -#include - -/* ISODE defines max(a,b) */ - -struct type_KRB5_AuthorizationData * -krb5_authdata2KRB5_AuthorizationData(val, error) -register krb5_authdata * const *val; -register int *error; -{ -#if 0 - /* this code is for -h2 style ISODE structures. However, pepsy - generates horribly broken when given -h2. */ - - register struct type_KRB5_AuthorizationData *retval; - register krb5_authdata * const *temp; - register int i; - - /* count elements */ - for (i = 0, temp = val; *temp; temp++,i++); - - retval = (struct type_KRB5_AuthorizationData *) - xmalloc(sizeof(*retval) + max(0,i-1)*sizeof(retval->element_KRB5_2[0])); - if (!retval) { - *error = ENOMEM; - return(0); - } - memset(retval, 0, sizeof(*retval)); - retval->nelem = i; - for (i = 0; i < retval->nelem; i++) { - retval->element_KRB5_2[i] = (struct element_KRB5_3 *) - xmalloc(sizeof(*(retval->element_KRB5_2[i]))); - if (!retval->element_KRB5_2[i]) { - errout: - retval->nelem = i; - free_KRB5_AuthorizationData(retval); - *error = ENOMEM; - return(0); - } - retval->element_KRB5_2[i]->ad__type = val[i]->ad_type; - - retval->element_KRB5_2[i]->ad__data = str2qb((char *)(val[i])->contents, - (val[i])->length, 1); - if (!retval->element_KRB5_2[i]->ad__data) { - /* clean up */ - krb5_xfree(retval->element_KRB5_2[i]); - goto errout; - } - } - return(retval); -#endif - register struct type_KRB5_AuthorizationData *retval = 0, *rv1 = 0, *rv2; - register krb5_authdata * const *temp; - register int i; - - /* count elements */ - for (i = 0, temp = val; *temp; temp++,i++, rv1 = rv2) { - - rv2 = (struct type_KRB5_AuthorizationData *) xmalloc(sizeof(*rv2)); - if (!rv2) { - if (retval) - free_KRB5_AuthorizationData(retval); - *error = ENOMEM; - return(0); - } - if (rv1) - rv1->next = rv2; - memset((char *)rv2, 0, sizeof (*rv2)); - if (!retval) - retval = rv2; - - rv2->element_KRB5_2 = (struct element_KRB5_3 *) - xmalloc(sizeof(*(rv2->element_KRB5_2))); - if (!rv2->element_KRB5_2) { - errout: - if (retval) - free_KRB5_AuthorizationData(retval); - *error = ENOMEM; - return(0); - } - rv2->element_KRB5_2->ad__type = val[i]->ad_type; - rv2->element_KRB5_2->ad__data = str2qb((char *)(val[i])->contents, - (val[i])->length, 1); - if (!rv2->element_KRB5_2->ad__data) { - goto errout; - } - } - if (retval == 0) - *error = ISODE_LOCAL_ERR_MISSING_PART; - return(retval); -} diff --git a/src/lib/krb5/asn.1/kaddr2addr.c b/src/lib/krb5/asn.1/kaddr2addr.c deleted file mode 100644 index 28cd2040c..000000000 --- a/src/lib/krb5/asn.1/kaddr2addr.c +++ /dev/null @@ -1,134 +0,0 @@ -/* - * lib/krb5/asn.1/kaddr2addr.c - * - * Copyright 1989,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. 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. - * - * - * Glue between Kerberos version and ISODE 6.0 version of structures. - */ - - -#include - -/*#include */ -#include -#include -#include "asn1glue.h" - -#include - -/* ISODE defines max(a,b) */ - -struct type_KRB5_HostAddresses * -krb5_address2KRB5_HostAddresses(val, error) -register krb5_address * const *val; -register int *error; -{ -#if 0 - /* this code is for -h2 style ISODE structures. However, pepsy - generates horribly broken when given -h2. */ - - register struct type_KRB5_HostAddresses *retval; - register krb5_address * const *temp; - register int i; - - if (!val) { - *error = EINVAL; - return 0; - } - - /* count elements */ - for (i = 0, temp = val; *temp; temp++,i++); - - retval = (struct type_KRB5_HostAddresses *) - xmalloc(sizeof(*retval) + max(0,i-1)*sizeof(retval->element_KRB5_0[0])); - if (!retval) { - *error = ENOMEM; - return(0); - } - memset(retval, 0, sizeof(*retval)); - retval->nelem = i; - for (i = 0; i < retval->nelem; i++) { - retval->element_KRB5_0[i] = (struct element_KRB5_1 *) - xmalloc(sizeof(*(retval->element_KRB5_0[i]))); - if (!retval->element_KRB5_0[i]) { - errout: - retval->nelem = i; - free_KRB5_HostAddresses(retval); - *error = ENOMEM; - return(0); - } - retval->element_KRB5_0[i]->addr__type = (val[i])->addrtype; - retval->element_KRB5_0[i]->address = str2qb((char *)(val[i])->contents, - (val[i])->length, 1); - if (!retval->element_KRB5_0[i]->address) { - /* clean up */ - krb5_xfree(retval->element_KRB5_0[i]); - goto errout; - } - } - return(retval); -#endif - register struct type_KRB5_HostAddresses *retval = 0, *rv1 = 0, *rv2; - register krb5_address * const *temp; - register int i; - - if (!val) { - *error = EINVAL; - return 0; - } - - for (i = 0, temp = val; *temp; temp++,i++, rv1 = rv2) { - - rv2 = (struct type_KRB5_HostAddresses *) xmalloc(sizeof(*rv2)); - if (!rv2) { - if (retval) - free_KRB5_HostAddresses(retval); - *error = ENOMEM; - return(0); - } - if (rv1) - rv1->next = rv2; - memset((char *)rv2, 0, sizeof (*rv2)); - if (!retval) - retval = rv2; - - rv2->element_KRB5_0 = (struct element_KRB5_1 *) - xmalloc(sizeof(*(retval->element_KRB5_0))); - if (!rv2->element_KRB5_0) { - errout: - if (retval) - free_KRB5_HostAddresses(retval); - *error = ENOMEM; - return(0); - } - rv2->element_KRB5_0->addr__type = (val[i])->addrtype; - rv2->element_KRB5_0->address = str2qb((char *)(val[i])->contents, - (val[i])->length, 1); - if (!rv2->element_KRB5_0->address) { - /* clean up */ - krb5_xfree(rv2->element_KRB5_0); - goto errout; - } - } - if (retval == 0) - *error = ISODE_LOCAL_ERR_MISSING_PART; - return(retval); -} diff --git a/src/lib/krb5/asn.1/kadr2adr.c b/src/lib/krb5/asn.1/kadr2adr.c deleted file mode 100644 index a85bccfa6..000000000 --- a/src/lib/krb5/asn.1/kadr2adr.c +++ /dev/null @@ -1,60 +0,0 @@ -/* - * lib/krb5/asn.1/kadr2adr.c - * - * Copyright 1989,1990 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. 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. - * - * - * Glue between Kerberos version and ISODE 6.0 version of structures. - */ - - -#include - -/*#include */ -#include -#include -#include "asn1glue.h" - -#include - -/* ISODE defines max(a,b) */ - -struct type_KRB5_HostAddress * -krb5_addr2KRB5_HostAddress(val, error) -register krb5_address const *val; -register int *error; -{ - register struct type_KRB5_HostAddress *retval; - - retval = (struct type_KRB5_HostAddress *) xmalloc(sizeof(*retval)); - if (!retval) { - nomem: - *error = ENOMEM; - return(0); - } - memset(retval, 0, sizeof(*retval)); - retval->addr__type = val->addrtype; - retval->address = str2qb((char *)val->contents, val->length, 1); - if (!retval->address) { - krb5_xfree(retval); - goto nomem; - } - return(retval); -} diff --git a/src/lib/krb5/asn.1/kaprp2aprp.c b/src/lib/krb5/asn.1/kaprp2aprp.c deleted file mode 100644 index 506bbc49d..000000000 --- a/src/lib/krb5/asn.1/kaprp2aprp.c +++ /dev/null @@ -1,62 +0,0 @@ -/* - * lib/krb5/asn.1/kaprp2aprp.c - * - * Copyright 1989,1990 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. 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. - * - * - * Glue between Kerberos version and ISODE 6.0 version of structures. - */ - - -#include - -/*#include */ -#include -#include -#include "asn1glue.h" - -#include - -/* ISODE defines max(a,b) */ - -struct type_KRB5_AP__REP * -krb5_ap_rep2KRB5_AP__REP(val, error) -register const krb5_ap_rep *val; -register int *error; -{ - register struct type_KRB5_AP__REP *retval; - - retval = (struct type_KRB5_AP__REP *)xmalloc(sizeof(*retval)); - if (!retval) { - *error = ENOMEM; - return(0); - } - memset(retval, 0, sizeof(*retval)); - - retval->pvno = KRB5_PVNO; - retval->msg__type = KRB5_AP_REP; - retval->enc__part = krb5_enc_data2KRB5_EncryptedData(&(val->enc_part), - error); - if (!retval->enc__part) { - krb5_xfree(retval); - return(0); - } - return(retval); -} diff --git a/src/lib/krb5/asn.1/kaprq2aprq.c b/src/lib/krb5/asn.1/kaprq2aprq.c deleted file mode 100644 index efdd51237..000000000 --- a/src/lib/krb5/asn.1/kaprq2aprq.c +++ /dev/null @@ -1,75 +0,0 @@ -/* - * lib/krb5/asn.1/kaprq2aprq.c - * - * Copyright 1989,1990 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. 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. - * - * - * Glue between Kerberos version and ISODE 6.0 version of structures. - */ - - -#include - -/*#include */ -#include -#include -#include "asn1glue.h" - -#include - -/* ISODE defines max(a,b) */ - -struct type_KRB5_AP__REQ * -krb5_ap_req2KRB5_AP__REQ(val, error) -register const krb5_ap_req *val; -register int *error; -{ - register struct type_KRB5_AP__REQ *retval; - - retval = (struct type_KRB5_AP__REQ *)xmalloc(sizeof(*retval)); - if (!retval) { - *error = ENOMEM; - return(0); - } - memset(retval, 0, sizeof(*retval)); - - retval->pvno = KRB5_PVNO; - retval->msg__type = KRB5_AP_REQ; - - retval->ap__options = krb5_apoptions2KRB5_APOptions(val->ap_options, - error); - if (!retval->ap__options) { - krb5_xfree(retval); - return(0); - } - retval->ticket = krb5_ticket2KRB5_Ticket(val->ticket, error); - if (!retval->ticket) { - free_KRB5_AP__REQ(retval); - return(0); - } - retval->authenticator = - krb5_enc_data2KRB5_EncryptedData(&(val->authenticator), - error); - if (!retval->authenticator) { - free_KRB5_AP__REQ(retval); - return(0); - } - return(retval); -} diff --git a/src/lib/krb5/asn.1/karep2arep.c b/src/lib/krb5/asn.1/karep2arep.c deleted file mode 100644 index 21d5b7814..000000000 --- a/src/lib/krb5/asn.1/karep2arep.c +++ /dev/null @@ -1,72 +0,0 @@ -/* - * lib/krb5/asn.1/karep2arep.c - * - * Copyright 1989,1990 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. 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. - * - * - * Glue between Kerberos version and ISODE 6.0 version of structures. - */ - - -#include - -/*#include */ -#include -#include -#include "asn1glue.h" - -#include - -/* ISODE defines max(a,b) */ - -struct type_KRB5_EncAPRepPart * -krb5_ap_rep_enc_part2KRB5_EncAPRepPart(val, error) -register const krb5_ap_rep_enc_part *val; -register int *error; -{ - register struct type_KRB5_EncAPRepPart *retval; - - retval = (struct type_KRB5_EncAPRepPart *)xmalloc(sizeof(*retval)); - if (!retval) { - *error = ENOMEM; - return(0); - } - memset(retval, 0, sizeof(*retval)); - - retval->ctime = unix2gentime(val->ctime, error); - if (!retval->ctime) { - krb5_xfree(retval); - return(0); - } - - retval->cusec = val->cusec; - if (val->subkey) { - retval->subkey = krb5_keyblock2KRB5_EncryptionKey(val->subkey, error); - if (!retval->subkey) { - free_KRB5_EncAPRepPart(retval); - return 0; - } - } - if (val->seq_number) { - retval->seq__number = val->seq_number; - retval->optionals |= opt_KRB5_EncAPRepPart_seq__number; - } - return(retval); -} diff --git a/src/lib/krb5/asn.1/kauth2auth.c b/src/lib/krb5/asn.1/kauth2auth.c deleted file mode 100644 index d1a7b083f..000000000 --- a/src/lib/krb5/asn.1/kauth2auth.c +++ /dev/null @@ -1,93 +0,0 @@ -/* - * lib/krb5/asn.1/kauth2auth.c - * - * Copyright 1989,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. 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. - * - * - * Glue between Kerberos version and ISODE 6.0 version of structures. - */ - - -#include - -/*#include */ -#include -#include -#include "asn1glue.h" - -#include - -/* ISODE defines max(a,b) */ - -struct type_KRB5_Authenticator * -krb5_authenticator2KRB5_Authenticator(val, error) -register const krb5_authenticator *val; -register int *error; -{ - register struct type_KRB5_Authenticator *retval; - - retval = (struct type_KRB5_Authenticator *)xmalloc(sizeof(*retval)); - if (!retval) { - *error = ENOMEM; - return(0); - } - - memset(retval, 0, sizeof(*retval)); - retval->authenticator__vno = KRB5_PVNO; - retval->crealm = krb5_data2qbuf(krb5_princ_realm(val->client)); - if (!retval->crealm) { - *error = ENOMEM; - errout: - free_KRB5_Authenticator(retval); - return(0); - } - retval->cname = krb5_principal2KRB5_PrincipalName(val->client, error); - if (!retval->cname) { - goto errout; - } - if (val->checksum) { - retval->cksum = krb5_checksum2KRB5_Checksum(val->checksum, error); - if (!retval->cksum) { - goto errout; - } - } - retval->cusec = val->cusec; - retval->ctime = unix2gentime(val->ctime, error); - if (!retval->ctime) { - goto errout; - } - if (val->subkey) { - retval->subkey = krb5_keyblock2KRB5_EncryptionKey(val->subkey, error); - if (!retval->subkey) - goto errout; - } - if (val->seq_number) { - retval->seq__number = val->seq_number; - retval->optionals |= opt_KRB5_Authenticator_seq__number; - } - if (val->authorization_data && *val->authorization_data) { - retval->authorization__data = - krb5_authdata2KRB5_AuthorizationData(val->authorization_data, error); - if (!retval->authorization__data) { - goto errout; - } - } - return(retval); -} diff --git a/src/lib/krb5/asn.1/kck2ck.c b/src/lib/krb5/asn.1/kck2ck.c deleted file mode 100644 index 894a8fbf4..000000000 --- a/src/lib/krb5/asn.1/kck2ck.c +++ /dev/null @@ -1,72 +0,0 @@ -/* - * lib/krb5/asn.1/kck2ck.c - * - * Copyright 1989,1990 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. 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. - * - * - * Glue between Kerberos version and ISODE 6.0 version of structures. - */ - - -#include - -/*#include */ -#include -#include -#include "asn1glue.h" - -#include - -/* ISODE defines max(a,b) */ - -struct type_KRB5_Checksum * -krb5_checksum2KRB5_Checksum(val, error) -const krb5_checksum *val; -register int *error; -{ - PE pe; - register struct type_KRB5_Checksum *retval; - struct qbuf *temp; - - pe = gens2prim(val->contents, val->length); - if (!pe) { - nomem: - *error = ENOMEM; - return(0); - } else - *error = 0; - - temp = prim2qb(pe); - if (!temp) - *error = pe->pe_errno + ISODE_50_PE_ERR_NONE; - (void) pe_free(pe); - - if (!temp) - return(0); - - retval = (struct type_KRB5_Checksum *) xmalloc(sizeof(*retval)); - if (!retval) { - goto nomem; - } - retval->cksumtype = val->checksum_type; - retval->checksum = temp; - - return(retval); -} diff --git a/src/lib/krb5/asn.1/kcred2cred.c b/src/lib/krb5/asn.1/kcred2cred.c deleted file mode 100644 index dfcfd0d3e..000000000 --- a/src/lib/krb5/asn.1/kcred2cred.c +++ /dev/null @@ -1,105 +0,0 @@ -/* - * lib/krb5/asn.1/kcred2cred.c - * - * Copyright 1989,1990 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. 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. - * - * - * Glue between Kerberos version and ISODE 6.0 version of structures. - */ - - -#include - -/*#include */ -#include -#include -#include "asn1glue.h" - -#include - -/* ISODE defines max(a,b) */ - - -struct type_KRB5_KRB__CRED * -krb5_cred2KRB5_KRB__CRED(val, error) -register const krb5_cred *val; -register int *error; -{ - register struct type_KRB5_KRB__CRED *retval; - register struct element_KRB5_12 *rv1 = 0, *rv2; - register krb5_ticket * const *temp; - register int i; - - retval = (struct type_KRB5_KRB__CRED *)xmalloc(sizeof(*retval)); - if (!retval) { - *error = ENOMEM; - return(0); - } - memset((char *)retval, 0, sizeof(*retval)); - - retval->pvno = KRB5_PVNO; - retval->msg__type = KRB5_CRED; - - /* Copy tickets */ - for (i = 0, temp = val->tickets; *temp; temp++, i++, rv1 = rv2) { - - rv2 = (struct element_KRB5_12 *) xmalloc(sizeof(*rv2)); - if (!rv2) { - errout: - while (retval->tickets) { - free_KRB5_Ticket(retval->tickets->Ticket); - rv1 = retval->tickets->next; - free(retval->tickets); - retval->tickets = rv1; - } - *error = ENOMEM; - return(0); - } - if (rv1) - rv1->next = rv2; - memset((char *)rv2, 0, sizeof (*rv2)); - if (!retval->tickets) - retval->tickets = rv2; - - rv2->Ticket = (struct type_KRB5_Ticket *) - xmalloc(sizeof(*(rv2->Ticket))); - if (!rv2->Ticket) - goto errout; - - rv2->Ticket = krb5_ticket2KRB5_Ticket(val->tickets[i], error); - if (!rv2->Ticket) { - krb5_xfree(retval->tickets); - return(0); - } - } - - if (!retval->tickets) { - krb5_xfree(retval); - return(0); - } - - retval->enc__part = krb5_enc_data2KRB5_EncryptedData(&(val->enc_part), - error); - if (!retval->enc__part) { - krb5_xfree(retval); - return(0); - } - return(retval); -} diff --git a/src/lib/krb5/asn.1/kcrep2crep.c b/src/lib/krb5/asn.1/kcrep2crep.c deleted file mode 100644 index d4253faf3..000000000 --- a/src/lib/krb5/asn.1/kcrep2crep.c +++ /dev/null @@ -1,197 +0,0 @@ -/* - * lib/krb5/asn.1/kcrep2crep.c - * - * Copyright 1989,1990 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. 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. - * - * - * Glue between Kerberos version and ISODE 6.0 version of structures. - */ - - -#include - -/*#include */ -#include -#include -#include "asn1glue.h" - -#include - -/* ISODE defines max(a,b) */ - -struct type_KRB5_EncKrbCredPart * -krb5_cred_enc_part2KRB5_EncKrbCredPart(val, error) -register const krb5_cred_enc_part *val; -register int *error; -{ - struct type_KRB5_EncKrbCredPart *retval = 0; - register struct element_KRB5_13 *rv1 = 0, *rv2; - register krb5_cred_info * const *temp; - register int i; - - retval = (struct type_KRB5_EncKrbCredPart *) xmalloc(sizeof(*retval)); - if (!retval) { - *error = ENOMEM; - return(0); - } - memset((char *)retval, 0, sizeof (*retval)); - - if (val->nonce) { - retval->nonce = val->nonce; - retval->optionals |= opt_KRB5_EncKrbCredPart_nonce; - } - - if (val->timestamp) { - retval->timestamp = unix2gentime(val->timestamp, error); - if (!retval->timestamp) { - errout: - if (retval) - free_KRB5_EncKrbCredPart(retval); - *error = ENOMEM; - return(0); - } - retval->usec = val->usec; - retval->optionals |= opt_KRB5_EncKrbCredPart_usec; - } - - if (val->s_address) { - retval->s__address = - krb5_addr2KRB5_HostAddress(val->s_address, error); - if (!retval->s__address) { - goto errout; - } - } - - if (val->r_address) { - retval->r__address = - krb5_addr2KRB5_HostAddress(val->r_address, error); - if (!retval->r__address) { - goto errout; - } - } - - for (i = 0, temp = val->ticket_info; *temp; temp++, i++, rv1 = rv2) { - - rv2 = (struct element_KRB5_13 *) xmalloc(sizeof(*rv2)); - if (!rv2) - goto errout; - - memset((char *)rv2, 0, sizeof (*rv2)); - - if (rv1) - rv1->next = rv2; - - if (!retval->ticket__info) - retval->ticket__info = rv2; - - rv2->KRB__CRED__INFO = (struct type_KRB5_KRB__CRED__INFO *) - xmalloc(sizeof(*(rv2->KRB__CRED__INFO))); - if (!rv2->KRB__CRED__INFO) - goto errout; - memset((char *)rv2->KRB__CRED__INFO, 0, sizeof (*rv2->KRB__CRED__INFO)); - - rv2->KRB__CRED__INFO->key = - krb5_keyblock2KRB5_EncryptionKey(val->ticket_info[i]->session, - error); - if (!rv2->KRB__CRED__INFO->key) { - goto errout; - } - - if (val->ticket_info[i]->client) { - rv2->KRB__CRED__INFO->prealm = - krb5_data2qbuf(krb5_princ_realm(val->ticket_info[i]->client)); - if (!rv2->KRB__CRED__INFO->prealm) { - goto errout; - } - rv2->KRB__CRED__INFO->pname = - krb5_principal2KRB5_PrincipalName(val->ticket_info[i]->client, - error); - if (!rv2->KRB__CRED__INFO->pname) { - goto errout; - } - } - - if (val->ticket_info[i]->flags) { - rv2->KRB__CRED__INFO->flags = - krb5_flags2KRB5_TicketFlags(val->ticket_info[i]->flags, error); - if (!rv2->KRB__CRED__INFO->flags) { - goto errout; - } - } - - if (val->ticket_info[i]->times.authtime) { - rv2->KRB__CRED__INFO->authtime = - unix2gentime(val->ticket_info[i]->times.authtime, error); - if (!rv2->KRB__CRED__INFO->authtime) { - goto errout; - } - } - - if (val->ticket_info[i]->times.starttime) { - rv2->KRB__CRED__INFO->starttime = - unix2gentime(val->ticket_info[i]->times.starttime, error); - if (!rv2->KRB__CRED__INFO->starttime) { - goto errout; - } - } - - if (val->ticket_info[i]->times.endtime) { - rv2->KRB__CRED__INFO->endtime = - unix2gentime(val->ticket_info[i]->times.endtime, error); - if (!rv2->KRB__CRED__INFO->endtime) { - goto errout; - } - } - - if (val->ticket_info[i]->flags & TKT_FLG_RENEWABLE) { - rv2->KRB__CRED__INFO->renew__till = - unix2gentime(val->ticket_info[i]->times.renew_till, error); - if (!rv2->KRB__CRED__INFO->renew__till) { - goto errout; - } - } - - if (val->ticket_info[i]->server) { - rv2->KRB__CRED__INFO->srealm = - krb5_data2qbuf(krb5_princ_realm(val->ticket_info[i]->server)); - if (!rv2->KRB__CRED__INFO->srealm) { - *error = ENOMEM; - goto errout; - } - rv2->KRB__CRED__INFO->sname = - krb5_principal2KRB5_PrincipalName(val->ticket_info[i]->server, - error); - if (!rv2->KRB__CRED__INFO->sname) { - goto errout; - } - } - - if (val->ticket_info[i]->caddrs) { - rv2->KRB__CRED__INFO->caddr = - krb5_address2KRB5_HostAddresses(val->ticket_info[i]->caddrs, - error); - if (!rv2->KRB__CRED__INFO->caddr) { - goto errout; - } - } - } - - return(retval); -} diff --git a/src/lib/krb5/asn.1/kdcr2kkdcr.c b/src/lib/krb5/asn.1/kdcr2kkdcr.c deleted file mode 100644 index 11f77317f..000000000 --- a/src/lib/krb5/asn.1/kdcr2kkdcr.c +++ /dev/null @@ -1,140 +0,0 @@ -/* - * lib/krb5/asn.1/kdcr2kkdcr.c - * - * Copyright 1989,1990 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. 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. - * - * - * Glue between Kerberos version and ISODE 6.0 version of structures. - */ - - -#include - -/*#include */ -#include -#include -#include "asn1glue.h" - -#include - -/* ISODE defines max(a,b) */ - - -krb5_pa_data ** -element_KRB5_112krb5_pa_data(val, error) - struct element_KRB5_11 *val; - register int *error; -{ - register krb5_pa_data **retval; - register int i; - register struct element_KRB5_11 *rv; - - for (i = 0, rv = val; rv; i++, rv = rv->next) - ; - - /* plus one for null terminator */ - retval = (krb5_pa_data **) xcalloc(i + 1, sizeof(*retval)); - if (!retval) { - *error = ENOMEM; - return(0); - } - for (i = 0, rv = val; rv; rv = rv->next, i++) { - if (qb_pullup(rv->PA__DATA->pa__data) != OK) { - retval[i] = 0; - krb5_free_pa_data(retval); - *error = ENOMEM; - return(0); - } - retval[i] = (krb5_pa_data *) xmalloc(sizeof(*retval[i])); - if (!retval[i]) { - krb5_free_pa_data(retval); - *error = ENOMEM; - return(0); - } - retval[i]->pa_type = rv->PA__DATA->padata__type; - retval[i]->length = rv->PA__DATA->pa__data->qb_forw->qb_len; - if (retval[i]->length) { - retval[i]->contents = (unsigned char *)xmalloc(rv->PA__DATA->pa__data->qb_forw->qb_len); - if (!retval[i]->contents) { - krb5_xfree(retval[i]); - retval[i] = 0; - krb5_free_pa_data(retval); - *error = ENOMEM; - return(0); - } - memcpy(retval[i]->contents, - rv->PA__DATA->pa__data->qb_forw->qb_data, - retval[i]->length); - } else - retval[i]->contents = 0; - } - retval[i] = 0; - return(retval); -} - - -krb5_kdc_rep * -KRB5_KDC__REP2krb5_kdc_rep(val, error) -register const struct type_KRB5_TGS__REP *val; -register int *error; -{ - register krb5_kdc_rep *retval; - krb5_enc_data *temp; - - retval = (krb5_kdc_rep *)xmalloc(sizeof(*retval)); - if (!retval) { - *error = ENOMEM; - return(0); - } - memset(retval, 0, sizeof(*retval)); - - retval->msg_type = val->msg__type; - - if (val->padata) { - retval->padata = element_KRB5_112krb5_pa_data(val->padata, error); - if (*error) { - krb5_xfree(retval); - return 0; - - } - } - retval->client = KRB5_PrincipalName2krb5_principal(val->cname, - val->crealm, - error); - if (!retval->client) { - krb5_free_kdc_rep(retval); - return(0); - } - - retval->ticket = KRB5_Ticket2krb5_ticket(val->ticket, error); - if (!retval->ticket) { - krb5_free_kdc_rep(retval); - return(0); - } - temp = KRB5_EncryptedData2krb5_enc_data(val->enc__part, error); - if (temp) { - retval->enc_part = *temp; - krb5_xfree(temp); - } else { - krb5_free_kdc_rep(retval); - return(0); - } - return(retval); -} diff --git a/src/lib/krb5/asn.1/kdcr2ktgsr.c b/src/lib/krb5/asn.1/kdcr2ktgsr.c deleted file mode 100644 index 104426e8d..000000000 --- a/src/lib/krb5/asn.1/kdcr2ktgsr.c +++ /dev/null @@ -1,45 +0,0 @@ -/* - * lib/krb5/asn.1/kdcr2ktgsr.c - * - * Copyright 1989,1990 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. 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. - * - * - * Glue between Kerberos version and ISODE 6.0 version of structures. - */ - - -#include - -/*#include */ -#include -#include -#include "asn1glue.h" - -#include - -/* ISODE defines max(a,b) */ - -krb5_kdc_rep * -KRB5_KDC__REP2krb5_tgs_rep(val, error) -register const struct type_KRB5_TGS__REP *val; -register int *error; -{ - return KRB5_KDC__REP2krb5_kdc_rep(val, error); -} diff --git a/src/lib/krb5/asn.1/kedat2edat.c b/src/lib/krb5/asn.1/kedat2edat.c deleted file mode 100644 index e07a2a39d..000000000 --- a/src/lib/krb5/asn.1/kedat2edat.c +++ /dev/null @@ -1,65 +0,0 @@ -/* - * lib/krb5/asn.1/kedat2edat.c - * - * Copyright 1990 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. 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. - * - * - * Glue between Kerberos version and ISODE 6.0 version of structures. - */ - - -#include - -/*#include */ -#include -#include -#include "asn1glue.h" - -#include - -/* ISODE defines max(a,b) */ - -struct type_KRB5_EncryptedData * -krb5_enc_data2KRB5_EncryptedData(val, error) -register const 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); - } - memset(retval, 0, sizeof(*retval)); - - retval->etype = val->etype; - retval->cipher = krb5_data2qbuf(&(val->ciphertext)); - if (!retval->cipher) { - krb5_xfree(retval); - *error = ENOMEM; - return(0); - } - if (val->kvno) { - retval->optionals = opt_KRB5_EncryptedData_kvno; - retval->kvno = val->kvno; - } - return(retval); -} diff --git a/src/lib/krb5/asn.1/kekrp2ekrp.c b/src/lib/krb5/asn.1/kekrp2ekrp.c deleted file mode 100644 index cdd3e23d3..000000000 --- a/src/lib/krb5/asn.1/kekrp2ekrp.c +++ /dev/null @@ -1,111 +0,0 @@ -/* - * lib/krb5/asn.1/kekrp2ekrp.c - * - * Copyright 1989,1990 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. 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. - * - * - * Glue between Kerberos version and ISODE 6.0 version of structures. - */ - - -#include - -/*#include */ -#include -#include -#include "asn1glue.h" - -#include - -/* ISODE defines max(a,b) */ - -struct type_KRB5_EncKDCRepPart * -krb5_enc_kdc_rep_part2KRB5_EncKDCRepPart(val, error) -register const krb5_enc_kdc_rep_part *val; -register int *error; -{ - register struct type_KRB5_EncKDCRepPart *retval; - - retval = (struct type_KRB5_EncKDCRepPart *)xmalloc(sizeof(*retval)); - if (!retval) { - *error = ENOMEM; - return(0); - } - memset(retval, 0, sizeof(*retval)); - - retval->key = krb5_keyblock2KRB5_EncryptionKey(val->session, error); - if (!retval->key) { - krb5_xfree(retval); - return(0); - } - retval->last__req = krb5_last_req2KRB5_LastReq(val->last_req, error); - if (!retval->last__req) { - errout: - free_KRB5_EncKDCRepPart(retval); - return(0); - } - retval->nonce = val->nonce; - if (val->key_exp) { - retval->key__expiration = unix2gentime(val->key_exp, error); - if (!retval->key__expiration) { - goto errout; - } - } - retval->flags = krb5_flags2KRB5_TicketFlags(val->flags, error); - if (!retval->flags) { - goto errout; - } - retval->authtime = unix2gentime(val->times.authtime, error); - if (!retval->authtime) { - goto errout; - } - if (val->times.starttime) { - retval->starttime = unix2gentime(val->times.starttime, error); - if (!retval->starttime) { - goto errout; - } - } - retval->endtime = unix2gentime(val->times.endtime, error); - if (!retval->endtime) { - goto errout; - } - if (val->flags & TKT_FLG_RENEWABLE) { - retval->renew__till = unix2gentime(val->times.renew_till, error); - if (!retval->renew__till) { - goto errout; - } - } - retval->srealm = krb5_data2qbuf(krb5_princ_realm(val->server)); - if (!retval->srealm) { - *error = ENOMEM; - goto errout; - } - retval->sname = krb5_principal2KRB5_PrincipalName(val->server, error); - if (!retval->sname) { - goto errout; - } - if (val->caddrs) { - retval->caddr = krb5_address2KRB5_HostAddresses(val->caddrs, error); - if (!retval->caddr) { - goto errout; - } - } - return(retval); -} diff --git a/src/lib/krb5/asn.1/kerr2err.c b/src/lib/krb5/asn.1/kerr2err.c deleted file mode 100644 index 3422cc825..000000000 --- a/src/lib/krb5/asn.1/kerr2err.c +++ /dev/null @@ -1,116 +0,0 @@ -/* - * lib/krb5/asn.1/kerr2err.c - * - * Copyright 1989,1990 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. 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. - * - * - * Glue between Kerberos version and ISODE 6.0 version of structures. - */ - - -#include - -/*#include */ -#include -#include -#include "asn1glue.h" - -#include - -/* ISODE defines max(a,b) */ - -struct type_KRB5_KRB__ERROR * -krb5_error2KRB5_KRB__ERROR(val, error) -register const krb5_error *val; -register int *error; -{ - register struct type_KRB5_KRB__ERROR *retval; - - retval = (struct type_KRB5_KRB__ERROR *)xmalloc(sizeof(*retval)); - if (!retval) { - *error = ENOMEM; - return(0); - } - memset(retval, 0, sizeof(*retval)); - - retval->pvno = KRB5_PVNO; - retval->msg__type = KRB5_ERROR; - - if (val->ctime) { - retval->ctime = unix2gentime(val->ctime, error); - if (!retval->ctime) { - krb5_xfree(retval); - return(0); - } - } - if (val->cusec) { - retval->cusec = val->cusec; - retval->optionals = opt_KRB5_KRB__ERROR_cusec; - } - - retval->stime = unix2gentime(val->stime, error); - if (!retval->stime) { - errout: - free_KRB5_KRB__ERROR(retval); - return(0); - } - retval->susec = val->susec; - retval->error__code = val->error; - - if (val->client) { - retval->crealm = krb5_data2qbuf(krb5_princ_realm(val->client)); - if (!retval->crealm) { - *error = ENOMEM; - goto errout; - } - retval->cname = krb5_principal2KRB5_PrincipalName(val->client, error); - if (!retval->cname) { - goto errout; - } - } - - /* server is technically not optional, but... */ - if (val->server) { - retval->realm = krb5_data2qbuf(krb5_princ_realm(val->server)); - if (!retval->realm) { - *error = ENOMEM; - goto errout; - } - retval->sname = krb5_principal2KRB5_PrincipalName(val->server, error); - if (!retval->sname) { - goto errout; - } - } - if (val->text.data) { - retval->e__text = krb5_data2qbuf(&val->text); - if (!retval->e__text) { - *error = ENOMEM; - goto errout; - } - } - if (val->e_data.data) { - retval->e__data = krb5_data2qbuf(&val->e_data); - if (!retval->e__data) { - *error = ENOMEM; - goto errout; - } - } - return(retval); -} diff --git a/src/lib/krb5/asn.1/ketpt2etpt.c b/src/lib/krb5/asn.1/ketpt2etpt.c deleted file mode 100644 index 7bc881403..000000000 --- a/src/lib/krb5/asn.1/ketpt2etpt.c +++ /dev/null @@ -1,109 +0,0 @@ -/* - * lib/krb5/asn.1/ketpt2etpt.c - * - * Copyright 1989,1990 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. 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. - * - * - * Glue between Kerberos version and ISODE 6.0 version of structures. - */ - - -#include - -#include -#include "asn1glue.h" - -#include - -struct type_KRB5_EncTicketPart * -krb5_enc_tkt_part2KRB5_EncTicketPart(val, error) -register const krb5_enc_tkt_part *val; -register int *error; -{ - register struct type_KRB5_EncTicketPart *retval; - - retval = (struct type_KRB5_EncTicketPart *)xmalloc(sizeof(*retval)); - if (!retval) { - *error = ENOMEM; - return(0); - } - memset(retval, 0, sizeof(*retval)); - - retval->flags = krb5_flags2KRB5_TicketFlags(val->flags, error); - if (*error) { - krb5_xfree(retval); - return(0); - } - retval->key = krb5_keyblock2KRB5_EncryptionKey(val->session, error); - if (!retval->key) { - errout: - free_KRB5_EncTicketPart(retval); - return(0); - } - retval->crealm = krb5_data2qbuf(krb5_princ_realm(val->client)); - if (!retval->crealm) { - *error = ENOMEM; - goto errout; - } - retval->cname = krb5_principal2KRB5_PrincipalName(val->client, error); - if (!retval->cname) { - goto errout; - } - retval->transited = - krb5_transited2KRB5_TransitedEncoding(&(val->transited), error); - if (!retval->transited) { - goto errout; - } - retval->authtime = unix2gentime(val->times.authtime, error); - if (!retval->authtime) { - goto errout; - } - if (val->times.starttime) { - retval->starttime = unix2gentime(val->times.starttime, error); - if (!retval->starttime) { - goto errout; - } - } - retval->endtime = unix2gentime(val->times.endtime, error); - if (!retval->endtime) { - goto errout; - } - if (val->times.renew_till) { - retval->renew__till = unix2gentime(val->times.renew_till, error); - if (!retval->renew__till) { - goto errout; - } - } - if (val->caddrs) { - retval->caddr = krb5_address2KRB5_HostAddresses(val->caddrs, - error); - if (!retval->caddr) { - goto errout; - } - } - if (val->authorization_data && *val->authorization_data) { - retval->authorization__data = - krb5_authdata2KRB5_AuthorizationData(val->authorization_data, error); - if (!retval->authorization__data) { - goto errout; - } - } - return(retval); -} diff --git a/src/lib/krb5/asn.1/kkdcr2kdcr.c b/src/lib/krb5/asn.1/kkdcr2kdcr.c deleted file mode 100644 index 807ab094b..000000000 --- a/src/lib/krb5/asn.1/kkdcr2kdcr.c +++ /dev/null @@ -1,134 +0,0 @@ -/* - * lib/krb5/asn.1/kkdcr2kdcr.c - * - * Copyright 1989,1990 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. 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. - * - * - * Glue between Kerberos version and ISODE 6.0 version of structures. - */ - - -#include - -#include -#include -#include "asn1glue.h" - -#include - - -struct element_KRB5_11 *krb5_pa_data2element_KRB5_11(val, error) - krb5_pa_data **val; - int *error; -{ - register struct element_KRB5_11 *retval = 0, *rv1 = 0, *rv2; - register krb5_pa_data * const *temp; - register int i; - - - *error = 0; - - if (val == 0) - return 0; - - /* count elements */ - for (i = 0, temp = val; *temp; temp++,i++, rv1 = rv2) { - - rv2 = (struct element_KRB5_11 *) xmalloc(sizeof(*rv2)); - if (!rv2) { - errout: - while (retval) { - free_KRB5_PA__DATA(retval->PA__DATA); - rv1 = retval->next; - free(retval); - retval = rv1; - } - *error = ENOMEM; - return(0); - } - if (rv1) - rv1->next = rv2; - memset((char *)rv2, 0, sizeof (*rv2)); - if (!retval) - retval = rv2; - - rv2->PA__DATA = (struct type_KRB5_PA__DATA *) - xmalloc(sizeof(*(rv2->PA__DATA))); - if (!rv2->PA__DATA) - goto errout; - rv2->PA__DATA->padata__type = val[i]->pa_type; - rv2->PA__DATA->pa__data = str2qb((char *)(val[i])->contents, - (val[i])->length, 1); - if (!rv2->PA__DATA->pa__data) { - goto errout; - } - } - if (retval == 0) - *error = ISODE_LOCAL_ERR_MISSING_PART; - return(retval); - -} - -struct type_KRB5_TGS__REP * -krb5_kdc_rep2KRB5_KDC__REP(val, error) - register const krb5_kdc_rep * val; - register int * error; -{ - register struct type_KRB5_TGS__REP *retval; - - retval = (struct type_KRB5_TGS__REP *)xmalloc(sizeof(*retval)); - if (!retval) { - *error = ENOMEM; - return(0); - } - memset(retval, 0, sizeof(*retval)); - - retval->pvno = KRB5_PVNO; - retval->msg__type = val->msg_type; - - if (val->padata) { - retval->padata = krb5_pa_data2element_KRB5_11(val->padata, error); - if (*error) { - goto errout; - } - } - - retval->crealm = krb5_data2qbuf(krb5_princ_realm(val->client)); - if (!retval->crealm) { - *error = ENOMEM; - errout: - free_KRB5_TGS__REP(retval); - return(0); - } - retval->cname = krb5_principal2KRB5_PrincipalName(val->client, error); - if (!retval->cname) { - goto errout; - } - retval->ticket = krb5_ticket2KRB5_Ticket(val->ticket, error); - if (!retval->ticket) { - goto errout; - } - retval->enc__part = krb5_enc_data2KRB5_EncryptedData(&(val->enc_part), - error); - if (!retval->enc__part) { - goto errout; - } - return(retval); -} diff --git a/src/lib/krb5/asn.1/kkey2enck.c b/src/lib/krb5/asn.1/kkey2enck.c deleted file mode 100644 index 395f206c4..000000000 --- a/src/lib/krb5/asn.1/kkey2enck.c +++ /dev/null @@ -1,73 +0,0 @@ -/* - * lib/krb5/asn.1/kkey2enck.c - * - * Copyright 1989,1990 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. 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. - * - * - * Glue between Kerberos version and ISODE 6.0 version of structures. - */ - - -#include - -/*#include */ -#include -#include -#include "asn1glue.h" - -#include - -/* ISODE defines max(a,b) */ - -struct type_KRB5_EncryptionKey * -krb5_keyblock2KRB5_EncryptionKey(val, error) -const krb5_keyblock *val; -register int *error; -{ - PE pe; - register struct type_KRB5_EncryptionKey *retval; - struct qbuf *temp; - - pe = gens2prim(val->contents, val->length); - if (!pe) { - nomem: - *error = ENOMEM; - return(0); - } else - *error = 0; - - temp = prim2qb(pe); - if (!temp) - *error = pe->pe_errno + ISODE_50_PE_ERR_NONE; - (void) pe_free(pe); - - if (!temp) - return(0); - - retval = (struct type_KRB5_EncryptionKey *) xmalloc(sizeof(*retval)); - if (!retval) { - goto nomem; - } - - retval->keytype = val->keytype; - retval->keyvalue = temp; - - return(retval); -} diff --git a/src/lib/krb5/asn.1/klsrq2lsrq.c b/src/lib/krb5/asn.1/klsrq2lsrq.c deleted file mode 100644 index 0aa5a46d1..000000000 --- a/src/lib/krb5/asn.1/klsrq2lsrq.c +++ /dev/null @@ -1,121 +0,0 @@ -/* - * lib/krb5/asn.1/klsrq2lsrq.c - * - * Copyright 1989,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. 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. - * - * - * Glue between Kerberos version and ISODE 6.0 version of structures. - */ - - -#include - -/*#include */ -#include -#include -#include "asn1glue.h" - -#include - -/* ISODE defines max(a,b) */ - -struct type_KRB5_LastReq * -krb5_last_req2KRB5_LastReq(val, error) -register krb5_last_req_entry * const *val; -register int *error; -{ -#if 0 - /* this code is for -h2 style ISODE structures. However, pepsy - generates horribly broken when given -h2. */ - - register struct type_KRB5_LastReq *retval; - register krb5_last_req_entry * const *temp; - register int i; - - /* count elements */ - for (i = 0, temp = val; *temp; temp++,i++); - - retval = (struct type_KRB5_LastReq *) - xmalloc(sizeof(*retval) + max(0,i-1)*sizeof(retval->element_KRB5_4[0])); - if (!retval) { - *error = ENOMEM; - return(0); - } - memset(retval, 0, sizeof(*retval)); - retval->nelem = i; - for (i = 0; i < retval->nelem; i++) { - retval->element_KRB5_4[i] = (struct element_KRB5_5 *) - xmalloc(sizeof(*(retval->element_KRB5_4[i]))); - if (!retval->element_KRB5_4[i]) { - *error = ENOMEM; - errout: - retval->nelem = i; - free_KRB5_LastReq(retval); - return(0); - } - retval->element_KRB5_4[i]->lr__type = val[i]->lr_type; - retval->element_KRB5_4[i]->lr__value = unix2gentime(val[i]->value, - error); - if (!retval->element_KRB5_4[i]->lr__value) { - goto errout; - } - } - return(retval); -#endif - register struct type_KRB5_LastReq *retval = 0, *rv1 = 0, *rv2; - register krb5_last_req_entry * const *temp; - register int i; - - /* count elements */ - for (i = 0, temp = val; *temp; temp++,i++, rv1 = rv2) { - - rv2 = (struct type_KRB5_LastReq *) xmalloc(sizeof(*rv2)); - if (!rv2) { - if (retval) - free_KRB5_LastReq(retval); - *error = ENOMEM; - return(0); - } - if (rv1) - rv1->next = rv2; - memset((char *)rv2, 0, sizeof (*rv2)); - if (!retval) - retval = rv2; - - rv2->element_KRB5_4 = (struct element_KRB5_5 *) - xmalloc(sizeof(*(retval->element_KRB5_4))); - if (!rv2->element_KRB5_4) { - errout: - *error = ENOMEM; - if (retval) - free_KRB5_LastReq(retval); - return(0); - } - rv2->element_KRB5_4->lr__type = val[i]->lr_type; - rv2->element_KRB5_4->lr__value = unix2gentime(val[i]->value, - error); - if (!retval->element_KRB5_4->lr__value) { - goto errout; - } - } - if (retval == 0) - *error = ISODE_LOCAL_ERR_MISSING_PART; - return(retval); -} diff --git a/src/lib/krb5/asn.1/kprep2prep.c b/src/lib/krb5/asn.1/kprep2prep.c deleted file mode 100644 index 6e8a0fbda..000000000 --- a/src/lib/krb5/asn.1/kprep2prep.c +++ /dev/null @@ -1,84 +0,0 @@ -/* - * lib/krb5/asn.1/kprep2prep.c - * - * Copyright 1989,1990 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. 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. - * - * - * Glue between Kerberos version and ISODE 6.0 version of structures. - */ - - -#include - -/*#include */ -#include -#include -#include "asn1glue.h" - -#include - -/* ISODE defines max(a,b) */ - -struct type_KRB5_EncKrbPrivPart * -krb5_priv_enc_part2KRB5_EncKrbPrivPart(val, error) -register const krb5_priv_enc_part *val; -register int *error; -{ - register struct type_KRB5_EncKrbPrivPart *retval; - - retval = (struct type_KRB5_EncKrbPrivPart *)xmalloc(sizeof(*retval)); - if (!retval) { - *error = ENOMEM; - return(0); - } - memset(retval, 0, sizeof(*retval)); - - retval->user__data = krb5_data2qbuf(&(val->user_data)); - if (!retval->user__data) { - krb5_xfree(retval); - *error = ENOMEM; - return(0); - } - if (val->timestamp) { - retval->timestamp = unix2gentime(val->timestamp, error); - if (!retval->timestamp) { - errout: - free_KRB5_EncKrbPrivPart(retval); - return(0); - } - retval->usec = val->usec; - retval->optionals |= opt_KRB5_EncKrbPrivPart_usec; - } - retval->s__address = krb5_addr2KRB5_HostAddress(val->s_address, error); - if (!retval->s__address) { - goto errout; - } - if (val->r_address) { - retval->r__address = krb5_addr2KRB5_HostAddress(val->r_address, error); - if (!retval->r__address) { - goto errout; - } - } - if (val->seq_number) { - retval->seq__number = val->seq_number; - retval->optionals |= opt_KRB5_EncKrbPrivPart_seq__number; - } - return(retval); -} diff --git a/src/lib/krb5/asn.1/kprin2prin.c b/src/lib/krb5/asn.1/kprin2prin.c deleted file mode 100644 index 192301131..000000000 --- a/src/lib/krb5/asn.1/kprin2prin.c +++ /dev/null @@ -1,85 +0,0 @@ -/* - * lib/krb5/asn.1/kprin2prin.c - * - * Copyright 1989,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. 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. - * - * - * Glue between Kerberos version and ISODE 6.0 version of structures. - */ - - -#include - -/*#include */ -#include -#include -#include "asn1glue.h" - -#include - -/* ISODE defines max(a,b) */ - -struct type_KRB5_PrincipalName * -krb5_principal2KRB5_PrincipalName(val, error) -krb5_const_principal val; -register int *error; -{ - register struct type_KRB5_PrincipalName *retval = 0; - register struct element_KRB5_6 *namestring = 0, *rv1 = 0, *rv2; - register int i; - int nelem = krb5_princ_size(val); - - retval = (struct type_KRB5_PrincipalName *) xmalloc(sizeof(*retval)); - if (!retval) { - *error = ENOMEM; - return(0); - } - - retval->name__type = krb5_princ_type(val); - - /* still skipping realm */ - for (i = 0; i < nelem; i++, rv1 = rv2) { - rv2 = (struct element_KRB5_6 *) xmalloc(sizeof(*rv2)); - if (!rv2) { - if (retval) - free_KRB5_PrincipalName(retval); - *error = ENOMEM; - return(0); - } - if (rv1) - rv1->next = rv2; - memset((char *)rv2, 0, sizeof (*rv2)); - if (!namestring) - namestring = rv2; - - rv2->GeneralString = krb5_data2qbuf(krb5_princ_component(val, i)); - if (!rv2->GeneralString) { - /* clean up */ - if (retval) - free_KRB5_PrincipalName(retval); - *error = ENOMEM; - return(0); - } - } - - retval->name__string = namestring; - - return(retval); -} diff --git a/src/lib/krb5/asn.1/kpriv2priv.c b/src/lib/krb5/asn.1/kpriv2priv.c deleted file mode 100644 index 6061f0fc3..000000000 --- a/src/lib/krb5/asn.1/kpriv2priv.c +++ /dev/null @@ -1,63 +0,0 @@ -/* - * lib/krb5/asn.1/kpriv2priv.c - * - * Copyright 1989,1990 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. 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. - * - * - * Glue between Kerberos version and ISODE 6.0 version of structures. - */ - - -#include - -/*#include */ -#include -#include -#include "asn1glue.h" - -#include - -/* ISODE defines max(a,b) */ - -struct type_KRB5_KRB__PRIV * -krb5_priv2KRB5_KRB__PRIV(val, error) -register const krb5_priv *val; -register int *error; -{ - register struct type_KRB5_KRB__PRIV *retval; - - retval = (struct type_KRB5_KRB__PRIV *)xmalloc(sizeof(*retval)); - if (!retval) { - *error = ENOMEM; - return(0); - } - memset(retval, 0, sizeof(*retval)); - - retval->pvno = KRB5_PVNO; - retval->msg__type = KRB5_PRIV; - - retval->enc__part = krb5_enc_data2KRB5_EncryptedData(&(val->enc_part), - error); - if (!retval->enc__part) { - krb5_xfree(retval); - return(0); - } - return(retval); -} diff --git a/src/lib/krb5/asn.1/kpwd2pwd.c b/src/lib/krb5/asn.1/kpwd2pwd.c deleted file mode 100644 index 2b4bc3d32..000000000 --- a/src/lib/krb5/asn.1/kpwd2pwd.c +++ /dev/null @@ -1,89 +0,0 @@ -/* - * lib/krb5/asn.1/kpwd2pwd.c - * - * Copyright 1989,1990 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. 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. - * - * - * Glue between Kerberos version and ISODE 6.0 version of structures. - */ - - -#include -#include - -#include -#include -#include "asn1glue.h" - -#include - -#ifdef NEVERDEFINE -/* - * typedef struct _passwd_phrase_element { - * krb5_data *passwd; - * krb5_data *phrase; - * } passwd_phrase_element; - * - * struct type_KRB5_PasswdSequence { - * struct qbuf *passwd; - * struct qbuf *phrase; - * }; - * - * struct qbuf { - * struct qbuf *qb_forw; /* doubly-linked list */ - * struct qbuf *qb_back; /* .. */ - * - * int qb_len; /* length of data */ - * char *qb_data; /* current pointer into data */ - * char qb_base[1]; /* extensible... */ - * }; - * - */ -#endif /* NEVERDEFINE */ - -struct type_KRB5_PasswdSequence * -krb5_pwd_seq2KRB5_PWD__SEQ(val, error) -register const passwd_phrase_element *val; -register int *error; -{ - register struct type_KRB5_PasswdSequence *retval; - - if ((retval = (struct type_KRB5_PasswdSequence *) calloc(1, - sizeof(struct type_KRB5_PasswdSequence))) == NULL) { - com_err("kpwd2pwd", 0, "Unable to Allocate PasswdSequence"); - *error = ENOMEM; - return(0); - } - - retval->passwd = krb5_data2qbuf(val->passwd); - if (!retval->passwd) { - *error = ENOMEM; - errout: - free_KRB5_PasswdSequence(retval); - return(0); - } - - retval->phrase = krb5_data2qbuf(val->phrase); - if (!retval->phrase) { - goto errout; - } - - return(retval); -} diff --git a/src/lib/krb5/asn.1/kpwds2pwds.c b/src/lib/krb5/asn.1/kpwds2pwds.c deleted file mode 100644 index 7f4aff2aa..000000000 --- a/src/lib/krb5/asn.1/kpwds2pwds.c +++ /dev/null @@ -1,126 +0,0 @@ -/* - * lib/krb5/asn.1/kpwds2pwds.c - * - * Copyright 1989,1990 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. 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. - * - * - * Glue between Kerberos version and ISODE 6.0 version of structures. - */ - -#ifdef NEVERDEFINE -/* - * encode_generic will return krb_data in the form: - * 1 Byte (Integer) ==> Password Sequence Count (25) - * 5 * ADM_MAX_PW_ITERATIONS Sets: - * 1 Byte (Integer) ==> Length of Passwd (8 - 255) - * 8 - 255 Bytes (Character) ==> "Password" - * 1 Byte (Integer) ==> Length of Phrase (8 - 255) - * 8 - 255 Bytes (Character) ==> "Phrase" - * - * typedef struct _passwd_phrase_element { - * krb5_data passwd; - * krb5_data phrase; - * } passwd_phrase_element; - * - * struct type_KRB5_PasswdData { - * integer passwd__sequence__count; - * /* SEQUENCE OF */ - * struct element_KRB5_14 { - * struct type_KRB5_PasswdSequence *PasswdSequence; - * struct element_KRB5_14 *next; - * } *passwd__sequence; - * }; - * - * struct type_KRB5_PasswdSequence { - * struct qbuf *passwd; - * struct qbuf *phrase; - * }; - */ -#endif /* NEVERDEFINE */ - - -#include -#include - -#include -#include -#include "asn1glue.h" - -#include - -struct type_KRB5_PasswdData * -krb5_pwd_data2KRB5_PWD__DATA(val, error) -register const krb5_pwd_data *val; -register int *error; -{ - register struct type_KRB5_PasswdData *retval = 0; - register struct element_KRB5_14 *passwdseq = 0, *rv1 = 0, *rv2; - passwd_phrase_element **temp; - register int i; - - /* Allocate PasswdData Structure */ - if ((retval = (struct type_KRB5_PasswdData *) xcalloc(1, - sizeof(*retval))) == NULL) { - *error = ENOMEM; - return(0); - } - - retval->passwd__sequence__count = val->sequence_count; - - if (val->element) { - for ( i = 0, temp = (passwd_phrase_element **) val->element; - *temp; - temp++, i++, rv1 = rv2){ - if ((rv2 = (struct element_KRB5_14 *) xcalloc(1, - sizeof(*rv2))) == NULL) {; - *error = ENOMEM; - errout: - free_KRB5_PasswdData(retval); - return(0); - } - - if (rv1) rv1->next = rv2; - - if (!passwdseq) { - passwdseq = rv2; - } - - rv2->PasswdSequence = - krb5_pwd_seq2KRB5_PWD__SEQ(val->element[i], - error); - - if (!rv2->PasswdSequence) { - for (rv1 = passwdseq; rv1; rv1 = rv2) { - if (rv1->PasswdSequence) - free_KRB5_PasswdSequence(rv1->PasswdSequence); - - rv2 = rv1->next; - krb5_xfree(rv1); - } - goto errout; - } - } - - retval->passwd__sequence = passwdseq; - } else - retval->passwd__sequence = 0; - - return(retval); -} diff --git a/src/lib/krb5/asn.1/ksafe2safe.c b/src/lib/krb5/asn.1/ksafe2safe.c deleted file mode 100644 index a0d3c3de9..000000000 --- a/src/lib/krb5/asn.1/ksafe2safe.c +++ /dev/null @@ -1,101 +0,0 @@ -/* - * lib/krb5/asn.1/ksafe2safe.c - * - * Copyright 1989,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. 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. - * - * - * Glue between Kerberos version and ISODE 6.0 version of structures. - */ - - -#include - -/*#include */ -#include -#include -#include "asn1glue.h" - -#include - -/* ISODE defines max(a,b) */ - -struct type_KRB5_KRB__SAFE * -krb5_safe2KRB5_KRB__SAFE(val, error) -register const krb5_safe *val; -register int *error; -{ - register struct type_KRB5_KRB__SAFE *retval; - register struct type_KRB5_KRB__SAFE__BODY *rv2; - - retval = (struct type_KRB5_KRB__SAFE *)xmalloc(sizeof(*retval)); - if (!retval) { - *error = ENOMEM; - return(0); - } - memset(retval, 0, sizeof(*retval)); - - rv2 = (struct type_KRB5_KRB__SAFE__BODY *)xmalloc(sizeof(*rv2)); - if (!rv2) { - krb5_xfree(retval); - *error = ENOMEM; - return(0); - } - memset(rv2, 0, sizeof(*rv2)); - - retval->pvno = KRB5_PVNO; - retval->msg__type = KRB5_SAFE; - retval->safe__body = rv2; - - rv2->user__data = krb5_data2qbuf(&(val->user_data)); - if (!rv2->user__data) { - krb5_xfree(retval); - *error = ENOMEM; - return(0); - } - if (val->timestamp) { - rv2->timestamp = unix2gentime(val->timestamp, error); - if (!rv2->timestamp) { - errout: - free_KRB5_KRB__SAFE(retval); - return(0); - } - rv2->usec = val->usec; - rv2->optionals |= opt_KRB5_KRB__SAFE__BODY_usec; - } - rv2->s__address = krb5_addr2KRB5_HostAddress(val->s_address, error); - if (!rv2->s__address) { - goto errout; - } - if (val->r_address) { - rv2->r__address = krb5_addr2KRB5_HostAddress(val->r_address, error); - if (!rv2->r__address) { - goto errout; - } - } - retval->cksum = krb5_checksum2KRB5_Checksum(val->checksum, error); - if (!retval->cksum) { - goto errout; - } - if (val->seq_number) { - rv2->seq__number = val->seq_number; - rv2->optionals |= opt_KRB5_KRB__SAFE__BODY_seq__number; - } - return(retval); -} diff --git a/src/lib/krb5/asn.1/ktgrq2tgrq.c b/src/lib/krb5/asn.1/ktgrq2tgrq.c deleted file mode 100644 index b0213fd52..000000000 --- a/src/lib/krb5/asn.1/ktgrq2tgrq.c +++ /dev/null @@ -1,326 +0,0 @@ -/* - * lib/krb5/asn.1/ktgrq2tgrq.c - * - * Copyright 1989,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. 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. - * - * - * Glue between Kerberos version and ISODE 6.0 version of structures. - */ - - -#include - -/*#include */ -#include -#include -#include "asn1glue.h" - -#include - -/* ISODE defines max(a,b) */ - -struct type_KRB5_KDC__REQ__BODY * -krb5_kdc_req2KRB5_KDC__REQ__BODY(val, error) -register const krb5_kdc_req *val; -register int *error; -{ - register struct type_KRB5_KDC__REQ__BODY *retval; - - retval = (struct type_KRB5_KDC__REQ__BODY *)xmalloc(sizeof(*retval)); - if (!retval) { - *error = ENOMEM; - return(0); - } - - memset(retval, 0, sizeof(*retval)); - - retval->kdc__options = - krb5_kdcoptions2KRB5_KDCOptions(val->kdc_options, - error); - if (!retval->kdc__options) { - errout: - free_KRB5_KDC__REQ__BODY(retval); - return(0); - } - if (val->client) { - retval->cname = - krb5_principal2KRB5_PrincipalName(val->client, error); - if (!retval->cname) { - goto errout; - } - } - if (val->server) { - retval->realm = krb5_data2qbuf(krb5_princ_realm(val->server)); - if (!retval->realm) { - *error = ENOMEM; - goto errout; - } - retval->sname = krb5_principal2KRB5_PrincipalName(val->server, error); - if (!retval->sname) { - goto errout; - } - } else if (val->client) { - retval->realm = krb5_data2qbuf(krb5_princ_realm(val->client)); - if (!retval->realm) { - *error = ENOMEM; - goto errout; - } - } else if (val->second_ticket && val->second_ticket[0] && - val->second_ticket[0]->server) { - retval->realm = krb5_data2qbuf(krb5_princ_realm(val->second_ticket[0]->server)); - if (!retval->realm) { - *error = ENOMEM; - goto errout; - } - } else { - *error = EINVAL; - goto errout; - } - - if (val->from) { - retval->from = unix2gentime(val->from, error); - if (!retval->from) { - goto errout; - } - } - retval->till = unix2gentime(val->till, error); - if (!retval->till) { - goto errout; - } - if (val->rtime) { - retval->rtime = unix2gentime(val->rtime, error); - if (!retval->rtime) { - goto errout; - } - } - retval->nonce = val->nonce; -#if 0 - /* XXX !@#*)@# busted ASN.1 compiler, -h2 doesn't generate compilable - code */ - retval->etype = (struct element_KRB5_8 *)malloc(sizeof(*retval->etype)+ - max(0,val->netypes-1)*sizeof(integer)); - if (!retval->etype) { - *error = ENOMEM; - goto errout; - } - for (i = 0; i < val->netypes; i++) { - retval->etype->element_KRB5_9[i] = val->etype[i]; - } - retval->etype->nelem = val->netypes; -#endif - { - register struct element_KRB5_8 *rv1 = 0, *rv2; - register int i; - - for (i = 0; i < val->netypes; i++, rv1 = rv2) { - rv2 = (struct element_KRB5_8 *) xmalloc(sizeof(*rv2)); - if (!rv2) { - *error = ENOMEM; - goto errout; - } - if (rv1) - rv1->next = rv2; - memset((char *)rv2, 0, sizeof (*rv2)); - if (!retval->etype) - retval->etype = rv2; - rv2->element_KRB5_9 = val->etype[i]; - } - } - - if (val->addresses) { - retval->addresses = - krb5_address2KRB5_HostAddresses(val->addresses, error); - if (!retval->addresses) { - goto errout; - } - } - if (val->authorization_data.ciphertext.data) { - retval->enc__authorization__data = - krb5_enc_data2KRB5_EncryptedData(&(val->authorization_data), - error); - if (!retval->enc__authorization__data) - goto errout; - } - if (val->second_ticket) { -#if 0 - /* code for -h2 structures, which generate bogus code from pepsy */ - - struct element_KRB5_10 *adtk; - krb5_ticket * const *temp; - register int i; - - /* count elements */ - for (i = 0, temp = val->second_ticket; *temp; temp++,i++); - - adtk = (struct element_KRB5_10 *)xmalloc(sizeof(*adtk) + - max(0,i-1)*sizeof(adtk->Ticket)); - if (!adtk) { - *error = ENOMEM; - goto errout; - } - memset(adtk, 0, sizeof(*adtk)); - adtk->nelem = i; - for (i = 0; i < adtk->nelem; i++) { - adtk->Ticket[i] = krb5_ticket2KRB5_Ticket(val->second_ticket[i], - error); - if (!adtk->Ticket[i]) { - while (i >= 0) { - free_KRB5_Ticket(adtk->Ticket[i]); - i--; - } - krb5_xfree(adtk); - goto errout; - } - } - retval->additional__tickets = adtk; -#endif - register struct element_KRB5_10 *adtk = 0, *rv1 = 0, *rv2; - krb5_ticket * const *temp; - register int i; - - /* count elements */ - for (i = 0, temp = val->second_ticket; *temp; temp++,i++, rv1 = rv2) { - - rv2 = (struct element_KRB5_10 *)xmalloc(sizeof(*rv2)); - if (!rv2) { - *error = ENOMEM; - goto errout; - } - if (rv1) - rv1->next = rv2; - memset((char *)rv2, 0, sizeof (*rv2)); - if (!adtk) - adtk = rv2; - - rv2->Ticket = krb5_ticket2KRB5_Ticket(val->second_ticket[i], - error); - if (!rv2->Ticket) { - for (rv1 = adtk; rv1; rv1 = rv2) { - if (rv1->Ticket) - free_KRB5_Ticket(rv1->Ticket); - rv2 = rv1->next; - krb5_xfree(rv1); - } - goto errout; - } - } - retval->additional__tickets = adtk; - } else { -#if 0 - /* this was once necessary to get around faulty optional processing */ - - struct element_KRB5_10 *adtk; - adtk = (struct element_KRB5_10 *)xmalloc(sizeof(*adtk)); - if (!adtk) { - *error = ENOMEM; - goto errout; - } - memset(adtk, 0, sizeof(*adtk)); - adtk->nelem = 0; - retval->additional__tickets = adtk; -#endif - retval->additional__tickets = 0; - } - - return retval; -} - - -struct element_KRB5_7 *krb5_pa_data2element_KRB5_7(val, error) - krb5_pa_data **val; - int *error; -{ - register struct element_KRB5_7 *retval = 0, *rv1 = 0, *rv2; - register krb5_pa_data * const *temp; - register int i; - - - *error = 0; - - if (val == 0) - return 0; - - /* count elements */ - for (i = 0, temp = val; *temp; temp++,i++, rv1 = rv2) { - - rv2 = (struct element_KRB5_7 *) xmalloc(sizeof(*rv2)); - if (!rv2) { - errout: - while (retval) { - free_KRB5_PA__DATA(retval->PA__DATA); - rv1 = retval->next; - free(retval); - retval = rv1; - } - *error = ENOMEM; - return(0); - } - if (rv1) - rv1->next = rv2; - memset((char *)rv2, 0, sizeof (*rv2)); - if (!retval) - retval = rv2; - - rv2->PA__DATA = (struct type_KRB5_PA__DATA *) - xmalloc(sizeof(*(rv2->PA__DATA))); - if (!rv2->PA__DATA) - goto errout; - rv2->PA__DATA->padata__type = val[i]->pa_type; - rv2->PA__DATA->pa__data = str2qb((char *)(val[i])->contents, - (val[i])->length, 1); - if (!rv2->PA__DATA->pa__data) { - goto errout; - } - } - if (retval == 0) - *error = ISODE_LOCAL_ERR_MISSING_PART; - return(retval); - -} - -struct type_KRB5_KDC__REQ * -krb5_kdc_req2KRB5_KDC__REQ(val, error) -register const krb5_kdc_req *val; -register int *error; -{ - register struct type_KRB5_KDC__REQ *retval; - - retval = (struct type_KRB5_KDC__REQ *)xmalloc(sizeof(*retval)); - if (!retval) { - *error = ENOMEM; - return(0); - } - memset(retval, 0, sizeof(*retval)); - retval->pvno = KRB5_PVNO; - retval->msg__type = val->msg_type; - if (val->padata) { - retval->padata = krb5_pa_data2element_KRB5_7(val->padata, error); - if (*error) { - krb5_xfree(retval); - return 0; - } - } - retval->req__body = krb5_kdc_req2KRB5_KDC__REQ__BODY(val, error); - if (!retval->req__body) { - free_KRB5_KDC__REQ(retval); - return(0); - } - return(retval); -} diff --git a/src/lib/krb5/asn.1/ktgsr2kdcr.c b/src/lib/krb5/asn.1/ktgsr2kdcr.c deleted file mode 100644 index dafe315f4..000000000 --- a/src/lib/krb5/asn.1/ktgsr2kdcr.c +++ /dev/null @@ -1,46 +0,0 @@ -/* - * lib/krb5/asn.1/ktgsr2kdcr.c - * - * Copyright 1989,1990 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. 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. - * - * - * Glue between Kerberos version and ISODE 6.0 version of structures. - */ - - -#include - -/*#include */ -#include -#include -#include "asn1glue.h" - -#include - -/* ISODE defines max(a,b) */ - -struct type_KRB5_TGS__REP * -krb5_tgs_rep2KRB5_KDC__REP(val, error) -register const krb5_kdc_rep *val; -register int *error; -{ - return (struct type_KRB5_TGS__REP *) - krb5_kdc_rep2KRB5_KDC__REP(val, error); -} diff --git a/src/lib/krb5/asn.1/ktkt2tkt.c b/src/lib/krb5/asn.1/ktkt2tkt.c deleted file mode 100644 index 488b1c854..000000000 --- a/src/lib/krb5/asn.1/ktkt2tkt.c +++ /dev/null @@ -1,72 +0,0 @@ -/* - * lib/krb5/asn.1/ktkt2tkt.c - * - * Copyright 1989,1990 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. 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. - * - * - * Glue between Kerberos version and ISODE 6.0 version of structures. - */ - - -#include - -/*#include */ -#include -#include -#include "asn1glue.h" - -#include - -/* ISODE defines max(a,b) */ - -struct type_KRB5_Ticket * -krb5_ticket2KRB5_Ticket(val, error) -register const krb5_ticket *val; -register int *error; -{ - register struct type_KRB5_Ticket *retval; - - retval = (struct type_KRB5_Ticket *)xmalloc(sizeof(*retval)); - if (!retval) { - *error = ENOMEM; - return(0); - } - memset(retval, 0, sizeof(*retval)); - - retval->tkt__vno = KRB5_PVNO; - retval->realm = krb5_data2qbuf(krb5_princ_realm(val->server)); - if (!retval->realm) { - *error = ENOMEM; - errout: - free_KRB5_Ticket(retval); - return(0); - } - retval->sname = krb5_principal2KRB5_PrincipalName(val->server, error); - if (!retval->sname) { - goto errout; - } - - retval->enc__part = krb5_enc_data2KRB5_EncryptedData(&(val->enc_part), - error); - if (!retval->enc__part) { - goto errout; - } - return(retval); -} diff --git a/src/lib/krb5/asn.1/ktran2tran.c b/src/lib/krb5/asn.1/ktran2tran.c deleted file mode 100644 index 1743c3caf..000000000 --- a/src/lib/krb5/asn.1/ktran2tran.c +++ /dev/null @@ -1,61 +0,0 @@ -/* - * lib/krb5/asn.1/ktran2tran.c - * - * Copyright 1989,1990 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. 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. - * - * - * Glue between Kerberos version and ISODE 6.0 version of structures. - */ - - -#include - -/*#include */ -#include -#include -#include "asn1glue.h" - -#include - -/* ISODE defines max(a,b) */ - -struct type_KRB5_TransitedEncoding * -krb5_transited2KRB5_TransitedEncoding(val, error) -register const krb5_transited *val; -register int *error; -{ - register struct type_KRB5_TransitedEncoding *retval; - - retval = (struct type_KRB5_TransitedEncoding *)xmalloc(sizeof(*retval)); - if (!retval) { - *error = ENOMEM; - return(0); - } - memset(retval, 0, sizeof(*retval)); - - retval->tr__type = val->tr_type; - retval->contents = krb5_data2qbuf(&val->tr_contents); - if (!retval->contents) { - *error = ENOMEM; - free_KRB5_TransitedEncoding(retval); - return(0); - } - return(retval); -} diff --git a/src/lib/krb5/asn.1/lsrq2klsrq.c b/src/lib/krb5/asn.1/lsrq2klsrq.c deleted file mode 100644 index f7b803194..000000000 --- a/src/lib/krb5/asn.1/lsrq2klsrq.c +++ /dev/null @@ -1,108 +0,0 @@ -/* - * lib/krb5/asn.1/lsrq2klsrq.c - * - * Copyright 1989,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. 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. - * - * - * Glue between Kerberos version and ISODE 6.0 version of structures. - */ - - -#include - -/*#include */ -#include -#include -#include "asn1glue.h" - -#include - -/* ISODE defines max(a,b) */ - -krb5_last_req_entry ** -KRB5_LastReq2krb5_last_req(val, error) -const struct type_KRB5_LastReq *val; -register int *error; -{ -#if 0 - /* this code is for -h2 style ISODE structures. However, pepsy - generates horribly broken when given -h2. */ - - register krb5_last_req_entry **retval; - register int i; - - /* plus one for null terminator */ - retval = (krb5_last_req_entry **) xcalloc(val->nelem + 1, - sizeof(krb5_last_req_entry *)); - if (!retval) { - *error = ENOMEM; - return(0); - } - for (i = 0; i < val->nelem; i++) { - retval[i] = (krb5_last_req_entry *) xmalloc(sizeof(*retval[i])); - if (!retval[i]) { - krb5_free_last_req(retval); - *error = ENOMEM; - return(0); - } - retval[i]->value = gentime2unix(val->element_KRB5_4[i]->lr__value, - error); - if (*error) { - /* value is zero if error, so it won't get freed... */ - krb5_free_last_req(retval); - return(0); - } - retval[i]->lr_type = val->element_KRB5_4[i]->lr__type; - } - retval[i] = 0; - return(retval); -#endif - register krb5_last_req_entry **retval; - register int i; - register const struct type_KRB5_LastReq *rv; - - for (i = 0, rv = val; rv; i++, rv = rv->next) - ; - - /* plus one for null terminator */ - retval = (krb5_last_req_entry **) xcalloc(i + 1, sizeof(*retval)); - if (!retval) { - *error = ENOMEM; - return(0); - } - for (i = 0, rv = val; rv; rv = rv->next, i++) { - retval[i] = (krb5_last_req_entry *) xmalloc(sizeof(*retval[i])); - if (!retval[i]) { - krb5_free_last_req(retval); - *error = ENOMEM; - return(0); - } - retval[i]->value = gentime2unix(rv->element_KRB5_4->lr__value, - error); - if (*error) { - /* value is zero if error, so it won't get freed... */ - krb5_free_last_req(retval); - return(0); - } - retval[i]->lr_type = rv->element_KRB5_4->lr__type; - } - retval[i] = 0; - return(retval); -} diff --git a/src/lib/krb5/asn.1/prep2kprep.c b/src/lib/krb5/asn.1/prep2kprep.c deleted file mode 100644 index 7e6308cfe..000000000 --- a/src/lib/krb5/asn.1/prep2kprep.c +++ /dev/null @@ -1,95 +0,0 @@ -/* - * lib/krb5/asn.1/prep2kprep.c - * - * Copyright 1989,1990 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. 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. - * - * - * Glue between Kerberos version and ISODE 6.0 version of structures. - */ - - -#include - -/*#include */ -#include -#include -#include "asn1glue.h" - -#include - -/* ISODE defines max(a,b) */ - -krb5_priv_enc_part * -KRB5_EncKrbPrivPart2krb5_priv_enc_part(val, error) -register const struct type_KRB5_EncKrbPrivPart *val; -register int *error; -{ - register krb5_priv_enc_part *retval; - krb5_data *temp; - - retval = (krb5_priv_enc_part *)xmalloc(sizeof(*retval)); - if (!retval) { - *error = ENOMEM; - return(0); - } - memset(retval, 0, sizeof(*retval)); - - temp = qbuf2krb5_data(val->user__data, error); - if (temp) { - retval->user_data = *temp; - krb5_xfree(temp); - } else { - krb5_xfree(retval); - return(0); - } - if (val->timestamp) { - if (!(val->optionals & opt_KRB5_EncKrbPrivPart_usec)) { - /* must have usec if we have timestamp */ - *error = ISODE_50_LOCAL_ERR_BADCOMBO; - goto errout; - } - - retval->timestamp = gentime2unix(val->timestamp, error); - if (*error) { - errout: - krb5_free_priv_enc_part(retval); - return(0); - } - retval->usec = val->usec; - } else { - retval->timestamp = 0; - retval->usec = 0; - } - retval->s_address = KRB5_HostAddress2krb5_addr(val->s__address, error); - if (!retval->s_address) { - goto errout; - } - if (val->r__address) { - retval->r_address = KRB5_HostAddress2krb5_addr(val->r__address, error); - if (!retval->r_address) { - goto errout; - } - } - if (val->optionals & opt_KRB5_EncKrbPrivPart_seq__number) { - retval->seq_number = val->seq__number; - } else - retval->seq_number = 0; - return(retval); -} diff --git a/src/lib/krb5/asn.1/prin2kprin.c b/src/lib/krb5/asn.1/prin2kprin.c deleted file mode 100644 index cf8d91412..000000000 --- a/src/lib/krb5/asn.1/prin2kprin.c +++ /dev/null @@ -1,103 +0,0 @@ -/* - * lib/krb5/asn.1/prin2kprin.c - * - * Copyright 1989,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. 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. - * - * - * Glue between Kerberos version and ISODE 6.0 version of structures. - */ - - -#include - -/*#include */ -#include -#include -#include "asn1glue.h" - -#include - -static int qbuf_to_data(val, data) -register const struct qbuf *val; -krb5_data *data; -{ - int length; - if (qb_pullup(val) != OK) - return 1; - if ((length = val->qb_forw->qb_len) > 0) { - data->data = malloc(length); - memcpy(data->data, val->qb_forw->qb_data, length); - } else { - data->data = 0; - } - data->length = length; - return 0; -} - - -krb5_principal -KRB5_PrincipalName2krb5_principal(val, realm, error) -const struct type_KRB5_PrincipalName *val; -const struct type_KRB5_Realm *realm; -register int *error; -{ - register krb5_principal retval; - register int i; - register const struct element_KRB5_6 *rv; - - retval = (krb5_principal) malloc(sizeof(krb5_principal_data)); - if (!retval) { - *error = ENOMEM; - return(0); - } - - for (i = 1, rv = val->name__string; rv->next; i++, rv = rv->next) - ; - - retval->length = i; - retval->data = (krb5_data *)malloc(i * sizeof(krb5_data)); - if (retval->data == 0) { - krb5_xfree(retval); - *error = ENOMEM; - return 0; - } - - retval->type = val->name__type; - - if (qbuf_to_data(realm, krb5_princ_realm(retval))) { - krb5_xfree(retval->data); - krb5_xfree(retval); - *error = ENOMEM; - return 0; - } - - for (i = 0, rv = val->name__string; rv; rv = rv->next, i++) - if (qbuf_to_data(rv->GeneralString, krb5_princ_component(retval, i))) { - while (--i >= 0) - free(krb5_princ_component(retval, i)->data); - *error = ENOMEM; - if (retval->realm.data) - krb5_xfree(retval->realm.data); - krb5_xfree(retval->data); - krb5_xfree(retval); - return(0); - } - return(retval); -} diff --git a/src/lib/krb5/asn.1/priv2kpriv.c b/src/lib/krb5/asn.1/priv2kpriv.c deleted file mode 100644 index b47b6e37f..000000000 --- a/src/lib/krb5/asn.1/priv2kpriv.c +++ /dev/null @@ -1,63 +0,0 @@ -/* - * lib/krb5/asn.1/priv2kpriv.c - * - * Copyright 1989,1990 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. 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. - * - * - * Glue between Kerberos version and ISODE 6.0 version of structures. - */ - - -#include - -/*#include */ -#include -#include -#include "asn1glue.h" - -#include - -/* ISODE defines max(a,b) */ - -krb5_priv * -KRB5_KRB__PRIV2krb5_priv(val, error) -register const struct type_KRB5_KRB__PRIV *val; -register int *error; -{ - register krb5_priv *retval; - krb5_enc_data *temp; - - retval = (krb5_priv *)xmalloc(sizeof(*retval)); - if (!retval) { - *error = ENOMEM; - return(0); - } - memset(retval, 0, sizeof(*retval)); - - temp = KRB5_EncryptedData2krb5_enc_data(val->enc__part, error); - if (temp) { - retval->enc_part = *temp; - krb5_xfree(temp); - } else { - krb5_xfree(retval); - return(0); - } - return(retval); -} diff --git a/src/lib/krb5/asn.1/pwd2kpwd.c b/src/lib/krb5/asn.1/pwd2kpwd.c deleted file mode 100644 index 6f2636dda..000000000 --- a/src/lib/krb5/asn.1/pwd2kpwd.c +++ /dev/null @@ -1,65 +0,0 @@ -/* - * lib/krb5/asn.1/pwd2kpwd.c - * - * Copyright 1989,1990 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. 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. - * - * - * Glue between Kerberos version and ISODE 6.0 version of structures. - */ - - -#include - -/*#include */ -#include -#include -#include "asn1glue.h" - -#include - -/* ISODE defines max(a,b) */ - -passwd_phrase_element * -KRB5_PWD__SEQ2krb5_pwd_seq(val, error) -register const struct type_KRB5_PasswdSequence *val; -register int *error; -{ - register passwd_phrase_element *retval; - - if ((retval = (passwd_phrase_element *) calloc(1, - sizeof(*retval))) == (passwd_phrase_element *) 0) { - *error = ENOMEM; - return(0); - } - - retval->passwd = qbuf2krb5_data(val->passwd, error); - if (!retval->passwd) { - krb5_xfree(retval); - return(0); - } - - retval->phrase = qbuf2krb5_data(val->phrase, error); - if (!retval->phrase) { - krb5_xfree(retval); - return(0); - } - - return(retval); -} diff --git a/src/lib/krb5/asn.1/pwds2kpwds.c b/src/lib/krb5/asn.1/pwds2kpwds.c deleted file mode 100644 index d080e05a3..000000000 --- a/src/lib/krb5/asn.1/pwds2kpwds.c +++ /dev/null @@ -1,89 +0,0 @@ -/* - * lib/krb5/asn.1/pwds2kpwds.c - * - * Copyright 1989,1990 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. 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. - * - * - * Glue between Kerberos version and ISODE 6.0 version of structures. - */ - - -#include -#include - -#include -#include -#include "asn1glue.h" - -#include - -krb5_pwd_data * -KRB5_PWD__DATA2krb5_pwd_data(val, error) -register const struct type_KRB5_PasswdData *val; -register int *error; -{ - register krb5_pwd_data *retval; - register passwd_phrase_element **element; - register struct element_KRB5_14 *seq_ptr, *rv; - register int i; - - - if ((retval = (krb5_pwd_data *) calloc (1, sizeof(*retval))) == NULL) { - fprintf(stderr, "pwds2kpwds: Unable to allocate retval space\n"); - *error = ENOMEM; - return(0); - } - - retval->sequence_count = val->passwd__sequence__count; - - seq_ptr = val->passwd__sequence; - - for (i = 0, rv = seq_ptr; rv; i++, rv = rv->next); - - /* Plus One for NULL Terminator */ - if ((element = (passwd_phrase_element **) xcalloc(i + 1, - sizeof(*element))) == NULL) { - fprintf(stderr, - "pwds2kpwds: Unable to allocate passwd_phrase_element list\n"); - *error = ENOMEM; - errout: - fprintf(stderr, "pwds2kpwds: Decode Failure\n"); - krb5_free_pwd_data(retval); - return(0); - } - - retval->element = element; - - for (i = 0, rv = seq_ptr; rv; rv = rv->next, i++) { - element[i] = KRB5_PWD__SEQ2krb5_pwd_seq(rv->PasswdSequence, - error); - if(!element[i]) { - while(i >= 0) { - krb5_free_pwd_sequences(element[i]); - i--; - } - krb5_xfree(element); - goto errout; - } - } - - - return(retval); -} diff --git a/src/lib/krb5/asn.1/qbuf2data.c b/src/lib/krb5/asn.1/qbuf2data.c deleted file mode 100644 index c4f400312..000000000 --- a/src/lib/krb5/asn.1/qbuf2data.c +++ /dev/null @@ -1,71 +0,0 @@ -/* - * lib/krb5/asn.1/qbuf2data.c - * - * Copyright 1989,1990 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. 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. - * - * - * Glue between Kerberos version and ISODE 6.0 version of structures. - */ - - -#include - -/*#include */ -#include -#include -#include "asn1glue.h" - -#include - -/* ISODE defines max(a,b) */ - -krb5_data * -qbuf2krb5_data(val, error) -const struct qbuf *val; -register int *error; -{ - krb5_data *retval; - if (qb_pullup(val) != OK) { - nomem: - *error = ENOMEM; - return(0); - } - retval = (krb5_data *)xmalloc(sizeof(*retval)); - if (!retval) { - goto nomem; - } - /* If there is no data, don't call malloc. This saves space on systems - which allocate data in response to malloc(0), and saves error checking - on systems which return NULL. */ - if ((retval->length = val->qb_forw->qb_len) == 0) { - retval->data = 0; - return retval; - } - retval->magic = 0; - retval->data = (char *)xmalloc(val->qb_forw->qb_len); - if (!retval->data) { - krb5_xfree(retval); - goto nomem; - } - memcpy(retval->data, val->qb_forw->qb_data, - val->qb_forw->qb_len); - return(retval); -} - diff --git a/src/lib/krb5/asn.1/safe2ksafe.c b/src/lib/krb5/asn.1/safe2ksafe.c deleted file mode 100644 index 84068da25..000000000 --- a/src/lib/krb5/asn.1/safe2ksafe.c +++ /dev/null @@ -1,101 +0,0 @@ -/* - * lib/krb5/asn.1/safe2ksafe.c - * - * Copyright 1989,1990 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. 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. - * - * - * Glue between Kerberos version and ISODE 6.0 version of structures. - */ - - -#include - -/*#include */ -#include -#include -#include "asn1glue.h" - -#include - -/* ISODE defines max(a,b) */ - -krb5_safe * -KRB5_KRB__SAFE2krb5_safe(val, error) -register const struct type_KRB5_KRB__SAFE *val; -register int *error; -{ - register krb5_safe *retval; - krb5_data *temp; - - retval = (krb5_safe *)xmalloc(sizeof(*retval)); - if (!retval) { - *error = ENOMEM; - return(0); - } - memset(retval, 0, sizeof(*retval)); - - temp = qbuf2krb5_data(val->safe__body->user__data, error); - if (temp) { - retval->user_data = *temp; - krb5_xfree(temp); - } else { - krb5_xfree(retval); - return(0); - } - if (val->safe__body->timestamp) { - if (!(val->safe__body->optionals & opt_KRB5_KRB__SAFE__BODY_usec)) { - /* must have usec if we have timestamp */ - *error = ISODE_50_LOCAL_ERR_BADCOMBO; - goto errout; - } - retval->timestamp = gentime2unix(val->safe__body->timestamp, error); - if (*error) { - errout: - krb5_free_safe(retval); - return(0); - } - retval->usec = val->safe__body->usec; - } else { - retval->timestamp = 0; - retval->usec = 0; - } - retval->s_address = KRB5_HostAddress2krb5_addr(val->safe__body->s__address, - error); - if (!retval->s_address) { - goto errout; - } - if (val->safe__body->r__address) { - retval->r_address = - KRB5_HostAddress2krb5_addr(val->safe__body->r__address, error); - if (!retval->r_address) { - goto errout; - } - } - retval->checksum = KRB5_Checksum2krb5_checksum(val->cksum, - error); - if (!retval->checksum) { - goto errout; - } - if (val->safe__body->optionals & opt_KRB5_KRB__SAFE__BODY_seq__number) { - retval->seq_number = val->safe__body->seq__number; - } else - retval->seq_number = 0; - return(retval); -} diff --git a/src/lib/krb5/asn.1/tgrq2ktgrq.c b/src/lib/krb5/asn.1/tgrq2ktgrq.c deleted file mode 100644 index 381b06751..000000000 --- a/src/lib/krb5/asn.1/tgrq2ktgrq.c +++ /dev/null @@ -1,277 +0,0 @@ -/* - * lib/krb5/asn.1/tgrq2ktgrq.c - * - * Copyright 1989,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. 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. - * - * - * Glue between Kerberos version and ISODE 6.0 version of structures. - */ - - -#include - -/*#include */ -#include -#include -#include "asn1glue.h" - -#include - -/* ISODE defines max(a,b) */ -#ifndef min -#define min(a,b) ((a) < (b) ? (a) : (b)) -#endif - -krb5_kdc_req * -KRB5_KDC__REQ__BODY2krb5_kdc_req(val, error) -register const struct type_KRB5_KDC__REQ__BODY *val; -register int *error; -{ - register krb5_kdc_req *retval; - krb5_enc_data *temp; - - retval = (krb5_kdc_req *)xmalloc(sizeof(*retval)); - if (!retval) { - *error = ENOMEM; - return(0); - } - memset(retval, 0, sizeof(*retval)); - - retval->kdc_options = - KRB5_KDCOptions2krb5_kdcoptions(val->kdc__options, - error); - if (*error) { - errout: - krb5_free_kdc_req(retval); - return(0); - } - if (val->cname) { - retval->client = - KRB5_PrincipalName2krb5_principal(val->cname, - val->realm, - error); - if (*error) { - goto errout; - } - } - - if (val->sname) { - retval->server = KRB5_PrincipalName2krb5_principal(val->sname, - val->realm, - error); - if (*error) { - goto errout; - } - } - - if (val->from) { - retval->from = gentime2unix(val->from, error); - if (*error) { - goto errout; - } - } - - retval->till = gentime2unix(val->till, error); - if (*error) { - goto errout; - } - if (val->rtime) { - retval->rtime = gentime2unix(val->rtime, error); - if (*error) { - goto errout; - } - } - retval->nonce = val->nonce; - -#if 0 - retval->etype = (krb5_enctype *) xmalloc(sizeof(*(retval->etype))*min(1,val->etype->nelem)); - if (!retval->etype) { - *error = ENOMEM; - goto errout; - } - /* XXX @#$#@ broken ASN.1 compiler, -h2 generates unusable code, - but the structures would be handle like so: */ - for (i = 0; i < val->etype->nelem; i++) { - retval->etype[i] = val->etype->element_KRB5_9[i]; - } - retval->netypes = val->etype->nelem; -#endif - { - register int i; - register struct element_KRB5_8 *rv; - for (i = 0, rv = val->etype; rv; i++, rv = rv->next) - ; - retval->netypes = i; - retval->etype = (krb5_enctype *) xcalloc(i+1,sizeof(*retval->etype)); - if (!retval->etype) { - *error = ENOMEM; - goto errout; - } - for (i = 0, rv = val->etype; rv; rv = rv->next, i++) - retval->etype[i] = rv->element_KRB5_9; - } - - if (val->addresses) { - retval->addresses = - KRB5_HostAddresses2krb5_address(val->addresses, error); - if (!retval->addresses) { - goto errout; - } - } - if (val->enc__authorization__data) { - temp = KRB5_EncryptedData2krb5_enc_data(val->enc__authorization__data, - error); - if (temp) { - retval->authorization_data = *temp; - krb5_xfree(temp); - } else - goto errout; - } - if (val->additional__tickets) { -#if 0 - /* code for -h2 style, which pepsy can't do right */ - - register krb5_ticket **aticks; - register struct element_KRB5_10 *tptr; - register int i; - - tptr = val->additional__tickets; - /* plus one for null terminator */ - aticks = (krb5_ticket **) xcalloc(tptr->nelem + 1, - sizeof(*aticks)); - if (!aticks) { - *error = ENOMEM; - goto errout; - } - for (i = 0; (i < tptr->nelem) && tptr->Ticket[i]; i++) { - aticks[i] = KRB5_Ticket2krb5_ticket(tptr->Ticket[i], error); - if (!aticks[i]) { - while (i >= 0) { - krb5_free_ticket(aticks[i]); - i--; - } - krb5_xfree(aticks); - goto errout; - } - } - retval->second_ticket = aticks; -#endif - register krb5_ticket **aticks; - register struct element_KRB5_10 *tptr, *rv; - register int i; - - tptr = val->additional__tickets; - for (i = 0, rv = tptr; rv; i++, rv = rv->next) - ; - - /* plus one for null terminator */ - aticks = (krb5_ticket **) xcalloc(i + 1, sizeof(*aticks)); - if (!aticks) { - *error = ENOMEM; - goto errout; - } - - for (i = 0, rv = tptr; rv; rv = rv->next, i++) { - aticks[i] = KRB5_Ticket2krb5_ticket(rv->Ticket, error); - if (!aticks[i]) { - while (i >= 0) { - krb5_free_ticket(aticks[i]); - i--; - } - krb5_xfree(aticks); - goto errout; - } - } - retval->second_ticket = aticks; - } - return retval; -} - - -krb5_pa_data ** -element_KRB5_72krb5_pa_data(val, error) - struct element_KRB5_7 *val; - register int *error; -{ - register krb5_pa_data **retval; - register int i; - register struct element_KRB5_7 *rv; - - for (i = 0, rv = val; rv; i++, rv = rv->next) - ; - - /* plus one for null terminator */ - retval = (krb5_pa_data **) xcalloc(i + 1, sizeof(*retval)); - if (!retval) { - *error = ENOMEM; - return(0); - } - for (i = 0, rv = val; rv; rv = rv->next, i++) { - if (qb_pullup(rv->PA__DATA->pa__data) != OK) { - krb5_xfree(retval); - *error = ENOMEM; - return(0); - } - retval[i] = (krb5_pa_data *) xmalloc(sizeof(*retval[i])); - if (!retval[i]) { - krb5_free_pa_data(retval); - *error = ENOMEM; - return(0); - } - retval[i]->pa_type = rv->PA__DATA->padata__type; - retval[i]->length = rv->PA__DATA->pa__data->qb_forw->qb_len; - if (retval[i]->length) { - retval[i]->contents = (unsigned char *)xmalloc(rv->PA__DATA->pa__data->qb_forw->qb_len); - if (!retval[i]->contents) { - krb5_xfree(retval[i]); - retval[i] = 0; - krb5_free_pa_data(retval); - *error = ENOMEM; - return(0); - } - memcpy(retval[i]->contents, - rv->PA__DATA->pa__data->qb_forw->qb_data, - retval[i]->length); - } - } - retval[i] = 0; - return(retval); -} - -krb5_kdc_req * -KRB5_KDC__REQ2krb5_kdc_req(val, error) -register const struct type_KRB5_KDC__REQ *val; -register int *error; -{ - register krb5_kdc_req *retval; - - if (!(retval = KRB5_KDC__REQ__BODY2krb5_kdc_req(val->req__body, error))) - return retval; - - retval->msg_type = val->msg__type; - if (val->padata) { - retval->padata = element_KRB5_72krb5_pa_data(val->padata, error); - if (!retval->padata) { - krb5_free_kdc_req(retval); - return(0); - } - } - return(retval); -} diff --git a/src/lib/krb5/asn.1/tkt2ktkt.c b/src/lib/krb5/asn.1/tkt2ktkt.c deleted file mode 100644 index ef6a26a5d..000000000 --- a/src/lib/krb5/asn.1/tkt2ktkt.c +++ /dev/null @@ -1,72 +0,0 @@ -/* - * lib/krb5/asn.1/tkt2ktkt.c - * - * Copyright 1989,1990 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. 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. - * - * - * Glue between Kerberos version and ISODE 6.0 version of structures. - */ - - -#include - -/*#include */ -#include -#include -#include "asn1glue.h" - -#include - -/* ISODE defines max(a,b) */ - -krb5_ticket * -KRB5_Ticket2krb5_ticket(val, error) -register const struct type_KRB5_Ticket *val; -register int *error; -{ - register krb5_ticket *retval; - krb5_enc_data *temp; - - retval = (krb5_ticket *)xmalloc(sizeof(*retval)); - if (!retval) { - *error = ENOMEM; - return(0); - } - memset(retval, 0, sizeof(*retval)); - - - retval->server = KRB5_PrincipalName2krb5_principal(val->sname, - val->realm, - error); - if (!retval->server) { - krb5_xfree(retval); - return(0); - } - - temp = KRB5_EncryptedData2krb5_enc_data(val->enc__part, error); - if (temp) { - retval->enc_part = *temp; - krb5_xfree(temp); - } else { - krb5_free_ticket(retval); - return(0); - } - return(retval); -} diff --git a/src/lib/krb5/asn.1/tran2ktran.c b/src/lib/krb5/asn.1/tran2ktran.c deleted file mode 100644 index 4f8bae748..000000000 --- a/src/lib/krb5/asn.1/tran2ktran.c +++ /dev/null @@ -1,64 +0,0 @@ -/* - * lib/krb5/asn.1/tran2ktran.c - * - * Copyright 1989,1990 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. 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. - * - * - * Glue between Kerberos version and ISODE 6.0 version of structures. - */ - - -#include - -/*#include */ -#include -#include -#include "asn1glue.h" - -#include - -/* ISODE defines max(a,b) */ - -krb5_transited * -KRB5_TransitedEncoding2krb5_transited(val, error) -register const struct type_KRB5_TransitedEncoding *val; -register int *error; -{ - register krb5_transited *retval; - krb5_data *temp; - - retval = (krb5_transited *)xmalloc(sizeof(*retval)); - if (!retval) { - *error = ENOMEM; - return(0); - } - memset(retval, 0, sizeof(*retval)); - - retval->tr_type = val->tr__type; - temp = qbuf2krb5_data(val->contents, error); - if (temp) { - retval->tr_contents = *temp; - krb5_xfree(temp); - } else { - krb5_xfree(retval); - return(0); - } - return(retval); -} diff --git a/src/lib/krb5/asn.1/u2gen.c b/src/lib/krb5/asn.1/u2gen.c deleted file mode 100644 index dc38c072e..000000000 --- a/src/lib/krb5/asn.1/u2gen.c +++ /dev/null @@ -1,66 +0,0 @@ -/* - * lib/krb5/asn.1/u2gen.c - * - * Copyright 1989,1990 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. 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. - * - * - * Glue between Kerberos version and ISODE 6.0 version of structures. - */ - - -#include -#include -#include /* includes */ -#include -#include "asn1glue.h" - -#include - -/* ISODE defines max(a,b) */ - -struct type_UNIV_GeneralizedTime * -unix2gentime(val, error) -const int val; -register int *error; -{ - UTCtime utc; - struct tm *tmp; - PE pe; - struct type_UNIV_GeneralizedTime *retval; - long val1 = (long) val; - - tmp = gmtime(&val1); /* convert long to tm struct */ - if (tmp->tm_year < 1900) - tmp->tm_year += 1900; - tm2ut(tmp, &utc); /* convert tm struct to utc struct */ - - pe = gent2prim(&utc); - if (!pe) { - *error = ENOMEM; - return((struct type_UNIV_GeneralizedTime *) 0); - } else - *error = 0; - retval = prim2qb(pe); - if (!retval) - *error = pe->pe_errno + ISODE_50_PE_ERR_NONE; - (void) pe_free(pe); - return(retval); -} - -- 2.26.2