*** empty log message ***
authorJohn Kohl <jtkohl@mit.edu>
Fri, 14 Dec 1990 18:26:22 +0000 (18:26 +0000)
committerJohn Kohl <jtkohl@mit.edu>
Fri, 14 Dec 1990 18:26:22 +0000 (18:26 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@1553 dc483132-0cff-0310-8789-dd5450dbe970

src/include/krb5/safepriv.h [new file with mode: 0644]
src/lib/krb5/asn.1/ktran2tran.c [new file with mode: 0644]
src/lib/krb5/asn.1/tran2ktran.c [new file with mode: 0644]
src/lib/krb5/free/f_arep_enc.c [new file with mode: 0644]
src/lib/krb5/free/f_padata.c [new file with mode: 0644]
src/lib/krb5/krb/pr_to_salt.c [new file with mode: 0644]

diff --git a/src/include/krb5/safepriv.h b/src/include/krb5/safepriv.h
new file mode 100644 (file)
index 0000000..a9898ca
--- /dev/null
@@ -0,0 +1,25 @@
+/*
+ * $Source$
+ * $Author$
+ * $Id$
+ *
+ * Copyright 1990 by the Massachusetts Institute of Technology.
+ *
+ * For copying and distribution information, please see the file
+ * <krb5/copyright.h>.
+ *
+ * #defines for SAFE and PRIV message options.
+ */
+
+#include <krb5/copyright.h>
+
+#ifndef KRB5_SAFE_PRIV__
+#define KRB5_SAFE_PRIV__
+
+#define KRB5_SAFE_NOTIME       0x1
+#define KRB5_SAFE_DOSEQUENCE   0x2
+
+#define KRB5_PRIV_NOTIME       0x1
+#define KRB5_PRIV_DOSEQUENCE   0x2
+
+#endif /* KRB5_SAFE_PRIV__ */
diff --git a/src/lib/krb5/asn.1/ktran2tran.c b/src/lib/krb5/asn.1/ktran2tran.c
new file mode 100644 (file)
index 0000000..5b038c0
--- /dev/null
@@ -0,0 +1,52 @@
+/*
+ * $Source$
+ * $Author$
+ *
+ * Copyright 1989,1990 by the Massachusetts Institute of Technology.
+ *
+ * For copying and distribution information, please see the file
+ * <krb5/copyright.h>.
+ *
+ * Glue between Kerberos version and ISODE 6.0 version of structures.
+ */
+
+#if !defined(lint) && !defined(SABER)
+static char rcsid_ktran2tran_c[] =
+"$Id$";
+#endif /* lint || saber */
+
+#include <krb5/copyright.h>
+#include <krb5/krb5.h>
+
+/*#include <time.h> */
+#include <isode/psap.h>
+#include <krb5/asn1.h>
+#include "asn1glue.h"
+
+#include <krb5/ext-proto.h>
+
+/* ISODE defines max(a,b) */
+
+struct type_KRB5_TransitedEncoding *
+krb5_transited2KRB5_TransitedEncoding(val, error)
+const register 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);
+    }
+    xbzero(retval, 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/tran2ktran.c b/src/lib/krb5/asn.1/tran2ktran.c
new file mode 100644 (file)
index 0000000..bba9512
--- /dev/null
@@ -0,0 +1,55 @@
+/*
+ * $Source$
+ * $Author$
+ *
+ * Copyright 1989,1990 by the Massachusetts Institute of Technology.
+ *
+ * For copying and distribution information, please see the file
+ * <krb5/copyright.h>.
+ *
+ * Glue between Kerberos version and ISODE 6.0 version of structures.
+ */
+
+#if !defined(lint) && !defined(SABER)
+static char rcsid_tran2ktran_c[] =
+"$Id$";
+#endif /* lint || saber */
+
+#include <krb5/copyright.h>
+#include <krb5/krb5.h>
+
+/*#include <time.h> */
+#include <isode/psap.h>
+#include <krb5/asn1.h>
+#include "asn1glue.h"
+
+#include <krb5/ext-proto.h>
+
+/* ISODE defines max(a,b) */
+
+krb5_transited *
+KRB5_TransitedEncoding2krb5_transited(val, error)
+const register 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);
+    }
+    xbzero(retval, sizeof(*retval));
+
+    retval->tr_type = val->tr__type;
+    temp = qbuf2krb5_data(val->contents, error);
+    if (temp) {
+       retval->tr_contents = *temp;
+       xfree(temp);
+    } else {
+       xfree(retval);
+       return(0);
+    }
+    return(retval);
+}
diff --git a/src/lib/krb5/free/f_arep_enc.c b/src/lib/krb5/free/f_arep_enc.c
new file mode 100644 (file)
index 0000000..be70cb1
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+ * $Source$
+ * $Author$
+ *
+ * Copyright 1990 by the Massachusetts Institute of Technology.
+ *
+ * For copying and distribution information, please see the file
+ * <krb5/copyright.h>.
+ *
+ * krb5_free_ap_rep_enc_part()
+ */
+
+#if !defined(lint) && !defined(SABER)
+static char rcsid_f_arep_enc_c [] =
+"$Id$";
+#endif /* !lint & !SABER */
+
+#include <krb5/copyright.h>
+#include <krb5/krb5.h>
+#include <krb5/ext-proto.h>
+
+void
+krb5_free_ap_rep_enc_part(val)
+krb5_ap_rep_enc_part *val;
+{
+    if (val->subkey)
+       krb5_free_keyblock(val->subkey);
+    xfree(val);
+    return;
+}
diff --git a/src/lib/krb5/free/f_padata.c b/src/lib/krb5/free/f_padata.c
new file mode 100644 (file)
index 0000000..346fd72
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+ * $Source$
+ * $Author$
+ *
+ * Copyright 1990 by the Massachusetts Institute of Technology.
+ *
+ * For copying and distribution information, please see the file
+ * <krb5/copyright.h>.
+ *
+ * krb5_free_padata()
+ */
+
+#if !defined(lint) && !defined(SABER)
+static char rcsid_f_padata_c [] =
+"$Id$";
+#endif /* !lint & !SABER */
+
+#include <krb5/copyright.h>
+#include <krb5/krb5.h>
+#include <krb5/ext-proto.h>
+
+void
+krb5_free_pa_data(val)
+krb5_pa_data **val;
+{
+    register krb5_pa_data **temp;
+
+    for (temp = val; *temp; temp++) {
+       if ((*temp)->contents)
+           xfree((*temp)->contents);
+       xfree(*temp);
+    }
+    xfree(val);
+    return;
+}
diff --git a/src/lib/krb5/krb/pr_to_salt.c b/src/lib/krb5/krb/pr_to_salt.c
new file mode 100644 (file)
index 0000000..4060202
--- /dev/null
@@ -0,0 +1,54 @@
+/*
+ * $Source$
+ * $Author$
+ *
+ * Copyright 1990 by the Massachusetts Institute of Technology.
+ *
+ * For copying and distribution information, please see the file
+ * <krb5/copyright.h>.
+ *
+ * krb5_principal2salt()
+ */
+
+#if !defined(lint) && !defined(SABER)
+static char rcsid_pr_to_salt_c[] =
+"$Id$";
+#endif  /* !lint & !SABER */
+
+#include <krb5/copyright.h>
+
+#include <krb5/krb5.h>
+#include <krb5/ext-proto.h>
+
+/*
+ * Convert a krb5_principal into the default salt for that principal.
+ */
+
+krb5_error_code
+krb5_principal2salt(pr, ret)
+krb5_const_principal pr;
+krb5_data *ret;
+{
+    int size, offset;
+    krb5_data **prp;
+    
+
+    if (pr == 0) {
+        ret->length = 0;
+        ret->data = 0;
+    } else {
+        for (size = 0, prp = pr; *prp; prp++)
+            size += (*prp)->length;
+
+        ret->length = size;
+        if (!(ret->data = malloc (size+1)))
+           return ENOMEM;
+
+        for (offset=0, prp=pr; *prp; prp++)
+        {
+            memcpy(&ret->data[offset],(*prp)->data, (*prp)->length);
+            offset += (*prp)->length;
+        }
+    }
+    return 0;
+}