summaryrefslogtreecommitdiffstats
path: root/src/lib/krb5/asn.1
diff options
context:
space:
mode:
authorTheodore Tso <tytso@mit.edu>1992-08-25 23:17:32 +0000
committerTheodore Tso <tytso@mit.edu>1992-08-25 23:17:32 +0000
commit4887ee632d73586d85fba201da5eda6f90072b12 (patch)
treea2ef0cec4cc4365e4692406597be39eba52b9dcf /src/lib/krb5/asn.1
parent11fb9bc4bf349971f4abdb5829a10dea9dfbe9bc (diff)
downloadkrb5-4887ee632d73586d85fba201da5eda6f90072b12.tar.gz
krb5-4887ee632d73586d85fba201da5eda6f90072b12.tar.xz
krb5-4887ee632d73586d85fba201da5eda6f90072b12.zip
As modified by Prasad @ ISI; PA DATA restructuring...
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@2370 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/lib/krb5/asn.1')
-rw-r--r--src/lib/krb5/asn.1/ktgrq2tgrq.c55
1 files changed, 54 insertions, 1 deletions
diff --git a/src/lib/krb5/asn.1/ktgrq2tgrq.c b/src/lib/krb5/asn.1/ktgrq2tgrq.c
index 31e6a7b9a..47f74db5f 100644
--- a/src/lib/krb5/asn.1/ktgrq2tgrq.c
+++ b/src/lib/krb5/asn.1/ktgrq2tgrq.c
@@ -226,6 +226,59 @@ register int *error;
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) {
+ if (retval)
+ free_KRB5_PA__DATA(retval);
+ *error = ENOMEM;
+ return(0);
+ }
+ if (rv1)
+ rv1->next = rv2;
+ xbzero((char *)rv2, sizeof (*rv2));
+ if (!retval)
+ retval = rv2;
+
+ rv2->PA__DATA = (struct type_KRB5_PA__DATA *)
+ xmalloc(sizeof(*(rv2->PA__DATA)));
+ if (!rv2->PA__DATA) {
+ errout:
+ if (retval)
+ free_KRB5_PA__DATA(retval);
+ *error = ENOMEM;
+ return(0);
+ }
+ 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)
const register krb5_kdc_req *val;
@@ -242,7 +295,7 @@ register int *error;
retval->pvno = KRB5_PVNO;
retval->msg__type = val->msg_type;
if (val->padata) {
- retval->padata = krb5_pa_data2KRB5_PA__DATA(val->padata, error);
+ retval->padata = krb5_pa_data2element_KRB5_7(val->padata, error);
if (*error) {
xfree(retval);
return 0;